commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
a27d3f76f194a9767022e37c83d5d18861552cfd
all-domains/tutorials/cracking-the-coding-interview/linked-lists-detect-a-cycle/solution.py
all-domains/tutorials/cracking-the-coding-interview/linked-lists-detect-a-cycle/solution.py
# https://www.hackerrank.com/challenges/ctci-linked-list-cycle # Python 3 """ Detect a cycle in a linked list. Note that the head pointer may be 'None' if the list is empty. A Node is defined as: class Node(object): def __init__(self, data = None, next_node = None): self.data = data ...
# https://www.hackerrank.com/challenges/ctci-linked-list-cycle # Python 3 """ Detect a cycle in a linked list. Note that the head pointer may be 'None' if the list is empty. A Node is defined as: class Node(object): def __init__(self, data = None, next_node = None): self.data = data ...
Solve problem to detect linked list cycle
Solve problem to detect linked list cycle https://www.hackerrank.com/challenges/ctci-linked-list-cycle
Python
mit
arvinsim/hackerrank-solutions
--- +++ @@ -13,13 +13,17 @@ """ def has_cycle(node): - if hasattr(node, 'visited'): - return True - node.visited = True + c = node + n = node.next - if node.next is None: - return False - return has_cycle(node.next) + while n is not None: + if hasattr(c, 'visited'): + ...
0be3b5bf33a3e0254297eda664c85fd249bce2fe
amostra/tests/test_jsonschema.py
amostra/tests/test_jsonschema.py
import hypothesis_jsonschema from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st from amostra.utils import load_schema sample_dict = load_schema("sample.json") # Pop uuid and revision cause they are created automatically sample_dict['properties'].pop('uuid') sample_dict['proper...
from operator import itemgetter import hypothesis_jsonschema from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st from amostra.utils import load_schema sample_dict = load_schema("sample.json") # Pop uuid and revision cause they are created automatically sample_dict['properties'...
Use itemgetter instead of lambda
TST: Use itemgetter instead of lambda
Python
bsd-3-clause
NSLS-II/amostra
--- +++ @@ -1,3 +1,5 @@ +from operator import itemgetter + import hypothesis_jsonschema from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st @@ -20,8 +22,8 @@ st_container = hypothesis_jsonschema.from_schema(container_dict) -@given(samples_list=st.lists(st_sample, unique...
d0ac312de9b48a78f92f9eb09e048131578483f5
giles/utils.py
giles/utils.py
# Giles: utils.py # Copyright 2012 Phil Bordelon # # 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 progra...
# Giles: utils.py # Copyright 2012 Phil Bordelon # # 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 progra...
Add my classic Struct "class."
Add my classic Struct "class." That's right, I embrace the lazy.
Python
agpl-3.0
sunfall/giles
--- +++ @@ -13,6 +13,10 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. + +class Struct(object): + # Empty class, useful for making "structs." + pass def booleanize(msg): # This returns:
b26ce5b5ff778208314bfd21014f88ee24917d7a
ideas/views.py
ideas/views.py
from .models import Idea from .serializers import IdeaSerializer from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response @api_view(['GET',]) def idea_list(request): if request.method == 'GET': ideas = Idea.objects.all() serialize...
from .models import Idea from .serializers import IdeaSerializer from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response @api_view(['GET',]) def idea_list(request): if request.method == 'GET': ideas = Idea.objects.all() serialize...
Add GET for idea and refactor vote
Add GET for idea and refactor vote
Python
mit
neosergio/vote_hackatrix_backend
--- +++ @@ -12,6 +12,13 @@ return Response(serializer.data, status=status.HTTP_200_OK) @api_view(['GET',]) +def idea(request, pk): + if request.method == 'GET': + idea = Idea.objects.get(pk=pk) + serializer = IdeaSerializer(idea) + return Response(serializer.data, status=status.HTT...
6464c3ed7481e347dc6ca93ccfcad6964456e769
manage.py
manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "capomastro.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
#!/usr/bin/env python import os import sys # This bootstraps the virtualenv so that the system Python can use it app_root = os.path.dirname(os.path.realpath(__file__)) activate_this = os.path.join(app_root, 'bin', 'activate_this.py') execfile(activate_this, dict(__file__=activate_this)) if __name__ == "__main__": ...
Add temporary bootstrapping to get the service working with how the charm presently expects to run the app.
Add temporary bootstrapping to get the service working with how the charm presently expects to run the app.
Python
mit
timrchavez/capomastro,timrchavez/capomastro
--- +++ @@ -1,6 +1,12 @@ #!/usr/bin/env python import os import sys + + +# This bootstraps the virtualenv so that the system Python can use it +app_root = os.path.dirname(os.path.realpath(__file__)) +activate_this = os.path.join(app_root, 'bin', 'activate_this.py') +execfile(activate_this, dict(__file__=activate_t...
8318bae21bd5cb716a4cbf2cd2dfe46ea8cadbcf
manage.py
manage.py
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'base.settings') os.environ.setdefault('DJANGO_CONFIGURATION', 'Development') import dotenv dotenv.read_dotenv('.env') from configurations.management import execute_from_command_...
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'base.settings') os.environ.setdefault('DJANGO_CONFIGURATION', 'Development') if os.environ['DJANGO_CONFIGURATION'] == 'Development': import dotenv dotenv.read_dotenv('.en...
Hide .env behind a development environment.
Hide .env behind a development environment.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
--- +++ @@ -7,8 +7,9 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'base.settings') os.environ.setdefault('DJANGO_CONFIGURATION', 'Development') - import dotenv - dotenv.read_dotenv('.env') + if os.environ['DJANGO_CONFIGURATION'] == 'Development': + import dotenv + dotenv.read_...
e9c7b17ccd9709eb90f38bec9d59c48dc6f793b2
calico_containers/tests/st/utils.py
calico_containers/tests/st/utils.py
import sh from sh import docker def get_ip(): """Return a string of the IP of the hosts eth0 interface.""" intf = sh.ifconfig.eth0() return sh.perl(intf, "-ne", 's/dr:(\S+)/print $1/e') def cleanup_inside(name): """ Clean the inside of a container by deleting the containers and images within it....
import sh from sh import docker import socket def get_ip(): """Return a string of the IP of the hosts eth0 interface.""" s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) ip = s.getsockname()[0] s.close() return ip def cleanup_inside(name): """ Clean the...
Use socket connection to get own IP.
Use socket connection to get own IP. Former-commit-id: ebec31105582235c8aa74e9bbfd608b9bf103ad1
Python
apache-2.0
robbrockbank/libcalico,tomdee/libnetwork-plugin,TrimBiggs/libcalico,plwhite/libcalico,tomdee/libcalico,projectcalico/libnetwork-plugin,L-MA/libcalico,projectcalico/libcalico,djosborne/libcalico,Symmetric/libcalico,TrimBiggs/libnetwork-plugin,alexhersh/libcalico,insequent/libcalico,caseydavenport/libcalico,TrimBiggs/lib...
--- +++ @@ -1,11 +1,15 @@ import sh from sh import docker +import socket def get_ip(): """Return a string of the IP of the hosts eth0 interface.""" - intf = sh.ifconfig.eth0() - return sh.perl(intf, "-ne", 's/dr:(\S+)/print $1/e') + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.conn...
4a827bfff24758677e9c1d9d3b186fc14f23e0bb
lib/oeqa/runtime/cases/parselogs_rpi.py
lib/oeqa/runtime/cases/parselogs_rpi.py
from oeqa.runtime.cases.parselogs import * rpi_errors = [ 'bcmgenet fd580000.genet: failed to get enet-eee clock', 'bcmgenet fd580000.genet: failed to get enet-wol clock', 'bcmgenet fd580000.genet: failed to get enet clock', 'bcmgenet fd580000.ethernet: failed to get enet-eee clock', 'bcmgenet fd58...
from oeqa.runtime.cases.parselogs import * rpi_errors = [ ] ignore_errors['raspberrypi4'] = rpi_errors + common_errors ignore_errors['raspberrypi4-64'] = rpi_errors + common_errors ignore_errors['raspberrypi3'] = rpi_errors + common_errors ignore_errors['raspberrypi3-64'] = rpi_errors + common_errors class ParseLogs...
Update the error regexps to 5.10 kernel
parselogs: Update the error regexps to 5.10 kernel The old messages are no longer necessary Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com>
Python
mit
agherzan/meta-raspberrypi,agherzan/meta-raspberrypi,agherzan/meta-raspberrypi,agherzan/meta-raspberrypi,agherzan/meta-raspberrypi,agherzan/meta-raspberrypi
--- +++ @@ -1,12 +1,6 @@ from oeqa.runtime.cases.parselogs import * rpi_errors = [ - 'bcmgenet fd580000.genet: failed to get enet-eee clock', - 'bcmgenet fd580000.genet: failed to get enet-wol clock', - 'bcmgenet fd580000.genet: failed to get enet clock', - 'bcmgenet fd580000.ethernet: failed to get e...
b1781b8c82979ee3765197084a9c8e372cb68cf8
jazzband/hooks.py
jazzband/hooks.py
import json import uuid from flask_hookserver import Hooks from .db import redis from .members.models import User from .projects.tasks import update_project_by_hook from .tasks import spinach hooks = Hooks() @hooks.hook("ping") def ping(data, guid): return "pong" @hooks.hook("membership") def membership(dat...
import json import uuid from flask_hookserver import Hooks from .db import redis from .members.models import User from .projects.tasks import update_project_by_hook from .tasks import spinach hooks = Hooks() @hooks.hook("ping") def ping(data, guid): return "pong" @hooks.hook("membership") def membership(dat...
Use new (?) repository transferred hook.
Use new (?) repository transferred hook.
Python
mit
jazzband/jazzband-site,jazzband/website,jazzband/website,jazzband/website,jazzband/website,jazzband/site,jazzband/jazzband-site,jazzband/site
--- +++ @@ -33,10 +33,10 @@ return "Thanks" -@hooks.hook("member") -def member(data, guid): +@hooks.hook("repository") +def repository(data, guid): # only if the action is to add a member and if there is repo data - if data.get("action") == "added" and "repository" in data: + if data.get("action")...
6e6c60613180bb3d7e2d019129e57d1a2c33286d
backend/backend/models.py
backend/backend/models.py
from django.db import models class Animal(models.Model): MALE = 'male' FEMALE = 'female' GENDER_CHOICES = ((MALE, 'Male'), (FEMALE, 'Female')) father = models.ForeignKey("self", null = True, on_delete = models.SET_NULL, related_name = "child_father") mother = models.ForeignKey("self", null = True...
from django.db import models from django.core.validators import MaxValueValidator, MaxLengthValidator from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from datetime import datetime def current_year(): return datetime.now().year class Animal(models.Model): ...
Add length validator to name. Add dob validator can't be higher than current year.
Add length validator to name. Add dob validator can't be higher than current year.
Python
apache-2.0
mmlado/animal_pairing,mmlado/animal_pairing
--- +++ @@ -1,4 +1,11 @@ from django.db import models +from django.core.validators import MaxValueValidator, MaxLengthValidator +from django.core.exceptions import ValidationError +from django.utils.translation import gettext_lazy as _ +from datetime import datetime + +def current_year(): + return datetime.now()....
a1897464b7974589723790f946fed0c1a5bdb475
chef/fabric.py
chef/fabric.py
from chef import Search from chef.api import ChefAPI, autoconfigure from chef.exceptions import ChefError class Roledef(object): def __init__(self, name, api, hostname_attr): self.name = name self.api = api self.hostname_attr = hostname_attr def __call__(self): for row in Searc...
from chef import Search from chef.api import ChefAPI, autoconfigure from chef.exceptions import ChefError class Roledef(object): def __init__(self, name, api, hostname_attr): self.name = name self.api = api self.hostname_attr = hostname_attr def __call__(self): for row in Searc...
Work around when fqdn is not defined for a node.
Work around when fqdn is not defined for a node.
Python
apache-2.0
Scalr/pychef,jarosser06/pychef,cread/pychef,coderanger/pychef,Scalr/pychef,jarosser06/pychef,dipakvwarade/pychef,dipakvwarade/pychef,coderanger/pychef,cread/pychef
--- +++ @@ -6,13 +6,16 @@ def __init__(self, name, api, hostname_attr): self.name = name self.api = api - self.hostname_attr = hostname_attr - - + self.hostname_attr = hostname_attr + def __call__(self): - for row in Search('node', 'roles:'+self.name, api=self.api): - ...
1ce39741886cdce69e3801a1d0afb25c39a8b844
fitbit/models.py
fitbit/models.py
from django.contrib.auth.models import User from django.db import models class Token(models.Model): fitbit_id = models.CharField(max_length=50) refresh_token = models.CharField(max_length=120)
from django.contrib.auth.models import User from django.db import models class Token(models.Model): fitbit_id = models.CharField(max_length=50) refresh_token = models.CharField(max_length=120) def __repr__(self): return '<Token %s>' % self.fitbit_id def __str__(self): return self.fit...
Add repr and str to our token model
Add repr and str to our token model
Python
apache-2.0
Bachmann1234/fitbitSlackBot,Bachmann1234/fitbitSlackBot
--- +++ @@ -5,3 +5,9 @@ class Token(models.Model): fitbit_id = models.CharField(max_length=50) refresh_token = models.CharField(max_length=120) + + def __repr__(self): + return '<Token %s>' % self.fitbit_id + + def __str__(self): + return self.fitbit_id
9c3514c83404e12b51c6f78cd4472eb1b7bd9fd0
pysagec/client.py
pysagec/client.py
from urllib.request import Request, urlopen from .renderers import XMLRenderer class Client: def __init__(self, hostname, auth_info): self.base_url = 'http://{}/MRWEnvio.asmx'.format(hostname) self.auth_info = auth_info self.renderer = XMLRenderer() def make_http_request(self, pickup...
from urllib.request import Request, urlopen from .renderers import XMLRenderer class Client: def __init__(self, hostname, auth_info): self.base_url = 'http://{}/MRWEnvio.asmx'.format(hostname) self.auth_info = auth_info self.renderer = XMLRenderer() def make_http_request(self, pickup...
Use a list for main elements
Use a list for main elements
Python
mit
migonzalvar/pysagec
--- +++ @@ -10,17 +10,17 @@ self.renderer = XMLRenderer() def make_http_request(self, pickup_info, service_info): - data = { - 'soap:Header': self.auth_info.as_dict(), - 'soap:Body': { + data = [ + {'soap:Header': self.auth_info.as_dict()}, + {...
0420ed666f8a2cd5cd6c2055b13a5d26cc5d3792
output.py
output.py
def summarizeECG(instHR, avgHR, brady, tachy): """Create txt file summarizing ECG analysis :param instHR: (int) :param avgHR: (int) :param brady: (int) :param tachy: (int) """ #Calls hrdetector() to get instantaneous heart rate #instHR = findInstHR() #Calls findAvgHR() to get averag...
def summarizeECG(instHR, avgHR, brady, tachy): """Create txt file summarizing ECG analysis :param instHR: (int) :param avgHR: (int) :param brady: (int) :param tachy: (int) """ #Calls hrdetector() to get instantaneous heart rate #instHR = findInstHR() #Calls findAvgHR() to get averag...
Add units to brady and tachy strings.
Add units to brady and tachy strings.
Python
mit
raspearsy/bme590hrm
--- +++ @@ -22,5 +22,5 @@ bradystr = "Bradycardia occurred at: %s" % str(brady) tachystr = "Tachycardia occurred at: %s" % str(tachy) - ecgResults.write(instHRstr + ' BPM\n' + avgHRstr + ' BPM\n' + bradystr + '\n' + tachystr) + ecgResults.write(instHRstr + ' BPM\n' + avgHRstr + ' BPM\n' + bradystr +...
93f9bb4115c4259dd38962229947b87e952a25a7
completion/levenshtein.py
completion/levenshtein.py
def levenshtein(s1, s2): if len(s1) < len(s2): return levenshtein(s2, s1) # len(s1) >= len(s2) if len(s2) == 0: return len(s1) previous_row = range(len(s2) + 1) for i, c1 in enumerate(s1): current_row = [i + 1] for j, c2 in enumerate(s2): insertions = pr...
def levenshtein(top_string, bot_string): if len(top_string) < len(bot_string): return levenshtein(bot_string, top_string) # len(s1) >= len(s2) if len(bot_string) == 0: return len(top_string) previous_row = range(len(bot_string) + 1) for i, top_char in enumerate(top_string): ...
Use better variable names for algorithmic determination
Use better variable names for algorithmic determination
Python
mit
thatsIch/sublime-rainmeter
--- +++ @@ -1,18 +1,18 @@ -def levenshtein(s1, s2): - if len(s1) < len(s2): - return levenshtein(s2, s1) +def levenshtein(top_string, bot_string): + if len(top_string) < len(bot_string): + return levenshtein(bot_string, top_string) # len(s1) >= len(s2) - if len(s2) == 0: - return ...
d6461896dec112caad81490e1a6d055a3d4c9a95
db.py
db.py
"""Handles database connection, and all that fun stuff. @package ppbot """ from pymongo import MongoClient from settings import * client = MongoClient(MONGO_HOST, MONGO_PORT) db = client[MONGO_DB]
"""Handles database connection, and all that fun stuff. Adds a wrapper to pymongo. @package ppbot """ from pymongo import mongo_client from pymongo import database from pymongo import collection from settings import * class ModuleMongoClient(mongo_client.MongoClient): def __getattr__(self, name): attr =...
Add custom wrapper code to pymongo for Modules
Add custom wrapper code to pymongo for Modules
Python
mit
billyvg/piebot
--- +++ @@ -1,10 +1,37 @@ """Handles database connection, and all that fun stuff. +Adds a wrapper to pymongo. + @package ppbot """ -from pymongo import MongoClient +from pymongo import mongo_client +from pymongo import database +from pymongo import collection from settings import * -client = MongoClient(MON...
e87ac65b42b6390cee835deb180fc6cd2a814082
invocations/checks.py
invocations/checks.py
""" Tasks for common project sanity-checking such as linting or type checking. """ from __future__ import unicode_literals from invoke import task @task(name="blacken", iterable=["folder"]) def blacken(c, line_length=79, folder=None, check=False): """ Run black on the current source tree (all ``.py`` files)...
""" Tasks for common project sanity-checking such as linting or type checking. """ from __future__ import unicode_literals from invoke import task @task(name="blacken", iterable=["folder"]) def blacken(c, line_length=79, folder=None, check=False, diff=False): """ Run black on the current source tree (all ``...
Add diff option to blacken and document params
Add diff option to blacken and document params
Python
bsd-2-clause
pyinvoke/invocations
--- +++ @@ -8,13 +8,24 @@ @task(name="blacken", iterable=["folder"]) -def blacken(c, line_length=79, folder=None, check=False): +def blacken(c, line_length=79, folder=None, check=False, diff=False): """ Run black on the current source tree (all ``.py`` files). .. warning:: ``black`` onl...
2e6445bfda12e470fdc5c0b6aa725fd344c863f1
drake/bindings/python/pydrake/test/testRBTCoM.py
drake/bindings/python/pydrake/test/testRBTCoM.py
from __future__ import print_function import unittest import numpy as np import pydrake import os.path class TestRBTCoM(unittest.TestCase): def testCoM0(self): r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))...
from __future__ import print_function import unittest import numpy as np import pydrake import os.path class TestRBTCoM(unittest.TestCase): def testCoM0(self): r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))...
Test CoM Jacobian with random configuration for shape, and then with 0 configuration for values
Test CoM Jacobian with random configuration for shape, and then with 0 configuration for values
Python
bsd-3-clause
billhoffman/drake,billhoffman/drake,sheim/drake,sheim/drake,sheim/drake,sheim/drake,billhoffman/drake,billhoffman/drake,billhoffman/drake,sheim/drake,sheim/drake,sheim/drake,billhoffman/drake,billhoffman/drake,sheim/drake,billhoffman/drake
--- +++ @@ -23,6 +23,16 @@ kinsol = r.doKinematics(q, np.zeros((7, 1))) J = r.centerOfMassJacobian(kinsol) + self.assertTrue(np.shape(J) == (3, 7)) + + q = r.getZeroConfiguration() + kinsol = r.doKinematics(q, np.zeros((7, 1))) + J = r.centerOfMassJacobian(kinsol) + + ...
e30629cba2bf09cf83e8e424a203793a5baf9b43
remote.py
remote.py
import sublime, sublime_plugin
import sublime, sublime_plugin class DiffListener(sublime_plugin.EventListener): """Listens for modifications to the view and gets the diffs using Operational Transformation""" def __init___(self): self.buffer = None self.last_buffer = None def on_modified_async(self, view): """Li...
Add a bunch of mostly-empty method stubs.
Add a bunch of mostly-empty method stubs.
Python
mit
TeamRemote/remote-sublime,TeamRemote/remote-sublime
--- +++ @@ -1 +1,42 @@ import sublime, sublime_plugin + +class DiffListener(sublime_plugin.EventListener): + """Listens for modifications to the view and gets the diffs using Operational Transformation""" + + def __init___(self): + self.buffer = None + self.last_buffer = None + + def on_modifi...
6bbbc74ea4acda000c115d08801d2f6c677401da
lmod/__init__.py
lmod/__init__.py
import os from subprocess import Popen, PIPE LMOD_CMD = os.environ['LMOD_CMD'] LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '') def module(command, arguments=()): cmd = [LMOD_CMD, 'python', '--terse', command] cmd.extend(arguments) result = Popen(cmd, stdout=PIPE, stderr=PIPE) if command in ...
from os import environ from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, arguments=()): cmd = [environ['LMOD_CMD'], 'python', '--terse', command] cmd.extend(arguments) result = Popen(cmd, stdout=PIPE, stderr=PIPE) if command in ('load', 'unl...
Remove LMOD_CMD global from module scope
Remove LMOD_CMD global from module scope Declaring the variable at the module level could cause problem when installing and enabling the extension when Lmod was not activated.
Python
mit
cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod
--- +++ @@ -1,11 +1,10 @@ -import os +from os import environ from subprocess import Popen, PIPE -LMOD_CMD = os.environ['LMOD_CMD'] -LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '') +LMOD_SYSTEM_NAME = environ.get('LMOD_SYSTEM_NAME', '') def module(command, arguments=()): - cmd = [LMOD_CMD, 'python',...
bb42fe14165806caf8a2386c49cb602dbf9ad391
connectionless_service.py
connectionless_service.py
""" A Simple example for testing the SimpleServer Class. A simple connectionless server. It is for studying purposes only. """ from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "facundovt@gmail.com" def handle_message(sockets=None): """ Handle a simple UDP...
""" A Simple example for testing the SimpleServer Class. A simple connectionless server. It is for studying purposes only. """ from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "facundovt@gmail.com" def handle_message(sockets=None): """ Handle a simple UDP...
Fix python 2.4 connectionless service
Fix python 2.4 connectionless service
Python
mit
facundovictor/non-blocking-socket-samples
--- +++ @@ -22,8 +22,8 @@ (data, address) = readable.recvfrom(1024) print('Received data: %s from %s' % (data, address)) if data: - print('Sending a custom ACK to the client %s \ - '.format(address)) + pr...
8fba76340daef349c45946183757ef463004492b
tests/unit/test_spec_set.py
tests/unit/test_spec_set.py
import unittest class TestSpecSet(unittest.TestCase): pass
import unittest from piptools.datastructures import SpecSet, Spec class TestSpecSet(unittest.TestCase): def test_adding_specs(self): """Adding specs to a set.""" specset = SpecSet() specset.add_spec(Spec.from_line('Django>=1.3')) assert 'Django>=1.3' in map(str, specset) ...
Add test cases for testing SpecSet.
Add test cases for testing SpecSet.
Python
bsd-2-clause
suutari-ai/prequ,suutari/prequ,suutari/prequ
--- +++ @@ -1,5 +1,34 @@ import unittest +from piptools.datastructures import SpecSet, Spec class TestSpecSet(unittest.TestCase): - pass + def test_adding_specs(self): + """Adding specs to a set.""" + specset = SpecSet() + + specset.add_spec(Spec.from_line('Django>=1.3')) + ass...
fd99ef86dfca50dbd36b2c1a022cf30a0720dbea
scrapy/squeues.py
scrapy/squeues.py
""" Scheduler queues """ import marshal from six.moves import cPickle as pickle from queuelib import queue def _serializable_queue(queue_class, serialize, deserialize): class SerializableQueue(queue_class): def push(self, obj): s = serialize(obj) super(SerializableQueue, self).p...
""" Scheduler queues """ import marshal from six.moves import cPickle as pickle from queuelib import queue def _serializable_queue(queue_class, serialize, deserialize): class SerializableQueue(queue_class): def push(self, obj): s = serialize(obj) super(SerializableQueue, self).p...
Test for AttributeError when pickling objects (Python>=3.5)
Test for AttributeError when pickling objects (Python>=3.5) Same "fix" as in e.g. https://github.com/joblib/joblib/pull/246
Python
bsd-3-clause
YeelerG/scrapy,wenyu1001/scrapy,GregoryVigoTorres/scrapy,crasker/scrapy,jdemaeyer/scrapy,Parlin-Galanodel/scrapy,arush0311/scrapy,Digenis/scrapy,pablohoffman/scrapy,ArturGaspar/scrapy,kmike/scrapy,crasker/scrapy,eLRuLL/scrapy,wujuguang/scrapy,carlosp420/scrapy,darkrho/scrapy-scrapy,redapple/scrapy,carlosp420/scrapy,bar...
--- +++ @@ -25,7 +25,9 @@ def _pickle_serialize(obj): try: return pickle.dumps(obj, protocol=2) - except pickle.PicklingError as e: + # Python>=3.5 raises AttributeError here while + # Python<=3.4 raises pickle.PicklingError + except (pickle.PicklingError, AttributeError) as e: rai...
b639c9f1c615ca73fd49c171344effb3718b2b77
script.py
script.py
import ast import click from graphing.graph import FunctionGrapher from parsing.parser import FileVisitor @click.command() @click.argument('code', type=click.File('rb')) @click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file') @click.option('--remove-bui...
import ast import click from graphing.graph import FunctionGrapher from parsing.parser import FileVisitor @click.command() @click.argument('code', type=click.File('rb')) @click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file') @click.option('--remove-bui...
Add output file type option
Add output file type option
Python
mit
LaurEars/codegrapher
--- +++ @@ -11,7 +11,8 @@ @click.option('--printed', default=False, is_flag=True, help='Pretty prints the call tree for each class in the file') @click.option('--remove-builtins', default=False, is_flag=True, help='Removes builtin functions from call trees') @click.option('--output', help='Graphviz output file nam...
5cb10ce2f8e3b80fc54b5bfd3e60b4240dfed0fd
server.py
server.py
import bottle import waitress import controller import breathe from pytz import timezone from apscheduler.schedulers.background import BackgroundScheduler bottle_app = bottle.app() scheduler = BackgroundScheduler() scheduler.configure(timezone=timezone('US/Pacific')) breather = breathe.Breathe() my_controller = contro...
import bottle import waitress import controller import breathe from pytz import timezone from apscheduler.schedulers.background import BackgroundScheduler bottle_app = bottle.app() scheduler = BackgroundScheduler() scheduler.configure(timezone=timezone('US/Pacific')) breather = breathe.Breathe() my_controller = contro...
Set light timer 1 hr back, 10pm-12am
Set light timer 1 hr back, 10pm-12am
Python
mit
tipsqueal/duwamish-lighthouse,tipsqueal/duwamish-lighthouse,illumenati/duwamish-lighthouse,illumenati/duwamish-lighthouse,YonasBerhe/duwamish-lighthouse
--- +++ @@ -12,15 +12,15 @@ my_controller = controller.Controller(bottle_app, breather) -@scheduler.scheduled_job(trigger='cron', hour=21, minute=0) +@scheduler.scheduled_job(trigger='cron', hour=22, minute=0) def on_job(): - """Start at 9:00pm PT""" + """Start at 10:00pm PT""" print('STARTING BREATH...
14756f5de831832a192a8a453e7e108be7ebcacd
components/includes/utilities.py
components/includes/utilities.py
import random import json import time import SocketExtend as SockExt import config as conf import parser as p def ping(sock): try: rand = random.randint(1, 99999) data = {'request':'ping', 'contents': {'value':rand}} SockExt.send_msg(sock, json.dumps(data)) result = json.loads(SockExt.recv_msg(sock)) if ...
import random import json import time import SocketExtend as SockExt import config as conf import parser as p def ping(sock): try: rand = random.randint(1, 99999) data = {'request':'ping', 'contents': {'value':rand}} SockExt.send_msg(sock, json.dumps(data)) result = json.loads(SockExt.recv_msg(sock)) if ...
Clean up, comments, liveness checking, robust data transfer
Clean up, comments, liveness checking, robust data transfer
Python
bsd-2-clause
mavroudisv/Crux
--- +++ @@ -41,12 +41,10 @@ success = False while (attempted < conf.tries): try: - if utilities.multiping(port, machines): + if multiping(port, machines): success = True - print "hey" break except Exception as e: - print "ouups" time.sleep(1) attempted += 1
6b4e5c731d4545561bcc1bd5f819e88d5a3eea60
djangae/settings_base.py
djangae/settings_base.py
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage' FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 FILE_UPLOAD_HANDLERS = ( 'djangae.storage.BlobstoreFileUploadHandler', 'django.core.files.uploadhandler.MemoryFileUploadHandler', ) DATABASES = { 'default': { 'ENGINE': 'djangae.db.backends.appengin...
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage' FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 FILE_UPLOAD_HANDLERS = ( 'djangae.storage.BlobstoreFileUploadHandler', 'django.core.files.uploadhandler.MemoryFileUploadHandler', ) DATABASES = { 'default': { 'ENGINE': 'djangae.db.backends.appengin...
Set up logging for live environment.
Set up logging for live environment.
Python
bsd-3-clause
martinogden/djangae,wangjun/djangae,martinogden/djangae,stucox/djangae,SiPiggles/djangae,potatolondon/djangae,trik/djangae,martinogden/djangae,kirberich/djangae,grzes/djangae,kirberich/djangae,armirusco/djangae,pablorecio/djangae,b-cannon/my_djae,armirusco/djangae,leekchan/djangae,trik/djangae,stucox/djangae,jscissr/dj...
--- +++ @@ -19,3 +19,27 @@ 'BACKEND': 'djangae.core.cache.backends.AppEngineMemcacheCache' } } + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'filters': { + 'require_debug_false': { + '()': 'django.utils.log.RequireDebugFalse' + } + }, + 'h...
6aa7c86828e230699365b88368070f426a7e2a8c
son-gtklic/app.py
son-gtklic/app.py
import sys import os import json import unittest import xmlrunner from flask import Flask, Response from flask_sqlalchemy import SQLAlchemy from flask_restful import Api from flask_script import Manager, Server, prompt_bool from flask_migrate import Migrate, MigrateCommand app = Flask(__name__) app.config.from_pyfi...
import sys import os import json import unittest import xmlrunner from flask import Flask, Response from flask_sqlalchemy import SQLAlchemy from flask_restful import Api from flask_script import Manager, Server, prompt_bool from flask_migrate import Migrate, MigrateCommand app = Flask(__name__) app.config.from_pyfi...
Fix extra colon in status_code key
Fix extra colon in status_code key
Python
apache-2.0
dang03/son-gkeeper,alfonsoegio/son-gkeeper,felipevicens/son-gkeeper,jbonnet/son-gkeeper,alfonsoegio/son-gkeeper,sonata-nfv/son-gkeeper,jbonnet/son-gkeeper,alfonsoegio/son-gkeeper,jbonnet/son-gkeeper,felipevicens/son-gkeeper,sonata-nfv/son-gkeeper,jbonnet/son-gkeeper,dang03/son-gkeeper,alfonsoegio/son-gkeeper,felipevice...
--- +++ @@ -31,7 +31,7 @@ # Method used to unify responses sintax def build_response(status_code, description="", error="", data=""): - jd = {"status_code:" : status_code, "error": error, "description": description, "data": data} + jd = {"status_code" : status_code, "error": error, "description": descriptio...
f118d1c3cb4752a20329a32d0d49fd9e46280bc3
user/admin.py
user/admin.py
from django.contrib import admin from .models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): # list view list_display = ( 'email', 'is_staff', 'is_superuser') list_filter = ( 'is_staff', 'is_superuser', 'profile__joined') ordering ...
from django.contrib import admin from .models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): # list view list_display = ( 'email', 'get_date_joined', 'is_staff', 'is_superuser') list_filter = ( 'is_staff', 'is_superuser', 'prof...
Add join date to UserAdmin list.
Ch23: Add join date to UserAdmin list.
Python
bsd-2-clause
jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8
--- +++ @@ -8,6 +8,7 @@ # list view list_display = ( 'email', + 'get_date_joined', 'is_staff', 'is_superuser') list_filter = ( @@ -16,3 +17,9 @@ 'profile__joined') ordering = ('email',) search_fields = ('email',) + + def get_date_joined(self, user...
ab191322b245d51df92bed11467512fc92665b1c
nisl/__init__.py
nisl/__init__.py
""" Machine Learning module for NeuroImaging in python ================================================== See http://nisl.github.com for complete documentation. """ """ try: import numpy except ImportError: print 'Numpy could not be found, please install it properly to use nisl.' try: import scipy except...
""" Machine Learning module for NeuroImaging in python ================================================== See http://nisl.github.com for complete documentation. """ """ try: import numpy except ImportError: print 'Numpy could not be found, please install it properly to use nisl.' try: import scipy except...
Change "Sklearn" to "Scikit-learn" in error message
Change "Sklearn" to "Scikit-learn" in error message
Python
bsd-3-clause
abenicho/isvr
--- +++ @@ -19,7 +19,7 @@ try: import sklearn except ImportError: - print 'Sklearn could not be found, please install it properly to use nisl.' + print 'Scikit-learn could not be found, please install it properly to use nisl.' """ try: from numpy.testing import nosetester
0bb7a3d468a70e57bb867678a7649e7ad736d39f
cms/utils/setup.py
cms/utils/setup.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from cms.utils.compat.dj import is_installed as app_is_installed def validate_dependencies(): """ Check for installed apps, their versions and configuration options """ if not app_is_installed('mptt'): ra...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from cms.utils.compat.dj import is_installed as app_is_installed def validate_dependencies(): """ Check for installed apps, their versions and configuration options """ if not app_is_installed('mptt'): ra...
Patch get_models to ensure plugins are properly patched
Patch get_models to ensure plugins are properly patched
Python
bsd-3-clause
robmagee/django-cms,chmberl/django-cms,astagi/django-cms,sephii/django-cms,philippze/django-cms,dhorelik/django-cms,cyberintruder/django-cms,evildmp/django-cms,cyberintruder/django-cms,takeshineshiro/django-cms,netzkolchose/django-cms,saintbird/django-cms,memnonila/django-cms,wuzhihui1123/django-cms,AlexProfi/django-cm...
--- +++ @@ -29,5 +29,15 @@ """ Gather all checks and validations """ + from django.db.models import loading + + def get_models_patched(app_mod=None, include_auto_created=False, + include_deferred=False, only_installed=True): + loading.cache.get_models(app_mod, inc...
7456080d3f8d598728fe7a9ee96884db9e28a869
tests/services/shop/conftest.py
tests/services/shop/conftest.py
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.email import service as email_service from byceps.services.shop.cart.models import Cart from byceps.services.shop.sequence import service as sequence_service from byceps.services.shop...
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.email import service as email_service from byceps.services.shop.cart.models import Cart from byceps.services.shop.sequence import service as sequence_service from byceps.services.shop...
Introduce factory for email config fixture
Introduce factory for email config fixture This allows to create local fixtures that use email config with a broader scope than 'function'.
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
--- +++ @@ -15,14 +15,23 @@ from tests.helpers import create_user_with_detail +@pytest.fixture(scope='session') +def make_email_config(): + + def _wrapper(): + config_id = 'email-config-01' + sender_address = 'info@shop.example' + + email_service.set_config(config_id, sender_address) + + ...
be779b6b7f47750b70afa6f0aeb67b99873e1c98
indico/modules/events/tracks/forms.py
indico/modules/events/tracks/forms.py
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 3 of the # License, or (a...
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 3 of the # License, or (a...
Remove useless field descs, increase rows
Tracks: Remove useless field descs, increase rows
Python
mit
DirkHoffmann/indico,pferreir/indico,OmeGak/indico,indico/indico,mvidalgarcia/indico,mvidalgarcia/indico,indico/indico,OmeGak/indico,DirkHoffmann/indico,mic4ael/indico,mvidalgarcia/indico,OmeGak/indico,indico/indico,OmeGak/indico,indico/indico,ThiefMaster/indico,pferreir/indico,ThiefMaster/indico,ThiefMaster/indico,pfer...
--- +++ @@ -24,6 +24,6 @@ class TrackForm(IndicoForm): - title = StringField(_('Title'), [DataRequired()], description=_('Title of the track')) - code = StringField(_('Code'), description=_('Code for the track')) - description = TextAreaField(_('Description'), description=_('Text describing the track'))...
e47ede85f2001cc5c514951355ded1253b4c45f7
notaro/apps.py
notaro/apps.py
from django.apps import AppConfig from watson import search as watson class NotaroConfig(AppConfig): name = "notaro" verbose_name = "Notizen" def ready(self): NoteModel = self.get_model("Note") watson.register(NoteModel.objects.filter(published=True)) SourceModel = self.get_model...
from django.apps import AppConfig from watson import search as watson class NotaroConfig(AppConfig): name = "notaro" verbose_name = "Notizen" def ready(self): NoteModel = self.get_model("Note") watson.register(NoteModel.objects.filter(published=True)) SourceModel = self.get_model...
Fix watson settings; add search for picture
Fix watson settings; add search for picture
Python
bsd-3-clause
ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio
--- +++ @@ -14,4 +14,7 @@ watson.register(SourceModel.objects.all()) DocumentModel = self.get_model("Document") - watson.register(DocumentModel.objects.all(), exclude=('doc')) + watson.register(DocumentModel.objects.all(), exclude=('doc', 'image')) + + PictureModel = self.get_...
c7efd5976f511200162610612fcd5b6f9b013a54
dciclient/v1/utils.py
dciclient/v1/utils.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Fix TypeError exception when parsing json
Fix TypeError exception when parsing json This change fixes the TypeError exception that is raised when it should not while parsing json File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, en...
Python
apache-2.0
redhat-cip/python-dciclient,redhat-cip/python-dciclient
--- +++ @@ -42,5 +42,7 @@ kwargs['data'] = json.loads(kwargs['data']) except KeyError: pass + except TypeError: + pass return kwargs
d17f72112625d66169098d8cb8fb856e7fd93272
knights/k_tags.py
knights/k_tags.py
import ast from .klass import build_method from .library import Library register = Library() def parse_args(bits): ''' Parse tag bits as if they're function args ''' code = ast.parse('x(%s)' % bits, mode='eval') return code.body.args, code.body.keywords @register.tag(name='block') def block(s...
import ast from .library import Library register = Library() @register.tag(name='block') def block(parser, token): token = token.strip() parser.build_method(token, endnodes=['endblock']) return ast.YieldFrom( value=ast.Call( func=ast.Attribute( value=ast.Name(id='sel...
Update for parser class Add if/else tags
Update for parser class Add if/else tags
Python
mit
funkybob/knights-templater,funkybob/knights-templater
--- +++ @@ -1,25 +1,15 @@ import ast -from .klass import build_method from .library import Library register = Library() -def parse_args(bits): - ''' - Parse tag bits as if they're function args - ''' - code = ast.parse('x(%s)' % bits, mode='eval') - return code.body.args, code.body.keyword...
ed24b2771d80b7043c052e076ae7384f976d92b7
sum-of-multiples/sum_of_multiples.py
sum-of-multiples/sum_of_multiples.py
def sum_of_multiples(limit, factors): return sum(filter(lambda n: n < limit, {f*i for i in range(1, limit) for f in factors}))
def sum_of_multiples(limit, factors): return sum({n for f in factors for n in range(f, limit, f)})
Use more optimal method of getting multiples
Use more optimal method of getting multiples
Python
agpl-3.0
CubicComet/exercism-python-solutions
--- +++ @@ -1,3 +1,2 @@ def sum_of_multiples(limit, factors): - return sum(filter(lambda n: n < limit, - {f*i for i in range(1, limit) for f in factors})) + return sum({n for f in factors for n in range(f, limit, f)})
c468b85ff0278a8f398823adcd2893b28f2e8afe
fair/constants/general.py
fair/constants/general.py
import molwt M_ATMOS = 5.1352e18 # mass of atmosphere, kg # Conversion between ppm CO2 and GtC emissions ppm_gtc = M_ATMOS/1e18*molwt.C/molwt.AIR
from . import molwt M_ATMOS = 5.1352e18 # mass of atmosphere, kg # Conversion between ppm CO2 and GtC emissions ppm_gtc = M_ATMOS/1e18*molwt.C/molwt.AIR
Fix import of molwt in constants
Fix import of molwt in constants
Python
apache-2.0
OMS-NetZero/FAIR
--- +++ @@ -1,4 +1,4 @@ -import molwt +from . import molwt M_ATMOS = 5.1352e18 # mass of atmosphere, kg
7fb7a4f68be4ce23da23914cffc1c5b76fe5fd06
incuna_test_utils/testcases/request.py
incuna_test_utils/testcases/request.py
from django.contrib.auth.models import AnonymousUser from django.test import TestCase, RequestFactory class DummyStorage: def __init__(self): self.store = set() def add(self, level, message, extra_tags=''): self.store.add(message) def __iter__(self): for item in self.store: ...
from django.contrib.auth.models import AnonymousUser from django.test import TestCase, RequestFactory class DummyStorage: def __init__(self): self.store = list() def add(self, level, message, extra_tags=''): self.store.add(message) def __iter__(self): for item in self.store: ...
Use a list for DummyStorage() for ordering.
Use a list for DummyStorage() for ordering.
Python
bsd-2-clause
incuna/incuna-test-utils,incuna/incuna-test-utils
--- +++ @@ -4,7 +4,7 @@ class DummyStorage: def __init__(self): - self.store = set() + self.store = list() def add(self, level, message, extra_tags=''): self.store.add(message)
09a96a308c7666defdc1377e207f9632b9bc9c7a
app.py
app.py
#!flask/bin/python """ Author: Swagger.pro File: app.py Purpose: runs the app! """ from swagip import app app.config.from_object('config') if __name__ == "__main__": app.run(debug=True, host='0.0.0.0')
#!flask/bin/python """ Author: Swagger.pro File: app.py Purpose: runs the app! """ from swagip import app app.config.from_object('config') if __name__ == "__main__": app.run()
Remove debug and all host listener
Remove debug and all host listener
Python
mit
thatarchguy/SwagIP,thatarchguy/SwagIP,thatarchguy/SwagIP
--- +++ @@ -11,4 +11,4 @@ if __name__ == "__main__": - app.run(debug=True, host='0.0.0.0') + app.run()
23747dd111d72995942e9d218fc99ce4ec810266
fingerprint/fingerprint_agent.py
fingerprint/fingerprint_agent.py
class FingerprintAgent(object): def __init__(self, request): self.request = request def detect_server_whorls(self): vars = {} # get cookie enabled if self.request.cookies: vars['cookie_enabled'] = 'Yes' else: vars['cookie_enabled'] = 'No' ...
class FingerprintAgent(object): def __init__(self, request): self.request = request def detect_server_whorls(self): vars = {} # get cookie enabled if self.request.cookies: vars['cookie_enabled'] = 'Yes' else: vars['cookie_enabled'] = 'No' ...
Use unicode strings for 'no javascript' just so it's consistent with browser-retrieved values
Use unicode strings for 'no javascript' just so it's consistent with browser-retrieved values
Python
agpl-3.0
EFForg/panopticlick-python,EFForg/panopticlick-python,EFForg/panopticlick-python,EFForg/panopticlick-python
--- +++ @@ -24,16 +24,16 @@ vars['dnt_enabled'] = (self._get_header('DNT') != "") # these are dummies: - vars['plugins'] = "no javascript" - vars['video'] = "no javascript" - vars['timezone'] = "no javascript" - vars['fonts'] = "no javascript" - vars['supercookie...
ea8a78cb7d7cda7b597826a478cce3ab4b0a4b62
django_nose_plugin.py
django_nose_plugin.py
from nose.plugins import Plugin class DjangoNosePlugin(Plugin): ''' Adaptor that allows usage of django_nose package plugin from the nosetests command line. Imports and instantiates django_nose plugin after initialization so that the django environment does not have to be configured when running n...
from nose.plugins import Plugin class DjangoNosePlugin(Plugin): ''' Adaptor that allows usage of django_nose package plugin from the nosetests command line. Imports and instantiates django_nose plugin after initialization so that the django environment does not have to be configured when running n...
Fix issue when running nosetests and django_nose is not required
Fix issue when running nosetests and django_nose is not required
Python
mit
jenniferlianne/django_nose_adapter
--- +++ @@ -26,7 +26,8 @@ def configure(self, *args, **kw_args): super(DjangoNosePlugin, self).configure(*args, **kw_args) - self.plugin.configure(*args, **kw_args) + if self.enabled: + self.plugin.configure(*args, **kw_args) def prepareTest(self, test): self.p...
7a66b9fb3482778cd0efab692cbc535260bcad25
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://dicasdejava.com.br' RELATIVE_URLS = Fa...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://dicasdejava.com.br' RELATIVE_URLS = Fa...
Remove minify plugin to test search.
Remove minify plugin to test search.
Python
mit
gustavofoa/dicasdejava.com.br,gustavofoa/dicasdejava.com.br,gustavofoa/dicasdejava.com.br,gustavofoa/dicasdejava.com.br,gustavofoa/dicasdejava.com.br
--- +++ @@ -20,7 +20,7 @@ # Plugins PLUGIN_PATHS = ['./pelican-plugins'] -PLUGINS = ['sitemap', 'minify'] +PLUGINS = ['sitemap'] SITEMAP = { 'format': 'xml',
7303afd415cd6867908c6a5108d3604fafb0c8a0
blockbuster/example_config_files/example_config.py
blockbuster/example_config_files/example_config.py
# General Settings timerestriction = False debug_mode = True # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Services Auth basic_auth = 'ba...
# General Settings timerestriction = False debug_mode = True log_directory = './logs' # Email Settings # emailtype = "Gmail" emailtype = "Console" # SMS Settings # outboundsmstype = "WebService" outboundsmstype = "Console" # Twilio Auth Keys account_sid = "twilio sid here" auth_token = "auth token here" # SMS Servi...
Add new configuration setting for log_directory
Add new configuration setting for log_directory
Python
mit
mattstibbs/blockbuster-server,mattstibbs/blockbuster-server
--- +++ @@ -1,6 +1,7 @@ # General Settings timerestriction = False debug_mode = True +log_directory = './logs' # Email Settings # emailtype = "Gmail" @@ -43,6 +44,7 @@ mail_username = '' mail_fromaddr = mail_username mail_password = '' +mail_monitoring_addr = '' # API Variables api_username = "username ...
c6ffb39cc730809781e8dabff4458fd167e60123
app.py
app.py
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return '<H1>Measure Anything</H1>' if __name__ == '__main__': app.run(debug=True)
from flask import Flask from flask.ext.script import Manager app = Flask(__name__) manager = Manager(app) @app.route('/') def index(): return '<H1>Measure Anything</H1>' if __name__ == '__main__': manager.run()
Use flask-script so command line parameters can be used.
Use flask-script so command line parameters can be used.
Python
mit
rahimnathwani/measure-anything
--- +++ @@ -1,9 +1,12 @@ from flask import Flask +from flask.ext.script import Manager + app = Flask(__name__) +manager = Manager(app) @app.route('/') def index(): return '<H1>Measure Anything</H1>' if __name__ == '__main__': - app.run(debug=True) + manager.run()
8bc9d9dd548cb2e19a51fb33336695ca3925ba64
tests/python/unittest/test_random.py
tests/python/unittest/test_random.py
import os import mxnet as mx import numpy as np def same(a, b): return np.sum(a != b) == 0 def check_with_device(device): with mx.Context(device): a, b = -10, 10 mu, sigma = 10, 2 for i in range(5): shape = (100 + i, 100 + i) mx.random.seed(128) ret1...
import os import mxnet as mx import numpy as np def same(a, b): return np.sum(a != b) == 0 def check_with_device(device): with mx.Context(device): a, b = -10, 10 mu, sigma = 10, 2 shape = (100, 100) mx.random.seed(128) ret1 = mx.random.normal(mu, sigma, shape) u...
Revert "Update random number generator test"
Revert "Update random number generator test" This reverts commit b63bda37aa2e9b5251cf6c54d59785d2856659ca.
Python
apache-2.0
sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet,sxjscience/mxnet
--- +++ @@ -9,19 +9,18 @@ with mx.Context(device): a, b = -10, 10 mu, sigma = 10, 2 - for i in range(5): - shape = (100 + i, 100 + i) - mx.random.seed(128) - ret1 = mx.random.normal(mu, sigma, shape) - un1 = mx.random.uniform(a, b, shape) - ...
0e66044b3949255be2653c0cffee53b003ea3929
solum/api/controllers/v1/pub/trigger.py
solum/api/controllers/v1/pub/trigger.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Fix pecan error message not available in body for Trigger.post
Fix pecan error message not available in body for Trigger.post When a trigger_id resource is not found, the API returns a 202 status code, the error message could not be added in the body of the request because pecan.response.text was used instead of pecan.response.body. Change-Id: I8b03210b5a2f2b5c0ea24bfc8149cca122...
Python
apache-2.0
ed-/solum,stackforge/solum,ed-/solum,devdattakulkarni/test-solum,gilbertpilz/solum,ed-/solum,openstack/solum,gilbertpilz/solum,ed-/solum,devdattakulkarni/test-solum,openstack/solum,gilbertpilz/solum,stackforge/solum,gilbertpilz/solum
--- +++ @@ -26,8 +26,7 @@ handler = assembly_handler.AssemblyHandler(None) try: handler.trigger_workflow(trigger_id) + pecan.response.status = 202 except exception.ResourceNotFound as excp: pecan.response.status = excp.code - pecan.response.te...
2add55f78d6b5efb097f8a4d089b2eced80d0882
chrome/common/extensions/docs/server2/fake_host_file_system_provider.py
chrome/common/extensions/docs/server2/fake_host_file_system_provider.py
#!/usr/bin/env python # Copyright 2013 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. from mock_file_system import MockFileSystem from test_file_system import TestFileSystem from third_party.json_schema_compiler.memoize i...
# Copyright 2013 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. from mock_file_system import MockFileSystem from test_file_system import TestFileSystem from third_party.json_schema_compiler.memoize import memoize class F...
Remove shebang line from non-executable .py file.
Remove shebang line from non-executable .py file. Fixes checkperms failure on the main waterfall: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Full/builds/30316/steps/check_perms/logs/stdio /b/build/slave/Linux_ChromiumOS/build/src/chrome/common/extensions/docs/server2/fake_host_file_...
Python
bsd-3-clause
dednal/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,TheTyp...
--- +++ @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright 2013 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.
96c14567ee54033a11bf1f8bc3b3eb0058c092f7
manoseimas/compatibility_test/admin.py
manoseimas/compatibility_test/admin.py
from django.contrib import admin from manoseimas.compatibility_test.models import CompatTest from manoseimas.compatibility_test.models import Topic from manoseimas.compatibility_test.models import TopicVoting from manoseimas.compatibility_test.models import Argument from manoseimas.compatibility_test.models import Tes...
from django.contrib import admin from manoseimas.compatibility_test import models class VotingInline(admin.TabularInline): model = models.TopicVoting raw_id_fields = [ 'voting', ] class ArgumentInline(admin.TabularInline): model = models.Argument class TopicAdmin(admin.ModelAdmin): li...
Fix really strange bug about conflicting models
Fix really strange bug about conflicting models The bug: Failure: RuntimeError (Conflicting 'c' models in application 'nose': <class 'manoseimas.compatibility_test.admin.TestGroup'> and <class 'nose.util.C'>.) ... ERROR ====================================================================== ERROR: Failure...
Python
agpl-3.0
ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt
--- +++ @@ -1,21 +1,17 @@ from django.contrib import admin -from manoseimas.compatibility_test.models import CompatTest -from manoseimas.compatibility_test.models import Topic -from manoseimas.compatibility_test.models import TopicVoting -from manoseimas.compatibility_test.models import Argument -from manoseimas.c...
48b6bb91537d9daecca2bc112f5e06dc9b530f09
scripts/c2s-info.py
scripts/c2s-info.py
#!/usr/bin/env python """ Summarize dataset. Examples: c2s info data.pck """ import sys from argparse import ArgumentParser from pickle import dump from scipy.io import savemat from numpy import corrcoef, mean from c2s import load_data def main(argv): parser = ArgumentParser(argv[0], description=__doc__) parse...
#!/usr/bin/env python """ Summarize dataset. Examples: c2s info data.pck """ import sys from argparse import ArgumentParser from pickle import dump from scipy.io import savemat from numpy import corrcoef, mean, unique from c2s import load_data def main(argv): parser = ArgumentParser(argv[0], description=__doc__...
Print a little bit more info.
Print a little bit more info.
Python
mit
lucastheis/c2s,jonasrauber/c2s
--- +++ @@ -13,7 +13,7 @@ from argparse import ArgumentParser from pickle import dump from scipy.io import savemat -from numpy import corrcoef, mean +from numpy import corrcoef, mean, unique from c2s import load_data def main(argv): @@ -26,9 +26,28 @@ data = load_data(args.dataset) def prints(left, right...
2e95e3b9badf9c860b98bca6a4edb1d4fac358a9
setup.py
setup.py
from roku import __version__ from setuptools import setup, find_packages import os f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='python-roku', version=__version__, description='Client for the Roku media player', long_description=readme, au...
from roku import __version__ from setuptools import setup, find_packages import os f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='roku', version=__version__, description='Client for the Roku media player', long_description=readme, author='J...
Change name of package to roku
Change name of package to roku
Python
bsd-3-clause
jcarbaugh/python-roku
--- +++ @@ -7,7 +7,7 @@ f.close() setup( - name='python-roku', + name='roku', version=__version__, description='Client for the Roku media player', long_description=readme,
d08d78460d0f7143b90a5157c4f5450bb062ec75
im2sim.py
im2sim.py
import argparse import PIL from PIL import Image import subprocess import os import glob def get_image(filename): p = Image.open(filename) docker_image = p.info['im2sim_image'] return subprocess.call('docker pull {}'.format(docker_image), shell=True) print('Pulled docker image {}'.format(docker_image)...
import argparse import PIL from PIL import Image import subprocess import os import glob def get_image(filename): p = Image.open(filename) docker_image = p.info['im2sim_image'] return subprocess.call('docker pull {}'.format(docker_image), shell=True) print('Pulled docker image {}'.format(docker_image)...
Make script consistent with instructions.
Make script consistent with instructions.
Python
mit
IanHawke/im2sim
--- +++ @@ -14,7 +14,7 @@ def tag_images(docker_image): subprocess.call(['mkdir', '-p', 'figures']) - subprocess.call("docker run -v {}/figures:/home/pyro/pyro2/figures " + subprocess.call("docker run -v {}/figures:/figures " "{} make figures".format(os.getcwd(), docker_image), shell=True) f...
7cc2a54dff4dc801306f5f41633ea7edbcc061c5
setup.py
setup.py
import os from os.path import relpath, join from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def find_package_data(data_root, package_root): files = [] for root, dirnames, filenames in os.walk(data_root): for fn in filenames: ...
import os from os.path import relpath, join from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def find_package_data(data_root, package_root): files = [] for root, dirnames, filenames in os.walk(data_root): for fn in filenames: ...
Increment version number for release
Increment version number for release
Python
mit
openforcefield/openff-toolkit,open-forcefield-group/openforcefield,open-forcefield-group/openforcefield,open-forcefield-group/openforcefield,openforcefield/openff-toolkit
--- +++ @@ -14,7 +14,7 @@ setup( name = "smarty", - version = "0.1.4", + version = "0.1.5", author = "John Chodera, David Mobley, and others", author_email = "john.chodera@choderalab.org", description = ("Automated Bayesian atomtype sampling"),
706c0b16600e69f911bcd5632be95ec528d688dd
setup.py
setup.py
from setuptools import setup def readme(): with open('README.rst') as readme_file: return readme_file.read() configuration = { 'name' : 'hypergraph', 'version' : '0.1', 'description' : 'Hypergraph tools and algorithms', 'long_description' : readme(), 'classifiers' : [ 'Developm...
from setuptools import setup def readme(): with open('README.rst') as readme_file: return readme_file.read() configuration = { 'name' : 'hypergraph', 'version' : '0.1', 'description' : 'Hypergraph tools and algorithms', 'long_description' : readme(), 'classifiers' : [ 'Developm...
Update requirements to include networkx
Update requirements to include networkx
Python
lgpl-2.1
lmcinnes/hypergraph
--- +++ @@ -30,7 +30,8 @@ 'maintainer_email' : 'leland.mcinnes@gmail.com', 'license' : 'BSD', 'packages' : ['hdbscan'], - 'install_requires' : ['numpy>=1.5], + 'install_requires' : ['numpy>=1.5', + 'networkx>=1.9.1'], 'ext_modules' : [], 'cmdclass' : {'build_ext' : build_ext},...
7fd7ce41e388a2014cd30a641f1fb3b35661af40
setup.py
setup.py
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.2', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
from setuptools import setup,find_packages setup ( name = 'pymatgen', version = '1.0.3', packages = find_packages(), # Declare your packages' dependencies here, for eg: install_requires = ['numpy','scipy','matplotlib','PyCIFRW'], author = 'Shyue Ping Ong, Anubhav Jain, Michael Kocher, Dan Gunter', aut...
Update to v1.0.3 given all the bug fixes.
Update to v1.0.3 given all the bug fixes. Former-commit-id: 0aebb52391a2dea2aabf08879335df01775d02ab [formerly 65ccbe5c10f2c1b54e1736caf7d8d88c7345610f] Former-commit-id: 1e823ba824b20ed7641ff7360c6b50184562b3bd
Python
mit
mbkumar/pymatgen,davidwaroquiers/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,richardtran415/pymatgen,gpetretto/pymatgen,gVallverdu/pymatgen,johnson1228/pymatgen,czhengsci/pymatgen,xhqu1981/pymatgen,johnson1228/pymatgen,vorwerkc/pymatgen,montoyjh/pymatgen,setten/pymatgen,setten/pymatgen,blondegeek/pymatgen,richardtra...
--- +++ @@ -2,7 +2,7 @@ setup ( name = 'pymatgen', - version = '1.0.2', + version = '1.0.3', packages = find_packages(), # Declare your packages' dependencies here, for eg:
03a5c3ce6c3c5c3238068f7e52d7f482eeebf7fb
setup.py
setup.py
#!/usr/bin/env python # coding: utf-8 """ setup.py ~~~~~~~~ Installs marvin as a package. """ from setuptools import setup, find_packages setup( name='marvin', version='0.1.0', author='Tarjei Husøy', author_email='tarjei@roms.no', url='https://github.com/streamr/marvin', descript...
#!/usr/bin/env python # coding: utf-8 """ setup.py ~~~~~~~~ Installs marvin as a package. """ from setuptools import setup, find_packages setup( name='marvin', version='0.1.0', author='Tarjei Husøy', author_email='tarjei@roms.no', url='https://github.com/streamr/marvin', descript...
Add templates to the build.
Add templates to the build.
Python
mit
streamr/marvin,streamr/marvin,streamr/marvin
--- +++ @@ -21,6 +21,7 @@ package_data={ '': [ 'log_conf.yaml', + 'templates/*.html', ], }, zip_safe=False,
082d53c48dc37b5c8edd3781bd1f40234c922db2
APITaxi/test_settings.py
APITaxi/test_settings.py
DEBUG = True SECRET_KEY = 'super-secret' SQLALCHEMY_DATABASE_URI = 'postgresql://vincent:vincent@localhost/odtaxi_test' REDIS_URL = "redis://:@localhost:6379/0" REDIS_GEOINDEX = 'geoindex' SQLALCHEMY_POOL_SIZE = 2 SECURITY_PASSWORD_HASH = 'plaintext' NOW = 'time_test'
DEBUG = True SECRET_KEY = 'super-secret' SQLALCHEMY_DATABASE_URI = 'postgresql://vincent:vincent@localhost/odtaxi_test' REDIS_URL = "redis://:@localhost:6379/0" REDIS_GEOINDEX = 'geoindex' SQLALCHEMY_POOL_SIZE = 2 SECURITY_PASSWORD_HASH = 'plaintext' NOW = 'time_test' DOGPILE_CACHE_BACKEND = 'dogpile.cache.null'
Use null cache in tests
Use null cache in tests
Python
agpl-3.0
openmaraude/APITaxi,l-vincent-l/APITaxi,openmaraude/APITaxi,l-vincent-l/APITaxi
--- +++ @@ -8,3 +8,4 @@ SECURITY_PASSWORD_HASH = 'plaintext' NOW = 'time_test' +DOGPILE_CACHE_BACKEND = 'dogpile.cache.null'
cd9a5d62a7d13b8526a68394508c48cbfc443bba
setup.py
setup.py
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from config import get_version from distutils.command.install import INSTALL_SCHEMES setup(name='datadog-agent', ...
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from config import get_version from distutils.command.install import INSTALL_SCHEMES setup(name='datadog-agent', ...
Add compat/ files in packaging
Add compat/ files in packaging
Python
bsd-3-clause
AniruddhaSAtre/dd-agent,oneandoneis2/dd-agent,a20012251/dd-agent,joelvanvelden/dd-agent,packetloop/dd-agent,huhongbo/dd-agent,AniruddhaSAtre/dd-agent,manolama/dd-agent,joelvanvelden/dd-agent,jamesandariese/dd-agent,eeroniemi/dd-agent,manolama/dd-agent,eeroniemi/dd-agent,AntoCard/powerdns-recursor_check,AntoCard/powerdn...
--- +++ @@ -16,7 +16,7 @@ author='Datadog', author_email='info@datadoghq.com', url='http://datadoghq.com/', - packages=['checks', 'checks/db', 'resources'], + packages=['checks', 'checks/db', 'resources', 'compat'], package_data={'checks': ['libs/*']}, scripts=['agent.py',...
9bb48f43c5b7b026d74710860e5427c4e0ec71dd
valohai_yaml/objs/input.py
valohai_yaml/objs/input.py
from enum import Enum from .base import Item class KeepDirectories(Enum): NONE = 'none' SUFFIX = 'suffix' FULL = 'full' @classmethod def cast(cls, value): if not value: return KeepDirectories.NONE if value is True: return KeepDirectories.FULL retur...
from enum import Enum from .base import Item class KeepDirectories(Enum): NONE = 'none' SUFFIX = 'suffix' FULL = 'full' @classmethod def cast(cls, value): if not value: return KeepDirectories.NONE if value is True: return KeepDirectories.FULL retur...
Remove trailing comma not compatible with Python 3.5
Remove trailing comma not compatible with Python 3.5
Python
mit
valohai/valohai-yaml
--- +++ @@ -27,7 +27,7 @@ optional=False, description=None, keep_directories=False, - filename=None, + filename=None ) -> None: self.name = name self.default = default # may be None, a string or a list of strings
d1e75df724fd3627b3fd83ab374dd9770d1acada
setup.py
setup.py
# coding=utf-8 from setuptools import setup, find_packages from sii import __LIBRARY_VERSION__ INSTALL_REQUIRES = [line for line in open('requirements.txt')] TESTS_REQUIRE = [line for line in open('requirements-dev.txt')] PACKAGES_DATA = {'sii': ['data/*.xsd']} setup( name='sii', description='Librería de S...
# coding=utf-8 from setuptools import setup, find_packages from sii import __LIBRARY_VERSION__ with open('requirements.txt', 'r') as f: INSTALL_REQUIRES = f.readlines() with open('requirements-dev.txt', 'r') as f: TESTS_REQUIRE = f.readlines() PACKAGES_DATA = {'sii': ['data/*.xsd']} setup( name='sii', ...
Simplify readlines() to add requirements
Simplify readlines() to add requirements
Python
mit
gisce/sii
--- +++ @@ -3,9 +3,11 @@ from setuptools import setup, find_packages from sii import __LIBRARY_VERSION__ -INSTALL_REQUIRES = [line for line in open('requirements.txt')] +with open('requirements.txt', 'r') as f: + INSTALL_REQUIRES = f.readlines() -TESTS_REQUIRE = [line for line in open('requirements-dev.txt')...
703e659ee2705b509b105a9b2a4f09d29c129643
setup.py
setup.py
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
"""Config for PyPI.""" from setuptools import find_packages from setuptools import setup setup( author='Kyle P. Johnson', author_email='kyle@kyle-p-johnson.com', classifiers=[ 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MI...
Increment version to trigger auto build
Increment version to trigger auto build
Python
mit
kylepjohnson/cltk,TylerKirby/cltk,TylerKirby/cltk,D-K-E/cltk,LBenzahia/cltk,diyclassics/cltk,cltk/cltk,LBenzahia/cltk
--- +++ @@ -36,7 +36,7 @@ name='cltk', packages=find_packages(), url='https://github.com/cltk/cltk', - version='0.1.64', + version='0.1.65', zip_safe=True, test_suite='cltk.tests.test_cltk', )
7da8c97530d25d4f471f7927825382c0cea9524d
setup.py
setup.py
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/todoman', license='MIT', packages=['todoman'], entry_points={ ...
#!/usr/bin/env python3 from setuptools import setup setup( name='todoman', description='A simple CalDav-based todo manager.', author='Hugo Osvaldo Barrera', author_email='hugo@barrera.io', url='https://gitlab.com/hobarrera/todoman', license='MIT', packages=['todoman'], entry_points={ ...
Make README.rst the package's long description
Make README.rst the package's long description
Python
isc
pimutils/todoman,rimshaakhan/todoman,Sakshisaraswat/todoman,asalminen/todoman,AnubhaAgrawal/todoman,hobarrera/todoman
--- +++ @@ -18,6 +18,7 @@ install_requires=[ open('requirements.txt').readlines() ], + long_description=open('README.rst').read(), use_scm_version={'version_scheme': 'post-release'}, setup_requires=['setuptools_scm'], # TODO: classifiers
cf496e0f18811dd61caea822a8cc3e5769bbdc04
setup.py
setup.py
#!/usr/bin/env python3 # coding: utf-8 """A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages import keysmith with open('README.rst') as readme_file: README = readme_file.read() setu...
#!/usr/bin/env python3 # coding: utf-8 """A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup, find_packages import keysmith with open('README.rst') as readme_file: README = readme_file.read() setu...
Remove the Intended Audience classifier
Remove the Intended Audience classifier
Python
bsd-3-clause
dmtucker/keysmith
--- +++ @@ -30,7 +30,6 @@ classifiers=[ 'License :: OSI Approved :: ' 'GNU Lesser General Public License v2 or later (LGPLv2+)', - 'Intended Audience :: End Users/Desktop', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Program...
5da6d00d040e7e4567956492ed955f9bd4e6cfa7
setup.py
setup.py
from setuptools import setup, find_packages import sys, os from applib import __version__ setup(name='applib', version=__version__, description="Cross-platform application utilities", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_class...
from setuptools import setup, find_packages import sys, os from applib import __version__ setup(name='applib', version=__version__, description="Cross-platform application utilities", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_class...
Fix url to use new homepage
Fix url to use new homepage
Python
mit
ActiveState/applib
--- +++ @@ -12,7 +12,7 @@ keywords='', author='Sridhar Ratnakumar', author_email='srid@nearfar.org', - url='http://firefly.activestate.com/sridharr/applib', + url='http://bitbucket.org/srid/applib', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'te...
9fbfaac74b3213601ce48c73cd49a02344ba580b
setup.py
setup.py
from distutils.core import setup import sisdb setup ( name='sisdb', version=sisdb.VERSION, description='SIS ORM like library', packages=['sisdb'], install_requires=['sis >= 0.3.0'] )
from distutils.core import setup import sisdb setup ( name='sisdb', version=sisdb.VERSION, description='SIS ORM like library', packages=['sisdb'], install_requires=['sispy >= 0.3.0'] )
Update to require sispy instead of sis
Update to require sispy instead of sis
Python
bsd-3-clause
sis-cmdb/sis-db-python
--- +++ @@ -7,5 +7,5 @@ version=sisdb.VERSION, description='SIS ORM like library', packages=['sisdb'], - install_requires=['sis >= 0.3.0'] + install_requires=['sispy >= 0.3.0'] )
3f7c6e468f420198f83e090efc155efe8fb18660
setup.py
setup.py
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-zendesk-tickets', version='...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-zendesk-tickets', version='...
Remove <1.9 limit on Django version
Remove <1.9 limit on Django version
Python
mit
ministryofjustice/django-zendesk-tickets,ministryofjustice/django-zendesk-tickets
--- +++ @@ -15,7 +15,7 @@ license='MIT License', description='', long_description=README, - install_requires=['Django>=1.8,<1.9', 'requests', ], + install_requires=['Django>=1.8', 'requests', ], classifiers=[ 'Framework :: Django', 'Intended Audience :: Python Developers',
f78f5b467ffe722e04317396622b5b81e40bb6bd
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='7.0.16', packages=['todoist', 'todoist.managers'], author='Doist Team...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='7.0.17', packages=['todoist', 'todoist.managers'], author='Doist Team...
Update the PyPI version to 7.0.17.
Update the PyPI version to 7.0.17.
Python
mit
Doist/todoist-python
--- +++ @@ -10,7 +10,7 @@ setup( name='todoist-python', - version='7.0.16', + version='7.0.17', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com',
83410be53dfd4ddba5c3d5fff4c8cea022fc08d2
setup.py
setup.py
from setuptools import setup, find_packages with open("README.rst", "rt") as f: readme = f.read() setup( name='gimei', version="0.1.5", description="generates the name and the address at random.", long_description=__doc__, author='Mao Nabeta', author_email='mao.nabeta@gmail.com', url='h...
from setuptools import setup, find_packages with open("README.rst", "rt") as f: readme = f.read() setup( name='gimei', version="0.1.51", description="generates the name and the address at random.", long_description=__doc__, author='Mao Nabeta', author_email='mao.nabeta@gmail.com', url='...
Set version number to 0.1.51.
Set version number to 0.1.51.
Python
mit
nabetama/gimei
--- +++ @@ -6,7 +6,7 @@ setup( name='gimei', - version="0.1.5", + version="0.1.51", description="generates the name and the address at random.", long_description=__doc__, author='Mao Nabeta',
2c41039669b9f8b423209c04f1d032584a86721e
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup def read(filename): return open(filename).read() setup(name="lzo-indexer", version="0.0.1", description="Library for indexing LZO compressed files", long_description=read("README.md"), author="Tom Arnfeld", author_email="tom@duedil.com", ...
#!/usr/bin/env python from setuptools import setup def read(filename): return open(filename).read() setup(name="lzo-indexer", version="0.0.1", description="Library for indexing LZO compressed files", long_description=read("README.md"), author="Tom Arnfeld", author_email="tom@duedil.com", ...
Switch to the new github release download links
Switch to the new github release download links
Python
apache-2.0
duedil-ltd/python-lzo-indexer
--- +++ @@ -15,7 +15,7 @@ maintainer="Tom Arnfeld", maintainer_email="tom@duedil.com", url="https://github.com/duedil-ltd/python-lzo-indexer", - download_url="https://github.com/duedil-ltd/python-lzo-indexer/archive/release-0.0.1.zip", + download_url="https://github.com/duedil-ltd/python-lzo-inde...
ea860743e0ba4538714d9fe5476b4807cf75ed35
sourcer/__init__.py
sourcer/__init__.py
from .terms import * from .parser import * __all__ = [ 'Alt', 'And', 'Any', 'AnyChar', 'AnyInst', 'Bind', 'Content', 'End', 'Expect', 'ForwardRef', 'InfixLeft', 'InfixRight', 'Left', 'LeftAssoc', 'List', 'Literal', 'Middle', 'Not', 'Operation...
from .terms import ( Alt, And, Any, AnyChar, AnyInst, Bind, Content, End, Expect, ForwardRef, InfixLeft, InfixRight, Left, LeftAssoc, List, Literal, Middle, Not, Operation, OperatorPrecedence, Opt, Or, ParseError, ParseResul...
Replace the __all__ specification with direct imports.
Replace the __all__ specification with direct imports.
Python
mit
jvs/sourcer
--- +++ @@ -1,50 +1,49 @@ -from .terms import * -from .parser import * +from .terms import ( + Alt, + And, + Any, + AnyChar, + AnyInst, + Bind, + Content, + End, + Expect, + ForwardRef, + InfixLeft, + InfixRight, + Left, + LeftAssoc, + List, + Literal, + Middle, + ...
cb998c88d385d42f13e2e39fb86e8df73610a275
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-validate-model-attribute-assignment', url="https://chris-lamb.co.uk/projects/django-validate-model-attribute-assignment", version='2.0.1', description="Prevent typos and other errors when assigning attributes to Dja...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='django-validate-model-attribute-assignment', url="https://chris-lamb.co.uk/projects/django-validate-model-attribute-assignment", version='2.0.1', description="Prevent typos and other errors when assigning attributes to Dja...
Update Django requirement to latest LTS
Update Django requirement to latest LTS
Python
bsd-3-clause
lamby/django-validate-model-attribute-assignment
--- +++ @@ -14,4 +14,8 @@ license="BSD", packages=find_packages(), + + install_requires=( + 'Django>=1.8', + ), )
7fc2b2d1c2f21cd44b3fbcd641ae2b36f38f080d
setup.py
setup.py
import os from setuptools import setup from withtool import __version__ def read(fname): path = os.path.join(os.path.dirname(__file__), fname) with open(path, encoding='utf-8') as f: return f.read() setup( name='with', version=__version__, description='A shell context manager', long_...
import os from setuptools import setup from withtool import __version__ def read(fname): path = os.path.join(os.path.dirname(__file__), fname) with open(path, encoding='utf-8') as f: return f.read() setup( name='with', version=__version__, description='A shell context manager', long_...
Upgrade dependency python-slugify to ==1.2.1
Upgrade dependency python-slugify to ==1.2.1
Python
mit
renanivo/with
--- +++ @@ -23,7 +23,7 @@ 'appdirs==1.4.0', 'docopt==0.6.2', 'prompt-toolkit==1.0', - 'python-slugify==1.2.0', + 'python-slugify==1.2.1', ], packages=['withtool'], classifiers=[
7ef952010f1bbfb9f78de923caa1112121328324
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup settings = dict() # Publish if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() settings.update( name='whenpy'...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup settings = dict() # Publish if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() settings.update( name='whenpy'...
Add new Python versions to the supported languages
Add new Python versions to the supported languages Now that tests are passing for Python 3.1 and 3.2, they should go into the list of supported versions of Python listed on PyPI.
Python
bsd-3-clause
dirn/When.py
--- +++ @@ -38,6 +38,8 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.1', + 'Programming Language :: Python :: 3.2', 'Topic :: Software Development :: Librar...
0ebf51994a73fdc7c4f13b274fc41bef541eea52
deflect/widgets.py
deflect/widgets.py
from __future__ import unicode_literals from itertools import chain from django import forms from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe class DataListInput(forms.TextInput): """ A form widget that displays a standard `...
from __future__ import unicode_literals from itertools import chain from django import forms from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import mark_safe class DataListInput(forms.TextInput): """ A form widget that displays a standard `...
Hide the option set from incompatible browsers
Hide the option set from incompatible browsers
Python
bsd-3-clause
jbittel/django-deflect
--- +++ @@ -30,7 +30,7 @@ def render_options(self, name, choices): output = [] output.append('<datalist id="id_%s_list">' % name) - output.append('<select>') + output.append('<select style="display:none">') for option in chain(self.choices, choices): output.a...
806a6d8e029ef1c4708a265abd99219b167cc843
generate-data.py
generate-data.py
#!/usr/bin/env python import random from nott_params import * num_samples = int(gridDim[0] * gridDim[1] * 10) def generate_data(numx, numy): stimulus = (random.randint(0, numx - 1), random.randint(0, numy - 1)) return stimulus def print_header(): print("{0} {1} {2}".format(num_samples, num_inputs, num_o...
#!/usr/bin/env python import random from nott_params import * num_samples = int(gridDim[0] * gridDim[1] * 0.2) def generate_data(numx, numy): stimulus = (random.randint(0, numx - 1), random.randint(0, numy - 1)) return stimulus def print_header(): print("{0} {1} {2}".format(num_samples, num_inputs, num_...
Remove oversampling; use 20 percent instead
Remove oversampling; use 20 percent instead
Python
mit
jeffames-cs/nnot
--- +++ @@ -3,7 +3,7 @@ import random from nott_params import * -num_samples = int(gridDim[0] * gridDim[1] * 10) +num_samples = int(gridDim[0] * gridDim[1] * 0.2) def generate_data(numx, numy): stimulus = (random.randint(0, numx - 1), random.randint(0, numy - 1))
35541f35ebed2b41b3fde073e8f3d2aaaca41dcb
tasks.py
tasks.py
from invoke import run, task TESTPYPI = "https://testpypi.python.org/pypi" @task def lint(): """Run flake8 to lint code""" run("python setup.py flake8") @task(lint) def test(): """Lint, unit test, and check setup.py""" run("nosetests --with-coverage --cover-package=siganalysis") run("python set...
from invoke import run, task TESTPYPI = "https://testpypi.python.org/pypi" @task def lint(): """Run flake8 to lint code""" run("python setup.py flake8") @task(lint) def test(): """Lint, unit test, and check setup.py""" run("nosetests --with-coverage --cover-package=taffmat") run("python setup.p...
Fix test task (wrong package)
Fix test task (wrong package)
Python
mit
questrail/taffmat
--- +++ @@ -12,7 +12,7 @@ @task(lint) def test(): """Lint, unit test, and check setup.py""" - run("nosetests --with-coverage --cover-package=siganalysis") + run("nosetests --with-coverage --cover-package=taffmat") run("python setup.py check")
1c7e6a9c973551193d19bacb79d602e4d3cca630
tests/unit/test_examples.py
tests/unit/test_examples.py
# -*- coding: utf-8 -*- ####################################################################### # Name: test_examples # Purpose: Test that examples run without errors. # Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # Copyright: (c) 2014-2015 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # L...
# -*- coding: utf-8 -*- ####################################################################### # Name: test_examples # Purpose: Test that examples run without errors. # Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # Copyright: (c) 2014-2015 Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com> # L...
Insert example directories in path before all others in the example test.
Insert example directories in path before all others in the example test.
Python
mit
leiyangyou/Arpeggio,leiyangyou/Arpeggio
--- +++ @@ -20,7 +20,7 @@ examples = [f for f in glob.glob(examples_pat) if f != '__init__.py'] for e in examples: example_dir = os.path.dirname(e) - sys.path.append(example_dir) + sys.path.insert(0, example_dir) (module_name, _) = os.path.splitext(os.path.basename(e)) ...
97c0f23c676de7e726e938bf0b61087834cf9fd9
netbox/tenancy/api/serializers.py
netbox/tenancy/api/serializers.py
from rest_framework import serializers from extras.api.serializers import CustomFieldSerializer from tenancy.models import Tenant, TenantGroup # # Tenant groups # class TenantGroupSerializer(serializers.ModelSerializer): class Meta: model = TenantGroup fields = ['id', 'name', 'slug'] class Te...
from rest_framework import serializers from extras.api.serializers import CustomFieldSerializer from tenancy.models import Tenant, TenantGroup # # Tenant groups # class TenantGroupSerializer(serializers.ModelSerializer): class Meta: model = TenantGroup fields = ['id', 'name', 'slug'] class Te...
Add description field to TenantSerializer
Add description field to TenantSerializer This might be just an oversight. Other data models do include the description in their serialisers. The API produces the description field with this change.
Python
apache-2.0
digitalocean/netbox,snazy2000/netbox,digitalocean/netbox,snazy2000/netbox,Alphalink/netbox,snazy2000/netbox,lampwins/netbox,Alphalink/netbox,snazy2000/netbox,Alphalink/netbox,lampwins/netbox,lampwins/netbox,digitalocean/netbox,digitalocean/netbox,lampwins/netbox,Alphalink/netbox
--- +++ @@ -30,7 +30,7 @@ class Meta: model = Tenant - fields = ['id', 'name', 'slug', 'group', 'comments', 'custom_fields'] + fields = ['id', 'name', 'slug', 'group', 'description', 'comments', 'custom_fields'] class TenantNestedSerializer(TenantSerializer):
7b1766a6f07d468f1830871bfe2cdc1aaa29dcbf
examples/client.py
examples/client.py
""" Cross-process log tracing: HTTP client. """ from __future__ import unicode_literals import sys import requests from eliot import Logger, to_file, start_action to_file(sys.stdout) logger = Logger() def request(x, y): with start_action(logger, "http_request", x=x, y=y) as action: task_id = action.seri...
""" Cross-process log tracing: HTTP client. """ from __future__ import unicode_literals import sys import requests from eliot import Logger, to_file, start_action to_file(sys.stdout) logger = Logger() def remote_divide(x, y): with start_action(logger, "http_request", x=x, y=y) as action: task_id = actio...
Address review comment: Better function name.
Address review comment: Better function name.
Python
apache-2.0
ScatterHQ/eliot,ScatterHQ/eliot,ClusterHQ/eliot,iffy/eliot,ScatterHQ/eliot
--- +++ @@ -11,7 +11,7 @@ logger = Logger() -def request(x, y): +def remote_divide(x, y): with start_action(logger, "http_request", x=x, y=y) as action: task_id = action.serialize_task_id() response = requests.get( @@ -25,4 +25,4 @@ if __name__ == '__main__': with start_action(logg...
6e6383037fc86beba36f16e9beb89e850ba24649
oauth_access/models.py
oauth_access/models.py
import datetime from django.db import models from django.contrib.auth.models import User class UserAssociation(models.Model): user = models.ForeignKey(User) service = models.CharField(max_length=75, db_index=True) identifier = models.CharField(max_length=255, db_index=True) token = models.CharF...
import datetime from django.db import models from django.contrib.auth.models import User class UserAssociation(models.Model): user = models.ForeignKey(User) service = models.CharField(max_length=75, db_index=True) identifier = models.CharField(max_length=255, db_index=True) token = models.CharF...
Handle case when token has a null expires
Handle case when token has a null expires
Python
bsd-3-clause
eldarion/django-oauth-access,eldarion/django-oauth-access
--- +++ @@ -17,4 +17,6 @@ unique_together = [("user", "service")] def expired(self): - return self.expires and datetime.datetime.now() < self.expires + if not self.expires: + return True + return datetime.datetime.now() < self.expires
53a518aa9e00af8f2b24b566f6d0420d107e93bf
handler/index.py
handler/index.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio # Index Page from BaseHandler import BaseHandler from tornado.web import authenticated as Auth class IndexHandler(BaseHandler): #@Auth def get(self): self.log.info('Hell,Index page!') # Log Test self.render('index/index.html')
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio # Index Page from BaseHandler import BaseHandler #from tornado.web import authenticated as Auth class IndexHandler(BaseHandler): #@Auth def get(self): self.log.info('Hello,Index page!') # Log Test self.render('index/index.html')
Fix a log display error
Fix a log display error
Python
mit
kkstu/Torweb,kkstu/Torweb
--- +++ @@ -4,11 +4,11 @@ # Index Page from BaseHandler import BaseHandler -from tornado.web import authenticated as Auth +#from tornado.web import authenticated as Auth class IndexHandler(BaseHandler): #@Auth def get(self): - self.log.info('Hell,Index page!') # Log Test + self.log.in...
9d02fcd251cc2f954e559794507e1b052d8bef3c
tests/test_compile_samples.py
tests/test_compile_samples.py
import os.path import pytest import rain.compiler as C def ls(*path): path = os.path.join(*path) for file in os.listdir(path): yield os.path.join(path, file) def lsrn(*path, recurse=False): for file in ls(*path): if os.path.isfile(file) and file.endswith('.rn') and not file.endswith('_pkg.rn'): yi...
import os.path import pytest import rain.compiler as C def ls(*path): path = os.path.join(*path) for file in os.listdir(path): yield os.path.join(path, file) def lsrn(*path, recurse=False): for file in ls(*path): if os.path.isfile(file) and file.endswith('.rn') and not file.endswith('_pkg.rn'): yi...
Fix tests for new quiet attribute
tests: Fix tests for new quiet attribute
Python
mit
philipdexter/rain,philipdexter/rain,philipdexter/rain,scizzorz/rain,philipdexter/rain,scizzorz/rain,scizzorz/rain,scizzorz/rain
--- +++ @@ -16,6 +16,7 @@ @pytest.mark.parametrize('src', lsrn('samples', recurse=True)) def test_sample(src): - comp = C.get_compiler(src, main=True, quiet=True) + C.Compiler.quiet = True + comp = C.get_compiler(src, main=True) comp.goodies() comp.compile()
05dbb8055f4e1c61d04daf8324169c7834b5393b
tests/test_get_user_config.py
tests/test_get_user_config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_get_user_config -------------------- Tests formerly known from a unittest residing in test_config.py named """ import pytest @pytest.fixture(scope='function') def back_up_rc(request): """ Back up an existing cookiecutter rc and restore it after the tes...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_get_user_config -------------------- Tests formerly known from a unittest residing in test_config.py named """ import os import shutil import pytest @pytest.fixture(scope='function') def back_up_rc(request): """ Back up an existing cookiecutter rc and ...
Remove self references from setup/teardown
Remove self references from setup/teardown
Python
bsd-3-clause
nhomar/cookiecutter,audreyr/cookiecutter,vincentbernat/cookiecutter,cguardia/cookiecutter,luzfcb/cookiecutter,dajose/cookiecutter,vincentbernat/cookiecutter,dajose/cookiecutter,janusnic/cookiecutter,atlassian/cookiecutter,jhermann/cookiecutter,0k/cookiecutter,agconti/cookiecutter,cguardia/cookiecutter,venumech/cookiecu...
--- +++ @@ -8,6 +8,8 @@ Tests formerly known from a unittest residing in test_config.py named """ +import os +import shutil import pytest @@ -17,20 +19,20 @@ Back up an existing cookiecutter rc and restore it after the test. If ~/.cookiecutterrc is pre-existing, move it to a temp location """ ...
384e7076f8c07f6192f11a813569540ddc98cc0c
kmeans.py
kmeans.py
import numpy as np class KMeans(object): def __init__(self, clusters, init=None): self.clusters = clusters self.init = init self.centroids = np.array([]) self.partition = np.array([]) def cluster(self, dataset): # Randomly choose initial set of centroids if undefined ...
import numpy as np class KMeans: def __init__(self, clusters, init=None): self.clusters = clusters self.init = init self.centroids = None self.partition = None def cluster(self, dataset): # Randomly choose initial set of centroids if undefined if not self.init: ...
Use numpy.random.choice in place of numpy.random.randint.
Use numpy.random.choice in place of numpy.random.randint. Allows sampling without replacement; hence, removing the possibility of choosing equal initial centroids.
Python
mit
kubkon/kmeans
--- +++ @@ -1,17 +1,17 @@ import numpy as np -class KMeans(object): +class KMeans: def __init__(self, clusters, init=None): self.clusters = clusters self.init = init - self.centroids = np.array([]) - self.partition = np.array([]) + self.centroids = None + self.par...
ad42c66676cc8b7778a4020fff3402bc100f212c
material/admin/__init__.py
material/admin/__init__.py
default_app_config = 'material.admin.apps.MaterialAdminConfig'
default_app_config = 'material.admin.apps.MaterialAdminConfig' try: from . import modules admin = modules.Admin() except ImportError: """ Ok, karenina is not installed """
Add module declaration for karenina
Add module declaration for karenina
Python
bsd-3-clause
Axelio/django-material,MonsterKiller/django-material,refnode/django-material,lukasgarcya/django-material,2947721120/django-material,afifnz/django-material,afifnz/django-material,sourabhdattawad/django-material,MonsterKiller/django-material,koopauy/django-material,koopauy/django-material,thiagoramos-luizalabs/django-mat...
--- +++ @@ -1 +1,10 @@ default_app_config = 'material.admin.apps.MaterialAdminConfig' + + +try: + from . import modules + admin = modules.Admin() +except ImportError: + """ + Ok, karenina is not installed + """
b2badddd5fb58d6928bdfce84e88951e190f15fb
02/test_move.py
02/test_move.py
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
from move import load_moves, encode_moves, normalize_index, move import unittest class TestMove(unittest.TestCase): def setUp(self): self.moves = ['ULL', 'RRDDD', 'LURDL', 'UUUUD'] def test_load_moves(self): assert load_moves('example.txt') == self.moves def test_encode_moves(self): ...
Add tests for alternate number pad.
Add tests for alternate number pad.
Python
mit
machinelearningdeveloper/aoc_2016
--- +++ @@ -17,6 +17,9 @@ assert normalize_index(1) == 1 assert normalize_index(0) == 0 assert normalize_index(-1) == 0 + assert normalize_index(2, 1) == 0 + assert normalize_index(5, 2) == 1 + assert normalize_index(-1, 4) == 0 def test_move(self): asse...
2a0a29effa48caf5d95ed892d85cee235ebe1624
lamvery/utils.py
lamvery/utils.py
# -*- coding: utf-8 -*- import os import sys import re import shlex import subprocess from termcolor import cprint ENV_PATTERN = re.compile('^(?P<name>[^\s]+)\s*=\s*(?P<value>.+)$') def previous_alias(alias): return '{}-pre'.format(alias) def parse_env_args(env): if not isinstance(env, list): retu...
# -*- coding: utf-8 -*- import os import sys import re import shlex import subprocess ENV_PATTERN = re.compile('^(?P<name>[^\s]+)\s*=\s*(?P<value>.+)$') def previous_alias(alias): return '{}-pre'.format(alias) def parse_env_args(env): if not isinstance(env, list): return None ret = {} for...
Fix error when import lamvery in function
Fix error when import lamvery in function
Python
mit
marcy-terui/lamvery,marcy-terui/lamvery
--- +++ @@ -5,7 +5,6 @@ import re import shlex import subprocess -from termcolor import cprint ENV_PATTERN = re.compile('^(?P<name>[^\s]+)\s*=\s*(?P<value>.+)$') @@ -52,7 +51,7 @@ def confirm_overwrite(path): ret = True if os.path.exists(path): - cprint('Overwrite {}? [y/n]: '.format(path), ...
ce59932d485440c592abbacc16c1fc32a7cde6e2
jktest/testcase.py
jktest/testcase.py
import unittest from jktest.config import TestConfig from jktest.jkind import JKind from jktest.results import ResultList class TestCase( unittest.TestCase ): def assertTrue( self, expr, msg = None ): super( TestCase, self ).assertTrue( expr, msg ) class JKTestCase( unittest.TestCase ): # class JKTestC...
import unittest from jktest.config import TestConfig from jktest.jkind import JKind from jktest.results import ResultList class TestCase( unittest.TestCase ): def assertTrue( self, expr, msg = None ): super( TestCase, self ).assertTrue( expr, msg ) class JKTestCase( unittest.TestCase ): # class JKTestC...
Add prints for output formatting
Add prints for output formatting
Python
bsd-3-clause
agacek/jkindRegression,pr-martin/jkindRegression
--- +++ @@ -20,14 +20,19 @@ self.results = ResultList() self.file = TestConfig().popFile() + # Print test header for nicer output formatting + print( '\n**********************************************' ) + print( 'BEGIN TEST OF: ' + str( self.file ) ) + for arg in Test...
07bcbe76f33cb4354cb90744f46c5528169183e3
launch_pyslvs.py
launch_pyslvs.py
# -*- coding: utf-8 -*- ##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI. ##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com] from sys import exit if __name__=='__main__': try: from core.info.info import show_info, Pyslvs_Splash args = show_info() from PyQt5.QtWi...
# -*- coding: utf-8 -*- ##Pyslvs - Dimensional Synthesis of Planar Four-bar Linkages in PyQt5 GUI. ##Copyright (C) 2016 Yuan Chang [daan0014119@gmail.com] from sys import exit if __name__=='__main__': try: from core.info.info import show_info, Pyslvs_Splash args = show_info() from PyQt5.QtWi...
Change the Error show in command window.
Change the Error show in command window.
Python
agpl-3.0
40323230/Pyslvs-PyQt5,KmolYuan/Pyslvs-PyQt5,KmolYuan/Pyslvs-PyQt5
--- +++ @@ -22,5 +22,5 @@ logging.basicConfig(filename='PyslvsLogFile.log', filemode='w', format='%(asctime)s | %(message)s', level=logging.INFO) logging.exception("Exception Happened.") - print("Exception Happened. Please check the log file.") + print(...
79dd3b4d0bd1fb331558892b5d29b223d4022657
feedhq/urls.py
feedhq/urls.py
from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse, HttpResponsePermanentRedirect from ratelimitbackend import admin admin.autod...
from django.conf import settings from django.conf.urls.defaults import url, patterns, include from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse, HttpResponsePermanentRedirect from ratelimitbackend import admin admin.autod...
Make sure to import the user monkeypatch before anything else that touches it
Make sure to import the user monkeypatch before anything else that touches it
Python
bsd-3-clause
rmoorman/feedhq,vincentbernat/feedhq,vincentbernat/feedhq,rmoorman/feedhq,rmoorman/feedhq,rmoorman/feedhq,feedhq/feedhq,vincentbernat/feedhq,vincentbernat/feedhq,feedhq/feedhq,feedhq/feedhq,rmoorman/feedhq,feedhq/feedhq,vincentbernat/feedhq,feedhq/feedhq
--- +++ @@ -7,8 +7,10 @@ from ratelimitbackend import admin admin.autodiscover() +# This patches User and needs to be done early +from .profiles.models import User, DjangoUser + from .profiles.forms import AuthForm -from .profiles.models import User, DjangoUser robots = lambda _: HttpResponse('User-agent: *\n...
b7d0d81bd6030abfee5b3993d42e02896e8c0b50
edpwd/random_string.py
edpwd/random_string.py
# -*- coding: utf-8 import random, string def random_string(length, letters=True, digits=True, punctuation=False, whitespace=False): """ Returns a random string """ chars = '' if letters: chars += string.ascii_letters if digits: chars += string.digits ...
# -*- coding: utf-8 from random import choice import string def random_string(length, letters=True, digits=True, punctuation=False, whitespace=False): """ Returns a random string """ chars = '' if letters: chars += string.ascii_letters if digits: chars +...
Revert "Use random.sample() rather than reinventing it."
Revert "Use random.sample() rather than reinventing it." My wrong. sample() doesn't allow repeating characters, so it's not exactly the same.
Python
bsd-2-clause
tampakrap/edpwd
--- +++ @@ -1,6 +1,7 @@ # -*- coding: utf-8 -import random, string +from random import choice +import string def random_string(length, letters=True, @@ -17,4 +18,4 @@ chars += string.punctuation if whitespace: chars += string.whitespace - return ''.join(random.sample(chars, le...
cb39c1edf395f7da1c241010fc833fe512fa74ac
bcbio/distributed/clargs.py
bcbio/distributed/clargs.py
"""Parsing of command line arguments into parallel inputs. """ def to_parallel(args, module="bcbio.distributed"): """Convert input arguments into a parallel dictionary for passing to processing. """ ptype, cores = _get_cores_and_type(args.numcores, getattr(args, "paralleltype", None), ...
"""Parsing of command line arguments into parallel inputs. """ def to_parallel(args, module="bcbio.distributed"): """Convert input arguments into a parallel dictionary for passing to processing. """ ptype, cores = _get_cores_and_type(args.numcores, getattr(args, "para...
Fix for bcbio-nextgen-vm not passing the local_controller option.
Fix for bcbio-nextgen-vm not passing the local_controller option.
Python
mit
brainstorm/bcbio-nextgen,brainstorm/bcbio-nextgen,vladsaveliev/bcbio-nextgen,vladsaveliev/bcbio-nextgen,lbeltrame/bcbio-nextgen,brainstorm/bcbio-nextgen,lbeltrame/bcbio-nextgen,a113n/bcbio-nextgen,biocyberman/bcbio-nextgen,vladsaveliev/bcbio-nextgen,lbeltrame/bcbio-nextgen,chapmanb/bcbio-nextgen,a113n/bcbio-nextgen,cha...
--- +++ @@ -4,15 +4,17 @@ def to_parallel(args, module="bcbio.distributed"): """Convert input arguments into a parallel dictionary for passing to processing. """ - ptype, cores = _get_cores_and_type(args.numcores, getattr(args, "paralleltype", None), + ptype, cores = _get_cores_and_type(args.numcores...
10be4d04d5e96993f5dd969b3b1fdb0686b11382
examples/basic_lock.py
examples/basic_lock.py
import asyncio import logging from aioredlock import Aioredlock, LockError async def basic_lock(): lock_manager = Aioredlock([{ 'host': 'localhost', 'port': 6374, 'db': 0, 'password': None }]) try: lock = await lock_manager.lock("resource") except LockError: ...
import asyncio import logging from aioredlock import Aioredlock, LockError async def basic_lock(): lock_manager = Aioredlock([{ 'host': 'localhost', 'port': 6379, 'db': 0, 'password': None }]) try: lock = await lock_manager.lock("resource") except LockError: ...
Revert unintented port change in example
Revert unintented port change in example
Python
mit
joanvila/aioredlock
--- +++ @@ -7,7 +7,7 @@ async def basic_lock(): lock_manager = Aioredlock([{ 'host': 'localhost', - 'port': 6374, + 'port': 6379, 'db': 0, 'password': None }])
99884ec3e960fa7b73e10a6969c455de6eca542b
src/ggrc_workflows/migrations/versions/20140715214934_26d9c9c91542_add_cycletaskgroupobject_object.py
src/ggrc_workflows/migrations/versions/20140715214934_26d9c9c91542_add_cycletaskgroupobject_object.py
"""Add CycleTaskGroupObject.object Revision ID: 26d9c9c91542 Revises: 19a67dc67c3 Create Date: 2014-07-15 21:49:34.073412 """ # revision identifiers, used by Alembic. revision = '26d9c9c91542' down_revision = '19a67dc67c3' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('cycle_tas...
"""Add CycleTaskGroupObject.object Revision ID: 26d9c9c91542 Revises: 19a67dc67c3 Create Date: 2014-07-15 21:49:34.073412 """ # revision identifiers, used by Alembic. revision = '26d9c9c91542' down_revision = '19a67dc67c3' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('cycle_tas...
Update migration to fix existing CycleTaskGroupObjects
Update migration to fix existing CycleTaskGroupObjects
Python
apache-2.0
NejcZupec/ggrc-core,hasanalom/ggrc-core,hyperNURb/ggrc-core,hasanalom/ggrc-core,vladan-m/ggrc-core,plamut/ggrc-core,uskudnik/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,jmakov/ggrc-core,AleksNeStu/ggrc-core,hyperNURb/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,hasanalom/ggrc-core,edofic/ggrc-core,prasannav7/ggrc-cor...
--- +++ @@ -19,6 +19,15 @@ op.add_column('cycle_task_group_objects', sa.Column('object_id', sa.Integer(), nullable=False)) op.add_column('cycle_task_group_objects', sa.Column('object_type', sa.String(length=250), nullable=False)) + op.execute(''' + UPDATE cycle_task_group_objects + JO...
18204d7e508052cfabc58bc58e4bb21be13fbd00
src/webapp/tasks.py
src/webapp/tasks.py
from uwsgidecorators import spool import database as db from database.model import Team from geotools import simple_distance from geotools.routing import MapPoint @spool def get_aqua_distance(args): team = db.session.query(Team).filter(Team.id == int(args["team_id"])).first() if team is None: return ...
import database as db from database.model import Team from geotools import simple_distance from geotools.routing import MapPoint try: from uwsgidecorators import spool except ImportError as e: def spool(fn): def nufun(*args, **kwargs): raise e return nufun @spool def get_aqua_dist...
Raise import errors for uwsgi decorators only if the task is called.
Raise import errors for uwsgi decorators only if the task is called.
Python
bsd-3-clause
janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system
--- +++ @@ -1,8 +1,15 @@ -from uwsgidecorators import spool import database as db from database.model import Team from geotools import simple_distance from geotools.routing import MapPoint + +try: + from uwsgidecorators import spool +except ImportError as e: + def spool(fn): + def nufun(*args, **kwar...
7f0b561625b94c6fa6b14dab4bbe02fa28d38bfa
statement_format.py
statement_format.py
import pandas as pd def fn(row): if row['Type'] == 'DIRECT DEBIT': return 'DD' if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME': return 'BP' if row['Amount (GBP)'] < 0: return 'SO' raise Exception('Unintended state') df = pd.read_csv('statement.csv') ...
import pandas as pd def fn(row): if row['Type'] == 'DIRECT DEBIT': return 'DD' if row['Type'] == 'DIRECT CREDIT' or row['Spending Category'] == 'INCOME': return 'BP' if row['Amount (GBP)'] < 0: return 'SO' raise Exception('Unintended state') df = pd.read_csv('statement.csv') ...
Correct numbers. Now to format output
Correct numbers. Now to format output
Python
mit
noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit
--- +++ @@ -15,10 +15,11 @@ output = df[['Date']] output['Type'] = df.apply(fn, axis=1) output['Description'] = df['Reference'] -output['Paid Out'] = df['Amount (GBP)'] -output['Paid In'] = df['Amount (GBP)'] -output[output['Paid Out'] < 0] = 0 -output[output['Paid In'] < 0] = 0 +output['Paid Out'] = df['Amount (G...
05f220d6090be58ee465b6f30d01e14079bcbeba
corehq/messaging/scheduling/scheduling_partitioned/dbaccessors.py
corehq/messaging/scheduling/scheduling_partitioned/dbaccessors.py
def save_schedule_instance(instance): instance.save()
from corehq.sql_db.util import ( get_object_from_partitioned_database, save_object_to_partitioned_database, run_query_across_partitioned_databases, ) from datetime import datetime from django.db.models import Q def get_schedule_instance(schedule_instance_id): from corehq.messaging.scheduling.schedulin...
Add functions for processing ScheduleInstances
Add functions for processing ScheduleInstances
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
--- +++ @@ -1,4 +1,47 @@ +from corehq.sql_db.util import ( + get_object_from_partitioned_database, + save_object_to_partitioned_database, + run_query_across_partitioned_databases, +) +from datetime import datetime +from django.db.models import Q + + +def get_schedule_instance(schedule_instance_id): + from...
955d83391540d9d1dd7732c204a99a51789745e4
config.py
config.py
from os import getenv, \ path from time import time from datetime import timedelta class Config(object): AWS_ACCESS_KEY_ID = getenv('AWS_ACCESS_KEY_ID') AWS_REGION = getenv('AWS_REGION') AWS_S3_BUCKET = getenv('AWS_S3_BUCKET') AWS_SECRET_ACCESS_KEY = getenv('AWS_SECRET_ACCESS_KEY') ...
from os import getenv, \ path from time import time from datetime import timedelta class Config(object): AWS_ACCESS_KEY_ID = getenv('AWS_ACCESS_KEY_ID') AWS_REGION = getenv('AWS_REGION') AWS_S3_BUCKET = getenv('AWS_S3_BUCKET') AWS_SECRET_ACCESS_KEY = getenv('AWS_SECRET_ACCESS_KEY') ...
Support mysql2: prefixed database url's
Support mysql2: prefixed database url's
Python
mit
taeram/aflutter,taeram/aflutter,taeram/aflutter,taeram/aflutter
--- +++ @@ -16,7 +16,7 @@ REMEMBER_COOKIE_DURATION = timedelta(days=30) SECRET_KEY = getenv('SECRET_KEY') SITE_NAME = getenv('SITE_NAME', 'Aflutter') - SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL') + SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL').replace('mysql2:', 'mysql:') SQLALCHEMY_...
2e10e1bbfe6c8b7b4fba9adfe0cbb8518a19eeca
config.py
config.py
import toml def parse(file): with open(file) as conffile: data = toml.loads(conffile.read()) return data
import pytoml def parse(file): with open(file) as conffile: data = pytoml.loads(conffile.read()) return data
Use pytoml instead of toml library
Use pytoml instead of toml library
Python
mit
mvdnes/mdms,mvdnes/mdms
--- +++ @@ -1,7 +1,7 @@ -import toml +import pytoml def parse(file): with open(file) as conffile: - data = toml.loads(conffile.read()) + data = pytoml.loads(conffile.read()) return data
fbe446727b35680e747c74816995f6b7912fffeb
syslights_server.py
syslights_server.py
#!/usr/bin/env python3 import sys import time import glob import serial import psutil CPU_INTERVAL = 0.5 CONNECT_TIMEOUT = 2 BAUD = 4800 def update_loop(conn): while True: load = psutil.cpu_percent(interval=CPU_INTERVAL) scaled_load = int(load * 10) message = str(scaled_load).encode('asc...
#!/usr/bin/env python3 import sys import time import glob import serial import psutil CPU_INTERVAL = 0.5 CONNECT_TIMEOUT = 2 BAUD = 4800 def update_loop(conn): while True: load = psutil.cpu_percent(interval=CPU_INTERVAL) scaled_load = int(load * 10) message = str(scaled_load).encode('asc...
Fix error handling in server
Fix error handling in server
Python
mit
swarmer/syslights
--- +++ @@ -18,8 +18,12 @@ message = str(scaled_load).encode('ascii') conn.write(message) -def connect_serial(DEVICE, BAUD): - conn = serial.Serial(DEVICE, BAUD) +def connect_serial(): + devices = glob.glob('/dev/ttyUSB?') + if not devices: + raise IOError() + + conn = serial.Se...