commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
1e513d901dfef9135a62c8f99633b10d3900ecb8
Fix case when processing column names for MySQL
sdispater/orator
orator/schema/mysql_builder.py
orator/schema/mysql_builder.py
# -*- coding: utf-8 -*- from .builder import SchemaBuilder class MySQLSchemaBuilder(SchemaBuilder): def has_table(self, table): """ Determine if the given table exists. :param table: The table :type table: str :rtype: bool """ sql = self._grammar.compile_...
# -*- coding: utf-8 -*- from .builder import SchemaBuilder class MySQLSchemaBuilder(SchemaBuilder): def has_table(self, table): """ Determine if the given table exists. :param table: The table :type table: str :rtype: bool """ sql = self._grammar.compile...
mit
Python
fa63410e5c408bb6aea35d7f80c5ad2193d69be8
Install CDAP CLI package
cdapio/cdap-ambari-service,cdapio/cdap-ambari-service
package/scripts/cli.py
package/scripts/cli.py
import sys from resource_management import * class CLI(Script): def install(self, env): print 'Install the CDAP CLI' import params # Add repository file helpers.add_repo(params.files_dir + params.repo_file, params.os_repo_dir) # Install any global packages self.install_packages(env) # Ins...
import sys from resource_management import * class CLI(Script): def install(self, env): print 'Install the CDAP CLI' def configure(self, env): print 'Configure the CDAP CLI' import params env.set_params(params) helpers.cdap_config('client') def status(self, env): raise ClientComponentHa...
apache-2.0
Python
910345ccdab24662a562ecf818da17c00b6b07c9
fix typo that fails stats command
OriHoch/Open-Knesset,OriHoch/Open-Knesset,MeirKriheli/Open-Knesset,daonb/Open-Knesset,daonb/Open-Knesset,alonisser/Open-Knesset,alonisser/Open-Knesset,daonb/Open-Knesset,alonisser/Open-Knesset,MeirKriheli/Open-Knesset,MeirKriheli/Open-Knesset,MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,OriHoch/Open-Knesset,daonb/Open...
mks/management/commands/recalc_mks_bill_stats.py
mks/management/commands/recalc_mks_bill_stats.py
from django.core.management.base import NoArgsCommand from logging import getLogger from mks.models import Member from django.core.cache import cache logger = getLogger(__name__) class Command(NoArgsCommand): help = "Recalculates bill statistics for mks of current knesset" info_types = ['bills_proposed', 'bi...
from django.core.management.base import NoArgsCommand from logging import getLogger from mks.models import Member from django.core.cache import cache logger = getLogger(__name__) class Command(NoArgsCommand): help = "Recalculates bill statistics for mks of current knesset" info_types = ['bills_proposed', 'bil...
bsd-3-clause
Python
dacc3fa91017c2541caf4dde17fd17a9ff0e964d
Bump version 0.2.6
kenjhim/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting
accounting/__init__.py
accounting/__init__.py
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 2, 6) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) # Append 3rd digit if > 0 if VERSION[2]: version = '%s.%s' % (versi...
import os # Use 'final' as the 4th element to indicate # a full release VERSION = (0, 2, 5) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) # Append 3rd digit if > 0 if VERSION[2]: version = '%s.%s' % (versi...
mit
Python
0a6078f5d0537cea9f36894b736fa274c3fa3e47
Fix upload form to only accept .zip files
praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo
molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/forms.py
molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/forms.py
from django import forms class MediaForm(forms.Form): zip_file = forms.FileField(label="Zipped Media File") def clean_zip_file(self): file = self.cleaned_data['zip_file'] if file: extension = file.name.split('.')[-1] if extension != 'zip': raise forms....
from django import forms class MediaForm(forms.Form): zip_file = forms.FileField(label="Zipped Media File") def clean_data_file(self): file = self.cleaned_data['data_file'] if file: extension = file.name.split('.')[-1] if extension != 'zip': raise form...
bsd-2-clause
Python
9ae865a5b5b6cf56307b01d5e64a99a0b0ffe078
Add Rocky milestone tag for alembic migration revisions
openstack/neutron,openstack/neutron,mahak/neutron,openstack/neutron,mahak/neutron,mahak/neutron
neutron/db/migration/alembic_migrations/versions/rocky/expand/867d39095bf4_port_forwarding.py
neutron/db/migration/alembic_migrations/versions/rocky/expand/867d39095bf4_port_forwarding.py
# Copyright 2018 OpenStack Foundation # # 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 ...
# Copyright 2018 OpenStack Foundation # # 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 ...
apache-2.0
Python
2e627fe0ac923c42a652f49bd01f2fd255aa9f1d
Fix autonomous selector tests to work with new pyfrc
robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities
robotpy_ext/autonomous/selector_tests.py
robotpy_ext/autonomous/selector_tests.py
import logging from pyfrc.test_support.controller import TestController as PyfrcTestController from networktables.util import ChooserControl autonomous_seconds = 15 def test_all_autonomous(control: PyfrcTestController): """ This test runs all possible autonomous modes that can be selected by the autonom...
import pyfrc.config import pytest from networktables.util import ChooserControl autonomous_seconds = 15 _gsms = pyfrc.config.config_obj["pyfrc"]["game_specific_messages"] @pytest.mark.parametrize("gamedata", _gsms or [""]) def test_all_autonomous(control, fake_time, robot, gamedata): """ This test runs all p...
bsd-3-clause
Python
b14f077615096294e1e7e5fbd7ee4cfa10813298
fix comment - we use dots not spaces
dmd/clack
clack_comm.py
clack_comm.py
#!/usr/bin/python import sys import os import fileinput import serial import struct import time class PortTalker(object): def __init__(self, port): self.sp = serial.Serial(port, 57600) self.sp.setTimeout(0.02) self.buff = '' def send_picture(self, half, data): assert half in [...
#!/usr/bin/python import sys import os import fileinput import serial import struct import time class PortTalker(object): def __init__(self, port): self.sp = serial.Serial(port, 57600) self.sp.setTimeout(0.02) self.buff = '' def send_picture(self, half, data): assert half in [...
apache-2.0
Python
7d6b5f649e266cecffcd386385b67dea5fc7c844
make importable
paultopia/cleanpunct
cleanpunct.py
cleanpunct.py
# -*- coding: utf-8 -*- drek = {u'β€œ': '"', u'”': '"', u"’": "'", u"β€˜": "'", u'β€”': '-', u'βˆ’': '-'} def clean(text): for key in drek.keys(): text = text.replace(key, drek[key]) return text def cleanFile(filename): import io with io.open(filename,'r',encoding='utf8') as t: text = t.read() newtext = cl...
# -*- coding: utf-8 -*- drek = {u'β€œ': '"', u'”': '"', u"’": "'", u"β€˜": "'", u'β€”': '-', u'βˆ’': '-'} def clean(text): for key in drek.keys(): text = text.replace(key, drek[key]) return text def cleanFile(filename): import io with io.open(filename,'r',encoding='utf8') as t: text = t.read() newtext = cl...
mit
Python
4f7c96f3c0db56b2d5e0a140ab26cc366fb109ba
Update to F# 3.1.1.10.
BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild
packages/fsharp-3.1.py
packages/fsharp-3.1.py
class Fsharp31Package(GitHubTarballPackage): def __init__(self): GitHubTarballPackage.__init__(self, 'fsharp', 'fsharp', '3.1.1.10', 'ce5dd38c209fcd74e6bb42e3a42eb0574a4a6bf1', configure = '') def build(self): self.sh ('autoreconf') self.sh ('./configure --prefix="%{prefix}"') self.sh ('make') ...
class Fsharp31Package(GitHubTarballPackage): def __init__(self): GitHubTarballPackage.__init__(self, 'fsharp', 'fsharp', '3.1.1.7', 'fdc33bfdd7966bf11daadfae951bb6b1b26233c3', configure = '') def build(self): self.sh ('autoreconf') self.sh ('./configure --prefix="%{prefix}"') self.sh ('make') F...
mit
Python
565fe7c0cdadf41ff62d7039ed2bb3e04886e185
Add li_model, tb_model and ts_model to interactive
lnls-fac/sirius
sirius/interactive.py
sirius/interactive.py
"""Interactive sirius module Use this module to define variables and functions to be globally available when using 'from sirius.interactive import *' """ from pyaccel.interactive import * import sirius.SI_V07 as si_model import sirius.BO_V901 as bo_model import sirius.TB_V300 as tb_model import sirius.TS_V400 a...
"""Interactive sirius module Use this module to define variables and functions to be globally available when using 'from sirius.interactive import *' """ from pyaccel.interactive import * import sirius.SI_V07 as si_model import sirius.BO_V901 as bo_model __all__ = [name for name in dir() if not name.startswit...
mit
Python
40ad778928c8cd1d254139f816eccd6afe10c2f3
modify api call test to make sure lists get encoded properly
janrain/janrain-python-api,janrain/janrain-python-api
janrain/capture/test/test_api.py
janrain/capture/test/test_api.py
import unittest import json from janrain.capture import Api, config from janrain.capture.api import api_encode from janrain.capture.exceptions import * from os.path import exists from os.path import expanduser from os import environ class TestApi(unittest.TestCase): """ Test the api module. """ def setUp(self)...
import unittest import json from janrain.capture import Api, config from janrain.capture.api import api_encode from janrain.capture.exceptions import * from os.path import exists from os.path import expanduser from os import environ class TestApi(unittest.TestCase): """ Test the api module. """ def setUp(self)...
mit
Python
d86667933cceae375a3b0e8cf59fe2b9a40a348c
format for viz
elazarg/ug-data
src/read.py
src/read.py
import json import itertools as it from collections import defaultdict COURSE_LIST_FILENAME = 'course_list.json' REVERSE_KDAM_FILENAME = 'reverse_kdam.json' REVERSE_ADJACENT_FILENAME = 'reverse_adjacent.json' def read_json_to_dict(filename=COURSE_LIST_FILENAME): with open(filename, encoding='utf8') as f: ...
import json import itertools as it from collections import defaultdict COURSE_LIST_FILENAME = 'course_list.json' REVERSE_KDAM_FILENAME = 'reverse_kdam.json' REVERSE_ADJACENT_FILENAME = 'reverse_adjacent.json' def read_json_to_dict(filename=COURSE_LIST_FILENAME): with open(filename, encoding='utf8') as f: ...
mit
Python
8a55e9fac0885c5b6eb21cd8f3da54a105de8010
Fix utils module import mechanism
bnoi/scikit-tracker,bnoi/scikit-tracker,bnoi/scikit-tracker
sktracker/__init__.py
sktracker/__init__.py
"""Object detection and tracking for cell biology `scikit-learn` is bla bla bla. Subpackages ----------- color Color space conversion. """ try: from .version import __version__ except ImportError: __version__ = "dev" import utils
"""Object detection and tracking for cell biology `scikit-learn` is bla bla bla. Subpackages ----------- color Color space conversion. Utility Functions ----------------- img_as_float Convert an image to floating point format, with values in [0, 1]. """ try: from .version import __version__ except Imp...
bsd-3-clause
Python
f6b87ad3a81fdd49447f8ed56ba979e395ba5cad
Mark result as safe
affan2/django-embedly
embeds/templatetags/embed_filters.py
embeds/templatetags/embed_filters.py
import re from datetime import datetime from hashlib import md5 from django import template from django.core.cache import cache from django.conf import settings from embedly import Embedly from embeds.models import SavedEmbed from django.utils.safestring import mark_safe register = template.Library() EMBED_REGEX =...
import re from datetime import datetime from hashlib import md5 from django import template from django.core.cache import cache from django.conf import settings from embedly import Embedly from embeds.models import SavedEmbed register = template.Library() EMBED_REGEX = re.compile(r'https?://[\w\d:#@%/;$()~_?\+\-=\\...
apache-2.0
Python
464310c35f62ba8846ffbd5916bcd02653547ec6
Improve ticket #8 test
zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara
test/tree/test_contributed_2009.py
test/tree/test_contributed_2009.py
# -*- encoding: utf-8 -*- #Tests based on bug reports and other contributions from the community import unittest from amara.lib import testsupport from amara.bindery import parse import amara class Test_many_attribs(unittest.TestCase): """http://trac.xml3k.org/ticket/8""" MANY_ATTRS_XML = """<row a="1" b="2" ...
# -*- encoding: utf-8 -*- #Tests based on bug reports and other contributions from the community import unittest from amara.lib import testsupport from amara.bindery import parse import amara class Test_many_attribs(unittest.TestCase): """http://trac.xml3k.org/ticket/8""" MANY_ATTRS_XML = """<row a="" b="" c=...
apache-2.0
Python
015064957be96767ade87f3cf2cee3205a768be3
Update LightIntensity.py
Python-IoT/Smart-IoT-Planting-System,Python-IoT/Smart-IoT-Planting-System
device/src/LightIntensity.py
device/src/LightIntensity.py
#-------------------------------------- # ___ _ ____ # / __(_)__ / __/ # _\ \/ / _ \_\ \ # /___/_/ .__/___/ # /_/ # # LightIntensity.py # Get light intensity data from GY-30 module which is base on bh1750 sensor. # # Author : Arvin # Date : 15/09/2017 #-------------------------------------...
#-------------------------------------- # ___ _ ____ # / __(_)__ / __/ # _\ \/ / _ \_\ \ # /___/_/ .__/___/ # /_/ # # LightIntensity.py # Get light intensity data from GY-30 module which is base on bh1750 sensor. # # Author : Arvin # Date : 15/09/2017 #-------------------------------------...
mit
Python
3622e89334b9e6ca9b27b56a86083ec8b6952c14
add todo for upcoming fixes (mostly to trigger Travis again)
julienr/vispy,QuLogic/vispy,Eric89GXL/vispy,hronoses/vispy,sh4wn/vispy,QuLogic/vispy,jdreaver/vispy,Eric89GXL/vispy,jdreaver/vispy,Eric89GXL/vispy,dchilds7/Deysha-Star-Formation,bollu/vispy,julienr/vispy,sbtlaarzc/vispy,michaelaye/vispy,kkuunnddaannkk/vispy,bollu/vispy,inclement/vispy,jdreaver/vispy,kkuunnddaannkk/visp...
vispy/gloo/globject.py
vispy/gloo/globject.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------------------...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------------------...
bsd-3-clause
Python
ecb84d6ba705b6fd18429f762b6cd585dac1a944
Use DummyActionLog in tests
bcroq/kansha,Net-ng/kansha,Net-ng/kansha,bcroq/kansha,Net-ng/kansha,Net-ng/kansha,bcroq/kansha,bcroq/kansha
kansha/card_addons/vote/tests.py
kansha/card_addons/vote/tests.py
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- import unittest from nagare import database from elixir import metadata as...
# -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- import unittest from nagare import database from elixir import metadata as...
bsd-3-clause
Python
607595b11c7b139be778a1f021951a629b6f3e3b
Remove commenting out for print word ladder graph
bowen0701/algorithms_data_structures
alg_word_ladder_bfs.py
alg_word_ladder_bfs.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division from collections import defaultdict from itertools import product from alg_breadth_first_search import traverse_bfs WORDS_FILE = 'four_letter_words.txt' def read_words(): """Read words file with produci...
from __future__ import absolute_import from __future__ import print_function from __future__ import division from collections import defaultdict from itertools import product from alg_breadth_first_search import traverse_bfs WORDS_FILE = 'four_letter_words.txt' def read_words(): """Read words file with produci...
bsd-2-clause
Python
c51477ac93f2145b87283547b7d48b0086e51e91
Add tests outline
imsally/redash,hudl/redash,ninneko/redash,imsally/redash,easytaxibr/redash,imsally/redash,ninneko/redash,crowdworks/redash,amino-data/redash,stefanseifert/redash,getredash/redash,getredash/redash,easytaxibr/redash,stefanseifert/redash,EverlyWell/redash,vishesh92/redash,44px/redash,M32Media/redash,amino-data/redash,deni...
tests/handlers/test_permissions.py
tests/handlers/test_permissions.py
from redash import models from tests import BaseTestCase from tests.test_handlers import AuthenticationTestMixin class QueryAccessPermissionsTest(BaseTestCase, AuthenticationTestMixin): def setUp(self): self.paths = ['/api/queries/1/acl'] super(QueryAccessPermissionsTest, self).setUp() def te...
from redash import models from tests import BaseTestCase from tests.test_handlers import AuthenticationTestMixin class QueryAccessPermissionsTest(BaseTestCase, AuthenticationTestMixin): def setUp(self): self.paths = ['/api/queries/1/acl'] super(QueryAccessPermissionsTest, self).setUp() def te...
bsd-2-clause
Python
9638f427356c19746dd81bfe88338f84120e9bb6
Fix #23: arguments order for _send_mail call
danirus/django-comments-xtd,danirus/django-comments-xtd,danirus/django-comments-xtd,danirus/django-comments-xtd
django_comments_xtd/utils.py
django_comments_xtd/utils.py
# Idea borrowed from Selwin Ong post: # http://ui.co.id/blog/asynchronous-send_mail-in-django try: import Queue as queue # python2 except ImportError: import queue as queue # python3 import threading from django.core.mail import EmailMultiAlternatives from django_comments_xtd.conf import settings mail_sent_...
# Idea borrowed from Selwin Ong post: # http://ui.co.id/blog/asynchronous-send_mail-in-django try: import Queue as queue # python2 except ImportError: import queue as queue # python3 import threading from django.core.mail import EmailMultiAlternatives from django_comments_xtd.conf import settings mail_sent_...
bsd-2-clause
Python
8347bd449fc137cbbc986461b3f4aa5c68c2137e
Replace deprecated function call
almarklein/scikit-image,bsipocz/scikit-image,newville/scikit-image,chriscrosscutler/scikit-image,rjeli/scikit-image,chintak/scikit-image,oew1v07/scikit-image,WarrenWeckesser/scikits-image,youprofit/scikit-image,blink1073/scikit-image,michaelaye/scikit-image,keflavich/scikit-image,chintak/scikit-image,vighneshbirodkar/s...
doc/examples/plot_denoise.py
doc/examples/plot_denoise.py
""" ============================= Denoising the picture of Lena ============================= In this example, we denoise a noisy version of the picture of Lena using the total variation and bilateral denoising filter. These algorithms typically produce "posterized" images with flat domains separated by sharp edges. ...
""" ============================= Denoising the picture of Lena ============================= In this example, we denoise a noisy version of the picture of Lena using the total variation and bilateral denoising filter. These algorithms typically produce "posterized" images with flat domains separated by sharp edges. ...
bsd-3-clause
Python
6472a472266328bca855d98d5c7c8704bf42fa1c
Complete iterative sol
bowen0701/algorithms_data_structures
lc0041_first_missing_positive.py
lc0041_first_missing_positive.py
"""Leetcode 41. First Missing Positive Hard URL: https://leetcode.com/problems/first-missing-positive/ Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 Note: Your algori...
"""Leetcode 41. First Missing Positive Hard URL: https://leetcode.com/problems/first-missing-positive/ Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 Note: Your algori...
bsd-2-clause
Python
aa14c724ff845c3c1bd9bbd6097a8b6799a43b6c
update preformance of merge-k-sorted-lists.py
dsysoev/fun-with-algorithms
leetcode/merge-k-sorted-lists.py
leetcode/merge-k-sorted-lists.py
# https://leetcode.com/problems/merge-k-sorted-lists/submissions/ # Runtime: 116 ms, faster than 56.96% of Python3 online submissions for Merge k Sorted Lists. # Memory Usage: 16.4 MB, less than 56.06% of Python3 online submissions for Merge k Sorted Lists import sortedcontainers # Definition for singly-linked list. ...
# https://leetcode.com/problems/merge-k-sorted-lists/submissions/ # Runtime: 128 ms, faster than 42.22% of Python3 online submissions for Merge k Sorted Lists. # Memory Usage: 16 MB, less than 100.00% of Python3 online submissions for Merge k Sorted Lists. # Definition for singly-linked list. # class ListNode: # ...
mit
Python
e92fa763729ce68e86da3664ae1a1ed37e3200a5
Add ballot paper ID to API
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
ynr/apps/uk_results/serializers.py
ynr/apps/uk_results/serializers.py
from __future__ import unicode_literals from rest_framework import serializers from candidates.serializers import MembershipSerializer from .models import CandidateResult, ResultSet class CandidateResultSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = CandidateResult fiel...
from __future__ import unicode_literals from rest_framework import serializers from candidates.serializers import MembershipSerializer from .models import CandidateResult, ResultSet class CandidateResultSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = CandidateResult fiel...
agpl-3.0
Python
51199dc1da7646b3db55ea941231c70504995b90
Fix issue #86
regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations,regular/pyglet-avbin-optimizations
tests/window/EVENT_MOUSE_MOTION.py
tests/window/EVENT_MOUSE_MOTION.py
#!/usr/bin/env python '''Test that mouse motion event works correctly. Expected behaviour: One window will be opened. Move the mouse in and out of this window and ensure the absolute and relative coordinates are correct. - Absolute coordinates relative to 0,0 at bottom-left of client area of wind...
#!/usr/bin/env python '''Test that mouse motion event works correctly. Expected behaviour: One window will be opened. Move the mouse in and out of this window and ensure the absolute and relative coordinates are correct. - Absolute coordinates relative to 0,0 at top-left of client area of window....
bsd-3-clause
Python
e4ed22e1abc29436fbc262947795d2c4e5e78a4c
update tests (partially)
SexualHealthInnovations/callisto-core,SexualHealthInnovations/callisto-core,project-callisto/callisto-core,project-callisto/callisto-core
callisto_core/tests/notification/test_email.py
callisto_core/tests/notification/test_email.py
from unittest import skip from django.conf import settings from django.test import TestCase from callisto_core.notification import tasks class TestAsyncEmail(TestCase): TEST_DOMAIN = 'localhost' def setUp(self): self.mailgun_post_route = f'https://api.mailgun.net/v3/{self.TEST_DOMAIN}/messages' ...
from django.test import TestCase from callisto_core.notification import tasks class TestAsyncEmail(TestCase): def setUp(self): self.email_data = { 'to': 'test@example.com', 'subject': 'test', 'html': '<h1>test</h1>', 'o:testmode': 'yes', } ...
agpl-3.0
Python
03c125ca50dae2838e0b5625ea3008bd26e49a32
Refactor do/undo ops into single toggle function
shacker/django-todo,shacker/django-todo,shacker/django-todo
todo/utils.py
todo/utils.py
import datetime from django.contrib import messages from django.contrib.sites.models import Site from django.core.mail import send_mail from django.template.loader import render_to_string from todo.models import Item def toggle_done(request, items): # Check for items in the mark_done POST array. If present, cha...
import datetime from django.contrib import messages from django.contrib.sites.models import Site from django.core.mail import send_mail from django.template.loader import render_to_string from todo.models import Item def mark_done(request, done_items): # Check for items in the mark_done POST array. If present, ...
bsd-3-clause
Python
c3ac3d8de10ed90b84a044d8662611bb15020df7
Make tests python2.6 compatible.
glogiotatidis/lumbergh,ziir/lumbergh,glogiotatidis/lumbergh,alexgibson/lumbergh,mozilla/lumbergh,chirilo/lumbergh,mozilla/lumbergh,mozilla/lumbergh,ziir/lumbergh,alexgibson/lumbergh,mozilla/lumbergh,chirilo/lumbergh,chirilo/lumbergh,chirilo/lumbergh,alexgibson/lumbergh,glogiotatidis/lumbergh,ziir/lumbergh,glogiotatidis...
careers/university/tests/test_models.py
careers/university/tests/test_models.py
import locale from datetime import date from django.core.exceptions import ValidationError from nose.tools import assert_raises, eq_ from careers.base.tests import TestCase from careers.university.tests import EventFactory MAY = locale.nl_langinfo(locale.ABMON_5) JUN = locale.nl_langinfo(locale.ABMON_6) class Ev...
import locale from datetime import date from django.core.exceptions import ValidationError from nose.tools import assert_raises, eq_ from careers.base.tests import TestCase from careers.university.tests import EventFactory MAY = locale.nl_langinfo(locale.ABMON_5) JUN = locale.nl_langinfo(locale.ABMON_6) class Ev...
mpl-2.0
Python
3c8b3a24978cf757fb3a8cc8660eb4554f183e0f
Use get_db_prep_value instead of get_db_prep_save. Closes gh-42
WW-Digital/django-social-auth,1st/django-social-auth,vxvinh1511/django-social-auth,limdauto/django-social-auth,michael-borisov/django-social-auth,caktus/django-social-auth,thesealion/django-social-auth,lovehhf/django-social-auth,dongguangming/django-social-auth,VishvajitP/django-social-auth,MjAbuz/django-social-auth,du...
social_auth/fields.py
social_auth/fields.py
from django.core.exceptions import ValidationError from django.db import models from django.utils import simplejson class JSONField(models.TextField): """Simple JSON field that stores python structures as JSON strings on database. """ __metaclass__ = models.SubfieldBase def to_python(self, value...
from django.core.exceptions import ValidationError from django.db import models from django.utils import simplejson class JSONField(models.TextField): """Simple JSON field that stores python structures as JSON strings on database. """ __metaclass__ = models.SubfieldBase def to_python(self, value...
bsd-3-clause
Python
f70647419099cdeb85acc2767f2fefa98617caf3
add generic default no html email message
qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq
dimagi/utils/django/email.py
dimagi/utils/django/email.py
from django.conf import settings from django.core.mail import SMTPConnection from django.core.mail.message import EmailMultiAlternatives NO_HTML_EMAIL_MESSAGE = """ Your email client is trying to display the plaintext version of an email that is only supported in HTML. Please set your email client to display this mess...
from django.conf import settings from django.core.mail import SMTPConnection from django.core.mail.message import EmailMultiAlternatives def send_HTML_email(subject, recipient, html_content, text_content=None): if not text_content: text_content = settings.NO_HTML_EMAIL_MESSAGE # If you get the return_...
bsd-3-clause
Python
86f9ba7a47e8c5dc3d04ded71f31f93e71dd7e16
test slug based list view
zbyte64/django-dockitcms
dockitcms/tests/listpoint.py
dockitcms/tests/listpoint.py
from dockitcms.viewpoints.listpoint import ListViewPoint import dockit class SampleDocument(dockit.Document): title = dockit.CharField() slug = dockit.SlugField() body = dockit.TextField() SampleDocument.objects.enable_index("equals", "slug", {'field':'slug'}) class MockedListViewPoint(ListViewPoint): ...
from dockitcms.viewpoints.listpoint import ListViewPoint import dockit class SampleDocument(dockit.Document): title = dockit.CharField() slug = dockit.SlugField() body = dockit.TextField() class MockedListViewPoint(ListViewPoint): document = None def get_document(self): return self.d...
bsd-3-clause
Python
12778778152518d76d004b294b08ea085bc6d0ae
Use canonical smiles
OpenChemistry/mongochemserver
girder/molecules/server/openbabel.py
girder/molecules/server/openbabel.py
from openbabel import OBMol, OBConversion import pybel # gen3d should be true for 2D input formats such as inchi or smiles def convert_str(str_data, in_format, out_format, gen3d=False): obMol = OBMol() conv = OBConversion() conv.SetInFormat(in_format) conv.SetOutFormat(out_format) conv.ReadString(...
from openbabel import OBMol, OBConversion import pybel # gen3d should be true for 2D input formats such as inchi or smiles def convert_str(str_data, in_format, out_format, gen3d=False): obMol = OBMol() conv = OBConversion() conv.SetInFormat(in_format) conv.SetOutFormat(out_format) conv.ReadString(...
bsd-3-clause
Python
49b3fe4e334e25c6afaa9ccace72f5c985e761cb
Modify to fit with PEP8 standard
pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control
wcontrol/src/models.py
wcontrol/src/models.py
from app import db from flask_login import UserMixin class User(UserMixin, db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) nickname = db.Column(db.String(64), index=True, unique=True) name = db.Column(db.String(64), index=True) email = db.Column(db.String(64), index...
from app import db from flask_login import UserMixin class User(UserMixin, db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) nickname = db.Column(db.String(64), index=True, unique=True) name = db.Column(db.String(64), index=True) email = db.Column(db.String(64), index=...
mit
Python
220a65007cefdbdca94beb7668983a512ae0c60e
add stat field and raw_stat field to Ticket
Go-In/go-coup,Go-In/go-coup,Go-In/go-coup,Go-In/go-coup,Go-In/go-coup
go-coup/storemanage/models/Ticket.py
go-coup/storemanage/models/Ticket.py
from django.db import models from django.contrib.auth.models import User from django.contrib.postgres.fields import JSONField from .Currency import Currency # Create your models here. class Ticket(models.Model): name = models.CharField(max_length=127) price = models.PositiveIntegerField() detail = models....
from django.db import models from django.contrib.auth.models import User from django.contrib.postgres.fields import JSONField from .Currency import Currency # Create your models here. class Ticket(models.Model): name = models.CharField(max_length=127) price = models.PositiveIntegerField() detail = models....
mit
Python
f989c8b97981e59e76a8cc6994bb4122a60ad42c
Add TODO
eentzel/myeventbot,eentzel/myeventbot,eentzel/myeventbot,eentzel/myeventbot,eentzel/myeventbot
google_api.py
google_api.py
import atom.url import gdata.service import gdata.alt.appengine import os from xml.sax.saxutils import escape GCAL_FEED = 'https://www.google.com/calendar/feeds/default/private/full' rsa_key = None # TODO: always use secure tokens, need a separate RSA key for dev, staging, prod debug = os.environ['SERVER_SOFTWARE'].s...
import atom.url import gdata.service import gdata.alt.appengine import os from xml.sax.saxutils import escape GCAL_FEED = 'https://www.google.com/calendar/feeds/default/private/full' rsa_key = None # TODO: always use secure tokens, need a separate RSA key for dev, staging, prod debug = os.environ['SERVER_SOFTWARE'].s...
mit
Python
0256a00baaeb765394d97a6d7cf974aa331df07c
Make readline optional.
lemon24/intercessor
intercessor/cli.py
intercessor/cli.py
import sys try: import readline except ImportError: readline = None from .driver import Driver class Completer(object): def __init__(self): self.words = [] def __call__(self, text, state): matches = [w for w in self.words if w.startswith(text)] try: rv = matche...
import sys import readline from .driver import Driver class Completer(object): def __init__(self): self.words = [] def __call__(self, text, state): matches = [w for w in self.words if w.startswith(text)] try: rv = matches[state] except IndexError: re...
bsd-3-clause
Python
b54a6353a746d54869a7cadca1bdcfb1e1cd3d51
Add some extra fields to movie model
simon-andrews/movieman2,simon-andrews/movieman2
moviemanager/models.py
moviemanager/models.py
from django.contrib.auth.models import User from django.db import models class Movie(models.Model): tmdb_id = models.IntegerField() score = models.IntegerField() submitter = models.ForeignKey(User)
from django.db import models class Movie(models.Model): tmdb_id = models.IntegerField()
mit
Python
6fae32c47411e3846e3dacbe440885d68d8a536d
Remove extraneous super call
richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation
groundstation/objects/root_object.py
groundstation/objects/root_object.py
import root_object_pb2 class RootObject(object): data_members = ["id", "channel", "protocol"] def __init__(self, id, channel, protocol): self.id = id self.channel = channel self.protocol = protocol @staticmethod def from_object(obj): """Convert an object straight from G...
import root_object_pb2 class RootObject(object): data_members = ["id", "channel", "protocol"] def __init__(self, id, channel, protocol): super(RootObject, self).__init__() self.id = id self.channel = channel self.protocol = protocol @staticmethod def from_object(obj): ...
mit
Python
0d95f32490f8485a40a8a1ef108b98759f60470b
Update original newsindex view context instead of creating a new context
takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews
wagtailnews/views/frontend.py
wagtailnews/views/frontend.py
from __future__ import absolute_import, unicode_literals from django.shortcuts import get_object_or_404, redirect, render from django.utils import timezone from django.utils.six.moves.urllib.parse import urlparse from ..conf import paginate def _newsitem_list(request, newsindex, newsitem_list, extra_context): p...
from __future__ import absolute_import, unicode_literals from django.shortcuts import get_object_or_404, redirect, render from django.utils import timezone from django.utils.six.moves.urllib.parse import urlparse from ..conf import paginate def _newsitem_list(request, newsindex, newsitem_list, extra_context): p...
bsd-2-clause
Python
1b184ab7f208853930b92eab4cfc21f62272ea99
Allow folding, but reset at every update
tomv564/LSP
plugin/core/panels.py
plugin/core/panels.py
import sublime import sublime_plugin try: from typing import Optional assert Optional except ImportError: pass OUTPUT_PANEL_SETTINGS = { "auto_indent": False, "draw_indent_guides": False, "draw_white_space": "None", "gutter": True, 'is_widget': True, "line_numbers": False, "ma...
import sublime import sublime_plugin try: from typing import Optional assert Optional except ImportError: pass OUTPUT_PANEL_SETTINGS = { "auto_indent": False, "draw_indent_guides": False, "draw_white_space": "None", "gutter": False, 'is_widget': True, "line_numbers": False, "m...
mit
Python
9b20ec9458a9f4c1583d046a77f08a4ac573b1e6
add test for no picture
ivancrneto/django-magic-album
magicalbum/tests.py
magicalbum/tests.py
""" Module for Magic Album tests """ from django.test import TestCase from django.core.urlresolvers import reverse as r from magicalbum.models import Album import json class TestAlbumView(TestCase): """ Class for testing Magic Album view """ def test_status_code(self): """ Response status code for a...
""" Module for Magic Album tests """ from django.test import TestCase from django.core.urlresolvers import reverse as r from magicalbum.models import Album import json class TestAlbumView(TestCase): """ Class for testing Magic Album view """ def test_status_code(self): """ Response status code for a...
mit
Python
fc02df9a7e159e578764607bec6aa6d5206689df
Add priority to project, experience repr
sean-dooher/website,sean-dooher/website,sean-dooher/website
mainpages/models.py
mainpages/models.py
from django.db import models # Create your models here. class Project(models.Model): SCHOOL="s" PERSONAL="p" WORK="w" CATEGORY_CHOICES = ((PERSONAL, "Personal"), (SCHOOL, "School"), (WORK, "Work")) title = models.CharField(max_length=50) date = models.DateField() category = models.CharField(max_length=1, choice...
from django.db import models # Create your models here. class Project(models.Model): SCHOOL="s" PERSONAL="p" WORK="w" CATEGORY_CHOICES = ((PERSONAL, "Personal"), (SCHOOL, "School"), (WORK, "Work")) title = models.CharField(max_length=50) date = models.DateField() category = models.CharField(max_length=1, choice...
mit
Python
c2b9c6d39f8ffc9fa699039ba73da1122d7295b8
Clean up
nansencenter/DAPPER,nansencenter/DAPPER
docs/bib/rename_citations.py
docs/bib/rename_citations.py
#!/usr/bin/env python """ DAPPER for (e.g.) `bib.Boc11` and change it to `bib.bocquet2011ensemble`. """ import os from dapper.dpr_config import rc from patlib.std import rewrite, sub_run renaming = dict( Boc14 = "bocquet2014iterative", And10 = "anderson2010non", Liu01 = "liu2001theoretical", Raa1...
#!/usr/bin/env python """ DAPPER for (e.g.) `bib.Boc11` and change it to `bib.bocquet2011ensemble`. """ from pathlib import Path from textwrap import dedent import os from dapper.dpr_config import rc from patlib.std import rewrite, sub_run renaming = dict( Boc14 = "bocquet2014iterative", And10 = "anderson...
mit
Python
43b077050cd0e914fbe7398f9077e787c496afe4
Add support for django 1.8 by using test runner
sternb0t/django-pandas,perpetua1/django-pandas,arcticshores/django-pandas,chrisdev/django-pandas
runtests.py
runtests.py
#!/usr/bin/env python import os import sys import django from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'django.contrib.contenttypes', 'django_pandas', 'django_pandas.tests', ), DATABASES={ ...
#!/usr/bin/env python import os import sys import django from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'django.contrib.contenttypes', 'django_pandas', 'django_pandas.tests', ), DATABASES={ ...
bsd-3-clause
Python
1af1d3bef44656c44bad1a281a0cda4b949ed701
Update committee document view to work with statement slug
twhyte/openparliament,twhyte/openparliament,rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,litui/openparliament,litui/openparliament,twhyte/openparliament,litui/openparliament
parliament/committees/views.py
parliament/committees/views.py
from django.http import HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404, render from django.template import loader, RequestContext from parliament.committees.models import Committee, CommitteeMeeting from parliament.core.models import Session from parliament.hansards.views im...
from django.http import HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404, render from django.template import loader, RequestContext from parliament.committees.models import Committee, CommitteeMeeting from parliament.core.models import Session from parliament.hansards.views im...
agpl-3.0
Python
1807db7a0a0963119993fb7e8969e123d3f6e5b7
Remove support for unsupported Django versions in runtests.py.
eugena/django-localeurl
runtests.py
runtests.py
#!/usr/bin/env python from os.path import dirname, abspath import sys import django from django.conf import settings if not settings.configured: settings.configure( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitemap test ...
#!/usr/bin/env python from os.path import dirname, abspath import sys import django from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'localeurl', 'localeurl.tests', 'django.contrib.sites', # for sitemap test ...
mit
Python
854d09a5224cb426800d56735d478c14ff8dd4ac
Fix tests to run with newer Django.
coleifer/micawber,coleifer/micawber
runtests.py
runtests.py
#!/usr/bin/env python import os import sys import unittest from micawber import tests def run_django_tests(): try: import django except ImportError: print('Skipping django tests') return else: print('Running django integration tests') providers = 'micawber.contrib.mcd...
#!/usr/bin/env python import os import sys import unittest from micawber import tests def run_django_tests(): try: import django except ImportError: print('Skipping django tests') return else: print('Running django integration tests') providers = 'micawber.contrib.mcd...
mit
Python
e3a5ad42739bff5fe39369813a0636f0d8f28519
Test GetIndexInParent
GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core
tests/registryd/test_root_accessible.py
tests/registryd/test_root_accessible.py
# Pytest will pick up this module automatically when running just "pytest". # # Each test_*() function gets passed test fixtures, which are defined # in conftest.py. So, a function "def test_foo(bar)" will get a bar() # fixture created for it. import pytest import dbus from utils import get_property, check_unknown_p...
# Pytest will pick up this module automatically when running just "pytest". # # Each test_*() function gets passed test fixtures, which are defined # in conftest.py. So, a function "def test_foo(bar)" will get a bar() # fixture created for it. import pytest import dbus from utils import get_property, check_unknown_p...
lgpl-2.1
Python
52df6cbe5c02d8a50a93cdc454a8fdfdf1706d55
Update runtests.py
MrMinimal64/timezonefinder,MrMinimal64/timezonefinder
runtests.py
runtests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import pytest def main(): sys.path.insert(0, "test") return pytest.main() if __name__ == "__main__": sys.exit(main())
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import sys import pytest def main(): sys.path.insert(0, "test") return pytest.main() if __name__ == "__main__": sys.exit(main())
mit
Python
b4a1ddf5eb5b7c2c303259affff8ec63bae2753a
Fix tests.
onrik/django-webshell,onrik/django-webshell,onrik/django-webshell
runtests.py
runtests.py
#!/usr/bin/env python import sys import django from django.conf import settings from django.test.utils import get_runner if not settings.configured: settings.configure( DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', ...
#!/usr/bin/env python import sys import django from django.conf import settings from django.test.utils import get_runner if not settings.configured: settings.configure( DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', ...
mit
Python
1c973914d386f48d39ddc443d60a86c9fa4b4169
Add address-finder settings to example.local settings
ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend
cla_frontend/settings/.example.local.py
cla_frontend/settings/.example.local.py
from .base import * DEV_APPS = ( # 'django_extensions', # 'debug_toolbar', 'django_pdb', ) INSTALLED_APPS += DEV_APPS CSP_DEFAULT_SRC = list(CSP_DEFAULT_SRC) + ['localhost:8005'] LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { ...
from .base import * DEV_APPS = ( # 'django_extensions', # 'debug_toolbar', 'django_pdb', ) INSTALLED_APPS += DEV_APPS CSP_DEFAULT_SRC = list(CSP_DEFAULT_SRC) + ['localhost:8005'] LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { ...
mit
Python
894086bda2545fc7d094def6f925b96905920992
Fix catch socket timeout and error exceptions
jiumx60rus/isso,janusnic/isso,WQuanfeng/isso,mathstuf/isso,janusnic/isso,Mushiyo/isso,posativ/isso,xuhdev/isso,jelmer/isso,princesuke/isso,mathstuf/isso,princesuke/isso,WQuanfeng/isso,jelmer/isso,jelmer/isso,xuhdev/isso,posativ/isso,Mushiyo/isso,jelmer/isso,xuhdev/isso,princesuke/isso,posativ/isso,jiumx60rus/isso,maths...
isso/utils/http.py
isso/utils/http.py
# -*- encoding: utf-8 -*- import socket try: import httplib except ImportError: import http.client as httplib from isso.wsgi import urlsplit class curl(object): """Easy to use wrapper around :module:`httplib`. Use as context-manager so we can close the response properly. .. code-block:: pytho...
# -*- encoding: utf-8 -*- import socket try: import httplib except ImportError: import http.client as httplib from isso.wsgi import urlsplit class curl(object): """Easy to use wrapper around :module:`httplib`. Use as context-manager so we can close the response properly. .. code-block:: pytho...
mit
Python
c1a9570bbab4bb8a7713ec972f648ecb4f1fcc24
Switch to Mandrill
kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz
uchicagohvz/production_settings.py
uchicagohvz/production_settings.py
from local_settings import * DEBUG = False ALLOWED_HOSTS = ['uchicagohvz.org', 'www.uchicagohvz.org'] ADMINS = ( ('Administrator', 'admin@uchicagohvz.org'), ) SERVER_EMAIL = 'noreply@uchicagohvz.org' # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'pos...
from local_settings import * DEBUG = False ALLOWED_HOSTS = ['uchicagohvz.org', 'www.uchicagohvz.org'] ADMINS = ( ('Administrator', 'admin@uchicagohvz.org'), ) SERVER_EMAIL = 'noreply@uchicagohvz.org' # Database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'pos...
mit
Python
0304098ff4c38af34ac999be2be626e84a2e8ef6
Remove mail_admins logging handler during tests (thanks @hodgestar)
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
go/testsettings.py
go/testsettings.py
import os from settings import * SECRET_KEY = "test_secret" # This needs to point at the test riak buckets. VUMI_API_CONFIG['riak_manager'] = {'bucket_prefix': 'test.'} VUMI_API_CONFIG['redis_manager'] = { 'key_prefix': 'test', 'FAKE_REDIS': 'sure', } # Setup test database VUMIGO_TEST_DB = os.environ.get('V...
import os from settings import * SECRET_KEY = "test_secret" # This needs to point at the test riak buckets. VUMI_API_CONFIG['riak_manager'] = {'bucket_prefix': 'test.'} VUMI_API_CONFIG['redis_manager'] = { 'key_prefix': 'test', 'FAKE_REDIS': 'sure', } # Setup test database VUMIGO_TEST_DB = os.environ.get('V...
bsd-3-clause
Python
8904d0dc0314d2deb166fd1de3e81f27b5e2201f
Add custom widget for test label and status
martinsmid/pytest-ui
putr.py
putr.py
#!/usr/bin/env python # encoding: utf-8 import urwid import logging import unittest from StringIO import StringIO def get_tests(suite): test_list = {} for item in suite: if isinstance(item, unittest.suite.TestSuite): test_list.update(get_tests(item)) else: test_list[ite...
#!/usr/bin/env python # encoding: utf-8 import urwid import logging import unittest from StringIO import StringIO def get_tests(suite): test_list = {} for item in suite: if isinstance(item, unittest.suite.TestSuite): test_list.update(get_tests(item)) else: test_list[ite...
mit
Python
67eab77c217761d7eb79465e142cc0287048bafc
Fix admin
justathoughtor2/psu-hn-laundry,justathoughtor2/psu-hn-laundry,justathoughtor2/psu-hn-laundry
laundry/status/models.py
laundry/status/models.py
from django.db import models class Query(models.Model): query_text = models.CharField(max_length=200) def __unicode__(self): return u'%s' % (self.query_text) class Response(models.Model): query = models.ForeignKey(Query) response_type = models.CharField(max_length=200) in_use = models.Bool...
from django.db import models class Query(models.Model): query_text = models.CharField(max_length=200) def __unicode__(self): return u'%s' % (self.query_text) class Response(models.Model): query = models.ForeignKey(Query) response_value = models.BooleanField(default=False) def __unicode__(s...
agpl-3.0
Python
d4545951ccac1563bc52a41118f8b8131c9f81b1
Change price for website_sale_add_to_cart
it-projects-llc/website-addons,it-projects-llc/website-addons,it-projects-llc/website-addons
website_sale_add_to_cart/__openerp__.py
website_sale_add_to_cart/__openerp__.py
# -*- coding: utf-8 -*- { 'name': 'Quick add items to shopping cart', 'version': '1.0.0', 'author': 'IT-Projects LLC, Ivan Yelizariev', 'license': 'GPL-3', 'category': 'eCommerce', 'website': 'https://twitter.com/yelizariev', 'price': 15.00, 'currency': 'EUR', 'depends': ['website_sa...
# -*- coding: utf-8 -*- { 'name': 'Quick add items to shopping cart', 'version': '1.0.0', 'author': 'IT-Projects LLC, Ivan Yelizariev', 'license': 'GPL-3', 'category': 'eCommerce', 'website': 'https://twitter.com/yelizariev', 'price': 9.00, 'currency': 'EUR', 'depends': ['website_sal...
mit
Python
c6511d28a27c262addf5226811f2184beb0ea477
call the method
alexandre/flask-rest-template
app/config/__init__.py
app/config/__init__.py
from . import development, testing, production def set_app_config_keys(app, settings): """Load all flask.Flask config vars. :app: a flask.Flask object :settings: a module with config vars :returns: None """ # create a unique dict with all config vars all_config_vars = dict( list(...
from . import development, testing, production def set_app_config_keys(app, settings): """Load all flask.Flask config vars. :app: a flask.Flask object :settings: a module with config vars :returns: None """ # create a unique dict with all config vars all_config_vars = dict( list(...
unlicense
Python
e06e448b54586949011d8730701b25cd2947951e
improve test coverage
benvanwerkhoven/kernel_tuner
test/strategies/test_strategies.py
test/strategies/test_strategies.py
from collections import OrderedDict import os import pytest import numpy as np import kernel_tuner from kernel_tuner.interface import strategy_map from kernel_tuner import util cache_filename = os.path.dirname(os.path.realpath(__file__)) + "/../test_cache_file.json" @pytest.fixture def vector_add(): kernel_stri...
from collections import OrderedDict import os import pytest import numpy as np import kernel_tuner from kernel_tuner.interface import strategy_map from kernel_tuner import util cache_filename = os.path.dirname(os.path.realpath(__file__)) + "/../test_cache_file.json" @pytest.fixture def vector_add(): kernel_stri...
apache-2.0
Python
b446befaa8f62f24c73bcad4ea9ee319ebed555a
resolve conflict
Alerion/shopping-helper,Alerion/shopping-helper,Alerion/shopping-helper,Alerion/shopping-helper
history/views.py
history/views.py
from django.contrib.auth.decorators import login_required from django.template.response import TemplateResponse from src.main.models import ShoppingList from src.main.models import Category from django.http import HttpResponse @login_required def index(request): dash = request.user.get_dashboard() sl = dash.sho...
from django.contrib.auth.decorators import login_required from django.template.response import TemplateResponse from src.main.models import ShoppingList from src.main.models import Category from django.http import HttpResponse @login_required def index(request): dash = request.user.get_dashboard() sl = dash.sho...
mit
Python
6913ef43184eda1166541b2c59e0a82c3981d643
Add test coverage for save pages (happy path)
znerol/spreadflow-pdf
spreadflow_pdf/test/test_savepdfpages.py
spreadflow_pdf/test/test_savepdfpages.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import copy import pdfrw from twisted.internet import defer from mock import Mock, patch, mock_open, call from testtools import ExpectedException, TestCase, run_test_with from testtools.twistedsupport impor...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import copy from twisted.internet import defer from mock import Mock from testtools import ExpectedException, TestCase, run_test_with from testtools.twistedsupport import AsynchronousDeferredRunTest from s...
mit
Python
fe41e69e92361bb775b05d3177b5d2ced7dc56fc
Revert to scipy fsolve vs root, don't want dependency on SciPy 0.11 quite yet
wrobstory/climatic
climatic/weibull_est.py
climatic/weibull_est.py
# -*- coding: utf-8 -*- ''' Weibull Estimators ------- A small library of tools for fitting weibull pdfs to data ''' from __future__ import division import scipy.stats as spystats import scipy.optimize as spyopt from scipy.special import gamma import numpy as np #Least Squares def least_sq(data,x): '''Least sq...
# -*- coding: utf-8 -*- ''' Weibull Estimators ------- A small library of tools for fitting weibull pdfs to data ''' from __future__ import division import scipy.stats as spystats import scipy.optimize as spyopt from scipy.special import gamma import numpy as np #Least Squares def least_sq(data,x): '''Least sq...
mit
Python
52bd8d437cc08b1f0fe78e67a740b293e2700272
fix vm form
tjcsl/director,tjcsl/director,tjcsl/director,tjcsl/director
web3/apps/vms/forms.py
web3/apps/vms/forms.py
import uuid from django import forms from django.conf import settings from django.utils.text import slugify from ..users.models import User from ..sites.models import Site from .models import VirtualMachine from .helpers import call_api class VirtualMachineForm(forms.ModelForm): name = forms.CharField(max_lengt...
import uuid from django import forms from django.conf import settings from django.utils.text import slugify from ..users.models import User from ..sites.models import Site from .models import VirtualMachine from .helpers import call_api class VirtualMachineForm(forms.ModelForm): name = forms.CharField(max_lengt...
mit
Python
64b86c31783c8d2aa6729b5e7518cbfaa02c67e1
change integerfield to charfield
holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung
src/reservierung/models.py
src/reservierung/models.py
from django.db import models # Zugriff auf die Benutzer from django.contrib.auth.models import User from django.utils import timezone from django.conf import settings from django.urls import reverse import datetime # Create your models here. class Raum(models.Model): name = models.CharField(max_length=255) n...
from django.db import models # Zugriff auf die Benutzer from django.contrib.auth.models import User from django.utils import timezone from django.conf import settings from django.urls import reverse import datetime # Create your models here. class Raum(models.Model): name = models.CharField(max_length=255) n...
mit
Python
d164b47bce25e60761206c8228803075122fd13e
Document version.version
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
hoomd/version.py
hoomd/version.py
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """Version and build information. Attributes: compile_date (str): The date this build was compiled. compile_flags (str): Human readable summary of comp...
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """Version and build information. Attributes: compile_date (str): The date this build was compiled. compile_flags (str): Human readable summary of comp...
bsd-3-clause
Python
41b9935c93635bcc97f0760b47a65df434efdb51
Fix case when we actually want reCAPTCHA
jaredjennings/snowy,nekohayo/snowy,GNOME/snowy,NoUsername/PrivateNotesExperimental,sandyarmstrong/snowy,widox/snowy,NoUsername/PrivateNotesExperimental,leonhandreke/snowy,widox/snowy,syskill/snowy,leonhandreke/snowy,GNOME/snowy,sandyarmstrong/snowy,jaredjennings/snowy,jaredjennings/snowy,syskill/snowy,jaredjennings/sno...
users/forms.py
users/forms.py
# # Copyright (c) 2009 Brad Taylor <brad@getcoded.net> # # 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 <brad@getcoded.net> # # 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...
agpl-3.0
Python
0ad8b84fb7f0885a5f12ce8d4d8896476d69de67
Swap post kwarg
Naught0/qtbot
cogs/dalle.py
cogs/dalle.py
import base64 import io import aiohttp import discord from discord.ext import commands from utils import custom_context from time import time from urllib.parse import urlencode class Dalle(commands.Cog): @commands.command(aliases=["ai"]) async def dalle(self, ctx: custom_context.CustomContext, *, prompt: str)...
import base64 import io import aiohttp import discord from discord.ext import commands from utils import custom_context from time import time from urllib.parse import urlencode class Dalle(commands.Cog): @commands.command(aliases=["ai"]) async def dalle(self, ctx: custom_context.CustomContext, *, prompt: str)...
mit
Python
de82adcb5de0861d30bca427be02a7f4b0186c3f
Make a cosmetic adjustment
learning-on-chip/google-cluster-prediction
prediction/teacher.py
prediction/teacher.py
import numpy as np import tensorflow as tf class Teacher: def __init__(self, model, config): self.future_length = config.future_length with tf.variable_scope('training_loss'): self.training_loss = tf.reduce_mean( tf.squared_difference(model.y, model.y_hat)) grad...
import numpy as np import tensorflow as tf class Teacher: def __init__(self, model, config): self.future_length = config.future_length with tf.variable_scope('training_loss'): self.training_loss = tf.reduce_mean( tf.squared_difference(model.y, model.y_hat)) grad...
mit
Python
781a0251d3324e5e9f76ecab22f9d607380c9e5a
delete errors after 10 seconds
PrestigeDox/Watashi-SelfBot
cogs/error.py
cogs/error.py
import discord from discord.ext import commands class ErrorFormatter: def __init__(self, bot): self.bot = bot @commands.command(name='error', hidden=True) async def error_formatter(self, ctx, *, err: str): """ Send a nice embed error with a message Usage: class Foo: ...
import discord from discord.ext import commands class ErrorFormatter: def __init__(self, bot): self.bot = bot @commands.command(name='error', hidden=True) async def error_formatter(self, ctx, *, err: str): """ Send a nice embed error with a message Usage: class Foo: ...
mit
Python
0eb20c8025a838d93a5854442640550d5bf05b0b
Add android and ios client IDs
elbernante/conference-central,elbernante/conference-central,elbernante/conference-central
settings.py
settings.py
#!/usr/bin/env python """settings.py Udacity conference server-side Python App Engine app user settings $Id$ created/forked from conference.py by wesc on 2014 may 24 """ # Replace the following lines with client IDs obtained from the APIs # Console or Cloud Console. WEB_CLIENT_ID = '757224007118-0lblpo8abqeantp8m...
#!/usr/bin/env python """settings.py Udacity conference server-side Python App Engine app user settings $Id$ created/forked from conference.py by wesc on 2014 may 24 """ # Replace the following lines with client IDs obtained from the APIs # Console or Cloud Console. WEB_CLIENT_ID = '757224007118-0lblpo8abqeantp8m...
apache-2.0
Python
c7e6daad331cae20e52caaa9075784b87804023b
Allow for more complex object hiearchy in debug.get_check
jshum/dd-agent,jshum/dd-agent,jshum/dd-agent,jshum/dd-agent,jshum/dd-agent
utils/debug.py
utils/debug.py
# stdlib import inspect import os from pprint import pprint import sys # datadog from config import get_checksd_path, get_confd_path from util import get_os def run_check(name, path=None): """ Test custom checks on Windows. """ # Read the config file confd_path = path or os.path.join(get_confd_p...
# stdlib import inspect import os from pprint import pprint import sys # datadog from config import get_checksd_path, get_confd_path from util import get_os def run_check(name, path=None): """ Test custom checks on Windows. """ # Read the config file confd_path = path or os.path.join(get_confd_p...
bsd-3-clause
Python
259470cb1c90167713b9fd25d8e1180cbd5de2f6
Remove SED_REGEX from utils/parse.py
svkampen/James
utils/parse.py
utils/parse.py
""" IRC Parser - parse.py """ import inspect import traceback import re import codecs import subprocess import sys def parse(msg): """ Parse an IRC protocol message """ if msg.startswith("PING"): info = {"method": "PING", "arg": msg.split()[-1]} else: splitmsg = msg.split(" ", 2) i...
""" IRC Parser - parse.py """ import inspect import traceback import re import codecs import subprocess import sys #SED_REGEX = re.compile(r"^(?:(\S+)[:,]\s)?(?:(.+?)/)?s/(.+?)/([^/]*)/?([gixs]{0,4})?(?: (.*))?") SED_REGEX = re.compile(r"^(?:(\S+)[:,]\s)?(?:s|(.+?)/s)/((?:\\/|[^/])+)\/((?:\\/|[^/])*?)/([gixs]{0,4})?"...
mit
Python
50509932c67494497f71b36a059ddc49bafab291
use localsettings as well as settings
istresearch/json-transporter
settings.py
settings.py
JSON_SETTINGS = { } ES_SETTINGS = { 'host': 'localhost:9200', 'ssl': 'false' } S3_SETTINGS = { 'access_key': 'use_localsettings', 'secret_key': 'use_localsettings' } MONGO_SETTINGS = { } HBASE_SETTINGS = { } KAFKA_SETTINGS = { 'host': 'localhost:9092', 'prefix': 'dingo' } # Local Overrides # ~~~~~~~~...
JSON_SETTINGS = { } ES_SETTINGS ={ } S3_SETTINGS = { } MONGO_SETTINGS = { } HBASE_SETTINGS = { } KAFKA_SETTINGS = { }
mit
Python
70bc8f0d9cbf66776a75552ae007629976c406de
add test
MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI,MaxMorgenstern/EmeraldAI
testing/arduino/omniwheel3_port.py
testing/arduino/omniwheel3_port.py
#!/usr/bin/python # -*- coding: utf-8 -*- import math wheel1 = 150 wheel2 = 270 wheel3 = 30 def GetSpeed(wheel, angle): return -round(math.cos(math.radians(wheel - angle)), 4) def Map(speed): return int(round(speed * 255)) a = 0 print GetSpeed(wheel1, a), Map(GetSpeed(wheel1, a)) print GetSpeed(wheel2, a)...
#!/usr/bin/python # -*- coding: utf-8 -*- import math wheel1 = 150 wheel2 = 270 wheel3 = 30 def GetSpeed(wheel, angle): return -round(math.cos(math.radians(wheel - angle)), 4) def Map(speed): return int(round(speed * 255)) a = 0 print GetSpeed(wheel1, a), Map(GetSpeed(wheel1, a)) print GetSpeed(wheel2, a)...
apache-2.0
Python
0b56e5d8b1da9c5b76a39cead7f4642384750c0a
Remove the unnecessary and never-used basic auth hack.
ReachingOut/unisubs,ofer43211/unisubs,ReachingOut/unisubs,ujdhesa/unisubs,eloquence/unisubs,pculture/unisubs,ujdhesa/unisubs,wevoice/wesub,ReachingOut/unisubs,wevoice/wesub,pculture/unisubs,eloquence/unisubs,norayr/unisubs,norayr/unisubs,eloquence/unisubs,pculture/unisubs,wevoice/wesub,ReachingOut/unisubs,pculture/unis...
utils/http.py
utils/http.py
# Universal Subtitles, universalsubtitles.org # # Copyright (C) 2012 Participatory Culture Foundation # # 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, ...
# Universal Subtitles, universalsubtitles.org # # Copyright (C) 2012 Participatory Culture Foundation # # 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, ...
agpl-3.0
Python
37ef368bfd5d135232920aee1537e15a582ba751
Update once.py
Nik0l/UTemPro,Nik0l/UTemPro
utils/once.py
utils/once.py
""" The once module provides caching of function results across program executions for crash-and-rerun programming. It implements Greg Little's once() from the TurKit UIST 2010 paper: on first execution, function are called and results are written in order into a database. On subsequent executions, calls to once check...
mit
Python
f0b3cb1d7a37ac511007e324bcabf5b684111a4c
add a more generic utils function for building atom results
cwisecarver/osf.io,mluke93/osf.io,asanfilippo7/osf.io,GageGaskins/osf.io,aaxelb/osf.io,caseyrollins/osf.io,jeffreyliu3230/osf.io,jnayak1/osf.io,reinaH/osf.io,chennan47/osf.io,felliott/osf.io,chrisseto/osf.io,cslzchen/osf.io,chrisseto/osf.io,RomanZWang/osf.io,asanfilippo7/osf.io,kushG/osf.io,sloria/osf.io,chennan47/osf....
website/search/util.py
website/search/util.py
from werkzeug.contrib.atom import AtomFeed def build_query(q='*', start=0, size=10, sort=None): query = { 'query': build_query_string(q), 'from': start, 'size': size, } if sort: query['sort'] = [ { sort: 'desc' } ] retur...
from werkzeug.contrib.atom import AtomFeed def build_query(q='*', start=0, size=10, sort=None): query = { 'query': build_query_string(q), 'from': start, 'size': size, } if sort: query['sort'] = [ { sort: 'desc' } ] retur...
apache-2.0
Python
ae76e28e159a1af7395c0821a3e49a75620d55cb
fix asteval version check
breznak/nupic,breznak/nupic,breznak/nupic
tests/external/py2/asteval_test.py
tests/external/py2/asteval_test.py
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
Python
cb055a207c5aa40d1fed6dce542752a77e2b234f
allow again fairlogin as ID provider
vjFaLk/frappe,vjFaLk/frappe,vjFaLk/frappe,vjFaLk/frappe
frappe/integrations/oauth2_logins.py
frappe/integrations/oauth2_logins.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token import json @frappe.whitelist(allow_guest=True) def login_via_google(...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token import json @frappe.whitelist(allow_guest=True) def login_via_google(...
mit
Python
0f7c9cefef7b403c31731034ca08fa4324b02481
Bump version to 1.0.1-machtfit-37
machtfit/django-oscar,machtfit/django-oscar,machtfit/django-oscar
src/oscar/__init__.py
src/oscar/__init__.py
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 37) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 36) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
bsd-3-clause
Python
8916f5652e62faa727486b1c6b52893ae4531537
Bump version to 1.0.1-machtfit-27
machtfit/django-oscar,machtfit/django-oscar,machtfit/django-oscar
src/oscar/__init__.py
src/oscar/__init__.py
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 27) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
import os # Use 'dev', 'beta', or 'final' as the 4th element to indicate release type. VERSION = (1, 0, 1, 'machtfit', 26) def get_short_version(): return '%s.%s' % (VERSION[0], VERSION[1]) def get_version(): return '{}.{}.{}-{}-{}'.format(*VERSION) # Cheeky setting that allows each template to be acces...
bsd-3-clause
Python
8055307d53933ed527716cc9e8c2734fc236b200
Test to show pollution of the auth_user_model()
Fantomas42/django-blog-zinnia,1844144/django-blog-zinnia,marctc/django-blog-zinnia,Maplecroft/django-blog-zinnia,petecummings/django-blog-zinnia,dapeng0802/django-blog-zinnia,bywbilly/django-blog-zinnia,1844144/django-blog-zinnia,ZuluPro/django-blog-zinnia,dapeng0802/django-blog-zinnia,ghachey/django-blog-zinnia,ghache...
zinnia/tests/author.py
zinnia/tests/author.py
"""Test cases for Zinnia's Author""" from django.test import TestCase from django.contrib.sites.models import Site from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth import get_user_model from zinnia.models.entry import Entry from zinnia.models.author import Author from zinnia.manage...
"""Test cases for Zinnia's Author""" from django.test import TestCase from django.contrib.sites.models import Site from django.contrib.auth.tests.utils import skipIfCustomUser from zinnia.models.entry import Entry from zinnia.models.author import Author from zinnia.managers import PUBLISHED @skipIfCustomUser class ...
bsd-3-clause
Python
d801cb01773a456639c801c7b789b3dd9f63e261
Add to display parse error message.
shoma/python.tools
jsonpp-server.py
jsonpp-server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import cgi import json from BaseHTTPServer import BaseHTTPRequestHandler class RequestHandler(BaseHTTPRequestHandler): template = u""" <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8" /></head><body> <form method="POST" action="/"> <div><te...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import cgi import json from BaseHTTPServer import BaseHTTPRequestHandler class RequestHandler(BaseHTTPRequestHandler): template = u""" <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8" /></head><body> <form method="POST" action="/"> <div><te...
mit
Python
0356ee5ff8b5ca2fdec77f2530282bffc1dfd16d
Convert linear to CGPM.
probcomp/cgpm,probcomp/cgpm
src/uncorrelated/linear.py
src/uncorrelated/linear.py
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
apache-2.0
Python
5dc69c3e88ab4df897c9a1d632a47de42e5bc9c0
Enable Cross Origin Resource Sharing
machariamarigi/shopping_list_api
app.py
app.py
"""Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from flask_cors import CORS from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api",...
"""Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for...
mit
Python
c90464be60c35b15c823b763a403829cf47366dc
Fix error when VERBOSE isn't set
zapier/sentinel-graylog
app.py
app.py
import logging import os import sys import time import graypy from redis.client import StrictRedis GRAYLOG_ADDRESS = os.environ.get('GRAYLOG_ADDRESS') SENTINEL_ADDRESS = os.environ.get('SENTINEL_ADDRESS') SENTINEL_PORT = os.environ.get('SENTINEL_PORT') VERBOSE = '-v' in sys.argv or os.environ.get('VERBOSE', '').lowe...
import logging import os import sys import time import graypy from redis.client import StrictRedis GRAYLOG_ADDRESS = os.environ.get('GRAYLOG_ADDRESS') SENTINEL_ADDRESS = os.environ.get('SENTINEL_ADDRESS') SENTINEL_PORT = os.environ.get('SENTINEL_PORT') VERBOSE = '-v' in sys.argv or os.environ.get('VERBOSE').lower() ...
mit
Python
e6b4e48559d7f28e3345d47490b7bbe88885f48b
Update thread2_add_thread.py
wangwei7175878/tutorials
threadingTUT/thread2_add_thread.py
threadingTUT/thread2_add_thread.py
# View more python learning tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial import threading #def main(): # print(threading.active_count()) # print(threading.enumerate()) # s...
import threading #def main(): # print(threading.active_count()) # print(threading.enumerate()) # see the thread list # print(threading.current_thread()) def thread_job(): print('This is a thread of %s' % threading.current_thread()) def main(): thread = threading.Thread(target=thread_job,) thread...
mit
Python
8d5802e5f6661f610373ab2e83851aef41d8fc92
change downloaded media mtime and atime to created_time
orkaa/instagram-scraper,rarcega/instagram-scraper
app.py
app.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Usage: python app.py <username> """ import concurrent.futures import json import os import requests import sys from tqdm import tqdm def crawl(username, items=[], max_id=None): """Walks through the user's media""" url = 'http://instagram.com/' + u...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Usage: python app.py <username> """ import concurrent.futures import json import os import requests import sys from tqdm import tqdm def crawl(username, items=[], max_id=None): """Walks through the user's media""" url = 'http://instagram.com/' + u...
unlicense
Python
f7f29a637c1c81adfb51e601211c8dd262aa1d3b
update app
ojengwa/gfe
app.py
app.py
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy import rq_dashboard from utils import add_basic_auth app = Flask(__name__) app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig')) db = SQLAlchemy(app) if not app.config.get('TESTING'): add_basic_auth(rq_dashboard....
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy import rq_dashboard from utils import add_basic_auth app = Flask(__name__) db = SQLAlchemy(app) app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig')) if not app.config.get('TESTING'): add_basic_auth(rq_dashboard....
mit
Python
6f5ebd78694ce3b11ed15f6dd58b7bf7cc38e780
Return No Content in flask when getting new repo_path
kdheepak89/c3.py,kdheepak89/c3.py
app.py
app.py
from flask import Flask from flask import render_template from flask import render_template_string from flask import request app = Flask(__name__) app.config['DEBUG'] = True repo_path = '.' app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) def my_form_post(): global repo_path if request.method ...
from flask import Flask from flask import render_template from flask import render_template_string from flask import request app = Flask(__name__) app.config['DEBUG'] = True repo_path = '.' app = Flask(__name__) @app.route('/', methods=['POST', 'GET']) def my_form_post(): global repo_path if request.method ...
bsd-3-clause
Python
7fddc0771e2d57a9aaf5881b58be2091cfcffa5c
simplify route
tforrest/twilio-plays-roomba-flask
app.py
app.py
from flask import Flask, jsonify, request from dotenv import load_dotenv, find_dotenv from twilio import twiml from Queue import Queue from threading import Thread from time import sleep load_dotenv(find_dotenv()) directions = ['forward', 'backward'] task_q = Queue() def send_rasp(task_q): while True: sleep(2)...
from flask import Flask, jsonify, request from dotenv import load_dotenv, find_dotenv from twilio import twiml from Queue import Queue from threading import Thread from time import sleep load_dotenv(find_dotenv()) directions = ['forward', 'backward'] task_q = Queue() def send_rasp(task_q): while True: sleep(2)...
mit
Python
7496622796b5a669c1ab5e883cdab2f318619c10
Fix mime type detection in local server
PostDispatchInteractive/app-template,wbez/app-template,wbez/app-template,robojukie/app-template,wbez/budget-tracker,cerealcommas/app-template,chagan/there-goes-the-neighborhood,nprapps/books14,TylerFisher/hearsay,eads/app-template,chagan/there-goes-the-neighborhood,PostDispatchInteractive/app-template,nprapps/app-templ...
app.py
app.py
#!/usr/bin/env python import csv from mimetypes import guess_type import envoy from flask import Flask, render_template import app_config from render_utils import make_context app = Flask(app_config.PROJECT_NAME) # Example application views @app.route('/') @app.route('/simple.html') def simple(): """ Exam...
#!/usr/bin/env python import csv from mimetypes import guess_type import envoy from flask import Flask, render_template import app_config from render_utils import make_context app = Flask(app_config.PROJECT_NAME) # Example application views @app.route('/') @app.route('/simple.html') def simple(): """ Exam...
mit
Python
30979a64f433676a9f932d7600dad8464c2bb9e3
update app.py
ojengwa/gfe
app.py
app.py
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy import rq_dashboard from utils import add_basic_auth app = Flask(__name__) db = SQLAlchemy(app) app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig')) if not app.config.get('TESTING'): add_basic_auth(rq_dashboard....
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy import rq_dashboard from rq import Queue from rq.job import Job from worker import conn from utils import add_basic_auth app = Flask(__name__) db = SQLAlchemy(app) app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig'...
mit
Python
fcbf5d5483aba42632691cae308e5fba236e4a6e
Create app.py
rajeshrao04/news-api
app.py
app.py
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
apache-2.0
Python
e22772a0d05e96fae035b52fc4abc45551392c52
Tidy logic in contact form
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
dthm4kaiako/general/forms.py
dthm4kaiako/general/forms.py
"""Forms for general website pages.""" from django import forms from django.conf import settings from django.core.mail import send_mail, mail_managers from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from captcha.fields import ReCaptchaField MESSAGE_TEMPLATE = "{message}\n\n-----\nMes...
"""Forms for general website pages.""" from django import forms from django.conf import settings from django.core.mail import send_mail, mail_managers from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from captcha.fields import ReCaptchaField SUBJECT_TEMPLATE = "[dthm4kaiako] - {}" MES...
mit
Python
b618d03cfd85ea03de564bbcba92556083374db1
return OS when system info not supported
efiop/dvc,efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol
dvc/analytics/system_info.py
dvc/analytics/system_info.py
import platform import sys import distro def collect(): system = platform.system() if system == "Windows": version = sys.getwindowsversion() return { "os": "windows", "windows_version_build": version.build, "windows_version_major": version.major, ...
import platform import sys import distro def collect(): system = platform.system() if system == "Windows": version = sys.getwindowsversion() return { "os": "windows", "windows_version_build": version.build, "windows_version_major": version.major, ...
apache-2.0
Python
966603659eb79b20ae826a15d9cfc353b4093015
Update admin screen so we can add mapping info.
jacquesbeukes/easy-call,jacquesbeukes/easy-call,jacquesbeukes/easy-call
easyCall/apps/lists/admin.py
easyCall/apps/lists/admin.py
from django.contrib import admin from easyCall.apps.lists.models import ListType from easyCall.apps.lists.models import CallResult from easyCall.apps.lists.models import ExtraMapping from easyCall.apps.lists.models import NoteMapping from easyCall.apps.lists.models import CallMapping class ResultInline(admin.TabularI...
from django.contrib import admin from easyCall.apps.lists.models import ListType from easyCall.apps.lists.models import CallResult from easyCall.apps.lists.models import ExtraMapping class ResultInline(admin.TabularInline): model = CallResult extra = 1 can_delete = False class ExtraInline(admin.StackedI...
mit
Python
2adc021a520baa356c46ad1316893c1cd96f3147
Rework Lexer to use Token object
funkybob/knights-templater,funkybob/knights-templater
knights/lexer.py
knights/lexer.py
from enum import Enum import re TokenType = Enum('Token', 'load comment text var block',) tag_re = re.compile( '|'.join([ r'{\!\s*(?P<load>.+?)\s*\!}', r'{%\s*(?P<tag>.+?)\s*%}', r'{{\s*(?P<var>.+?)\s*}}', r'{#\s*(?P<comment>.+?)\s*#}' ]), re.DOTALL ) class Token: de...
from enum import Enum import re Token = Enum('Token', 'load comment text var block',) tag_re = re.compile( '|'.join([ r'{\!\s*(?P<load>.+?)\s*\!}', r'{%\s*(?P<tag>.+?)\s*%}', r'{{\s*(?P<var>.+?)\s*}}', r'{#\s*(?P<comment>.+?)\s*#}' ]), re.DOTALL ) def tokenise(template): ...
mit
Python