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 |
|---|---|---|---|---|---|---|---|---|---|---|
bf89baf003bace5b48bcf8421a0548c7e1fd73a0 | viper/interpreter/value.py | viper/interpreter/value.py | from .environment import Environment
from viper.parser.ast.nodes import Expr
class Value:
pass
class TupleVal(Value):
def __init__(self, *vals: Value):
self.vals = list(vals)
def __repr__(self) -> str:
return f"TupleVal({', '.join(map(str, self.vals))})"
class NumVal(Value):
def ... | from .environment import Environment
from viper.parser.ast.nodes import AST, Parameter
from typing import List
class Value:
pass
class TupleVal(Value):
def __init__(self, *vals: Value):
self.vals = list(vals)
def __repr__(self) -> str:
return f"TupleVal({', '.join(map(str, self.vals))... | Update CloVal to allow for specifying multiple parameters | Update CloVal to allow for specifying multiple parameters
| Python | apache-2.0 | pdarragh/Viper | ---
+++
@@ -1,6 +1,8 @@
from .environment import Environment
-from viper.parser.ast.nodes import Expr
+from viper.parser.ast.nodes import AST, Parameter
+
+from typing import List
class Value:
@@ -24,13 +26,13 @@
class CloVal(Value):
- def __init__(self, name: str, expr: Expr, env: Environment):
- ... |
312bb90415218398ddbe9250cfe7dbc4bb013e14 | opal/core/lookuplists.py | opal/core/lookuplists.py | """
OPAL Lookuplists
"""
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
# class LookupList(models.Model):
# class Meta:
# abstract = True
class LookupList(models.Model):
name = models.CharField(max_length=255, unique=True)
synonyms = GenericRelation('o... | """
OPAL Lookuplists
"""
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
class LookupList(models.Model):
name = models.CharField(max_length=255, unique=True)
synonyms = GenericRelation('opal.Synonym')
class Meta:
ordering = ['name']
abstract = Tr... | Delete commented out old code. | Delete commented out old code.
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | ---
+++
@@ -3,11 +3,6 @@
"""
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
-
-# class LookupList(models.Model):
-# class Meta:
-# abstract = True
-
class LookupList(models.Model):
name = models.CharField(max_length=255, unique=True)
@@ -22,22 +17,3 ... |
35f286ac175d5480d3dbb7261205f12dd97144bb | checkmail.py | checkmail.py | #!/usr/bin/env python
"""
Simple Python module to parse a Thunderbird mail file and
scan each email message with ClamAV in order to detect
suspect messages.
"""
import pyclamav
import os
import re
import email
import argparse
import sys
import tempfile
mail_split_re = re.compile(r'\s(?=From -)')
def pr... | #!/usr/bin/env python
"""
Simple Python module to parse a Thunderbird mail file and
scan each email message with ClamAV in order to detect
suspect messages.
"""
import pyclamav
import os
import email
import argparse
import sys
import tempfile
import mailbox
def print_message(parsed, signature=None):
... | Use the python MBox class rather than parsing the mailbox manually | Use the python MBox class rather than parsing the mailbox manually
| Python | mit | DanSearle/CheckMail | ---
+++
@@ -8,17 +8,14 @@
import pyclamav
import os
-import re
import email
import argparse
import sys
import tempfile
-
-mail_split_re = re.compile(r'\s(?=From -)')
+import mailbox
-def print_message(message, signature=None):
- parsed = email.message_from_string(message)
+def print_message(parsed, sig... |
f54123b1727f0af424d31398e7397300975b0272 | grow/submodules/__init__.py | grow/submodules/__init__.py | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | import os
import sys
def fix_imports():
here = os.path.dirname(__file__)
dirs = [
os.path.normpath(os.path.join(here, '..', '..')),
os.path.normpath(os.path.join(here, 'babel')),
os.path.normpath(os.path.join(here, 'dulwich')),
os.path.normpath(os.path.join(here, 'google-apputils-python'))... | Use python2 pyyaml instead of python3. | Use python2 pyyaml instead of python3.
| Python | mit | denmojo/pygrow,grow/grow,grow/grow,denmojo/pygrow,grow/pygrow,grow/grow,vitorio/pygrow,codedcolors/pygrow,grow/pygrow,vitorio/pygrow,grow/grow,denmojo/pygrow,vitorio/pygrow,denmojo/pygrow,grow/pygrow,codedcolors/pygrow,codedcolors/pygrow | ---
+++
@@ -11,7 +11,7 @@
os.path.normpath(os.path.join(here, 'google-apputils-python')),
os.path.normpath(os.path.join(here, 'httplib2', 'python2')),
os.path.normpath(os.path.join(here, 'pytz')),
- os.path.normpath(os.path.join(here, 'pyyaml', 'lib2')),
+ os.path.normpath(os.path.join(... |
842cfc631949831053f4310f586e7b2a83ff7cde | notifications_utils/timezones.py | notifications_utils/timezones.py | from datetime import datetime
import pytz
from dateutil import parser
local_timezone = pytz.timezone("Europe/London")
def utc_string_to_aware_gmt_datetime(date):
"""
Date can either be a string or a naive datetime
"""
if not isinstance(date, datetime):
date = parser.parse(date)
forced_u... | from datetime import datetime
import pytz
from dateutil import parser
local_timezone = pytz.timezone("Europe/London")
def utc_string_to_aware_gmt_datetime(date):
"""
Date can either be a string, naive UTC datetime or an aware UTC datetime
Returns an aware London datetime, essentially the time you'd see ... | Add descriptions to timezone functions | Add descriptions to timezone functions
These are quite complex things and benefit from having better descriptions.
Note, we weren't quite happy with the names of the functions.
`aware_gmt_datetime` should really be `aware_london_datetime` and
the other two functions could have more verbose names (mentioning
that the... | Python | mit | alphagov/notifications-utils | ---
+++
@@ -8,7 +8,8 @@
def utc_string_to_aware_gmt_datetime(date):
"""
- Date can either be a string or a naive datetime
+ Date can either be a string, naive UTC datetime or an aware UTC datetime
+ Returns an aware London datetime, essentially the time you'd see on your clock
"""
if not is... |
38bf0cba402d3c747584b8aae109c3735d23f6fa | config/settings/__init__.py | config/settings/__init__.py | import os
# include settimgs from daiquiri
from daiquiri.core.settings import *
# include settings from base.py
from .base import *
# include settings from local.py
from .local import *
# include 3rd party apps after the daiquiri apps from base.py
INSTALLED_APPS = DJANGO_APPS + DAIQUIRI_APPS + ADDITIONAL_APPS + INS... | import os
# include settimgs from daiquiri
from daiquiri.core.settings import *
# include settings from base.py
from .base import *
# include settings from local.py
from .local import *
# include 3rd party apps after the daiquiri apps from base.py
INSTALLED_APPS = DJANGO_APPS + DAIQUIRI_APPS + ADDITIONAL_APPS + INS... | Fix prepend BASE_URL for ACCOUNT_LOGOUT_REDIRECT_URL | Fix prepend BASE_URL for ACCOUNT_LOGOUT_REDIRECT_URL
| Python | apache-2.0 | aipescience/django-daiquiri-app,aipescience/django-daiquiri-app | ---
+++
@@ -17,7 +17,7 @@
LOGIN_URL = BASE_URL + LOGIN_URL
LOGIN_REDIRECT_URL = BASE_URL + LOGIN_REDIRECT_URL
LOGOUT_URL = BASE_URL + LOGOUT_URL
- ACCOUNT_LOGOUT_REDIRECT_URL = BASE_URL
+ ACCOUNT_LOGOUT_REDIRECT_URL = BASE_URL + ACCOUNT_LOGOUT_REDIRECT_URL
MEDIA_URL = BASE_URL + MEDIA_URL
... |
6992437bd82fa6524b5c7ed98370e2e7c3ad0ee3 | dj_experiment/management/commands/infocatalog.py | dj_experiment/management/commands/infocatalog.py | from dj_experiment.models import Catalog
from django.core.management.base import BaseCommand, CommandError
from humanfriendly.tables import format_pretty_table
class Command(BaseCommand):
"""Retrieve information about experiments from the catalog."""
help = 'Retrieve information about experiments from the ca... | from dj_experiment.models import Catalog
from django.core.management.base import BaseCommand, CommandError
from humanfriendly.tables import format_pretty_table
class Command(BaseCommand):
"""Retrieve information about experiments from the catalog."""
help = 'Retrieve information about experiments from the ca... | Fix query by unique name | Fix query by unique name
| Python | mit | francbartoli/dj-experiment,francbartoli/dj-experiment | ---
+++
@@ -18,7 +18,7 @@
raise CommandError("infocatalog takes no arguments")
column_names = ['Catalog Name']
# [self.stdout.write(cat, ending='') for cat in Catalog.objects.all()]
- catalog = [cat.title for cat in Catalog.objects.all()]
+ catalog = [cat.name for cat in C... |
41f254bd53ca6998725c959d9abe71975cffc92f | froide/accesstoken/admin.py | froide/accesstoken/admin.py | from django.contrib import admin
from .models import AccessToken
class AccessTokenAdmin(admin.ModelAdmin):
raw_id_fields = ('user',)
admin.site.register(AccessToken, AccessTokenAdmin)
| from django.contrib import admin
from .models import AccessToken
class AccessTokenAdmin(admin.ModelAdmin):
raw_id_fields = ('user',)
list_filter = ('purpose',)
search_fields = ('user__email',)
admin.site.register(AccessToken, AccessTokenAdmin)
| Add search, filter to access tokens | Add search, filter to access tokens | Python | mit | stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide | ---
+++
@@ -5,6 +5,8 @@
class AccessTokenAdmin(admin.ModelAdmin):
raw_id_fields = ('user',)
+ list_filter = ('purpose',)
+ search_fields = ('user__email',)
admin.site.register(AccessToken, AccessTokenAdmin) |
38c2f86e8784530efc0234851d3bb9ebbfef58f5 | froide/account/api_views.py | froide/account/api_views.py | from rest_framework import serializers, views, permissions, response
from oauth2_provider.contrib.rest_framework import TokenHasScope
from .models import User
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id',)
def to_representation(self, ... | from rest_framework import serializers, views, permissions, response
from .models import User
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('id', 'private')
def to_representation(self, obj):
default = super(UserSerializer, self).to_r... | Make logged in user endpoint available w/o token | Make logged in user endpoint available w/o token | Python | mit | stefanw/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide | ---
+++
@@ -1,6 +1,4 @@
from rest_framework import serializers, views, permissions, response
-
-from oauth2_provider.contrib.rest_framework import TokenHasScope
from .models import User
@@ -8,7 +6,7 @@
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
- ... |
97db526a655f9723342df3c0c27e7325002c50aa | ovp_users/serializers.py | ovp_users/serializers.py | from django.core.exceptions import ValidationError
from django.contrib.auth.password_validation import validate_password
from ovp_users import models
from rest_framework import serializers
class UserCreateSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
fields = ['id', 'name', 'email'... | from django.core.exceptions import ValidationError
from django.contrib.auth.password_validation import validate_password
from ovp_users import models
from rest_framework import serializers
class UserCreateSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
fields = ['id', 'name', 'email'... | Add password as a write_only field on CreateUserSerializer | Add password as a write_only field on CreateUserSerializer
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-users,OpenVolunteeringPlatform/django-ovp-users | ---
+++
@@ -7,6 +7,7 @@
class Meta:
model = models.User
fields = ['id', 'name', 'email', 'password']
+ extra_kwargs = {'password': {'write_only': True}}
def validate(self, data):
password = data.get('password')
@@ -14,7 +15,6 @@
errors = dict()
try:
validate_password... |
a0baec4446efb96483d414a11bc71a483ded1d2b | tests/alerts/alert_test_case.py | tests/alerts/alert_test_case.py | import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../alerts"))
from alert_test_suite import AlertTestSuite
class AlertTestCase(object):
def __init__(self, description, events=[], events_type='event', expected_alert=None):
self.description = description
# As a r... | import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../alerts"))
from alert_test_suite import AlertTestSuite
class AlertTestCase(object):
def __init__(self, description, events=[], expected_alert=None):
self.description = description
# As a result of defining our... | Remove events_type from alert test case | Remove events_type from alert test case
| Python | mpl-2.0 | mpurzynski/MozDef,mpurzynski/MozDef,jeffbryner/MozDef,mozilla/MozDef,mpurzynski/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,mozilla/MozDef,mozilla/MozDef,mozilla/MozDef,jeffbryner/MozDef,jeffbryner/MozDef | ---
+++
@@ -6,14 +6,13 @@
class AlertTestCase(object):
- def __init__(self, description, events=[], events_type='event', expected_alert=None):
+ def __init__(self, description, events=[], expected_alert=None):
self.description = description
# As a result of defining our test cases as clas... |
454b1ee88a0dea04fc7a551a411fad060546f391 | document/management/commands/clean_submitters.py | document/management/commands/clean_submitters.py | import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from document.models import Document
from document.models import Submitter
logger = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
self.do()
@transacti... | import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from document.models import Document
from document.models import Submitter
logger = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
self.do()
# @transac... | Remove atomic transaction from command to reduce memory usage | Remove atomic transaction from command to reduce memory usage
| Python | mit | openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer | ---
+++
@@ -14,7 +14,7 @@
def handle(self, *args, **options):
self.do()
- @transaction.atomic
+ # @transaction.atomic
def do(self):
submitters = Submitter.objects.all()
documents = Document.objects.all()
@@ -22,7 +22,7 @@
n_docs = documents.count()
print(... |
5a8348fa634748caf55f1c35e204fda500297157 | pywkeeper.py | pywkeeper.py | #!/usr/bin/env python
import json
import os
import optparse
import random
from crypto import *
from file_io import *
from settings import *
options = None
arguments = None
def main():
if arguments[0] == 'generate':
generate()
elif arguments[0] == 'save':
save()
elif arguments[0] == 'edit'... | #!/usr/bin/env python
import json
import os
import optparse
import random
from crypto import *
from file_io import *
from settings import *
options = None
arguments = None
def main():
if arguments[0] == 'generate':
generate()
elif arguments[0] == 'save':
save()
elif arguments[0] == 'edit'... | Use optparser for generate length | Use optparser for generate length
| Python | unlicense | kvikshaug/pwkeeper | ---
+++
@@ -37,16 +37,14 @@
print("Plaintext written to: %s" % os.path.abspath(DECRYPTED_FILE))
def generate():
- if len(arguments) == 2:
- length = int(arguments[1])
- else:
- length = DEFAULT_PASSWORD_LENGTH
+ length = options.n if options.n else DEFAULT_PASSWORD_LENGTH
for i in ... |
a09491de1278db810c31280405c923c30337deb0 | scanblog/scanning/management/commands/fixuploadperms.py | scanblog/scanning/management/commands/fixuploadperms.py | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | Change order of permission changes | Change order of permission changes
| Python | agpl-3.0 | yourcelf/btb,yourcelf/btb,flexpeace/btb,yourcelf/btb,flexpeace/btb,flexpeace/btb,flexpeace/btb,yourcelf/btb,flexpeace/btb,yourcelf/btb | ---
+++
@@ -14,8 +14,8 @@
os.path.join(settings.MEDIA_ROOT, "page_picker_thumbs"),
settings.PUBLIC_MEDIA_ROOT):
print dirname
- os.system('sudo chown -R www-data.btb "%s"' % dirname)
# files: -rw-rw-r--
os.system('sudo... |
3ba3788fd8b1aa614056de144b6262c921d83702 | python/qitools/interact.py | python/qitools/interact.py | ## Copyright (C) 2011 Aldebaran Robotics
"""Small set of tools to interact with the user
"""
#TODO: color!
def ask_choice(choices, input_text):
"""Ask the user to choose from a list of choices
"""
print "::", input_text
for i, choice in enumerate(choices):
print " ", (i+1), choice
keep... | ## Copyright (C) 2011 Aldebaran Robotics
"""Small set of tools to interact with the user
"""
#TODO: color!
def ask_choice(choices, input_text):
"""Ask the user to choose from a list of choices
"""
print "::", input_text
for i, choice in enumerate(choices):
print " ", (i+1), choice
keep... | Fix typo in variable name | Fix typo in variable name
| Python | bsd-3-clause | dmerejkowsky/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild | ---
+++
@@ -35,8 +35,8 @@
def ask_yes_no(question):
"""Ask the user to answer by yes or no"""
print "::", question, "(y/n)?"
- anwer = raw_input("> ")
- return anwer == "y"
+ answer = raw_input("> ")
+ return answer == "y"
def ask_string(question, default=None):
"""Ask the user to enter... |
80bdeb25795776bd73b911909863bc54b0afeea4 | tree/treeplayer/test/dataframe/dataframe_histograms.py | tree/treeplayer/test/dataframe/dataframe_histograms.py | import unittest
import ROOT
class HistogramsFromTDF(unittest.TestCase):
@classmethod
def setUp(cls):
ROOT.gRandom.SetSeed(1)
def test_histo1D(self):
ROOT.gRandom.SetSeed(1)
tdf = ROOT.ROOT.Experimental.TDataFrame(64)
g = tdf.Define("r","gRandom->Gaus(0,1)")
h1Proxy = g.Histo1D(... | import unittest
import ROOT
class HistogramsFromTDF(unittest.TestCase):
@classmethod
def setUp(cls):
ROOT.gRandom.SetSeed(1)
def test_histo1D(self):
ROOT.gRandom.SetSeed(1)
tdf = ROOT.ROOT.Experimental.TDataFrame(64)
g = tdf.Define("r","gRandom->Gaus(0,1)")
h1Proxy ... | Replace tabs with spaces in the unit tests. | [TDF] Replace tabs with spaces in the unit tests.
| Python | lgpl-2.1 | karies/root,root-mirror/root,karies/root,root-mirror/root,root-mirror/root,karies/root,olifre/root,zzxuanyuan/root,zzxuanyuan/root,root-mirror/root,olifre/root,olifre/root,zzxuanyuan/root,zzxuanyuan/root,olifre/root,zzxuanyuan/root,root-mirror/root,zzxuanyuan/root,olifre/root,karies/root,karies/root,zzxuanyuan/root,roo... | ---
+++
@@ -7,11 +7,11 @@
ROOT.gRandom.SetSeed(1)
def test_histo1D(self):
- ROOT.gRandom.SetSeed(1)
- tdf = ROOT.ROOT.Experimental.TDataFrame(64)
- g = tdf.Define("r","gRandom->Gaus(0,1)")
- h1Proxy = g.Histo1D(("h1","h1",64, -2., 2.),"r")
- h1 = h1Proxy.GetValue()
+ ROOT.gR... |
836551789ee6764f48a1328804c55222acc106b1 | lc131_palindrome_partitioning.py | lc131_palindrome_partitioning.py | """Leetcode 131. Palindrome Partitioning
Medium
URL: https://leetcode.com/problems/palindrome-partitioning/
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: "aab"
Output:
[
["aa","b"],
["a","a","b"]
]
"""
... | """Leetcode 131. Palindrome Partitioning
Medium
URL: https://leetcode.com/problems/palindrome-partitioning/
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: "aab"
Output:
[
["aa","b"],
["a","a","b"]
]
"""
... | Use partial for duplicated partial string | Use partial for duplicated partial string
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | ---
+++
@@ -25,7 +25,8 @@
for i in range(start, len(s)):
# Check if palindrome.
- if s[start:i+1] == s[start:i+1][::-1]:
+ partial = s[start:i+1]
+ if partial == partial[::-1]:
temps.append(s[start:i+1])
self._backtrack(result,... |
703861029a2d3a36bbb18ed9e56c55064323478c | account_banking_payment_export/migrations/8.0.0.1.166/pre-migrate.py | account_banking_payment_export/migrations/8.0.0.1.166/pre-migrate.py | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | Check if column exists before creating it | [FIX] account_banking_payment_export: Check if column exists before creating it
| Python | agpl-3.0 | incaser/bank-payment,damdam-s/bank-payment,sergiocorato/bank-payment,Antiun/bank-payment,acsone/bank-payment,damdam-s/bank-payment,CompassionCH/bank-payment,diagramsoftware/bank-payment,sergiocorato/bank-payment,open-synergy/bank-payment,hbrunn/bank-payment,Antiun/bank-payment,CompassionCH/bank-payment | ---
+++
@@ -20,7 +20,14 @@
def migrate(cr, version):
- cr.execute('alter table payment_order add column total numeric')
+ cr.execute(
+ 'SELECT count(attname) FROM pg_attribute '
+ 'WHERE attrelid = '
+ '( SELECT oid FROM pg_class WHERE relname = %s ) '
+ 'AND attname = %s',
+ ... |
d521435ecd6082d0235ef489fd6ae3395bbbfc44 | poradnia/config/local.py | poradnia/config/local.py | # -*- coding: utf-8 -*-
'''
Local Configurations
- Runs in Debug mode
- Uses console backend for emails
- Use Django Debug Toolbar
'''
from configurations import values
from .common import Common
class Local(Common):
# DEBUG
DEBUG = values.BooleanValue(True)
TEMPLATE_DEBUG = DEBUG
# END DEBUG
#... | # -*- coding: utf-8 -*-
'''
Local Configurations
- Runs in Debug mode
- Uses console backend for emails
- Use Django Debug Toolbar
'''
from configurations import values
from .common import Common
class Local(Common):
# DEBUG
DEBUG = values.BooleanValue(True)
TEMPLATE_DEBUG = DEBUG
# END DEBUG
#... | Drop loading jquery by django-debug-toolbar - it is integrated now | Drop loading jquery by django-debug-toolbar - it is integrated now
| Python | mit | watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia | ---
+++
@@ -38,7 +38,6 @@
'debug_toolbar.panels.redirects.RedirectsPanel',
],
'SHOW_TEMPLATE_CONTEXT': True,
- 'JQUERY_URL': 'http://localhost:8000/static/js/jquery.min.js',
}
# end django-debug-toolbar |
2b8377d968dc336cd344dd4191e24b3c4f76857d | openedx/core/djangoapps/content/course_overviews/migrations/0009_readd_facebook_url.py | openedx/core/djangoapps/content/course_overviews/migrations/0009_readd_facebook_url.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models, OperationalError, connection
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
class Migration(migrations.Migration):
dependencies = [
('course_overviews', '0008_rem... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models, connection
def table_description():
"""Handle Mysql/Pg vs Sqlite"""
# django's mysql/pg introspection.get_table_description tries to select *
# from table and fails during initial migrations from scra... | Migrate correctly from scratch also | Migrate correctly from scratch also
Unfortunately, instrospection.get_table_description runs
select * from course_overview_courseoverview, which of course
does not exist while django is calculating initial migrations, causing
this to fail. Additionally, sqlite does not support information_schema,
but does not do a se... | Python | agpl-3.0 | Edraak/circleci-edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/circleci-edx-platform,Edraak/circleci-edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/circleci-edx-platform,Edraak/circleci-edx-platform | ---
+++
@@ -1,8 +1,27 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-from django.db import migrations, models, OperationalError, connection
-from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
+from django.db import migrations, models, connection
+
+def table_de... |
dd646b7573c1e2bb41f60723e02aa6ddf58d59f6 | kobo/apps/help/permissions.py | kobo/apps/help/permissions.py | # coding: utf-8
from rest_framework import permissions
class InAppMessagePermissions(permissions.BasePermission):
def has_permission(self, request, view):
if not request.user.is_authenticated:
# Deny access to anonymous users
return False
if request.user.is_superuser:
... | # coding: utf-8
from rest_framework import exceptions, permissions
class InAppMessagePermissions(permissions.BasePermission):
def has_permission(self, request, view):
if not request.user.is_authenticated:
# Deny access to anonymous users
return False
if request.user.is_supe... | Fix Python 2-to-3 bug in in-app messages | Fix Python 2-to-3 bug in in-app messages
…so that the permission check for `PATCH`ing `interactions` does not
always fail. Fixes #2762
| Python | agpl-3.0 | kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi | ---
+++
@@ -1,5 +1,5 @@
# coding: utf-8
-from rest_framework import permissions
+from rest_framework import exceptions, permissions
class InAppMessagePermissions(permissions.BasePermission):
@@ -19,9 +19,19 @@
# that's what the DRF "Browsable API" does, at least. We'll
# wave i... |
61db23b71aa15d14b8c88e36205c17cc1b01882f | frontends/etiquette_flask/etiquette_flask_prod.py | frontends/etiquette_flask/etiquette_flask_prod.py | '''
This file is the WSGI entrypoint for remote / production use.
If you are using Gunicorn, for example:
gunicorn etiquette_flask_prod:site --bind "0.0.0.0:PORT" --access-logfile "-"
'''
import werkzeug.middleware.proxy_fix
import backend
backend.site.wsgi_app = werkzeug.middleware.proxy_fix.ProxyFix(backend.site.w... | '''
This file is the WSGI entrypoint for remote / production use.
If you are using Gunicorn, for example:
gunicorn etiquette_flask_prod:site --bind "0.0.0.0:PORT" --access-logfile "-"
'''
import werkzeug.middleware.proxy_fix
import backend
backend.site.wsgi_app = werkzeug.middleware.proxy_fix.ProxyFix(backend.site.w... | Remove arg create because it will use closest_photodb. | Remove arg create because it will use closest_photodb.
| Python | bsd-3-clause | voussoir/etiquette,voussoir/etiquette,voussoir/etiquette | ---
+++
@@ -12,4 +12,4 @@
site = backend.site
-backend.common.init_photodb(create=False)
+backend.common.init_photodb() |
5355d55bf4ca0c4c0a3f2ee53f59275ef393af9d | dallinger_scripts/worker.py | dallinger_scripts/worker.py | """Heroku web worker."""
listen = ["high", "default", "low"]
def main():
import gevent.monkey
gevent.monkey.patch_all()
from gevent.queue import LifoQueue
# These imports are inside the __main__ block
# to make sure that we only import from rq_gevent_worker
# (which has the side effect of ap... | """Heroku web worker."""
listen = ["high", "default", "low"]
def main():
import gevent.monkey
gevent.monkey.patch_all()
from gevent.queue import LifoQueue
# These imports are inside the __main__ block
# to make sure that we only import from rq_gevent_worker
# (which has the side effect of ap... | Remove cert requirements from hopefully last spot | Remove cert requirements from hopefully last spot
| Python | mit | Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger | ---
+++
@@ -28,7 +28,9 @@
redis_url = os.getenv("REDIS_URL", "redis://localhost:6379")
# Specify queue class for improved performance with gevent.
# see http://carsonip.me/posts/10x-faster-python-gevent-redis-connection-pool/
- redis_pool = BlockingConnectionPool.from_url(redis_url, queue_class=Lifo... |
3df97670f91c20ff2da26936dcf40592dbef89f0 | indra/sources/crog/__init__.py | indra/sources/crog/__init__.py | # -*- coding: utf-8 -*-
"""Processor for the `Chemical Roles Graph (CRoG)
<https://github.com/chemical-roles/chemical-roles>`_.
Contains axiomization of ChEBI roles, their targets, and actual
relationship polarity.
* `Extension of Roles in the ChEBI Ontology
<https://doi.org/10.26434/chemrxiv.12591221>`_.
Hoyt... | # -*- coding: utf-8 -*-
"""Processor for the `Chemical Roles Graph (CRoG)
<https://github.com/chemical-roles/chemical-roles>`_.
Contains axiomization of ChEBI roles, their targets, and actual
relationship polarity.
* `Extension of Roles in the ChEBI Ontology
<https://doi.org/10.26434/chemrxiv.12591221>`_.
Hoyt, ... | Fix citation formatting in docstring | Fix citation formatting in docstring
| Python | bsd-2-clause | bgyori/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/belpy,bgyori/indra | ---
+++
@@ -7,8 +7,9 @@
relationship polarity.
* `Extension of Roles in the ChEBI Ontology
- <https://doi.org/10.26434/chemrxiv.12591221>`_.
- Hoyt, C. T., *et al.* (2020). *ChemRxiv*, 12591221.
+ <https://doi.org/10.26434/chemrxiv.12591221>`_.
+ Hoyt, C. T., *et al.* (2020). *ChemRxiv*, 12591221.
+
"""
... |
5b7469d573235405f735089e87d3b939b1a5e142 | tests/test_quotes.py | tests/test_quotes.py | import wikiquote
import unittest
class QuotesTest(unittest.TestCase):
"""
Test wikiquote.quotes()
"""
def test_disambiguation(self):
self.assertRaises(wikiquote.DisambiguationPageException,
wikiquote.quotes,
'Matrix')
def test_no_such_pa... | import wikiquote
import unittest
class QuotesTest(unittest.TestCase):
"""
Test wikiquote.quotes()
"""
def test_disambiguation(self):
self.assertRaises(wikiquote.DisambiguationPageException,
wikiquote.quotes,
'Matrix')
def test_no_such_pa... | Add test for alternate version of cast credit | Add test for alternate version of cast credit
| Python | mit | federicotdn/python-wikiquotes,jakerockland/python-wikiquotes | ---
+++
@@ -23,3 +23,10 @@
def test_max_quotes(self):
quotes = wikiquote.quotes('The Matrix (film)', max_quotes = 8)
self.assertEqual(len(quotes), 8)
+
+ def test_is_cast_credit(self):
+ cast1 = 'Bryan Cranston - Walter White'.split()
+ cast2 = 'Giancarlo Esposito - Gustavo "Gus" F... |
53c014a5ccff103a89c2b9ff9b5f1f30b5d4f7b0 | tests/test_states.py | tests/test_states.py | # coding: utf-8
import pytest
from mmvdApp.utils import objective_function
from mmvdApp.utils import valid_solution
@pytest.mark.utils
@pytest.mark.linprog
def test_objective_function(states1):
"""
Test if ``utils.linprog.objective_function`` correctly calculates expected
objective function value.
"""... | # coding: utf-8
import pytest
from mmvdApp.utils import objective_function
from mmvdApp.utils import valid_solution
from mmvdApp.utils import InvalidOrderException
@pytest.mark.utils
@pytest.mark.linprog
def test_objective_function(states1):
"""
Test if ``utils.linprog.objective_function`` correctly calculate... | Test missing checking for InvalidOrderException raised | Fix: Test missing checking for InvalidOrderException raised
| Python | mit | WojciechFocus/MMVD,WojciechFocus/MMVD | ---
+++
@@ -2,6 +2,7 @@
import pytest
from mmvdApp.utils import objective_function
from mmvdApp.utils import valid_solution
+from mmvdApp.utils import InvalidOrderException
@pytest.mark.utils
@@ -27,4 +28,5 @@
assert valid_solution(states1, order, drop_zone1)
# check for valid solution when one pr... |
c1b600596e49409daf31d20f821f280d0aadf124 | emission/net/usercache/formatters/android/motion_activity.py | emission/net/usercache/formatters/android/motion_activity.py | import logging
import emission.core.wrapper.motionactivity as ecwa
import emission.net.usercache.formatters.common as fc
import attrdict as ad
def format(entry):
formatted_entry = ad.AttrDict()
formatted_entry["_id"] = entry["_id"]
formatted_entry.user_id = entry.user_id
metadata = entry.metadata
... | import logging
import emission.core.wrapper.motionactivity as ecwa
import emission.net.usercache.formatters.common as fc
import attrdict as ad
def format(entry):
formatted_entry = ad.AttrDict()
formatted_entry["_id"] = entry["_id"]
formatted_entry.user_id = entry.user_id
metadata = entry.metadata
... | Support the new google play motion activity format | Support the new google play motion activity format
As part of the change to slim down the apk for android,
https://github.com/e-mission/e-mission-phone/pull/46,
https://github.com/e-mission/e-mission-data-collection/pull/116
we switched from google play version from 8.1.0 to 8.3.0, which is the version
that has separa... | Python | bsd-3-clause | yw374cornell/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-... | ---
+++
@@ -18,13 +18,18 @@
data = ad.AttrDict()
if 'agb' in entry.data:
data.type = ecwa.MotionTypes(entry.data.agb).value
+ elif 'zzaEg' in entry.data:
+ data.type = ecwa.MotionTypes(entry.data.zzaEg).value
else:
- data.type = ecwa.MotionTypes(entry.data.zzaEg).value
+ ... |
61c256b11897fb7130faadbe2ffa3d02d0863db6 | scripts/export-tutorial.py | scripts/export-tutorial.py | """
Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their
support files in the ../docs/tutorial folder.
"""
import subprocess
import os
# Get the list of tutorial notebooks.
tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in... | """
Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their
support files in the ../docs/tutorial folder.
"""
import subprocess
import os
# Get the list of tutorial notebooks.
tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in... | Remove old criuft. FIx. Partially fix export issue. | Remove old criuft. FIx. Partially fix export issue.
| Python | mit | ResidentMario/geoplot | ---
+++
@@ -17,6 +17,7 @@
# Get the list of generated files.
gened_files = [f for f in os.listdir(".") if (".py" not in f)]
-# Move them to where they need to be.
+# Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the
+# files are hosted.
for file in gen... |
ca33afb60d98da4d54c1bce8eef6e7251aaaff7f | runserver.py | runserver.py | from dasem.app import app
# WSGIServer server better than werkzeug
# http://stackoverflow.com/questions/37962925/
from gevent.wsgi import WSGIServer
http_server = WSGIServer(('', 5000), app)
http_server.serve_forever()
| """Entrypoint to start app."""
from gevent.wsgi import WSGIServer
import logging
from dasem.app import create_app
app = create_app(logging_level=logging.DEBUG)
# WSGIServer server better than werkzeug
# http://stackoverflow.com/questions/37962925/
http_server = WSGIServer(('', 5000), app)
http_server.serve_foreve... | Change to use app factory | Change to use app factory
| Python | apache-2.0 | fnielsen/dasem,fnielsen/dasem | ---
+++
@@ -1,7 +1,15 @@
-from dasem.app import app
+"""Entrypoint to start app."""
+
+from gevent.wsgi import WSGIServer
+
+import logging
+
+from dasem.app import create_app
+
+
+app = create_app(logging_level=logging.DEBUG)
# WSGIServer server better than werkzeug
# http://stackoverflow.com/questions/37962925/... |
e93151490ea9c96b3856ec2e269552d8b52e0355 | lobster/cmssw/__init__.py | lobster/cmssw/__init__.py | from job import JobProvider
from publish import publish
from jobit import JobitStore
from merge import MergeProvider
| from job import JobProvider
from jobit import JobitStore
from merge import MergeProvider
from plotting import plot
from publish import publish
| Add plotting to the default imports of cmssw. | Add plotting to the default imports of cmssw.
| Python | mit | matz-e/lobster,matz-e/lobster,matz-e/lobster | ---
+++
@@ -1,4 +1,5 @@
from job import JobProvider
-from publish import publish
from jobit import JobitStore
from merge import MergeProvider
+from plotting import plot
+from publish import publish |
efcafd02930d293f780c4d18910c5a732c552c43 | scheduler.py | scheduler.py | from apscheduler.schedulers.blocking import BlockingScheduler
import logging
import warner
import archiver
import announcer
import flagger
import os
logging.basicConfig()
sched = BlockingScheduler()
@sched.scheduled_job("cron", hour=4)
#@sched.scheduled_job("cron", hour="*", minute="*/10") # for testing
def destalina... | from apscheduler.schedulers.blocking import BlockingScheduler
import logging
import warner
import archiver
import announcer
import flagger
import os
# When testing changes, set the "TEST_SCHEDULE" envvar to run more often
if os.getenv("TEST_SCHEDULE"):
schedule_kwargs = {"hour": "*", "minute": "*/10"}
else:
s... | Switch to a test schedule based on the environment | Switch to a test schedule based on the environment
Switching an environment variable and kicking the `clock` process feels
like a neater solution than commenting out one line, uncommenting
another, and redeploying.
| Python | apache-2.0 | rossrader/destalinator | ---
+++
@@ -6,11 +6,17 @@
import flagger
import os
+
+# When testing changes, set the "TEST_SCHEDULE" envvar to run more often
+if os.getenv("TEST_SCHEDULE"):
+ schedule_kwargs = {"hour": "*", "minute": "*/10"}
+else:
+ schedule_kwargs = {"hour": 4}
+
logging.basicConfig()
sched = BlockingScheduler()
-@... |
cdb32cd52552843400cfd5738458f3c2d26b0137 | app.py | app.py | """Web app that serves proselint's API."""
from flask import Flask, request
import subprocess
from flask_cors import CORS, cross_origin
import uuid
import os
import re
import urllib2
import json
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = "Origin, X-Requested-With,Content-Type, Accept"
@app.... | """Web app that serves proselint's API."""
from flask import Flask, request
import subprocess
from flask_cors import CORS, cross_origin
import uuid
import os
import re
import urllib2
import json
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = "Origin, X-Requested-With,Content-Type, Accept"
@app.... | Allow POST requests on server side | Allow POST requests on server side
| Python | bsd-3-clause | jstewmon/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint | ---
+++
@@ -14,7 +14,7 @@
app.config['CORS_HEADERS'] = "Origin, X-Requested-With,Content-Type, Accept"
-@app.route('/v1/')
+@app.route('/v1/', methods=['GET', 'POST'])
@cross_origin() # allow all origins all methods.
def lint():
"""Run linter on the provided text and return the results.""" |
b31a4eb259a0f165ea29c76a86c3683f33f079cd | bot.py | bot.py | from flask import Flask
from flask_restful import Resource, Api
from slackclient import SlackClient
app = Flask(__name__)
api = Api(app)
class RealName(Resource):
def get(self):
# return real_name from user id info from slack
pass
api.add_resource(RealName, '/names')
class PostDM(Resource):
... | import os
import json
from flask import Flask
from flask_restful import Resource, Api, reqparse
from slackclient import SlackClient
app = Flask(__name__)
api = Api(app)
token = os.environ.get('SLACK_KEY')
sc = SlackClient(token)
print sc.api_call('api.test')
class RealName(Resource):
def get(self):
# return real... | Create logic to post DM to user on slack when user id is provided | Create logic to post DM to user on slack when user id is provided
| Python | mit | NdagiStanley/visibot | ---
+++
@@ -1,27 +1,57 @@
+import os
+import json
from flask import Flask
-from flask_restful import Resource, Api
+from flask_restful import Resource, Api, reqparse
from slackclient import SlackClient
app = Flask(__name__)
api = Api(app)
+token = os.environ.get('SLACK_KEY')
+sc = SlackClient(token)
+print sc... |
a8c8781373e1501ed8a628004904acc465b80dad | rep.py | rep.py | """
The top level of the APL Read-Evaluate-Print loop
UNDER DEVELOPMENT
This version adds trivial apl_quit() and apl_exit() routines to the read-evaluate-print loop.
"""
import sys
def read_evaluate_print (prompt):
"""
Read input, echo input
"""
try:
while True:
p... | """
The top level of the APL Read-Evaluate-Print loop
UNDER DEVELOPMENT
This version adds trivial apl_quit() and apl_exit() routines to the read-evaluate-print loop.
"""
import sys
def read_evaluate_print (prompt):
"""
Read input, echo input
"""
try:
while True:
p... | Add recognition of )OFF to mean exit gracefully | Add recognition of )OFF to mean exit gracefully
| Python | apache-2.0 | NewForester/apl-py,NewForester/apl-py | ---
+++
@@ -15,7 +15,11 @@
try:
while True:
print(end=prompt)
- line = input()
+ line = input().lstrip()
+ if line:
+ if line[0] == ')':
+ if line[0:4].upper() == ')OFF':
+ apl_exit("Bye bye")
... |
3f9d68c8b1719047de29e41bd673f3b6926a81df | run.py | run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: run.py
Author: huxuan <i(at)huxuan.org>
Description: Run script for app.
"""
import os.path
if not os.path.isfile('config.py'):
raise Exception('Please copy `config.sample.py` to `config.py` with proper'
'configuration to make it work.')
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: run.py
Author: huxuan <i(at)huxuan.org>
Description: Run script for app.
"""
import os.path
if not os.path.isfile('config.py'):
raise Exception('Please copy `config.sample.py` to `config.py` with proper'
' configuration to make it work.')
... | Add missing space for exception message. | Add missing space for exception message.
| Python | mit | CAPU-ENG/CAPUHome-API,huxuan/CAPUHome-API | ---
+++
@@ -9,7 +9,7 @@
if not os.path.isfile('config.py'):
raise Exception('Please copy `config.sample.py` to `config.py` with proper'
- 'configuration to make it work.')
+ ' configuration to make it work.')
from app import app
|
5af2464aa0a97bbcbce71342771e4fa3d86d97ea | run.py | run.py | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
#resp = twilio.twiml.Response()
#resp.message("yo homie im playing nes")
print request.form['Body']
print request.form['From']
with open("msgs.txt", "a+") as... | from flask import Flask, request, redirect
import twilio.twiml
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def hello():
#resp = twilio.twiml.Response()
#resp.message("yo homie im playing nes")
print request.form['Body']
print request.form['From']
with open("input.txt", "w") as... | Update flask app to be compatible with the emulator script | Update flask app to be compatible with the emulator script
| Python | mit | sagnew/NESMS,sagnew/NESMS | ---
+++
@@ -11,7 +11,7 @@
print request.form['Body']
print request.form['From']
- with open("msgs.txt", "a+") as f:
+ with open("input.txt", "w") as f:
f.write(request.form['From'] + ":" + request.form['Body']+"\n")
#return str(resp)
return 'recieved' |
eea9655d6b92c9bfd0276b1173010dad9fa54fa5 | api_tests/licenses/views/test_license_detail.py | api_tests/licenses/views/test_license_detail.py | from nose.tools import * # flake8: noqa
import functools
from tests.base import ApiTestCase
from osf.models.licenses import NodeLicense
from api.base.settings.defaults import API_BASE
class TestLicenseDetail(ApiTestCase):
def setUp(self):
super(TestLicenseDetail, self).setUp()
self.license = Nod... | import pytest
import functools
from api.base.settings.defaults import API_BASE
from osf.models.licenses import NodeLicense
@pytest.mark.django_db
class TestLicenseDetail:
@pytest.fixture()
def license(self):
return NodeLicense.find()[0]
@pytest.fixture()
def url_license(self, license):
... | Convert license detail to pytest | Convert license detail to pytest
| Python | apache-2.0 | caneruguz/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,sloria/osf.io,caneruguz/osf.io,caseyrollins/osf.io,cslzchen/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,felliott/osf.io,chrisseto/osf.io,mattclark/osf.io,crcresearch/osf.io,felliott/osf.io,binoculars/osf.io,icereval/osf.io,adlius/osf.io... | ---
+++
@@ -1,29 +1,39 @@
-from nose.tools import * # flake8: noqa
+import pytest
import functools
-from tests.base import ApiTestCase
+from api.base.settings.defaults import API_BASE
from osf.models.licenses import NodeLicense
-from api.base.settings.defaults import API_BASE
+@pytest.mark.django_db
+class Tes... |
6ec8f4618bd3e6140780b5acbab719390271fd2f | IMU_program/PythonServer.py | IMU_program/PythonServer.py | import serial.tools.list_ports
import serial
import socket
ports = list(serial.tools.list_ports.comports())
arduino_port = next((port for port in ports if "Arduino" in port.description), None)
arduino = serial.Serial(arduino_port[0], 9600)
PORT = 4242
HOST = ''
server_socket = socket.socket(socket.AF_INET, socket.... | import serial.tools.list_ports
import serial
import socket
ports = list(serial.tools.list_ports.comports())
arduino_port = next((port for port in ports if "Arduino" in port.description), None)
arduino = serial.Serial(arduino_port[0], 9600)
PORT = 4242
HOST = 'localhost'
server_socket = socket.socket(socket.AF_INET... | Change python code to only listen on localhost | Change python code to only listen on localhost
| Python | apache-2.0 | dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo | ---
+++
@@ -9,7 +9,7 @@
arduino = serial.Serial(arduino_port[0], 9600)
PORT = 4242
-HOST = ''
+HOST = 'localhost'
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind((HOST, PORT)) |
bd4ee91c964ce7fb506b722d4d93a8af019d4e7c | test/test_future_and_futures.py | test/test_future_and_futures.py | import imp
import os
import sys
from django.test import TestCase
from kolibri import dist as kolibri_dist
dist_dir = os.path.realpath(os.path.dirname(kolibri_dist.__file__))
class FutureAndFuturesTestCase(TestCase):
def test_import_concurrent_py3(self):
import concurrent
if sys.version_info[0]... | import imp
import os
import sys
# Import from kolibri first to ensure Kolibri's monkey patches are applied.
from kolibri import dist as kolibri_dist # noreorder
from django.test import TestCase # noreorder
dist_dir = os.path.realpath(os.path.dirname(kolibri_dist.__file__))
class FutureAndFuturesTestCase(TestCase... | Fix import order in tests. | Fix import order in tests.
| Python | mit | learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,learningequality/kolibri | ---
+++
@@ -2,9 +2,10 @@
import os
import sys
-from django.test import TestCase
+# Import from kolibri first to ensure Kolibri's monkey patches are applied.
+from kolibri import dist as kolibri_dist # noreorder
-from kolibri import dist as kolibri_dist
+from django.test import TestCase # noreorder
dist_dir... |
ad7485b9500ebc75e9c741641d3258a40fffe43b | myDevices/plugins/analog.py | myDevices/plugins/analog.py | """
This module provides classes for interfacing with analog plugins.
"""
import json
from myDevices.plugins.manager import PluginManager
from myDevices.utils.logger import info
class AnalogInput():
"""Reads data from an analog input."""
def __init__(self, adc_name):
"""Initializes the analog input.
... | """
This module provides classes for interfacing with analog plugins.
"""
import json
from myDevices.plugins.manager import PluginManager
from myDevices.utils.logger import info, debug
class AnalogInput():
"""Reads data from an analog input."""
def __init__(self, adc):
"""Initializes the analog input... | Modify AnalogInput initialization, add exception handling. | Modify AnalogInput initialization, add exception handling.
| Python | mit | myDevicesIoT/Cayenne-Agent,myDevicesIoT/Cayenne-Agent | ---
+++
@@ -3,19 +3,19 @@
"""
import json
from myDevices.plugins.manager import PluginManager
-from myDevices.utils.logger import info
+from myDevices.utils.logger import info, debug
class AnalogInput():
"""Reads data from an analog input."""
- def __init__(self, adc_name):
+ def __init__(self, a... |
26f8c6d4cf51c1f479edc512fa8097ad4b8e1059 | puppet/modules/commonservices-apache/files/index.py | puppet/modules/commonservices-apache/files/index.py | #!/usr/bin/python
import os
from string import Template
print "Content-Type: text/html"
print
tmpl = Template(file('index.html.tmpl').read())
target = os.environ['REQUEST_URI']
if target.startswith('/_'):
target = '/' + target.lstrip('/').lstrip('_')
target = target.replace('%7C', '#', 1)
else:
target =... | #!/usr/bin/python
import os
from urllib import unquote
from string import Template
print "Content-Type: text/html"
print
tmpl = Template(file('index.html.tmpl').read())
target = os.environ['REQUEST_URI']
if target.startswith('/_'):
target = '/' + target.lstrip('/').lstrip('_')
target = unquote(target)
t... | Fix URL fragment management on Firefox | Fix URL fragment management on Firefox
Close Bug: 13
Change-Id: If3e3182e670b4c498043a58f2b5a82cb87560722
| Python | apache-2.0 | enovance/software-factory,invenfantasy/software-factory,invenfantasy/software-factory,enovance/software-factory,enovance/software-factory,invenfantasy/software-factory,invenfantasy/software-factory,invenfantasy/software-factory,enovance/software-factory,enovance/software-factory | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/python
import os
+from urllib import unquote
from string import Template
@@ -11,7 +12,8 @@
target = os.environ['REQUEST_URI']
if target.startswith('/_'):
target = '/' + target.lstrip('/').lstrip('_')
- target = target.replace('%7C', '#', 1)
+ target = unquote(t... |
d012a3de5d294cdbaa4dbc8141fdb6ad2af31893 | pystruct/tests/test_learners/test_frankwolfe_svm.py | pystruct/tests/test_learners/test_frankwolfe_svm.py |
from numpy.testing import assert_array_equal
from pystruct.models import GridCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
def test_multinomial_blocks_frankwolfe():
X, Y = generate_blocks_multinomial(n_samples=50, noise=0.4,
... |
from numpy.testing import assert_array_equal
from pystruct.models import GridCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
def test_multinomial_blocks_frankwolfe():
X, Y = generate_blocks_multinomial(n_samples=50, noise=0.5,
... | TEST use same amount of noise for frank wolfe test as for other test. Works now that C is scaled correctly :) | TEST use same amount of noise for frank wolfe test as for other test. Works now that C is scaled correctly :)
| Python | bsd-2-clause | pystruct/pystruct,pystruct/pystruct,amueller/pystruct,massmutual/pystruct,massmutual/pystruct,amueller/pystruct,d-mittal/pystruct,wattlebird/pystruct,wattlebird/pystruct,d-mittal/pystruct | ---
+++
@@ -9,7 +9,7 @@
def test_multinomial_blocks_frankwolfe():
- X, Y = generate_blocks_multinomial(n_samples=50, noise=0.4,
+ X, Y = generate_blocks_multinomial(n_samples=50, noise=0.5,
seed=0)
crf = GridCRF(inference_method='qpbo')
clf = FrankWolfeSSVM... |
7a552161eab19d24b7b221635e51a915adff0166 | templater.py | templater.py | #!/usr/bin/python
import string
if __name__ == "__main__":
import sys
template_file = sys.argv[1]
with open(template_file) as f:
data = f.read()
template = string.Template(data)
template_mapping = {}
for item in sys.argv[2:]:
# item is in the following form: KEY=VALUE
... | #!/usr/bin/python
import string
import os
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-t", "--template", dest="template_file",
help="Input template file")
(options, args) = parser.parse_args()
if not os.path.isfil... | Use OptionParser instead of simple sys.argv. | Use OptionParser instead of simple sys.argv.
| Python | mit | elecro/strep | ---
+++
@@ -1,18 +1,28 @@
#!/usr/bin/python
import string
+import os
+
if __name__ == "__main__":
- import sys
+ from optparse import OptionParser
- template_file = sys.argv[1]
+ parser = OptionParser()
+ parser.add_option("-t", "--template", dest="template_file",
+ help="In... |
46f14b9681d011b78aabdf0bd9e4e86a92ff8023 | packages/python-windows/setup.py | packages/python-windows/setup.py | #!/usr/bin/env python
# ====================================================================
# Copyright (c) 2006 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://sub... | #!/usr/bin/env python
# ====================================================================
# Copyright (c) 2006 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://sub... | Fix the python-windows installer generator by making it include the .dll files in the installer. That list originally consisted only of "*.dll". When the build system was modified to generate .pyd files for the binary modules, it was changed to "*.pyd". The Subversion libraries and the dependencies are still .dll files... | Fix the python-windows installer generator by making it include the .dll
files in the installer. That list originally consisted only of "*.dll".
When the build system was modified to generate .pyd files for the binary
modules, it was changed to "*.pyd". The Subversion libraries and the
dependencies are still .dll files... | Python | apache-2.0 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | ---
+++
@@ -22,4 +22,4 @@
url = "http://subversion.tigris.org",
version = "1.4.0",
packages = ["libsvn", "svn"],
- package_data = {"libsvn": ["*.pyd"]})
+ package_data = {"libsvn": ["*.dll", "*.pyd"]}) |
462397443770d55617356bf257b021406367b4c2 | wluopensource/osl_flatpages/models.py | wluopensource/osl_flatpages/models.py | from django.db import models
import markdown
class Flatpage(models.Model):
page_name = models.CharField(max_length=100, primary_key=True, unique=True)
title = models.CharField(max_length=100)
description = models.CharField(max_length=255)
markdown_content = models.TextField('content')
content = mod... | from django.db import models
import markdown
class Flatpage(models.Model):
page_name = models.CharField(max_length=100, primary_key=True, unique=True)
title = models.CharField(blank=True, max_length=100)
description = models.CharField(blank=True, max_length=255)
markdown_content = models.TextField('con... | Allow blank entries for title and description for flatpages | Allow blank entries for title and description for flatpages
| Python | bsd-3-clause | jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website,jeffcharles/Open-Source-at-Laurier-Website | ---
+++
@@ -3,8 +3,8 @@
class Flatpage(models.Model):
page_name = models.CharField(max_length=100, primary_key=True, unique=True)
- title = models.CharField(max_length=100)
- description = models.CharField(max_length=255)
+ title = models.CharField(blank=True, max_length=100)
+ description = model... |
7bc7bfa84550b4037672cc1168a178cf20f0c548 | pamda/private/curry_spec/make_func_curry_spec.py | pamda/private/curry_spec/make_func_curry_spec.py | from inspect import getargspec
from .curry_spec import CurrySpec
from ..accepts_varargs import accepts_varargs
class CurrySpecVarargError(ValueError):
def __init__(self, f):
name = f.__name__
message_template = "Cannot curry var-arg or var-kwarg function {0}"
message = message_template.for... | from inspect import getargspec
from .curry_spec import CurrySpec
from ..accepts_varargs import accepts_varargs
class CurrySpecVarargError(ValueError):
def __init__(self, f):
name = f.__name__
message_template = "Cannot curry var-arg or var-kwarg function {0}"
message = message_template.for... | Fix make_fun_curry_spec for functions with no defaults | Fix make_fun_curry_spec for functions with no defaults
| Python | mit | jackfirth/pyramda | ---
+++
@@ -18,7 +18,7 @@
def func_arg_defaults(f):
argspec = getargspec(f)
arg_names = argspec.args
- default_arg_values = argspec.defaults
+ default_arg_values = argspec.defaults or []
num_defaults = len(default_arg_values)
default_arg_names = arg_names[-num_defaults:]
return dict(zi... |
cc7893b5a81fc1fc41a1273ee4e89b0fc0f93530 | setup.py | setup.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2010 Sebastian Krysmanski
# Copyright (C) 2012 Greg Lavallee
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from setuptools import setup
PACKAGE = 'TicketGuidelinesPl... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2010 Sebastian Krysmanski
# Copyright (C) 2012 Greg Lavallee
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from setuptools import setup
PACKAGE = 'TicketGuidelinesPl... | Change URL to point to trac-hacks.org | 1.0.0: Change URL to point to trac-hacks.org
| Python | bsd-3-clause | trac-hacks/TicketGuidelinesPlugin | ---
+++
@@ -17,7 +17,7 @@
name=PACKAGE,
version=VERSION,
author='Sebastian Krysmanski',
- url='https://github.com/trac-hacks/TicketGuidelinesPlugin',
+ url='https://trac-hacks.org/wiki/TicketGuidelinesPlugin',
description="Adds your ticket guidelines to the ticket view. The "
... |
8d4388bed399b27d650a77e93d9ff4da8d7f8a82 | setup.py | setup.py | from setuptools import setup
import generate
generate.run()
setup(
name='nnpy',
version='0.1',
url='https://github.com/djc/jasinja',
license='MIT',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman.nl',
description='cffi-based Python bindings for nanomsg',
long_description=open('... | from setuptools import setup
import generate
generate.run()
setup(
name='nnpy',
version='0.1',
url='https://github.com/djc/jasinja',
license='MIT',
author='Dirkjan Ochtman',
author_email='dirkjan@ochtman.nl',
description='cffi-based Python bindings for nanomsg',
long_description=open('... | Install the nanomsg.h file, we need it. | Install the nanomsg.h file, we need it.
| Python | mit | tempbottle/nnpy,nanomsg/nnpy | ---
+++
@@ -21,5 +21,6 @@
'Programming Language :: Python',
],
packages=['nnpy'],
+ package_data={'nnpy': ['*.h']},
install_requires=['cffi'],
) |
451483d991c5cb0b2c9b9a4879e10e759be0667a | setup.py | setup.py | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... | Remove numpy as it's a dependency of Pandas already | Remove numpy as it's a dependency of Pandas already
| Python | mit | datasciencebr/serenata-toolbox | ---
+++
@@ -14,7 +14,6 @@
],
description='Toolbox for Serenata de Amor project',
install_requires=[
- 'numpy>=1.11',
'pandas>=0.18',
],
keywords='serenata de amor, data science, brazil, corruption', |
c9c86da6d25cc4801c428e927b3df4705f850995 | setup.py | setup.py | from setuptools import find_packages, setup
setup(
name='tchannel',
version='0.1.0+dev0',
author='Aiden Scandella',
author_email='dev@uber.com',
description='Network multiplexing and framing protocol for RPC',
license='MIT',
url='https://github.com/uber/tchannel',
packages=find_package... | from setuptools import find_packages, setup
setup(
name='tchannel',
version='0.1.0+dev0',
author='Aiden Scandella',
author_email='dev@uber.com',
description='Network multiplexing and framing protocol for RPC',
license='MIT',
url='https://github.com/uber/tchannel',
packages=find_package... | Add futures as a dependency. | Add futures as a dependency.
| Python | mit | uber/tchannel-python,Willyham/tchannel-python,uber/tchannel-python,Willyham/tchannel-python | ---
+++
@@ -10,7 +10,7 @@
license='MIT',
url='https://github.com/uber/tchannel',
packages=find_packages(),
- install_requires=['contextlib2', 'enum34'],
+ install_requires=['contextlib2', 'enum34', 'futures'],
entry_points={
'console_scripts': [
'tcurl.py = tchannel.tcu... |
64918cf64c46ecd0a540902147a1c8cde2937b00 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
version = '0.1.4'
setup(
name='docxgen',
version=version,
packages=find_packages(),
install_requires=['lxml', 'six'],
include_package_data=True,
test_suite='nose.collector',
tests_require=['nose', 'coverage'],
descript... | #!/usr/bin/env python
from setuptools import setup, find_packages
version = '0.1.5'
setup(
name='docxgen',
version=version,
packages=find_packages(),
install_requires=['lxml', 'six'],
include_package_data=True,
test_suite='nose.collector',
tests_require=['nose', 'coverage'],
descript... | Bump the version to 0.1.5. | Bump the version to 0.1.5.
| Python | mit | kunxi/docxgen | ---
+++
@@ -2,7 +2,7 @@
from setuptools import setup, find_packages
-version = '0.1.4'
+version = '0.1.5'
setup(
name='docxgen', |
e1d969743ade709e0b14f1c329ad271aa7079fdb | setup.py | setup.py | import os
from setuptools import setup # type: ignore
VERSION = '4.4.1'
setup(
name='conllu',
packages=["conllu"],
python_requires=">=3.6",
package_data={
"": ["py.typed"]
},
version=VERSION,
description='CoNLL-U Parser parses a CoNLL-U formatted string into a nested python dicti... | import os
from setuptools import setup # type: ignore
VERSION = '4.4.1'
setup(
name='conllu',
packages=["conllu"],
python_requires=">=3.6",
package_data={
"": ["py.typed"]
},
version=VERSION,
license='MIT License',
description='CoNLL-U Parser parses a CoNLL-U formatted string... | Add official OSI name in the license metadata | Add official OSI name in the license metadata
This makes it easier for automatic license checkers to verify the license of this package. | Python | mit | EmilStenstrom/conllu | ---
+++
@@ -12,6 +12,7 @@
"": ["py.typed"]
},
version=VERSION,
+ license='MIT License',
description='CoNLL-U Parser parses a CoNLL-U formatted string into a nested python dictionary',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
long_descript... |
ff2aabb04003e8f529fc5289a96fe504590191e6 | setup.py | setup.py | from setuptools import setup, find_packages
from pypandoc import convert
def convert_markdown_to_rst(file):
return convert(file, 'rst')
setup(name='gitlabform',
version='1.1.0',
description='Easy configuration as code tool for GitLab using config in plain YAML',
long_description=convert_mark... | from setuptools import setup, find_packages
from pypandoc import convert
def convert_markdown_to_rst(file):
return convert(file, 'rst')
setup(name='gitlabform',
version='1.1.0',
description='Easy configuration as code tool for GitLab using config in plain YAML',
long_description=convert_mark... | Update deps because of CVE-2019-10906 in Jinja2 < 2.10.1 | Update deps because of CVE-2019-10906 in Jinja2 < 2.10.1
| Python | mit | egnyte/gitlabform,egnyte/gitlabform | ---
+++
@@ -28,7 +28,7 @@
install_requires=[
'requests>=2.20.0',
'pyyaml>=4.2b1',
- 'Jinja2==2.10',
+ 'Jinja2>=2.10.1,<3',
],
tests_require=[
'pytest', |
b95bab6acacffc3b59e4d5a57d06f21159742044 | setup.py | setup.py | '''
Python wrapper for the OpenAQ API
Written originally by David H Hagan
December 2015
'''
__version__ = '1.1.0'
try:
from setuptools import setup
except:
from distutils.core import setup
setup(
name = 'py-openaq',
version = __version__,
description = 'Python wrapper for the OpenAQ API',
keywords = ['OpenAQ... | '''
Python wrapper for the OpenAQ API
Written originally by David H Hagan
December 2015
'''
__version__ = '1.1.0'
try:
from setuptools import setup
except:
from distutils.core import setup
setup(
name = 'py-openaq',
version = __version__,
description = 'Python wrapper for the OpenAQ API',
keywords = ['OpenAQ... | Add requests package as dependency | Add requests package as dependency
The package depends on the requests package, which is not explicitly mentioned in the setup file. Path adds this as requirement to the setup file. | Python | mit | dhhagan/py-openaq,dhhagan/py-openaq | ---
+++
@@ -20,6 +20,7 @@
url = 'https://github.com/dhhagan/py-openaq',
license = 'MIT',
packages = ['openaq'],
+ install_requires = ['requests'],
test_suite = 'tests',
classifiers = [
'Development Status :: 3 - Alpha', |
ba84740e7ba0edd709c9cd076a7dce83a6c91a30 | research/mlt_quality_research.py | research/mlt_quality_research.py | #!/usr/bin/env python
import pprint
from elasticsearch import Elasticsearch
'''Inside ipython:
[(r['_score'], r['_source']['Header']['En'], r['_source']['UnitTypeDesc'])for r in es.mlt(index='bhp10', doc_type='places', id=71433, mlt_fields=related_fields, search_types=['places','personalities','photoUnits','familyNa... | #!/usr/bin/env python
import pprint
from elasticsearch import Elasticsearch
'''Inside ipython:
[(r['_score'], r['_source']['Header']['En'], r['_source']['UnitTypeDesc'])for r in es.mlt(index='bhp10', doc_type='places', id=71433, mlt_fields=related_fields, search_types=['places','personalities','photoUnits','familyNa... | Add ES search example, similar to Mongo related FTS | Add ES search example, similar to Mongo related FTS
| Python | agpl-3.0 | Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back | ---
+++
@@ -6,6 +6,12 @@
'''Inside ipython:
[(r['_score'], r['_source']['Header']['En'], r['_source']['UnitTypeDesc'])for r in es.mlt(index='bhp10', doc_type='places', id=71433, mlt_fields=related_fields, search_types=['places','personalities','photoUnits','familyNames'], search_size=40)['hits']['hits']]
+'''
+
+... |
1a9a43b1e1f7872f70773f5793d2b588c2a58934 | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
import os
import sys
# Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml)
if sys.platform == 'darwin':
os.environ['C_INCLU... | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
import os
import sys
# Add /usr/local/include to the path for macs, fixes easy_install for several packages (like gevent and pyyaml)
if sys.platform == 'darwin':
os.environ['C_INCLU... | Remove duplicate mock deps from coi-services | Remove duplicate mock deps from coi-services
| Python | bsd-2-clause | ooici/coi-services,ooici/coi-services,ooici/coi-services,ooici/coi-services,ooici/coi-services | ---
+++
@@ -29,7 +29,6 @@
],
test_suite = 'pyon',
install_requires = [
- 'pyon',
- 'mock'
+ 'pyon'
],
) |
182b94f777b1743671b706c939ce14f89c31efca | lint/queue.py | lint/queue.py | from . import persist
import time
import threading
# Map from view_id to threading.Timer objects
timers = {}
# For compatibility this is a class with unchanged API from SL3.
class Daemon:
def start(self, callback):
self._callback = callback
def hit(self, view):
assert self._callback, "Queu... | from . import persist
import time
import threading
# Map from view_id to threading.Timer objects
timers = {}
# For compatibility this is a class with unchanged API from SL3.
class Daemon:
def start(self, callback):
self._callback = callback
def hit(self, view):
assert self._callback, "Queu... | Remove MIN_DELAY bc a default setting is guaranteed | Remove MIN_DELAY bc a default setting is guaranteed
| Python | mit | SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3 | ---
+++
@@ -38,9 +38,6 @@
return hit_time
-MIN_DELAY = 0.1
-
-
def get_delay():
"""Return the delay between a lint request and when it will be processed.
@@ -50,7 +47,7 @@
if persist.settings.get('lint_mode') != 'background':
return 0
- return persist.settings.get('delay', MIN_DELA... |
e01f8f4a9c9c0329b4d33106ef5589580ce5337d | bluesky/epics_callbacks.py | bluesky/epics_callbacks.py | import epics
import asyncio
class PVSuspender:
"""
A class to manage the callback interface between asyincio and
pyepics.
This will probably be a base class eventually.
"""
def __init__(self, RE, pv_name, loop=None):
if loop is None:
loop = asyncio.get_event_loop()
... | import epics
import asyncio
class PVSuspender:
"""
A class to manage the callback interface between asyincio and
pyepics.
This will probably be a base class eventually.
"""
def __init__(self, RE, pv_name, loop=None):
if loop is None:
loop = asyncio.get_event_loop()
... | Use the correct Event loop. | FIX: Use the correct Event loop.
| Python | bsd-3-clause | ericdill/bluesky,dchabot/bluesky,dchabot/bluesky,ericdill/bluesky,klauer/bluesky,sameera2004/bluesky,klauer/bluesky,sameera2004/bluesky | ---
+++
@@ -44,7 +44,7 @@
# in the case where either have never been
# called or have already fully cycled once
if self._should_suspend(value):
- self._ev = asyncio.Event()
+ self._ev = asyncio.Event(loop=self._loop)
self._loop.ca... |
8530e491d600f6a03b163d885c5febee0e654cc5 | matador/core/management.py | matador/core/management.py | #!/usr/bin/env python
import sys
import logging
import argparse
from matador.core.commands import commands
def setup_logging(logging_destination='console', verbosity='DEBUG'):
logHandlers = {
'console': logging.StreamHandler(),
'none': logging.NullHandler(),
'file': logging.FileHandler('./... | #!/usr/bin/env python
import sys
import logging
import argparse
from matador.core.commands import commands
def _setup_logging(logging_destination='console', verbosity='INFO'):
logHandlers = {
'console': logging.StreamHandler(),
'none': logging.NullHandler(),
'file': logging.FileHandler('./... | Add log level and destination arguments | Add log level and destination arguments
| Python | mit | Empiria/matador | ---
+++
@@ -5,7 +5,7 @@
from matador.core.commands import commands
-def setup_logging(logging_destination='console', verbosity='DEBUG'):
+def _setup_logging(logging_destination='console', verbosity='INFO'):
logHandlers = {
'console': logging.StreamHandler(),
'none': logging.NullHandler(),
... |
f677c607d98fb54d0b469c06e3682322f6f6321f | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyj... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyj... | Add contrib package to deployment | Add contrib package to deployment
| Python | isc | fulfilio/fulfil-python-api,sharoonthomas/fulfil-python-api | ---
+++
@@ -34,9 +34,11 @@
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
+ 'fulfil_client.contrib',
],
package_dir={
- 'fulfil_client': 'fulfil_client'
+ 'fulfil_client': 'fulfil_client',
+ 'fulfil_client.contrib': 'fulfil_cli... |
3a12d545ef22db37d4d26b0a75af4dc4348afd9a | setup.py | setup.py | from setuptools import setup, find_packages
VERSION = '3.0.1'
setup(
name='django-node',
version=VERSION,
packages=find_packages(exclude=('tests', 'example',)),
package_data={
'django_node': [
'node_server.js',
'package.json',
],
},
install_requires=[
... | from setuptools import setup, find_packages
VERSION = '3.0.1'
setup(
name='django-node',
version=VERSION,
packages=find_packages(exclude=('tests', 'example',)),
package_data={
'django_node': [
'node_server.js',
'services/echo.js',
'package.json',
],
... | Include required echo service in package | Include required echo service in package
| Python | mit | markfinger/django-node,markfinger/django-node | ---
+++
@@ -9,6 +9,7 @@
package_data={
'django_node': [
'node_server.js',
+ 'services/echo.js',
'package.json',
],
}, |
4ba46ac6674f7972d70d2e4f819303e38a934462 | setup.py | setup.py | # coding=utf-8
# Make sure setup tools is installed, if not install it.
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'loadimpact'))
from version import __version__
setup(
name='loadimpact',
version... | # coding=utf-8
"""
Copyright 2013 Load Impact
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 writ... | Add license notice and update description. | Add license notice and update description.
| Python | apache-2.0 | loadimpact/loadimpact-sdk-python | ---
+++
@@ -1,4 +1,20 @@
# coding=utf-8
+
+"""
+Copyright 2013 Load Impact
+
+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... |
a092414a9af42c514febc9738da8d671cfb2ff3c | setup.py | setup.py | #!/usr/bin/env python
import re
from setuptools import setup
version = re.search(
'^__version__\s*=\s*"([^"]*)"',
open("suplemon/main.py").read(),
re.M
).group(1)
files = ["config/*.json", "themes/*", "modules/*.py", "linelight/*.py"]
setup(name="Suplemon",
version=version,
description="C... | #!/usr/bin/env python
import re
from setuptools import setup
version = re.search(
'^__version__\s*=\s*"([^"]*)"',
open("suplemon/main.py").read(),
re.M
).group(1)
files = ["config/*.json", "themes/*", "modules/*.py", "linelight/*.py"]
setup(name="Suplemon",
version=version,
description="C... | Add pygments as dependency. Lets see if this works... | Add pygments as dependency. Lets see if this works...
| Python | mit | richrd/suplemon,richrd/suplemon,twolfson/suplemon,twolfson/suplemon | ---
+++
@@ -19,6 +19,9 @@
packages=["suplemon"],
package_data={"": files},
include_package_data=True,
+ install_requires=[
+ "pygments"
+ ],
entry_points={
"console_scripts": ["suplemon=suplemon.cli:main"]
}, |
f2311a2369243939b5be12d07e17c3bf5b137073 | setup.py | setup.py | #!/usr/bin/env python
# setup.py
"""pyftpdlib installer.
To install pyftpdlib just open a command shell and run:
> python setup.py install
"""
from distutils.core import setup
long_descr = """\
Python FTP server library, based on asyncore framework, provides
an high-level portable interface to easily write asynchro... | #!/usr/bin/env python
# setup.py
"""pyftpdlib installer.
To install pyftpdlib just open a command shell and run:
> python setup.py install
"""
from distutils.core import setup
long_descr = """\
Python FTP server library, based on asyncore framework, provides
an high-level portable interface to easily write asynchro... | Update download url to newer version. | Update download url to newer version.
| Python | mit | giampaolo/pyftpdlib | ---
+++
@@ -24,7 +24,7 @@
author="Giampaolo Rodola'",
author_email='g.rodola@gmail.com',
url='http://code.google.com/p/pyftpdlib/',
- download_url='http://pyftpdlib.googlecode.com/files/pyftpdlib-0.3.0.tar.gz',
+ download_url='http://pyftpdlib.googlecode.com/files/pyftpdlib-0.4.0.tar.gz',
pa... |
26b0571212d6abcd65fd4d857726131d12146d85 | setup.py | setup.py | from distutils.core import setup
setup(
name='LightMatchingEngine',
version='0.1.2',
author='Gavin Chan',
author_email='gavincyi@gmail.com',
packages=['lightmatchingengine'],
url='http://pypi.python.org/pypi/LightMatchingEngine/',
license='LICENSE.txt',
description='A light matching eng... | from setuptools import setup
setup(
name='LightMatchingEngine',
use_scm_version=True,
setup_requires=['setuptools_scm'],
author='Gavin Chan',
author_email='gavincyi@gmail.com',
packages=['lightmatchingengine'],
url='http://pypi.python.org/pypi/LightMatchingEngine/',
license='LICENSE.txt... | Update to use scm for versioning | Update to use scm for versioning
| Python | mit | gavincyi/LightMatchingEngine | ---
+++
@@ -1,12 +1,13 @@
-from distutils.core import setup
+from setuptools import setup
setup(
name='LightMatchingEngine',
- version='0.1.2',
+ use_scm_version=True,
+ setup_requires=['setuptools_scm'],
author='Gavin Chan',
author_email='gavincyi@gmail.com',
packages=['lightmatchinge... |
eea9cabf7f15106124b3eb2b69f050f63f4c16f2 | yatsm/structural_break/_core.py | yatsm/structural_break/_core.py | from collections import namedtuple
import pandas as pd
import xarray as xr
pandas_like = (pd.DataFrame, pd.Series, xr.DataArray)
_fields = ['method', 'index', 'score', 'process', 'pvalue', 'signif']
#: namedtuple: Structural break detection results
StructuralBreakResult = namedtuple('StructuralBreak', _fields)
| from collections import namedtuple
import pandas as pd
import xarray as xr
pandas_like = (pd.DataFrame, pd.Series, xr.DataArray)
_fields = ['method', 'index', 'score', 'process', 'pvalue', 'signif']
#: namedtuple: Structural break detection results
StructuralBreakResult = namedtuple('StructuralBreakResult', _fields... | Fix struc break named tuple name | Fix struc break named tuple name
| Python | mit | c11/yatsm,c11/yatsm | ---
+++
@@ -8,4 +8,4 @@
_fields = ['method', 'index', 'score', 'process', 'pvalue', 'signif']
#: namedtuple: Structural break detection results
-StructuralBreakResult = namedtuple('StructuralBreak', _fields)
+StructuralBreakResult = namedtuple('StructuralBreakResult', _fields) |
3867d443c948dfa300016ed4235796b5c9e07011 | setup.py | setup.py | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
readme = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as requirements_file:
requirements = [line.rstrip() for line in requirements_file ... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
readme = readme.read()
with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as requirements_file:
requirements = [line.rstrip() for line in requirements_file ... | Update version number and supported Python versions | Update version number and supported Python versions
| Python | mit | easy-as-python/django-webmention | ---
+++
@@ -11,7 +11,7 @@
setup(
name='django-webmention',
- version='0.0.3',
+ version='0.0.4',
packages=find_packages(),
description='A pluggable implementation of webmention for Django projects.',
keywords='webmention pingback linkback blogging',
@@ -31,5 +31,6 @@
'License :: ... |
b0434a28080d59c27a755b70be195c9f3135bf94 | mdx_linkify/mdx_linkify.py | mdx_linkify/mdx_linkify.py | import bleach
from html5lib.sanitizer import HTMLSanitizer
from markdown.postprocessors import Postprocessor
from markdown import Extension
class MyTokenizer(HTMLSanitizer):
def sanitize_token(self, token):
return token
class LinkifyPostprocessor(Postprocessor):
def __init__(self, md, linkify_call... | import bleach
from markdown.postprocessors import Postprocessor
from markdown import Extension
class LinkifyPostprocessor(Postprocessor):
def __init__(self, md, linkify_callbacks=[]):
super(Postprocessor, self).__init__(md)
self._callbacks = linkify_callbacks
def run(self, text):
tex... | Make compatible with Bleach v2.0 and html5lib v1.0 | Make compatible with Bleach v2.0 and html5lib v1.0
| Python | mit | daGrevis/mdx_linkify | ---
+++
@@ -1,14 +1,7 @@
import bleach
-
-from html5lib.sanitizer import HTMLSanitizer
from markdown.postprocessors import Postprocessor
from markdown import Extension
-
-
-class MyTokenizer(HTMLSanitizer):
- def sanitize_token(self, token):
- return token
class LinkifyPostprocessor(Postprocessor)... |
3c7c72ea00a7009e53cdd0404b35b887b6fb4e9e | setup.py | setup.py | from setuptools import setup
setup(
name='slacker',
version='0.6.8',
packages=['slacker'],
description='Slack API client',
author='Oktay Sancak',
author_email='oktaysancak@gmail.com',
url='http://github.com/os/slacker/',
install_requires=['requests >= 2.2.1'],
license='http://www.a... | from setuptools import setup
setup(
name='slacker',
version='0.7.0',
packages=['slacker'],
description='Slack API client',
author='Oktay Sancak',
author_email='oktaysancak@gmail.com',
url='http://github.com/os/slacker/',
install_requires=['requests >= 2.2.1'],
license='http://www.a... | Set version number to 0.7.0. | Set version number to 0.7.0.
| Python | apache-2.0 | STANAPO/slacker,techartorg/slacker,wkentaro/slacker,kashyap32/slacker,os/slacker,wasabi0522/slacker,hreeder/slacker | ---
+++
@@ -3,7 +3,7 @@
setup(
name='slacker',
- version='0.6.8',
+ version='0.7.0',
packages=['slacker'],
description='Slack API client',
author='Oktay Sancak', |
73685bccb82dbdf570c1e2823e49e9b156b42ba1 | setup.py | setup.py | import os
import codecs
from setuptools import setup
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
def read(*path):
full_path = os.path.join(PROJECT_ROOT, *path)
with codecs.open(full_path, 'r', encoding='utf-8') as f:
return f.read()
setup(
name='whitenoise',
version='0.12',
... | import os
import codecs
from setuptools import setup, find_packages
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
def read(*path):
full_path = os.path.join(PROJECT_ROOT, *path)
with codecs.open(full_path, 'r', encoding='utf-8') as f:
return f.read()
setup(
name='whitenoise',
vers... | Use find_packages to ensure management command is included in installs | Use find_packages to ensure management command is included in installs
| Python | mit | evansd/whitenoise,KnockSoftware/whitenoise,evansd/whitenoise,hirokiky/whitenoise,evansd/whitenoise | ---
+++
@@ -1,6 +1,6 @@
import os
import codecs
-from setuptools import setup
+from setuptools import setup, find_packages
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
@@ -16,7 +16,7 @@
author='David Evans',
author_email='d@evans.io',
url='http://whitenoise.evans.io',
- packages=... |
2551458006a0187dfb0c3d5ab87581df1029f65d | scripts/should_rebuild_master.py | scripts/should_rebuild_master.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Decide whether we should re-build tests for a project on master.
Exits with code 1 if there are changes that require a rebuild, 0 if not.
"""
from __future__ import print_function
import os
import sys
from should_rerun_tests import should_run_tests, ShouldRebuild
... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Decide whether we should re-build tests for a project on master.
Exits with code 1 if there are changes that require a rebuild, 0 if not.
"""
from __future__ import print_function
import os
import sys
from should_rerun_tests import should_run_tests, ShouldRebuild
... | Fix SyntaxError in the Travis scripts | Fix SyntaxError in the Travis scripts
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | ---
+++
@@ -23,7 +23,7 @@
if (
task.startswith('sbt-') and
- any(f.startswith('docker/scala_service') in changed_files
+ any(f.startswith('docker/scala_service') in changed_files)
):
raise ShouldRebuild(
'Changes to docker/scala_service mean we should deploy' |
a2943faa21a51f90314a343da4ed14700c9f9c87 | setup.py | setup.py | from setuptools import setup
VERSION = '0.3'
setup(
name='jinja2_standalone_compiler',
packages=['jinja2_standalone_compiler', ],
version=VERSION,
author='Filipe Waitman',
author_email='filwaitman@gmail.com',
install_requires=[x.strip() for x in open('requirements.txt').readlines()],
url=... | from setuptools import setup
VERSION = '1.0'
setup(
name='jinja2_standalone_compiler',
packages=['jinja2_standalone_compiler', ],
version=VERSION,
author='Filipe Waitman',
author_email='filwaitman@gmail.com',
install_requires=[x.strip() for x in open('requirements.txt').readlines()],
url=... | Mark as stable and bump to 1.0 | Mark as stable and bump to 1.0
| Python | mit | filwaitman/jinja2-standalone-compiler | ---
+++
@@ -1,6 +1,6 @@
from setuptools import setup
-VERSION = '0.3'
+VERSION = '1.0'
setup(
@@ -15,7 +15,7 @@
test_suite='tests',
keywords=['Jinja2', 'Jinja', 'renderer', 'compiler', 'HTML'],
classifiers=[
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Producti... |
35fc31cda618d05add5154e9ffbf2de676852d93 | setup.py | setup.py | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... | from setuptools import setup
REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox'
setup(
author='Serenata de Amor',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language... | Add pandas as requirement for the project | Add pandas as requirement for the project
| Python | mit | datasciencebr/serenata-toolbox | ---
+++
@@ -14,7 +14,8 @@
],
description='Toolbox for Serenata de Amor project',
install_requires=[
- 'requests',
+ 'numpy>=1.11',
+ 'pandas>=0.18',
],
keywords='serenata de amor, data science, brazil, corruption',
license='MIT', |
929997d9d86f93033ef013c586095b59f151bce8 | setup.py | setup.py | #!/usr/local/bin/python -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
# Make sure we have access to SentientHome commons
import os
print 'Checking node.js presence:'
if 0 != os.system('node -... | #!/usr/local/bin/python3 -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
# Make sure we have access to SentientHome commons
import os
print 'Checking node.js presence:'
if 0 != os.system('node ... | Add Python 3 requests install | Add Python 3 requests install
| Python | apache-2.0 | fxstein/SentientHome | ---
+++
@@ -1,4 +1,4 @@
-#!/usr/local/bin/python -u
+#!/usr/local/bin/python3 -u
__author__ = 'Oliver Ratzesberger <https://github.com/fxstein>'
__copyright__ = 'Copyright (C) 2015 Oliver Ratzesberger'
__license__ = 'Apache License, Version 2.0'
@@ -22,6 +22,10 @@
print 'Installing Python3 dependencies'
... |
69d8ef8c1eba424568158611d45f02bc316c737b | setup.py | setup.py | """
Glue
-----
Glue is a simple command line tool to generate CSS sprites.
"""
try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}... | """
Glue
-----
Glue is a simple command line tool to generate CSS sprites.
"""
try:
from setuptools import setup
kw = {'entry_points':
"""[console_scripts]\nglue = glue:main\n""",
'zip_safe': False}
except ImportError:
from distutils.core import setup
kw = {'scripts': ['glue.py']}... | Change the project name to glue, add the new public download_url | Change the project name to glue, add the new public download_url
| Python | bsd-3-clause | WillsB3/glue,zhiqinyigu/glue,jorgebastida/glue,dext0r/glue,beni55/glue,jorgebastida/glue,zhiqinyigu/glue,dext0r/glue,WillsB3/glue,beni55/glue | ---
+++
@@ -16,9 +16,10 @@
kw = {'scripts': ['glue.py']}
setup(
- name='Glue',
- version='0.1',
- url='http://glue.github.com/',
+ name='glue',
+ version='0.1.1',
+ url='https://github.com/jorgebastida/glue',
+ dowload_url='https://nodeload.github.com/jorgebastida/glue/zipball/master',
... |
27d281ab2c733d80fdf7f3521e250e72341c85b7 | setup.py | setup.py | from distutils.core import setup
import os
f = open("README.rst")
try:
try:
readme_text = f.read()
except:
readme_text = ""
finally:
f.close()
setup(name="ftptool", version="0.4",
url="http://blogg.se",
description="Higher-level interface to ftplib",
author="Blogg Esse AB",
... | from distutils.core import setup
import os
readme_fname = os.path.join(os.path.dirname(__file__), "README.rst")
readme_text = open(readme_fname).read()
setup(name="ftptool", version="0.4",
url="http://blogg.se",
description="Higher-level interface to ftplib",
author="Blogg Esse AB",
author_email="open... | Make long description import path agnostic. | Make long description import path agnostic.
| Python | bsd-3-clause | bloggse/ftptool | ---
+++
@@ -1,14 +1,8 @@
from distutils.core import setup
import os
-f = open("README.rst")
-try:
- try:
- readme_text = f.read()
- except:
- readme_text = ""
-finally:
- f.close()
+readme_fname = os.path.join(os.path.dirname(__file__), "README.rst")
+readme_text = open(readme_fname).read()... |
9de760794eac63dd053b9a2ac78072a3648b7752 | tests/run.py | tests/run.py | from __future__ import print_function
import datetime
import os
import sys
from io import BytesIO
from pprint import pprint
import requests
import voxjar
if __name__ == "__main__":
metadata = {
"identifier": "test_call_identifier",
"timestamp": datetime.datetime.now(),
"type": {
... | from __future__ import print_function
import datetime
import os
import sys
from io import BytesIO
from pprint import pprint
from uuid import uuid4
import requests
import voxjar
if __name__ == "__main__":
metadata = {
"identifier": "test_{}".format(uuid4()),
"timestamp": datetime.datetime.now(),
... | Add uuid to identifier in test script | Add uuid to identifier in test script
| Python | apache-2.0 | platoai/platoai-python,platoai/platoai | ---
+++
@@ -5,6 +5,7 @@
import sys
from io import BytesIO
from pprint import pprint
+from uuid import uuid4
import requests
@@ -12,7 +13,7 @@
if __name__ == "__main__":
metadata = {
- "identifier": "test_call_identifier",
+ "identifier": "test_{}".format(uuid4()),
"timestamp": d... |
521abaa6bfc4e1da4f11a22d811669f14e6c59f7 | setup.py | setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='slugger',
version='0.2dev',
description=('Slugging done right. Tries to support close to 300'
'languages.'),
long_descriptio... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='slugger',
version='0.2dev',
description=('Slugging done right. Tries to support close to 300'
'languages.'),
long_descriptio... | Comment out python3 classifier for now. | Comment out python3 classifier for now.
| Python | lgpl-2.1 | mbr/slugger | ---
+++
@@ -22,6 +22,6 @@
packages=find_packages(exclude=['glibcparse']),
classifiers=[
'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 3',
+ #'Programming Language :: Python :: 3',
]
) |
68ef99afe3afe871e7f5471cbc18452f66c12be0 | setup.py | setup.py | #!/usr/bin/env python3
from setuptools import setup
setup(
name="cistern",
version="0.1.3",
license="MIT",
url="https://github.com/archangelic/cistern",
description="Command line tool for downloading torrents from RSS feeds.",
author="Michael Hancock",
author_email="michaelhancock89@gmail.c... | #!/usr/bin/env python3
from setuptools import setup
import sys
if not sys.version_info[0] == 3:
sys.exit("Sorry, Cistern only supports Python 3.")
setup(
name="cistern",
version="0.1.4",
license="MIT",
url="https://github.com/archangelic/cistern",
description="Command line tool for downloading... | Add check for Python 3 and increment version | Add check for Python 3 and increment version
| Python | mit | archangelic/cistern | ---
+++
@@ -1,16 +1,20 @@
#!/usr/bin/env python3
from setuptools import setup
+import sys
+
+if not sys.version_info[0] == 3:
+ sys.exit("Sorry, Cistern only supports Python 3.")
setup(
name="cistern",
- version="0.1.3",
+ version="0.1.4",
license="MIT",
url="https://github.com/archangeli... |
9496f281ee46489712b85837b60adf9cd4eb9708 | setup.py | setup.py | # Copyright 2017 Verily Life Sciences Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright 2017 Verily Life Sciences Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Update google-cloud-bigquery version to incorporate PollingFuture retry changes. | Update google-cloud-bigquery version to incorporate PollingFuture retry changes.
Specifically: https://github.com/googleapis/google-cloud-python/commit/f576d148f802666dbd11cf7c50a0629a77f81665
Change-Id: Id3244786ffa73cbe3a166cfe35cb7f2219140a31
| Python | apache-2.0 | verilylifesciences/analysis-py-utils,verilylifesciences/analysis-py-utils | ---
+++
@@ -19,7 +19,7 @@
REQUIRED_PACKAGES = ['pandas',
'google-api-core==1.5.1',
'google-auth==1.4.1',
- 'google-cloud-bigquery==1.6.0',
+ 'google-cloud-bigquery==1.7.0',
'google-cloud-storage==1.10.0',
... |
4b85fbfba29410b4e04fc4db62c81206dac96b4a | setup.py | setup.py | from setuptools import setup, find_packages
import platform
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko>=2.3', 'netaddr', 'requests', 'tinydb', 'python_hosts==0.3.3', 'jinja2']
if 'Darwin' in platform.... | from setuptools import setup, find_packages
import platform
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko>=2.3.1', 'netaddr', 'requests', 'tinydb', 'python_hosts==0.3.3', 'jinja2']
if 'Darwin' in platfor... | Add paramiko req >= 2.3.1 | Add paramiko req >= 2.3.1
| Python | apache-2.0 | turbulent/substance,turbulent/substance | ---
+++
@@ -6,7 +6,7 @@
execfile('substance/_version.py')
-install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko>=2.3', 'netaddr', 'requests', 'tinydb', 'python_hosts==0.3.3', 'jinja2']
+install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko>=2.3.1', 'netaddr', 'requests', 't... |
ccebabfc39fbb43c7f0f11dae7b5aa288e565788 | test_echo.py | test_echo.py | #!/usr/bin/env python
import pytest
import echo_server
import echo_client
| #!/usr/bin/env python
import pytest
import echo_server
from threading import Thread
import socket
def dummy_client():
message = "Christian Bale is a terrible actor."
port = 50000
address = '127.0.0.1'
client_socket = socket.socket(
socket.AF_INET,
socket.SOCK_STREAM,
socket.IPP... | Add test_connection unit test. This single test seems to cover it. | Add test_connection unit test. This single test seems to cover it.
| Python | mit | charlieRode/network_tools | ---
+++
@@ -1,5 +1,26 @@
#!/usr/bin/env python
import pytest
import echo_server
-import echo_client
+from threading import Thread
+import socket
+
+def dummy_client():
+ message = "Christian Bale is a terrible actor."
+ port = 50000
+ address = '127.0.0.1'
+ client_socket = socket.socket(
+ so... |
a673b4608e7024a8778f7ea6ca7a6414748f8f21 | setup.py | setup.py | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus Systems, 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 app... | #!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus Systems, 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 app... | Add pep8 to build deps | Add pep8 to build deps
| Python | apache-2.0 | ccassler/DeploymentManager,tbeckham/DeploymentManager,tbeckham/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager,ccassler/DeploymentManager | ---
+++
@@ -25,7 +25,7 @@
url='https://github.com/eucalyptus/DeploymentManager.git',
license='Apache License 2.0',
packages=find_packages(),
- install_requires=['paramiko', 'PrettyTable', 'eve', 'requests', 'mock',
+ install_requires=['paramiko', 'PrettyTable', 'eve', 'requests', 'mock'... |
b8dea6cf081fa916f0c88fa8d042e1a9e7da6279 | charla/plugins/cap.py | charla/plugins/cap.py | from ..plugin import BasePlugin
from ..commands import BaseCommands
class Commands(BaseCommands):
def cap(self, sock, source):
pass
class Capability(BasePlugin):
def init(self, *args, **kwargs):
super(Capability, self).init(*args, **kwargs)
Commands(*args, **kwargs).register(self)... | from ..plugin import BasePlugin
from ..commands import BaseCommands
class Commands(BaseCommands):
def cap(self, sock, source, *args):
pass
class Capability(BasePlugin):
def init(self, *args, **kwargs):
super(Capability, self).init(*args, **kwargs)
Commands(*args, **kwargs).registe... | Fix CAP so it takes any no. of args | Fix CAP so it takes any no. of args
| Python | mit | MrSwiss/charla,prologic/charla,spaceone/charla | ---
+++
@@ -4,7 +4,7 @@
class Commands(BaseCommands):
- def cap(self, sock, source):
+ def cap(self, sock, source, *args):
pass
|
ee6e887bc4be703c0d279baff1fac402c971883b | gitfs/views/index.py | gitfs/views/index.py | import os
from errno import ENOENT
from stat import S_IFDIR
from gitfs import FuseMethodNotImplemented, FuseOSError
from .view import View
from log import log
class IndexView(View):
def statfs(self, path):
return {}
def getattr(self, path, fh=None):
'''
Returns a dictionary with ke... | import os
from errno import ENOENT
from stat import S_IFDIR
from gitfs import FuseMethodNotImplemented, FuseOSError
from .view import View
from log import log
class IndexView(View):
def statfs(self, path):
return {}
def getattr(self, path, fh=None):
'''
Returns a dictionary with ke... | Remove unused code from IndexView. | Remove unused code from IndexView.
| Python | apache-2.0 | bussiere/gitfs,PressLabs/gitfs,PressLabs/gitfs,ksmaheshkumar/gitfs,rowhit/gitfs | ---
+++
@@ -40,11 +40,5 @@
return 0
def readdir(self, path, fh):
- #dirents = [
- #('.', {'st_ino': 1, 'st_mode': S_IFDIR}),
- #('..', {'st_ino': 2, 'st_mode': S_IFDIR}),
- #('current', {'st_ino': 3, 'st_mode': S_IFDIR}),
- #('history', {'st_ino': 4, ... |
43fa842244da9d75496ba3ba02517870daca8849 | provision/08-create-keystone-stuff.py | provision/08-create-keystone-stuff.py | #!/usr/bin/env python
import ConfigParser
import requests
cp = ConfigParser.SafeConfigParser()
cp.read('/etc/keystone/keystone.conf')
token = cp.get('DEFAULT', 'admin_token')
baseurl = 'http://localhost:35357/v3/OS-FEDERATION'
headers = {
'X-Auth-Token': token,
'Content-Type': 'application/json',
}
with open... | #!/usr/bin/env python
import ConfigParser
import requests
cp = ConfigParser.SafeConfigParser()
cp.read('/etc/keystone/keystone.conf')
token = cp.get('DEFAULT', 'admin_token')
baseurl = 'http://localhost:35357/v3/OS-FEDERATION'
headers = {
'X-Auth-Token': token,
'Content-Type': 'application/json',
}
with open... | Fix paths to json files | Fix paths to json files
| Python | apache-2.0 | norcams/himlar-connect,norcams/himlar-connect | ---
+++
@@ -12,14 +12,14 @@
'X-Auth-Token': token,
'Content-Type': 'application/json',
}
-with open('json/create-idp.json') as fh:
+with open('/opt/himlar/json/create-idp.json') as fh:
response = requests.put(baseurl + '/identity_providers/dataporten', headers=headers, data=fh.read())
response.ra... |
317eaa7dd37638f233d8968fb55ed596bc2b8502 | pycroscopy/io/translators/__init__.py | pycroscopy/io/translators/__init__.py | from . import be_odf
from . import be_odf_relaxation
from . import beps_ndf
from . import general_dynamic_mode
from . import gmode_iv
from . import gmode_line
from . import image
from . import ndata_translator
from . import numpy_translator
from . import oneview
from . import ptychography
from . import sporc
from . imp... | from . import be_odf
from . import be_odf_relaxation
from . import beps_ndf
from . import general_dynamic_mode
from . import gmode_iv
from . import gmode_line
from . import image
from . import ndata_translator
from . import numpy_translator
from . import igor_ibw
from . import oneview
from . import ptychography
from . ... | Add missing import statement for igor translator | Add missing import statement for igor translator
| Python | mit | anugrah-saxena/pycroscopy,pycroscopy/pycroscopy | ---
+++
@@ -7,6 +7,7 @@
from . import image
from . import ndata_translator
from . import numpy_translator
+from . import igor_ibw
from . import oneview
from . import ptychography
from . import sporc |
43ea528a1832c94dd7879f995a1c4cc8dfb2a315 | pyroonga/tests/functional/conftest.py | pyroonga/tests/functional/conftest.py | # -*- coding: utf-8 -*-
import json
import os
import pytest
from pyroonga.odm.table import tablebase, TableBase
from pyroonga.tests import utils
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
FIXTURE_PATH = os.path.join(FIXTURE_DIR, 'dbfixture%s.json')
@pytest.fixture
def Table(request):
cl... | # -*- coding: utf-8 -*-
import json
import os
import pytest
from pyroonga.odm.table import tablebase, TableBase
from pyroonga.tests import utils
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
FIXTURE_PATH = os.path.join(FIXTURE_DIR, 'dbfixture%s.json')
@pytest.fixture
def Table(request):
cl... | Fix an issue that tables not be removed in end of each test | Fix an issue that tables not be removed in end of each test
| Python | mit | naoina/pyroonga,naoina/pyroonga | ---
+++
@@ -20,12 +20,12 @@
def __tablename__(cls):
if not getattr(cls, '_tablename', None):
cls._tablename = utils.gen_unique_tablename()
+
+ def remove_table():
+ utils.sendquery('table_remove %s' % cls._tablename)
+ request.add... |
c613df26375d205272ecc1ccc6295b292508cc13 | PhotoLoader/loader/tests/test_model.py | PhotoLoader/loader/tests/test_model.py | from io import BytesIO
from PIL import Image
from django.core.files.base import ContentFile
from django.db import transaction
from django.db.utils import IntegrityError
from django.test import TestCase
from .factory import PhotoFactory
class ModelTest(TestCase):
def setUp(self):
self.photo = PhotoFactory()... | from io import BytesIO
import os
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.db import transaction
from django.db.utils import IntegrityError
from django.test import TestCase
from PIL import Image
from .factory import PhotoFactory
class ModelTest(T... | Delete unnecessary file in 'media' folder | Delete unnecessary file in 'media' folder
| Python | mit | SerSamgy/PhotoLoader,SerSamgy/PhotoLoader | ---
+++
@@ -1,17 +1,24 @@
from io import BytesIO
-from PIL import Image
+import os
+
from django.core.files.base import ContentFile
+from django.core.files.storage import default_storage
from django.db import transaction
from django.db.utils import IntegrityError
from django.test import TestCase
+from PIL import... |
47f19fec718f8407965487e2d3b993e8dbc7e23b | qregexeditor/api/match_highlighter.py | qregexeditor/api/match_highlighter.py | import re
from pyqode.core.qt import QtGui
class MatchHighlighter(QtGui.QSyntaxHighlighter):
def __init__(self, document):
super().__init__(document)
self.prog = None
self._format = QtGui.QTextCharFormat()
self._format.setBackground(QtGui.QBrush(QtGui.QColor('#bbfcbb')))
def h... | import re
from pyqode.core.qt import QtGui
class MatchHighlighter(QtGui.QSyntaxHighlighter):
def __init__(self, document):
super().__init__(document)
self.prog = None
self._format = QtGui.QTextCharFormat()
self._format.setBackground(QtGui.QBrush(QtGui.QColor('#bbfcbb')))
def h... | Fix highlighting when multiple matches | Fix highlighting when multiple matches
| Python | mit | ColinDuquesnoy/QRegexEditor | ---
+++
@@ -11,12 +11,6 @@
def highlightBlock(self, text):
if self.prog and text:
- match = self.prog.search(text)
- if match:
- start, end = match.span()
- while match and end > start:
- self.setFormat(start, end - start, self._fo... |
d4e5af537be36bd50405e60fdb46f31b88537916 | src/commoner_i/views.py | src/commoner_i/views.py | from django.core.files.storage import default_storage
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from django.http import HttpResponse
def badge(request, username, size=''):
# serve the inactive badge by default
filename = 'images/badge/%sinactive.png' % size
... | from django.core.files.storage import default_storage
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404
def badge(request, username, size=''):
# serve the inactive badge by default
filename = 'images/badge/%sinactive.png' %... | Raise a 404 when for FREE profile badge requests | Raise a 404 when for FREE profile badge requests
| Python | agpl-3.0 | cc-archive/commoner,cc-archive/commoner | ---
+++
@@ -1,7 +1,7 @@
from django.core.files.storage import default_storage
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
-from django.http import HttpResponse
+from django.http import HttpResponse, Http404
def badge(request, username, size=''):
@@ -12,9 +12,13 @... |
bb3842ab99b830eee5dc7f34061f3ad98a2b6374 | flask_ui/models/__init__.py | flask_ui/models/__init__.py | from flask_ui import db
class Group(db.Model):
__tablename__ = 'Groups'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(30))
class User(db.Model):
__tablename__ = 'Users'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(60))
class Tag(db.Model):
__tablename__... | Add a basic database model | Add a basic database model
| Python | mit | matcom/autoexam,matcom/autoexam,matcom/autoexam,matcom/autoexam,matcom/autoexam | ---
+++
@@ -0,0 +1,39 @@
+from flask_ui import db
+
+
+
+class Group(db.Model):
+ __tablename__ = 'Groups'
+ id = db.Column(db.Integer, primary_key=True)
+ name = db.Column(db.String(30))
+
+
+class User(db.Model):
+ __tablename__ = 'Users'
+ id = db.Column(db.Integer, primary_key=True)
+ name = db.Column(db.String(6... | |
ff3ec67192ec144c12cabc7b403f17650c460757 | tests/sentry/metrics/test_datadog.py | tests/sentry/metrics/test_datadog.py | from __future__ import absolute_import
import socket
from mock import patch
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
class DatadogMetricsBackendTest(TestCase):
def setUp(self):
self.backend = DatadogMetricsBackend(prefix='sentrytest.')
@patch('... | from __future__ import absolute_import
from mock import patch
from datadog.util.hostname import get_hostname
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
class DatadogMetricsBackendTest(TestCase):
def setUp(self):
self.backend = DatadogMetricsBackend(pr... | Test DatadogMetricsBackend against datadog's get_hostname | Test DatadogMetricsBackend against datadog's get_hostname
This fixes tests in Travis since the hostname returned is different
| Python | bsd-3-clause | ngonzalvez/sentry,korealerts1/sentry,fotinakis/sentry,beeftornado/sentry,ngonzalvez/sentry,gencer/sentry,nicholasserra/sentry,BuildingLink/sentry,JamesMura/sentry,kevinlondon/sentry,jean/sentry,beeftornado/sentry,mvaled/sentry,mvaled/sentry,Natim/sentry,looker/sentry,kevinlondon/sentry,korealerts1/sentry,daevaorn/sentr... | ---
+++
@@ -1,8 +1,8 @@
from __future__ import absolute_import
-import socket
+from mock import patch
-from mock import patch
+from datadog.util.hostname import get_hostname
from sentry.metrics.datadog import DatadogMetricsBackend
from sentry.testutils import TestCase
@@ -18,7 +18,7 @@
mock_incr.ass... |
8d02522c276b87f45999281c3aa6a57e19df9c09 | src/core/middlewares.py | src/core/middlewares.py | import re
from django.conf import settings
from django.http import HttpResponseRedirect
# Matches things like
# /en
# /en/
# /en/foo/bar (can be anything after the first trailing slash)
# But not
# /en-gb
# because the fallback language code is not followed immediately by a slash.
FALLBACK_PREFIX_PATTERN = r... | import re
from django.conf import settings
from django.core.urlresolvers import get_script_prefix
from django.http import HttpResponseRedirect
# Matches things like
# /en
# /en/
# /en/foo/bar (can be anything after the first trailing slash)
# But not
# /en-gb
# because the fallback language code is not follo... | Prepend script prefix when replacing lang code | Prepend script prefix when replacing lang code
| Python | mit | pycontw/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016 | ---
+++
@@ -1,6 +1,7 @@
import re
from django.conf import settings
+from django.core.urlresolvers import get_script_prefix
from django.http import HttpResponseRedirect
@@ -33,5 +34,8 @@
return
lang = match.group('lang')
fallback = settings.FALLBACK_LANGUAGE_PREFIXES[lang]
- ... |
4489a5ffcd7fee5f6c243e050de5e65ef45a3100 | nested_comments/serializers.py | nested_comments/serializers.py | # Third party apps
from rest_framework import serializers
# Other AstroBin apps
from common.api_fields import PKRelatedFieldAcceptNull
# This app
from .models import NestedComment
class NestedCommentSerializer(serializers.ModelSerializer):
class Meta:
model = NestedComment
fields = (
... | # Third party apps
from rest_framework import serializers
# Other AstroBin apps
from common.api_fields import PKRelatedFieldAcceptNull
# This app
from .models import NestedComment
class NestedCommentSerializer(serializers.ModelSerializer):
class Meta:
model = NestedComment
fields = (
... | Remove unneded API serializer field that was breaking nested comments | Remove unneded API serializer field that was breaking nested comments
| Python | agpl-3.0 | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | ---
+++
@@ -22,5 +22,3 @@
'deleted',
'parent',
)
-
- parent = PKRelatedFieldAcceptNull(read_only = True) |
80c192155256aa02f290130f792fc804fb59a4d7 | pycat/talk.py | pycat/talk.py | """Communication link driver."""
import sys
import selectors
CLIENT_TO_SERVER = object()
SERVER_TO_CLIENT = object()
def talk(socket, source=sys.stdin.buffer, sink=sys.stdout.buffer):
"""Run communication, in a loop. Input from `source` is sent on `socket`,
and data received on `socket` is forwarded to `si... | """Communication link driver."""
import sys
import select
def talk(socket, source=sys.stdin.buffer, sink=sys.stdout.buffer):
"""Run communication, in a loop. Input from `source` is sent on `socket`,
and data received on `socket` is forwarded to `sink`.
All file descriptors must be non-blocking.
"""
... | Switch to just using `select` directly | Switch to just using `select` directly
This is less efficient, but does let use get the "exceptional" cases
and handle them more pleasantly.
| Python | mit | prophile/pycat | ---
+++
@@ -1,11 +1,7 @@
"""Communication link driver."""
import sys
-import selectors
-
-
-CLIENT_TO_SERVER = object()
-SERVER_TO_CLIENT = object()
+import select
def talk(socket, source=sys.stdin.buffer, sink=sys.stdout.buffer):
@@ -17,15 +13,12 @@
OUTPUT_BUFFER_SIZE = 1024
- with selectors.Def... |
133bddf28eed38273eeb384b152ec35ae861a480 | sunpy/__init__.py | sunpy/__init__.py | """
SunPy
=====
An open-source Python library for Solar Physics data analysis.
Web Links
---------
Homepage: http://sunpy.org
Documentation: http://docs.sunpy.org/en/stable/
"""
from __future__ import absolute_import
try:
from .version import version as __version__
except ImportError:
__version__ = ''
try:
... | """
SunPy
=====
An open-source Python library for Solar Physics data analysis.
Web Links
---------
Homepage: http://sunpy.org
Documentation: http://docs.sunpy.org/en/stable/
"""
from __future__ import absolute_import
try:
from .version import version as __version__
except ImportError:
__version__ = ''
try:
... | Make sure package does not import itself during setup | Make sure package does not import itself during setup
| Python | bsd-2-clause | dpshelio/sunpy,dpshelio/sunpy,dpshelio/sunpy | ---
+++
@@ -21,14 +21,21 @@
except ImportError:
__githash__ = ''
-import os
-from sunpy.util.config import load_config, print_config
-from sunpy.util import system_info
-from sunpy.tests.runner import SunPyTestRunner
+try:
+ _ASTROPY_SETUP_
+except NameError:
+ _ASTROPY_SETUP_ = False
-self_test = Sun... |
0dda4e65d4c15e3654cb77298e008d6f2d1f179b | numpy/_array_api/_dtypes.py | numpy/_array_api/_dtypes.py | import numpy as np
# Note: we use dtype objects instead of dtype classes. The spec does not
# require any behavior on dtypes other than equality.
int8 = np.dtype('int8')
int16 = np.dtype('int16')
int32 = np.dtype('int32')
int64 = np.dtype('int64')
uint8 = np.dtype('uint8')
uint16 = np.dtype('uint16')
uint32 = np.dtype... | import numpy as np
# Note: we use dtype objects instead of dtype classes. The spec does not
# require any behavior on dtypes other than equality.
int8 = np.dtype('int8')
int16 = np.dtype('int16')
int32 = np.dtype('int32')
int64 = np.dtype('int64')
uint8 = np.dtype('uint8')
uint16 = np.dtype('uint16')
uint32 = np.dtype... | Use tuples for internal type lists in the array API | Use tuples for internal type lists in the array API
These are easier for type checkers to handle.
| Python | mit | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | ---
+++
@@ -15,10 +15,10 @@
# Note: This name is changed
bool = np.dtype('bool')
-_all_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64,
- float32, float64, bool]
-_boolean_dtypes = [bool]
-_floating_dtypes = [float32, float64]
-_integer_dtypes = [int8, int16, int32, int64, uint8, ... |
57280453c222dddff6433e234608e89684e79c93 | test_board_pytest.py | test_board_pytest.py | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | from board import Board
def test_constructor():
board = Board(0,0)
assert board.boardMatrix.size == 0
assert board.columns == 0
assert board.rows == 0
board = Board(5,5)
assert board.boardMatrix.size == 25
assert board.columns == 5
assert board.rows == 5
def test_addPiece():
board... | Add more tests for addPiece method. | Add more tests for addPiece method.
| Python | mit | isaacarvestad/four-in-a-row | ---
+++
@@ -13,5 +13,16 @@
def test_addPiece():
board = Board(5,5)
- board.addPiece(0, 1)
+ assert board.addPiece(0, 1) == True
assert board.boardMatrix.item((4,0)) == 1
+
+ assert board.addPiece(0, 1) == True
+ assert board.boardMatrix.item((3,0)) == 1
+
+ assert board.addPiece(1, 1) == T... |
0575b4345fc21ca537a95866ff2a24d25128c698 | readthedocs/config/find.py | readthedocs/config/find.py | """Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_all(path, filename_regex):
"""Find all files in ``path`` that match ``filename_regex`` regex."""
path = os.path.abspath(path)
for root, dirs, files in os.walk(path, topd... | """Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
_path = os.path.abspath(path)
for filename in os.listdir(_path):
... | Remove logic for iterating directories to search for config file | Remove logic for iterating directories to search for config file
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | ---
+++
@@ -6,18 +6,11 @@
import re
-def find_all(path, filename_regex):
- """Find all files in ``path`` that match ``filename_regex`` regex."""
- path = os.path.abspath(path)
- for root, dirs, files in os.walk(path, topdown=True):
- dirs.sort()
- for filename in files:
- if re.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.