commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
b912c1a508640c7c351ed1d945bfeebdaa995332
djcelery/management/commands/celeryd.py
djcelery/management/commands/celeryd.py
""" Start the celery daemon from the Django management command. """ from __future__ import absolute_import, unicode_literals from celery.bin import worker from djcelery.app import app from djcelery.management.base import CeleryCommand worker = worker.worker(app=app) class Command(CeleryCommand): """Run the c...
""" Start the celery daemon from the Django management command. """ from __future__ import absolute_import, unicode_literals from celery.bin import worker from djcelery.app import app from djcelery.management.base import CeleryCommand worker = worker.worker(app=app) class Command(CeleryCommand): """Run the c...
Add requested call to check_args.
Add requested call to check_args.
Python
bsd-3-clause
Amanit/django-celery,digimarc/django-celery,iris-edu-int/django-celery,axiom-data-science/django-celery,celery/django-celery,CloudNcodeInc/django-celery,Amanit/django-celery,axiom-data-science/django-celery,georgewhewell/django-celery,CloudNcodeInc/django-celery,iris-edu-int/django-celery,digimarc/django-celery,celery/...
635a51c1ee8f5608de03351008f0d5aa9a116660
opps/images/templatetags/images_tags.py
opps/images/templatetags/images_tags.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import template from ..generate import image_url as url register = template.Library() @register.simple_tag def image_url(image_url, **kwargs): return url(image_url=image_url, **kwargs) @register.simple_tag def image_obj(image, **kwargs): new = {} ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import template from ..generate import image_url as url register = template.Library() @register.simple_tag def image_url(image_url, **kwargs): return url(image_url=image_url, **kwargs) @register.simple_tag def image_obj(image, **kwargs): new = {} ...
Fix has no attribute on templatetags image_obj
Fix has no attribute on templatetags image_obj
Python
mit
jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps
a1c4c7f8d07ba12494b55f988853d0804e657f9a
opps/images/templatetags/images_tags.py
opps/images/templatetags/images_tags.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import template from ..generate import image_url as url register = template.Library() @register.simple_tag def image_url(image_url, **kwargs): return url(image_url=image_url, **kwargs) @register.simple_tag def image_obj(image, **kwargs): new = {} ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import template from ..generate import image_url as url register = template.Library() @register.simple_tag def image_url(image_url, **kwargs): return url(image_url=image_url, **kwargs) @register.simple_tag def image_obj(image, **kwargs): new = {} ...
Add image crop on templatetags image_obj
Add image crop on templatetags image_obj
Python
mit
jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,opps/opps,williamroot/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps
dabb67601fd977b2f3e97a601a76ec8dd576fa77
drivnal/remote_snapshot.py
drivnal/remote_snapshot.py
from constants import * from core_snapshot import CoreSnapshot import logging logger = logging.getLogger(APP_NAME) class RemoteSnapshot(CoreSnapshot): def _get_path(self): dir_name = str(self.id) if self.state != COMPLETE: dir_name = '%s.%s' % (dir_name, self.state) return '%s@...
from constants import * from core_snapshot import CoreSnapshot import logging logger = logging.getLogger(APP_NAME) class RemoteSnapshot(CoreSnapshot): def _get_path(self): dir_name = str(self.id) if self.state != COMPLETE: dir_name = '%s.%s' % (dir_name, self.state) return '%s@...
Add get log path to remote snapshot
Add get log path to remote snapshot
Python
agpl-3.0
drivnal/drivnal,drivnal/drivnal,drivnal/drivnal
58e2059c37d7464e7ab7a1681ea8f465e9378940
ukpostcode/__init__.py
ukpostcode/__init__.py
# coding: utf-8 # Copyright 2013 Alan Justino da Silva, Oscar Vilaplana, et. al. # # 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 req...
# coding: utf-8 # Copyright 2013 Alan Justino da Silva, Oscar Vilaplana, et. al. # # 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 req...
Prepare to code the validator
Prepare to code the validator
Python
apache-2.0
alanjds/pyukpostcode
f0cb99f5e986c11164c98eeea38ce54e91748833
tests/grammar_unified_tests.py
tests/grammar_unified_tests.py
from unittest import TestCase from regparser.grammar.unified import * class GrammarCommonTests(TestCase): def test_depth1_p(self): text = '(c)(2)(ii)(A)(<E T="03">2</E>)' result = depth1_p.parseString(text) self.assertEqual('c', result.p1) self.assertEqual('2', result.p2) ...
# -*- coding: utf-8 -*- from unittest import TestCase from regparser.grammar.unified import * class GrammarCommonTests(TestCase): def test_depth1_p(self): text = '(c)(2)(ii)(A)(<E T="03">2</E>)' result = depth1_p.parseString(text) self.assertEqual('c', result.p1) self.assertEqual...
Add tests for marker_comment from ascott1/appendix-ref
Add tests for marker_comment from ascott1/appendix-ref Conflicts: tests/grammar_unified_tests.py
Python
cc0-1.0
tadhg-ohiggins/regulations-parser,eregs/regulations-parser,tadhg-ohiggins/regulations-parser,eregs/regulations-parser,cmc333333/regulations-parser,cmc333333/regulations-parser
4c95c238cd198779b7019a72b412ce20ddf865bd
alg_gcd.py
alg_gcd.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function def gcd(m, n): """Greatest Common Divisor (GCD) by Euclid's Algorithm. Time complexity: O(m%n). Space complexity: O(1). """ while n != 0: m, n = n, m % n return m def main():...
from __future__ import absolute_import from __future__ import division from __future__ import print_function def gcd_recur(m, n): """Greatest Common Divisor (GCD) by Euclid's Algorithm. Time complexity: O(m%n). Space complexity: O(m%n). """ if n == 0: return m return gcd_recur(n, m % ...
Complete gcd recur sol w/ time/space complexity
Complete gcd recur sol w/ time/space complexity
Python
bsd-2-clause
bowen0701/algorithms_data_structures
3290d532f3dd9c1e24921c4b80aeb6e860bc86a8
spock/plugins/__init__.py
spock/plugins/__init__.py
from spock.plugins.core import auth, event, net, ticker, timer from spock.plugins.helpers import clientinfo, entities, interact, inventory,\ keepalive, movement, physics, respawn, start, world from spock.plugins.base import PluginBase # noqa core_plugins = [ ('auth', auth.AuthPlugin), ('event', event.Ev...
from spock.plugins.core import auth, event, net, ticker, timer from spock.plugins.helpers import chat, clientinfo, entities, interact, \ inventory, keepalive, movement, physics, respawn, start, world from spock.plugins.base import PluginBase # noqa core_plugins = [ ('auth', auth.AuthPlugin), ('event', ev...
Fix removal of chat plugin
Fix removal of chat plugin
Python
mit
nickelpro/SpockBot,MrSwiss/SpockBot,Gjum/SpockBot,SpockBotMC/SpockBot,gamingrobot/SpockBot,luken/SpockBot
1f09af5b3b785133dce83cd5a00fde7f69fdf410
apps/config/powerline.symlink/segments/custom.py
apps/config/powerline.symlink/segments/custom.py
from powerline.segments.common import bat, sys def system_load(pl, num_avgs=3): return sys.system_load(pl)[:num_avgs] def battery(pl, max_percent=101): if bat._get_capacity(pl) < max_percent: return bat.battery(pl) return []
from powerline.segments.common import bat, sys def system_load(pl, num_avgs=3): return sys.system_load(pl)[:num_avgs] def battery(pl, max_percent=101): capacity, ac_powered = bat._get_battery_status(pl) if capacity < max_percent: return bat.battery(pl) return []
Update powerline battery wrapper for new API
Update powerline battery wrapper for new API
Python
mit
tchajed/dotfiles-osx,tchajed/dotfiles-osx,tchajed/dotfiles-osx
a3d58cc1feeca734898098920e5c7195632d408b
atompos/atompos/middleware/logging_middleware.py
atompos/atompos/middleware/logging_middleware.py
from time import time from logging import getLogger # From: https://djangosnippets.org/snippets/1866/ def sizify(value): """ Simple kb/mb/gb size snippet """ #value = ing(value) if value < 512: ext = 'B' elif value < 512000: value = value / 1024.0 ext = 'kB' elif val...
from time import time from logging import getLogger # From: https://djangosnippets.org/snippets/1866/ def sizify(value): """ Simple kb/mb/gb size snippet """ #value = ing(value) if value < 512: ext = 'B' elif value < 512000: value = value / 1024.0 ext = 'kB' elif val...
Fix for request timer not always working.
Fix for request timer not always working.
Python
mit
jimivdw/OAPoC,bertrand-caron/OAPoC,bertrand-caron/OAPoC
b4bdd8e20b82f8016030037712094f257af9221f
cinder/db/sqlalchemy/migrate_repo/versions/006_snapshots_add_provider_location.py
cinder/db/sqlalchemy/migrate_repo/versions/006_snapshots_add_provider_location.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
Fix provider_location column add for PSQL
Fix provider_location column add for PSQL Migration 006 (commit 690cae58e6bbac5758ea2f7b60774c797d28fba5) didn't work properly for postgres, this patch corrects the upgrade by ensuring the execute is performed and the value is initialized to None. Since we haven't released a milestone etc with this migration in the c...
Python
apache-2.0
nexusriot/cinder,github-borat/cinder,mahak/cinder,CloudServer/cinder,eharney/cinder,spring-week-topos/cinder-week,blueboxgroup/cinder,potsmaster/cinder,julianwang/cinder,github-borat/cinder,Datera/cinder,j-griffith/cinder,cloudbau/cinder,cloudbase/cinder,redhat-openstack/cinder,NeCTAR-RC/cinder,rakeshmi/cinder,abusse/c...
8866de1785cc6961d2111f1e0f55b781a7de660d
_markerlib/__init__.py
_markerlib/__init__.py
"""Used by pkg_resources to interpret PEP 345 environment markers.""" from _markerlib.markers import default_environment, compile, interpret, as_function
"""Used by pkg_resources to interpret PEP 345 environment markers.""" from _markerlib.markers import default_environment, compile, interpret
Remove missing import (since b62968cd2666)
Remove missing import (since b62968cd2666) --HG-- branch : distribute extra : rebase_source : d1190f895d794dfcb838f7eb40a60ab07b8b309e
Python
mit
pypa/setuptools,pypa/setuptools,pypa/setuptools
c45c86fb573bff8fc4c6470f5dfc83e27c638aa4
base/ajax.py
base/ajax.py
import json from django.contrib.auth import get_user_model from dajaxice.decorators import dajaxice_register @dajaxice_register(method="GET") def getuser(request, query): User = get_user_model() qs = User.objects.filter(username__icontains=query) |\ User.objects.filter(first_name__icontains=query) |\...
import json from django.contrib.auth import get_user_model from dajaxice.decorators import dajaxice_register @dajaxice_register(method="GET") def getuser(request, query): User = get_user_model() qs = User.objects.filter(username__icontains=query) |\ User.objects.filter(first_name__icontains=query) |\...
Exclude self and anonymous from message recipients in autocomplete.
Exclude self and anonymous from message recipients in autocomplete.
Python
bsd-3-clause
ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio
47e21119621f211b0cac47972f5ad7ca92ffd950
flaskext/urls.py
flaskext/urls.py
# -*- coding: utf-8 -*- """ flaskext.urls ~~~~~~~~~~~~~ A collection of URL-related functions for Flask applications. :copyright: (c) 2010 by Steve Losh. :license: MIT, see LICENSE for more details. """
# -*- coding: utf-8 -*- """ flaskext.urls ~~~~~~~~~~~~~ A collection of URL-related functions for Flask applications. :copyright: (c) 2010 by Steve Losh. :license: MIT, see LICENSE for more details. """ from flask import url_for from werkzeug.routing import BuildError def permalink(function): ...
Add the actual functionality, lol.
Add the actual functionality, lol.
Python
mit
sjl/flask-urls,sjl/flask-urls
a24b2b303c1cd5e9f43353d55cc6b9d07b37b7f4
ephemeral-cluster.py
ephemeral-cluster.py
#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and images after command completion (regardless of success or failure.) Generally, this would be used with the ``run`` command to provide a clean room \ testin...
#!/usr/bin/env python import subprocess import sys import uuid usage = """\ Run a command using a temporary docker-compose cluster, removing all containers \ and associated volumes after command completion (regardless of success or \ failure.) Generally, this would be used with the ``run`` command to provide a clean...
Fix forwarding ephemeral cluster exit code.
Fix forwarding ephemeral cluster exit code. Summary: Also improves logging a little bit. Test Plan: $ python ephemeral-cluster.py run --rm --entrypoint=bash pgshovel -c "exit 10" $ test $? -eq 10 Reviewers: jeff, tail Reviewed By: tail Differential Revision: http://phabricator.local.disqus.net/D19564
Python
apache-2.0
fuziontech/pgshovel,disqus/pgshovel,fuziontech/pgshovel,fuziontech/pgshovel,disqus/pgshovel
ded80de3c276b57cd36d94ab393937289f772a25
django_prometheus/db/backends/postgresql/base.py
django_prometheus/db/backends/postgresql/base.py
import django import psycopg2.extensions from django_prometheus.db.common import DatabaseWrapperMixin, \ ExportingCursorWrapper if django.VERSION >= (1, 9): from django.db.backends.postgresql import base else: from django.db.backends.postgresql_psycopg2 import base class DatabaseFeatures(base.DatabaseFe...
import django import psycopg2.extensions from django_prometheus.db.common import DatabaseWrapperMixin, \ ExportingCursorWrapper if django.VERSION >= (1, 9): from django.db.backends.postgresql import base else: from django.db.backends.postgresql_psycopg2 import base class DatabaseFeatures(base.DatabaseFe...
Fix backwards compatibility for postgresql backend on Django 1.10 and earlier
Fix backwards compatibility for postgresql backend on Django 1.10 and earlier
Python
apache-2.0
korfuri/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus,obytes/django-prometheus
128506f0e21bff78ab3612602b17eb13658e837d
utils/clear_redis.py
utils/clear_redis.py
"""Utility for clearing all keys out of redis -- do not use in production!""" import sys from optparse import OptionParser import redis def option_parser(): parser = OptionParser() parser.add_option("-d", "--db", type="int", dest="db", default=1, help="Redis DB to...
"""Utility for clearing all keys out of redis -- do not use in production!""" import sys from optparse import OptionParser import redis def option_parser(): parser = OptionParser() parser.add_option("-d", "--db", type="int", dest="db", default=1, help="Redis DB to...
Print which DB will be cleared.
Print which DB will be cleared.
Python
bsd-3-clause
vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,TouK/vumi,TouK/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix
4bc9d1b51cd735c366edce81cd4e36e2eca904c7
worker/models/spotify_artist.py
worker/models/spotify_artist.py
from spotify_item import SpotifyItem class Artist(SpotifyItem): def __init__(self, **entries): super(Artist, self).__init__(**entries) def __repr__(self): return '<Artist: {0}>'.format(self.name)
from spotify_item import SpotifyItem from pyechonest import config from pyechonest import artist from worker.config import ECHO_NEST_API_KEY config.ECHO_NEST_API_KEY = ECHO_NEST_API_KEY class Artist(SpotifyItem): def __init__(self, **entries): super(Artist, self).__init__(**entries) self.echone...
Add echo nest to artist model
Add echo nest to artist model
Python
mit
projectweekend/song-feed-worker
964125fd5871179c51ea24af0a3767ce88431c26
modules/bibharvest/lib/oai_repository_config.py
modules/bibharvest/lib/oai_repository_config.py
## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (a...
## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (a...
Disable W0611 warning, as the imported config variables are exposed to the business logic from here.
Disable W0611 warning, as the imported config variables are exposed to the business logic from here.
Python
mit
tiborsimko/invenio,inveniosoftware/invenio,tiborsimko/invenio,inveniosoftware/invenio
e4798424b22a38cfca519e5e792644ae7757a4f5
api/base/pagination.py
api/base/pagination.py
from collections import OrderedDict from rest_framework import pagination from rest_framework.response import Response from rest_framework.utils.urls import ( replace_query_param, remove_query_param ) class JSONAPIPagination(pagination.PageNumberPagination): """Custom paginator that formats responses in a JSO...
from collections import OrderedDict from rest_framework import pagination from rest_framework.response import Response from rest_framework.utils.urls import ( replace_query_param, remove_query_param ) class JSONAPIPagination(pagination.PageNumberPagination): """Custom paginator that formats responses in a JSO...
Allow client to customize page size using page[size] query param
Allow client to customize page size using page[size] query param
Python
apache-2.0
samchrisinger/osf.io,fabianvf/osf.io,erinspace/osf.io,lyndsysimon/osf.io,samanehsan/osf.io,brandonPurvis/osf.io,billyhunt/osf.io,baylee-d/osf.io,billyhunt/osf.io,erinspace/osf.io,ZobairAlijan/osf.io,mfraezz/osf.io,adlius/osf.io,brandonPurvis/osf.io,HalcyonChimera/osf.io,GageGaskins/osf.io,jnayak1/osf.io,jinluyuan/osf.i...
e284c0e512edd18ed0ef1259fd4606d630699f3a
wtl/wtgithub/models.py
wtl/wtgithub/models.py
from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.db import models @python_2_unicode_compatible class Repository(models.Model): """ Repository Represents github repository. Name, descr...
from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.db import models @python_2_unicode_compatible class Repository(models.Model): """ Repository Represents github repository. Name, descr...
Add missing `__str__` to `Repository` model
Add missing `__str__` to `Repository` model Can't use `@python_2_unicode_compatible` without defining `__str__`.
Python
mit
elegion/djangodash2013,elegion/djangodash2013
fd0479742afd994bfb241415f7db9c0c971a09b3
conanfile.py
conanfile.py
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class ClangTidyTargetCMakeConan(ConanFile): name = "clang-tidy-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspi...
from conans import ConanFile from conans.tools import download, unzip import os VERSION = "0.0.2" class ClangTidyTargetCMakeConan(ConanFile): name = "clang-tidy-target-cmake" version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION) generators = "cmake" requires = ("cmake-include-guard/master@smspi...
Copy find modules to root of module path
conan: Copy find modules to root of module path
Python
mit
polysquare/clang-tidy-target-cmake,polysquare/clang-tidy-target-cmake
a9a26ddff2e0d033854621e13b19693561f9fe5f
tests/drawing/demo_change_artist_group.py
tests/drawing/demo_change_artist_group.py
#!/usr/bin/env python3 """An orange rectangle should be displayed on top of a green one. When you click with the mouse, the green rectangle should move on top. When you release the mouse, the orange rectangle should move back to the top.""" import pyglet import glooey import vecrec from glooey.drawing import gree...
#!/usr/bin/env python3 """An orange rectangle should be displayed on top of a green one. When you click with the mouse, the green rectangle should move on top. When you release the mouse, the orange rectangle should move back to the top.""" import pyglet import glooey import vecrec from glooey.drawing import gree...
Make the test a bit more verbose.
Make the test a bit more verbose.
Python
mit
kxgames/glooey,kxgames/glooey
7437382d966d39c4de21d2686bd8f31a23e5c47b
IPython/html/texteditor/handlers.py
IPython/html/texteditor/handlers.py
#encoding: utf-8 """Tornado handlers for the terminal emulator.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from tornado import web from ..base.handlers import IPythonHandler, path_regex from ..utils import url_escape class EditorHandler(IPythonHandler): ...
#encoding: utf-8 """Tornado handlers for the terminal emulator.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from tornado import web from ..base.handlers import IPythonHandler, path_regex from ..utils import url_escape class EditorHandler(IPythonHandler): ...
Set page title for editor
Set page title for editor
Python
bsd-3-clause
ipython/ipython,ipython/ipython
ecee83e5cbc66c631fce5278bc2533eb2f711afe
crust/api.py
crust/api.py
from . import requests class Api(object): resources = {} def __init__(self, session=None, *args, **kwargs): super(Api, self).__init__(*args, **kwargs) if session is None: session = requests.session() self.session = session def __getattr__(self, name): if na...
import json import posixpath from . import requests from . import six from .exceptions import ResponseError class Api(object): resources = {} def __init__(self, session=None, *args, **kwargs): super(Api, self).__init__(*args, **kwargs) if session is None: session = requests.ses...
Make the Api class the key focal point to accessing the API
Make the Api class the key focal point to accessing the API
Python
bsd-2-clause
dstufft/crust
bd75d4548edfde2bebff116f33bfb66be6c982e2
warthog/transport.py
warthog/transport.py
# -*- coding: utf-8 -*- """ """ from __future__ import print_function, division import ssl import warnings import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager from requests.packages.urllib3.exceptions import InsecureRequestWarning def get_trans...
# -*- coding: utf-8 -*- """ """ from __future__ import print_function, division import ssl import warnings import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.poolmanager import PoolManager from requests.packages.urllib3.exceptions import InsecureRequestWarning def get_trans...
Change the name of the verify/no-verify param
Change the name of the verify/no-verify param
Python
mit
smarter-travel-media/warthog
f7f5bc45f6c3e86e9ea77be7a9be16d86465e3b3
perfkitbenchmarker/linux_packages/mysqlclient56.py
perfkitbenchmarker/linux_packages/mysqlclient56.py
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Install mysqlclient from HTTPs repo.
Install mysqlclient from HTTPs repo. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=263786009
Python
apache-2.0
GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker
f769360dbb6da83fc8bf9c244c04b3d2f7c49ffa
lab/runnerctl.py
lab/runnerctl.py
""" pytest runner control plugin """ import pytest def pytest_runtest_makereport(item, call): if 'setup_test' in item.keywords and call.excinfo: if not call.excinfo.errisinstance(pytest.skip.Exception): pytest.halt('A setup test has failed, aborting...') class Halt(object): def __init__(...
""" pytest runner control plugin """ import pytest import string def pytest_runtest_makereport(item, call): if 'setup_test' in item.keywords and call.excinfo: if not call.excinfo.errisinstance(pytest.skip.Exception): pytest.halt('A setup test has failed, aborting...') class Halt(object): ...
Move some fixtures into better places
Move some fixtures into better places Move datadir into the sipsecmon plugin and testname into lab.runnerctl.
Python
mpl-2.0
sangoma/pytestlab
9173a91ed6fc234c4a7b9dbf1d2e8f853d977a86
mail_restrict_follower_selection/__manifest__.py
mail_restrict_follower_selection/__manifest__.py
# Copyright (C) 2015 Therp BV <http://therp.nl> # Copyright (C) 2017 Komit <http://www.komit-consulting.com> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Restrict follower selection", "version": "13.0.1.0.2", "author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)", ...
# Copyright (C) 2015 Therp BV <http://therp.nl> # Copyright (C) 2017 Komit <http://www.komit-consulting.com> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Restrict follower selection", "version": "13.0.1.0.2", "author": "Therp BV,Creu Blanca,Odoo Community Association (OCA)", ...
Apply pre-commit changes: Resolve conflicts
[IMP] Apply pre-commit changes: Resolve conflicts
Python
agpl-3.0
OCA/social,OCA/social,OCA/social
328e65e2c134363a1407c42a44ae9043f701874e
tests/commands/load/test_load_cnv_report_cmd.py
tests/commands/load/test_load_cnv_report_cmd.py
# -*- coding: utf-8 -*- import os from scout.demo import cnv_report_path from scout.commands import cli def test_load_cnv_report(mock_app, case_obj): """Testing the load delivery report cli command""" # Make sure the path to delivery report is a valid path assert os.path.isfile(cnv_report_path) run...
# -*- coding: utf-8 -*- import os from scout.demo import cnv_report_path from scout.commands import cli def test_load_cnv_report(mock_app, case_obj): """Testing the load delivery report cli command""" # Make sure the path to delivery report is a valid path assert os.path.isfile(cnv_report_path) run...
Update test to avoid pipeline fail
Update test to avoid pipeline fail
Python
bsd-3-clause
Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout
8e4833c50b46d8b2f9604fcddcbd5258565ce185
examples/multiple_devices_with_watcher.py
examples/multiple_devices_with_watcher.py
""" An example showing how to use the Watcher to track multiple devices in one process. """ from ninja.api import NinjaAPI, Watcher from ninja.devices import TemperatureSensor from datetime import datetime # Set up the NinjaAPI and Device wrappers: # Access token from https://a.ninja.is/you#apiTab api...
""" An example showing how to use the Watcher to track multiple devices in one process. """ from ninja.api import NinjaAPI, Watcher from ninja.devices import TemperatureSensor, HumiditySensor from datetime import datetime # Set up the NinjaAPI and Device wrappers: # Access token from https://a.ninja.i...
Update Watcher example to use HumiditySensor instead of second TemperatureSensor
Update Watcher example to use HumiditySensor instead of second TemperatureSensor
Python
unlicense
alecperkins/py-ninja
ff9a8cb1f68785cc16c99fe26dd96e9fa01c325e
src/hunter/const.py
src/hunter/const.py
import site import sys from distutils.sysconfig import get_python_lib SITE_PACKAGES_PATHS = set(site.getsitepackages()) SITE_PACKAGES_PATHS.add(site.getusersitepackages()) SITE_PACKAGES_PATHS.add(get_python_lib()) SITE_PACKAGES_PATHS = tuple(SITE_PACKAGES_PATHS) SYS_PREFIX_PATHS = set(( sys.prefix, sys.exec_...
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()) SITE_PACKAGES_PATHS.add(get_pyt...
Add checks in case site.py is broken (eg: virtualenv).
Add checks in case site.py is broken (eg: virtualenv).
Python
bsd-2-clause
ionelmc/python-hunter
338435f7b1a10f749266138a0fbe610fa065a422
clients.py
clients.py
# -*- coding: utf-8 -*- from helpers import HTTPEventHandler import looping import buffer_event class StatusClient(HTTPEventHandler): def __init__(self, server, sock, address, request_parser): HTTPEventHandler.__init__(self, server, sock, address, request_parser, 204, b'...
# -*- coding: utf-8 -*- from helpers import HTTPEventHandler import looping import buffer_event class StatusClient(HTTPEventHandler): def __init__(self, server, sock, address, request_parser): HTTPEventHandler.__init__(self, server, sock, address, request_parser, 204, b'...
Remove commented out debug print lines
Remove commented out debug print lines
Python
agpl-3.0
noirbee/savate,noirbee/savate
ef29e2dd9426d42312de6969b927b5315f3df115
src/redmill/catalog.py
src/redmill/catalog.py
# This file is part of Redmill. # # Redmill 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. # # Redmill is distributed in the ho...
# This file is part of Redmill. # # Redmill 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. # # Redmill is distributed in the ho...
Save images instead of paths in Catalog.
Save images instead of paths in Catalog.
Python
agpl-3.0
lamyj/redmill,lamyj/redmill,lamyj/redmill
1d11f8d123709626ba3e41b7697a1511c034ab55
timeser.py
timeser.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from goristock import goristock a = goristock(8261) for i in range(3): a.display(3,6,9) a.raw_data.pop() a.data_date.pop() a.stock_range.pop() a.stock_vol.pop() a.display(3,6,9)
#!/usr/bin/env python # -*- coding: utf-8 -*- from goristock import goristock a = goristock(2201) while len(a.raw_data) > 19: a.raw_data.pop() a.data_date.pop() a.stock_range.pop() a.stock_vol.pop() if a.MAC(3) == '↑' and a.MAC(6) == '↑' and a.MAC(18) == '↑': #if a.MAO(3,6)[0][1][-1] < 0 and a.MAO(3,6)[1]...
Add time serial test, buy or sell point.
Add time serial test, buy or sell point.
Python
mit
toomore/goristock
4bf7c8f1522b433cbe7b9b9312a51942a9ea75c1
pytac/__init__.py
pytac/__init__.py
"""Pytac: Python Toolkit for Accelerator Controls.""" # PV types SP = 'setpoint' RB = 'readback' # Unit systems ENG = 'engineering' PHYS = 'physics' # Model types. SIM = 'simulation' LIVE = 'live'
"""Pytac: Python Toolkit for Accelerator Controls.""" # PV types SP = 'setpoint' RB = 'readback' # Unit systems ENG = 'engineering' PHYS = 'physics' # Model types. SIM = 'simulation' LIVE = 'live' from . import device, element, lattice, load_csv, lattice, utils
Add modules to pytac namespace.
Add modules to pytac namespace.
Python
apache-2.0
willrogers/pytac,willrogers/pytac
30044f8272557dbd367eab3dbe7c1ba1076484e9
readux/pages/models.py
readux/pages/models.py
from django.db import models # Create your models here. from django.utils.translation import ugettext_lazy as _ from feincms.module.page.models import Page from feincms.content.richtext.models import RichTextContent from feincms.content.medialibrary.models import MediaFileContent # Page.register_extensions('datepub...
from django.db import models # Create your models here. from django.utils.translation import ugettext_lazy as _ from feincms.module.page.models import Page from feincms.content.richtext.models import RichTextContent from feincms.content.medialibrary.models import MediaFileContent from feincms.content.video.models im...
Enable video content for cms pages
Enable video content for cms pages [#110289088]
Python
apache-2.0
emory-libraries/readux,emory-libraries/readux,emory-libraries/readux
2c7baf580631fc5a78b59560f65b5283b74f347b
tests/functional/test_download_l10n.py
tests/functional/test_download_l10n.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from bs4 import BeautifulSoup import pytest import requests def pytest_generate_tests(metafunc): if 'not headless'...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from bs4 import BeautifulSoup import pytest import requests def pytest_generate_tests(metafunc): if 'not headless'...
Add /firefox/nightly/all/ to download link tests
Add /firefox/nightly/all/ to download link tests
Python
mpl-2.0
mozilla/bedrock,alexgibson/bedrock,mkmelin/bedrock,TheoChevalier/bedrock,sgarrity/bedrock,pascalchevrel/bedrock,CSCI-462-01-2017/bedrock,CSCI-462-01-2017/bedrock,schalkneethling/bedrock,flodolo/bedrock,schalkneethling/bedrock,flodolo/bedrock,sylvestre/bedrock,pascalchevrel/bedrock,sylvestre/bedrock,gerv/bedrock,craigco...
e31a0d76236c27cfae733335bd13528e67f15fa4
version.py
version.py
major = 0 minor=0 patch=0 branch="dev" timestamp=1376425015.74
major = 0 minor=0 patch=10 branch="master" timestamp=1376502388.26
Tag commit for v0.0.10-master generated by gitmake.py
Tag commit for v0.0.10-master generated by gitmake.py
Python
mit
ryansturmer/gitmake
350e8bdcb9c6f3eace7839e5dc7270bfeb51e50f
tests/grafana_dashboards/test_config.py
tests/grafana_dashboards/test_config.py
# -*- coding: utf-8 -*- # Copyright 2015 grafana-dashboard-builder contributors # # 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 requi...
# -*- coding: utf-8 -*- # Copyright 2015 grafana-dashboard-builder contributors # # 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 requi...
Add more tests for Config
Add more tests for Config
Python
apache-2.0
jakubplichta/grafana-dashboard-builder
00e84b51f22f78f0243cd7b7212e70447fd5b552
store/tests/test_forms.py
store/tests/test_forms.py
from django.test import TestCase from store.forms import ReviewForm from store.models import Review from .factories import * class ReviewFormTest(TestCase): def test_form_validation_for_blank_items(self): p1 = ProductFactory.create() form = ReviewForm( data={'name':'', 'text': '', '...
from django.test import TestCase from store.forms import ReviewForm from store.models import Review from .factories import * class ReviewFormTest(TestCase): def test_form_validation_for_blank_items(self): p1 = ProductFactory.create() form = ReviewForm( data={'name':'', 'text': '', '...
Test that an empty name field doesn't raise errors
Test that an empty name field doesn't raise errors
Python
bsd-3-clause
andela-kndungu/compshop,andela-kndungu/compshop,andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop
327bbdde964f8af0625313922be91665a75d7268
fabfile.py
fabfile.py
from fabric import api def raspberry_pi(name): api.env.hosts = ["{0}.local".format(name)] api.env.user = 'pi' def deploy(): api.require('hosts', provided_by=[raspberry_pi]) with api.settings(warn_only=True): api.sudo('service sensor-rpc stop') with api.cd('~/Pi-Sensor-RPC-Service'): api.run('git pull ori...
from StringIO import StringIO from fabric import api from fabric.operations import prompt, put UPSTART_TEMPLATE = """ description "Pi-Sensor-RPC-Service" start on runlevel [2345] stop on runlevel [06] respawn respawn limit 10 5 env LOGGLY_TOKEN={loggly_token} env LOGGLY_SUBDOMAIN={loggly_domain} env SERIAL_ADDRESS=...
Add install task to fab file
Add install task to fab file
Python
mit
projectweekend/Pi-Sensor-RPC-Service
97efe99ae964e8f4e866d961282257e6f4293fd8
synapse/config/workers.py
synapse/config/workers.py
# -*- coding: utf-8 -*- # Copyright 2016 matrix.org # # 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...
# -*- coding: utf-8 -*- # Copyright 2016 matrix.org # # 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...
Make worker listener config backwards compat
Make worker listener config backwards compat
Python
apache-2.0
matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,TribeMedia/synapse,TribeMedia/synapse,TribeMedia/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,TribeMedia/synapse,TribeMedia/synapse
582811074db86be964648dc9457855db3549a2b5
data_structures/Disjoint_Set_Union/Python/dsu.py
data_structures/Disjoint_Set_Union/Python/dsu.py
parent=[] size=[] def initialize(n): for i in range(0,n+1): parent.append(i) size.append(1) def find(x): if parent[x] == x: return x else: return find(parent[x]) def join(a,b): p_a = find(a) p_b = find(b) if p_a != p_b: if size[p_a] < size[p_b]: parent[p_a] = p_b size[p_b] += size[p_a] els...
parent=[] size=[] def initialize(n): for i in range(0,n+1): parent.append(i) size.append(1) def find(x): if parent[x] == x: return x else: return find(parent[x]) def join(a,b): p_a = find(a) p_b = find(b) if p_a != p_b: if size[p_a] < size[p_b]: parent[p_a] = p_b size[p_b] += size[p_a] els...
Test for DSU on Python
Test for DSU on Python
Python
cc0-1.0
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
049a01d148c757a17e9804a2b1e42c918e29b094
tests/basics/for_break.py
tests/basics/for_break.py
# Testcase for break in a for [within bunch of other code] # https://github.com/micropython/micropython/issues/635 def foo(): seq = [1, 2, 3] v = 100 i = 5 while i > 0: print(i) for a in seq: if a == 2: break i -= 1 foo()
# Testcase for break in a for [within bunch of other code] # https://github.com/micropython/micropython/issues/635 def foo(): seq = [1, 2, 3] v = 100 i = 5 while i > 0: print(i) for a in seq: if a == 2: break i -= 1 foo() # break from within nested ...
Add another test for break-from-for-loop.
tests: Add another test for break-from-for-loop.
Python
mit
neilh10/micropython,galenhz/micropython,heisewangluo/micropython,heisewangluo/micropython,ruffy91/micropython,mgyenik/micropython,ericsnowcurrently/micropython,cnoviello/micropython,lbattraw/micropython,lbattraw/micropython,hosaka/micropython,EcmaXp/micropython,alex-march/micropython,Timmenem/micropython,cwyark/micropy...
9a8f27fb6b3cec373d841b0973ee59f2ddd0b875
fabfile.py
fabfile.py
from fabric.api import env, local, cd, run env.use_ssh_config = True env.hosts = ['root@skylines'] def deploy(branch='master', force=False): push(branch, force) restart() def push(branch='master', force=False): cmd = 'git push %s:/opt/skylines/src/ %s:master' % (env.host_string, branch) if force: ...
from fabric.api import env, local, cd, run, settings, sudo env.use_ssh_config = True env.hosts = ['root@skylines'] def deploy(branch='master', force=False): push(branch, force) restart() def push(branch='master', force=False): cmd = 'git push %s:/opt/skylines/src/ %s:master' % (env.host_string, branch)...
Use sudo() function for db migration call
fabric: Use sudo() function for db migration call
Python
agpl-3.0
RBE-Avionik/skylines,shadowoneau/skylines,RBE-Avionik/skylines,Harry-R/skylines,Turbo87/skylines,Harry-R/skylines,skylines-project/skylines,TobiasLohner/SkyLines,shadowoneau/skylines,RBE-Avionik/skylines,kerel-fs/skylines,kerel-fs/skylines,snip/skylines,skylines-project/skylines,shadowoneau/skylines,Harry-R/skylines,sh...
989abdc718973551bbb3565859d75ea0408776d0
example_project/example_project/urls.py
example_project/example_project/urls.py
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.static import serve urlpatterns = [ # Examples: # url(r'^$', 'example_project.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r"^admin/", include(admin.si...
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.static import serve urlpatterns = [ # Examples: # url(r'^$', 'example_project.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r"^admin/", admin.site.urls)...
Fix URLconf for example project.
Fix URLconf for example project.
Python
mit
zsiciarz/django-pgallery,zsiciarz/django-pgallery
cd9b2e375587fdf0bc6b2d61a983ca40e6680218
osf/migrations/0139_rename_aspredicted_schema.py
osf/migrations/0139_rename_aspredicted_schema.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-10-16 20:22 from __future__ import unicode_literals from django.db import migrations from osf.models import RegistrationSchema OLD_NAME = 'AsPredicted Preregistration' NEW_NAME = 'Preregistration Template from AsPredicted.org' def rename_schema(from_name,...
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-10-16 20:22 from __future__ import unicode_literals from django.db import migrations OLD_NAME = 'AsPredicted Preregistration' NEW_NAME = 'Preregistration Template from AsPredicted.org' def rename_schema(model, from_name, to_name): try: schema ...
Migrate with model from app state - Not from app code
Migrate with model from app state - Not from app code
Python
apache-2.0
adlius/osf.io,mattclark/osf.io,cslzchen/osf.io,pattisdr/osf.io,brianjgeiger/osf.io,adlius/osf.io,CenterForOpenScience/osf.io,mattclark/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,felliott/osf.io,pattisdr/osf.io,mfraezz/osf.io,adlius/osf.io,baylee-d/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,Johnetordoff/osf.io,bay...
a6e14ac538a40fd98db16a98938acfb6a811dc06
fabfile.py
fabfile.py
from fabric.api import ( cd, env, put, sudo, task ) PRODUCTION_IP = '' PROJECT_DIRECTORY = '/home/ubuntu/ztm/' COMPOSE_FILE = 'compose-production.yml' @task def production(): env.run = sudo env.hosts = [ 'ubuntu@' + PRODUCTION_IP + ':22', ] def create_project_directory(): ...
from fabric.api import ( cd, env, put, run, sudo, task ) PRODUCTION_IP = '54.154.235.243' PROJECT_DIRECTORY = '/home/ubuntu/ztm/' COMPOSE_FILE = 'compose-production.yml' @task def production(): env.run = sudo env.hosts = [ 'ubuntu@' + PRODUCTION_IP + ':22', ] def create...
Fix production ID and run command without sudo
Fix production ID and run command without sudo
Python
mit
prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine,prontotools/zendesk-tickets-machine
f5143ccb206e5b077f0a80c88555e57064b6acab
fabfile.py
fabfile.py
from fabric.api import * env.hosts = [ '192.168.1.144' ] env.user = 'pi' def prepare_raspberry_pi(): pass def remote_pull(): with cd('virtualenvs/queen/queen'): run('git pull') def deploy(): local('git commit -a') local('git push origin') remote_pull()
from fabric.api import * env.hosts = [ '192.168.1.144' ] env.user = 'pi' def prepare_raspberry_pi(): pass def remote_pull(): with cd('virtualenvs/queen/queen'): run('git pull') def commit(): local('git commit -a') def push(): local('git push origin') def deploy(): commit() push() remote_pull()
Add fab commands to push and pull
Add fab commands to push and pull
Python
mit
kalail/queen,kalail/queen
8b3132f9aec26d71498a153a29ea8d2049f07da6
studygroups/admin.py
studygroups/admin.py
from django.contrib import admin # Register your models here. from studygroups.models import Course, StudyGroup, StudyGroupSignup, Application class CourseAdmin(admin.ModelAdmin): pass class StudyGroupSignupInline(admin.TabularInline): model = StudyGroupSignup class StudyGroupAdmin(admin.ModelAdmin): in...
from django.contrib import admin # Register your models here. from studygroups.models import Course, StudyGroup, StudyGroupSignup, Application class StudyGroupSignupInline(admin.TabularInline): model = StudyGroupSignup class ApplicationInline(admin.TabularInline): model = Application.study_groups.through ...
Add applications to study groups
Add applications to study groups
Python
mit
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
42e17593dd9fdbeac02f2b71beebae3b1a7f94c8
openhatch-issues/openhatch-issues.py
openhatch-issues/openhatch-issues.py
# -*- coding: utf-8 -*- from github3 import login mytoken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' gh = login('xxxxx', token=mytoken) user = gh.user() print(user.name) print(user.login) print(user.followers) for f in gh.iter_followers(): print(str(f)) print(gh.zen())
# -*- coding: utf-8 -*- from github3 import login mytoken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' gh = login('xxxxx', token=mytoken) user = gh.user() print(user.name) print(user.login) print(user.followers) for f in gh.iter_followers(): print(str(f)) print(gh.zen()) issue = gh.issue('openhatch', 'oh-main...
Add hack experiment for issues and labels
Add hack experiment for issues and labels
Python
bsd-3-clause
willingc/openhatch-issues,willingc/openhatch-issues
daf29f52c01d83619585a1f2fa2e6f03a397e1cc
tests/test_utils.py
tests/test_utils.py
# coding: utf-8 from __future__ import absolute_import from __future__ import unicode_literals import io import os import unittest import tempfile try: from unittest import mock except ImportError: import mock from fs.archive import _utils class TestUtils(unittest.TestCase): @unittest.skipUnless(os.na...
# coding: utf-8 from __future__ import absolute_import from __future__ import unicode_literals import io import os import unittest import tempfile try: from unittest import mock except ImportError: import mock from fs.archive import _utils class TestUtils(unittest.TestCase): @unittest.skipUnless(os.na...
Fix test_writable_stream failing in Python 3.3 and 3.4
Fix test_writable_stream failing in Python 3.3 and 3.4
Python
mit
althonos/fs.archive
3a5dc4332e7f13119563e2190e6ef7d66b464054
tests/test_utils.py
tests/test_utils.py
""" Tests for the NURBS-Python package Released under The MIT License. See LICENSE file for details. Copyright (c) 2018 Onur Rauf Bingol Tests geomdl.utilities module. Requires "pytest" to run. """ from geomdl import utilities def test_autogen_knotvector(): degree = 4 num_ctrlpts = 12 aut...
""" Tests for the NURBS-Python package Released under The MIT License. See LICENSE file for details. Copyright (c) 2018 Onur Rauf Bingol Tests geomdl.utilities module. Requires "pytest" to run. """ from geomdl import utilities def test_autogen_knot_vector(): degree = 4 num_ctrlpts = 12 au...
Add knot vector normalization test
Add knot vector normalization test
Python
mit
orbingol/NURBS-Python,orbingol/NURBS-Python
d18f595b771ce68730cc5fea099f57dda6690157
piecewise/piecewise/bigquery.py
piecewise/piecewise/bigquery.py
import httplib2 from apiclient.discovery import build from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client import tools import os PROJECT_NUMBER = '422648324111' PARENT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRETS_FILE = os.path....
import httplib2 from apiclient.discovery import build from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client import tools import os PROJECT_NUMBER = '233384409938' PARENT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRETS_FILE = os.path....
Use M-Lab project number for BigQuery access.
Use M-Lab project number for BigQuery access.
Python
apache-2.0
opentechinstitute/piecewise,critzo/piecewise,critzo/piecewise,opentechinstitute/piecewise,opentechinstitute/piecewise,opentechinstitute/piecewise,critzo/piecewise,critzo/piecewise
d0613f3e77b87ad8df92730e5aa50aebf651ccc6
tests/test_plotting.py
tests/test_plotting.py
import unittest import numpy as np from numpy import pi import matplotlib.pyplot as plt from robot_arm import RobotArm from plotting import path_figure class TestPlotting(unittest.TestCase): def setUp(self): lengths = (3, 2, 2,) destinations = ( (5, 4, 6, 4, 5), (0, 2, 0.5,...
import unittest import numpy as np from plotting import path_figure from fixtures import robot_arm1 class TestPlotting(unittest.TestCase): def setUp(self): self.robot_arm = robot_arm1 n = len(self.robot_arm.lengths) s = len(self.robot_arm.destinations[0]) total_joints = n * s ...
Use fixture for robot_arm test
Use fixture for robot_arm test
Python
mit
JakobGM/robotarm-optimization
a21b02b93b8b92693be6dbdfe9c8d454ee233cc1
fabdefs.py
fabdefs.py
from fabric.api import * """ Define the server environments that this app will be deployed to. Ensure that you have SSH access to the servers for the scripts in 'fabfile.py' to work. """ def production(): """ Env parameters for the production environment. """ env.host_string = 'ubuntu@xxx' env.k...
from fabric.api import * """ Define the server environments that this app will be deployed to. Ensure that you have SSH access to the servers for the scripts in 'fabfile.py' to work. """ def production(): """ Env parameters for the production environment. """ env.host_string = 'ubuntu@54.76.117.251'...
Add details of demo EC2 server.
Add details of demo EC2 server.
Python
apache-2.0
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
1606445e137ecae5a1f5c50edcc5e851d399b313
project_euler/025.1000_digit_fibonacci_number.py
project_euler/025.1000_digit_fibonacci_number.py
''' Problem 025 The Fibonacci sequence is defined by the recurrence relation: Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. Hence the first 12 terms will be: F1 = 1 F2 = 1 F3 = 2 F4 = 3 F5 = 5 F6 = 8 F7 = 13 F8 = 21 F9 = 34 F10 = 55 F11 = 89 F12 = 144 The 12th term, F12, is the first term to contain three digits. What...
''' Problem 025 The Fibonacci sequence is defined by the recurrence relation: Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. Hence the first 12 terms will be: F1 = 1 F2 = 1 F3 = 2 F4 = 3 F5 = 5 F6 = 8 F7 = 13 F8 = 21 F9 = 34 F10 = 55 F11 = 89 F12 = 144 The 12th term, F12, is the first term to contain three digits. What...
Solve 1000 digit fib number
Solve 1000 digit fib number
Python
mit
daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various,daveinnyc/various
accd91b9b180f88facd5a61bddbb073b5a35af63
ratechecker/migrations/0002_remove_fee_loader.py
ratechecker/migrations/0002_remove_fee_loader.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): try: schema_editor.execute( 'DROP INDEX IF EXISTS idx_16977_pro...
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-10-31 16:33 from __future__ import unicode_literals from django.db import migrations, OperationalError, ProgrammingError def fix_fee_product_index(apps, schema_editor): try: schema_editor.execute( 'DROP INDEX IF EXISTS idx_16977_pro...
Fix order of migration in operations
Fix order of migration in operations
Python
cc0-1.0
cfpb/owning-a-home-api
9ed7649d98bc4b1d3412047d0d5c50c1a5c8116c
tests/system/conftest.py
tests/system/conftest.py
# This file contains pytest fixtures as well as some config API_BASE = "http://localhost:5555/n/" TEST_MAX_DURATION_SECS = 240 TEST_GRANULARITY_CHECK_SECS = 0.1 # we don't want to commit passwords to the repo. # load them from an external json file. try: from accounts import credentials passwords = [] for...
# This file contains pytest fixtures as well as some config API_BASE = "http://localhost:5555/n/" TEST_MAX_DURATION_SECS = 240 TEST_GRANULARITY_CHECK_SECS = 0.1 # we don't want to commit passwords to the repo. # load them from an external json file. try: from accounts import credentials passwords = [] for...
Fix check for accounts.py file in system tests.
Fix check for accounts.py file in system tests.
Python
agpl-3.0
Eagles2F/sync-engine,ErinCall/sync-engine,closeio/nylas,gale320/sync-engine,nylas/sync-engine,EthanBlackburn/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,wakermahmud/sync-engine,gale320/sync-engine,ErinCall/sync-engine,gale320/sync-engine,PriviPK/privipk-sync-engine,nylas/sync-engine,ny...
0912f6910ac436f8f09848b4485e39e5c308f70e
indra/tools/live_curation/dump_index.py
indra/tools/live_curation/dump_index.py
"""This is a script to dump all the corpora on S3 into an index file.""" import boto3 res = s3.list_objects(Bucket='world-modelers', Prefix='indra_models') s3 = boto3.session.Session(profile_name='wm').client('s3') corpora = [] for entry in res['Content']: if entry['Key'].endswith('/statements.json'): co...
"""This is a script to dump all the corpora on S3 into an index file.""" import boto3 if __name__ == '__main__': s3 = boto3.session.Session(profile_name='wm').client('s3') res = s3.list_objects(Bucket='world-modelers', Prefix='indra_models') corpora = [] for entry in res['Content']: if entry...
Fix the index dumper code
Fix the index dumper code
Python
bsd-2-clause
sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/belpy,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,johnbachman/belpy,bgyori/indra
7d0691eae614da96f8fe14a5f5338659ef9638df
ml/pytorch/image_classification/architectures.py
ml/pytorch/image_classification/architectures.py
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F ################################################################################ # SUPPORT ################################################################################ class Flat...
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F ################################################################################ # SUPPORT ################################################################################ class Flat...
Add custom conv layer module
FEAT: Add custom conv layer module
Python
apache-2.0
ronrest/convenience_py,ronrest/convenience_py
93870152b4afb04f1547378184e2cee0bd0dd45f
kobo/apps/languages/serializers/base.py
kobo/apps/languages/serializers/base.py
# coding: utf-8 from collections import defaultdict, OrderedDict from django.db import models from rest_framework import serializers class BaseServiceSerializer(serializers.ModelSerializer): class Meta: fields = [ 'name', 'code', ] class BaseServiceLanguageM2MSerializer...
# coding: utf-8 from collections import defaultdict, OrderedDict from django.db import models from rest_framework import serializers class BaseServiceSerializer(serializers.ModelSerializer): class Meta: fields = [ 'name', 'code', ] class BaseServiceLanguageM2MSerializer...
Return a dictionary for transcription/translation services (instead of list)
Return a dictionary for transcription/translation services (instead of list)
Python
agpl-3.0
kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi
bab9d6b28ca37ff5a34bf535d366ef81f10a5f90
pyinfra/modules/virtualenv.py
pyinfra/modules/virtualenv.py
# pyinfra # File: pyinfra/modules/pip.py # Desc: manage virtualenvs ''' Manage Python virtual environments ''' from __future__ import unicode_literals from pyinfra.api import operation from pyinfra.modules import files @operation def virtualenv( state, host, path, python=None, site_packages=False, always_c...
# pyinfra # File: pyinfra/modules/pip.py # Desc: manage virtualenvs ''' Manage Python virtual environments ''' from __future__ import unicode_literals from pyinfra.api import operation from pyinfra.modules import files @operation def virtualenv( state, host, path, python=None, site_packages=False, always_c...
Refactor building command using join()
Refactor building command using join()
Python
mit
Fizzadar/pyinfra,Fizzadar/pyinfra
0b1cdfac668b15ab9d48b1eb8a4ac4bff7b8c98e
pylinks/main/templatetags/menu_li.py
pylinks/main/templatetags/menu_li.py
from django.template import Library from django.template.defaulttags import URLNode, url from django.utils.html import escape, mark_safe register = Library() class MenuLINode(URLNode): def render(self, context): # Pull out the match and hijack asvar # to be used for the link title request...
from django.template import Library from django.template.defaulttags import URLNode, url from django.utils.html import escape, mark_safe register = Library() class MenuLINode(URLNode): def render(self, context): # Pull out the match and hijack asvar # to be used for the link title match =...
Fix check for valid resolver_match
Fix check for valid resolver_match
Python
mit
michaelmior/pylinks,michaelmior/pylinks,michaelmior/pylinks
3d6cc53a3fa5f272086612fa487589acc9b13737
federez_ldap/wsgi.py
federez_ldap/wsgi.py
""" WSGI config for federez_ldap project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
""" WSGI config for federez_ldap project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATI...
Append app path to Python path in WSGI
Append app path to Python path in WSGI
Python
mit
FedeRez/webldap,FedeRez/webldap,FedeRez/webldap
daaeb002d7a4a2845052dd3078512e66189c5a88
linguist/tests/base.py
linguist/tests/base.py
# -*- coding: utf-8 -*- from django.test import TestCase from ..registry import LinguistRegistry as Registry from ..models import Translation from . import settings from .translations import FooModel, FooTranslation class BaseTestCase(TestCase): """ Base test class mixin. """ @property def lang...
# -*- coding: utf-8 -*- from django.test import TestCase from ..models import Translation from . import settings from .translations import FooModel class BaseTestCase(TestCase): """ Base test class mixin. """ @property def languages(self): return [language[0] for language in settings.LA...
Update BaseTest class (removing registry).
Update BaseTest class (removing registry).
Python
mit
ulule/django-linguist
213a7a36bd599279d060edc053a86b602c9731b1
python/turbodbc_test/test_has_numpy_support.py
python/turbodbc_test/test_has_numpy_support.py
from mock import patch from turbodbc.cursor import _has_numpy_support def test_has_numpy_support_fails(): with patch('__builtin__.__import__', side_effect=ImportError): assert _has_numpy_support() == False def test_has_numpy_support_succeeds(): assert _has_numpy_support() == True
import six from mock import patch from turbodbc.cursor import _has_numpy_support # Python 2/3 compatibility _IMPORT_FUNCTION_NAME = "{}.__import__".format(six.moves.builtins.__name__) def test_has_numpy_support_fails(): with patch(_IMPORT_FUNCTION_NAME, side_effect=ImportError): assert _has_numpy_supp...
Fix test issue with mocking import for Python 3
Fix test issue with mocking import for Python 3
Python
mit
blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc
254702c1b5a76701a1437d6dc3d732ec27ebaa81
backslash/api_object.py
backslash/api_object.py
class APIObject(object): def __init__(self, client, json_data): super(APIObject, self).__init__() self.client = client self._data = json_data def __eq__(self, other): if not isinstance(other, APIObject): return NotImplemented return self.client is other.cli...
class APIObject(object): def __init__(self, client, json_data): super(APIObject, self).__init__() self.client = client self._data = json_data def __eq__(self, other): if not isinstance(other, APIObject): return NotImplemented return self.client is other.cli...
Make `refresh` return self for chaining actions
Make `refresh` return self for chaining actions
Python
bsd-3-clause
slash-testing/backslash-python,vmalloc/backslash-python
01aa219b0058cbfbdb96e890f510fa275f3ef790
python/Completion.py
python/Completion.py
import vim, syncrequest, types class Completion: def get_completions(self, column, partialWord): parameters = {} parameters['column'] = vim.eval(column) parameters['wordToComplete'] = vim.eval(partialWord) parameters['WantDocumentationForEveryCompletionResult'] = \ bool(...
import vim, syncrequest, types class Completion: def get_completions(self, column, partialWord): parameters = {} parameters['column'] = vim.eval(column) parameters['wordToComplete'] = vim.eval(partialWord) parameters['WantDocumentationForEveryCompletionResult'] = \ bool(...
Use or operator in python to tidy up completion building.
Use or operator in python to tidy up completion building.
Python
mit
OmniSharp/omnisharp-vim,OmniSharp/omnisharp-vim,OmniSharp/omnisharp-vim
76dd8c7b000a97b4c6b808d69294e5f1d3eee3e4
rdmo/core/exports.py
rdmo/core/exports.py
from xml.dom.minidom import parseString from django.http import HttpResponse class XMLResponse(HttpResponse): def __init__(self, xml, name=None): super().__init__(prettify_xml(xml), content_type='application/xml') if name: self['Content-Disposition'] = 'filename="{}.xml"'.format(name...
from xml.dom.minidom import parseString from django.http import HttpResponse class XMLResponse(HttpResponse): def __init__(self, xml, name=None): super().__init__(prettify_xml(xml), content_type='application/xml') if name: self['Content-Disposition'] = 'filename="{}.xml"'.format(name...
Add explicit xml export options (indent, new line and encoding)
Add explicit xml export options (indent, new line and encoding)
Python
apache-2.0
rdmorganiser/rdmo,rdmorganiser/rdmo,rdmorganiser/rdmo
aef60d17607a0819e24a2a61304bd5ca38289d50
scripts/slave/dart/dart_util.py
scripts/slave/dart/dart_util.py
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utils for the dart project. """ import optparse import os import sys from common import chromium_utils def clobber(): print('Cl...
#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utils for the dart project. """ import optparse import subprocess import sys def clobber(): cmd = [sys.executable, './t...
Use the new tools/clean_output_directory.py script for clobbering builders.
Use the new tools/clean_output_directory.py script for clobbering builders. This will unify our clobbering functionality across builders that use annotated steps and builders with test setup in the buildbot source. TBR=foo Review URL: https://chromiumcodereview.appspot.com/10834305 git-svn-id: 239fca9b83025a0b6f823a...
Python
bsd-3-clause
eunchong/build,eunchong/build,eunchong/build,eunchong/build
a6ce85fa26235769b84003cf3cd73999b343bee6
tests/environment.py
tests/environment.py
import os import shutil import tempfile def before_all(context): context.starting_dir = os.getcwd() context.temp_dir = tempfile.mkdtemp() os.chdir(context.temp_dir) def after_all(context): os.chdir(context.starting_dir) shutil.rmtree(context.temp_dir)
import os import shutil import tempfile def before_scenario(context, *args, **kwargs): context.starting_dir = os.getcwd() context.temp_dir = tempfile.mkdtemp() os.chdir(context.temp_dir) def after_scenario(context, *args, **kwargs): os.chdir(context.starting_dir) shutil.rmtree(context.temp_dir)
Make temp dirs for each scenario.
Make temp dirs for each scenario.
Python
mit
coddingtonbear/jirafs,coddingtonbear/jirafs
d91b9fe330f61b2790d3c4a84190caa2b798d80e
bitmath/integrations/__init__.py
bitmath/integrations/__init__.py
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright © 2014-2016 Tim Bielawa <timbielawa@gmail.com> # See GitHub Contributors Graph for more information # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to ...
# -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright © 2014-2016 Tim Bielawa <timbielawa@gmail.com> # See GitHub Contributors Graph for more information # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to ...
Fix build errors with Python <3.6
Fix build errors with Python <3.6 The `ModuleNotFoundError` was introduced in Python 3.6.
Python
mit
tbielawa/bitmath,tbielawa/bitmath
58f31424ccb2eda5ee94514bd1305f1b814ab1de
estmator_project/est_client/urls.py
estmator_project/est_client/urls.py
from django.conf.urls import url import views urlpatterns = [ # urls begin with /client/ url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently url( r'^form$', views.client_form_view, name='client_form' ), url( r'^form/ed...
from django.conf.urls import url import views urlpatterns = [ # urls begin with /client/ url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently url( r'^form$', views.client_form_view, name='client_form' ), url( r'^form/ed...
Add simple company form routes
Add simple company form routes
Python
mit
Estmator/EstmatorApp,Estmator/EstmatorApp,Estmator/EstmatorApp
de8b35e5c0a3c5f1427bbdcf3b60bd3e915cf0ad
xorcise/__init__.py
xorcise/__init__.py
import curses from .character import Character from .console import Console from .line import Line from .attribute import RenditionAttribute, ColorAttribute from .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \ is_printable_char, char_with_control_key __console = None def turn_on_cons...
import curses from .character import Character from .console import Console from .line import Line from .attribute import RenditionAttribute, ColorAttribute from .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \ is_printable_char, char_with_control_key def turn_on_console(asciize=False, ...
Remove an extra global variable in xorcise package
Remove an extra global variable in xorcise package
Python
unlicense
raviqqe/shakyo
ec1cbf654d8c280e3094a5917a696c84f1e1264f
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup VERSION = "2.00" setup( name = "SocksipyChain", version = VERSION, description = "A Python SOCKS/HTTP Proxy module", long_description = """\ This Python module allows you to create TCP connections through a chain of SOCKS or HTTP proxies without a...
#!/usr/bin/env python from distutils.core import setup VERSION = "2.00" setup( name = "SocksipyChain", version = VERSION, description = "A Python SOCKS/HTTP Proxy module", long_description = """\ This Python module allows you to create TCP connections through a chain of SOCKS or HTTP proxies without a...
Install as a script as well
Install as a script as well
Python
bsd-3-clause
locusf/PySocksipyChain,locusf/PySocksipyChain
33922c93c66d236b238863bffd08a520456846b6
tests/integration/modules/test_win_dns_client.py
tests/integration/modules/test_win_dns_client.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTest # Import Salt libs import salt.utils.platform @skipIf(not salt.utils.platf...
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTest # Import Salt libs import salt.utils.platform @skipIf(not salt.utils.platf...
Fix the failing dns test on Windows
Fix the failing dns test on Windows Gets the name of the first interface on the system. Windows network interfaces don't have the same name across Window systems. YOu can even go as far as naming them whatever you want. The test was failing because the interface name was hard-coded as 'Ethernet'.
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
3da286b934dcb9da5f06a8e19342f74079e432ef
fabtastic/management/commands/ft_backup_db_to_s3.py
fabtastic/management/commands/ft_backup_db_to_s3.py
import os from django.core.management.base import BaseCommand from django.conf import settings from fabtastic import db from fabtastic.util.aws import get_s3_connection class Command(BaseCommand): help = 'Backs the DB up to S3. Make sure to run s3cmd --configure.' def handle(self, *args, **options): ...
import os import datetime from django.core.management.base import BaseCommand from django.conf import settings from fabtastic import db from fabtastic.util.aws import get_s3_connection class Command(BaseCommand): help = 'Backs the DB up to S3. Make sure to run s3cmd --configure.' def handle(self, *args, **o...
Make backing up to S3 use a year/month/date structure for backups, for S3 clients that 'fake' directory structures.
Make backing up to S3 use a year/month/date structure for backups, for S3 clients that 'fake' directory structures.
Python
bsd-3-clause
duointeractive/django-fabtastic
d35bd019d99c8ef19012642339ddab1f4a631b8d
fixtureless/tests/test_django_project/test_django_project/test_app/tests/__init__.py
fixtureless/tests/test_django_project/test_django_project/test_app/tests/__init__.py
from test_app.tests.generator import * from test_app.tests.factory import * from test_app.tests.utils import *
from test_app.tests.test_generator import * from test_app.tests.test_factory import * from test_app.tests.test_utils import *
Fix broken imports after file namechange
Fix broken imports after file namechange
Python
mit
ricomoss/django-fixtureless
63c1382f80250ca5df4c438e31a71ddae519a44a
clowder_server/admin.py
clowder_server/admin.py
from django.contrib import admin from clowder_account.models import ClowderUser, ClowderUserAdmin from clowder_server.models import Alert, Ping admin.site.register(Alert) admin.site.register(ClowderUser, ClowderUserAdmin) admin.site.register(Ping)
from django.contrib import admin from clowder_account.models import ClowderUser, ClowderUserAdmin from clowder_server.models import Alert, Ping admin.site.register(Alert) admin.site.register(ClowderUser, ClowderUserAdmin) @admin.register(Ping) class PingAdmin(admin.ModelAdmin): list_filter = ('user',)
Add list filter for searching
ADMIN: Add list filter for searching
Python
agpl-3.0
keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server
effb5d796e55dbf28de2ec8d6711fcf2724bc62f
src/core/migrations/0059_auto_20211013_1657.py
src/core/migrations/0059_auto_20211013_1657.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-10-13 15:57 from __future__ import unicode_literals from django.db import migrations def set_about_plugin_to_hpe(apps, schema_editor): Plugin = apps.get_model('utils', 'Plugin') Plugin.objects.filter( name='About', ).update( h...
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-10-13 15:57 from __future__ import unicode_literals from django.db import migrations def set_about_plugin_to_hpe(apps, schema_editor): Plugin = apps.get_model('utils', 'Plugin') Plugin.objects.filter( name='About', ).update( h...
Fix missing dependency on core.0059 migration
Fix missing dependency on core.0059 migration
Python
agpl-3.0
BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway
c72764fde63e14f378a9e31dd89ea4180655d379
nightreads/emails/management/commands/send_email.py
nightreads/emails/management/commands/send_email.py
from django.core.management.base import BaseCommand from nightreads.emails.models import Email from nightreads.emails.email_service import send_email_obj from nightreads.emails.views import get_subscriber_emails class Command(BaseCommand): help = 'Send the email to susbcribers' def handle(self, *args, **opti...
from django.core.management.base import BaseCommand from nightreads.emails.models import Email from nightreads.emails.email_service import send_email_obj from nightreads.emails.views import get_subscriber_emails class Command(BaseCommand): help = 'Send the email to susbcribers' def handle(self, *args, **opti...
Add a note if no emails are available to send
Add a note if no emails are available to send
Python
mit
avinassh/nightreads,avinassh/nightreads
014e4fe380cddcdcc5ca12a32ab6af35e87ee56e
common/postgresqlfix.py
common/postgresqlfix.py
# This file is part of e-Giełda. # Copyright (C) 2014 Mateusz Maćkowski and Tomasz Zieliński # # e-Giełda 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 ...
# This file is part of e-Giełda. # Copyright (C) 2014 Mateusz Maćkowski and Tomasz Zieliński # # e-Giełda 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 ...
Fix buggy patched QuerySet methods
Fix buggy patched QuerySet methods
Python
agpl-3.0
m4tx/egielda,m4tx/egielda,m4tx/egielda
ce6e69c26b6d820b4f835cd56e72244faf0a6636
api/caching/listeners.py
api/caching/listeners.py
from api.caching.tasks import ban_url, logger from framework.guid.model import Guid from framework.tasks.handlers import enqueue_task from modularodm import signals @signals.save.connect def log_object_saved(sender, instance, fields_changed, cached_data): abs_url = None if hasattr(instance, 'absolute_api_v2_ur...
from api.caching.tasks import ban_url, logger from framework.guid.model import Guid from framework.tasks.handlers import enqueue_task from modularodm import signals @signals.save.connect def log_object_saved(sender, instance, fields_changed, cached_data): abs_url = None if hasattr(instance, 'absolute_api_v2_ur...
Remove logging. It will just break travis.
Remove logging. It will just break travis.
Python
apache-2.0
RomanZWang/osf.io,billyhunt/osf.io,billyhunt/osf.io,DanielSBrown/osf.io,monikagrabowska/osf.io,pattisdr/osf.io,pattisdr/osf.io,brandonPurvis/osf.io,amyshi188/osf.io,icereval/osf.io,KAsante95/osf.io,cslzchen/osf.io,cwisecarver/osf.io,saradbowman/osf.io,RomanZWang/osf.io,mluo613/osf.io,caneruguz/osf.io,GageGaskins/osf.io...
3429a1b543208adf95e60c89477a4219a5a366a3
makesty.py
makesty.py
import re # Input file created from http://astronautweb.co/snippet/font-awesome/ INPUT_FILE = 'htmlfontawesome.txt' OUTPUT_FILE = 'fontawesome.sty' with open(INPUT_FILE) as r, open(OUTPUT_FILE, 'w') as w: for line in r: # Expects to find 'fa-NAME' ending with " name = re.findall(r'fa-[^""]*', line)[0] #...
import re # Input file created from http://astronautweb.co/snippet/font-awesome/ INPUT_FILE = 'htmlfontawesome.txt' OUTPUT_FILE = 'fontawesome.sty' OUTPUT_HEADER = r''' % Identify this package. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{fontawesome}[2014/04/24 v4.0.3 font awesome icons] % Requirements to use. \usepac...
Add header and footer sections to the .sty.
Add header and footer sections to the .sty.
Python
mit
posquit0/latex-fontawesome
f87f2ec4707bcf851e00ff58bbfe43f4d7523606
scripts/dnz-fetch.py
scripts/dnz-fetch.py
import os import math import json from pprint import pprint from pydnz import Dnz dnz = Dnz(os.environ.get('DNZ_KEY')) results = [] def dnz_request(page=1): filters = { 'category': ['Images'], 'year': ['2005+TO+2006'] } fields = ['id', 'date'] return dnz.search('', _and=filters, per...
import os # import math import json from pprint import pprint from datetime import date from pydnz import Dnz dnz_api = Dnz(os.environ.get('DNZ_KEY')) YEAR_INTERVAL = 10 def request_dnz_records(timespan, page): parameters = { '_and': { 'category': ['Images'], 'year': [timespan] ...
Refactor DNZ fetch script before overhaul
Refactor DNZ fetch script before overhaul
Python
mit
judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday,judsonsam/tekautoday
be5541bd16a84c37b973cf77cb0f4d5c5e83e39a
spacy/tests/regression/test_issue768.py
spacy/tests/regression/test_issue768.py
# coding: utf-8 from __future__ import unicode_literals from ...language import Language from ...attrs import LANG from ...fr.language_data import get_tokenizer_exceptions, STOP_WORDS from ...language_data.punctuation import TOKENIZER_INFIXES, ALPHA import pytest @pytest.fixture def fr_tokenizer_w_infix(): SPLI...
# coding: utf-8 from __future__ import unicode_literals from ...language import Language from ...attrs import LANG from ...fr.stop_words import STOP_WORDS from ...fr.tokenizer_exceptions import TOKENIZER_EXCEPTIONS from ...language_data.punctuation import TOKENIZER_INFIXES, ALPHA from ...util import update_exc import...
Fix import and tokenizer exceptions
Fix import and tokenizer exceptions
Python
mit
explosion/spaCy,honnibal/spaCy,recognai/spaCy,explosion/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,recognai/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,spacy-io/spaCy,explosion/s...
99ef8377b5bf540542efe718a4eb4345a4b4d5a4
drf_writable_nested/__init__.py
drf_writable_nested/__init__.py
__title__ = 'DRF writable nested' __version__ = '0.4.3' __author__ = 'beda.software' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2014-2018 beda.software' # Version synonym VERSION = __version__ from .mixins import NestedUpdateMixin, NestedCreateMixin from .serializers import WritableNestedModelSerializer...
__title__ = 'DRF writable nested' __version__ = '0.4.3' __author__ = 'beda.software' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2014-2018 beda.software' # Version synonym VERSION = __version__ from .mixins import NestedUpdateMixin, NestedCreateMixin, UniqueFieldsMixin from .serializers import WritableNe...
Add UniqueMixin import to init
Add UniqueMixin import to init
Python
bsd-2-clause
Brogency/drf-writable-nested
a80b95f64a17c4bc5c506313fe94e66b4ad2e836
cyclonejet/__init__.py
cyclonejet/__init__.py
# -*- encoding:utf-8 -*- from flask import Flask from cyclonejet.views.frontend import frontend from flaskext.sqlalchemy import SQLAlchemy import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI app.register_module(frontend) db = SQLAlchemy(app)
# -*- encoding:utf-8 -*- from flask import Flask, render_template from cyclonejet.views.frontend import frontend from cyclonejet.views.errors import errors from flaskext.sqlalchemy import SQLAlchemy import settings app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI #Blueprint registration...
Switch to Blueprints, custom 404 handler.
Switch to Blueprints, custom 404 handler.
Python
agpl-3.0
tsoporan/cyclonejet
0fa9458e876f8361ac79f66b4cb0a845e3eb740d
src/fastpbkdf2/__init__.py
src/fastpbkdf2/__init__.py
from __future__ import absolute_import, division, print_function from fastpbkdf2._fastpbkdf2 import ffi, lib def pbkdf2_hmac(name, password, salt, rounds, dklen=None): if name not in ["sha1", "sha256", "sha512"]: raise ValueError( "Algorithm {} not supported. " "Please use sha1, s...
from __future__ import absolute_import, division, print_function from fastpbkdf2._fastpbkdf2 import ffi, lib def pbkdf2_hmac(name, password, salt, rounds, dklen=None): if name not in ["sha1", "sha256", "sha512"]: raise ValueError("unsupported hash type") algorithm = { "sha1": (lib.fastpbkdf2...
Change exception message to be same as stdlib.
Change exception message to be same as stdlib.
Python
apache-2.0
Ayrx/python-fastpbkdf2,Ayrx/python-fastpbkdf2
32b51cb7d63d9d122c0d678a46d56a735a9bea3e
dodo_commands/framework/decorator_scope.py
dodo_commands/framework/decorator_scope.py
from dodo_commands.framework.singleton import Dodo # Resp: add the current command_name # to the list of commands decorated by decorator_name. class DecoratorScope: def __init__(self, decorator_name): self.decorators = Dodo.get_config('/ROOT').setdefault( 'decorators', {}).setdefault(decorator...
from dodo_commands.framework.singleton import Dodo # Resp: add the current command_name # to the list of commands decorated by decorator_name. class DecoratorScope: def __init__(self, decorator_name, remove=False): self.decorators = Dodo.get_config('/ROOT').setdefault( 'decorators', {}).setdef...
Add ``remove`` flag to DecoratorScope
Add ``remove`` flag to DecoratorScope
Python
mit
mnieber/dodo_commands
866b55d9160d274772aa796946492549eea6ca17
tests/asttools/test_compiler.py
tests/asttools/test_compiler.py
"""Test suite for asttools.compiler.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import pytest from pycc.asttools import parse from pycc.asttools import compiler source = """ x = True for y in range(10): ...
"""Test suite for asttools.compiler.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import pytest from pycc import pycompat from pycc.asttools import parse from pycc.asttools import compiler source = """ x = Tru...
Add a skiptest to support PY34 testing
Add a skiptest to support PY34 testing The third party astkit library does not yet support the latest PY34 changes to the ast module. Until this is resolved the PY34 tests will skip any use of that library. Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
Python
apache-2.0
kevinconway/pycc,kevinconway/pycc
6ec7465b5ec96b44e82cae9db58d6529e60ff920
tests/linters/test_lint_nwod.py
tests/linters/test_lint_nwod.py
import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Has Virtue.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(char_file.read()) assert 'Missing virtue' not in problem...
"""Tests the helpers for linting generic nwod characters""" import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Has Virtue.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(cha...
Add doc comment to nwod lint tests
Add doc comment to nwod lint tests
Python
mit
aurule/npc,aurule/npc
65c347af4bb75154390744b53d6f2e0c75948f6b
src/proposals/admin.py
src/proposals/admin.py
from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from import_export.admin import ExportMixin from .models import AdditionalSpeaker, TalkProposal, TutorialProposal from .resources import TalkProposalResource class AdditionalSpeakerInline(GenericTabularInline): m...
from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from import_export.admin import ExportMixin from .models import AdditionalSpeaker, TalkProposal, TutorialProposal from .resources import TalkProposalResource class AdditionalSpeakerInline(GenericTabularInline): m...
Make ProposalAdmin work when creating
Make ProposalAdmin work when creating
Python
mit
pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016
77179ef9375640eb300171e5bd38e68b999f9daf
monitor.py
monitor.py
import re from subprocess import Popen, PIPE, STDOUT from sys import stdout p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE, stderr=STDOUT, bufsize=1) c = re.compile(r'KERNEL\[[^]]*\]\s*add\s*(?P<dev_path>\S*)\s*\(block\)') for line in iter(p.stdout.readline, b''): m = c.match(lin...
from __future__ import unicode_literals import re from subprocess import Popen, PIPE, STDOUT from sys import stdout from time import sleep bit_bucket = open('/dev/null', 'w') monitor_p = Popen(('stdbuf', '-oL', 'udevadm', 'monitor', '-k'), stdout=PIPE, stderr=PIPE, bufsize=1) block_add_pattern = re.com...
Handle removal; keep track of devices and info
Handle removal; keep track of devices and info
Python
mit
drkitty/arise
aa092529bb643eabae45ae051ecd99d6bebb88ea
src/som/vmobjects/abstract_object.py
src/som/vmobjects/abstract_object.py
class AbstractObject(object): def __init__(self): pass def send(self, frame, selector_string, arguments, universe): # Turn the selector string into a selector selector = universe.symbol_for(selector_string) invokable = self.get_class(universe).lookup_invokable(selec...
class AbstractObject(object): def __init__(self): pass def send(self, frame, selector_string, arguments, universe): # Turn the selector string into a selector selector = universe.symbol_for(selector_string) invokable = self.get_class(universe).lookup_invokable(selec...
Send methods need to return the result
Send methods need to return the result Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
Python
mit
smarr/RTruffleSOM,SOM-st/PySOM,SOM-st/RPySOM,smarr/PySOM,SOM-st/RTruffleSOM,SOM-st/RPySOM,SOM-st/RTruffleSOM,SOM-st/PySOM,smarr/RTruffleSOM,smarr/PySOM
539f0c6626f4ec18a0995f90727425748a5eaee9
migrations/versions/2f3192e76e5_.py
migrations/versions/2f3192e76e5_.py
"""empty message Revision ID: 2f3192e76e5 Revises: 3dbc20af3c9 Create Date: 2015-11-24 15:28:41.695124 """ # revision identifiers, used by Alembic. revision = '2f3192e76e5' down_revision = '3dbc20af3c9' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto gen...
"""empty message Revision ID: 2f3192e76e5 Revises: 3dbc20af3c9 Create Date: 2015-11-24 15:28:41.695124 """ # revision identifiers, used by Alembic. revision = '2f3192e76e5' down_revision = '3dbc20af3c9' from alembic import op import sqlalchemy as sa import sqlalchemy_utils from sqlalchemy_searchable import sync_tri...
Add sync trigger to latest migration
Add sync trigger to latest migration
Python
mit
Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary
0821e31867bac4704248a63d846c9e5fc0377ac3
storage/test_driver.py
storage/test_driver.py
#!/usr/bin/env python from storage import Storage NEW_REPORT = {'foo': 'bar', 'boo': 'baz'} def main(): db_store = Storage.get_storage() for key, value in db_store.__dict__.iteritems(): print '%s: %s' % (key, value) print '\n' # report_id = db_store.store(NEW_REPORT) report_id = 'AVM0dGO...
#!/usr/bin/env python from storage import Storage NEW_REPORT = {'foo': 'bar', 'boo': 'baz'} REPORTS = [ {'report_id': 1, 'report': {"/tmp/example": {"MD5": "53f43f9591749b8cae536ff13e48d6de", "SHA256": "815d310bdbc8684c1163b62f583dbaffb2df74b9104e2aadabf8f8491bafab66", "libmagic": "ASCII text"}}}, {'report_id...
Add populate es function to test driver
Add populate es function to test driver
Python
mpl-2.0
MITRECND/multiscanner,awest1339/multiscanner,mitre/multiscanner,awest1339/multiscanner,awest1339/multiscanner,jmlong1027/multiscanner,jmlong1027/multiscanner,jmlong1027/multiscanner,mitre/multiscanner,awest1339/multiscanner,MITRECND/multiscanner,mitre/multiscanner,jmlong1027/multiscanner
bdcb57264574fdfa5af33bdaae1654fd3f008ed5
app/conf/celeryschedule.py
app/conf/celeryschedule.py
from datetime import timedelta CELERYBEAT_SCHEDULE = { "reddit-validations": { "task": "reddit.tasks.process_validations", "schedule": timedelta(minutes=10), }, "eveapi-update": { "task": "eve_api.tasks.account.queue_apikey_updates", "schedule": timedelta(minutes=10), },...
from datetime import timedelta CELERYBEAT_SCHEDULE = { "reddit-validations": { "task": "reddit.tasks.process_validations", "schedule": timedelta(minutes=10), }, "eveapi-update": { "task": "eve_api.tasks.account.queue_apikey_updates", "schedule": timedelta(minutes=10), },...
Add the blacklist checking to the bulk
Add the blacklist checking to the bulk
Python
bsd-3-clause
nikdoof/test-auth