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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9249f1f2fce010cb0378080b5b7fef55235eefea | rnacentral/portal/migrations/0010_add_precomputed_rna_type.py | rnacentral/portal/migrations/0010_add_precomputed_rna_type.py | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | Drop size of rna_type column to 40 | Drop size of rna_type column to 40
Largest rna_type is 32 so 40 should give us plenty of buffer space as
per Anton's suggestion.
| Python | apache-2.0 | RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | <commit_before>from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
... | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
# for a ... | <commit_before>from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('portal', '0007_add_precomputed_rna_table'),
]
operations = [
# rna_type is a / seperated field that represents the set of rna_types
... |
80857a9f30b3e6773a658bf8ce93809c0881f80a | plugins/liquid_tags/liquid_tags.py | plugins/liquid_tags/liquid_tags.py | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MD_EXTENSIONS'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
if LiquidTags not in gen.settings['MD_EX... | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MARKDOWN'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN']
if LiquidTags not in gen.settings['MARKDOWN']:
... | Update to new markdown settings | Update to new markdown settings
| Python | apache-2.0 | danielfrg/danielfrg.github.io-source,danielfrg/danielfrg.github.io-source,danielfrg/danielfrg.github.io-source | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MD_EXTENSIONS'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
if LiquidTags not in gen.settings['MD_EX... | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MARKDOWN'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN']
if LiquidTags not in gen.settings['MARKDOWN']:
... | <commit_before>from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MD_EXTENSIONS'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
if LiquidTags not in gen.... | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MARKDOWN'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN']
if LiquidTags not in gen.settings['MARKDOWN']:
... | from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MD_EXTENSIONS'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
if LiquidTags not in gen.settings['MD_EX... | <commit_before>from pelican import signals
from .mdx_liquid_tags import LiquidTags, LT_CONFIG
def addLiquidTags(gen):
if not gen.settings.get('MD_EXTENSIONS'):
from pelican.settings import DEFAULT_CONFIG
gen.settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS']
if LiquidTags not in gen.... |
43434cc8efa52b56a64d52076b3760131456c34c | .bin/broadcast_any_song.py | .bin/broadcast_any_song.py | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | Remove CHANNEL. Why is it even there? | Remove CHANNEL. Why is it even there?
| Python | mit | ryanmjacobs/ryans_dotfiles,ryanmjacobs/ryans_dotfiles | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | <commit_before>#!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacob... | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | #!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacobs@gmail.com>
#
... | <commit_before>#!/usr/bin/env python2
################################################################################
# broadcast_any_song.py
#
# Uses the Exfm REST API to broadcast a song, (basically scours Tumblr for an
# audio file matching a query then sends it to PiFM.)
#
# Maintained By: Ryan Jacobs <ryan.mjacob... |
388c938c0604bbf432921ad46be8325b1e74fa4a | direct/src/showbase/TkGlobal.py | direct/src/showbase/TkGlobal.py | """ This module is now vestigial. """
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
| """ This module is now vestigial. """
from Tkinter import *
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
| Add import for backward compatibility | Add import for backward compatibility
| Python | bsd-3-clause | ee08b397/panda3d,hj3938/panda3d,mgracer48/panda3d,chandler14362/panda3d,grimfang/panda3d,mgracer48/panda3d,chandler14362/panda3d,brakhane/panda3d,chandler14362/panda3d,cc272309126/panda3d,grimfang/panda3d,matthiascy/panda3d,mgracer48/panda3d,chandler14362/panda3d,Wilee999/panda3d,ee08b397/panda3d,jjkoletar/panda3d,jjko... | """ This module is now vestigial. """
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
Add import for backward compati... | """ This module is now vestigial. """
from Tkinter import *
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
| <commit_before>""" This module is now vestigial. """
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
<commit_msg>Add ... | """ This module is now vestigial. """
from Tkinter import *
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
| """ This module is now vestigial. """
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
Add import for backward compati... | <commit_before>""" This module is now vestigial. """
import sys, Pmw
# This is required by the ihooks.py module used by Squeeze (used by
# pandaSqueezer.py) so that Pmw initializes properly
if '_Pmw' in sys.modules:
sys.modules['_Pmw'].__name__ = '_Pmw'
def spawnTkLoop():
base.spawnTkLoop()
<commit_msg>Add ... |
72de9e47015e2018ca13c6d4681a79e53c2d5475 | brabeion/models.py | brabeion/models.py | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=datetime.now)
slug = models.CharField(max_length=255)
level =... | from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=timezone.now)
slug = models.Char... | Use timezone-aware dates with BadgeAward if desired | Use timezone-aware dates with BadgeAward if desired
| Python | bsd-3-clause | kinsights/brabeion | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=datetime.now)
slug = models.CharField(max_length=255)
level =... | from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=timezone.now)
slug = models.Char... | <commit_before>from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=datetime.now)
slug = models.CharField(max_length=2... | from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=timezone.now)
slug = models.Char... | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=datetime.now)
slug = models.CharField(max_length=255)
level =... | <commit_before>from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class BadgeAward(models.Model):
user = models.ForeignKey(User, related_name="badges_earned")
awarded_at = models.DateTimeField(default=datetime.now)
slug = models.CharField(max_length=2... |
6eea9e787107a83be36b03d93cddfe7fdf1e9e05 | tools/skp/page_sets/skia_amazon_desktop.py | tools/skp/page_sets/skia_amazon_desktop.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | Add wait to amazon page set to avoid tab crashes | Add wait to amazon page set to avoid tab crashes
BUG=skia:3049
TBR=borenet
NOTRY=true
Review URL: https://codereview.chromium.org/686133002
| Python | bsd-3-clause | HalCanary/skia-hc,samuelig/skia,noselhq/skia,spezi77/android_external_skia,w3nd1go/android_external_skia,geekboxzone/mmallow_external_skia,YUPlayGodDev/platform_external_skia,AOSP-YU/platform_external_skia,PAC-ROM/android_external_skia,Infinitive-OS/platform_external_skia,UBERMALLOW/external_skia,scroggo/skia,AOSPB/ext... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class S... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class S... |
6ab0607e6182f7c4dec55b6318ab07af746e7c89 | compose/__init__.py | compose/__init__.py | from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.8.0'
| from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.9.0dev'
| Switch back to dev version | Switch back to dev version
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>
| Python | apache-2.0 | thaJeztah/compose,shin-/compose,andrewgee/compose,thaJeztah/compose,shin-/compose,michael-k/docker-compose,sdurrheimer/compose,dnephin/compose,hoogenm/compose,andrewgee/compose,dbdd4us/compose,swoopla/compose,hoogenm/compose,swoopla/compose,jrabbit/compose,schmunk42/compose,schmunk42/compose,funkyfuture/docker-compose,... | from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.8.0'
Switch back to dev version
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com> | from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.9.0dev'
| <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.8.0'
<commit_msg>Switch back to dev version
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com><commit_after> | from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.9.0dev'
| from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.8.0'
Switch back to dev version
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com>from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.9.0dev'
| <commit_before>from __future__ import absolute_import
from __future__ import unicode_literals
__version__ = '1.8.0'
<commit_msg>Switch back to dev version
Signed-off-by: Joffrey F <2e95f49799afcec0080c0aeb8813776d949e0768@docker.com><commit_after>from __future__ import absolute_import
from __future__ import unicode_l... |
edd4f01065b7bac6c7400d8c1496375fbe0a9aa5 | app/timetables/models.py | app/timetables/models.py | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | Add unique constraint on Meal name field | Add unique constraint on Meal name field
| Python | mit | teamtaverna/core | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | <commit_before>from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid ... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | <commit_before>from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid ... |
d2076f6fd3a0bb687224048de904207c885aba5c | utils.py | utils.py | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | Make it easier to define constants | Make it easier to define constants
| Python | unlicense | drkitty/python3-base,drkitty/python3-base | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | <commit_before>from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)... | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)
return... | <commit_before>from functools import wraps
def cached_property(f):
name = f.__name__
@property
@wraps(f)
def inner(self):
if not hasattr(self, "_property_cache"):
self._property_cache = {}
if name not in self._property_cache:
self._property_cache[name] = f(self)... |
07f2de7775cd73e220bebe3d6ea8cfe5604de174 | utils.py | utils.py | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | Fix branch name getting on older git version. | Fix branch name getting on older git version.
| Python | mit | liffiton/ATLeS,liffiton/ATLeS,liffiton/ATLeS,liffiton/ATLeS | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | <commit_before>import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("... | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("8.8.8.8", 53)) ... | <commit_before>import errno
import os
import socket
from contextlib import closing
import plumbum
# http://stackoverflow.com/a/166589
# Create a UDP socket to the internet at large to get our routed IP
def get_routed_ip():
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
s.connect(("... |
deb5a6c45d6f52daef7ca5752f574d7c14abbc47 | admin/base/urls.py | admin/base/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | Add preprints to the sidebar | Add preprints to the sidebar
[#OSF-7198]
| Python | apache-2.0 | mattclark/osf.io,caseyrollins/osf.io,aaxelb/osf.io,icereval/osf.io,felliott/osf.io,cwisecarver/osf.io,adlius/osf.io,crcresearch/osf.io,caneruguz/osf.io,cslzchen/osf.io,pattisdr/osf.io,leb2dg/osf.io,mattclark/osf.io,mfraezz/osf.io,caseyrollins/osf.io,baylee-d/osf.io,chrisseto/osf.io,saradbowman/osf.io,brianjgeiger/osf.i... | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
... | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
... |
5681e5ee342ee4660e634a2081d499940a3b0d3f | pytest_pycharm.py | pytest_pycharm.py | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | Set `pydev_message` only if `additional_info` exists. | Set `pydev_message` only if `additional_info` exists.
| Python | bsd-3-clause | jlubcke/pytest-pycharm | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | <commit_before># -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | <commit_before># -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
... |
e773239cbf0adee5ca192c10dba14d35275040ff | yarn_api_client/__init__.py | yarn_api_client/__init__.py | # -*- coding: utf-8 -*-
__version__ = '1.0.0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
| # -*- coding: utf-8 -*-
__version__ = '2.0.0.dev0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
| Prepare for next development iteration | Prepare for next development iteration
| Python | bsd-3-clause | toidi/hadoop-yarn-api-python-client | # -*- coding: utf-8 -*-
__version__ = '1.0.0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
Prepare for ne... | # -*- coding: utf-8 -*-
__version__ = '2.0.0.dev0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
| <commit_before># -*- coding: utf-8 -*-
__version__ = '1.0.0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager... | # -*- coding: utf-8 -*-
__version__ = '2.0.0.dev0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
| # -*- coding: utf-8 -*-
__version__ = '1.0.0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager
Prepare for ne... | <commit_before># -*- coding: utf-8 -*-
__version__ = '1.0.0'
__all__ = ['ApplicationMaster', 'HistoryServer', 'NodeManager', 'ResourceManager']
from .application_master import ApplicationMaster
from .history_server import HistoryServer
from .node_manager import NodeManager
from .resource_manager import ResourceManager... |
7f690132df6672978990589dd584f2101f592389 | tests/test_helper.py | tests/test_helper.py | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | Fix a warning about using assertEquals | Fix a warning about using assertEquals
| Python | apache-2.0 | HappyRay/php-di-generator | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | <commit_before>import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.ass... | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.assertEqual(expect... | <commit_before>import unittest
from generator.helper import Helper
class TestHelper(unittest.TestCase):
def test_parse_definition_string(self):
data = ' * @var FooClass | BarClass '
class_list = Helper.parse_definition_string(data)
expected = ['FooClass', 'BarClass']
self.ass... |
c8af52e91eb5ea40090a4b303e147c2d5d6cf28a | cloudbaseinit/shell.py | cloudbaseinit/shell.py | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | Fix py3 x64 crash thread related | Fix py3 x64 crash thread related
Change-Id: Iac00ea2463df4346ad60a17d0ba9a2af089c87cd
| Python | apache-2.0 | chialiang-8/cloudbase-init,stackforge/cloudbase-init,openstack/cloudbase-init,stefan-caraiman/cloudbase-init,cmin764/cloudbase-init,alexpilotti/cloudbase-init,ader1990/cloudbase-init | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | <commit_before># Copyright 2012 Cloudbase Solutions Srl
#
# 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 ... | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 l... | <commit_before># Copyright 2012 Cloudbase Solutions Srl
#
# 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 ... |
30261101fada94b4bd5df0f9c4506a4ac4dd1063 | examples/sum.py | examples/sum.py | from numba import d
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=d, argtypes=[d[:,:]])(sum2d)
from numpy import random
arr = random.randn(100,100)
... | from numba import double
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=double, argtypes=[double[:,:]])(sum2d)
from numpy import random
arr = random.r... | Update type specification in example | Update type specification in example
| Python | bsd-2-clause | stonebig/numba,seibert/numba,seibert/numba,stefanseefeld/numba,jriehl/numba,ssarangi/numba,IntelLabs/numba,GaZ3ll3/numba,pombredanne/numba,stuartarchibald/numba,gdementen/numba,numba/numba,IntelLabs/numba,stuartarchibald/numba,pitrou/numba,gdementen/numba,cpcloud/numba,stefanseefeld/numba,GaZ3ll3/numba,cpcloud/numba,ss... | from numba import d
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=d, argtypes=[d[:,:]])(sum2d)
from numpy import random
arr = random.randn(100,100)
... | from numba import double
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=double, argtypes=[double[:,:]])(sum2d)
from numpy import random
arr = random.r... | <commit_before>from numba import d
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=d, argtypes=[d[:,:]])(sum2d)
from numpy import random
arr = random.r... | from numba import double
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=double, argtypes=[double[:,:]])(sum2d)
from numpy import random
arr = random.r... | from numba import d
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=d, argtypes=[d[:,:]])(sum2d)
from numpy import random
arr = random.randn(100,100)
... | <commit_before>from numba import d
from numba.decorators import jit as jit
def sum2d(arr):
M, N = arr.shape
result = 0.0
for i in range(M):
for j in range(N):
result += arr[i,j]
return result
csum2d = jit(restype=d, argtypes=[d[:,:]])(sum2d)
from numpy import random
arr = random.r... |
bf8ddb49a1043f399a210e05e66e2db4d815cc22 | tests/test_build_chess.py | tests/test_build_chess.py | # -*- coding: utf-8 -*-
from app.chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
piece... | # -*- coding: utf-8 -*-
from chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
... | Add a TDD function ( queens on chess board) | Add a TDD function ( queens on chess board) | Python | mit | aymguesmi/ChessChallenge | # -*- coding: utf-8 -*-
from app.chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
piece... | # -*- coding: utf-8 -*-
from chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
... | <commit_before># -*- coding: utf-8 -*-
from app.chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4... | # -*- coding: utf-8 -*-
from chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
... | # -*- coding: utf-8 -*-
from app.chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4]
piece... | <commit_before># -*- coding: utf-8 -*-
from app.chess.chess import Chess
import unittest
class TestBuildChess(unittest.TestCase):
"""
`TestBuildChess()` class is unit-testing the class
Chess().
"""
# ///////////////////////////////////////////////////
def setUp(self):
params = [4, 4... |
639356ecf1b19b8546b5a4691d13a34d4b46d583 | src/app.py | src/app.py | import os
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/hello')
def hello():
return 'hello'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=True)
| import os
import json
import random
import flask
from hashlib import md5
records = {}
# Create a hash table of all records.
for record in json.loads(open('data/records-2015.json').read())['records']:
records[md5(str(record['id']).encode('utf-8')).hexdigest()] = record
app = flask.Flask(__name__)
@app.route('/... | Load records from JSON & expose them | Load records from JSON & expose them
| Python | mit | judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday | import os
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/hello')
def hello():
return 'hello'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=True)
Load record... | import os
import json
import random
import flask
from hashlib import md5
records = {}
# Create a hash table of all records.
for record in json.loads(open('data/records-2015.json').read())['records']:
records[md5(str(record['id']).encode('utf-8')).hexdigest()] = record
app = flask.Flask(__name__)
@app.route('/... | <commit_before>import os
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/hello')
def hello():
return 'hello'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=Tr... | import os
import json
import random
import flask
from hashlib import md5
records = {}
# Create a hash table of all records.
for record in json.loads(open('data/records-2015.json').read())['records']:
records[md5(str(record['id']).encode('utf-8')).hexdigest()] = record
app = flask.Flask(__name__)
@app.route('/... | import os
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/hello')
def hello():
return 'hello'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=True)
Load record... | <commit_before>import os
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return flask.render_template('index.html')
@app.route('/hello')
def hello():
return 'hello'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=Tr... |
d97d9294bf470c6e95958b0dc51391830c56a7b3 | thinglang/parser/values/inline_code.py | thinglang/parser/values/inline_code.py | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | Allow inline code to be transpiled | Allow inline code to be transpiled
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | <commit_before>from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__... | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__(value, source_... | <commit_before>from thinglang.lexer.lexical_token import LexicalToken
from thinglang.utils.type_descriptors import ValueType
class InlineCode(LexicalToken, ValueType):
"""
Represents inline C++ code
"""
STATIC = True
def __init__(self, value, source_ref):
super(InlineCode, self).__init__... |
a775cd66de2bbc2e176f946e93fe9c0636cf7115 | documents/views/utils.py | documents/views/utils.py | from django.http import HttpResponse
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.write(cont... | from django.http import HttpResponse
import os
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.... | Remove temporary files after delivering them | Remove temporary files after delivering them
| Python | agpl-3.0 | sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer | from django.http import HttpResponse
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.write(cont... | from django.http import HttpResponse
import os
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.... | <commit_before>from django.http import HttpResponse
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
resp... | from django.http import HttpResponse
import os
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.... | from django.http import HttpResponse
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
response.write(cont... | <commit_before>from django.http import HttpResponse
def render_to_mimetype_response(mimetype, filename, outputFile):
response = HttpResponse(mimetype=mimetype)
response['Content-Disposition'] = "attachment; filename=\"%s\"" % (filename)
f = open(outputFile)
try:
content = f.read()
resp... |
905a2b0ebc2a7e825f93fe1411dc598524dfd843 | examples/hello/server.py | examples/hello/server.py | import os
import avro.protocol
import tornado.web
import tornado.ioloop
import tornavro.server
import tornavro.responder
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
return 'Hello, %s' % name
proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr')).read()
proto... | import os
import avro.protocol
import tornado.web
import tornado.ioloop
from tornado.options import define, options
import tornavro.server
import tornavro.responder
define('port', default=8888, help='Listen on this port')
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
retur... | Make the hello protocol example more user-friendly | Make the hello protocol example more user-friendly
| Python | mit | richid/tornavro | import os
import avro.protocol
import tornado.web
import tornado.ioloop
import tornavro.server
import tornavro.responder
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
return 'Hello, %s' % name
proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr')).read()
proto... | import os
import avro.protocol
import tornado.web
import tornado.ioloop
from tornado.options import define, options
import tornavro.server
import tornavro.responder
define('port', default=8888, help='Listen on this port')
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
retur... | <commit_before>import os
import avro.protocol
import tornado.web
import tornado.ioloop
import tornavro.server
import tornavro.responder
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
return 'Hello, %s' % name
proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr'... | import os
import avro.protocol
import tornado.web
import tornado.ioloop
from tornado.options import define, options
import tornavro.server
import tornavro.responder
define('port', default=8888, help='Listen on this port')
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
retur... | import os
import avro.protocol
import tornado.web
import tornado.ioloop
import tornavro.server
import tornavro.responder
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
return 'Hello, %s' % name
proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr')).read()
proto... | <commit_before>import os
import avro.protocol
import tornado.web
import tornado.ioloop
import tornavro.server
import tornavro.responder
class HelloResponder(tornavro.responder.Responder):
def hello(self, name):
return 'Hello, %s' % name
proto = open(os.path.join(os.path.dirname(__file__), 'hello.avpr'... |
33e40319b5d670c3fa1a1423bf7eed1865115d5c | sitetools/venv_hook/sitecustomize.py | sitetools/venv_hook/sitecustomize.py | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | Adjust venv_hook to work in new location | Adjust venv_hook to work in new location | Python | bsd-3-clause | westernx/sitetools,westernx/sitetools,mikeboers/sitetools | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | <commit_before>"""
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
impo... | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | """
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
import os
import sy... | <commit_before>"""
This file serves as a hook into virtualenvs that do NOT have sitetools
installed.
It is added to the $PYTHONPATH by the `dev` command so that new virtualenvs
can refer to the sitetools from the old virtualenv.
It tries to play nice by looking for the next sitecustomize module.
"""
import imp
impo... |
b9eb6ac32a12ef912edc237409c0433cd139aaf6 | tapioca_harvest/tapioca_harvest.py | tapioca_harvest/tapioca_harvest.py | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
def get_reque... | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
api_root = 'ht... | Change auth method from password to token on adapter | Change auth method from password to token on adapter
| Python | mit | vintasoftware/tapioca-harvest | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
def get_reque... | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
api_root = 'ht... | <commit_before># coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
... | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
api_root = 'ht... | # coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
def get_reque... | <commit_before># coding: utf-8
from tapioca import (
TapiocaAdapter, generate_wrapper_from_adapter, JSONAdapterMixin)
from requests.auth import HTTPBasicAuth
from .resource_mapping import RESOURCE_MAPPING
class HarvestClientAdapter(JSONAdapterMixin, TapiocaAdapter):
resource_mapping = RESOURCE_MAPPING
... |
1ad4dba5d2dcfdfc9062f334204bd75b789b3ba6 | webapp/calendars/forms.py | webapp/calendars/forms.py | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | Change fields order and add field url. | Change fields order and add field url.
Signed-off-by: Mariusz Fik <e22610367d206dca7aa58af34ebf008b556228c5@fidano.pl>
| Python | agpl-3.0 | Fisiu/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,firemark/calendar-oswiecim,Fisiu/calendar-oswiecim,Fisiu/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,firemark/calendar-oswiecim,hackerspace-silesia/calendar-oswiecim,firemark/calendar-oswiecim | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | <commit_before>from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput()... | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput())
data_time_o... | <commit_before>from django import forms
from django.contrib.admin import widgets
from datetimewidget.widgets import DateTimeWidget
from .models import Event
class LoginForm(forms.Form):
username = forms.CharField(label='Nazwa użytkownika')
password = forms.CharField(label='Hasło', widget=forms.PasswordInput()... |
67d7ce2d9e8ffe26f5f5a97aca9cfb99c8914f3e | us_ignite/common/tests/utils.py | us_ignite/common/tests/utils.py | from django.core.urlresolvers import reverse
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
| from django.core.urlresolvers import reverse
from django.contrib.messages.storage.base import BaseStorage, Message
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
class TestMessagesBackend(BaseStorage):
def __init__(self, request, *args, ... | Add ``TestMessagesBackend`` for testing ``django.contrib.messages``. | Add ``TestMessagesBackend`` for testing ``django.contrib.messages``.
When unit testing a django view the ``messages`` middleware
will be missing. This backend will provision a simple
messaging midleware.
Usage::
from django.test import client
from us_ignite.common.tests import utils
factory = client.Req... | Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | from django.core.urlresolvers import reverse
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
Add ``TestMessagesBackend`` for testing ``django.contrib.messages``.
When unit testing a django view the ``messages`` middleware
will be missing. This... | from django.core.urlresolvers import reverse
from django.contrib.messages.storage.base import BaseStorage, Message
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
class TestMessagesBackend(BaseStorage):
def __init__(self, request, *args, ... | <commit_before>from django.core.urlresolvers import reverse
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
<commit_msg>Add ``TestMessagesBackend`` for testing ``django.contrib.messages``.
When unit testing a django view the ``messages`` middl... | from django.core.urlresolvers import reverse
from django.contrib.messages.storage.base import BaseStorage, Message
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
class TestMessagesBackend(BaseStorage):
def __init__(self, request, *args, ... | from django.core.urlresolvers import reverse
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
Add ``TestMessagesBackend`` for testing ``django.contrib.messages``.
When unit testing a django view the ``messages`` middleware
will be missing. This... | <commit_before>from django.core.urlresolvers import reverse
def get_login_url(url):
"""Returns an expected login URL."""
return ('%s?next=%s' % (reverse('auth_login'), url))
<commit_msg>Add ``TestMessagesBackend`` for testing ``django.contrib.messages``.
When unit testing a django view the ``messages`` middl... |
1104ef0db6b174c64aa9ddad4df10a790fda13cf | grammpy/StringGrammar.py | grammpy/StringGrammar.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | Fix return of Terminal instance when term method accept string | Fix return of Terminal instance when term method accept string
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
retu... | <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t... |
257315a2e0b3f23db36bb97813849d5cf425f81f | murano_tempest_tests/tests/api/service_broker/test_service_broker_negative.py | murano_tempest_tests/tests/api/service_broker/test_service_broker_negative.py | # Copyright (c) 2015 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 requir... | # Copyright (c) 2015 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 requir... | Adjust '410 Gone' exception in service broker negative tests | Adjust '410 Gone' exception in service broker negative tests
Tempest-lib 0.12.0 contains necessary code for checking correct exception.
This patch replaces 'UnexpectedResponceCode' exception to correct 'Gone' exception.
Aslo, this patch add expectedFail for negative test.
Change-Id: Ib460b6fc495060a1bd6dd7d0443ff983... | Python | apache-2.0 | openstack/murano,satish-avninetworks/murano,olivierlemasle/murano,NeCTAR-RC/murano,satish-avninetworks/murano,olivierlemasle/murano,satish-avninetworks/murano,NeCTAR-RC/murano,NeCTAR-RC/murano,NeCTAR-RC/murano,DavidPurcell/murano_temp,DavidPurcell/murano_temp,satish-avninetworks/murano,openstack/murano,olivierlemasle/m... | # Copyright (c) 2015 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 requir... | # Copyright (c) 2015 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 requir... | <commit_before># Copyright (c) 2015 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
#
# ... | # Copyright (c) 2015 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 requir... | # Copyright (c) 2015 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 requir... | <commit_before># Copyright (c) 2015 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
#
# ... |
99f61b183da7fb1f7e22377e0347418a852846e3 | dyfunconn/fc/crosscorr.py | dyfunconn/fc/crosscorr.py | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | Fix the order of the returned values from `analytic_signal`. | Fix the order of the returned values from `analytic_signal`.
| Python | bsd-3-clause | makism/dyfunconn | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | <commit_before># -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(dat... | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | # -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(data, fb, fs, pair... | <commit_before># -*- coding: utf-8 -*-
""" Cross Correlation
see @https://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .estimator import Estimator
from ..analytic_signal import analytic_signal
import numpy as np
def crosscorr(dat... |
74dfabb565dbd6581a300091c045067d0398e899 | source/jormungandr/jormungandr/interfaces/v1/Coverage.py | source/jormungandr/jormungandr/interfaces/v1/Coverage.py | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
region_fields = {
"id": ... | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
from fields... | Add error field to region | Jormungandr: Add error field to region
| Python | agpl-3.0 | VincentCATILLON/navitia,prhod/navitia,xlqian/navitia,prhod/navitia,prhod/navitia,xlqian/navitia,ballouche/navitia,is06/navitia,pbougue/navitia,ballouche/navitia,kadhikari/navitia,CanalTP/navitia,VincentCATILLON/navitia,frodrigo/navitia,CanalTP/navitia,pbougue/navitia,francois-vincent/navitia,TeXitoi/navitia,kinnou02/na... | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
region_fields = {
"id": ... | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
from fields... | <commit_before># coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
region_fields... | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
from fields... | # coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
region_fields = {
"id": ... | <commit_before># coding=utf-8
from flask.ext.restful import Resource, fields, marshal_with
from jormungandr import i_manager
from make_links import add_coverage_link, add_collection_links, clean_links
from converters_collection_type import collections_to_resource_type
from collections import OrderedDict
region_fields... |
b700e40f65953ea0c87666d38d53e968581611e1 | auditlog_tests/urls.py | auditlog_tests/urls.py | import django
from django.conf.urls import include, url
from django.contrib import admin
if django.VERSION < (1, 9):
admin_urls = include(admin.site.urls)
else:
admin_urls = admin.site.urls
urlpatterns = [
url(r'^admin/', admin_urls),
]
| from django.urls import path
from django.contrib import admin
urlpatterns = [
path("admin/", admin.site.urls),
]
| Remove old django related codes. | Remove old django related codes.
| Python | mit | jjkester/django-auditlog | import django
from django.conf.urls import include, url
from django.contrib import admin
if django.VERSION < (1, 9):
admin_urls = include(admin.site.urls)
else:
admin_urls = admin.site.urls
urlpatterns = [
url(r'^admin/', admin_urls),
]
Remove old django related codes. | from django.urls import path
from django.contrib import admin
urlpatterns = [
path("admin/", admin.site.urls),
]
| <commit_before>import django
from django.conf.urls import include, url
from django.contrib import admin
if django.VERSION < (1, 9):
admin_urls = include(admin.site.urls)
else:
admin_urls = admin.site.urls
urlpatterns = [
url(r'^admin/', admin_urls),
]
<commit_msg>Remove old django related codes.<commit_a... | from django.urls import path
from django.contrib import admin
urlpatterns = [
path("admin/", admin.site.urls),
]
| import django
from django.conf.urls import include, url
from django.contrib import admin
if django.VERSION < (1, 9):
admin_urls = include(admin.site.urls)
else:
admin_urls = admin.site.urls
urlpatterns = [
url(r'^admin/', admin_urls),
]
Remove old django related codes.from django.urls import path
from dj... | <commit_before>import django
from django.conf.urls import include, url
from django.contrib import admin
if django.VERSION < (1, 9):
admin_urls = include(admin.site.urls)
else:
admin_urls = admin.site.urls
urlpatterns = [
url(r'^admin/', admin_urls),
]
<commit_msg>Remove old django related codes.<commit_a... |
bd878da54d9816779303a0e7ea042c9adaeab993 | runserver.py | runserver.py | #!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', ... | #!/usr/bin/python
from wsgiref.simple_server import make_server
from optparse import OptionParser
from sys import stderr
import socket
import pytz
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', '--settings... | Revert to old server script (worked better). | Revert to old server script (worked better).
The old script did not auto-reload and did display requests made to the
server. The werkzeug-based script's auto-reload feature would mess with
the import magic that powers plugins.
| Python | bsd-3-clause | rescrv/firmant | #!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', ... | #!/usr/bin/python
from wsgiref.simple_server import make_server
from optparse import OptionParser
from sys import stderr
import socket
import pytz
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', '--settings... | <commit_before>#!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.ad... | #!/usr/bin/python
from wsgiref.simple_server import make_server
from optparse import OptionParser
from sys import stderr
import socket
import pytz
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', '--settings... | #!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.add_option('-s', ... | <commit_before>#!/usr/bin/python
from optparse import OptionParser
from sys import stderr
import pytz
from werkzeug import script
from werkzeug.script import make_runserver
from firmant.wsgi import Application
from firmant.utils import mod_to_dict
from firmant.utils import get_module
parser = OptionParser()
parser.ad... |
c91e494f16301789f2ebcc9c245697b379b30eca | irco/explorer/filters.py | irco/explorer/filters.py | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
if 'csv' in record.unparsed_record_format:
... | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
fmt_csv = 'csv' in record.unparsed_record_format
... | Add support to render tsp data in the explorer. | Add support to render tsp data in the explorer.
| Python | mit | GaretJax/irco,GaretJax/irco,GaretJax/irco,GaretJax/irco | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
if 'csv' in record.unparsed_record_format:
... | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
fmt_csv = 'csv' in record.unparsed_record_format
... | <commit_before>import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
if 'csv' in record.unparsed_record_form... | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
fmt_csv = 'csv' in record.unparsed_record_format
... | import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
if 'csv' in record.unparsed_record_format:
... | <commit_before>import csv
import collections
from StringIO import StringIO
from flask import render_template
from jinja2 import Markup
def init_app(app):
@app.template_filter('format_record')
def format_record(record):
val = record.unparsed_record_value
if 'csv' in record.unparsed_record_form... |
ecdda95d5d1ed9e3614639c672a860e2467ba3f1 | django_project/core/settings/prod_docker.py | django_project/core/settings/prod_docker.py | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | Use InaSAFE in the email subject line rather | Use InaSAFE in the email subject line rather
| Python | bsd-2-clause | AIFDR/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django,timlinux/inasafe-django,AIFDR/inasafe-django | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | <commit_before># noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gm... | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | # noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gmail.com'),)
DA... | <commit_before># noinspection PyUnresolvedReferences
from .prod import * # noqa
import os
print os.environ
ALLOWED_HOSTS = ['*']
ADMINS = (
('Tim Sutton', 'tim@kartoza.com'),
('Ismail Sunni', 'ismail@kartoza.com'),
('Christian Christellis', 'christian@kartoza.com'),
('Akbar Gumbira', 'akbargumbira@gm... |
2df61655cc99678e7e7db9d0cf1883c702fdc300 | python/servo/devenv_commands.py | python/servo/devenv_commands.py | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | Add a `mach rustc` command | Add a `mach rustc` command
| Python | mpl-2.0 | youprofit/servo,indykish/servo,evilpie/servo,samfoo/servo,hyowon/servo,Shraddha512/servo,dhananjay92/servo,g-k/servo,aweinstock314/servo,steveklabnik/servo,pyfisch/servo,DominoTree/servo,nerith/servo,WriterOfAlicrow/servo,saratang/servo,CJ8664/servo,nick-thompson/servo,huonw/servo,SimonSapin/servo,tschneidereit/servo,S... | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | <commit_before>from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,... | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,
Command,
)... | <commit_before>from __future__ import print_function, unicode_literals
import json
import os
import os.path as path
import shutil
import subprocess
import sys
import tarfile
from time import time
import urllib
from mach.registrar import Registrar
from mach.decorators import (
CommandArgument,
CommandProvider,... |
2b2a1848b398e59818ea7d3aa51bf7db6669917c | pytus2000/datadicts/__init__.py | pytus2000/datadicts/__init__.py | """This subpackage contains all data dictionaries."""
# The Python source code gets auto-generated and this package is intentially empty.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__class_... | """This subpackage contains all data dictionaries."""
# The Python source code in this package other than this file has been auto-generated.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__cla... | Update comment for auto generated files | Update comment for auto generated files
| Python | mit | timtroendle/pytus2000 | """This subpackage contains all data dictionaries."""
# The Python source code gets auto-generated and this package is intentially empty.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__class_... | """This subpackage contains all data dictionaries."""
# The Python source code in this package other than this file has been auto-generated.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__cla... | <commit_before>"""This subpackage contains all data dictionaries."""
# The Python source code gets auto-generated and this package is intentially empty.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is... | """This subpackage contains all data dictionaries."""
# The Python source code in this package other than this file has been auto-generated.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__cla... | """This subpackage contains all data dictionaries."""
# The Python source code gets auto-generated and this package is intentially empty.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is other.__class_... | <commit_before>"""This subpackage contains all data dictionaries."""
# The Python source code gets auto-generated and this package is intentially empty.
from enum import Enum
class OrderedEnum(Enum):
"""An Enum whose members are ordered by their value."""
def __ge__(self, other):
if self.__class__ is... |
70d0b672eb9f857c052028be12ccae56ed798c8a | 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/members/'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 3... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/members'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 36... | Remove slash from sandbox path | Remove slash from sandbox path
| Python | apache-2.0 | vprnet/pledge-drive,vprnet/pledge-drive,vprnet/pledge-drive | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/members/'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 3... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/members'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 36... | <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/members/'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRE... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/members'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 36... | import os
import inspect
# Flask
DEBUG = True
# Amazon S3 Settings
AWS_KEY = ''
AWS_SECRET_KEY = ''
AWS_BUCKET = 'www.vpr.net'
AWS_DIRECTORY = 'sandbox/members/'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRES = 60 * 24 * 3... | <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/members/'
NPR_API_KEY = ''
GOOGLE_SPREADSHEET = {'USER': '',
'PASSWORD': '',
'SOURCE': ''}
# Cache Settings (units in seconds)
STATIC_EXPIRE... |
51d4e250ca8105430bb881338d4e6174c7e0d86b | featureExtractors/Gait.py | featureExtractors/Gait.py | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
def extract(self, experiment, type, indiv):
filepath = experiment[2] + os.path.... | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
# isValidLine and sameAsFloat have been copied from distanceCalc.py
def isValidLin... | Fix for faulty trace files | Fix for faulty trace files
| Python | apache-2.0 | metamarkovic/dataCollector,metamarkovic/dataCollector,fgolemo/dataCollector,fgolemo/dataCollector | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
def extract(self, experiment, type, indiv):
filepath = experiment[2] + os.path.... | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
# isValidLine and sameAsFloat have been copied from distanceCalc.py
def isValidLin... | <commit_before>import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
def extract(self, experiment, type, indiv):
filepath = experimen... | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
# isValidLine and sameAsFloat have been copied from distanceCalc.py
def isValidLin... | import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
def extract(self, experiment, type, indiv):
filepath = experiment[2] + os.path.... | <commit_before>import numpy as np
import os
from FeatureExtractorAbstract import FeatureExtractorAbstract
from helpers.config import PathConfig
class Gait(FeatureExtractorAbstract):
def getCSVheader(self):
return ["gaitPeriod"]
def extract(self, experiment, type, indiv):
filepath = experimen... |
3e42d128cd3139a9e35fec45b6ed3785557784f2 | dv/uvm/core_ibex/scripts/build-instr-gen.py | dv/uvm/core_ibex/scripts/build-instr-gen.py | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argparse.Argumen... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argpar... | Write instr-gen build output to a log file, rather than stdout | Write instr-gen build output to a log file, rather than stdout
| Python | apache-2.0 | lowRISC/ibex,lowRISC/ibex,AmbiML/ibex,AmbiML/ibex,AmbiML/ibex,lowRISC/ibex,AmbiML/ibex,lowRISC/ibex | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argparse.Argumen... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argpar... | <commit_before>#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = a... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argpar... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = argparse.Argumen... | <commit_before>#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import shutil
import sys
from scripts_lib import run_one, start_riscv_dv_run_cmd
def main() -> int:
parser = a... |
d5377e06ae059a9d478c3fe06652a353f1a8359c | address_book/address_book.py | address_book/address_book.py | from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)
def __contains__(se... | from group import Group
from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)... | Make it possible to check if some group is in the AddressBook or not | Make it possible to check if some group is in the AddressBook or not
| Python | mit | dizpers/python-address-book-assignment | from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)
def __contains__(se... | from group import Group
from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)... | <commit_before>from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)
def ... | from group import Group
from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)... | from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)
def __contains__(se... | <commit_before>from person import Person
__all__ = ['AddressBook']
class AddressBook(object):
def __init__(self):
self.persons = []
self.groups = []
def add_person(self, person):
self.persons.append(person)
def add_group(self, group):
self.groups.append(group)
def ... |
5e0e6d672f5066b9caa2a202fe785cb2cfb1edc7 | ai_graph_color/experiment.py | ai_graph_color/experiment.py | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = map(
lambda m: LimitedAlgorithm(
m[0], problem, setup.Evaluation(), m[1]
),
algorithms
)
iteration_... | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = [
LimitedAlgorithm(
algorithm, problem, setup.Evaluation(), params
)
for algorithm, params in algorithms
... | Make iterative stopping stop if all algorithms complete, use comprehension over map | Make iterative stopping stop if all algorithms complete, use comprehension over map
| Python | mit | sagersmith8/ai_graph_coloring,sagersmith8/ai_graph_coloring | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = map(
lambda m: LimitedAlgorithm(
m[0], problem, setup.Evaluation(), m[1]
),
algorithms
)
iteration_... | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = [
LimitedAlgorithm(
algorithm, problem, setup.Evaluation(), params
)
for algorithm, params in algorithms
... | <commit_before>import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = map(
lambda m: LimitedAlgorithm(
m[0], problem, setup.Evaluation(), m[1]
),
algorithms
)
... | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = [
LimitedAlgorithm(
algorithm, problem, setup.Evaluation(), params
)
for algorithm, params in algorithms
... | import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = map(
lambda m: LimitedAlgorithm(
m[0], problem, setup.Evaluation(), m[1]
),
algorithms
)
iteration_... | <commit_before>import setup
from algorithm import LimitedAlgorithm
def iterative(algorithms, problem, iteration_func, local_limit,
global_limit=None):
algorithm_runners = map(
lambda m: LimitedAlgorithm(
m[0], problem, setup.Evaluation(), m[1]
),
algorithms
)
... |
250aab8f88cb7c6ef0c99a365a717035ce4f77d6 | rsk_mind/datasource/datasource_csv.py | rsk_mind/datasource/datasource_csv.py | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | Add exception when class not found | Add exception when class not found
| Python | mit | rsk-mind/rsk-mind-framework | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | <commit_before>import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
reader = ... | <commit_before>import csv
from datasource import Datasource
from ..dataset import Dataset
class CSVDatasource(Datasource):
def __init__(self, path, target=None):
super(CSVDatasource, self).__init__(path)
self.target = target
def read(self):
with open(self.path, 'rb') as infile:
... |
c1e1c9d63d5334140aa71c025a90e9500b299307 | functional_tests.py | functional_tests.py | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title | from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_start_a_list_and_retrieve_it_later(self):
# Rey has heard about a cool new online to-do... | Update tests to be human-readable | Update tests to be human-readable
| Python | apache-2.0 | rocity/the-testing-goat,rocity/the-testing-goat | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.titleUpdate tests to be human-readable | from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_start_a_list_and_retrieve_it_later(self):
# Rey has heard about a cool new online to-do... | <commit_before>from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title<commit_msg>Update tests to be human-readable<commit_after> | from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_start_a_list_and_retrieve_it_later(self):
# Rey has heard about a cool new online to-do... | from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.titleUpdate tests to be human-readablefrom selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
... | <commit_before>from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title<commit_msg>Update tests to be human-readable<commit_after>from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
def setUp(self):
... |
2bad8f41c8e64249ae3d1e0d129a41917ec73482 | app/test_base.py | app/test_base.py | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()... | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all(... | Add default values for login credentials in test base | Add default values for login credentials in test base
| Python | mit | rtfoley/scorepy,rtfoley/scorepy,rtfoley/scorepy | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()... | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all(... | <commit_before>from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
... | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all(... | from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()... | <commit_before>from flask.ext.testing import TestCase
import unittest
from app import create_app, db
class BaseTestCase(TestCase):
def create_app(self):
return create_app('config.TestingConfiguration')
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
... |
0f8263fb264e880bef47ce69d8b42b2bb885a2fd | goose/host_utils.py | goose/host_utils.py | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
selectors = all_selectors[sele... | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
host = host.replace("www.", "")
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
... | Add a workaround for processing rules without www | Add a workaround for processing rules without www
| Python | apache-2.0 | cronycle/python-goose,cronycle/python-goose,cronycle/python-goose | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
selectors = all_selectors[sele... | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
host = host.replace("www.", "")
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
... | <commit_before>import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
selectors = all... | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
host = host.replace("www.", "")
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
... | import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
selectors = all_selectors[sele... | <commit_before>import re
class HostUtils(object):
@classmethod
def host_selectors(self, all_selectors, host):
if host is None:
return None
if host in all_selectors:
selectors = all_selectors[host]
if type(selectors) is dict:
selectors = all... |
59bd51f4c809a7f99f186be52c6c9090b613ac42 | tests/unit/state_test.py | tests/unit/state_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | Update test to correct iteration | Update test to correct iteration
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | <commit_before># -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
NO_MOCK,
... | <commit_before># -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (... |
70748648bc4e7b050840ed781208ea14d21a735e | dragoman_blog/views.py | dragoman_blog/views.py | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslation
def get_queryset(self):
try:
... | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
from django.utils.translation import get_language
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslatio... | Add filter by language for list by tag. | Add filter by language for list by tag.
| Python | bsd-3-clause | fivethreeo/django-dragoman-blog | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslation
def get_queryset(self):
try:
... | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
from django.utils.translation import get_language
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslatio... | <commit_before>from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslation
def get_queryset(self):
... | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
from django.utils.translation import get_language
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslatio... | from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslation
def get_queryset(self):
try:
... | <commit_before>from dragoman_blog.models import EntryTranslation
from django.views.generic.list import ListView
class ListByTagView(ListView):
""" View for listing posts by tags"""
template_name = "dragoman_blog/entrytranslation_list_by_tag.html"
model = EntryTranslation
def get_queryset(self):
... |
fca6602f8bb9e7c8f7c036665c035cd58461bf06 | catalog/serializers.py | catalog/serializers.py | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | Add thread_set to course api | Add thread_set to course api
| Python | agpl-3.0 | UrLab/DocHub,UrLab/beta402,UrLab/beta402,UrLab/DocHub,UrLab/beta402,UrLab/DocHub,UrLab/DocHub | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | <commit_before>from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
... | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
return json.l... | <commit_before>from catalog.models import Course, Category
from rest_framework import serializers
from documents.serializers import ShortDocumentSerializer
import json
class CourseSerializer(serializers.HyperlinkedModelSerializer):
meta = serializers.SerializerMethodField()
def get_meta(self, course):
... |
2ba1139fe7994da64eb1bbcf057f7205b35a0fd5 | doc/pool_scripts/cats.py | doc/pool_scripts/cats.py | import os
import photomosaic.flickr
import photomosaic as pm
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
pm.set_options(flickr_api_key=FLICKR_API_KEY)
photomosaic.flickr.from_search('cats', '~/pools/cats/')
pool = pm.make_pool('~/... | import os
import photomosaic.flickr
import photomosaic as pm
class MissingAPIKey(Exception):
...
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
try:
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
except KeyError:
raise MissingAPIKey(
"This script requires... | Improve error message if FLICKR_API_KEY is missing | Improve error message if FLICKR_API_KEY is missing
| Python | bsd-3-clause | danielballan/photomosaic | import os
import photomosaic.flickr
import photomosaic as pm
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
pm.set_options(flickr_api_key=FLICKR_API_KEY)
photomosaic.flickr.from_search('cats', '~/pools/cats/')
pool = pm.make_pool('~/... | import os
import photomosaic.flickr
import photomosaic as pm
class MissingAPIKey(Exception):
...
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
try:
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
except KeyError:
raise MissingAPIKey(
"This script requires... | <commit_before>import os
import photomosaic.flickr
import photomosaic as pm
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
pm.set_options(flickr_api_key=FLICKR_API_KEY)
photomosaic.flickr.from_search('cats', '~/pools/cats/')
pool = p... | import os
import photomosaic.flickr
import photomosaic as pm
class MissingAPIKey(Exception):
...
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
try:
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
except KeyError:
raise MissingAPIKey(
"This script requires... | import os
import photomosaic.flickr
import photomosaic as pm
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
pm.set_options(flickr_api_key=FLICKR_API_KEY)
photomosaic.flickr.from_search('cats', '~/pools/cats/')
pool = pm.make_pool('~/... | <commit_before>import os
import photomosaic.flickr
import photomosaic as pm
if not os.path.isfile(os.path.expanduser('~/pools/cats/pool.json')):
FLICKR_API_KEY = os.environ['FLICKR_API_KEY']
pm.set_options(flickr_api_key=FLICKR_API_KEY)
photomosaic.flickr.from_search('cats', '~/pools/cats/')
pool = p... |
e74e4e1108cac7d8438e4b412e72f016323636a1 | chatterbot/__init__.py | chatterbot/__init__.py | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a3'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a4'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| Update release version to 1.0.0a4 | Update release version to 1.0.0a4
| Python | bsd-3-clause | vkosuri/ChatterBot,gunthercox/ChatterBot | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a3'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
Update release version to 1.0.0a4 | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a4'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| <commit_before>"""
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a3'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
<commit_msg>Update release versi... | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a4'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a3'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
Update release version to 1.0.0a4"""
ChatterBot... | <commit_before>"""
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '1.0.0a3'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
<commit_msg>Update release versi... |
a1a426a49511a52f5a40ab07310c1af4197feca2 | includes/helpers.py | includes/helpers.py | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600))
elif tdel.s... | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.days == 1 or tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600... | Fix for 24-48 hours being incorrectly shown as 0-24 hours. | Fix for 24-48 hours being incorrectly shown as 0-24 hours.
| Python | mit | Sulter/MASTERlinker | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600))
elif tdel.s... | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.days == 1 or tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600... | <commit_before># Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600))
... | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.days == 1 or tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600... | # Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600))
elif tdel.s... | <commit_before># Functions that multiple plugins should use
def time_string(tdel):
if tdel.days > 14:
return "{}w ago".format(tdel.days//7)
elif tdel.days > 1:
return "{}d ago".format(tdel.days)
elif tdel.seconds > 7200:
return "{}h ago".format((tdel.days*24)+(tdel.seconds//3600))
... |
2e2a00a075c7f59375f90ee8b1416800dddd53d1 | integration/main.py | integration/main.py | from spec import skip
def simple_command_on_host():
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts():
"""
Run command on localhost...twice!
"""
skip()
Batch(['localhost', 'localhost'])... | from spec import skip, Spec
class Main(Spec):
def simple_command_on_host(self):
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts(self):
"""
Run command on loc... | Move towards real spec usage | Move towards real spec usage
| Python | bsd-2-clause | fabric/fabric | from spec import skip
def simple_command_on_host():
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts():
"""
Run command on localhost...twice!
"""
skip()
Batch(['localhost', 'localhost'])... | from spec import skip, Spec
class Main(Spec):
def simple_command_on_host(self):
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts(self):
"""
Run command on loc... | <commit_before>from spec import skip
def simple_command_on_host():
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts():
"""
Run command on localhost...twice!
"""
skip()
Batch(['localhost'... | from spec import skip, Spec
class Main(Spec):
def simple_command_on_host(self):
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts(self):
"""
Run command on loc... | from spec import skip
def simple_command_on_host():
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts():
"""
Run command on localhost...twice!
"""
skip()
Batch(['localhost', 'localhost'])... | <commit_before>from spec import skip
def simple_command_on_host():
"""
Run command on host "localhost"
"""
skip()
Connection('localhost').run('echo foo')
# => Result
def simple_command_on_multiple_hosts():
"""
Run command on localhost...twice!
"""
skip()
Batch(['localhost'... |
42f0c76664337af80d692fe7649f3643c237cc47 | Tests/MathFunctionsTest.py | Tests/MathFunctionsTest.py | from Math.MathFunctions import *
def pointTest():
point1 = (0, 0)
point2 = (2, 4)
print("Point 1: {}".format(point1))
print("Point 2: {}".format(point2))
print("Point distance: {}".format(pointDistance(point1[0],point1[1],point2[0],point2[1])))
angle = pointAngle(point1[0],point1[1],point2[0],... | from Math.MathFunctions import *
import unittest
class TestPointMethods(unittest.TestCase):
def test_point(self):
point1 = (0, 0)
point2 = (2, 4)
angle = pointAngle(point1[0], point1[1], point2[0], point2[1])
dist = pointDistance(point1[0], point1[1], point2[0], point2[1])
... | Use python's unit testing framework | Use python's unit testing framework
| Python | mit | turtles/PythonScripts | from Math.MathFunctions import *
def pointTest():
point1 = (0, 0)
point2 = (2, 4)
print("Point 1: {}".format(point1))
print("Point 2: {}".format(point2))
print("Point distance: {}".format(pointDistance(point1[0],point1[1],point2[0],point2[1])))
angle = pointAngle(point1[0],point1[1],point2[0],... | from Math.MathFunctions import *
import unittest
class TestPointMethods(unittest.TestCase):
def test_point(self):
point1 = (0, 0)
point2 = (2, 4)
angle = pointAngle(point1[0], point1[1], point2[0], point2[1])
dist = pointDistance(point1[0], point1[1], point2[0], point2[1])
... | <commit_before>from Math.MathFunctions import *
def pointTest():
point1 = (0, 0)
point2 = (2, 4)
print("Point 1: {}".format(point1))
print("Point 2: {}".format(point2))
print("Point distance: {}".format(pointDistance(point1[0],point1[1],point2[0],point2[1])))
angle = pointAngle(point1[0],point... | from Math.MathFunctions import *
import unittest
class TestPointMethods(unittest.TestCase):
def test_point(self):
point1 = (0, 0)
point2 = (2, 4)
angle = pointAngle(point1[0], point1[1], point2[0], point2[1])
dist = pointDistance(point1[0], point1[1], point2[0], point2[1])
... | from Math.MathFunctions import *
def pointTest():
point1 = (0, 0)
point2 = (2, 4)
print("Point 1: {}".format(point1))
print("Point 2: {}".format(point2))
print("Point distance: {}".format(pointDistance(point1[0],point1[1],point2[0],point2[1])))
angle = pointAngle(point1[0],point1[1],point2[0],... | <commit_before>from Math.MathFunctions import *
def pointTest():
point1 = (0, 0)
point2 = (2, 4)
print("Point 1: {}".format(point1))
print("Point 2: {}".format(point2))
print("Point distance: {}".format(pointDistance(point1[0],point1[1],point2[0],point2[1])))
angle = pointAngle(point1[0],point... |
66bc45bb5cd8808bd65c4b796f3ca4d5564cccf8 | cell/results.py | cell/results.py | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | Add result property to AsyncResult (it blocks if the result has not been previously retrieved, or return the result otherwise) | Add result property to AsyncResult
(it blocks if the result has not been previously retrieved, or return the
result otherwise)
| Python | bsd-3-clause | celery/cell,celery/cell | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | <commit_before>"""cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | <commit_before>"""cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init... |
20562a167e24911873e83659bccfde94b0a91061 | do_the_tests.py | do_the_tests.py | from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| from runtests import Tester
import os.path
import sys
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| Add import back to test script | Add import back to test script
| Python | mit | sbird/fake_spectra,sbird/fake_spectra,sbird/fake_spectra | from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
Add import back to test script | from runtests import Tester
import os.path
import sys
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| <commit_before>from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
<commit_msg>Add import back to test script<commit_after> | from runtests import Tester
import os.path
import sys
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
Add import back to test scriptfrom runtests import Tester
import os.path
import sys
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
| <commit_before>from runtests import Tester
import os.path
tester = Tester(os.path.abspath(__file__), "fake_spectra")
tester.main(sys.argv[1:])
<commit_msg>Add import back to test script<commit_after>from runtests import Tester
import os.path
import sys
tester = Tester(os.path.abspath(__file__), "fake_spectra")
test... |
122b4e6982fe7a74ee668c1b146c32a61c72ec7b | armstrong/hatband/sites.py | armstrong/hatband/sites.py | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class AdminSite(DjangoAdminSite):
def get_urls(self):
from django.conf.urls.defaults import patterns, url
return patterns('',
# Custom hatband Views here
... | Simplify this code and make sure AdminSite doesn't act like a singleton | Simplify this code and make sure AdminSite doesn't act like a singleton
Create a faux-singleton for `AdminSite` and make sure it has a copy of
all of the previously registered models. This makes
`armstrong.hatband.site` look just like `django.contrib.admin.site`.
| Python | apache-2.0 | texastribune/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class AdminSite(DjangoAdminSite):
def get_urls(self):
from django.conf.urls.defaults import patterns, url
return patterns('',
# Custom hatband Views here
... | <commit_before>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(H... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class AdminSite(DjangoAdminSite):
def get_urls(self):
from django.conf.urls.defaults import patterns, url
return patterns('',
# Custom hatband Views here
... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | <commit_before>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(H... |
2f373227e16124ea63586c255a19b4919f1ec150 | functionaltests/__init__.py | functionaltests/__init__.py | """
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | Fix "invalid credentials" error running functional tests | Fix "invalid credentials" error running functional tests
This fixes the "invalid credentials" error that you will get
if you create a clean barbican environment and try to run the
functional tests. It is actually a workaround for a change
to tempest (see https://review.openstack.org/#/c/147778/) which
causes a config... | Python | apache-2.0 | cloudkeep/barbican,cneill/barbican,cloudkeep/barbican,MCDong/barbican,cneill/barbican,jmvrbanac/barbican,MCDong/barbican,openstack/barbican,openstack/barbican,jmvrbanac/barbican | Fix "invalid credentials" error running functional tests
This fixes the "invalid credentials" error that you will get
if you create a clean barbican environment and try to run the
functional tests. It is actually a workaround for a change
to tempest (see https://review.openstack.org/#/c/147778/) which
causes a config... | """
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | <commit_before><commit_msg>Fix "invalid credentials" error running functional tests
This fixes the "invalid credentials" error that you will get
if you create a clean barbican environment and try to run the
functional tests. It is actually a workaround for a change
to tempest (see https://review.openstack.org/#/c/147... | """
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | Fix "invalid credentials" error running functional tests
This fixes the "invalid credentials" error that you will get
if you create a clean barbican environment and try to run the
functional tests. It is actually a workaround for a change
to tempest (see https://review.openstack.org/#/c/147778/) which
causes a config... | <commit_before><commit_msg>Fix "invalid credentials" error running functional tests
This fixes the "invalid credentials" error that you will get
if you create a clean barbican environment and try to run the
functional tests. It is actually a workaround for a change
to tempest (see https://review.openstack.org/#/c/147... | |
5a102dfce418ec170a937ee50e3dbe0dac11bce9 | pinry/settings/local_settings.example.py | pinry/settings/local_settings.example.py | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | Add Pinry plugin config to local_settings.py | Feature: Add Pinry plugin config to local_settings.py
| Python | bsd-2-clause | pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,lapo-luchini/pinry | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | <commit_before>import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variabl... | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variable
SECRET_KEY = ... | <commit_before>import os
# Please don't change following settings unless you know what you are doing
STATIC_ROOT = '/data/static'
MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')
# SECURITY WARNING: keep the secret key used in production secret!
# Or just write your own secret-key here instead of using a env-variabl... |
ced02ae257246e700caa0da075d86becccc3b5c9 | jarn/viewdoc/colors.py | jarn/viewdoc/colors.py | import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(term.bold_blue)
gr... | import os
import functools
import blessed
def color(func):
assignments = functools.WRAPPER_ASSIGNMENTS
if not hasattr(func, '__name__'):
assignments = [x for x in assignments if x != '__name__']
@functools.wraps(func, assignments)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR'... | Fix wrapping in color decorator. | Fix wrapping in color decorator.
| Python | bsd-2-clause | Jarn/jarn.viewdoc | import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(term.bold_blue)
gr... | import os
import functools
import blessed
def color(func):
assignments = functools.WRAPPER_ASSIGNMENTS
if not hasattr(func, '__name__'):
assignments = [x for x in assignments if x != '__name__']
@functools.wraps(func, assignments)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR'... | <commit_before>import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(ter... | import os
import functools
import blessed
def color(func):
assignments = functools.WRAPPER_ASSIGNMENTS
if not hasattr(func, '__name__'):
assignments = [x for x in assignments if x != '__name__']
@functools.wraps(func, assignments)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR'... | import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(term.bold_blue)
gr... | <commit_before>import os
import functools
import blessed
def color(func):
functools.wraps(func)
def wrapper(string):
if os.environ.get('JARN_NO_COLOR') == '1':
return string
return func(string)
return wrapper
term = blessed.Terminal()
bold = color(term.bold)
blue = color(ter... |
8fadb2bb766bd3a18e7920a5dbf23669796330ff | src/mcedit2/rendering/scenegraph/bind_texture.py | src/mcedit2/rendering/scenegraph/bind_texture.py | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | Change BindTextureRenderNode to make fewer GL calls when the texture scale is None. | Change BindTextureRenderNode to make fewer GL calls when the texture scale is None.
| Python | bsd-3-clause | vorburger/mcedit2,vorburger/mcedit2 | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | <commit_before>"""
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.... | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | """
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.scenenode impor... | <commit_before>"""
bind_texture
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from OpenGL import GL
from mcedit2.rendering.scenegraph import rendernode
from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode
from mcedit2.rendering.scenegraph.... |
f3ce6fbb4f90e600955307e307d83103ef090d8f | watson-connector/watson_connector.py | watson-connector/watson_connector.py | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | Add fake IBM Watson response for testing | Add fake IBM Watson response for testing
| Python | mit | martialblog/watson-diary,martialblog/watson-diary,martialblog/watson-diary | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | <commit_before>#!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
... | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | #!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
self.db = db_c... | <commit_before>#!/usr/bin/env python3
import json
import watson_developer_cloud as wdc
from api_aggregator import ApiAggregator
class WatsonConnector():
"""
Handles the connection to IBM Watson, API calls and whatnot.
"""
def __init__(self, url, username, password, version, db_connector):
... |
ec2d3feff6a1677457dfeb5b948b2013bc03df2a | classes/admin.py | classes/admin.py | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | Add sessions inline to classes | Add sessions inline to classes
| Python | mit | thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee,thrive-refugee/thrive-refugee | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | <commit_before>from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbo... | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbose_name_plural ... | <commit_before>from django.contrib import admin
from classes.models import Attendee
from classes.models import Attendance
from classes.models import Session
from classes.models import WalkinClass
class AttendanceInline(admin.TabularInline):
model = Attendance
extra = 1
verbose_name = 'Attendee'
verbo... |
75c1d4a1c28efc690e230a6ad1d5244c9a84eb45 | coil/__init__.py | coil/__init__.py | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,8)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,9)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | Bump version to 0.3.9 for development. | Bump version to 0.3.9 for development.
Going forward I think I will use the even/odd version scheme to mark
development and stable versions to make minimum version checks easy. | Python | mit | tectronics/coil,tectronics/coil,marineam/coil,kovacsbalu/coil,marineam/coil,kovacsbalu/coil | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,8)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,9)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | <commit_before># Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,8)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
... | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,9)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | # Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,8)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
from coil.pars... | <commit_before># Copyright (c) 2005-2006 Itamar Shtull-Trauring.
# Copyright (c) 2008-2009 ITA Software, Inc.
# See LICENSE.txt for details.
"""Coil: A Configuration Library."""
__version_info__ = (0,3,8)
__version__ = ".".join([str(x) for x in __version_info__])
__all__ = ['struct', 'parser', 'tokenizer', 'errors']
... |
d8e5545a2397198b0f95854f86a4c4b0e39a42be | newsApp/loggingHelper.py | newsApp/loggingHelper.py | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | Hide ignorable error from googleApiClient | Hide ignorable error from googleApiClient
| Python | mit | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | <commit_before>#Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except... | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | #Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except critical ones ... | <commit_before>#Initialize the logging.
# InitLogging() should be called at the startup of each process in Procfile
import logging
def InitLogging():
"""
Initizalize the logging.
"""
logging.basicConfig(format='%(module)s:%(levelname)s:%(message)s', level=logging.INFO)
# suppress all logs except... |
b3c8ffd334df2c7669eb9f3a037ef6fa33fc521b | diylang/interpreter.py | diylang/interpreter.py | # -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it,... | # -*- coding: utf-8 -*-
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting... | Remove unused imports in interpeter. | Remove unused imports in interpeter. | Python | bsd-3-clause | codecop/diy-lang,codecop/diy-lang | # -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it,... | # -*- coding: utf-8 -*-
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting... | <commit_before># -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string,... | # -*- coding: utf-8 -*-
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it, and then
returns the resulting... | # -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string, interprets it,... | <commit_before># -*- coding: utf-8 -*-
from os.path import dirname, join
from .evaluator import evaluate
from .parser import parse, unparse, parse_multiple
from .types import Environment
def interpret(source, env=None):
"""
Interpret a DIY Lang program statement
Accepts a program statement as a string,... |
36b5bbba101b421234b4b776f4f4c2ac47516027 | indra/db/belief.py | indra/db/belief.py | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | Add function to populate support from links. | Add function to populate support from links.
| Python | bsd-2-clause | johnbachman/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,pvtodorov/indra,johnbachman/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,pvtodorov/indra | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | <commit_before>class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evide... | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evidence]
se... | <commit_before>class MockStatement(object):
"""A class to imitate real INDRA Statements for calculating belief."""
def __init__(self, mk_hash, evidence, supports=None, supported_by=None):
if isinstance(evidence, list):
self.evidence = evidence
else:
self.evidence = [evide... |
2d7c481c7c3d01a22759802a701e4c14789935d3 | django/__init__.py | django/__init__.py | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
| VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | Update django.VERSION in trunk per previous discussion | Update django.VERSION in trunk per previous discussion
git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@9103 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| Python | bsd-3-clause | FlaPer87/django-nonrel,aparo/django-nonrel,FlaPer87/django-nonrel,aparo/django-nonrel,aparo/django-nonrel,FlaPer87/django-nonrel | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
Update dj... | VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | <commit_before>VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
ret... | VERSION = (1, 1, 0, 'alpha', 0)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
version = '%s %s' % (version, VERSION[3])
if ... | VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
return v
Update dj... | <commit_before>VERSION = (1, 0, 'post-release-SVN')
def get_version():
"Returns the version as a human-format string."
v = '.'.join([str(i) for i in VERSION[:-1]])
if VERSION[-1]:
from django.utils.version import get_svn_revision
v = '%s-%s-%s' % (v, VERSION[-1], get_svn_revision())
ret... |
ab7c07078fb3fa2a5cbeda1ca04ddb91a7fb32a0 | oauth_provider/consts.py | oauth_provider/consts.py | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | Allow settings to override default lengths. | Allow settings to override default lengths.
| Python | bsd-3-clause | lukegb/django-oauth-plus,amrox/django-oauth-plus | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | <commit_before>from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | <commit_before>from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')... |
4b018935c4729aff0dfcff709331f840dd05e8b6 | kimochiconsumer/__init__.py | kimochiconsumer/__init__.py | from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_mako')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home',... | from pyramid.config import Configurator
import kimochiconsumer.kimochi
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
def get_kimochi(request):
return kimochi.Kimochi(settings['kimochi.url'],
settings['kimochi.api_key']... | Add kimochi client to request to make it available to views | Add kimochi client to request to make it available to views
| Python | mit | matslindh/kimochi-consumer | from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_mako')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home',... | from pyramid.config import Configurator
import kimochiconsumer.kimochi
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
def get_kimochi(request):
return kimochi.Kimochi(settings['kimochi.url'],
settings['kimochi.api_key']... | <commit_before>from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_mako')
config.add_static_view('static', 'static', cache_max_age=3600)
config.ad... | from pyramid.config import Configurator
import kimochiconsumer.kimochi
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
def get_kimochi(request):
return kimochi.Kimochi(settings['kimochi.url'],
settings['kimochi.api_key']... | from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_mako')
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home',... | <commit_before>from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_mako')
config.add_static_view('static', 'static', cache_max_age=3600)
config.ad... |
ebc5d1024c45a12595507fa1caa0bfc6353a9a32 | c2cgeoportal/views/echo.py | c2cgeoportal/views/echo.py | import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='echo')
def echo(request):
if request.method != 'POST':
raise HTTPBadRequest()
try:
file = request.POST['file']
exc... | from base64 import b64encode
import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
def base64_encode_chunks(file, chunk_size=57):
"""
Generate base64 encoded lines of up to 76 (== 57 * 8 / 6) characters, according... | Return a base64 text/html response instead of a binary response | Return a base64 text/html response instead of a binary response
| Python | bsd-2-clause | tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal | import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='echo')
def echo(request):
if request.method != 'POST':
raise HTTPBadRequest()
try:
file = request.POST['file']
exc... | from base64 import b64encode
import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
def base64_encode_chunks(file, chunk_size=57):
"""
Generate base64 encoded lines of up to 76 (== 57 * 8 / 6) characters, according... | <commit_before>import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='echo')
def echo(request):
if request.method != 'POST':
raise HTTPBadRequest()
try:
file = request.POST[... | from base64 import b64encode
import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
def base64_encode_chunks(file, chunk_size=57):
"""
Generate base64 encoded lines of up to 76 (== 57 * 8 / 6) characters, according... | import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='echo')
def echo(request):
if request.method != 'POST':
raise HTTPBadRequest()
try:
file = request.POST['file']
exc... | <commit_before>import os.path
import re
from pyramid.httpexceptions import HTTPBadRequest
from pyramid.response import Response
from pyramid.view import view_config
@view_config(route_name='echo')
def echo(request):
if request.method != 'POST':
raise HTTPBadRequest()
try:
file = request.POST[... |
089af405b331ecfa2cb0cf9a74423c392beea4e4 | lazysignup/test_settings.py | lazysignup/test_settings.py | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | Remove the now-defunct middleware from the test settings | Remove the now-defunct middleware from the test settings
| Python | bsd-3-clause | rwillmer/django-lazysignup,stefanklug/django-lazysignup,rwillmer/django-lazysignup,danfairs/django-lazysignup,danfairs/django-lazysignup,stefanklug/django-lazysignup | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | <commit_before># Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DA... | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | # Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '... | <commit_before># Settings to be used when running unit tests
# python manage.py test --settings=lazysignup.test_settings lazysignup
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DA... |
fa9fc567e9dcbfa5f301e3c998f87699f9ee11d5 | magnumclient/magnum.py | magnumclient/magnum.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | Add service API methods to what should be implemented | Add service API methods to what should be implemented
Add service API methods
| Python | apache-2.0 | openstack/python-magnumclient,ramielrowe/python-magnumclient,ramielrowe/python-magnumclient | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distri... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | <commit_before># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distri... |
eace27e618187860564de9501aabcb360112025a | matchmaker/skill.py | matchmaker/skill.py | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
MatchResult.bot,
func.sum(MatchResult.delta_ch... | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank, BotIdentity
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
BotIdentity.id,
func.coalesce(fun... | Add bots with no games to the leaderboard | Add bots with no games to the leaderboard
| Python | mit | gnmerritt/casino,gnmerritt/casino,gnmerritt/casino,gnmerritt/casino | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
MatchResult.bot,
func.sum(MatchResult.delta_ch... | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank, BotIdentity
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
BotIdentity.id,
func.coalesce(fun... | <commit_before>import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
MatchResult.bot,
func.sum(Match... | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank, BotIdentity
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
BotIdentity.id,
func.coalesce(fun... | import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
MatchResult.bot,
func.sum(MatchResult.delta_ch... | <commit_before>import datetime
from sqlalchemy.sql import func
from models import MatchResult, BotSkill, BotRank
class SkillUpdater(object):
def run(self, db):
session = db.session
today = datetime.date.today()
skills = session.query(
MatchResult.bot,
func.sum(Match... |
327b3c12924c14864d0101bb80104db1e975503e | python/pyhit/__init__.py | python/pyhit/__init__.py | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
try:
from . import hit
e... | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
hit_dir = os.path.join(moose_dir, 'f... | Add known location for HIT when loading pyhit | Add known location for HIT when loading pyhit
(refs #17108)
| Python | lgpl-2.1 | idaholab/moose,laagesen/moose,SudiptaBiswas/moose,SudiptaBiswas/moose,idaholab/moose,jessecarterMOOSE/moose,andrsd/moose,laagesen/moose,dschwen/moose,milljm/moose,jessecarterMOOSE/moose,sapitts/moose,andrsd/moose,sapitts/moose,SudiptaBiswas/moose,bwspenc/moose,nuclear-wizard/moose,laagesen/moose,nuclear-wizard/moose,ds... | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
try:
from . import hit
e... | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
hit_dir = os.path.join(moose_dir, 'f... | <commit_before>import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
try:
from . i... | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
hit_dir = os.path.join(moose_dir, 'f... | import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
try:
from . import hit
e... | <commit_before>import os
import sys
import subprocess
import mooseutils
moose_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
status = mooseutils.git_submodule_status(moose_dir)
# Use framework/contrib/hit because moosetools submodule is not available
if status['moosetools'] == '-':
try:
from . i... |
be27ec6d2567b85b94b40c79570ca5d9c20fd0bf | modeltrans/admin.py | modeltrans/admin.py | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Hide all translated fields, except:
- The field for the default language (settings.LANGUAGE_CODE)
- The field for the currently active language.
''... | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Add this mixin to your admin class to hide the untranslated field and all
translated fields, except:
- The field for the default language (settings.LAN... | Improve ActiveLanguageMixin to hide original field | Improve ActiveLanguageMixin to hide original field
| Python | bsd-3-clause | zostera/django-modeltrans,zostera/django-modeltrans | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Hide all translated fields, except:
- The field for the default language (settings.LANGUAGE_CODE)
- The field for the currently active language.
''... | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Add this mixin to your admin class to hide the untranslated field and all
translated fields, except:
- The field for the default language (settings.LAN... | <commit_before>from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Hide all translated fields, except:
- The field for the default language (settings.LANGUAGE_CODE)
- The field for the currently active l... | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Add this mixin to your admin class to hide the untranslated field and all
translated fields, except:
- The field for the default language (settings.LAN... | from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Hide all translated fields, except:
- The field for the default language (settings.LANGUAGE_CODE)
- The field for the currently active language.
''... | <commit_before>from .conf import get_default_language
from .translator import get_i18n_field
from .utils import get_language
class ActiveLanguageMixin(object):
'''
Hide all translated fields, except:
- The field for the default language (settings.LANGUAGE_CODE)
- The field for the currently active l... |
c32de922e3e7419d58a8cd7c1a00cf53833c49c7 | mpltools/io/core.py | mpltools/io/core.py | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt='png', default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible, and multiple
file formats can be saved by specifying a list of extensions.
Parameters
-------... | Simplify handling of image format. | Simplify handling of image format.
| Python | bsd-3-clause | matteoicardi/mpltools,tonysyu/mpltools | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt='png', default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible, and multiple
file formats can be saved by specifying a list of extensions.
Parameters
-------... | <commit_before>import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt='png', default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible, and multiple
file formats can be saved by specifying a list of extensions.
Parameters
-------... | import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
fmt : str, l... | <commit_before>import os
import matplotlib.pyplot as plt
def save_all_figs(directory='./', fmt=None, default_name='untitled%i'):
"""Save all open figures.
Each figure is saved with the title of the plot, if possible.
Parameters
------------
directory : str
Path where figures are saved.
... |
6d4573445692b86c4b406a4b1d93ce19199c328a | brp/accounts/migrations/0001_initial.py | brp/accounts/migrations/0001_initial.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | Adjust migration for new structure | Adjust migration for new structure
| Python | bsd-2-clause | chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal,chop-dbhi/biorepo-portal | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | <commit_before># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models... | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models.fields.AutoFie... | <commit_before># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration, DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_table(u'accounts_userprofile', (
('id', self.gf('django.db.models... |
8c097f07eca52dc37e8d3d4591bb9ee1c05fa310 | calexicon/calendars/tests/test_other.py | calexicon/calendars/tests/test_other.py | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | Add a new test - on date to day number conversion. | Add a new test - on date to day number conversion.
| Python | apache-2.0 | jwg4/qual,jwg4/calexicon | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | <commit_before>from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(201... | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(2010, 8, 1)
... | <commit_before>from datetime import date as vanilla_date
from calendar_testing import CalendarTest
from calexicon.calendars.other import JulianDayNumber
class TestJulianDayNumber(CalendarTest):
def setUp(self):
self.calendar = JulianDayNumber()
def test_make_date(self):
vd = vanilla_date(201... |
5161d6c0023151d39fb56a85f739063205e676f4 | nova/api/manager.py | nova/api/manager.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | Initialize iptables rules on initialization of MetadataManager | Initialize iptables rules on initialization of MetadataManager
To avoid multiple initialization of iptables rules if there are a few
workers for metadata service, perform iptables configuration in
__init__() of MetadataManager.
Change-Id: I674c04f973318f06cbb98693f0a884c824af8748
Closes-Bug: #1097999
| Python | apache-2.0 | noironetworks/nova,orbitfp7/nova,eayunstack/nova,badock/nova,JioCloud/nova,CEG-FYP-OpenStack/scheduler,badock/nova,mikalstill/nova,gooddata/openstack-nova,LoHChina/nova,rahulunair/nova,jeffrey4l/nova,shahar-stratoscale/nova,vmturbo/nova,scripnichenko/nova,mandeepdhami/nova,cyx1231st/nova,felixma/nova,luogangyi/bcec-nov... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | <commit_before># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file e... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | <commit_before># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file e... |
17b184e5c8d41eb083dc6400f6fca2a3eeb8f742 | core/admin/mailu/internal/views.py | core/admin/mailu/internal/views.py | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main authentication endpoint for ... | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
import base64
import urllib
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main ... | Implement a basic authentication API | Implement a basic authentication API
| Python | mit | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main authentication endpoint for ... | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
import base64
import urllib
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main ... | <commit_before>from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main authenticatio... | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
import base64
import urllib
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main ... | from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main authentication endpoint for ... | <commit_before>from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@limiter.limit(
app.config["AUTH_RATELIMIT"],
lambda: flask.request.headers["Client-Ip"]
)
def nginx_authentication():
""" Main authenticatio... |
c7c1fa91a0ec213bd648f2f50f95f5652891d3ab | main/readability_graph.py | main/readability_graph.py | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT ari FROM comment_feature_read', None)
print('Got results')
values = [ result[i]['ari'] for i in result ]... | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT * FROM comment_feature_read LIMIT 100', None)
print('Got results')
values = [ result[i]['ari'] for i in... | Add other statistical measures for graphing | Add other statistical measures for graphing
| Python | mit | worldwise001/stylometry | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT ari FROM comment_feature_read', None)
print('Got results')
values = [ result[i]['ari'] for i in result ]... | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT * FROM comment_feature_read LIMIT 100', None)
print('Got results')
values = [ result[i]['ari'] for i in... | <commit_before>import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT ari FROM comment_feature_read', None)
print('Got results')
values = [ result[i]['ari'] fo... | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT * FROM comment_feature_read LIMIT 100', None)
print('Got results')
values = [ result[i]['ari'] for i in... | import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT ari FROM comment_feature_read', None)
print('Got results')
values = [ result[i]['ari'] for i in result ]... | <commit_before>import graph
from corpus.mysql.reddit import RedditMySQLCorpus
import cred
if __name__ == '__main__':
corpus = RedditMySQLCorpus()
corpus.setup(**(cred.kwargs))
result = corpus.run_sql('SELECT ari FROM comment_feature_read', None)
print('Got results')
values = [ result[i]['ari'] fo... |
7d988a0d622496065e3b1acbb9f4a32fa3678c9e | manager/manager/themes.py | manager/manager/themes.py | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.0"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.3"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | Update Thema version static string | chore(Dev): Update Thema version static string
| Python | apache-2.0 | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.0"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.3"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | <commit_before># Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.0"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "... | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.3"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | # Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.0"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "galleria"
g... | <commit_before># Generated by generate.js. Commit this file, but do not edit it.
from manager.helpers import EnumChoice
# The version of Thema to use
version = "2.20.0"
class Themes(EnumChoice):
"""The list of Thema themes."""
bootstrap = "bootstrap"
elife = "elife"
f1000 = "f1000"
galleria = "... |
00ee7549c900d8c3bcae94141a8b8c774d943731 | examples/new_member.py | examples/new_member.py | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
await guild.default_channel.send('Welcome {0.men... | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
... | Update new member example to not be broken. | Update new member example to not be broken.
Took forever but better late than never.
| Python | mit | imayhaveborkedit/discord.py,Harmon758/discord.py,Rapptz/discord.py,Harmon758/discord.py,khazhyk/discord.py,rapptz/discord.py | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
await guild.default_channel.send('Welcome {0.men... | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
... | <commit_before>import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
await guild.default_channel.send(... | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
if guild.system_channel is not None:
... | import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
await guild.default_channel.send('Welcome {0.men... | <commit_before>import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_member_join(self, member):
guild = member.guild
await guild.default_channel.send(... |
3588c52060b540f6d3ca791c7309b4e9185a60aa | config.py | config.py | class Config(object):
"""
Base configuration class. Contains one method that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
def __init__(self):
self.database_uri()
def database_uri(self):
if self.DIALECT == 'sqlite':
... | class Config(object):
"""
Base configuration class. Contains one property that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
@property
def database_uri(self):
return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqli... | Replace database_uri method with a property | Replace database_uri method with a property
| Python | mit | soccermetrics/marcotti-mls | class Config(object):
"""
Base configuration class. Contains one method that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
def __init__(self):
self.database_uri()
def database_uri(self):
if self.DIALECT == 'sqlite':
... | class Config(object):
"""
Base configuration class. Contains one property that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
@property
def database_uri(self):
return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqli... | <commit_before>class Config(object):
"""
Base configuration class. Contains one method that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
def __init__(self):
self.database_uri()
def database_uri(self):
if self.DIALECT == 'sql... | class Config(object):
"""
Base configuration class. Contains one property that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
@property
def database_uri(self):
return r'sqlite://{name}'.format(name=self.DBNAME) if self.DIALECT == 'sqli... | class Config(object):
"""
Base configuration class. Contains one method that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
def __init__(self):
self.database_uri()
def database_uri(self):
if self.DIALECT == 'sqlite':
... | <commit_before>class Config(object):
"""
Base configuration class. Contains one method that defines the database URI.
This class is to be subclassed and its attributes defined therein.
"""
def __init__(self):
self.database_uri()
def database_uri(self):
if self.DIALECT == 'sql... |
e3f6b604c90032dc1fb9dcc9838f11aa10498dae | pi_approach/UI/main.py | pi_approach/UI/main.py | # Touchscreen Kivy Interface for Lidar Project
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_slider = self.... | # Touchscreen Kivy Interface for Lidar Project
import socket
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_... | Create a server class from scratch | Create a server class from scratch
| Python | mit | the-raspberry-pi-guy/lidar | # Touchscreen Kivy Interface for Lidar Project
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_slider = self.... | # Touchscreen Kivy Interface for Lidar Project
import socket
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_... | <commit_before># Touchscreen Kivy Interface for Lidar Project
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value... | # Touchscreen Kivy Interface for Lidar Project
import socket
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_... | # Touchscreen Kivy Interface for Lidar Project
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value_slider = self.... | <commit_before># Touchscreen Kivy Interface for Lidar Project
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.core.window import Window
#Window.clearcolor=(1,1,1,1)
class Init_Screen(GridLayout):
pass
class Main_Screen(GridLayout):
angle = 0
def change_value(self, *args):
value... |
512ec31a3c022bc8a31d57bc51e4e6dac29dcf83 | src/sentry/web/frontend/organization_api_key_settings.py | src/sentry/web/frontend/organization_api_key_settings.py | from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry.web.frontend.base import OrganizationView
class ApiKeyForm(forms.ModelForm):
... | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry... | Allow key settings to be saved | Allow key settings to be saved
| Python | bsd-3-clause | hongliang5623/sentry,TedaLIEz/sentry,gg7/sentry,ifduyue/sentry,wujuguang/sentry,boneyao/sentry,fuziontech/sentry,fuziontech/sentry,pauloschilling/sentry,mvaled/sentry,JackDanger/sentry,imankulov/sentry,kevinlondon/sentry,kevinlondon/sentry,vperron/sentry,looker/sentry,Natim/sentry,looker/sentry,beeftornado/sentry,Kryz/... | from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry.web.frontend.base import OrganizationView
class ApiKeyForm(forms.ModelForm):
... | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry... | <commit_before>from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry.web.frontend.base import OrganizationView
class ApiKeyForm(form... | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry... | from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry.web.frontend.base import OrganizationView
class ApiKeyForm(forms.ModelForm):
... | <commit_before>from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.models import ApiKey, OrganizationMemberType
from sentry.web.forms.fields import OriginsField
from sentry.web.frontend.base import OrganizationView
class ApiKeyForm(form... |
91835ee095aaa36cb44ed0bca691045678a32703 | wrapper_functions.py | wrapper_functions.py | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | Change number of cores for submit | Change number of cores for submit
| Python | mit | MadsJensen/malthe_alpha_project,MadsJensen/malthe_alpha_project | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | <commit_before>"""
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020... | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | """
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020", "0021",
... | <commit_before>"""
Doc string here.
@author mje
@email: mads [] cnru.dk
"""
import sys
import subprocess
cmd = "/usr/local/common/meeg-cfin/configurations/bin/submit_to_isis"
subjects = ["0004", "0005", "0006", "0007", "0008", "0009", "0010", "0011",
"0012", "0013", "0014", "0015", "0016", "0017", "0020... |
ecea45689fdebf409b06311cc8e84b2e609967e1 | manila/tests/fake_driver.py | manila/tests/fake_driver.py | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Fix failing of unittests in one thread | Fix failing of unittests in one thread
With change of default driver, that is used for unittests one additional
method 'ensure_share' was not mocked, that caused problems running
unittests in one thread.
Change-Id: Iea08207bb6200c37f5608d222dccdfbdc509b234
Closes-Bug: #1358854
| Python | apache-2.0 | vponomaryov/manila,weiting-chen/manila,jcsp/manila,openstack/manila,sajuptpm/manila,sajuptpm/manila,scality/manila,bswartz/manila,NetApp/manila,scality/manila,vponomaryov/manila,jcsp/manila,redhat-openstack/manila,redhat-openstack/manila,openstack/manila,NetApp/manila,weiting-chen/manila,bswartz/manila | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
fd4c7e3af81a4a37462dfcd7c3ac4eb43bdafcb2 | crmapp/subscribers/models.py | crmapp/subscribers/models.py | from django.db import models
from django.contrib.auth.models import User
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=50)
state = models... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
import stripe
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = m... | Create the Subscriber Form - Part III > Create Stripe Processing Code | Create the Subscriber Form - Part III > Create Stripe Processing Code
| Python | mit | deenaariff/Django,tabdon/crmeasyapp,tabdon/crmeasyapp | from django.db import models
from django.contrib.auth.models import User
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=50)
state = models... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
import stripe
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = m... | <commit_before>from django.db import models
from django.contrib.auth.models import User
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=50)
... | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
import stripe
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = m... | from django.db import models
from django.contrib.auth.models import User
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=50)
state = models... | <commit_before>from django.db import models
from django.contrib.auth.models import User
class Subscriber(models.Model):
user_rec = models.ForeignKey(User)
address_one = models.CharField(max_length=100)
address_two = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=50)
... |
25a95d34fcfa9447302ec399affdee14e0362cd7 | write_graphs.py | write_graphs.py | """Save graphical representations of all the lyman workflows."""
import os
import re
from glob import glob
from lyman import workflows as wf
from nipype import config
def main():
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [k for k in dir(wf)... | """Save graphical representations of all the lyman workflows."""
import os
import re
import sys
from glob import glob
from lyman import workflows as wf
from nipype import config
def main(arglist):
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [... | Allow for writing specific graph images | Allow for writing specific graph images
| Python | bsd-3-clause | tuqc/lyman,mwaskom/lyman,kastman/lyman | """Save graphical representations of all the lyman workflows."""
import os
import re
from glob import glob
from lyman import workflows as wf
from nipype import config
def main():
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [k for k in dir(wf)... | """Save graphical representations of all the lyman workflows."""
import os
import re
import sys
from glob import glob
from lyman import workflows as wf
from nipype import config
def main(arglist):
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [... | <commit_before>"""Save graphical representations of all the lyman workflows."""
import os
import re
from glob import glob
from lyman import workflows as wf
from nipype import config
def main():
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [k f... | """Save graphical representations of all the lyman workflows."""
import os
import re
import sys
from glob import glob
from lyman import workflows as wf
from nipype import config
def main(arglist):
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [... | """Save graphical representations of all the lyman workflows."""
import os
import re
from glob import glob
from lyman import workflows as wf
from nipype import config
def main():
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [k for k in dir(wf)... | <commit_before>"""Save graphical representations of all the lyman workflows."""
import os
import re
from glob import glob
from lyman import workflows as wf
from nipype import config
def main():
config.set('logging', 'workflow_level', 'CRITICAL')
# Find the functions that create workflows
wf_funcs = [k f... |
89971ece16ee1c062a8a54fa5cd83c473628c2ba | pyanyapi/helpers.py | pyanyapi/helpers.py | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | Remove unused line from cached_property | Remove unused line from cached_property
| Python | mit | gorlemik/pyanyapi,Stranger6667/pyanyapi | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | <commit_before># coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, ins... | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | # coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, instance, type=Non... | <commit_before># coding: utf-8
"""
Functions to dynamically attach attributes to classes.
Most of parsing result is cached because of immutability of input data.
"""
class cached_property(object):
"""
Copied from Django.
"""
def __init__(self, func):
self.func = func
def __get__(self, ins... |
fd0c368d6527c1a20e904ff911238d4e75811e4f | pykeg/core/tests.py | pykeg/core/tests.py | """Builds a test suite for all tests in the 'core' directory.
The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest
import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_unittest
import ... | # Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | Update unittest suite for new modules. | Update unittest suite for new modules.
| Python | mit | Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server | """Builds a test suite for all tests in the 'core' directory.
The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest
import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_unittest
import ... | # Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | <commit_before>"""Builds a test suite for all tests in the 'core' directory.
The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest
import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_u... | # Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | """Builds a test suite for all tests in the 'core' directory.
The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest
import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_unittest
import ... | <commit_before>"""Builds a test suite for all tests in the 'core' directory.
The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest
import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_u... |
3301e7101cb73674047613ef8a20c16cd2d504da | mots_vides/tests/factory.py | mots_vides/tests/factory.py | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | Complete the list of expected tests | Complete the list of expected tests
| Python | bsd-3-clause | Fantomas42/mots-vides,Fantomas42/mots-vides | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | <commit_before>"""
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | """
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... | <commit_before>"""
Tests for StopWordFactory
"""
import os
from unittest import TestCase
from mots_vides.stop_words import StopWord
from mots_vides.factory import StopWordFactory
class StopWordFactoryTestCase(TestCase):
def setUp(self):
self.data_directory = os.path.join(
os.path.dirname(
... |
c0d84ec83dcd62f556cbd236abd40d54e15b1008 | fabric/__init__.py | fabric/__init__.py | from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
| from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
from version import get_version
| Update public API to include get_version() so setup.py doesn't die. | Update public API to include get_version() so setup.py doesn't die.
Thanks to Curt Micol.
| Python | bsd-2-clause | xLegoz/fabric,pashinin/fabric,tekapo/fabric,pgroudas/fabric,bitmonk/fabric,jaraco/fabric,amaniak/fabric,cmattoon/fabric,askulkarni2/fabric,StackStorm/fabric,haridsv/fabric,TarasRudnyk/fabric,ericholscher/fabric,ploxiln/fabric,kxxoling/fabric,fernandezcuesta/fabric,rbramwell/fabric,hrubi/fabric,raimon49/fabric,bspink/fa... | from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
Update public API to include get_version() so setup.py doesn't die.
Thanks to Curt Micol. | from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
from version import get_version
| <commit_before>from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
<commit_msg>Update public API to include get_version() so setup.py doesn't die.
Thanks to Curt ... | from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
from version import get_version
| from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
Update public API to include get_version() so setup.py doesn't die.
Thanks to Curt Micol.from context_managers... | <commit_before>from context_managers import warnings_only
from decorators import hosts, roles, runs_once
from operations import require, prompt, put, get, run, sudo, local
from state import env
from utils import abort, warn
<commit_msg>Update public API to include get_version() so setup.py doesn't die.
Thanks to Curt ... |
59c9b0a3914920c19c9ccdbf5d77e4ce990d7d58 | rdmo/core/models.py | rdmo/core/models.py | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | Add value to return if nothing is found | Add value to return if nothing is found
| Python | apache-2.0 | rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | <commit_before>from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_n... | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_name=_('created'... | <commit_before>from django.db import models
from django.utils.timezone import now
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rdmo.core.utils import get_languages
class Model(models.Model):
created = models.DateTimeField(editable=False, verbose_n... |
91de92361ae02d796da4ef6b58ac8e63ca437614 | dataviva/apps/partners/models.py | dataviva/apps/partners/models.py | from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
| from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
active = db.Column(db.Integer)
| Add colunm active in calls tables. | Add colunm active in calls tables.
| Python | mit | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
Add colunm active in calls tables. | from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
active = db.Column(db.Integer)
| <commit_before>from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
<commit_msg>Add colunm active in calls tables.<commit_after> | from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
active = db.Column(db.Integer)
| from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
Add colunm active in calls tables.from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_cal... | <commit_before>from dataviva import db
class Call(db.Model):
__tablename__ = 'partner_call'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(400))
link = db.Column(db.String(250))
<commit_msg>Add colunm active in calls tables.<commit_after>from dataviva import db
class Call(db... |
881d41b2fc465d018a1247419b6a2487c71b88b4 | pft/tests/test_basics.py | pft/tests/test_basics.py | """Basic Unit Tests."""
import unittest
from flask import current_app
from .. import create_app
from ..database import db
class BasicsTestCase(unittest.TestCase):
"""Basic Test Case."""
def setUp(self):
"""Set up tests."""
self.app = create_app('testing')
self.app_context = self.app.a... | """Basic Unit Tests."""
import pytest
from flask import current_app
from .. import create_app
from ..database import db
@pytest.fixture(autouse=True)
def initialise_testing_db():
"""Create database before testing, delete after."""
app = create_app('testing')
app_context = app.app_context()
app_context... | Convert basic tests to pytest | Convert basic tests to pytest
| Python | unknown | gregcowell/BAM,gregcowell/PFT,gregcowell/PFT,gregcowell/BAM | """Basic Unit Tests."""
import unittest
from flask import current_app
from .. import create_app
from ..database import db
class BasicsTestCase(unittest.TestCase):
"""Basic Test Case."""
def setUp(self):
"""Set up tests."""
self.app = create_app('testing')
self.app_context = self.app.a... | """Basic Unit Tests."""
import pytest
from flask import current_app
from .. import create_app
from ..database import db
@pytest.fixture(autouse=True)
def initialise_testing_db():
"""Create database before testing, delete after."""
app = create_app('testing')
app_context = app.app_context()
app_context... | <commit_before>"""Basic Unit Tests."""
import unittest
from flask import current_app
from .. import create_app
from ..database import db
class BasicsTestCase(unittest.TestCase):
"""Basic Test Case."""
def setUp(self):
"""Set up tests."""
self.app = create_app('testing')
self.app_conte... | """Basic Unit Tests."""
import pytest
from flask import current_app
from .. import create_app
from ..database import db
@pytest.fixture(autouse=True)
def initialise_testing_db():
"""Create database before testing, delete after."""
app = create_app('testing')
app_context = app.app_context()
app_context... | """Basic Unit Tests."""
import unittest
from flask import current_app
from .. import create_app
from ..database import db
class BasicsTestCase(unittest.TestCase):
"""Basic Test Case."""
def setUp(self):
"""Set up tests."""
self.app = create_app('testing')
self.app_context = self.app.a... | <commit_before>"""Basic Unit Tests."""
import unittest
from flask import current_app
from .. import create_app
from ..database import db
class BasicsTestCase(unittest.TestCase):
"""Basic Test Case."""
def setUp(self):
"""Set up tests."""
self.app = create_app('testing')
self.app_conte... |
550c9754f3e3a93c5ece36befb3ecbcffc6a3d2b | helper.py | helper.py | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | Add y to the check true function | Add y to the check true function
This is an obvious omision.
| Python | mit | scimusmn/transit | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | <commit_before>from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" +... | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" + wrapper, bold=... | <commit_before>from fabric.api import hide, settings
from fabric.colors import blue
from contextlib import contextmanager
def header(txt):
"""Decorate a string to make it stand out as a header. """
wrapper = "------------------------------------------------------"
return blue(wrapper + "\n" + txt + "\n" +... |
f2abc1d265d7eed57223a14009900db7e622d7f6 | simpleflow/swf/process/worker/dispatch/dynamic_dispatcher.py | simpleflow/swf/process/worker/dispatch/dynamic_dispatcher.py | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | Improve error message on DispatchError's | Improve error message on DispatchError's
| Python | mit | botify-labs/simpleflow,botify-labs/simpleflow | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | <commit_before># -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod... | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | # -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod
def dispat... | <commit_before># -*- coding: utf-8 -*-
import importlib
from simpleflow.activity import Activity
from .exceptions import DispatchError
class Dispatcher(object):
"""
Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher
but without a hierarchy.
"""
@staticmethod... |
b4207380bc5b8639397e3d1d9a4b70069ef8d6e7 | hydrachain/__init__.py | hydrachain/__init__.py | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | Allow version parsing code to use non-annotated tags | Allow version parsing code to use non-annotated tags | Python | mit | HydraChain/hydrachain,wangkangda/hydrachain,HydraChain/hydrachain,wangkangda/hydrachain | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | <commit_before># -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
... | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | # -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | <commit_before># -*- coding: utf-8 -*-
# ############# version ##################
from pkg_resources import get_distribution, DistributionNotFound
import os.path
import subprocess
import re
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
... |
c27020fc832ce9cba8efee72034c32bb7a3e6b30 | path_and_address/parsing.py | path_and_address/parsing.py | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | Allow integer ports in split_address. | Bugfix: Allow integer ports in split_address.
| Python | mit | joeyespo/path-and-address | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | <commit_before>from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
... | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
path = None
... | <commit_before>from .validation import valid_hostname, valid_port
def resolve(path_or_address=None, address=None, *ignored):
"""Returns (path, address) based on consecutive optional arguments, [path] [address]."""
if path_or_address is None or address is not None:
return path_or_address, address
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.