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
c43820a2e26dd4f87c36b986a9a0af80b409f659
sentence_extractor.py
sentence_extractor.py
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
Update regex to match sentences starting with ÅÄÖ
Update regex to match sentences starting with ÅÄÖ
Python
mit
Xaril/sentence-extractor,Xaril/sentence-extractor
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
<commit_before>import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory,...
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory, the # program ...
<commit_before>import textract import sys import os import re import random ################################### # Extracts text from a pdf file and # selects one sentence, which it # then prints. # # Created by Fredrik Omstedt. ################################### # Extracts texts from pdf files. If given a directory,...
b2f6a318434f33f39c9d3bc6e738b6b0eba508c9
tensorflow_cloud/__init__.py
tensorflow_cloud/__init__.py
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Allow user access to remote flag
Allow user access to remote flag
Python
apache-2.0
tensorflow/cloud,tensorflow/cloud
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
<commit_before># Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
<commit_before># Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
c8cc1f8e0e9b6d7dfb29ff9aef04bf2b5867cceb
genomediff/records.py
genomediff/records.py
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
Raise AttributeError if key does not exist when trying to get it from a Record
Raise AttributeError if key does not exist when trying to get it from a Record
Python
mit
biosustain/genomediff-python
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
<commit_before>class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record...
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record(object): d...
<commit_before>class Metadata(object): def __init__(self, name, value): self.name = name self.value = value def __repr__(self): return "Metadata({}, {})".format(repr(self.name), repr(self.value)) def __eq__(self, other): return self.__dict__ == other.__dict__ class Record...
9aace6d89642e5025692b25e2c6253544ed580a6
social_auth/models.py
social_auth/models.py
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
Remove max_length from TextFields and replace short text fields with CharFields
Remove max_length from TextFields and replace short text fields with CharFields
Python
bsd-3-clause
michael-borisov/django-social-auth,krvss/django-social-auth,thesealion/django-social-auth,lovehhf/django-social-auth,sk7/django-social-auth,dongguangming/django-social-auth,czpython/django-social-auth,beswarm/django-social-auth,adw0rd/django-social-auth,MjAbuz/django-social-auth,VishvajitP/django-social-auth,MjAbuz/dja...
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
<commit_before>"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.T...
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.TextField() ...
<commit_before>"""Social auth models""" from django.db import models from django.contrib.auth.models import User class UserSocialAuth(models.Model): """Social Auth association model""" user = models.ForeignKey(User, related_name='social_auth') provider = models.CharField(max_length=32) uid = models.T...
eca73e0c57042593f7e65446e26e63790c5cf2aa
notes/admin.py
notes/admin.py
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
Complete removal of reversion usage
Complete removal of reversion usage
Python
agpl-3.0
leonhandreke/snowy,NoUsername/PrivateNotesExperimental,jaredjennings/snowy,GNOME/snowy,sandyarmstrong/snowy,syskill/snowy,syskill/snowy,NoUsername/PrivateNotesExperimental,sandyarmstrong/snowy,jaredjennings/snowy,jaredjennings/snowy,widox/snowy,jaredjennings/snowy,nekohayo/snowy,nekohayo/snowy,widox/snowy,GNOME/snowy,l...
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
<commit_before># # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ve...
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
# # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # This...
<commit_before># # Copyright (c) 2009 Brad Taylor <[email protected]> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later ve...
630ba21f3b08dcd2685297b057cbee4b6abee6f7
us_ignite/sections/models.py
us_ignite/sections/models.py
from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField(upload_to="sponsor") order = models.IntegerField(default=0) class Meta: ordering = ('order', ) def __unicode__(self): ...
from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField( upload_to="sponsor", help_text='This image is not post processed. ' 'Please make sure it has the right design specs.') ...
Add help text describing the image field functionality.
Add help text describing the image field functionality.
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.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField(upload_to="sponsor") order = models.IntegerField(default=0) class Meta: ordering = ('order', ) def __unicode__(self): ...
from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField( upload_to="sponsor", help_text='This image is not post processed. ' 'Please make sure it has the right design specs.') ...
<commit_before>from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField(upload_to="sponsor") order = models.IntegerField(default=0) class Meta: ordering = ('order', ) def __un...
from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField( upload_to="sponsor", help_text='This image is not post processed. ' 'Please make sure it has the right design specs.') ...
from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField(upload_to="sponsor") order = models.IntegerField(default=0) class Meta: ordering = ('order', ) def __unicode__(self): ...
<commit_before>from django.db import models class Sponsor(models.Model): name = models.CharField(max_length=255) website = models.URLField(max_length=500) image = models.ImageField(upload_to="sponsor") order = models.IntegerField(default=0) class Meta: ordering = ('order', ) def __un...
5edeb2e484eae8ac81898f92369f06dfed78908c
tests/test_KociembaSolver.py
tests/test_KociembaSolver.py
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
Increase number of Kociemba test iterations to 100
Increase number of Kociemba test iterations to 100
Python
mit
Wiston999/python-rubik
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
<commit_before>from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.K...
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.KociembaSolver(c...
<commit_before>from src.Move import Move from src.NaiveCube import NaiveCube from src.Cubie import Cube from src.Solver import Kociemba import timeout_decorator import unittest class TestKociembaSolver(unittest.TestCase): @timeout_decorator.timeout(300) def _test_solution(self, c): solver = Kociemba.K...
850d5189d3159f7cab6c509a2dd58c9f427c0bfc
examples/python/find_events.py
examples/python/find_events.py
from gi.repository import Zeitgeist log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None)
from gi.repository import Zeitgeist, Gtk log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) Gtk.main()
Add loop to the python example
Add loop to the python example
Python
lgpl-2.1
freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist,freedesktop-unofficial-mirror/zeitgeist__zeitgeist
from gi.repository import Zeitgeist log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) Add loop to the python example
from gi.repository import Zeitgeist, Gtk log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) Gtk.main()
<commit_before>from gi.repository import Zeitgeist log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) <commit_msg>Add loop to the python example<commit_after>
from gi.repository import Zeitgeist, Gtk log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) Gtk.main()
from gi.repository import Zeitgeist log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) Add loop to the python examplefrom gi.repository import Zeitgeist, Gtk log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([...
<commit_before>from gi.repository import Zeitgeist log = Zeitgeist.Log.get_default() def callback (x): print x log.get_events([x for x in xrange(100)], None, callback, None) <commit_msg>Add loop to the python example<commit_after>from gi.repository import Zeitgeist, Gtk log = Zeitgeist.Log.get_default() def ca...
79a33e6e0de55dcfd602a58ef5adfabe7895915e
mysite/urls.py
mysite/urls.py
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls urlpatterns = [ url(r'^django-admin/...
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtailimages import urls as...
Add an entry in URLs configuration for image support.
Add an entry in URLs configuration for image support.
Python
mit
yostan/mysite,yostan/mysite
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls urlpatterns = [ url(r'^django-admin/...
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtailimages import urls as...
<commit_before>from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls urlpatterns = [ url(r...
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtailimages import urls as...
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls urlpatterns = [ url(r'^django-admin/...
<commit_before>from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls urlpatterns = [ url(r...
9cfd402c8f95c016953eda752e1bd91302d6c8c0
translations/lantmateriet.py
translations/lantmateriet.py
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
Add population to the tags
LM: Add population to the tags
Python
bsd-3-clause
andpe/swegov-to-osm
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
<commit_before> def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstr...
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstreetmap.org/wiki...
<commit_before> def filterTags(attrs): res = {} if 'NAMN' in attrs: res['name'] = attrs['NAMN'] if 'TATNR' in attrs: res['ref:se:scb'] = attrs['TATNR'] if attrs.get('BEF') is not None: bef = int(attrs.get('BEF')) # This is an approximation based on http://wiki.openstr...
d13c674a7286f1af9cd13babe2cb5c429b5b3bfa
scripts/update_guide_stats.py
scripts/update_guide_stats.py
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from mica.stats import update_guide_stats update_guide_stats.main() import os table_file = mica.stats.guide_stats.TABLE_FILE file_stat = os.stat(table_file) if file_stat.st_size > 200e6: print(""" Warning: {tfile} is larger than...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import os import argparse from mica.stats import update_guide_stats import mica.stats.guide_stats # Cheat and pass options directly. Needs entrypoint scripts opt = argparse.Namespace(datafile=mica.stats.guide_stats.TABLE_FILE, ...
Update guide stat script to pass datafile
Update guide stat script to pass datafile
Python
bsd-3-clause
sot/mica,sot/mica
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from mica.stats import update_guide_stats update_guide_stats.main() import os table_file = mica.stats.guide_stats.TABLE_FILE file_stat = os.stat(table_file) if file_stat.st_size > 200e6: print(""" Warning: {tfile} is larger than...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import os import argparse from mica.stats import update_guide_stats import mica.stats.guide_stats # Cheat and pass options directly. Needs entrypoint scripts opt = argparse.Namespace(datafile=mica.stats.guide_stats.TABLE_FILE, ...
<commit_before>#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from mica.stats import update_guide_stats update_guide_stats.main() import os table_file = mica.stats.guide_stats.TABLE_FILE file_stat = os.stat(table_file) if file_stat.st_size > 200e6: print(""" Warning: {tfile}...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import os import argparse from mica.stats import update_guide_stats import mica.stats.guide_stats # Cheat and pass options directly. Needs entrypoint scripts opt = argparse.Namespace(datafile=mica.stats.guide_stats.TABLE_FILE, ...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from mica.stats import update_guide_stats update_guide_stats.main() import os table_file = mica.stats.guide_stats.TABLE_FILE file_stat = os.stat(table_file) if file_stat.st_size > 200e6: print(""" Warning: {tfile} is larger than...
<commit_before>#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst from mica.stats import update_guide_stats update_guide_stats.main() import os table_file = mica.stats.guide_stats.TABLE_FILE file_stat = os.stat(table_file) if file_stat.st_size > 200e6: print(""" Warning: {tfile}...
7f6bb0706b24f8664937e9d991ffe01b2d62279e
varify/context_processors.py
varify/context_processors.py
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
Return dict object from sentry processor regardless of setting existence
Return dict object from sentry processor regardless of setting existence
Python
bsd-2-clause
chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify,chop-dbhi/varify
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
<commit_before>import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_UR...
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_URL': os.path.joi...
<commit_before>import os import logging from django.conf import settings log = logging.getLogger(__name__) def static(request): "Shorthand static URLs. In debug mode, the JavaScript is not minified." static_url = settings.STATIC_URL prefix = 'src' if settings.DEBUG else 'min' return { 'CSS_UR...
f624ca7894037361c441d4c5834e4a1fe66c991d
ipaqe_provision_hosts/utils.py
ipaqe_provision_hosts/utils.py
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
Add simple parser for os-release to get OS version
Add simple parser for os-release to get OS version
Python
mit
apophys/ipaqe-provision-hosts
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
<commit_before># Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.loa...
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
# Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.load(f) except...
<commit_before># Author: Milan Kubik import logging import yaml from ipaqe_provision_hosts.errors import IPAQEProvisionerError log = logging.getLogger(__name__) class ConfigLoadError(IPAQEProvisionerError): pass def load_yaml(path): try: with open(path, mode='r') as f: return yaml.loa...
5914b9a4d1d086f1a92309c0895aa7dd11761776
conf_site/accounts/tests/test_registration.py
conf_site/accounts/tests/test_registration.py
from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" response = self.cli...
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from factory import fuzzy from faker import Faker class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" re...
Change imports in user registration test.
Change imports in user registration test.
Python
mit
pydata/conf_site,pydata/conf_site,pydata/conf_site
from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" response = self.cli...
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from factory import fuzzy from faker import Faker class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" re...
<commit_before>from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" resp...
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from factory import fuzzy from faker import Faker class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" re...
from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" response = self.cli...
<commit_before>from factory import Faker, fuzzy from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse class UserRegistrationTestCase(TestCase): def test_registration_view(self): """Verify that user registration view loads properly.""" resp...
9a7100aaf0207fe93b28d7e473a4b5c1cd6061fe
vumi/application/__init__.py
vumi/application/__init__.py
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager", "TagpoolManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager from vumi.application.tagpool import TagpoolManager
Add TagpoolManager to vumi.application API.
Add TagpoolManager to vumi.application API.
Python
bsd-3-clause
vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,harrissoerja/vumi
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager Add TagpoolManager to vumi.application API.
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager", "TagpoolManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager from vumi.application.tagpool import TagpoolManager
<commit_before>"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager <commit_msg>Add TagpoolManager to vumi.application API.<commit_after>
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager", "TagpoolManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager from vumi.application.tagpool import TagpoolManager
"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager Add TagpoolManager to vumi.application API."""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager", "Tagpo...
<commit_before>"""The vumi.application API.""" __all__ = ["ApplicationWorker", "SessionManager"] from vumi.application.base import ApplicationWorker from vumi.application.session import SessionManager <commit_msg>Add TagpoolManager to vumi.application API.<commit_after>"""The vumi.application API.""" __all__ = ["App...
2479b4a51b733ce8ba989d8f01b48791492d9f21
cogs/utils/dataIO.py
cogs/utils/dataIO.py
import redis_collections import threading import time import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True, name=kwargs['key']) self.thr...
import redis_collections import threading import time # noinspection PyUnresolvedReferences import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True...
Make config sync more efficient
Make config sync more efficient
Python
mit
Thessia/Liara
import redis_collections import threading import time import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True, name=kwargs['key']) self.thr...
import redis_collections import threading import time # noinspection PyUnresolvedReferences import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True...
<commit_before>import redis_collections import threading import time import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True, name=kwargs['key']) ...
import redis_collections import threading import time # noinspection PyUnresolvedReferences import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True...
import redis_collections import threading import time import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True, name=kwargs['key']) self.thr...
<commit_before>import redis_collections import threading import time import __main__ class RedisDict(redis_collections.Dict): def __init__(self, **kwargs): super().__init__(**kwargs) self.die = False self.thread = threading.Thread(target=self.update_loop, daemon=True, name=kwargs['key']) ...
87a3025196b0b3429cab1f439cd10728e99d982f
skimage/transform/__init__.py
skimage/transform/__init__.py
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
Add missing imports in transform module.
BUG: Add missing imports in transform module.
Python
bsd-3-clause
emon10005/scikit-image,bsipocz/scikit-image,blink1073/scikit-image,youprofit/scikit-image,rjeli/scikit-image,SamHames/scikit-image,almarklein/scikit-image,rjeli/scikit-image,emon10005/scikit-image,almarklein/scikit-image,youprofit/scikit-image,chintak/scikit-image,almarklein/scikit-image,paalge/scikit-image,vighneshbir...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
<commit_before>from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, Polynomi...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, PolynomialTransform, ...
<commit_before>from .hough_transform import * from .radon_transform import * from .finite_radon_transform import * from .integral import * from ._geometric import (warp, warp_coords, estimate_transform, SimilarityTransform, AffineTransform, ProjectiveTransform, Polynomi...
ed3c03ac4f213f3882e28f25ae0596a7021928cd
test/ParseableInterface/Inputs/make-unreadable.py
test/ParseableInterface/Inputs/make-unreadable.py
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
Fix handling of Network Service username.
[windows] Fix handling of Network Service username. In Windows Server 2016 at least, the Network Service user (the one being used by the CI machine) is returned as Host$, which icacls doesn't understand. Turn the name into something that icacls if we get a name that ends with a dollar.
Python
apache-2.0
atrick/swift,hooman/swift,harlanhaskins/swift,shahmishal/swift,stephentyrone/swift,jmgc/swift,devincoughlin/swift,ahoppen/swift,tkremenek/swift,xedin/swift,shahmishal/swift,xwu/swift,xedin/swift,harlanhaskins/swift,harlanhaskins/swift,sschiau/swift,shajrawi/swift,karwa/swift,gribozavr/swift,apple/swift,CodaFi/swift,aho...
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
<commit_before> import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, #...
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, # _In_Out_ lpBuf...
<commit_before> import platform import subprocess import sys if platform.system() == 'Windows': import ctypes AdvAPI32 = ctypes.windll.Advapi32 from ctypes.wintypes import POINTER UNLEN = 256 GetUserNameW = AdvAPI32.GetUserNameW GetUserNameW.argtypes = ( ctypes.c_wchar_p, #...
8f68e3f3ab63d67d3e7fc1c8cd63c6c9d03729a2
Channels/News_Channel/lz77.py
Channels/News_Channel/lz77.py
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
Comment about the hex part
Comment about the hex part
Python
agpl-3.0
RiiConnect24/File-Maker,RiiConnect24/File-Maker
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
<commit_before>import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnul...
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnull, "w+") de...
<commit_before>import glob import os import subprocess """This is used to decompress the news.bin files.""" def decompress(file): with open(file, "rb") as source_file: read = source_file.read() tail = read[320:] with open(file + ".2", "w+") as dest_file: dest_file.write(tail) FNULL = open(os.devnul...
794a75ed410fe39ba2376ebcab75d21cc5e9fee0
common/safeprint.py
common/safeprint.py
import multiprocessing, sys, datetime print_lock = multiprocessing.Lock() def safeprint(content): with print_lock: sys.stdout.write(("[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n'))
import multiprocessing, sys, datetime print_lock = multiprocessing.RLock() def safeprint(content): string = "[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n' with print_lock: sys.stdout.write(string)
Reduce the amount of time locking
Reduce the amount of time locking
Python
mit
gappleto97/Senior-Project
import multiprocessing, sys, datetime print_lock = multiprocessing.Lock() def safeprint(content): with print_lock: sys.stdout.write(("[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n')) Reduce the amount of time locking
import multiprocessing, sys, datetime print_lock = multiprocessing.RLock() def safeprint(content): string = "[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n' with print_lock: sys.stdout.write(string)
<commit_before>import multiprocessing, sys, datetime print_lock = multiprocessing.Lock() def safeprint(content): with print_lock: sys.stdout.write(("[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n')) <commit_msg>Reduce the amount o...
import multiprocessing, sys, datetime print_lock = multiprocessing.RLock() def safeprint(content): string = "[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n' with print_lock: sys.stdout.write(string)
import multiprocessing, sys, datetime print_lock = multiprocessing.Lock() def safeprint(content): with print_lock: sys.stdout.write(("[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n')) Reduce the amount of time lockingimport multip...
<commit_before>import multiprocessing, sys, datetime print_lock = multiprocessing.Lock() def safeprint(content): with print_lock: sys.stdout.write(("[" + str(multiprocessing.current_process().pid) + "] " + datetime.datetime.now().strftime('%H%M%S') + ": " + str(content) + '\r\n')) <commit_msg>Reduce the amount o...
b79ed827f7211efbcdef95286bf2d4113d6e8b88
posts/views.py
posts/views.py
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
Fix ordering of category view
Fix ordering of category view Signed-off-by: Michal Čihař <[email protected]>
Python
agpl-3.0
nijel/photoblog,nijel/photoblog
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
<commit_before>from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' pa...
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' paginate_by = 20 ...
<commit_before>from django.shortcuts import get_object_or_404 from django.views.generic.dates import ArchiveIndexView from django.views.generic.edit import FormView from .models import Entry, Category from .forms import ContactForm class CategoryView(ArchiveIndexView): model = Entry date_field = 'date' pa...
df99ee50e7d7a677aec4e30af10283399a8edb8c
dlstats/configuration.py
dlstats/configuration.py
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname elif os.path.isfile('/etc/'+appname): ...
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if "HOME" in os.environ: if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname ...
Test for environment variable existence
Test for environment variable existence
Python
agpl-3.0
Widukind/dlstats,MichelJuillard/dlstats,MichelJuillard/dlstats,mmalter/dlstats,mmalter/dlstats,Widukind/dlstats,mmalter/dlstats,MichelJuillard/dlstats
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname elif os.path.isfile('/etc/'+appname): ...
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if "HOME" in os.environ: if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname ...
<commit_before>import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname elif os.path.isfile('/et...
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if "HOME" in os.environ: if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname ...
import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname elif os.path.isfile('/etc/'+appname): ...
<commit_before>import configobj import validate import os def _get_filename(): """Return the configuration file path.""" appname = 'dlstats' if os.name == 'posix': if os.path.isfile(os.environ["HOME"]+'/.'+appname): return os.environ["HOME"]+'/.'+appname elif os.path.isfile('/et...
3838e44a397fdb4b605ead875b7c6ebc5787644d
jal_stats/stats/serializers.py
jal_stats/stats/serializers.py
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializer): ...
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('id', 'user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializ...
Add 'id' to both Serializers
Add 'id' to both Serializers
Python
mit
jal-stats/django
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializer): ...
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('id', 'user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializ...
<commit_before>from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedMode...
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('id', 'user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializ...
from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedModelSerializer): ...
<commit_before>from rest_framework import serializers from .models import Activity, Datapoint class ActivitySerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Activity fields = ('user', 'full_description', 'units', 'url') class DatapointSerializer(serializers.HyperlinkedMode...
ec1e0cd1fa8bab59750032942643a7abc8700642
cspreports/models.py
cspreports/models.py
#LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) ...
# STANDARD LIB import json #LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.D...
Revert removing data which is still used
Revert removing data which is still used This was removed in b1bc34e9a83cb3af5dd11baa1236f2b65ab823f9 but is still used in admin.py.
Python
mit
adamalton/django-csp-reports
#LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) ...
# STANDARD LIB import json #LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.D...
<commit_before>#LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(...
# STANDARD LIB import json #LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.D...
#LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) ...
<commit_before>#LIBRARIES from django.db import models from django.utils.html import escape from django.utils.safestring import mark_safe class CSPReport(models.Model): class Meta(object): ordering = ('-created',) created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(...
271b4cd3795cbe0e5e013ac53c3ea26ca08e7a1a
IPython/utils/importstring.py
IPython/utils/importstring.py
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
Fix error in test suite startup with dotted import names.
Fix error in test suite startup with dotted import names. Detected first on ubuntu 12.04, but the bug is generic, we just hadn't seen it before. Will push straight to master as this will begin causing problems as more people upgrade.
Python
bsd-3-clause
ipython/ipython,ipython/ipython
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
<commit_before># encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The ...
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
# encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is...
<commit_before># encoding: utf-8 """ A simple utility to import something by its string name. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The ...
14869bd8c58a393caec488e95d51c282ccf23d0d
katagawa/sql/__init__.py
katagawa/sql/__init__.py
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtokens @abc.abstract...
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ __slots__ = () def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtoke...
Add aliased ABC for tokens with an alias.
Add aliased ABC for tokens with an alias.
Python
mit
SunDwarf/asyncqlio
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtokens @abc.abstract...
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ __slots__ = () def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtoke...
<commit_before>""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtokens ...
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ __slots__ = () def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtoke...
""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtokens @abc.abstract...
<commit_before>""" SQL generators for Katagawa. """ import abc import typing class Token(abc.ABC): """ Base class for a token. """ def __init__(self, subtokens: typing.List['Token']): """ :param subtokens: Any subtokens this token has. """ self.subtokens = subtokens ...
7844df0c4f32c9cc1f5833aba4712680461f77b5
test/on_yubikey/cli_piv/test_misc.py
test/on_yubikey/cli_piv/test_misc.py
import unittest from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') def test_info(self): output = ykman_cli('piv',...
import unittest from ykman.piv import OBJ from .util import DEFAULT_MANAGEMENT_KEY from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') ...
Test that invalid cert crashes export-certificate but not info
Test that invalid cert crashes export-certificate but not info
Python
bsd-2-clause
Yubico/yubikey-manager,Yubico/yubikey-manager
import unittest from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') def test_info(self): output = ykman_cli('piv',...
import unittest from ykman.piv import OBJ from .util import DEFAULT_MANAGEMENT_KEY from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') ...
<commit_before>import unittest from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') def test_info(self): output = y...
import unittest from ykman.piv import OBJ from .util import DEFAULT_MANAGEMENT_KEY from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') ...
import unittest from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') def test_info(self): output = ykman_cli('piv',...
<commit_before>import unittest from ..framework import cli_test_suite from .util import DEFAULT_MANAGEMENT_KEY @cli_test_suite def additional_tests(ykman_cli): class Misc(unittest.TestCase): def setUp(self): ykman_cli('piv', 'reset', '-f') def test_info(self): output = y...
1c3c092afae1946e72a87cca8792bd012bee23e4
ktbs_bench/utils/decorators.py
ktbs_bench/utils/decorators.py
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" # TODO mettre args (n_repeat, func) qui execute n_repeat fois et applique un reduce(res, func) @wraps(f) def wrapped(*args, **kwargs): timer = Ti...
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Decorator to time a function. Parameters ---------- f : function The function to time. Returns ------- call_signature : str The signature of the function call, with param...
Add docstrings and fix call of call_signature.
Add docstrings and fix call of call_signature. For the fix: call_signature has been moved before executing the actual call, if the call is made before then it might change arguments if they are references.
Python
mit
ktbs/ktbs-bench,ktbs/ktbs-bench
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" # TODO mettre args (n_repeat, func) qui execute n_repeat fois et applique un reduce(res, func) @wraps(f) def wrapped(*args, **kwargs): timer = Ti...
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Decorator to time a function. Parameters ---------- f : function The function to time. Returns ------- call_signature : str The signature of the function call, with param...
<commit_before>from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" # TODO mettre args (n_repeat, func) qui execute n_repeat fois et applique un reduce(res, func) @wraps(f) def wrapped(*args, **kwargs): ...
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Decorator to time a function. Parameters ---------- f : function The function to time. Returns ------- call_signature : str The signature of the function call, with param...
from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" # TODO mettre args (n_repeat, func) qui execute n_repeat fois et applique un reduce(res, func) @wraps(f) def wrapped(*args, **kwargs): timer = Ti...
<commit_before>from functools import wraps from inspect import getcallargs from timer import Timer def bench(f): """Times a function given specific arguments.""" # TODO mettre args (n_repeat, func) qui execute n_repeat fois et applique un reduce(res, func) @wraps(f) def wrapped(*args, **kwargs): ...
15be3bd492a0808713c6ae6981ecb99acacd5297
allauth/socialaccount/providers/trello/provider.py
allauth/socialaccount/providers/trello/provider.py
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
Use 'scope' in TrelloProvider auth params. Allows overriding from django settings.
feat(TrelloProvider): Use 'scope' in TrelloProvider auth params. Allows overriding from django settings.
Python
mit
AltSchool/django-allauth,AltSchool/django-allauth,AltSchool/django-allauth
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
<commit_before>from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OA...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OAuthProvider): ...
<commit_before>from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class TrelloAccount(ProviderAccount): def get_profile_url(self): return None def get_avatar_url(self): return None class TrelloProvider(OA...
d7fc84f6e92cb2f6bc3006971258d655059f9fb1
lemur/dns_providers/schemas.py
lemur/dns_providers/schemas.py
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() providerType = fields.String() ...
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() provider_type = fields.String() ...
Fix dns-providers type missing from schema
Fix dns-providers type missing from schema
Python
apache-2.0
Netflix/lemur,Netflix/lemur,Netflix/lemur,Netflix/lemur
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() providerType = fields.String() ...
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() provider_type = fields.String() ...
<commit_before>from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() providerType = fie...
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() provider_type = fields.String() ...
from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() providerType = fields.String() ...
<commit_before>from marshmallow import fields from lemur.common.fields import ArrowDateTime from lemur.common.schema import LemurInputSchema, LemurOutputSchema class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() providerType = fie...
a35b6e46bd9d443f07391f37f5e0e384e37608bb
nbgrader/tests/test_nbgrader_feedback.py
nbgrader/tests/test_nbgrader_feedback.py
from .base import TestBase from nbgrader.api import Gradebook import os class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("Problem Set 1") gb.add_student("foo") gb.add_student("bar") return ...
from .base import TestBase from nbgrader.api import Gradebook import os import shutil class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("ps1") gb.add_student("foo") return dbpath def test_help(...
Update tests for nbgrader feedback
Update tests for nbgrader feedback
Python
bsd-3-clause
jhamrick/nbgrader,alope107/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,modulexcite/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jdfreder/nbgrader,MatKallada/nbgrader,jupyter/nbgrader,MatKallada/nbgrader,jupyter/nbgrader,dementrock/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jupyter/nbgrader,m...
from .base import TestBase from nbgrader.api import Gradebook import os class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("Problem Set 1") gb.add_student("foo") gb.add_student("bar") return ...
from .base import TestBase from nbgrader.api import Gradebook import os import shutil class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("ps1") gb.add_student("foo") return dbpath def test_help(...
<commit_before>from .base import TestBase from nbgrader.api import Gradebook import os class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("Problem Set 1") gb.add_student("foo") gb.add_student("bar") ...
from .base import TestBase from nbgrader.api import Gradebook import os import shutil class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("ps1") gb.add_student("foo") return dbpath def test_help(...
from .base import TestBase from nbgrader.api import Gradebook import os class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("Problem Set 1") gb.add_student("foo") gb.add_student("bar") return ...
<commit_before>from .base import TestBase from nbgrader.api import Gradebook import os class TestNbgraderFeedback(TestBase): def _setup_db(self): dbpath = self._init_db() gb = Gradebook(dbpath) gb.add_assignment("Problem Set 1") gb.add_student("foo") gb.add_student("bar") ...
0749c47bb280230ae5b1e2cda23773d3b10b2491
redis_check.py
redis_check.py
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
Make output easier to parse with cli tools.
Make output easier to parse with cli tools.
Python
bsd-3-clause
averagesecurityguy/research
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
<commit_before>#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() pri...
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() print('[+] {0}:{1}...
<commit_before>#!/usr/bin/env python3 import sys import redis import redis.exceptions host = sys.argv[1] host = host.strip('\r\n') port = 6379 timeout = 5 try: db = redis.StrictRedis(host=host, port=port, socket_timeout=timeout) i = db.info() ver = i.get('redis_version') siz = db.dbsize() pri...
95a78f801a094861832d2a27fc69866f99b44af4
github_list_repos.py
github_list_repos.py
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import textwrap gh = codetools.github(authfile='~/.sq_github_token') # Argument Parsing # ---------------- parser = argpars...
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import os import textwrap debug = os.getenv("DM_SQUARE_DEBUG") gh = codetools.github(authfile='~/.sq_github_token') # Argum...
Allow multiple --hide options to be used
Allow multiple --hide options to be used Also: imply --team if --hide more pythonic
Python
mit
lsst-sqre/sqre-codekit,lsst-sqre/sqre-codekit
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import textwrap gh = codetools.github(authfile='~/.sq_github_token') # Argument Parsing # ---------------- parser = argpars...
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import os import textwrap debug = os.getenv("DM_SQUARE_DEBUG") gh = codetools.github(authfile='~/.sq_github_token') # Argum...
<commit_before>#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import textwrap gh = codetools.github(authfile='~/.sq_github_token') # Argument Parsing # ---------------- p...
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import os import textwrap debug = os.getenv("DM_SQUARE_DEBUG") gh = codetools.github(authfile='~/.sq_github_token') # Argum...
#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import textwrap gh = codetools.github(authfile='~/.sq_github_token') # Argument Parsing # ---------------- parser = argpars...
<commit_before>#!/usr/bin/env python """ List repositories on Github belonging to organisations, teams, etc """ # Technical Debt # -------------- # Known Bugs # ---------- import argparse import codetools import textwrap gh = codetools.github(authfile='~/.sq_github_token') # Argument Parsing # ---------------- p...
8e53b65b5f28a02f8ee980b9f53a57e7cdd077bd
main.py
main.py
import places from character import Character import actions import options from multiple_choice import MultipleChoice def combat(character): """ takes in a character, returns outcome of fight """ return actions.Attack(character.person).get_outcome(character) def main(): """ The goal is to h...
import places from character import Character import actions import options from multiple_choice import MultipleChoice def main(): """ The goal is to have the main function operate as follows: Set up the initial state Display the initial message Display the initial options Choo...
Refactor combat code to be more concise
Refactor combat code to be more concise
Python
apache-2.0
SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame,SageBerg/St.GeorgeGame
import places from character import Character import actions import options from multiple_choice import MultipleChoice def combat(character): """ takes in a character, returns outcome of fight """ return actions.Attack(character.person).get_outcome(character) def main(): """ The goal is to h...
import places from character import Character import actions import options from multiple_choice import MultipleChoice def main(): """ The goal is to have the main function operate as follows: Set up the initial state Display the initial message Display the initial options Choo...
<commit_before>import places from character import Character import actions import options from multiple_choice import MultipleChoice def combat(character): """ takes in a character, returns outcome of fight """ return actions.Attack(character.person).get_outcome(character) def main(): """ T...
import places from character import Character import actions import options from multiple_choice import MultipleChoice def main(): """ The goal is to have the main function operate as follows: Set up the initial state Display the initial message Display the initial options Choo...
import places from character import Character import actions import options from multiple_choice import MultipleChoice def combat(character): """ takes in a character, returns outcome of fight """ return actions.Attack(character.person).get_outcome(character) def main(): """ The goal is to h...
<commit_before>import places from character import Character import actions import options from multiple_choice import MultipleChoice def combat(character): """ takes in a character, returns outcome of fight """ return actions.Attack(character.person).get_outcome(character) def main(): """ T...
75d6e88de0ed8f8cb081de15ce0d3949a78c9ded
efselab/build.py
efselab/build.py
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sources=['%s.c' % module], li...
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] def main(): for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sourc...
Put module in method to enable calls from libraries.
Put module in method to enable calls from libraries. Former-commit-id: e614cec07ee71723be5b114163fe835961f6811c
Python
mit
EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sources=['%s.c' % module], li...
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] def main(): for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sourc...
<commit_before>#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sources=['%s.c' % module], ...
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] def main(): for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sourc...
#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sources=['%s.c' % module], li...
<commit_before>#!/usr/bin/env python3 from distutils.core import setup, Extension MODULES_TO_BUILD = ["fasthash", "suc", "lemmatize"] for module in MODULES_TO_BUILD: setup( name=module, ext_modules=[ Extension( name=module, sources=['%s.c' % module], ...
f4b0493edc949f6c31e120f8c005fc8ea99f9ede
markwiki/tests/test_factory.py
markwiki/tests/test_factory.py
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
Make the unit tests work with 2.6.
Make the unit tests work with 2.6.
Python
bsd-2-clause
mblayman/markwiki,mblayman/markwiki
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
<commit_before># Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An excepti...
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
# Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An exception to ensure st...
<commit_before># Copyright (c) 2014, Matt Layman '''Tests for the StorageFactory.''' import unittest from markwiki.exceptions import ConfigurationError from markwiki.storage.factory import UserStorageFactory from markwiki.storage.fs.user import FileUserStorage class InitializeException(Exception): '''An excepti...
1763b533bf33a8e450b4cf8d6f55d4ffaf6b2bea
tests/window/WINDOW_CAPTION.py
tests/window/WINDOW_CAPTION.py
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
Make windows bigger in this test so the captions can be read.
Make windows bigger in this test so the captions can be read. Index: tests/window/WINDOW_CAPTION.py =================================================================== --- tests/window/WINDOW_CAPTION.py (revision 777) +++ tests/window/WINDOW_CAPTION.py (working copy) @@ -19,8 +19,8 @@ class WINDOW_CAPTION(unittest....
Python
bsd-3-clause
mammadori/pyglet,oktayacikalin/pyglet,oktayacikalin/pyglet,theblacklion/pyglet,mammadori/pyglet,oktayacikalin/pyglet,theblacklion/pyglet,oktayacikalin/pyglet,mammadori/pyglet,theblacklion/pyglet,theblacklion/pyglet,oktayacikalin/pyglet,mammadori/pyglet,theblacklion/pyglet
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
<commit_before>#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window t...
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window to finished the ...
<commit_before>#!/usr/bin/env python '''Test that the window caption can be set. Expected behaviour: Two windows will be opened, one with the caption "Window caption 1" counting up every second; the other with a Unicode string including some non-ASCII characters. Press escape or close either window t...
486d7e76c76e79a44c0ed199724f0dc349e7539a
thelma/db/schema/tables/plannedworklistmember.py
thelma/db/schema/tables/plannedworklistmember.py
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
Adjust deleting cascade for planned liquid transfers
Adjust deleting cascade for planned liquid transfers
Python
mit
helixyte/TheLMA,helixyte/TheLMA
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
<commit_before>""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metada...
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metadata, planned_wor...
<commit_before>""" Planned worklist member table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table from sqlalchemy.schema import PrimaryKeyConstraint __docformat__ = 'reStructuredText en' __all__ = ['create_table'] def create_table(metada...
10f72ab0428ddf51b47bc95b64b2a532c8e670a5
auth0/v2/authentication/enterprise.py
auth0/v2/authentication/enterprise.py
import requests class Enterprise(object): def __init__(self, domain): self.domain = domain def saml_login(self, client_id, connection): """ """ return requests.get( 'https://%s/samlp/%s' % (self.domain, client_id), params={'connection': connection} ...
from .base import AuthenticationBase class Enterprise(AuthenticationBase): def __init__(self, domain): self.domain = domain def saml_metadata(self, client_id): return self.get(url='https://%s/samlp/metadata/%s' % (self.domain, cli...
Refactor Enterprise class to use AuthenticationBase
Refactor Enterprise class to use AuthenticationBase
Python
mit
auth0/auth0-python,auth0/auth0-python
import requests class Enterprise(object): def __init__(self, domain): self.domain = domain def saml_login(self, client_id, connection): """ """ return requests.get( 'https://%s/samlp/%s' % (self.domain, client_id), params={'connection': connection} ...
from .base import AuthenticationBase class Enterprise(AuthenticationBase): def __init__(self, domain): self.domain = domain def saml_metadata(self, client_id): return self.get(url='https://%s/samlp/metadata/%s' % (self.domain, cli...
<commit_before>import requests class Enterprise(object): def __init__(self, domain): self.domain = domain def saml_login(self, client_id, connection): """ """ return requests.get( 'https://%s/samlp/%s' % (self.domain, client_id), params={'connection':...
from .base import AuthenticationBase class Enterprise(AuthenticationBase): def __init__(self, domain): self.domain = domain def saml_metadata(self, client_id): return self.get(url='https://%s/samlp/metadata/%s' % (self.domain, cli...
import requests class Enterprise(object): def __init__(self, domain): self.domain = domain def saml_login(self, client_id, connection): """ """ return requests.get( 'https://%s/samlp/%s' % (self.domain, client_id), params={'connection': connection} ...
<commit_before>import requests class Enterprise(object): def __init__(self, domain): self.domain = domain def saml_login(self, client_id, connection): """ """ return requests.get( 'https://%s/samlp/%s' % (self.domain, client_id), params={'connection':...
acec9342e392fed103e5d6b78470251d2cf535d6
timpani/webserver/webserver.py
timpani/webserver/webserver.py
import flask import os.path import datetime import urllib.parse from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../c...
import flask import os.path import datetime import urllib.parse from .. import database from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join...
Add teardown request instead of usesDatabase decorator
Add teardown request instead of usesDatabase decorator
Python
mit
ollien/Timpani,ollien/Timpani,ollien/Timpani
import flask import os.path import datetime import urllib.parse from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../c...
import flask import os.path import datetime import urllib.parse from .. import database from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join...
<commit_before>import flask import os.path import datetime import urllib.parse from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOC...
import flask import os.path import datetime import urllib.parse from .. import database from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join...
import flask import os.path import datetime import urllib.parse from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../c...
<commit_before>import flask import os.path import datetime import urllib.parse from .. import configmanager from . import controllers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static")) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOC...
967ec17d15f07191e6d42fc122eb5e731605ad67
git_code_debt/repo_parser.py
git_code_debt/repo_parser.py
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo, ref): self.git_repo = git_repo self.ref = ref s...
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo): self.git_repo = git_repo self.tempdir = None @con...
Change sha fetching to use --parent-only and removed ref parameter
Change sha fetching to use --parent-only and removed ref parameter
Python
mit
ucarion/git-code-debt,Yelp/git-code-debt,ucarion/git-code-debt,ucarion/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt,Yelp/git-code-debt
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo, ref): self.git_repo = git_repo self.ref = ref s...
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo): self.git_repo = git_repo self.tempdir = None @con...
<commit_before> import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo, ref): self.git_repo = git_repo self.ref ...
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo): self.git_repo = git_repo self.tempdir = None @con...
import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo, ref): self.git_repo = git_repo self.ref = ref s...
<commit_before> import collections import contextlib import shutil import subprocess import tempfile from util.iter import chunk_iter Commit = collections.namedtuple('Commit', ['sha', 'date', 'name']) class RepoParser(object): def __init__(self, git_repo, ref): self.git_repo = git_repo self.ref ...
a1583d181170302df72fc0a97e5db7f6300061b3
tests/__init__.py
tests/__init__.py
#
import os DATADIR = os.path.abspath('docs/data') FILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk.prj'] def create_zipfile(zipfilename): import zipfile with zipfile.ZipFile(zipfilename, 'w') as zip: for filename in FILES: zip.write(os.path.join(DATADIR, filename), filename) ...
Create derived test data files if they do not exist when running nosetests
Create derived test data files if they do not exist when running nosetests
Python
bsd-3-clause
perrygeo/Fiona,rbuffat/Fiona,perrygeo/Fiona,johanvdw/Fiona,Toblerity/Fiona,rbuffat/Fiona,Toblerity/Fiona
# Create derived test data files if they do not exist when running nosetests
import os DATADIR = os.path.abspath('docs/data') FILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk.prj'] def create_zipfile(zipfilename): import zipfile with zipfile.ZipFile(zipfilename, 'w') as zip: for filename in FILES: zip.write(os.path.join(DATADIR, filename), filename) ...
<commit_before># <commit_msg>Create derived test data files if they do not exist when running nosetests<commit_after>
import os DATADIR = os.path.abspath('docs/data') FILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk.prj'] def create_zipfile(zipfilename): import zipfile with zipfile.ZipFile(zipfilename, 'w') as zip: for filename in FILES: zip.write(os.path.join(DATADIR, filename), filename) ...
# Create derived test data files if they do not exist when running nosetestsimport os DATADIR = os.path.abspath('docs/data') FILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk.prj'] def create_zipfile(zipfilename): import zipfile with zipfile.ZipFile(zipfilename, 'w') as zip: for filename ...
<commit_before># <commit_msg>Create derived test data files if they do not exist when running nosetests<commit_after>import os DATADIR = os.path.abspath('docs/data') FILES = ['test_uk.shp', 'test_uk.shx', 'test_uk.dbf', 'test_uk.prj'] def create_zipfile(zipfilename): import zipfile with zipfile.ZipFile(zipfil...
822afb73e35d4f1651ee44e974dcc51deaacb361
tests/conftest.py
tests/conftest.py
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
Rename schema fixture to free up parameter name
Rename schema fixture to free up parameter name
Python
mit
RazerM/pg_grant,RazerM/pg_grant
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
<commit_before>from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): ...
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): POSTGRES_USER ...
<commit_before>from pathlib import Path import pytest from sqlalchemy import create_engine from testcontainers import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', 'test-schema.sql') class PostgresContainer(_PostgresContainer): ...
34031f2b16303bcff69a7b52ec3e85ce35103c96
src/hunter/const.py
src/hunter/const.py
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
Sort by longest path (assuming stdlib stuff will be in the longest).
Sort by longest path (assuming stdlib stuff will be in the longest).
Python
bsd-2-clause
ionelmc/python-hunter
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
<commit_before>import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersite...
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SIT...
<commit_before>import collections import os import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set() if hasattr(site, 'getsitepackages'): SITE_PACKAGES_PATHS.update(site.getsitepackages()) if hasattr(site, 'getusersitepackages'): SITE_PACKAGES_PATHS.add(site.getusersite...
9d8e3b650d02537c0693a2a5ebe4b17ce1be24ae
rml/lattice.py
rml/lattice.py
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
Add method to get all families of currently loaded elements
Add method to get all families of currently loaded elements
Python
apache-2.0
willrogers/pml,willrogers/pml,razvanvasile/RML
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
<commit_before>class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(...
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(self): ...
<commit_before>class Lattice(object): def __init__(self, name): self.name = name self._elements = [] def __getitem__(self, i): return self._elements[i] def __len__(self): ''' Get the number of elements in the lattice ''' return len(self._elements) def __str__(...
d1edcb2f59d96168e94ec748633221a2d5f95b99
colorise/color_tools.py
colorise/color_tools.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
Remove unused color distance function
Remove unused color distance function
Python
bsd-3-clause
MisanthropicBit/colorise
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) for ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions for converting and comparing colors.""" import colorsys import math import operator def hls_to_rgb(hue, lightness, saturation): """Convert HLS (hue, lightness, saturation) values to RGB.""" return tuple(int(math.ceil(c * 255.)) ...
2c0ff93e3ef5e6914a85e4fc3443f0432337854e
text_processor.py
text_processor.py
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
Move main execution to function
Move main execution to function
Python
mit
kentoj/python-fundamentals
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
<commit_before>from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_w...
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_words.append(wor...
<commit_before>from urllib.request import urlopen def fetch_words(): with urlopen('http://sixty-north.com/c/t.txt') as story: story_words = [] word_list = '' for line in story: line_words = line.decode('utf-8').split() for word in line_words: story_w...
83ceca04758c6546c41d5bc7f96583d838f25e11
src/mmw/apps/user/backends.py
src/mmw/apps/user/backends.py
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
Add request parameter to backend.authenticate
Add request parameter to backend.authenticate Without this, the signature of our custom backend does not match that of the function call. This signature is tested in django.contrib.auth.authenticate here: https://github.com/django/django/blob/fdf209eab8949ddc345aa0212b349c79fc6fdebb/django/contrib/auth/__init__.py#L69...
Python
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
<commit_before># -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentica...
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end f...
<commit_before># -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentica...
e3919de815594c73c35c265380c66ef14a51acbd
__init__.py
__init__.py
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') PY_TAG = sys.implementation.cache_tag PY_VERSION = sys.hexversion if PY_TAG is None: # Never seen this to be true, but Python documentation # mentions that it's possib...
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') if sys.implementation.cache_tag is None: raise ImportError('cannot load the bundle since module caching is disabled') PY_TAG = sys.implementation.cache_tag PY_VERSION = ...
Rewrite the initial bootstrapping mechanism.
Rewrite the initial bootstrapping mechanism.
Python
mit
pyos/dg
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') PY_TAG = sys.implementation.cache_tag PY_VERSION = sys.hexversion if PY_TAG is None: # Never seen this to be true, but Python documentation # mentions that it's possib...
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') if sys.implementation.cache_tag is None: raise ImportError('cannot load the bundle since module caching is disabled') PY_TAG = sys.implementation.cache_tag PY_VERSION = ...
<commit_before>import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') PY_TAG = sys.implementation.cache_tag PY_VERSION = sys.hexversion if PY_TAG is None: # Never seen this to be true, but Python documentation # mentions t...
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') if sys.implementation.cache_tag is None: raise ImportError('cannot load the bundle since module caching is disabled') PY_TAG = sys.implementation.cache_tag PY_VERSION = ...
import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') PY_TAG = sys.implementation.cache_tag PY_VERSION = sys.hexversion if PY_TAG is None: # Never seen this to be true, but Python documentation # mentions that it's possib...
<commit_before>import sys import marshal import os.path if not hasattr(sys, 'implementation'): raise ImportError('Python 3.3 or newer is required') PY_TAG = sys.implementation.cache_tag PY_VERSION = sys.hexversion if PY_TAG is None: # Never seen this to be true, but Python documentation # mentions t...
638b8be8a07262803c087e796e40a51858c08983
__init__.py
__init__.py
from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView()
from . import LayerView def getMetaData(): return { 'type': 'view', 'plugin': { "name": "Layer View" }, 'view': { 'name': 'Layers' } } def register(app): return LayerView.LayerView()
Update plugin metadata to the new format
Update plugin metadata to the new format
Python
agpl-3.0
totalretribution/Cura,markwal/Cura,quillford/Cura,DeskboxBrazil/Cura,lo0ol/Ultimaker-Cura,senttech/Cura,bq/Ultimaker-Cura,ad1217/Cura,fieldOfView/Cura,fieldOfView/Cura,DeskboxBrazil/Cura,Curahelper/Cura,Curahelper/Cura,hmflash/Cura,bq/Ultimaker-Cura,hmflash/Cura,markwal/Cura,quillford/Cura,derekhe/Cura,totalretribution...
from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView() Update plugin metadata to the new format
from . import LayerView def getMetaData(): return { 'type': 'view', 'plugin': { "name": "Layer View" }, 'view': { 'name': 'Layers' } } def register(app): return LayerView.LayerView()
<commit_before>from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView() <commit_msg>Update plugin metadata to the new format<commit_after>
from . import LayerView def getMetaData(): return { 'type': 'view', 'plugin': { "name": "Layer View" }, 'view': { 'name': 'Layers' } } def register(app): return LayerView.LayerView()
from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView() Update plugin metadata to the new formatfrom . import LayerView def getMetaData(): return { 'type': 'view', 'plugin': { "name": "Layer Vie...
<commit_before>from . import LayerView def getMetaData(): return { "name": "LayerView", "type": "View" } def register(app): return LayerView.LayerView() <commit_msg>Update plugin metadata to the new format<commit_after>from . import LayerView def getMetaData(): return { 'type': 'view', '...
badba5070ac40a70de2be47b6d58afd0364ed7fe
staticassets/views.py
staticassets/views.py
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
Use correct argument for content type in serve view
Use correct argument for content type in serve view
Python
mit
davidelias/django-staticassets,davidelias/django-staticassets,davidelias/django-staticassets
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
<commit_before>import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): ...
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): mimetype, en...
<commit_before>import mimetypes from django.http import HttpResponse, HttpResponseNotModified, Http404 from django.contrib.staticfiles.views import serve as staticfiles_serve from django.views.static import was_modified_since, http_date from staticassets import finder, settings def serve(request, path, **kwargs): ...
d74e134ca63b7d3cd053d21168ca526a493999df
mysql.py
mysql.py
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.cursor() # Chec...
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(user = 'root', host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.c...
Use root user to connect
Use root user to connect
Python
mit
innogames/igcollect
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.cursor() # Chec...
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(user = 'root', host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.c...
<commit_before>#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.c...
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(user = 'root', host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.c...
#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.cursor() # Chec...
<commit_before>#!/usr/bin/env python # # igcollect - Mysql Status # # Copyright (c) 2016, InnoGames GmbH # import time import socket import MySQLdb hostname = socket.gethostname().replace(".", "_") now = str(int(time.time())) db = MySQLdb.connect(host = 'localhost', read_default_file='/etc/mysql/my.cnf') cur = db.c...
297f42a2013428c2f6caefdf83735cc4a528e225
caching.py
caching.py
import os import cPickle as pickle try: DATA_DIR = os.path.dirname(os.path.realpath(__file__)) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): return pickle.load(open(cache_path(name), 'r')) def save_cache(obj, name): pickle.dump(o...
import os import cPickle as pickle home_dir = os.path.expanduser('~') DATA_DIR = os.path.join(home_dir, '.tax_resolve') if not os.path.exists(DATA_DIR): try: os.mkdir(DATA_DIR) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): ...
Use user's local application data directory instead of the module path.
Use user's local application data directory instead of the module path.
Python
mit
bendmorris/tax_resolve
import os import cPickle as pickle try: DATA_DIR = os.path.dirname(os.path.realpath(__file__)) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): return pickle.load(open(cache_path(name), 'r')) def save_cache(obj, name): pickle.dump(o...
import os import cPickle as pickle home_dir = os.path.expanduser('~') DATA_DIR = os.path.join(home_dir, '.tax_resolve') if not os.path.exists(DATA_DIR): try: os.mkdir(DATA_DIR) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): ...
<commit_before>import os import cPickle as pickle try: DATA_DIR = os.path.dirname(os.path.realpath(__file__)) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): return pickle.load(open(cache_path(name), 'r')) def save_cache(obj, name): ...
import os import cPickle as pickle home_dir = os.path.expanduser('~') DATA_DIR = os.path.join(home_dir, '.tax_resolve') if not os.path.exists(DATA_DIR): try: os.mkdir(DATA_DIR) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): ...
import os import cPickle as pickle try: DATA_DIR = os.path.dirname(os.path.realpath(__file__)) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): return pickle.load(open(cache_path(name), 'r')) def save_cache(obj, name): pickle.dump(o...
<commit_before>import os import cPickle as pickle try: DATA_DIR = os.path.dirname(os.path.realpath(__file__)) except: DATA_DIR = os.getcwd() cache_path = lambda name: os.path.join(DATA_DIR, '%s.cache' % name) def get_cache(name): return pickle.load(open(cache_path(name), 'r')) def save_cache(obj, name): ...
310cebbe1f4a4d92c8f181d7e4de9cc4f75a14dc
indra/assemblers/__init__.py
indra/assemblers/__init__.py
try: from pysb_assembler import PysbAssembler except ImportError: pass try: from graph_assembler import GraphAssembler except ImportError: pass try: from sif_assembler import SifAssembler except ImportError: pass try: from cx_assembler import CxAssembler except ImportError: pass try: ...
try: from indra.assemblers.pysb_assembler import PysbAssembler except ImportError: pass try: from indra.assemblers.graph_assembler import GraphAssembler except ImportError: pass try: from indra.assemblers.sif_assembler import SifAssembler except ImportError: pass try: from indra.assemblers.c...
Update to absolute imports in assemblers
Update to absolute imports in assemblers
Python
bsd-2-clause
johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,pvtodorov/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,bgyori/indra,jmuhlich/indra,pvtodorov/indra,sorgerlab/indra,jmuhlich/indra,johnbachman/belpy,johnbachman/belpy,sorgerlab/belpy,johnbachman/indra,sorgerlab/belpy,johnbachman/belpy,jmuhlich/ind...
try: from pysb_assembler import PysbAssembler except ImportError: pass try: from graph_assembler import GraphAssembler except ImportError: pass try: from sif_assembler import SifAssembler except ImportError: pass try: from cx_assembler import CxAssembler except ImportError: pass try: ...
try: from indra.assemblers.pysb_assembler import PysbAssembler except ImportError: pass try: from indra.assemblers.graph_assembler import GraphAssembler except ImportError: pass try: from indra.assemblers.sif_assembler import SifAssembler except ImportError: pass try: from indra.assemblers.c...
<commit_before>try: from pysb_assembler import PysbAssembler except ImportError: pass try: from graph_assembler import GraphAssembler except ImportError: pass try: from sif_assembler import SifAssembler except ImportError: pass try: from cx_assembler import CxAssembler except ImportError: ...
try: from indra.assemblers.pysb_assembler import PysbAssembler except ImportError: pass try: from indra.assemblers.graph_assembler import GraphAssembler except ImportError: pass try: from indra.assemblers.sif_assembler import SifAssembler except ImportError: pass try: from indra.assemblers.c...
try: from pysb_assembler import PysbAssembler except ImportError: pass try: from graph_assembler import GraphAssembler except ImportError: pass try: from sif_assembler import SifAssembler except ImportError: pass try: from cx_assembler import CxAssembler except ImportError: pass try: ...
<commit_before>try: from pysb_assembler import PysbAssembler except ImportError: pass try: from graph_assembler import GraphAssembler except ImportError: pass try: from sif_assembler import SifAssembler except ImportError: pass try: from cx_assembler import CxAssembler except ImportError: ...
d150db290a72590e0f7cf9dae485bf98901bb2c2
web_ui/helpers.py
web_ui/helpers.py
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
Add helper method for resetting user data
Add helper method for resetting user data
Python
apache-2.0
ciex/souma,ciex/souma,ciex/souma
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
<commit_before>from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random(...
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random() * 10 def ge...
<commit_before>from web_ui import app from flask import session from datetime import datetime # For calculating scores epoch = datetime.utcfromtimestamp(0) epoch_seconds = lambda dt: (dt - epoch).total_seconds() - 1356048000 def score(star_object): import random return random.random() * 100 - random.random(...
312a742e31fb33b43a946da0016db201ca809799
seria/utils.py
seria/utils.py
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: _ = int(i) if not exact_match: return _ elif str(_...
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: if not exact_match: return int(i) elif str(int(i)) == i: ...
Refactor str_to_num to be more concise
Refactor str_to_num to be more concise Functionally nothing has changed. We just need not try twice nor define the variable _ twice.
Python
mit
rtluckie/seria
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: _ = int(i) if not exact_match: return _ elif str(_...
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: if not exact_match: return int(i) elif str(int(i)) == i: ...
<commit_before># -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: _ = int(i) if not exact_match: return _ ...
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: if not exact_match: return int(i) elif str(int(i)) == i: ...
# -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: _ = int(i) if not exact_match: return _ elif str(_...
<commit_before># -*- coding: utf-8 -*- def str_to_num(i, exact_match=True): """ Attempts to convert a str to either an int or float """ # TODO: Cleanup -- this is really ugly if not isinstance(i, str): return i try: _ = int(i) if not exact_match: return _ ...
7180aba7ce183e64ef12e4fc384408036c2fe901
product_template_tree_prices/__init__.py
product_template_tree_prices/__init__.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import product # vim:expandtab:smartindent...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## # vim:expandtab:smartindent:tabstop=4:softtabstop...
FIX produ template tree prices
FIX produ template tree prices
Python
agpl-3.0
ingadhoc/product,ingadhoc/product
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import product # vim:expandtab:smartindent...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## # vim:expandtab:smartindent:tabstop=4:softtabstop...
<commit_before># -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import product # vim:expand...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## # vim:expandtab:smartindent:tabstop=4:softtabstop...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import product # vim:expandtab:smartindent...
<commit_before># -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import product # vim:expand...
186a72b91798b11d13ea7f2538141f620b0787a8
tests/test_metrics.py
tests/test_metrics.py
import json from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, [])...
from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, []) def tes...
Add test for noop routes
Add test for noop routes
Python
apache-2.0
vladimir-smirnov-sociomantic/graphite-api,michaelrice/graphite-api,GeorgeJahad/graphite-api,vladimir-smirnov-sociomantic/graphite-api,michaelrice/graphite-api,alphapigger/graphite-api,raintank/graphite-api,hubrick/graphite-api,rackerlabs/graphite-api,Knewton/graphite-api,raintank/graphite-api,Knewton/graphite-api,bogus...
import json from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, [])...
from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, []) def tes...
<commit_before>import json from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSO...
from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, []) def tes...
import json from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSON(response, [])...
<commit_before>import json from . import TestCase class MetricsTests(TestCase): def test_find(self): url = '/metrics/find' response = self.app.get(url) self.assertEqual(response.status_code, 400) response = self.app.get(url, query_string={'query': 'test'}) self.assertJSO...
2410255e846c5fbd756ed97868299e1674c89467
flash_example.py
flash_example.py
from BlinkyTape import BlinkyTape bb = BlinkyTape('/dev/tty.usbmodemfa131') while True: for x in range(60): bb.sendPixel(10, 10, 10) bb.show() for x in range(60): bb.sendPixel(0, 0, 0) bb.show()
from BlinkyTape import BlinkyTape import time #bb = BlinkyTape('/dev/tty.usbmodemfa131') bb = BlinkyTape('COM8') while True: for x in range(60): bb.sendPixel(100, 100, 100) bb.show() time.sleep(.5) for x in range(60): bb.sendPixel(0, 0, 0) bb.show() time.sleep(.5)
Set it to flash black and white every second
Set it to flash black and white every second
Python
mit
Blinkinlabs/BlinkyTape_Python,jpsingleton/BlinkyTape_Python,railsagainstignorance/blinkytape
from BlinkyTape import BlinkyTape bb = BlinkyTape('/dev/tty.usbmodemfa131') while True: for x in range(60): bb.sendPixel(10, 10, 10) bb.show() for x in range(60): bb.sendPixel(0, 0, 0) bb.show() Set it to flash black and white every second
from BlinkyTape import BlinkyTape import time #bb = BlinkyTape('/dev/tty.usbmodemfa131') bb = BlinkyTape('COM8') while True: for x in range(60): bb.sendPixel(100, 100, 100) bb.show() time.sleep(.5) for x in range(60): bb.sendPixel(0, 0, 0) bb.show() time.sleep(.5)
<commit_before>from BlinkyTape import BlinkyTape bb = BlinkyTape('/dev/tty.usbmodemfa131') while True: for x in range(60): bb.sendPixel(10, 10, 10) bb.show() for x in range(60): bb.sendPixel(0, 0, 0) bb.show() <commit_msg>Set it to flash black and white every second<commit_after>
from BlinkyTape import BlinkyTape import time #bb = BlinkyTape('/dev/tty.usbmodemfa131') bb = BlinkyTape('COM8') while True: for x in range(60): bb.sendPixel(100, 100, 100) bb.show() time.sleep(.5) for x in range(60): bb.sendPixel(0, 0, 0) bb.show() time.sleep(.5)
from BlinkyTape import BlinkyTape bb = BlinkyTape('/dev/tty.usbmodemfa131') while True: for x in range(60): bb.sendPixel(10, 10, 10) bb.show() for x in range(60): bb.sendPixel(0, 0, 0) bb.show() Set it to flash black and white every secondfrom BlinkyTape import BlinkyTape import time...
<commit_before>from BlinkyTape import BlinkyTape bb = BlinkyTape('/dev/tty.usbmodemfa131') while True: for x in range(60): bb.sendPixel(10, 10, 10) bb.show() for x in range(60): bb.sendPixel(0, 0, 0) bb.show() <commit_msg>Set it to flash black and white every second<commit_after>from...
251a0d1b1df0fd857a86878ecb7e4c6bc26a93ef
paci/helpers/display_helper.py
paci/helpers/display_helper.py
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def std_input(text, default): """Get input or return default if none is given.""" return input(text.format(default)) or default
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def print_table(entries): """Prints out a table""" print(tabulate(entries, tablefmt="plain")) def std_input(text, default): """...
Add function to just print a simple table
Add function to just print a simple table
Python
mit
tradebyte/paci,tradebyte/paci
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def std_input(text, default): """Get input or return default if none is given.""" return input(text.format(default)) or default Add f...
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def print_table(entries): """Prints out a table""" print(tabulate(entries, tablefmt="plain")) def std_input(text, default): """...
<commit_before>"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def std_input(text, default): """Get input or return default if none is given.""" return input(text.format(default)) o...
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def print_table(entries): """Prints out a table""" print(tabulate(entries, tablefmt="plain")) def std_input(text, default): """...
"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def std_input(text, default): """Get input or return default if none is given.""" return input(text.format(default)) or default Add f...
<commit_before>"""Helper to output stuff""" from tabulate import tabulate def print_list(header, entries): """Prints out a list""" print(tabulate(entries, header, tablefmt="grid")) def std_input(text, default): """Get input or return default if none is given.""" return input(text.format(default)) o...
bb768ef543469395ccbd0b2761442d9dcfa8e0c5
testanalyzer/analyze_repos.py
testanalyzer/analyze_repos.py
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/test.pkl") for _, repo in repos.iterrows(): if not validators.url(repo["url"]): print("Error: Invalid URL.") ...
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/repos.pkl") repos["code_lines"] = 0 repos["code_classes"] = 0 repos["code_functions"] = 0 repos["test_lines"] = 0 rep...
Update dataframe with counts and serialize
Update dataframe with counts and serialize
Python
mpl-2.0
CheriPai/TestAnalyzer,CheriPai/TestAnalyzer,CheriPai/TestAnalyzer
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/test.pkl") for _, repo in repos.iterrows(): if not validators.url(repo["url"]): print("Error: Invalid URL.") ...
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/repos.pkl") repos["code_lines"] = 0 repos["code_classes"] = 0 repos["code_functions"] = 0 repos["test_lines"] = 0 rep...
<commit_before>import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/test.pkl") for _, repo in repos.iterrows(): if not validators.url(repo["url"]): print("Error: Inv...
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/repos.pkl") repos["code_lines"] = 0 repos["code_classes"] = 0 repos["code_functions"] = 0 repos["test_lines"] = 0 rep...
import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/test.pkl") for _, repo in repos.iterrows(): if not validators.url(repo["url"]): print("Error: Invalid URL.") ...
<commit_before>import pandas as pd import shutil import utils as u import validators from analyzer import Analyzer from git import Repo if __name__ == "__main__": repos = pd.read_pickle("data/test.pkl") for _, repo in repos.iterrows(): if not validators.url(repo["url"]): print("Error: Inv...
05d498cc1f216ba722ce887b212ac5e750fb0c8d
tests/test_player_creation.py
tests/test_player_creation.py
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} app.post('/players', params) res = app.get('/players') assert res.status_int...
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} expected = {'count': 1, 'offset': 0, 'players': [ ...
Make player creation test check for valid response.
Make player creation test check for valid response.
Python
mit
dropshot/dropshot-server
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} app.post('/players', params) res = app.get('/players') assert res.status_int...
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} expected = {'count': 1, 'offset': 0, 'players': [ ...
<commit_before>from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} app.post('/players', params) res = app.get('/players') assert...
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} expected = {'count': 1, 'offset': 0, 'players': [ ...
from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} app.post('/players', params) res = app.get('/players') assert res.status_int...
<commit_before>from webtest import TestApp import dropshot def test_create_player(): app = TestApp(dropshot.app) params = {'username': 'chapmang', 'password': 'deadparrot', 'email': '[email protected]'} app.post('/players', params) res = app.get('/players') assert...
fc904d8fd02cecfb2c3d69d6101caaab7b224e93
_bin/person_list_generator.py
_bin/person_list_generator.py
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print """ - role: {} name: {}""".format(row[0], row[1])
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: stream = open('tmp/person_list_output.yml', 'a') stream.write( """ - role: {}\n name: {}\n""".format(row[0], row[1]) ) ...
Make person list generator output to file
Make person list generator output to file The console was going beyond the terminal history limit for 14-15
Python
mit
johnathan99j/history-project,johnathan99j/history-project,newtheatre/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project,johnathan99j/history-project,newtheatre/history-project
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print """ - role: {} name: {}""".format(row[0], row[1]) Make person list generator output to file The console was going beyond the termin...
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: stream = open('tmp/person_list_output.yml', 'a') stream.write( """ - role: {}\n name: {}\n""".format(row[0], row[1]) ) ...
<commit_before># Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print """ - role: {} name: {}""".format(row[0], row[1]) <commit_msg>Make person list generator output to file The console ...
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: stream = open('tmp/person_list_output.yml', 'a') stream.write( """ - role: {}\n name: {}\n""".format(row[0], row[1]) ) ...
# Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print """ - role: {} name: {}""".format(row[0], row[1]) Make person list generator output to file The console was going beyond the termin...
<commit_before># Console outputs a person list import os import csv with open('tmp/person_list_input.csv') as csvfile: csvreader = csv.reader(csvfile) for row in csvreader: print """ - role: {} name: {}""".format(row[0], row[1]) <commit_msg>Make person list generator output to file The console ...
10b9d412c26b90bb86fe1abd04c3fe0f86826104
pelicanconf_with_pagination.py
pelicanconf_with_pagination.py
from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5
import sys # Hack for Travis, where local imports don't work. if '' not in sys.path: sys.path.insert(0, '') from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5
Fix Python import path on Travis.
Fix Python import path on Travis.
Python
apache-2.0
dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog,dhermes/bossylobster-blog
from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5 Fix Python import path on Travis.
import sys # Hack for Travis, where local imports don't work. if '' not in sys.path: sys.path.insert(0, '') from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5
<commit_before>from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5 <commit_msg>Fix Python import path on Travis.<commit_after>
import sys # Hack for Travis, where local imports don't work. if '' not in sys.path: sys.path.insert(0, '') from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5
from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5 Fix Python import path on Travis.import sys # Hack for Travis, where local imports don't work. if '' not in sys.path: sys.path.insert(0, '') from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5
<commit_before>from pelicanconf import * # Over-ride so there is paging. DEFAULT_PAGINATION = 5 <commit_msg>Fix Python import path on Travis.<commit_after>import sys # Hack for Travis, where local imports don't work. if '' not in sys.path: sys.path.insert(0, '') from pelicanconf import * # Over-ride so there is ...
c6ecf6160664bc61cf6dc213af1f2fe3fd6a3617
editorsnotes/djotero/models.py
editorsnotes/djotero/models.py
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField() zotero_data = models.TextField(blank=True) date_information = models.TextF...
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField(blank=True) zotero_data = models.TextField() date_information = models.TextF...
Allow blank zotero url reference, but require zotero json data
Allow blank zotero url reference, but require zotero json data
Python
agpl-3.0
editorsnotes/editorsnotes,editorsnotes/editorsnotes
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField() zotero_data = models.TextField(blank=True) date_information = models.TextF...
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField(blank=True) zotero_data = models.TextField() date_information = models.TextF...
<commit_before>from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField() zotero_data = models.TextField(blank=True) date_information...
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField(blank=True) zotero_data = models.TextField() date_information = models.TextF...
from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField() zotero_data = models.TextField(blank=True) date_information = models.TextF...
<commit_before>from django.db import models from editorsnotes.main.models import Document import utils import json class ZoteroLink(models.Model): doc = models.OneToOneField(Document, related_name='_zotero_link') zotero_url = models.URLField() zotero_data = models.TextField(blank=True) date_information...
9fda3df6ae1f31af139c03eaf8b385746816f3b4
spec/helper.py
spec/helper.py
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) def log(self, *error_message): """Altered log...
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
Remove TestGame.log() method as log() isn't a method of Game anymore
Remove TestGame.log() method as log() isn't a method of Game anymore
Python
mit
AndyDeany/pygame-template
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) def log(self, *error_message): """Altered log...
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
<commit_before>from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) def log(self, *error_message): ...
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) def log(self, *error_message): """Altered log...
<commit_before>from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) def log(self, *error_message): ...
36b8ec51dc6e1caca90db41d83d4dc21d70005a5
app/task.py
app/task.py
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField import datetime, enum class Priority(enum.IntEnum): LOW = 0, MIDDLE = 1, HIGH = 2 """ This defines the basic model for a Task as we want it to be stored in the MongoDB. """ class Task(Document): ...
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField, ValidationError import datetime, enum, Exception from app import logger class Priority(enum.IntEnum): """ This defines the priority levels a Task can have. """ LOW = 0, MIDDLE = 1, HIGH =...
Add a Status enum and documentation
Add a Status enum and documentation
Python
mit
Zillolo/lazy-todo
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField import datetime, enum class Priority(enum.IntEnum): LOW = 0, MIDDLE = 1, HIGH = 2 """ This defines the basic model for a Task as we want it to be stored in the MongoDB. """ class Task(Document): ...
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField, ValidationError import datetime, enum, Exception from app import logger class Priority(enum.IntEnum): """ This defines the priority levels a Task can have. """ LOW = 0, MIDDLE = 1, HIGH =...
<commit_before>from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField import datetime, enum class Priority(enum.IntEnum): LOW = 0, MIDDLE = 1, HIGH = 2 """ This defines the basic model for a Task as we want it to be stored in the MongoDB. """ class Ta...
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField, ValidationError import datetime, enum, Exception from app import logger class Priority(enum.IntEnum): """ This defines the priority levels a Task can have. """ LOW = 0, MIDDLE = 1, HIGH =...
from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField import datetime, enum class Priority(enum.IntEnum): LOW = 0, MIDDLE = 1, HIGH = 2 """ This defines the basic model for a Task as we want it to be stored in the MongoDB. """ class Task(Document): ...
<commit_before>from mongoengine import Document, DateTimeField, EmailField, IntField, \ ReferenceField, StringField import datetime, enum class Priority(enum.IntEnum): LOW = 0, MIDDLE = 1, HIGH = 2 """ This defines the basic model for a Task as we want it to be stored in the MongoDB. """ class Ta...
acf3819d433f3ebc3d3eed17c61f2542f7429f8e
trimesh/resources/__init__.py
trimesh/resources/__init__.py
import os import inspect # find the current absolute path using inspect _pwd = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- ...
import os # find the current absolute path to this directory _pwd = os.path.dirname(__file__) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- name : str File path relative to `trimesh/resources` decode : bool Wh...
Use __file__ instead of inspect, for compatibility with frozen environments
RF: Use __file__ instead of inspect, for compatibility with frozen environments
Python
mit
mikedh/trimesh,mikedh/trimesh,dajusc/trimesh,mikedh/trimesh,mikedh/trimesh,dajusc/trimesh
import os import inspect # find the current absolute path using inspect _pwd = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- ...
import os # find the current absolute path to this directory _pwd = os.path.dirname(__file__) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- name : str File path relative to `trimesh/resources` decode : bool Wh...
<commit_before>import os import inspect # find the current absolute path using inspect _pwd = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ---...
import os # find the current absolute path to this directory _pwd = os.path.dirname(__file__) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- name : str File path relative to `trimesh/resources` decode : bool Wh...
import os import inspect # find the current absolute path using inspect _pwd = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ------------- ...
<commit_before>import os import inspect # find the current absolute path using inspect _pwd = os.path.dirname( os.path.abspath( inspect.getfile( inspect.currentframe()))) def get_resource(name, decode=True): """ Get a resource from the trimesh/resources folder. Parameters ---...
83dabc9fc1142e1575843d3a68c6241185543936
fabtastic/db/__init__.py
fabtastic/db/__init__.py
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: raise NotImplementedError("Fabtastic: DB engine '%s' is not supported" % db_engine)
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: print("Fabtastic WARNING: DB engine '%s' is not supported" % db_engine)
Make the warning for SQLite not being supported a print instead of an exception.
Make the warning for SQLite not being supported a print instead of an exception.
Python
bsd-3-clause
duointeractive/django-fabtastic
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: raise NotImplementedError("Fabtastic: DB engine '%s' is not supported" % db_engine)Make the warning for SQLite not being sup...
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: print("Fabtastic WARNING: DB engine '%s' is not supported" % db_engine)
<commit_before>from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: raise NotImplementedError("Fabtastic: DB engine '%s' is not supported" % db_engine)<commit_msg>Make the warni...
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: print("Fabtastic WARNING: DB engine '%s' is not supported" % db_engine)
from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: raise NotImplementedError("Fabtastic: DB engine '%s' is not supported" % db_engine)Make the warning for SQLite not being sup...
<commit_before>from django.conf import settings from fabtastic.db import util db_engine = util.get_db_setting('ENGINE') if 'postgresql_psycopg2' in db_engine: from fabtastic.db.postgres import * else: raise NotImplementedError("Fabtastic: DB engine '%s' is not supported" % db_engine)<commit_msg>Make the warni...
208f90497c7a6867f9aeece84b1161926ca1627b
nethud/nh_client.py
nethud/nh_client.py
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): data = '{"register": {"...
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): self.send_message('auth...
Simplify nethack protocol to a single method.
Simplify nethack protocol to a single method.
Python
mit
ryansb/netHUD
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): data = '{"register": {"...
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): self.send_message('auth...
<commit_before>""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): data = '...
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): self.send_message('auth...
""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): data = '{"register": {"...
<commit_before>""" An example client. Run simpleserv.py first before running this. """ import json from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected, send a message, then print the result.""" def connectionMade(self): data = '...
881e693d16d12109c3ececffda61336b020c172a
portable_mds/tests/conftest.py
portable_mds/tests/conftest.py
import os import tempfile import shutil import tzlocal import pytest from ..mongoquery.mds import MDS @pytest.fixture(params=[1], scope='function') def mds_all(request): '''Provide a function level scoped FileStore instance talking to temporary database on localhost:27017 with both v0 and v1. ''' ver...
import os import tempfile import shutil import tzlocal import pytest import portable_mds.mongoquery.mds import portable_mds.sqlite.mds variations = [portable_mds.mongoquery.mds, portable_mds.sqlite.mds] @pytest.fixture(params=variations, scope='function') def mds_all(request): '''Provide a function ...
Test sqlite and mongoquery variations.
TST: Test sqlite and mongoquery variations.
Python
bsd-3-clause
ericdill/databroker,ericdill/databroker
import os import tempfile import shutil import tzlocal import pytest from ..mongoquery.mds import MDS @pytest.fixture(params=[1], scope='function') def mds_all(request): '''Provide a function level scoped FileStore instance talking to temporary database on localhost:27017 with both v0 and v1. ''' ver...
import os import tempfile import shutil import tzlocal import pytest import portable_mds.mongoquery.mds import portable_mds.sqlite.mds variations = [portable_mds.mongoquery.mds, portable_mds.sqlite.mds] @pytest.fixture(params=variations, scope='function') def mds_all(request): '''Provide a function ...
<commit_before>import os import tempfile import shutil import tzlocal import pytest from ..mongoquery.mds import MDS @pytest.fixture(params=[1], scope='function') def mds_all(request): '''Provide a function level scoped FileStore instance talking to temporary database on localhost:27017 with both v0 and v1. ...
import os import tempfile import shutil import tzlocal import pytest import portable_mds.mongoquery.mds import portable_mds.sqlite.mds variations = [portable_mds.mongoquery.mds, portable_mds.sqlite.mds] @pytest.fixture(params=variations, scope='function') def mds_all(request): '''Provide a function ...
import os import tempfile import shutil import tzlocal import pytest from ..mongoquery.mds import MDS @pytest.fixture(params=[1], scope='function') def mds_all(request): '''Provide a function level scoped FileStore instance talking to temporary database on localhost:27017 with both v0 and v1. ''' ver...
<commit_before>import os import tempfile import shutil import tzlocal import pytest from ..mongoquery.mds import MDS @pytest.fixture(params=[1], scope='function') def mds_all(request): '''Provide a function level scoped FileStore instance talking to temporary database on localhost:27017 with both v0 and v1. ...
bd5c215c1c481f3811753412bca6b509bb00591a
me_api/app.py
me_api/app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from .middleware.me import me from .cache import cache def _register_module(app, module): if module == 'douban': from .middleware import douban app.register_blueprint(...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from werkzeug.utils import import_string from me_api.middleware.me import me from me_api.cache import cache middlewares = { 'douban': 'me_api.middleware.douban:douban_api', 'githu...
Improve the way that import middlewares
Improve the way that import middlewares
Python
mit
lord63/me-api
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from .middleware.me import me from .cache import cache def _register_module(app, module): if module == 'douban': from .middleware import douban app.register_blueprint(...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from werkzeug.utils import import_string from me_api.middleware.me import me from me_api.cache import cache middlewares = { 'douban': 'me_api.middleware.douban:douban_api', 'githu...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from .middleware.me import me from .cache import cache def _register_module(app, module): if module == 'douban': from .middleware import douban app.regi...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from werkzeug.utils import import_string from me_api.middleware.me import me from me_api.cache import cache middlewares = { 'douban': 'me_api.middleware.douban:douban_api', 'githu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from .middleware.me import me from .cache import cache def _register_module(app, module): if module == 'douban': from .middleware import douban app.register_blueprint(...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from flask import Flask from .middleware.me import me from .cache import cache def _register_module(app, module): if module == 'douban': from .middleware import douban app.regi...
af6f4868f4329fec75e43fe0cdcd1a7665c5238a
contentcuration/manage.py
contentcuration/manage.py
#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from dj...
#!/usr/bin/env python import os import sys if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from django.core.management import exe...
Remove comment on attaching cloud debugger
Remove comment on attaching cloud debugger
Python
mit
DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation
#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from dj...
#!/usr/bin/env python import os import sys if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from django.core.management import exe...
<commit_before>#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings...
#!/usr/bin/env python import os import sys if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from django.core.management import exe...
#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from dj...
<commit_before>#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings...
948b9987afa95d7a69bd61f3d8f9fea822323b01
wagtaildraftail/draft_text.py
wagtaildraftail/draft_text.py
from __future__ import absolute_import, unicode_literals import json from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(self, value, **kwargs): super(DraftText, self)....
from __future__ import absolute_import, unicode_literals import json from django.utils.functional import cached_property from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(se...
Implement equality check for DraftText nodes
Implement equality check for DraftText nodes Compare the (cached) rendered html of a node
Python
mit
gasman/wagtaildraftail,gasman/wagtaildraftail,gasman/wagtaildraftail,springload/wagtaildraftail,gasman/wagtaildraftail,springload/wagtaildraftail,springload/wagtaildraftail,springload/wagtaildraftail
from __future__ import absolute_import, unicode_literals import json from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(self, value, **kwargs): super(DraftText, self)....
from __future__ import absolute_import, unicode_literals import json from django.utils.functional import cached_property from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(se...
<commit_before>from __future__ import absolute_import, unicode_literals import json from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(self, value, **kwargs): super(Dr...
from __future__ import absolute_import, unicode_literals import json from django.utils.functional import cached_property from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(se...
from __future__ import absolute_import, unicode_literals import json from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(self, value, **kwargs): super(DraftText, self)....
<commit_before>from __future__ import absolute_import, unicode_literals import json from draftjs_exporter.html import HTML from wagtail.wagtailcore.rich_text import RichText from wagtaildraftail.settings import get_exporter_config class DraftText(RichText): def __init__(self, value, **kwargs): super(Dr...
8312ac22c444b895bab9f2a3707e4d4a7ccc40b2
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
Remove sphinx pinning since 1.7.6 has been released.
Remove sphinx pinning since 1.7.6 has been released.
Python
apache-2.0
vertexproject/synapse,vertexproject/synapse,vertexproject/synapse
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github....
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github.com/vertexproje...
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages setup( name='synapse', version='0.1.0a1', description='Synapse Distributed Key-Value Hypergraph Analysis Framework', author='Invisigoth Kenshoto', author_email='[email protected]', url='https://github....
c75749922c8be3b70bacd66a6b25b8e50faf7b76
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
Bump flask from 0.10.1 to 1.0
Bump flask from 0.10.1 to 1.0 Bumps [flask](https://github.com/pallets/flask) from 0.10.1 to 1.0. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/0.10.1...1.0) --- updated-dependenci...
Python
bsd-3-clause
codehugger/Flask-Starter,codehugger/Flask-Starter
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
<commit_before># -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='h...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
# -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='https://www.gith...
<commit_before># -*- coding: utf-8 -*- from setuptools import setup setup( name="myapp", version='0.0.1-dev', description='My Awesome Application', author='**INSERT_AUTHOR_NAME**', author_email='**INSERT_AUTHOR_EMAIL**', packages=[ 'myapp', 'myapp.blueprints' ], url='h...
d2f7fce3cac7b2d742ab553325b3394092a0c8f8
setup.py
setup.py
from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pytest'], py_mo...
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
Change the name of the package
Change the name of the package Full length 'version'. Add 'classifiers' and 'keywords'. Include files in MANIFEST.in in the dist.
Python
mit
adolfosilva/libgen.py
from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pytest'], py_mo...
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
<commit_before>from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pyte...
from setuptools import setup setup( name='libgen.py', version='0.1.0', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', classifiers=[ 'License ...
from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pytest'], py_mo...
<commit_before>from setuptools import setup setup( name='libgen', version='0.1', license='MIT', author='Adolfo Silva', author_email='[email protected]', url='https://github.com/adolfosilva/libgen.py', description='A script to download books from gen.lib.rus.ec', tests_requires=['pyte...
5c851ee3d333518829ce26bfc06fd1038e70651c
corehq/util/decorators.py
corehq/util/decorators.py
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ def _outer(fn)...
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception class ContextDecorator(object): """ A base class that enables a context manager to also be used as a decorator. https://docs.python.org/3/library/contextlib.html#...
Add util to temporarily alter log levels
Add util to temporarily alter log levels Also backport ContextDecorator from python 3. I saw this just the other day and it looks like an awesome pattern, and a much clearer way to write decorators.
Python
bsd-3-clause
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ def _outer(fn)...
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception class ContextDecorator(object): """ A base class that enables a context manager to also be used as a decorator. https://docs.python.org/3/library/contextlib.html#...
<commit_before>from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ ...
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception class ContextDecorator(object): """ A base class that enables a context manager to also be used as a decorator. https://docs.python.org/3/library/contextlib.html#...
from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ def _outer(fn)...
<commit_before>from functools import wraps import logging from corehq.util.global_request import get_request from dimagi.utils.logging import notify_exception def handle_uncaught_exceptions(mail_admins=True): """Decorator to log uncaught exceptions and prevent them from bubbling up the call chain. """ ...
a35d6f59d214741f554dde1363d2eac7addb04cb
crypto_enigma/__init__.py
crypto_enigma/__init__.py
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import *
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality. Limitations ~~~~~~~~~~~ Note that the correct display of some characters used to represent components (thin Naval rotors) assumes support for Unicode, while some aspects of the display of machine state depe...
Add limitations to package documentation
Add limitations to package documentation
Python
bsd-3-clause
orome/crypto-enigma-py
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import * Add limitations to package documentation
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality. Limitations ~~~~~~~~~~~ Note that the correct display of some characters used to represent components (thin Naval rotors) assumes support for Unicode, while some aspects of the display of machine state depe...
<commit_before>#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import * <commit_msg>Add limitations to package documentation<com...
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality. Limitations ~~~~~~~~~~~ Note that the correct display of some characters used to represent components (thin Naval rotors) assumes support for Unicode, while some aspects of the display of machine state depe...
#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import * Add limitations to package documentation#!/usr/bin/env python # encodin...
<commit_before>#!/usr/bin/env python # encoding: utf8 """An Enigma machine simulator with rich textual display functionality.""" from ._version import __version__, __author__ #__all__ = ['machine', 'components'] from .components import * from .machine import * <commit_msg>Add limitations to package documentation<com...
08291f3948108da15b9832c495fade04cf2e22c4
tests/tests.py
tests/tests.py
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
Add test to check title of index
Add test to check title of index
Python
mit
jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
<commit_before>#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(sel...
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(self): # V...
<commit_before>#!/usr/bin/env python3 from selenium import webdriver import unittest class AdminPageTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(3) def tearDown(self): self.browser.quit() def test_visit_admin_page(sel...
44520918dc0fad40f3afcfc2cdfde6f3208543cd
garden_lighting/MCP23017/raspberry.py
garden_lighting/MCP23017/raspberry.py
import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registe...
import time import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registers in init...
Use wiringPiSetupGpio, which required root. With wiringPiSetupSys some gpios stayed on low after boot.
Use wiringPiSetupGpio, which required root. With wiringPiSetupSys some gpios stayed on low after boot.
Python
mit
ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting,ammannbros/garden-lighting
import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registe...
import time import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registers in init...
<commit_before>import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to ...
import time import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registers in init...
import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to put all registe...
<commit_before>import time import os import wiringpi from garden_lighting.MCP23017.MCP23017 import MCP23017 class RaspberryMCP23017(MCP23017): def __init__(self, dev_addr, rst_pin=0xFF, i2cport=1): super().__init__(dev_addr, rst_pin, i2cport) def initDevice(self): ''' Does a reset to ...
f30a923b881e908fa607e276de1d152d803248f1
pgpdump/__main__.py
pgpdump/__main__.py
import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date
import sys import cProfile from . import AsciiData, BinaryData def parsefile(name): with open(name) as infile: if name.endswith('.asc'): data = AsciiData(infile.read()) else: data = BinaryData(infile.read()) counter = 0 for packet in data.packets(): counter ...
Update main to run a profiler
Update main to run a profiler Signed-off-by: Dan McGee <[email protected]>
Python
bsd-3-clause
toofishes/python-pgpdump
import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date Update main to run a profiler Signed-off-by: Dan McGee <a6e5737275ff1276377ee2...
import sys import cProfile from . import AsciiData, BinaryData def parsefile(name): with open(name) as infile: if name.endswith('.asc'): data = AsciiData(infile.read()) else: data = BinaryData(infile.read()) counter = 0 for packet in data.packets(): counter ...
<commit_before>import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date <commit_msg>Update main to run a profiler Signed-off-by: Dan Mc...
import sys import cProfile from . import AsciiData, BinaryData def parsefile(name): with open(name) as infile: if name.endswith('.asc'): data = AsciiData(infile.read()) else: data = BinaryData(infile.read()) counter = 0 for packet in data.packets(): counter ...
import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date Update main to run a profiler Signed-off-by: Dan McGee <a6e5737275ff1276377ee2...
<commit_before>import sys from . import BinaryData for filename in sys.argv[1:]: with open(filename) as infile: data = BinaryData(infile.read()) for packet in data.packets(): print hex(packet.key_id), packet.creation_date <commit_msg>Update main to run a profiler Signed-off-by: Dan Mc...
fddc7e09bcebf9b4875906ad03e58699237b13be
src/nodeconductor_assembly_waldur/packages/filters.py
src/nodeconductor_assembly_waldur/packages/filters.py
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
Enable filtering OpenStack package by tenant.
Enable filtering OpenStack package by tenant.
Python
mit
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
<commit_before>import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): ...
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): model = mod...
<commit_before>import django_filters from nodeconductor.core.filters import UUIDFilter from . import models class PackageTemplateFilter(django_filters.FilterSet): name = django_filters.CharFilter(lookup_type='icontains') settings_uuid = UUIDFilter(name='service_settings__uuid') class Meta(object): ...
f5d4f543cc7265433bf6040335b2f6d592b52b91
lmod/__init__.py
lmod/__init__.py
from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if command in ('load', ...
import os # require by lmod output evaluated by exec() from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + arg...
Add import os in lmod to fix regression
Add import os in lmod to fix regression
Python
mit
cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod
from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if command in ('load', ...
import os # require by lmod output evaluated by exec() from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + arg...
<commit_before>from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if comma...
import os # require by lmod output evaluated by exec() from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + arg...
from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if command in ('load', ...
<commit_before>from functools import partial from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, *args): cmd = (environ['LMOD_CMD'], 'python', '--terse', command) result = Popen(cmd + args, stdout=PIPE, stderr=PIPE) if comma...
5d7f2f84600abcede94a0aaee087ef299cf740a6
farmers_api/farmers/views.py
farmers_api/farmers/views.py
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer filter_fields = ('town',)
Add filter on the town field on the Farmer model
Add filter on the town field on the Farmer model
Python
bsd-2-clause
tm-kn/farmers-api
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer Add filter on the town field on the Farmer model
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer filter_fields = ('town',)
<commit_before>from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer <commit_msg>Add filter on the town field on the Farmer model<commit_a...
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer filter_fields = ('town',)
from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer Add filter on the town field on the Farmer modelfrom rest_framework import viewsets ...
<commit_before>from rest_framework import viewsets from .models import Farmer from .serializers import FarmerSerializer class FarmerViewSet(viewsets.ReadOnlyModelViewSet): queryset = Farmer.objects.all() serializer_class = FarmerSerializer <commit_msg>Add filter on the town field on the Farmer model<commit_a...
833ed3352c2e40923c167ddb41edba17db292bb7
salt/returners/mongo_return.py
salt/returners/mongo_return.py
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', } def ret...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', 'mongo.us...
Allow mongo returner to update a password protected mongo database.
Allow mongo returner to update a password protected mongo database.
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', } def ret...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', 'mongo.us...
<commit_before>''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', ...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', 'mongo.us...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', } def ret...
<commit_before>''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem ''' import logging import pymongo log = logging.getLogger(__name__) __opts__ = { 'mongo.host': 'salt', 'mongo.port': 27017, 'mongo.db': 'salt', ...
d4e03bfcbc6292d3a50237f95c9d67ba5d89a475
swampdragon/pubsub_providers/redis_sub_provider.py
swampdragon/pubsub_providers/redis_sub_provider.py
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
Use usubscribe rather than popping the broadcaster
Use usubscribe rather than popping the broadcaster
Python
bsd-3-clause
sahlinet/swampdragon,boris-savic/swampdragon,michael-k/swampdragon,denizs/swampdragon,aexeagmbh/swampdragon,jonashagstedt/swampdragon,jonashagstedt/swampdragon,d9pouces/swampdragon,boris-savic/swampdragon,sahlinet/swampdragon,aexeagmbh/swampdragon,jonashagstedt/swampdragon,bastianh/swampdragon,boris-savic/swampdragon,m...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
<commit_before>import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel ...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel in self._subscr...
<commit_before>import json import tornadoredis.pubsub import tornadoredis from .base_provider import BaseProvider class RedisSubProvider(BaseProvider): def __init__(self): self._subscriber = tornadoredis.pubsub.SockJSSubscriber(tornadoredis.Client()) def close(self, broadcaster): for channel ...
e30e5e9780cfe674a70856609ad6010056936263
picdump/webadapter.py
picdump/webadapter.py
import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(urllike) t...
import requests class WebAdapter: def __init__(self): self.cookies = {} def get(self, urllike): res = requests.get(str(urllike), cookies=self.cookies) self.cookies = res.cookies return res.text
Use requests instead of urllib.request
Use requests instead of urllib.request
Python
mit
kanosaki/PicDump,kanosaki/PicDump
import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(urllike) t...
import requests class WebAdapter: def __init__(self): self.cookies = {} def get(self, urllike): res = requests.get(str(urllike), cookies=self.cookies) self.cookies = res.cookies return res.text
<commit_before> import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(url...
import requests class WebAdapter: def __init__(self): self.cookies = {} def get(self, urllike): res = requests.get(str(urllike), cookies=self.cookies) self.cookies = res.cookies return res.text
import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(urllike) t...
<commit_before> import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(url...
a35abfda8af01f3c5bab4f4122060b630c118cac
bitbots_head_behavior/src/bitbots_head_behavior/actions/pattern_search.py
bitbots_head_behavior/src/bitbots_head_behavior/actions/pattern_search.py
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
Use ros-logging instead of print
Use ros-logging instead of print
Python
bsd-3-clause
bit-bots/bitbots_behaviour
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
<commit_before>import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self...
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
<commit_before>import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self...
86ff28441a23762d30cbab9843a7abeb67bfd028
src/mist/bucky_extras/clients/debug_client.py
src/mist/bucky_extras/clients/debug_client.py
import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout def send(s...
import sys import time import datetime from bucky.client import Client from bucky.names import statname class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') ...
Improve printing in bucky's DebugClient
Improve printing in bucky's DebugClient
Python
apache-2.0
mistio/mist.monitor,mistio/mist.monitor
import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout def send(s...
import sys import time import datetime from bucky.client import Client from bucky.names import statname class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') ...
<commit_before>import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout ...
import sys import time import datetime from bucky.client import Client from bucky.names import statname class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') ...
import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout def send(s...
<commit_before>import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout ...
b38f465e512f9b7e79935c156c60ef56d6122387
aiohttp_middlewares/constants.py
aiohttp_middlewares/constants.py
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
Order HTTP methods in constant.
chore: Order HTTP methods in constant.
Python
bsd-3-clause
playpauseandstop/aiohttp-middlewares,playpauseandstop/aiohttp-middlewares
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
<commit_before>""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NO...
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
<commit_before>""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NO...
fbb2c05aef76c02094c13f5edeaecd9b7428ff11
alignak_backend/models/uipref.py
alignak_backend/models/uipref.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
Update UI preferences model (dict)
Update UI preferences model (dict)
Python
agpl-3.0
Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema...
53b9eff3ffc1768d3503021e7248351e24d59af7
tests/httpd.py
tests/httpd.py
import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) try: ...
import BaseHTTPServer class Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): content_type = self.headers.getheader('content-type') content_length = int(self.headers.getheader('content-length')) self.send_response(200) self.send_header('Content-Type', content_type) ...
Fix test http server, change to echo back request body
Fix test http server, change to echo back request body
Python
bsd-2-clause
chop-dbhi/django-webhooks,pombredanne/django-webhooks,pombredanne/django-webhooks,chop-dbhi/django-webhooks
import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) try: ...
import BaseHTTPServer class Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): content_type = self.headers.getheader('content-type') content_length = int(self.headers.getheader('content-length')) self.send_response(200) self.send_header('Content-Type', content_type) ...
<commit_before>import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) ...
import BaseHTTPServer class Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): content_type = self.headers.getheader('content-type') content_length = int(self.headers.getheader('content-length')) self.send_response(200) self.send_header('Content-Type', content_type) ...
import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) try: ...
<commit_before>import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) ...
b9143462c004af7d18a66fa92ad94585468751b9
IndexedRedis/fields/classic.py
IndexedRedis/fields/classic.py
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
Change IRFieldClassic to use 'encoded_str_type'
Change IRFieldClassic to use 'encoded_str_type'
Python
lgpl-2.1
kata198/indexedredis,kata198/indexedredis
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
<commit_before># Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, ir...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
<commit_before># Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, ir...
effa5f84fc93ced38ad9e5d3b0a16bea2d3914ef
caminae/common/templatetags/field_verbose_name.py
caminae/common/templatetags/field_verbose_name.py
from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name)
from django import template from django.db.models.fields.related import FieldDoesNotExist register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" try: return obj._meta.get_field(field).verbose_name except FieldDoesNotExist: a = getattr(o...
Allow column to be a property
Allow column to be a property
Python
bsd-2-clause
makinacorpus/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,johan--/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-adm...
from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name) Allow column to be a property
from django import template from django.db.models.fields.related import FieldDoesNotExist register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" try: return obj._meta.get_field(field).verbose_name except FieldDoesNotExist: a = getattr(o...
<commit_before>from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name) <commit_msg>Allow column ...
from django import template from django.db.models.fields.related import FieldDoesNotExist register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" try: return obj._meta.get_field(field).verbose_name except FieldDoesNotExist: a = getattr(o...
from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name) Allow column to be a propertyfrom django...
<commit_before>from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name) <commit_msg>Allow column ...
bdb78cd1bb13981a20ecb0cf9eb981d784c95b0e
fellowms/forms.py
fellowms/forms.py
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class Meta: mo...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "home_lon", "home_lat", "inauguration_year", "mentor", ] ...
Update form to handle home_lon and home_lat
Update form to handle home_lon and home_lat
Python
bsd-3-clause
softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class Meta: mo...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "home_lon", "home_lat", "inauguration_year", "mentor", ] ...
<commit_before>from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class M...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "home_lon", "home_lat", "inauguration_year", "mentor", ] ...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class Meta: mo...
<commit_before>from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class M...
ca2b02d551e9bb4c8625ae79f7878892673fa731
corehq/apps/es/domains.py
corehq/apps/es/domains.py
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def real_domains(): ...
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commcare_domains, commconnect_domains, commtrack_domains, created, ] +...
Add CommCare, CommTrack filters for DomainES
Add CommCare, CommTrack filters for DomainES
Python
bsd-3-clause
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def real_domains(): ...
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commcare_domains, commconnect_domains, commtrack_domains, created, ] +...
<commit_before>from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def r...
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commcare_domains, commconnect_domains, commtrack_domains, created, ] +...
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def real_domains(): ...
<commit_before>from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def r...
11f933e986dd9e2c62b852ca38a37f959c10145e
tools/utils.py
tools/utils.py
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
Fix FindDepotToolsInPath not working in some cases
Fix FindDepotToolsInPath not working in some cases When depot tools' path in PATH is like '/home/project/depot_tools/', FindDepotToolsInPath will not detect it because os.path.basename will get empty string. Fix this by getting its parent if its basename is empty. BUG=https://github.com/otcshare/cameo/issues/29
Python
bsd-3-clause
shaochangbin/crosswalk,rakuco/crosswalk,RafuCater/crosswalk,DonnaWuDongxia/crosswalk,tomatell/crosswalk,mrunalk/crosswalk,jpike88/crosswalk,dreamsxin/crosswalk,stonegithubs/crosswalk,weiyirong/crosswalk-1,siovene/crosswalk,baleboy/crosswalk,crosswalk-project/crosswalk,fujunwei/crosswalk,ZhengXinCN/crosswalk,minggangw/c...
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
<commit_before>#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('P...
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
<commit_before>#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('P...
91ff0fcb40d5d5318b71f0eb4b0873fb470265a0
migrations/versions/f0c9c797c230_populate_application_settings_with_.py
migrations/versions/f0c9c797c230_populate_application_settings_with_.py
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
Add downgrade started applications migration
Add downgrade started applications migration
Python
agpl-3.0
loomchild/puffin,loomchild/puffin,loomchild/puffin,puffinrocks/puffin,puffinrocks/puffin,loomchild/jenca-puffin,loomchild/puffin,loomchild/jenca-puffin,loomchild/puffin
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
<commit_before>"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.co...
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
<commit_before>"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.co...
50ead4fe13eec7ad9760f0f577212beb8e8a51be
pombola/info/views.py
pombola/info/views.py
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page, or 'index' if no slug""" model = InfoPage
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page for the given slug""" model = InfoPage queryset = InfoPage.objects.filter(kind=InfoPage.KIND_PAGE)
Use a queryset to display only kind=page
Use a queryset to display only kind=page
Python
agpl-3.0
mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,hzj123/56th,ken-muturi/pombola,mysociety/pombola,patricmutwiri/pombola,patricmutwiri/pombola,ken-muturi/pombola,ken-muturi/pombola,hzj123/56th,ken-muturi/pombola,ken-muturi/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,geoffkilpin/pombola,h...
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page, or 'index' if no slug""" model = InfoPage Use a queryset to display only kind=page
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page for the given slug""" model = InfoPage queryset = InfoPage.objects.filter(kind=InfoPage.KIND_PAGE)
<commit_before>from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page, or 'index' if no slug""" model = InfoPage <commit_msg>Use a queryset to display only kind=page<commit_after>
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page for the given slug""" model = InfoPage queryset = InfoPage.objects.filter(kind=InfoPage.KIND_PAGE)
from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page, or 'index' if no slug""" model = InfoPage Use a queryset to display only kind=pagefrom django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): ...
<commit_before>from django.views.generic import DetailView from models import InfoPage class InfoPageView(DetailView): """Show the page, or 'index' if no slug""" model = InfoPage <commit_msg>Use a queryset to display only kind=page<commit_after>from django.views.generic import DetailView from models import Inf...