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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1eb9830485ec82713d3e8d4d1e13ea1fdc1733c6 | airtable.py | airtable.py | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | Add quick error messaging for easier debugging | Add quick error messaging for easier debugging
| Python | mit | MeetMangrove/location-bot | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | <commit_before>import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r... | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r.json()
df = ... | <commit_before>import requests, json
import pandas as pd
class AT:
def __init__(self, base, api):
self.base = base
self.api = api
self.headers = {"Authorization": "Bearer "+self.api}
def getTable(self,table):
r = requests.get("https://api.airtable.com/v0/"+self.base+"/"+table, headers=self.headers)
j = r... |
378b5679f9ca3b814eb0a2a89e9f8045ae4bc4c1 | FunctionHandler.py | FunctionHandler.py | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | Clean up module loading printing | Clean up module loading printing
| Python | mit | HubbeKing/Hubbot_Twisted | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | <commit_before>import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
... | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
del sys.module... | <commit_before>import os, sys
from glob import glob
import GlobalVars
def LoadFunction(path, loadAs=''):
loadType = 'l'
name = path
src = __import__('Functions.' + name, globals(), locals(), [])
if loadAs != '':
name = loadAs
if name in GlobalVars.functions:
loadType = 'rel'
... |
47d69320261a3126637229c9deaf02ba425998af | members/models.py | members/models.py | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.protocols.all()
| from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.meetings_attend.all()
def absent_m... | Add attended_meetings and absent_meetings methos to User class | Add attended_meetings and absent_meetings methos to User class
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.protocols.all()
Add attended_meetings a... | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.meetings_attend.all()
def absent_m... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.protocols.all()
<commit_... | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.meetings_attend.all()
def absent_m... | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.protocols.all()
Add attended_meetings a... | <commit_before>from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
faculty_number = models.CharField(max_length=8)
def __unicode__(self):
return unicode(self.username)
def attended_meetings(self):
return self.protocols.all()
<commit_... |
b261eb0b2180ebc07ace6c1abad4ec68d6c17840 | app/__init__.py | app/__init__.py | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | Configure slacker on app initialization | Configure slacker on app initialization
| Python | apache-2.0 | pipex/gitbot,pipex/gitbot,pipex/gitbot | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webho... | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webhooks
from .webho... | <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
# Import flask and template operators
from flask import Flask, request, render_template
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_object('config.default')
# Configure webho... |
2917e089734ace4fd212ef9a16e8adf71d671312 | test/partial_double_test.py | test/partial_double_test.py | from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return(... | from doubles import allow, teardown
class User(object):
def __init__(self, name, age):
self.name = name
self._age = age
@property
def age(self):
return self._age
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(sel... | Test that only stubbed methods are altered on partial doubles. | Test that only stubbed methods are altered on partial doubles.
| Python | mit | uber/doubles | from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return(... | from doubles import allow, teardown
class User(object):
def __init__(self, name, age):
self.name = name
self._age = age
@property
def age(self):
return self._age
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(sel... | <commit_before>from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_nam... | from doubles import allow, teardown
class User(object):
def __init__(self, name, age):
self.name = name
self._age = age
@property
def age(self):
return self._age
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(sel... | from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return(... | <commit_before>from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_nam... |
efb7191428756f8ef0b85475d00297e2594eca4c | feincms/content/comments/models.py | feincms/content/comments/models.py | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | Handle posting in comments content type so the "post comment" stays in the cms framework instead of showing an external page from django.contrib.comments. | Handle posting in comments content type so the "post comment" stays in the cms framework instead of showing an external page from django.contrib.comments. | Python | bsd-3-clause | joshuajonah/feincms,feincms/feincms,matthiask/django-content-editor,matthiask/django-content-editor,hgrimelid/feincms,michaelkuty/feincms,nickburlett/feincms,hgrimelid/feincms,mjl/feincms,matthiask/django-content-editor,joshuajonah/feincms,mjl/feincms,joshuajonah/feincms,michaelkuty/feincms,nickburlett/feincms,nickburl... | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | <commit_before># ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db... | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | # ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db import models
... | <commit_before># ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
#
# Created by Martin J. Laubach on 08.01.10.
#
# ------------------------------------------------------------------------
from django.db... |
12cca87c2c84db562361ee230dfc033c31f7e0d4 | webhooks/azuremonitor/setup.py | webhooks/azuremonitor/setup.py | from setuptools import setup, find_packages
version = '5.0.0'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | from setuptools import setup, find_packages
version = '5.0.1'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | Add dependency to azure monitor | Add dependency to azure monitor
| Python | mit | alerta/alerta-contrib,alerta/alerta-contrib,alerta/alerta-contrib | from setuptools import setup, find_packages
version = '5.0.0'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | from setuptools import setup, find_packages
version = '5.0.1'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | <commit_before>from setuptools import setup, find_packages
version = '5.0.0'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trug... | from setuptools import setup, find_packages
version = '5.0.1'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | from setuptools import setup, find_packages
version = '5.0.0'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trugen.net',
pa... | <commit_before>from setuptools import setup, find_packages
version = '5.0.0'
setup(
name="alerta-azure-monitor",
version=version,
description='Alerta webhook for Azure Monitor',
url='https://github.com/alerta/alerta-contrib',
license='MIT',
author='Anton Delitsch',
author_email='anton@trug... |
b37eb87e73f049b87dcd0bf3cd3ff9be1ffaff4b | scripts/run_tests.py | scripts/run_tests.py | #!/usr/bin/env python
import optparse
import sys
from os import path
from os.path import expanduser
import unittest
import argparse
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to skip th... | #!/usr/bin/env python
import argparse
import optparse
from os import getenv, path
from os.path import expanduser
import sys
import unittest
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to... | Check APP_ENGINE env var before using hard-coded path to Google AppEngine SDK. | Check APP_ENGINE env var before using hard-coded path to Google AppEngine SDK.
| Python | apache-2.0 | hschema/schemaorg,schemaorg/schemaorg,pwz3n0/schemaorg,gkellogg/schemaorg,vholland/schemaorg,URXtech/schemaorg,schemaorg/schemaorg,cesarmarinhorj/schemaorg,sdo-sport/schemaorg,hschema/schemaorg,tfrancart/schemaorg,ya7lelkom/schemaorg,ynh/schemaorg,sdo-sport/schemaorg,twamarc/schemaorg,haonature/schemaorg,schemaorg/sche... | #!/usr/bin/env python
import optparse
import sys
from os import path
from os.path import expanduser
import unittest
import argparse
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to skip th... | #!/usr/bin/env python
import argparse
import optparse
from os import getenv, path
from os.path import expanduser
import sys
import unittest
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to... | <commit_before>#!/usr/bin/env python
import optparse
import sys
from os import path
from os.path import expanduser
import unittest
import argparse
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipba... | #!/usr/bin/env python
import argparse
import optparse
from os import getenv, path
from os.path import expanduser
import sys
import unittest
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to... | #!/usr/bin/env python
import optparse
import sys
from os import path
from os.path import expanduser
import unittest
import argparse
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipbasics to skip th... | <commit_before>#!/usr/bin/env python
import optparse
import sys
from os import path
from os.path import expanduser
import unittest
import argparse
# Simple stand-alone test runner
# - Runs independently of appengine runner
# - So we need to find the GAE library
# - Looks for tests as ./tests/test*.py
# - Use --skipba... |
f86c43e7f1d59aa2b6b8bf636c736cb36da877f9 | google/cloud/forseti/__init__.py | google/cloud/forseti/__init__.py | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | Change version number to 2.11.0. | Change version number to 2.11.0.
| Python | apache-2.0 | forseti-security/forseti-security,forseti-security/forseti-security,forseti-security/forseti-security,forseti-security/forseti-security | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | <commit_before># Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | <commit_before># Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
1a61ba3655e575cbf4d20190182654cb677bce9c | app/grandchallenge/serving/tasks.py | app/grandchallenge/serving/tasks.py | from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
try:
d = Download.objects.get(**kwargs)
d.count = F("count") + 1
d.save()
except Download.DoesNotExist:
Download.obj... | from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
d, created = Download.objects.get_or_create(**kwargs)
if not created:
d.count = F("count") + 1
d.save()
| Fix race condition in create_download | Fix race condition in create_download
| Python | apache-2.0 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
try:
d = Download.objects.get(**kwargs)
d.count = F("count") + 1
d.save()
except Download.DoesNotExist:
Download.obj... | from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
d, created = Download.objects.get_or_create(**kwargs)
if not created:
d.count = F("count") + 1
d.save()
| <commit_before>from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
try:
d = Download.objects.get(**kwargs)
d.count = F("count") + 1
d.save()
except Download.DoesNotExist:
... | from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
d, created = Download.objects.get_or_create(**kwargs)
if not created:
d.count = F("count") + 1
d.save()
| from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
try:
d = Download.objects.get(**kwargs)
d.count = F("count") + 1
d.save()
except Download.DoesNotExist:
Download.obj... | <commit_before>from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
try:
d = Download.objects.get(**kwargs)
d.count = F("count") + 1
d.save()
except Download.DoesNotExist:
... |
094b16a8088c8e7f8012465984c53e87e6e61eac | prompt_toolkit/__init__.py | prompt_toolkit/__init__.py | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | Fix typo: `meight` -> `might` | Fix typo: `meight` -> `might`
| Python | bsd-3-clause | jonathanslenders/python-prompt-toolkit | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | <commit_before>"""
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn ab... | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | """
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn about the usage.
... | <commit_before>"""
prompt_toolkit
==============
Author: Jonathan Slenders
Description: prompt_toolkit is a Library for building powerful interactive
command lines in Python. It can be a replacement for GNU
readline, but it can be much more than that.
See the examples directory to learn ab... |
8c10f7a3112ecece857ee9c3d20076377f7196a0 | upload.py | upload.py | import os
import re
import datetime
from trovebox import Trovebox
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Check that ~/.config/trovebox/default exists a... | import os
import re
import datetime
from trovebox import Trovebox
from trovebox.errors import TroveboxError
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Chec... | Use full path as album name fallback. Support all Trovebox file types. | Use full path as album name fallback. Support all Trovebox file types.
| Python | mit | nip3o/trovebox-uploader | import os
import re
import datetime
from trovebox import Trovebox
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Check that ~/.config/trovebox/default exists a... | import os
import re
import datetime
from trovebox import Trovebox
from trovebox.errors import TroveboxError
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Chec... | <commit_before>import os
import re
import datetime
from trovebox import Trovebox
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Check that ~/.config/trovebox/d... | import os
import re
import datetime
from trovebox import Trovebox
from trovebox.errors import TroveboxError
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Chec... | import os
import re
import datetime
from trovebox import Trovebox
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Check that ~/.config/trovebox/default exists a... | <commit_before>import os
import re
import datetime
from trovebox import Trovebox
def main():
try:
client = Trovebox()
client.configure(api_version=2)
except IOError, e:
print
print '!! Could not initialize Trovebox connection.'
print '!! Check that ~/.config/trovebox/d... |
b13c8b5cd0dde5d329a14b99c672307567992434 | workshop_drf/todo/serializers.py | workshop_drf/todo/serializers.py | from rest_framework import serializers
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
class Task(serializers.ModelSerializer):
class Meta:
model = models.Task
| from rest_framework import serializers
from django.contrib.auth import get_user_model
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
fields = ('id', 'name')
class Task(serializers.ModelSerializer):
owner = serializers.SlugRelatedField(
... | Add human readable owner & categories. | Add human readable owner & categories.
| Python | mit | arnlaugsson/workshop_drf,xordoquy/workshop_drf_djangoconeu2015,pombredanne/workshop_drf_djangoconeu2015 | from rest_framework import serializers
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
class Task(serializers.ModelSerializer):
class Meta:
model = models.Task
Add human readable owner & categories. | from rest_framework import serializers
from django.contrib.auth import get_user_model
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
fields = ('id', 'name')
class Task(serializers.ModelSerializer):
owner = serializers.SlugRelatedField(
... | <commit_before>from rest_framework import serializers
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
class Task(serializers.ModelSerializer):
class Meta:
model = models.Task
<commit_msg>Add human readable owner & categories.<commit_afte... | from rest_framework import serializers
from django.contrib.auth import get_user_model
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
fields = ('id', 'name')
class Task(serializers.ModelSerializer):
owner = serializers.SlugRelatedField(
... | from rest_framework import serializers
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
class Task(serializers.ModelSerializer):
class Meta:
model = models.Task
Add human readable owner & categories.from rest_framework import serializers
... | <commit_before>from rest_framework import serializers
from . import models
class Category(serializers.ModelSerializer):
class Meta:
model = models.Category
class Task(serializers.ModelSerializer):
class Meta:
model = models.Task
<commit_msg>Add human readable owner & categories.<commit_afte... |
303f7e3e623294f63e53de2a1949a8bfb4a416ab | src/wirecloudcommons/utils/transaction.py | src/wirecloudcommons/utils/transaction.py | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | Make commit_on_http_success commit for status codes from 200 to 399 and not only with 200 | Make commit_on_http_success commit for status codes from 200 to 399 and not only with 200
Signed-off-by: Álvaro Arranz García <3a7352a9ec78d7d17a9240a830621a1f159ca041@conwet.com>
| Python | agpl-3.0 | jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | <commit_before>from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on H... | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on HTTP success res... | <commit_before>from django.db.transaction import is_dirty, leave_transaction_management, rollback, commit, enter_transaction_management, managed
from django.db import DEFAULT_DB_ALIAS
from django.http import HttpResponse
def commit_on_http_success(func, using=None):
"""
This decorator activates db commit on H... |
8ddfcf45b4da91a02e12ebff2304e7ecf8a04378 | IPython/utils/importstring.py | IPython/utils/importstring.py | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | Restructure code to avoid unnecessary list slicing by using rsplit. | Restructure code to avoid unnecessary list slicing by using rsplit.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | <commit_before># encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The ... | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | # encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is... | <commit_before># encoding: utf-8
"""
A simple utility to import something by its string name.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The ... |
531974ce5d621b903608aa226110277f77918167 | tools/reset_gids.py | tools/reset_gids.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | Reset GIDs works even if user has no pub_key | Fix: Reset GIDs works even if user has no pub_key
| Python | mit | yippeecw/sfa,onelab-eu/sfa,onelab-eu/sfa,yippeecw/sfa,onelab-eu/sfa,yippeecw/sfa | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | <commit_before>#!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
def fix_u... | <commit_before>#!/usr/bin/env python
# -*- coding:utf-8 -*-
import types
from sfa.storage.model import *
from sfa.storage.alchemy import *
from sfa.trust.gid import create_uuid
from sfa.trust.hierarchy import Hierarchy
from sfa.util.xrn import Xrn
from sfa.trust.certificate import Certificate, Keypair, convert_public... |
1a069e7a8565dcd72b362d6b4c0cc3b1b981e5a6 | Streamer/iterMapper.py | Streamer/iterMapper.py | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | Improve choose_nodes method (set problem) | Improve choose_nodes method (set problem)
| Python | mit | AldurD392/SubgraphExplorer,AldurD392/SubgraphExplorer,AldurD392/SubgraphExplorer | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | <commit_before>#!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_... | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | #!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_list += t[1:]
... | <commit_before>#!/usr/bin/env python
from utils import read_input
from constants import EURISTIC_FACTOR
from collections import Counter
import sys
def choose_nodes(nodes, neighbours_iterable):
neighbours_count = len(neighbours_iterable)
unpacked_list = []
for t in neighbours_iterable:
unpacked_... |
474d7c95e5fec4a8638f1eb4ff7225f01d116308 | heap.py | heap.py | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
_heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the dat... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the da... | Revert "remove name mangling to make testing easier" | Revert "remove name mangling to make testing easier"
This reverts commit c0647badcab661e0ac6e0499c36868e516dcd2e6.
| Python | mit | DasAllFolks/PyAlgo | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
_heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the dat... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the da... | <commit_before># -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
_heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list con... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
__heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the da... | # -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
_heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list containing the dat... | <commit_before># -*- coding: utf-8 -*-
class Heap(object):
"""Implements a heap data structure in Python.
The underlying data structure used to hold the data is a list.
"""
_heap = []
def __init__(self, initial=None):
"""Creates a new heap.
Args:
initial: (Optional): A continguous list con... |
1d1a64c8a98d98a243307dd58ec3874f0369ce8f | tests/ex12_tests.py | tests/ex12_tests.py | from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
print(test_histogram)
assert_equal(test_histogram, '*\n**\n***\n')
| from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
# assert_equal(test_histogram, '*\n**\n***\n')
| Drop ex12 tests for now. | Drop ex12 tests for now.
| Python | mit | gravyboat/python-exercises | from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
print(test_histogram)
assert_equal(test_histogram, '*\n**\n***\n')
Drop ex12 tests for now. | from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
# assert_equal(test_histogram, '*\n**\n***\n')
| <commit_before>from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
print(test_histogram)
assert_equal(test_histogram, '*\n**\n***\n')
<commit_msg>Drop ex12 tests for now.<commit_after... | from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
# assert_equal(test_histogram, '*\n**\n***\n')
| from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
print(test_histogram)
assert_equal(test_histogram, '*\n**\n***\n')
Drop ex12 tests for now.from nose.tools import *
from exercises ... | <commit_before>from nose.tools import *
from exercises import ex12
def test_histogram():
'''
Test our histogram output is correct
'''
test_histogram = ex12.histogram([1, 2, 3])
print(test_histogram)
assert_equal(test_histogram, '*\n**\n***\n')
<commit_msg>Drop ex12 tests for now.<commit_after... |
13da665f07be45f5c5b9308d0219250b368810d5 | tests/test_utils.py | tests/test_utils.py | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
db.create_all... | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url, get_redirect_target
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
... | Add unit test for get_redirect_target utility function | Add unit test for get_redirect_target utility function
| Python | mit | Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
db.create_all... | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url, get_redirect_target
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
... | <commit_before>import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
... | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url, get_redirect_target
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
... | import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
db.create_all... | <commit_before>import unittest
from app import create_app, db
from app.utils import get_or_create, is_safe_url
from app.models import User
class TestUtils(unittest.TestCase):
def setUp(self):
self.app = create_app("testing")
self.app_ctx = self.app.app_context()
self.app_ctx.push()
... |
7c646414121e68b69896b5f700f65a1963977f72 | tests/test_views.py | tests/test_views.py | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urls import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user = self.ma... | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urlresolvers import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user =... | Fix for older versions of django | Fix for older versions of django | Python | isc | Bearle/django-private-chat,Bearle/django-private-chat,Bearle/django-private-chat | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urls import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user = self.ma... | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urlresolvers import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user =... | <commit_before>from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urls import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner... | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urlresolvers import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user =... | from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urls import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner_user = self.ma... | <commit_before>from test_plus.test import TestCase
from django_private_chat.views import *
from django.test import RequestFactory
from django.urls import reverse
from django_private_chat.models import *
class TestDialogListView(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.owner... |
23e984fe24428241b873b93a4ca541b69d3345d2 | nipy/labs/viz_tools/test/test_cm.py | nipy/labs/viz_tools/test/test_cm.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | Fix tests on old MPL | BUG: Fix tests on old MPL
Old MPL do not have function-defined colormaps, so the corresponding
code path cannot be tested.
| Python | bsd-3-clause | alexis-roche/nipy,nipy/nipy-labs,arokem/nipy,arokem/nipy,alexis-roche/nipy,alexis-roche/nireg,alexis-roche/register,alexis-roche/niseg,alexis-roche/nipy,bthirion/nipy,alexis-roche/nipy,bthirion/nipy,alexis-roche/register,arokem/nipy,nipy/nireg,nipy/nireg,bthirion/nipy,alexis-roche/nireg,alexis-roche/niseg,arokem/nipy,a... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | <commit_before># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=False)
impo... | <commit_before># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Smoke testing the cm module
"""
from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
mp.use('svg', warn=... |
d348c4f7c60b599e713eeeda7ed6806c5b1baae0 | tests/explorers_tests/test_additive_ou.py | tests/explorers_tests/test_additive_ou.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
import numpy as np
from chainerrl.explorers.additive_ou import AdditiveOU
class ... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
from chainer import testing
import numpy as np
from chainerrl.explorers.additive_o... | Add tests of non-scalar sigma for AddtiveOU | Add tests of non-scalar sigma for AddtiveOU
| Python | mit | toslunar/chainerrl,toslunar/chainerrl | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
import numpy as np
from chainerrl.explorers.additive_ou import AdditiveOU
class ... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
from chainer import testing
import numpy as np
from chainerrl.explorers.additive_o... | <commit_before>from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
import numpy as np
from chainerrl.explorers.additive_ou import Addi... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
from chainer import testing
import numpy as np
from chainerrl.explorers.additive_o... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
import numpy as np
from chainerrl.explorers.additive_ou import AdditiveOU
class ... | <commit_before>from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import unittest
import numpy as np
from chainerrl.explorers.additive_ou import Addi... |
0049a5b12b60e0bbd104c7d88d36d432f51a3d37 | cobe/control.py | cobe/control.py | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | Remove built-in profiling support; use cProfile from outside | Remove built-in profiling support; use cProfile from outside
| Python | mit | meska/cobe,DarkMio/cobe,LeMagnesium/cobe,meska/cobe,wodim/cobe-ng,LeMagnesium/cobe,wodim/cobe-ng,pteichman/cobe,tiagochiavericosta/cobe,DarkMio/cobe,tiagochiavericosta/cobe,pteichman/cobe | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | <commit_before>import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
... | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
help=optp... | <commit_before>import cmdparse
import commands
import logging
import optparse
import sys
parser = cmdparse.CommandParser()
parser.add_option("-b", "--brain", type="string", default="cobe.brain",
help="Specify an alternate brain file")
parser.add_option("", "--debug", action="store_true",
... |
37161832aab8ecb611f9a80e1b58fc57866cdc14 | tests/rules/test_git_remote_seturl_add.py | tests/rules/test_git_remote_seturl_add.py | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | Fix flake8 errors: E123 closing bracket does not match indentation of opening bracket's line | Fix flake8 errors: E123 closing bracket does not match indentation of opening bracket's line
| Python | mit | Clpsplug/thefuck,SimenB/thefuck,mlk/thefuck,nvbn/thefuck,nvbn/thefuck,scorphus/thefuck,scorphus/thefuck,SimenB/thefuck,Clpsplug/thefuck,mlk/thefuck | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | <commit_before>import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.m... | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize... | <commit_before>import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='git remote set-url origin url', stderr="fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.m... |
7baac2883aa6abc0f1f458882025ba1d0e9baab2 | app/migrations/versions/4ef20b76cab1_.py | app/migrations/versions/4ef20b76cab1_.py | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION postgis;")
... | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION IF NOT EXIS... | Add extra code to PostGIS migration to only create extensions if they're not already there. Drop on rollback only if extensions exist. | Add extra code to PostGIS migration to only create extensions if they're not already there. Drop on rollback only if extensions exist.
| Python | mit | openchattanooga/cpd-zones-old,openchattanooga/cpd-zones-old | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION postgis;")
... | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION IF NOT EXIS... | <commit_before>"""Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENS... | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION IF NOT EXIS... | """Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENSION postgis;")
... | <commit_before>"""Enable PostGIS
Revision ID: 4ef20b76cab1
Revises: 55004b0f00d6
Create Date: 2015-02-11 20:49:42.303864
"""
# revision identifiers, used by Alembic.
revision = '4ef20b76cab1'
down_revision = '55004b0f00d6'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute("CREATE EXTENS... |
e697743b89f262a179881e2c58e2422a146248d0 | db_cleanup.py | db_cleanup.py | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
import os, datetime
def clean_up():
# Set Django settings module.
os.... | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
# Cronjob to run on the 12th hour of every day:
# * 12 * * * PYTHONPATH=/... | Add cron information, clean up old cruft that isnt needed. | Add cron information, clean up old cruft that isnt needed.
| Python | bsd-2-clause | Justasic/StackSmash,Justasic/StackSmash | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
import os, datetime
def clean_up():
# Set Django settings module.
os.... | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
# Cronjob to run on the 12th hour of every day:
# * 12 * * * PYTHONPATH=/... | <commit_before>#!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
import os, datetime
def clean_up():
# Set Django settin... | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
# Cronjob to run on the 12th hour of every day:
# * 12 * * * PYTHONPATH=/... | #!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
import os, datetime
def clean_up():
# Set Django settings module.
os.... | <commit_before>#!/usr/bin/env python
#
# Periodic cleanup job for blog comments.
# This will remove any abandoned comments that
# may have been posted by bots and did not get
# past the captcha.
#
# Use PYTHONPATH=<StackSmash dir to manage.py> ./db_cleanup.py
#
import os, datetime
def clean_up():
# Set Django settin... |
6e6aaac438a18220db20ad480a8a82af49c44caa | pages/serializers.py | pages/serializers.py | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | Add 'view_name' to url extra kwargs | Add 'view_name' to url extra kwargs
| Python | bsd-2-clause | incuna/feincms-pages-api | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | <commit_before>from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField(... | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField('rendered_regio... | <commit_before>from rest_framework import serializers
from rest_framework.reverse import reverse
from pages import fields, mixins, models
from pages.utils import build_url
class PageSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.CharField()
regions = serializers.SerializerMethodField(... |
fb7b9618d5e54e8500efb0904913b4febf80222c | catsnap/batch/image_batch.py | catsnap/batch/image_batch.py | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_images(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_REQUE... | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_image_items(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_... | Break get_images up to match get_tags | Break get_images up to match get_tags
| Python | mit | ErinCall/catsnap,ErinCall/catsnap,ErinCall/catsnap | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_images(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_REQUE... | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_image_items(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_... | <commit_before>from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_images(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX... | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_image_items(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_... | from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_images(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX_ITEMS_TO_REQUE... | <commit_before>from __future__ import unicode_literals
from catsnap import Client, HASH_KEY
from boto.dynamodb.batch import BatchList
import json
MAX_ITEMS_TO_REQUEST = 99
def get_images(filenames):
if not filenames:
raise StopIteration
filenames = list(filenames)
unprocessed_keys = filenames[MAX... |
39d370f314431e44e7eb978865be4f7696625eec | scraper/models.py | scraper/models.py | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | Order entries in table by year, then title | Order entries in table by year, then title
| Python | mit | Spferical/cure-alzheimers-fund-tracker,Spferical/cure-alzheimers-fund-tracker,Spferical/cure-alzheimers-fund-tracker | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | <commit_before>from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
jo... | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
journal = models.... | <commit_before>from django.db import models
class Author(models.Model):
name = models.TextField()
def __str__(self):
return self.name
class Paper(models.Model):
url = models.TextField()
title = models.TextField()
citations = models.IntegerField()
abstract = models.TextField()
jo... |
9c3c5ede82b6672f23b5aec90cdbadb57ca8b92c | construi/cli.py | construi/cli.py | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | Add -T option to list available targets | Add -T option to list available targets
| Python | apache-2.0 | lstephen/construi | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | <commit_before>from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target'... | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target', metavar='TARG... | <commit_before>from .config import parse
from .target import Target
from .__version__ import __version__
from argparse import ArgumentParser
import logging
import os
import sys
def main():
setup_logging()
parser = ArgumentParser(prog='construi', description='Run construi')
parser.add_argument('target'... |
a754323facdb05b18d19a1a0365ad12e8c25ed06 | ocradmin/core/tests/test_core.py | ocradmin/core/tests/test_core.py | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | Test the presence of various tools | Test the presence of various tools
| Python | apache-2.0 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | <commit_before>"""
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self)... | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | """
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | <commit_before>"""
Core tests. Test general environment.
"""
import subprocess as sp
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.conf import settings
class CoreTest(TestCase):
def setUp(self):
pass
def tearDown(self)... |
9c5c2f916f8f8fceb38848212d7c4d8883fd2aef | polling_stations/apps/api/mixins.py | polling_stations/apps/api/mixins.py | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | Return object not array when requesting single district/station | Return object not array when requesting single district/station
If we are requesting a single polling station or district
return an object instead of an array with length 1
| Python | bsd-3-clause | DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | <commit_before>from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_cl... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | <commit_before>from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_cl... |
3d03959224de39f2c7d491bdac438c08e368fb6c | comics/comics/komistriper.py | comics/comics/komistriper.py | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-14"
class Craw... | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-24"
class Craw... | Correct start date for "Samtull" | Correct start date for "Samtull"
| Python | agpl-3.0 | jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-14"
class Craw... | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-24"
class Craw... | <commit_before># encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-1... | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-24"
class Craw... | # encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-14"
class Craw... | <commit_before># encoding: utf-8
from comics.aggregator.crawler import NettserierCrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Samtull"
language = "no"
url = "https://nettserier.no/aikomi/comic/"
rights = "Emil Åslund"
start_date = "2015-01-1... |
dcd39f2955cd80e3888458954a58203ae74dab71 | cyder/base/eav/forms.py | cyder/base/eav/forms.py | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | Set EAV form class name to match EAV model name | Set EAV form class name to match EAV model name
(for easier debugging, at least in theory)
| Python | bsd-3-clause | murrown/cyder,akeym/cyder,OSU-Net/cyder,drkitty/cyder,drkitty/cyder,zeeman/cyder,drkitty/cyder,zeeman/cyder,drkitty/cyder,akeym/cyder,murrown/cyder,murrown/cyder,murrown/cyder,zeeman/cyder,zeeman/cyder,OSU-Net/cyder,OSU-Net/cyder,OSU-Net/cyder,akeym/cyder,akeym/cyder | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | <commit_before>from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
... | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'inst... | <commit_before>from django import forms
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_TYPES
from cyder.base.eav.models import Attribute
def get_eav_form(eav_model, entity_model):
class EAVForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
... |
43e43e9f342d69bd2b0652d833e204916517efe2 | module_auto_update/migrations/10.0.2.0.0/pre-migrate.py | module_auto_update/migrations/10.0.2.0.0/pre-migrate.py | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | Rollback cursor if param exists | [FIX] module_auto_update: Rollback cursor if param exists
Without this patch, when upgrading after you have stored the deprecated features parameter, the cursor became broken and no more migrations could happen. You got this error:
Traceback (most recent call last):
File "/usr/local/bin/odoo", line 6, in <mod... | Python | agpl-3.0 | Vauxoo/server-tools,Vauxoo/server-tools,Vauxoo/server-tools | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__n... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | # -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__name__)
def mi... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import logging
from psycopg2 import IntegrityError
from odoo.addons.module_auto_update.models.module_deprecated import \
PARAM_DEPRECATED
_logger = logging.getLogger(__n... |
f6f3c7a70ff2c47adc2525c0c5868debc7e78fdd | make_a_plea/settings/production.py | make_a_plea/settings/production.py | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | Update ALLOWED_HOSTS for move to service domain | Update ALLOWED_HOSTS for move to service domain
| Python | mit | ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | <commit_before>from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD... | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD': os.environ.g... | <commit_before>from .base import *
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
GOOGLE_ANALYTICS_ID = "UA-53811587-1"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['POSTGRES_DB'],
'USER': os.environ['POSTGRES_USER'],
'PASSWORD... |
505772740004ec8c73db49b7772e15d563a27b38 | themint/__init__.py | themint/__init__.py | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | Set config logging in init to debug | Set config logging in init to debug
| Python | mit | LandRegistry/mint-alpha,LandRegistry/mint-alpha | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | <commit_before>import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INF... | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INFO)
if 'SENTRY_... | <commit_before>import os
from flask import Flask
import logging
from raven.contrib.flask import Sentry
from themint.health import Health
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
if not app.debug:
app.logger.addHandler(logging.StreamHandler())
app.logger.setLevel(logging.INF... |
82c31412190e42f98ce65d5ad1a6a9b8faad2cb6 | lcd_ticker.py | lcd_ticker.py | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
symbo... | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
a = y... | Handle when N/A comes thru the quote. | Handle when N/A comes thru the quote.
| Python | mit | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
symbo... | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
a = y... | <commit_before>#!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(sym... | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
a = y... | #!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(symbol):
symbo... | <commit_before>#!/usr/bin/env python
"""Display stock quotes on LCD"""
import ystockquote as y
from lcd import lcd_string, tn
symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE',
'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK',
'RTN']
def compact_quote(sym... |
b9dde5e9fc56feaea581cecca3f919f4e053044d | brumecli/config.py | brumecli/config.py | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def load(config_file='brume.yml'):
"""Return the YAML configuration for a project based on the `config_file` template."""
template_fu... | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def env(key):
"""Return the value of the `key` environment variable."""
try:
return os.environ[key]
except KeyErr... | Move template functions out of `Config.load()` | Move template functions out of `Config.load()`
| Python | mit | flou/brume,geronimo-iia/brume | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def load(config_file='brume.yml'):
"""Return the YAML configuration for a project based on the `config_file` template."""
template_fu... | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def env(key):
"""Return the value of the `key` environment variable."""
try:
return os.environ[key]
except KeyErr... | <commit_before>import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def load(config_file='brume.yml'):
"""Return the YAML configuration for a project based on the `config_file` template."""
... | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def env(key):
"""Return the value of the `key` environment variable."""
try:
return os.environ[key]
except KeyErr... | import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def load(config_file='brume.yml'):
"""Return the YAML configuration for a project based on the `config_file` template."""
template_fu... | <commit_before>import os
import yaml
from subprocess import check_output, CalledProcessError
from colors import red
from jinja2 import Template
class Config():
@staticmethod
def load(config_file='brume.yml'):
"""Return the YAML configuration for a project based on the `config_file` template."""
... |
fe42da2e9c642c7e4f8b480012e9455ffcb294a0 | openacademy/model/openacademy_course.py | openacademy/model/openacademy_course.py | # -*- coding: utf-8 -*-
from openerp import fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to iden... | # -*- coding: utf-8 -*-
from openerp import api, fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to... | Modify copy method into inherit | [REF] openacademy: Modify copy method into inherit
| Python | apache-2.0 | deivislaya/openacademy-project | # -*- coding: utf-8 -*-
from openerp import fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to iden... | # -*- coding: utf-8 -*-
from openerp import api, fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field r... | # -*- coding: utf-8 -*-
from openerp import api, fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to... | # -*- coding: utf-8 -*-
from openerp import fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field reserved to iden... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models
'''
This module create model of Course
'''
class Course(models.Model):
'''
This class create model of Course
'''
_name = 'openacademy.course' # Model odoo name
name = fields.Char(string='Title', required=True) # Field r... |
b27a09e67d737310ec419eb76a39e667316184f0 | userprofile/forms.py | userprofile/forms.py | from datetime import datetime
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFileWidget)
... | from datetime import datetime, timedelta
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFi... | Add 24 hour waiting time for removing phone number after reservation | Add 24 hour waiting time for removing phone number after reservation
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | from datetime import datetime
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFileWidget)
... | from datetime import datetime, timedelta
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFi... | <commit_before>from datetime import datetime
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=Materi... | from datetime import datetime, timedelta
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFi... | from datetime import datetime
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=MaterialFileWidget)
... | <commit_before>from datetime import datetime
from django import forms
from news.forms import MaterialFileWidget
from .models import Profile
class ProfileSearchForm(forms.Form):
name = forms.CharField(max_length=200)
class ProfileForm(forms.ModelForm):
image = forms.FileField(required=False, widget=Materi... |
b8a1e049024289a0665c5bff3ecdf60cf3e63825 | typhon/spareice/__init__.py | typhon/spareice/__init__.py | # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
| # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.array import *
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
| Add array submodule to standard import | Add array submodule to standard import
| Python | mit | atmtools/typhon,atmtools/typhon | # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
Add array submodule to standard import | # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.array import *
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
| <commit_before># -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
<commit_msg>Add array submodule to standard ... | # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.array import *
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
| # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
Add array submodule to standard import# -*- coding: utf-8 -... | <commit_before># -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
from typhon.spareice.collocations import * # noqa
from typhon.spareice.common import * # noqa
from typhon.spareice.datasets import * # noqa
__all__ = [s for s in dir() if not s.startswith('_')]
<commit_msg>Add array submodule to standard ... |
12b46a902f1596c0559e6e7d3faf6ea7b812a800 | api/radar_api/tests/conftest.py | api/radar_api/tests/conftest.py | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | Add UKRDC_PATIENT_SEARCH_URL to test app config | Add UKRDC_PATIENT_SEARCH_URL to test app config
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | <commit_before>import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY'... | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY': ''.join(rando... | <commit_before>import string
import random
import pytest
from radar_api.app import create_app
from radar.database import db
@pytest.fixture(scope='session')
def app():
return create_app({
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': 'postgres://postgres@localhost/radar_test',
'SECRET_KEY'... |
7e60f9d7962b3795983fdf5af0605319b1447098 | whack/operations.py | whack/operations.py | import os
from whack.caching import DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if caching.enabled:
cacher = DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
else:
cacher = NoCachingStrategy()
... | import os
from whack.caching import HttpCacher, DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if not caching.enabled:
cacher = NoCachingStrategy()
elif caching.http_cache_url is not None:
# TODO: add DirectoryCacher in... | Implement HTTP caching when CLI option is set | Implement HTTP caching when CLI option is set
| Python | bsd-2-clause | mwilliamson/whack | import os
from whack.caching import DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if caching.enabled:
cacher = DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
else:
cacher = NoCachingStrategy()
... | import os
from whack.caching import HttpCacher, DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if not caching.enabled:
cacher = NoCachingStrategy()
elif caching.http_cache_url is not None:
# TODO: add DirectoryCacher in... | <commit_before>import os
from whack.caching import DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if caching.enabled:
cacher = DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
else:
cacher = NoCachingStrateg... | import os
from whack.caching import HttpCacher, DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if not caching.enabled:
cacher = NoCachingStrategy()
elif caching.http_cache_url is not None:
# TODO: add DirectoryCacher in... | import os
from whack.caching import DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if caching.enabled:
cacher = DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
else:
cacher = NoCachingStrategy()
... | <commit_before>import os
from whack.caching import DirectoryCacher, NoCachingStrategy
import whack.builder
def install(package, install_dir, caching, builder_uris, params):
if caching.enabled:
cacher = DirectoryCacher(os.path.expanduser("~/.cache/whack/builds"))
else:
cacher = NoCachingStrateg... |
73caeecd963326f4789eb3dc484e59ffb475e12f | blankspot_stats.py | blankspot_stats.py | #! /usr/bin/env python
import MapGardening
import optparse
usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--place', '-p',
default="all"
)
options, arguments = p.parse_args()
possible_tables = [
'hist_point',
'hist_poin... | #! /usr/bin/env python
"""
Calculate statistics for each study area, and prints results to stdout.
All it prints is the number of blankspots, the number of v1 nodes,
and the number of total nodes. Since I am no longer storing the blankspot
information in the hist_point table itself, these stats are no longer very inf... | Add docstring, change tables searched | Add docstring, change tables searched
| Python | mit | almccon/mapgardening,almccon/mapgardening,almccon/mapgardening,almccon/mapgardening | #! /usr/bin/env python
import MapGardening
import optparse
usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--place', '-p',
default="all"
)
options, arguments = p.parse_args()
possible_tables = [
'hist_point',
'hist_poin... | #! /usr/bin/env python
"""
Calculate statistics for each study area, and prints results to stdout.
All it prints is the number of blankspots, the number of v1 nodes,
and the number of total nodes. Since I am no longer storing the blankspot
information in the hist_point table itself, these stats are no longer very inf... | <commit_before>#! /usr/bin/env python
import MapGardening
import optparse
usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--place', '-p',
default="all"
)
options, arguments = p.parse_args()
possible_tables = [
'hist_point',
... | #! /usr/bin/env python
"""
Calculate statistics for each study area, and prints results to stdout.
All it prints is the number of blankspots, the number of v1 nodes,
and the number of total nodes. Since I am no longer storing the blankspot
information in the hist_point table itself, these stats are no longer very inf... | #! /usr/bin/env python
import MapGardening
import optparse
usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--place', '-p',
default="all"
)
options, arguments = p.parse_args()
possible_tables = [
'hist_point',
'hist_poin... | <commit_before>#! /usr/bin/env python
import MapGardening
import optparse
usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--place', '-p',
default="all"
)
options, arguments = p.parse_args()
possible_tables = [
'hist_point',
... |
b97842ecf1c8fa22b599353c1c7fe75fcf482702 | tests/test_utils.py | tests/test_utils.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import (split_translated_fieldname,
transform_translatable_fields)
from modeltrans.utils import build_localized_fieldname
from tests.app.models import Blog
class U... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import transform_translatable_fields
from modeltrans.utils import (build_localized_fieldname,
split_translated_fieldname)
from tests.app.models import Blog
class Uti... | Use proper import from utils | Use proper import from utils
| Python | bsd-3-clause | zostera/django-modeltrans,zostera/django-modeltrans | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import (split_translated_fieldname,
transform_translatable_fields)
from modeltrans.utils import build_localized_fieldname
from tests.app.models import Blog
class U... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import transform_translatable_fields
from modeltrans.utils import (build_localized_fieldname,
split_translated_fieldname)
from tests.app.models import Blog
class Uti... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import (split_translated_fieldname,
transform_translatable_fields)
from modeltrans.utils import build_localized_fieldname
from tests.app.models import... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import transform_translatable_fields
from modeltrans.utils import (build_localized_fieldname,
split_translated_fieldname)
from tests.app.models import Blog
class Uti... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import (split_translated_fieldname,
transform_translatable_fields)
from modeltrans.utils import build_localized_fieldname
from tests.app.models import Blog
class U... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from modeltrans.manager import (split_translated_fieldname,
transform_translatable_fields)
from modeltrans.utils import build_localized_fieldname
from tests.app.models import... |
a9d4fab047249fbf5db26385779902d0f7483057 | qsimcirq/__init__.py | qsimcirq/__init__.py | from .qsim_circuit import *
from .qsim_simulator import *
from .qsimh_simulator import *
| from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit
from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator
from .qsimh_simulator import QSimhSimulator
| Replace star imports to fix mypy issue. | Replace star imports to fix mypy issue.
| Python | apache-2.0 | quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim | from .qsim_circuit import *
from .qsim_simulator import *
from .qsimh_simulator import *
Replace star imports to fix mypy issue. | from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit
from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator
from .qsimh_simulator import QSimhSimulator
| <commit_before>from .qsim_circuit import *
from .qsim_simulator import *
from .qsimh_simulator import *
<commit_msg>Replace star imports to fix mypy issue.<commit_after> | from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit
from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator
from .qsimh_simulator import QSimhSimulator
| from .qsim_circuit import *
from .qsim_simulator import *
from .qsimh_simulator import *
Replace star imports to fix mypy issue.from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit
from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator
from .qsimh_simulator imp... | <commit_before>from .qsim_circuit import *
from .qsim_simulator import *
from .qsimh_simulator import *
<commit_msg>Replace star imports to fix mypy issue.<commit_after>from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit
from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult... |
f5592efd0cf780c6e97483a16820f98478be8e3d | devil/devil/android/sdk/version_codes.py | devil/devil/android/sdk/version_codes.py | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | Add NOUGAT version code constant. | Add NOUGAT version code constant.
Review-Url: https://codereview.chromium.org/2386453002
| Python | bsd-3-clause | sahiljain/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,sahiljain/catapult,sahiljain/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,benschmaus/catapult,benschmaus/catapult,sahiljain/catap... | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | <commit_before># Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 ... | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | # Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 = 17
JELLY_BEAN... | <commit_before># Copyright 2015 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.
"""Android SDK version codes.
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
"""
JELLY_BEAN = 16
JELLY_BEAN_MR1 ... |
881a57be20adb82eb7632bcd8282b0971c2793f7 | test/test.py | test/test.py | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"expect hello.tcl"
]
def... | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"tclsh hello.tcl"
]
def ... | Use tclsh. Old habits die hard :) | Use tclsh. Old habits die hard :)
| Python | mit | luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github,luke-ho/hello-github | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"expect hello.tcl"
]
def... | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"tclsh hello.tcl"
]
def ... | <commit_before>#!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"expect hell... | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"tclsh hello.tcl"
]
def ... | #!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"expect hello.tcl"
]
def... | <commit_before>#!/usr/bin/python
import os
import re
import commands
successRE = re.compile("Hello, GitHub!")
testsPassed = 0
# Add more tests here
tests = [
"bin/hello_c",
"bin/hello_cpp",
"java -cp bin hello",
"python hello.py",
"ruby hello.rb",
"perl hello.pl",
"sh hello.sh",
"expect hell... |
8dbf6f4c581430ae7393d1ed0c5f0b377ffebd7e | doc/examples/plot_match_face_template.py | doc/examples/plot_match_face_template.py | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | Fix shape unpacking ((height, width), not (w, h)). | Fix shape unpacking ((height, width), not (w, h)).
| Python | bsd-3-clause | rjeli/scikit-image,Midafi/scikit-image,ofgulban/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,michaelpacer/scikit-image,chriscrosscutler/scikit-image,Hiyorimi/scikit-image,almarklein/scikit-image,paalge/scikit-image,emon10005/scikit-image,SamHames/scikit-image,emmanuelle/scikits.image,jwiggins/scikit-i... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | <commit_before>"""
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | """
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds to the head lo... | <commit_before>"""
=================
Template Matching
=================
In this example, we use template matching to identify the occurrence of an
image patch (in this case, a sub-image centered on the camera man's head).
Since there's only a single match, the maximum value in the `match_template`
result` corresponds... |
70863101a882eee0811460cf9bf0f8442d9b0775 | djproxy/urls.py | djproxy/urls.py | from django.conf.urls import patterns
from djproxy.views import HttpProxy
def generate_routes(config):
routes = []
for service_name, proxy_config in config.items():
ProxyClass = type(
'ProxyClass',
(HttpProxy, ),
{'base_url': proxy_config['base_url']}
)
... | import re
from django.conf.urls import patterns, url
from djproxy.views import HttpProxy
def generate_routes(config):
routes = ()
for service_name, proxy_config in config.items():
base_url = proxy_config['base_url']
prefix = proxy_config['prefix']
ProxyClass = type('ProxyClass', (Ht... | Return a `patterns` rather than a list of tuples | Return a `patterns` rather than a list of tuples
| Python | mit | thomasw/djproxy | from django.conf.urls import patterns
from djproxy.views import HttpProxy
def generate_routes(config):
routes = []
for service_name, proxy_config in config.items():
ProxyClass = type(
'ProxyClass',
(HttpProxy, ),
{'base_url': proxy_config['base_url']}
)
... | import re
from django.conf.urls import patterns, url
from djproxy.views import HttpProxy
def generate_routes(config):
routes = ()
for service_name, proxy_config in config.items():
base_url = proxy_config['base_url']
prefix = proxy_config['prefix']
ProxyClass = type('ProxyClass', (Ht... | <commit_before>from django.conf.urls import patterns
from djproxy.views import HttpProxy
def generate_routes(config):
routes = []
for service_name, proxy_config in config.items():
ProxyClass = type(
'ProxyClass',
(HttpProxy, ),
{'base_url': proxy_config['base_url']}... | import re
from django.conf.urls import patterns, url
from djproxy.views import HttpProxy
def generate_routes(config):
routes = ()
for service_name, proxy_config in config.items():
base_url = proxy_config['base_url']
prefix = proxy_config['prefix']
ProxyClass = type('ProxyClass', (Ht... | from django.conf.urls import patterns
from djproxy.views import HttpProxy
def generate_routes(config):
routes = []
for service_name, proxy_config in config.items():
ProxyClass = type(
'ProxyClass',
(HttpProxy, ),
{'base_url': proxy_config['base_url']}
)
... | <commit_before>from django.conf.urls import patterns
from djproxy.views import HttpProxy
def generate_routes(config):
routes = []
for service_name, proxy_config in config.items():
ProxyClass = type(
'ProxyClass',
(HttpProxy, ),
{'base_url': proxy_config['base_url']}... |
48ef416352870ae5c695ada006f1855d03d893df | dlexperiment.py | dlexperiment.py | class Experiment(object):
def __init__(self, epochs=1):
self.epochs = epochs
def get_epochs(self):
return self.epochs
def train(self):
raise NotImplementedError
def test(self):
raise NotImplementedError
def set_loss(self):
raise NotImplementedError
de... | class Experiment(object):
def __init__(self, model, optimizer, train_data, test_data, epochs=1):
self.model = model
self.optimizer = optimizer
self.train_data = train_data
self.test_data = test_data
self.epochs = epochs
self.loss = 0
self.current_epoch = 0
... | Add necessary params to Experiment. | Add necessary params to Experiment.
| Python | apache-2.0 | sagelywizard/dlex | class Experiment(object):
def __init__(self, epochs=1):
self.epochs = epochs
def get_epochs(self):
return self.epochs
def train(self):
raise NotImplementedError
def test(self):
raise NotImplementedError
def set_loss(self):
raise NotImplementedError
de... | class Experiment(object):
def __init__(self, model, optimizer, train_data, test_data, epochs=1):
self.model = model
self.optimizer = optimizer
self.train_data = train_data
self.test_data = test_data
self.epochs = epochs
self.loss = 0
self.current_epoch = 0
... | <commit_before>class Experiment(object):
def __init__(self, epochs=1):
self.epochs = epochs
def get_epochs(self):
return self.epochs
def train(self):
raise NotImplementedError
def test(self):
raise NotImplementedError
def set_loss(self):
raise NotImplement... | class Experiment(object):
def __init__(self, model, optimizer, train_data, test_data, epochs=1):
self.model = model
self.optimizer = optimizer
self.train_data = train_data
self.test_data = test_data
self.epochs = epochs
self.loss = 0
self.current_epoch = 0
... | class Experiment(object):
def __init__(self, epochs=1):
self.epochs = epochs
def get_epochs(self):
return self.epochs
def train(self):
raise NotImplementedError
def test(self):
raise NotImplementedError
def set_loss(self):
raise NotImplementedError
de... | <commit_before>class Experiment(object):
def __init__(self, epochs=1):
self.epochs = epochs
def get_epochs(self):
return self.epochs
def train(self):
raise NotImplementedError
def test(self):
raise NotImplementedError
def set_loss(self):
raise NotImplement... |
05e8170326c5aa2be48eee5f90ab5a3919775e01 | io_EDM/__init__.py | io_EDM/__init__.py |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... | Remove potential duplicate registration code | Remove potential duplicate registration code
Was sometimes causing an error when importing the project
| Python | mit | ndevenish/Blender_ioEDM,ndevenish/Blender_ioEDM |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... | <commit_before>
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
... |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... |
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
from .io_oper... | <commit_before>
bl_info = {
'name': "Import: .EDM model files",
'description': "Importing of .EDM model files",
'author': "Nicholas Devenish",
'version': (0,0,1),
'blender': (2, 78, 0),
'location': "File > Import/Export > .EDM Files",
'category': 'Import-Export',
}
try:
import bpy
def register():
... |
f8fe7041d209bb83e8483180824ffa73ceaa5f52 | ckanny/__init__.py | ckanny/__init__.py | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | Move version num to own line | Move version num to own line | Python | mit | reubano/ckanny,reubano/ckanny | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | <commit_before># -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute_import, divisi... | <commit_before># -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanny
~~~~~~
Miscellaneous CKAN utility scripts
Examples:
literal blocks::
python example_google.py
Attributes:
module_level_variable1 (int): Module level variables may be documented in
"""
from __future__ import (
absolute... |
899cf1aa2bc274602a7f9b2ef315ed67239f955a | examples/inprocess/embedded_qtconsole.py | examples/inprocess/embedded_qtconsole.py | import os
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
from IPython.utils import path
def print_process_id():
print 'Process ID is:'... | import os
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
def print_process_id():
print 'Process ID is:', os.getpid()
def main():
# Print the ID of the main process
print_process_id()
... | Revert config-loading change in embedding example. | Revert config-loading change in embedding example.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | import os
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
from IPython.utils import path
def print_process_id():
print 'Process ID is:'... | import os
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
def print_process_id():
print 'Process ID is:', os.getpid()
def main():
# Print the ID of the main process
print_process_id()
... | <commit_before>import os
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
from IPython.utils import path
def print_process_id():
print '... | import os
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
def print_process_id():
print 'Process ID is:', os.getpid()
def main():
# Print the ID of the main process
print_process_id()
... | import os
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
from IPython.utils import path
def print_process_id():
print 'Process ID is:'... | <commit_before>import os
from IPython.qt.console.qtconsoleapp import IPythonQtConsoleApp
from IPython.qt.console.rich_ipython_widget import RichIPythonWidget
from IPython.qt.inprocess import QtInProcessKernelManager
from IPython.lib import guisupport
from IPython.utils import path
def print_process_id():
print '... |
ae324434fb00a46eae45d8218954950947bd636c | test_board_pytest.py | test_board_pytest.py | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | Add test checking board can't get overfilled. | Add test checking board can't get overfilled.
| Python | mit | isaacarvestad/four-in-a-row | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | <commit_before>from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPie... | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | <commit_before>from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPie... |
9437b7fa2ef7f581968d6628561940dcb1e3f4ad | test_tws/__init__.py | test_tws/__init__.py | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | Implement a __getattr__() for mock_wrapper that just returns a lambda that records whatever call was attempted along with the call params. | Implement a __getattr__() for mock_wrapper that just returns a lambda that records whatever call was attempted along with the call params. | Python | bsd-3-clause | kbluck/pytws,kbluck/pytws | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | <commit_before>'''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
... | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | '''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
def __init__... | <commit_before>'''Unit test package for package "tws".'''
__copyright__ = "Copyright (c) 2008 Kevin J Bluck"
__version__ = "$Id$"
import socket
from tws import EWrapper
def test_import():
'''Verify successful import of top-level "tws" package'''
import tws
assert tws
class mock_wrapper(EWrapper):
... |
87c6a222c7e979c2e44ecf152158bfcbe3b61d2a | calaccess_processed/managers.py | calaccess_processed/managers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | Fix path to .sql files | Fix path to .sql files
| Python | mit | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS data into proc... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom managers for working with CAL-ACCESS processed data models.
"""
from __future__ import unicode_literals
import os
from django.db import models, connection
class ProcessedDataManager(models.Manager):
"""
Utilities for loading raw CAL-ACCESS... |
334b3e1bbda58439020131fe178db1e72cbf662a | 2/Solution.py | 2/Solution.py | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
current_node = ListNode(None)
head_node = current_node
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
... | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
head_node = current_node = ListNode(None)
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
p = p.next
... | Refactor build and print method | Refactor build and print method
| Python | mit | xliiauo/leetcode,xiao0720/leetcode,xiao0720/leetcode,xliiauo/leetcode,xliiauo/leetcode | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
current_node = ListNode(None)
head_node = current_node
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
... | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
head_node = current_node = ListNode(None)
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
p = p.next
... | <commit_before>from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
current_node = ListNode(None)
head_node = current_node
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p... | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
head_node = current_node = ListNode(None)
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
p = p.next
... | from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
current_node = ListNode(None)
head_node = current_node
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p.val
... | <commit_before>from ListNode import *
class Solution():
def addTwoNumbers(self, l1, l2):
current_node = ListNode(None)
head_node = current_node
carry = 0
p = l1
q = l2
while p or q or carry:
x = y = 0
if p is not None:
x = p... |
edb10e7ae1f428dade04a9976c3b3f985065d458 | settings/__init__.py | settings/__init__.py | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
from .prod import * # no... | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
except ImportError:
pass
... | Make sure prod.py is read in settings | Make sure prod.py is read in settings
| Python | mit | hTrap/junction,farhaanbukhsh/junction,ChillarAnand/junction,farhaanbukhsh/junction,akshayaurora/junction,NabeelValapra/junction,pythonindia/junction,shashisp/junction,hTrap/junction,ChillarAnand/junction,shashisp/junction,nava45/junction,NabeelValapra/junction,shashisp/junction,farhaanbukhsh/junction,akshayaurora/junct... | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
from .prod import * # no... | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
except ImportError:
pass
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
from .prod... | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
except ImportError:
pass
... | # -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
from .prod import * # no... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function
# Standard Library
import sys
if "test" in sys.argv:
print("\033[1;91mNo django tests.\033[0m")
print("Try: \033[1;33mpy.test\033[0m")
sys.exit(0)
from .common import * # noqa
try:
from .dev import * # noqa
from .prod... |
b7db1d067c8efe86a6ab39a15fef0ab878656249 | uber/__init__.py | uber/__init__.py | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | Revert "Don't make dirs on startup" | Revert "Don't make dirs on startup"
This reverts commit 17243b31fc6c8d8f4bb0dc7e11e2601800e80bb0.
| Python | agpl-3.0 | magfest/ubersystem,magfest/ubersystem,magfest/ubersystem,magfest/ubersystem | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | <commit_before>import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F40... | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F401
from uber... | <commit_before>import os
from decimal import Decimal
from pockets.autolog import log
from uber._version import __version__ # noqa: F401
def on_load():
"""
Called by sideboard when the uber plugin is loaded.
"""
# Note: The following imports have side effects
from uber import config # noqa: F40... |
84bb5fbef5c98bdee344ac9d9739f035bd9a8f7b | tooz/drivers/zake.py | tooz/drivers/zake.py | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Change inline docs about class fake storage variable | Change inline docs about class fake storage variable
Adjust the docs to better describe why a fake storage
class attribute exists and how it is used and what it
represents compared to a real zookeeper setup.
Change-Id: I255ccd83c8033266e9cee09a343468ae4e0f2bfd
| Python | apache-2.0 | citrix-openstack-build/tooz,openstack/tooz,citrix-openstack-build/tooz,openstack/tooz | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright (c) 2013-2014 Mirantis Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
40493966b989e73a07f6a33bd9e9497ae9ad9f3f | user/admin.py | user/admin.py | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | Remove password from UserAdmin fieldsets. | Ch23: Remove password from UserAdmin fieldsets.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | <commit_before>from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'ema... | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'email')
list_f... | <commit_before>from django.contrib import admin
from .models import User
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
# list view
list_display = (
'get_name',
'email',
'get_date_joined',
'is_staff',
'is_superuser')
list_display_links = ('get_name', 'ema... |
178373851bcb66487b89224f19e3c3dc887a8f95 | user_profile/urls.py | user_profile/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | Fix user_profile index page url-pattern | Fix user_profile index page url-pattern
| Python | mit | DeWaster/Tviserrys,DeWaster/Tviserrys | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_... | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_own_view'),
... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^', views.ViewView.as_view(), name='profile_own_view'),
url(r'^edit/', views.EditView.as_view(), name='profile_edit'),
url(r'^view/', views.ViewView.as_view(), name='profile_... |
01b15e2df498706a342009e300c77168032c7824 | fbmsgbot/bot.py | fbmsgbot/bot.py | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completio... | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message):
response, error = self.cli... | Refactor send_message to remove completion block | Refactor send_message to remove completion block
| Python | mit | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completio... | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message):
response, error = self.cli... | <commit_before>from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
... | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message):
response, error = self.cli... | from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
def _completio... | <commit_before>from http_client import HttpClient
from models.message import ReceivedMessage
class Bot():
"""
@brief Facebook messenger bot
"""
def __init__(self, token):
self.api_token = token
self.client = HttpClient(token)
def send_message(self, message, completion):
... |
c209115dfb385cc167457aa87808b21a554f63cf | yvs/set_pref.py | yvs/set_pref.py | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | Revise "set preference" notification to be clearer | Revise "set preference" notification to be clearer
Notification message originally read as though it were in the
imperative when it is meant to be in past tense.
| Python | mit | caleb531/youversion-suggest,caleb531/youversion-suggest | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | <commit_before># yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pre... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pref_set_data['val... | <commit_before># yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data(pref_set_data_str):
pref_set_data = json.loads(pref_set_data_str)
return pref_set_data['pref'], pre... |
bf53b5a1e6562162ba9c3f89568ebfeb0124249d | athenet/layers/pool.py | athenet/layers/pool.py | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | Change stride semantic in MaxPool | Change stride semantic in MaxPool
| Python | bsd-2-clause | heurezjusz/Athenet,heurezjusz/Athena | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | <commit_before>"""Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
... | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | """Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
:stride: ... | <commit_before>"""Pooling layer."""
from theano.tensor.signal import downsample
from athenet.layers import Layer
class MaxPool(Layer):
"""Max-pooling layer."""
def __init__(self, poolsize, stride=None):
"""Create max-pooling layer.
:poolsize: Pooling factor in the format (height, width).
... |
f56ed1c14b87e4d28e8e853cf64d91cf756576d1 | dashboard/tasks.py | dashboard/tasks.py | import json
import requests
from bitcoinmonitor.celeryconfig import app
from channels import Group
app.conf.beat_schedule = {
'add-every-30-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 6.0,
'args': ("dale",)
},
}
@app.task
def get_bitcoin_price(arg):
last... | import json
from bitcoinmonitor.celeryconfig import app
from channels import Group
from .helpers import get_coin_price
app.conf.beat_schedule = {
'get-bitcoin-price-every-five-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 5.0,
},
'get-litecoin-price-every-five-secon... | Create another task to get the litecoin price | Create another task to get the litecoin price
| Python | mit | alessandroHenrique/coinpricemonitor,alessandroHenrique/coinpricemonitor,alessandroHenrique/coinpricemonitor | import json
import requests
from bitcoinmonitor.celeryconfig import app
from channels import Group
app.conf.beat_schedule = {
'add-every-30-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 6.0,
'args': ("dale",)
},
}
@app.task
def get_bitcoin_price(arg):
last... | import json
from bitcoinmonitor.celeryconfig import app
from channels import Group
from .helpers import get_coin_price
app.conf.beat_schedule = {
'get-bitcoin-price-every-five-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 5.0,
},
'get-litecoin-price-every-five-secon... | <commit_before>import json
import requests
from bitcoinmonitor.celeryconfig import app
from channels import Group
app.conf.beat_schedule = {
'add-every-30-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 6.0,
'args': ("dale",)
},
}
@app.task
def get_bitcoin_price... | import json
from bitcoinmonitor.celeryconfig import app
from channels import Group
from .helpers import get_coin_price
app.conf.beat_schedule = {
'get-bitcoin-price-every-five-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 5.0,
},
'get-litecoin-price-every-five-secon... | import json
import requests
from bitcoinmonitor.celeryconfig import app
from channels import Group
app.conf.beat_schedule = {
'add-every-30-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 6.0,
'args': ("dale",)
},
}
@app.task
def get_bitcoin_price(arg):
last... | <commit_before>import json
import requests
from bitcoinmonitor.celeryconfig import app
from channels import Group
app.conf.beat_schedule = {
'add-every-30-seconds': {
'task': 'dashboard.tasks.get_bitcoin_price',
'schedule': 6.0,
'args': ("dale",)
},
}
@app.task
def get_bitcoin_price... |
8d53a7478a139770d9ffb241ec2985123c403845 | bookmarks/bookmarks/models.py | bookmarks/bookmarks/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | Remove attachment and use slack link unfurling | Remove attachment and use slack link unfurling
| Python | mit | tom-henderson/bookmarks,tom-henderson/bookmarks,tom-henderson/bookmarks | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_leng... | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_length=200, blank=T... | <commit_before>from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.dispatch import receiver
from django.conf import settings
from taggit.managers import TaggableManager
import requests
class Bookmark(models.Model):
title = models.CharField(max_leng... |
b9e2418e90ba61905aacf37d254e2718124aba77 | apps/graphing/tests/__init__.py | apps/graphing/tests/__init__.py | from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
from views import *
| from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
# actually, to prevent getting swamped by email error
# logs, i'll comment this out until it's fixed
# from views import *
| Disable graphing unit tests until we fix logger.error conditions | Disable graphing unit tests until we fix logger.error conditions
| Python | bsd-3-clause | SEL-Columbia/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedso... | from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
from views import *
Disable graphing unit tests until we fix logger.error conditions | from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
# actually, to prevent getting swamped by email error
# logs, i'll comment this out until it's fixed
# from views import *
| <commit_before>from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
from views import *
<commit_msg>Disable graphing unit tests until we fix logger.error conditions<commit_after> | from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
# actually, to prevent getting swamped by email error
# logs, i'll comment this out until it's fixed
# from views import *
| from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
from views import *
Disable graphing unit tests until we fix logger.error conditionsfrom basic import *
# this generates a lot of non-exception generating errors
# all the mo... | <commit_before>from basic import *
# this generates a lot of non-exception generating errors
# all the more incentive to fix these tests up sooner!
# TODO - fix
from views import *
<commit_msg>Disable graphing unit tests until we fix logger.error conditions<commit_after>from basic import *
# this generates a lot of non... |
abe9be5cc9789b7b1c091f08b23655f903d71fb2 | apps/impala/src/impala/tests.py | apps/impala/src/impala/tests.py | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | Fix test looking for Impala icon | [impala] Fix test looking for Impala icon
Use regexp in tests for matching white spaces and new lines
| Python | apache-2.0 | xiangel/hue,xiangel/hue,GitHublong/hue,kawamon/hue,kawamon/hue,rahul67/hue,cloudera/hue,lumig242/Hue-Integration-with-CDAP,dulems/hue,xq262144/hue,sanjeevtripurari/hue,epssy/hue,rahul67/hue,pwong-mapr/private-hue,x303597316/hue,ahmed-mahran/hue,epssy/hue,ChenJunor/hue,sanjeevtripurari/hue,abhishek-ch/hue,epssy/hue,xian... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | <commit_before>#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | <commit_before>#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
4cfa123da2ccf416e2cb7e4bd9bc0c189a06081b | tests/__init__.py | tests/__init__.py | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | Add test logger if not added by nose | Add test logger if not added by nose
| Python | apache-2.0 | jregovic/python-driver,thobbs/python-driver,mobify/python-driver,stef1927/python-driver,stef1927/python-driver,coldeasy/python-driver,thelastpickle/python-driver,beobal/python-driver,bbirand/python-driver,HackerEarth/cassandra-python-driver,yi719/python-driver,HackerEarth/cassandra-python-driver,thelastpickle/python-dr... | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | <commit_before># Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | <commit_before># Copyright 2013-2014 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
5841590444d202e6fb1fe8d7d937807ff9805677 | astropy/table/tests/test_row.py | astropy/table/tests/test_row.py | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
def test_subclass(self):
"""Row is subclass of ndarray and Row"""
table = Table([self.a, self.b]... | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
self.t = Table([self.a, self.b])
def test_subclass(self):
"""Row is subclass of ndarray and Row"... | Add a (skipped) test for row slice assignment. | Add a (skipped) test for row slice assignment.
E. Bray requested the ability to assign to a table via a row with
slice assignment, e.g.
row = table[2]
row[2:5] = [2, 3, 4]
row[:] = 3
This does not currently work because np.void (which is what numpy
returns for structured array row access) does not support slice
assi... | Python | bsd-3-clause | bsipocz/astropy,lpsinger/astropy,MSeifert04/astropy,larrybradley/astropy,bsipocz/astropy,astropy/astropy,kelle/astropy,DougBurke/astropy,stargaser/astropy,dhomeier/astropy,lpsinger/astropy,pllim/astropy,dhomeier/astropy,DougBurke/astropy,lpsinger/astropy,astropy/astropy,tbabej/astropy,joergdietrich/astropy,funbaker/ast... | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
def test_subclass(self):
"""Row is subclass of ndarray and Row"""
table = Table([self.a, self.b]... | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
self.t = Table([self.a, self.b])
def test_subclass(self):
"""Row is subclass of ndarray and Row"... | <commit_before>import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
def test_subclass(self):
"""Row is subclass of ndarray and Row"""
table = Table([... | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
self.t = Table([self.a, self.b])
def test_subclass(self):
"""Row is subclass of ndarray and Row"... | import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
def test_subclass(self):
"""Row is subclass of ndarray and Row"""
table = Table([self.a, self.b]... | <commit_before>import pytest
import numpy as np
from .. import Column, Row, Table
class TestRow():
def setup_method(self, method):
self.a = Column('a', [1, 2, 3])
self.b = Column('b', [4, 5, 6])
def test_subclass(self):
"""Row is subclass of ndarray and Row"""
table = Table([... |
7faeebea3186443055cd8dd5e02137339c048ac9 | src/ggrc_basic_permissions/roles/ProgramOwner.py | src/ggrc_basic_permissions/roles/ProgramOwner.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | Add support for creating snapshots for program owner | Add support for creating snapshots for program owner
| Python | apache-2.0 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a pers... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a person
creates a ... | <commit_before># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "Private Program"
description = """
User with authorization to peform administrative tasks such as associating
users to roles within the scope of of a program.<br/><br/>When a pers... |
ce95fbb56d7b331c0d1f55f6f6f8fc32b1e0f135 | datastories/admin.py | datastories/admin.py | from models import Story, Page, StoryPage
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Page)
admin.site.register(StoryPage)
| from models import Story, Page, StoryPage
from django.contrib import admin
class StoryAdmin(admin.ModelAdmin):
list_display = ('title', 'slug')
prepopulated_fields = dict(slug=['title'])
exclude = ('owner',)
# Uncomment the stuff below to automate keeping creator as owner
# and restricting editing to own... | Add a StoryAdmin to hide owner. | Add a StoryAdmin to hide owner.
Also has comment out code for automating owner and restrincting
editing of a story to its owner and superuser. We can decide
whether we want it later (untested).
| Python | bsd-3-clause | MAPC/masshealth,MAPC/masshealth | from models import Story, Page, StoryPage
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Page)
admin.site.register(StoryPage)
Add a StoryAdmin to hide owner.
Also has comment out code for automating owner and restrincting
editing of a story to its owner and superuser. We can decide
w... | from models import Story, Page, StoryPage
from django.contrib import admin
class StoryAdmin(admin.ModelAdmin):
list_display = ('title', 'slug')
prepopulated_fields = dict(slug=['title'])
exclude = ('owner',)
# Uncomment the stuff below to automate keeping creator as owner
# and restricting editing to own... | <commit_before>from models import Story, Page, StoryPage
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Page)
admin.site.register(StoryPage)
<commit_msg>Add a StoryAdmin to hide owner.
Also has comment out code for automating owner and restrincting
editing of a story to its owner and ... | from models import Story, Page, StoryPage
from django.contrib import admin
class StoryAdmin(admin.ModelAdmin):
list_display = ('title', 'slug')
prepopulated_fields = dict(slug=['title'])
exclude = ('owner',)
# Uncomment the stuff below to automate keeping creator as owner
# and restricting editing to own... | from models import Story, Page, StoryPage
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Page)
admin.site.register(StoryPage)
Add a StoryAdmin to hide owner.
Also has comment out code for automating owner and restrincting
editing of a story to its owner and superuser. We can decide
w... | <commit_before>from models import Story, Page, StoryPage
from django.contrib import admin
admin.site.register(Story)
admin.site.register(Page)
admin.site.register(StoryPage)
<commit_msg>Add a StoryAdmin to hide owner.
Also has comment out code for automating owner and restrincting
editing of a story to its owner and ... |
c0f37084b587e142aaadfa2c803d40bb9c4e55fe | website/project/metadata/authorizers/__init__.py | website/project/metadata/authorizers/__init__.py | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = json.load(
open(
os.path.join(HERE, 'defaults.json')
)
)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logger.info('No local.json fou... | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = None
with open(os.path.join(HERE, 'defaults.json')) as defaults:
groups = json.load(defaults)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logg... | Use context manager for filepointer management | Use context manager for filepointer management
| Python | apache-2.0 | kch8qx/osf.io,wearpants/osf.io,pattisdr/osf.io,cwisecarver/osf.io,billyhunt/osf.io,crcresearch/osf.io,baylee-d/osf.io,mfraezz/osf.io,DanielSBrown/osf.io,cwisecarver/osf.io,TomHeatwole/osf.io,sloria/osf.io,cwisecarver/osf.io,brianjgeiger/osf.io,samanehsan/osf.io,asanfilippo7/osf.io,felliott/osf.io,jnayak1/osf.io,brandon... | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = json.load(
open(
os.path.join(HERE, 'defaults.json')
)
)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logger.info('No local.json fou... | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = None
with open(os.path.join(HERE, 'defaults.json')) as defaults:
groups = json.load(defaults)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logg... | <commit_before>import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = json.load(
open(
os.path.join(HERE, 'defaults.json')
)
)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logger.info('No... | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = None
with open(os.path.join(HERE, 'defaults.json')) as defaults:
groups = json.load(defaults)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logg... | import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = json.load(
open(
os.path.join(HERE, 'defaults.json')
)
)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logger.info('No local.json fou... | <commit_before>import json
import os
import logging
logger = logging.getLogger(__name__)
HERE = os.path.dirname(os.path.realpath(__file__))
groups = json.load(
open(
os.path.join(HERE, 'defaults.json')
)
)
fp = None
try:
fp = open('{0}/local.json'.format(HERE))
except IOError:
logger.info('No... |
dbd92c4fd50f81ee23387636fddff827da8fb7f3 | dduplicated/cli.py | dduplicated/cli.py | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | Fix in output to help command. | Fix in output to help command.
Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>
| Python | mit | messiasthi/dduplicated-cli | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opat... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opat... |
b4d9fb47e040b199f88cffb4a0b761c443f390b4 | dduplicated/cli.py | dduplicated/cli.py | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | Update in output to terminal. | Update in output to terminal.
Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>
| Python | mit | messiasthi/dduplicated-cli | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from pprint import pprint
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath... |
44e50483a4ba9a4c47ee092d8d807930340c4e8e | testClient.py | testClient.py | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET
if __name__ == '__main__':
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET, EXTRA_HDR_FMTS
from testServer import CMD_SET, CMD_ADD, CMD_REPLACE
if __name__ == '_... | Allow mutation commands from the test client. | Allow mutation commands from the test client.
| Python | mit | dustin/memcached-test | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET
if __name__ == '__main__':
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET, EXTRA_HDR_FMTS
from testServer import CMD_SET, CMD_ADD, CMD_REPLACE
if __name__ == '_... | <commit_before>#!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET
if __name__ == '__main__':
s=socket.socket(socket.AF_INET, socket.S... | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET, EXTRA_HDR_FMTS
from testServer import CMD_SET, CMD_ADD, CMD_REPLACE
if __name__ == '_... | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET
if __name__ == '__main__':
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... | <commit_before>#!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import sys
import socket
import random
import struct
from testServer import REQ_MAGIC_BYTE, PKT_FMT, MIN_RECV_PACKET
if __name__ == '__main__':
s=socket.socket(socket.AF_INET, socket.S... |
a0db97549a64595cb30554ccb583f928f4ad430d | api/models.py | api/models.py | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | Fix Device model, not needed to set last_seen on creation | Fix Device model, not needed to set last_seen on creation
| Python | mit | jchmura/suchary-django,jchmura/suchary-django,jchmura/suchary-django | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | <commit_before>import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
... | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
model = mod... | <commit_before>import json
from django.db import models
import requests
from Suchary.settings import GCM_API_KEY
class Device(models.Model):
registration_id = models.TextField()
android_id = models.TextField(unique=True)
alias = models.TextField(blank=True)
version = models.CharField(max_length=20)
... |
83c5cc34539f68360cbab585af9465e95f3ec592 | tensorbayes/__init__.py | tensorbayes/__init__.py | from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
| import sys
from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
if 'ipykernel' in sys.argv[0]:
from . import nbutils
| Add nbutils import to base import | Add nbutils import to base import
| Python | mit | RuiShu/tensorbayes | from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
Add nbutils import to base import | import sys
from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
if 'ipykernel' in sys.argv[0]:
from . import nbutils
| <commit_before>from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
<commit_msg>Add nbutils import to base import<commit_after> | import sys
from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
if 'ipykernel' in sys.argv[0]:
from . import nbutils
| from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
Add nbutils import to base importimport sys
from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import dist... | <commit_before>from . import layers
from . import utils
from . import nputils
from . import tbutils
from . import distributions
from .utils import FileWriter
from .tbutils import function
<commit_msg>Add nbutils import to base import<commit_after>import sys
from . import layers
from . import utils
from . import nputils... |
e5812200c68a720345310e9a14ffa2a1a8f849e0 | arg-reader.py | arg-reader.py | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
import argparse
def main():
'''
For help, use argument -h
$ ./arg-reader.py -h
To specify an argument, p... | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
# http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-the-help-text
import argparse
from arg... | Format description to multiple lines using RawTextHelpFormatter. | Format description to multiple lines using RawTextHelpFormatter.
Reference:
# http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-the-help-text
| Python | mit | beepscore/argparse | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
import argparse
def main():
'''
For help, use argument -h
$ ./arg-reader.py -h
To specify an argument, p... | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
# http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-the-help-text
import argparse
from arg... | <commit_before>#!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
import argparse
def main():
'''
For help, use argument -h
$ ./arg-reader.py -h
To specify... | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
# http://stackoverflow.com/questions/3853722/python-argparse-how-to-insert-newline-the-help-text
import argparse
from arg... | #!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
import argparse
def main():
'''
For help, use argument -h
$ ./arg-reader.py -h
To specify an argument, p... | <commit_before>#!/usr/bin/env python3
# References:
# http://docs.python.org/3.3/library/argparse.html?highlight=argparse#argparse
# http://bip.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/argparse/index.html
import argparse
def main():
'''
For help, use argument -h
$ ./arg-reader.py -h
To specify... |
39c4d50b08f92a5d76ac5864e13a3427e7dfd86a | app/accounts/tests/test_models.py | app/accounts/tests/test_models.py | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | Add test for creating profile on user creation | Add test for creating profile on user creation
| Python | mit | teamtaverna/core | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | <commit_before>from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank'... | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank', password='sec... | <commit_before>from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import TestCase
from app.accounts.models import UserProfile
class UserProfileTest(TestCase):
"""Test UserProfile model"""
def setUp(self):
self.user = User.objects.create(username='frank'... |
4007508e10d730068e7f0a2ded0a7403525051a4 | checklisthq/checklisthq/urls.py | checklisthq/checklisthq/urls.py | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | Reorder URLs, catchall at the end | Reorder URLs, catchall at the end
| Python | agpl-3.0 | checklisthq/checklisthq.com,checklisthq/checklisthq.com | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | <commit_before>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user"),
url(r'^... | <commit_before>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^users/new$', 'main.views.new_user', name="new_user... |
265f36fb7fac426d662fbdebf29e8aad01e257d2 | flask_oauthlib/utils.py | flask_oauthlib/utils.py | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | Fix to_bytes when text is None | Fix to_bytes when text is None
| Python | bsd-3-clause | tonyseek/flask-oauthlib,auerj/flask-oauthlib,icook/flask-oauthlib,RealGeeks/flask-oauthlib,Fleurer/flask-oauthlib,CoreyHyllested/flask-oauthlib,huxuan/flask-oauthlib,landler/flask-oauthlib,lepture/flask-oauthlib,lepture/flask-oauthlib,tonyseek/flask-oauthlib,CommonsCloud/CommonsCloud-FlaskOAuthlib,brightforme/flask-oau... | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | <commit_before># coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
... | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | # coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
del headers['... | <commit_before># coding: utf-8
import base64
from flask import request, Response
from oauthlib.common import to_unicode, bytes_type
def extract_params():
"""Extract request params."""
uri = request.url
http_method = request.method
headers = dict(request.headers)
if 'wsgi.input' in headers:
... |
c480ed20fd5b7c5d53b4f0112feed801cd99ef9c | tests/test_data_prep.py | tests/test_data_prep.py | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | Use allclose for dataprep test | Use allclose for dataprep test
| Python | mit | tesera/pygypsy,tesera/pygypsy | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | <commit_before>import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.jo... | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.join(
DAT... | <commit_before>import os
import pandas as pd
import numpy.testing as npt
from gypsy import DATA_DIR
from gypsy.data_prep import prep_standtable
def test_prep_standtable():
data_file_name = 'raw_standtable.csv'
plot_data = pd.read_csv(os.path.join(DATA_DIR, data_file_name))
expected_data_path = os.path.jo... |
07455e5821d21c988c7c5fcda9345e99355eb4e7 | redash/__init__.py | redash/__init__.py | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | Use database number from redis url if available. | Use database number from redis url if available.
| Python | bsd-2-clause | chriszs/redash,imsally/redash,44px/redash,guaguadev/redash,denisov-vlad/redash,rockwotj/redash,44px/redash,rockwotj/redash,getredash/redash,ninneko/redash,akariv/redash,amino-data/redash,akariv/redash,imsally/redash,EverlyWell/redash,getredash/redash,easytaxibr/redash,M32Media/redash,vishesh92/redash,ninneko/redash,get... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | <commit_before>import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
sta... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=sett... | <commit_before>import json
import urlparse
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
import redis
from redash import settings, utils
__version__ = '0.3.2'
app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
sta... |
4139dafb967c61ac8d10b3b9fa8d64c8c079bfa2 | scripts/png2raw.py | scripts/png2raw.py | #!/usr/bin/env python
import Image
import logging
import sys
def main(argv):
pngFileName = sys.argv[1]
baseFileName, _ = pngFileName.rsplit('.')
rawFileName = '%s.raw' % baseFileName
palFileName = '%s.pal' % baseFileName
image = Image.open(pngFileName)
with open(palFileName, 'w') as palFile:
pal = ... | #!/usr/bin/env python
import Image
import argparse
import os
def main():
parser = argparse.ArgumentParser(
description='Converts input image to raw image and palette data.')
parser.add_argument('-f', '--force', action='store_true',
help='If output files exist, the tool will overwrite them.')
parser.... | Add cmdline options parser and a sanity check. | Add cmdline options parser and a sanity check.
| Python | artistic-2.0 | cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene | #!/usr/bin/env python
import Image
import logging
import sys
def main(argv):
pngFileName = sys.argv[1]
baseFileName, _ = pngFileName.rsplit('.')
rawFileName = '%s.raw' % baseFileName
palFileName = '%s.pal' % baseFileName
image = Image.open(pngFileName)
with open(palFileName, 'w') as palFile:
pal = ... | #!/usr/bin/env python
import Image
import argparse
import os
def main():
parser = argparse.ArgumentParser(
description='Converts input image to raw image and palette data.')
parser.add_argument('-f', '--force', action='store_true',
help='If output files exist, the tool will overwrite them.')
parser.... | <commit_before>#!/usr/bin/env python
import Image
import logging
import sys
def main(argv):
pngFileName = sys.argv[1]
baseFileName, _ = pngFileName.rsplit('.')
rawFileName = '%s.raw' % baseFileName
palFileName = '%s.pal' % baseFileName
image = Image.open(pngFileName)
with open(palFileName, 'w') as palF... | #!/usr/bin/env python
import Image
import argparse
import os
def main():
parser = argparse.ArgumentParser(
description='Converts input image to raw image and palette data.')
parser.add_argument('-f', '--force', action='store_true',
help='If output files exist, the tool will overwrite them.')
parser.... | #!/usr/bin/env python
import Image
import logging
import sys
def main(argv):
pngFileName = sys.argv[1]
baseFileName, _ = pngFileName.rsplit('.')
rawFileName = '%s.raw' % baseFileName
palFileName = '%s.pal' % baseFileName
image = Image.open(pngFileName)
with open(palFileName, 'w') as palFile:
pal = ... | <commit_before>#!/usr/bin/env python
import Image
import logging
import sys
def main(argv):
pngFileName = sys.argv[1]
baseFileName, _ = pngFileName.rsplit('.')
rawFileName = '%s.raw' % baseFileName
palFileName = '%s.pal' % baseFileName
image = Image.open(pngFileName)
with open(palFileName, 'w') as palF... |
3fe8498b8599238fd18b8f96edff438e1f569f48 | sheldon/storage.py | sheldon/storage.py | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | Fix typo in redis error message | Fix typo in redis error message
| Python | mit | lises/sheldon | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | <commit_before># -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | # -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self, bot):
... | <commit_before># -*- coding: utf-8 -*-
"""
Interface to Redis-storage.
@author: Seva Zhidkov
@contact: zhidkovseva@gmail.com
@license: The MIT license
Copyright (C) 2015
"""
from .utils import logger
# We will catch all import exceptions in bot.py
from redis import StrictRedis
class Storage:
def __init__(self... |
f1b1542b28b83f7adabbadc7e2932ed8b42aa8c3 | main/_config.py | main/_config.py | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (units in seconds)
... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 10
# Cache Settings (units in seconds)... | Increase number of SoundCloud episodes pulled in | Increase number of SoundCloud episodes pulled in
This is related to the fact that unpublished episodes still pull through. | Python | apache-2.0 | vprnet/EOTS-iframe-widget,vprnet/EOTS-iframe-widget,vprnet/EOTS-iframe-widget | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (units in seconds)
... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 10
# Cache Settings (units in seconds)... | <commit_before>import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (uni... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 10
# Cache Settings (units in seconds)... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (units in seconds)
... | <commit_before>import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/app/'
SOUNDCLOUD_API = {
"client_id": "",
"client_secret": "",
"username": "",
"password": ""}
SOUNDCLOUD_NUM_TRACKS = 5
# Cache Settings (uni... |
3c4f7906f98e6dfb9afe6993bee993ed05b969f3 | apps/splash/views.py | apps/splash/views.py | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | Add method for merging duplicated events | Add method for merging duplicated events
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | <commit_before>import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base... | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base.html', {'splas... | <commit_before>import datetime
from django.shortcuts import render
from apps.splash.models import SplashEvent, SplashYear
def index(request):
# I'm really sorry ...
splash_year = SplashYear.objects.get(start_date__gt=str(datetime.date.today() - datetime.timedelta(180)))
return render(request, 'splash/base... |
7b108ec9392c70113a5f5bf04e104de1fe123815 | autosort/wrapping.py | autosort/wrapping.py | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = 0, limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if i == j or score < best and psum >= 0:
best ... | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = float('inf'), limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if score < best and (psum >= 0 or i == j):
... | Make it clearer that exactly one item allows psum < 0 | Make it clearer that exactly one item allows psum < 0
| Python | mit | fbergroth/autosort | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = 0, limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if i == j or score < best and psum >= 0:
best ... | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = float('inf'), limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if score < best and (psum >= 0 or i == j):
... | <commit_before>def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = 0, limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if i == j or score < best and psum >= 0:
... | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = float('inf'), limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if score < best and (psum >= 0 or i == j):
... | def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = 0, limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if i == j or score < best and psum >= 0:
best ... | <commit_before>def _dynamic_wrap(items, limit):
scores, trace = [0], []
for j in range(len(items)):
best, psum, index = 0, limit, -1
for i in reversed(range(j + 1)):
psum -= items[i]
score = scores[i] + psum ** 2
if i == j or score < best and psum >= 0:
... |
e0797f6dbefea651420f474940963b470a0931fd | test/functional/test_framework/txtools.py | test/functional/test_framework/txtools.py | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | Fix pad_tx off by one error + nits | Fix pad_tx off by one error + nits
Summary: See title
Test Plan: test_runner.py
Reviewers: deadalnix, schancel, #bitcoin_abc
Reviewed By: schancel, #bitcoin_abc
Subscribers: teamcity
Differential Revision: https://reviews.bitcoinabc.org/D2096
| Python | mit | Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,ftrader-bitcoinabc/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,ftrader-bitcoinabc/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,ftrader-bitcoinabc/bitcoin-abc,Bitcoin-ABC/bitcoin-abc... | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | <commit_before>from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_si... | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_size is None:
... | <commit_before>from .cdefs import MIN_TX_SIZE, MAX_TXOUT_PUBKEY_SCRIPT
from .mininode import CTransaction, FromHex, ToHex, CTxOut
from .script import OP_RETURN, CScript
import random
from binascii import hexlify, unhexlify
# Pad outputs until it reaches at least min_size
def pad_tx(tx, min_size=None):
if min_si... |
bdcecb3c96cef5b663b1ada22efa952b0882f1f0 | spacy/tests/regression/test_issue600.py | spacy/tests/regression/test_issue600.py | from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
| from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ...attrs import POS
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
| Add import in regression test | Add import in regression test
| Python | mit | Gregory-Howard/spaCy,spacy-io/spaCy,raphael0202/spaCy,explosion/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,banglakit/spaCy,banglakit/spaCy,raphael0202/spaCy,honnibal/spaCy,aikramer2/spaCy,recognai/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,explosion/spaCy,recognai/spaCy,recognai/spaCy,oroszgy/spaCy.hu,recognai/sp... | from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
Add import in regression test | from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ...attrs import POS
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
| <commit_before>from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
<commit_msg>Add import in regression test<commit_after> | from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
from ...attrs import POS
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
| from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
Add import in regression testfrom __future__ import unicode_literals
from ...tokens import Doc
from ...vocab ... | <commit_before>from __future__ import unicode_literals
from ...tokens import Doc
from ...vocab import Vocab
def test_issue600():
doc = Doc(Vocab(tag_map={'NN': {'pos': 'NOUN'}}), words=['hello'])
doc[0].tag_ = u'NN'
<commit_msg>Add import in regression test<commit_after>from __future__ import unicode_literals... |
1f3183acbe50df32d76d1cc0cb71b4cd9afdaa79 | controller/__init__.py | controller/__init__.py | # -*- coding: utf-8 -*-
import sys
__version__ = '0.6.0'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | # -*- coding: utf-8 -*-
import sys
__version__ = '0.5.1'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | Fix version with last package | Fix version with last package
| Python | mit | rapydo/do | # -*- coding: utf-8 -*-
import sys
__version__ = '0.6.0'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | # -*- coding: utf-8 -*-
import sys
__version__ = '0.5.1'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | <commit_before># -*- coding: utf-8 -*-
import sys
__version__ = '0.6.0'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2ui... | # -*- coding: utf-8 -*-
import sys
__version__ = '0.5.1'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | # -*- coding: utf-8 -*-
import sys
__version__ = '0.6.0'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2uifoza
TESTING = ... | <commit_before># -*- coding: utf-8 -*-
import sys
__version__ = '0.6.0'
FRAMEWORK_NAME = 'RAPyDo'
# PROJECT_YAML_SPECSDIR = 'specs'
COMPOSE_ENVIRONMENT_FILE = '.env'
SUBMODULES_DIR = 'submodules'
PLACEHOLDER = '#@$%-REPLACE-#@%$-ME-#@$%'
##################
# NOTE: telling the app if testing or not
# http://j.mp/2ui... |
ff13cc4b7ef29c4454abb41b8e9a525d12c9ff7d | tailorscad/tests/test_arg_parser.py | tailorscad/tests/test_arg_parser.py |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args)
def test_parse_args_inknown(self):
args = []
argv = ['... |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args.config)
def test_parse_args_inknown(self):
args = []
ar... | Fix unit tests for arg_parser | Fix unit tests for arg_parser
| Python | mit | savorywatt/tailorSCAD |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args)
def test_parse_args_inknown(self):
args = []
argv = ['... |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args.config)
def test_parse_args_inknown(self):
args = []
ar... | <commit_before>
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args)
def test_parse_args_inknown(self):
args = []
... |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args.config)
def test_parse_args_inknown(self):
args = []
ar... |
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args)
def test_parse_args_inknown(self):
args = []
argv = ['... | <commit_before>
import unittest
from tailorscad.arg_parser import parse_args
class TestArgParser(unittest.TestCase):
def test_parse_args_none(self):
args = []
argv = []
args = parse_args(argv)
self.assertFalse(args)
def test_parse_args_inknown(self):
args = []
... |
ccbd25f196453f4c7b61fa4e69d192d7b96595e2 | remo/remozilla/tests/__init__.py | remo/remozilla/tests/__init__.py | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | Add default RESOLUTION and STATUS in BugFactory. | Add default RESOLUTION and STATUS in BugFactory.
* Fixes failing tests.
| Python | bsd-3-clause | tsmrachel/remo,johngian/remo,mozilla/remo,tsmrachel/remo,flamingspaz/remo,abdullah2891/remo,johngian/remo,chirilo/remo,akatsoulas/remo,flamingspaz/remo,Mte90/remo,mozilla/remo,tsmrachel/remo,Mte90/remo,johngian/remo,chirilo/remo,abdullah2891/remo,johngian/remo,akatsoulas/remo,mozilla/remo,abdullah2891/remo,abdullah2891... | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | <commit_before>import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.dat... | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime(2011, 1, ... | <commit_before>import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.dat... |
f17310e0fcf5d7ea7ceab2b9243f106eb1222b69 | desertbot/datastore.py | desertbot/datastore.py | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = None
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.data = {}
self.save()
... | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = {}
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.save()
return
with open... | Allow using DataStore class as if dict | Allow using DataStore class as if dict
| Python | mit | DesertBot/DesertBot | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = None
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.data = {}
self.save()
... | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = {}
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.save()
return
with open... | <commit_before>import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = None
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.data = {}
self... | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = {}
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.save()
return
with open... | import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = None
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.data = {}
self.save()
... | <commit_before>import json
import os
class DataStore(object):
def __init__(self, storagePath="desertbot_data.json"):
self.storagePath = storagePath
self.data = None
self.load()
def load(self):
if not os.path.exists(self.storagePath):
self.data = {}
self... |
4ef159ae6d45bc546f1c84b57416fc2b87eecc33 | thrift/test/py/adapter_for_tests.py | thrift/test/py/adapter_for_tests.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Convert type check targets in thrift/test to use configuration | Convert type check targets in thrift/test to use configuration
Summary:
Migrating buck integration to use configurations.
For more information about this migration, please see: https://fb.workplace.com/groups/295311271085134/permalink/552700215346237/
Reviewed By: dkgi
Differential Revision: D30708385
fbshipit-sou... | Python | apache-2.0 | facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | <commit_before># Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 app... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | <commit_before># Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 app... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.