commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
51ceeb00175943dc5e8252c0a972452957093474 | Refactor for PEP8 | attakei/ananta | ananta/scripts/deploy.py | ananta/scripts/deploy.py | # -*- coding:utf8 -*-
"""Deploy build package
"""
from __future__ import unicode_literals
import zipfile
import json
__author__ = 'attakei'
def deploy_functions(registry, config, args):
import boto3
client = boto3.client('lambda')
functions_list = []
with zipfile.ZipFile(args.path) as zfp:
... | # -*- coding:utf8 -*-
"""Deploy build package
"""
from __future__ import unicode_literals
import zipfile
import json
__author__ = 'attakei'
def deploy_functions(registry, config, args):
import boto3
client = boto3.client('lambda')
functions_list = []
with zipfile.ZipFile(args.path) as zfp:
... | mit | Python |
92afee803c7d18ccccffeb530c189478269dee08 | Fix reference error and add script for packing pypi package (#1172) | yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,yangw1234/BigDL,intel-analytics/BigDL | python/dllib/src/bigdl/utils/engine.py | python/dllib/src/bigdl/utils/engine.py | #
# Copyright 2016 The BigDL Authors.
#
# 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 ... | #
# Copyright 2016 The BigDL Authors.
#
# 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 ... | apache-2.0 | Python |
95219f3e4ef741d7e8d354c60128ea595b921809 | Improve chain calls and docstring | dcramer/mock-django,bennylope/mock-django | mock_django/managers.py | mock_django/managers.py | """
mock_django.managers
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import mock
__all__ = ('ManagerMock',)
class _ManagerMock(mock.MagicMock):
def __init__(self, *args, **kwargs):
super(_ManagerMock, self).__init__(*args, **kwargs)
... | """
mock_django.managers
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import mock
__all__ = ('ManagerMock',)
class _ManagerMock(mock.MagicMock):
def __init__(self, *args, **kwargs):
super(_ManagerMock, self).__init__(*args, **kwargs)
... | apache-2.0 | Python |
df244c8b8b16df2d40553da90b1c70442e194ba0 | Add files via upload | ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS,ifrguy/NHWG-MIMS | src/mims_conf.py | src/mims_conf.py | """
MIMS Configuration File
"""
# Mongo DB host options
MIMS_HOST = 'localhost'
MIMS_PORT = 27017
MIMS_DB = 'NHWG'
# Where to save output
LogFilePath = "./log/"
JobFilePath = "./job/"
| """
MIMS Configuration File
"""
# Where to save output
LogFilePath = "./log/"
JobFilePath = "./job/"
# Delete user records from MongoDB Google DB if purged
DeletePurged = False
| apache-2.0 | Python |
fdf5f2045ceb2f98843ce5869c8a4d28a4c3884a | Verify type and agent when comparing metrics | omniti-labs/circus,omniti-labs/circus | module/compare_hosts.py | module/compare_hosts.py | import collections
__cmdname__ = 'compare_hosts'
__cmdopts__ = ''
class recursivedefaultdict(collections.defaultdict):
def __init__(self):
self.default_factory = type(self)
class Module(object):
def __init__(self, api, account):
self.api = api
def command(self, opts, host1, host2):
... | __cmdname__ = 'compare_hosts'
__cmdopts__ = ''
class Module(object):
def __init__(self, api, account):
self.api = api
def command(self, opts, host1, host2):
"""Compare the metrics of two hosts
"""
rv = self.api.list_checks()
ips = [host1, host2]
# Fetch checks... | isc | Python |
57bb37d7579620005a49613ff90f0a2eec55a77e | Fix max elements in header | jilljenn/voyageavecmoi,jilljenn/voyageavecmoi,jilljenn/voyageavecmoi | backend/offers_web.py | backend/offers_web.py | import falcon
import json
import rethinkdb as r
MAX_OFFERS = 100
class OfferListResource:
def __init__(self):
self._db = r.connect('localhost', 28015)
def on_get(self, req, resp):
"""Returns all offers available"""
try:
limit, page = map(int, (req.params.get('limit', MAX_O... | import falcon
import json
import rethinkdb as r
MAX_OFFERS = 100
class OfferListResource:
def __init__(self):
self._db = r.connect('localhost', 28015)
def on_get(self, req, resp):
"""Returns all offers available"""
try:
limit, page = map(int, (req.params.get('limit', MAX_O... | agpl-3.0 | Python |
6a3fe8917bde9914157fe18096e14512c25209ab | Return 400 if form is invalid | eldarion/django-boxes,pinax/pinax-boxes | boxes/views.py | boxes/views.py | import json
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils import timezone
from django.views.decorators.http ... | import json
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils import timezone
from django.views.decorators.http i... | unknown | Python |
38aaf1dda20e0eb0ade8fb6bd1965059cf755681 | Remove debug view | patrick91/pycon,patrick91/pycon | backend/pycon/urls.py | backend/pycon/urls.py | from api.schema import schema
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from strawberry.contrib.django.views import GraphQLView
urlpatterns = [
path("admin/"... | from api.schema import schema
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.http.response import HttpResponse
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from strawberry.contrib.django.views import ... | mit | Python |
a4bbe08089143326a655edf0cd8d914078588852 | check permuation.py | bourneagain/pythonBytes,bourneagain/pythonBytes,bourneagain/pythonBytes,bourneagain/pythonBytes | checkPermutation.py | checkPermutation.py | from collections import defaultdict
def permutation(str1,str2):
str1_dict=defaultdict(lambda: 0)
str2_dict=defaultdict(lambda: 0)
for i in str1:
str1_dict[i]+=1
for j in str2:
str2_dict[j]+=1
if str1_dict == str2_dict:
return True
else:
return False
print permutation("sama","maas");
print permutation("sa... | from collections import defaultdict
def permutation(str1,str2):
str1_dict=defaultdict(lambda: 0)
str2_dict=defaultdict(lambda: 0)
for i in str1:
str1_dict[i]+=1
for j in str2:
str2_dict[j]+=1
if str1_dict == str2_dict:
return True
else:
return False
print permutation("sama","maas");
print permutation("sa... | mit | Python |
41ec32fbb818d9178d28d37a9edc037827449fa7 | Make autocomplete never suggest empty suggestions. | marineam/nagcat,marineam/nagcat,marineam/nagcat | railroad/railroad/ajax/autocomplete.py | railroad/railroad/ajax/autocomplete.py | from django.http import HttpResponse
from railroad.viewhosts import views
import itertools
import json
def transpose_combo(li, n, memo):
"""
Give the right set of auto complete suggestions for repeated start strings.
Note that if called with the same inputs multiple times different values
will be retu... | from django.http import HttpResponse
from railroad.viewhosts import views
import itertools
import json
def transpose_combo(li, n, memo):
"""
Give the right set of auto complete suggestions for repeated start strings.
Note that if called with the same inputs multiple times different values
will be retu... | apache-2.0 | Python |
c630bb2189f21ea2d457e841149494e56802fc5c | Fix build | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | lib_client/src/d1_client/tests/test_object_format_info.py | lib_client/src/d1_client/tests/test_object_format_info.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache... | apache-2.0 | Python |
8830659b13e538c10ead74263b4f17c70271fb8d | bump version | vmalloc/gossip | gossip/__version__.py | gossip/__version__.py | __version__ = "0.6.0"
| __version__ = "0.5.0"
| bsd-3-clause | Python |
95e8c937e6a56e5c983058a64e4318cc885e5a77 | add campipe function arguments | bollu/polymage,bollu/polymage,bollu/polymage | sandbox/apps/python/img_proc/campipe/exec_pipe.py | sandbox/apps/python/img_proc/campipe/exec_pipe.py | import sys
import os
import ctypes
import numpy as np
import time
from printer import print_line
from compiler import *
from constructs import *
from utils import *
def call_pipe(U_, W_, app_data):
rows = app_data['rows']
cols = app_data['cols']
app_args = app_data['app_args']
colour_temp = app_ar... | import sys
import os
import ctypes
import numpy as np
import time
from printer import print_line
from compiler import *
from constructs import *
from utils import *
def call_pipe(U_, W_, app_data):
rows = app_data['rows']
cols = app_data['cols']
img_data = app_data['img_data']
IN = img_data['IN']
... | apache-2.0 | Python |
cd3b686204e48412765c633f61f02a6166141125 | Use standard three-digits for now | ella/citools,ella/citools | citools/__init__.py | citools/__init__.py | """
CI tools is a collection of small configurations aimed to ease setting up
complete CI system, targettet on django apps.
"""
VERSION = (0, 1, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
| """
CI tools is a collection of small configurations aimed to ease setting up
complete CI system, targettet on django apps.
"""
VERSION = (0, 0, 1, 0)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION))
| bsd-3-clause | Python |
b769460d4bb1d861ef7bf7eec59eaf1b0231baae | bump version | rsalmei/clearly | clearly/__init__.py | clearly/__init__.py | VERSION = (0, 9, 0)
__author__ = 'Rogério Sampaio de Almeida'
__email__ = 'rsalmei@gmail.com'
__version__ = '.'.join(map(str, VERSION))
__all__ = ('__author__', '__version__', '__email__')
| VERSION = (0, 8, 3)
__author__ = 'Rogério Sampaio de Almeida'
__email__ = 'rsalmei@gmail.com'
__version__ = '.'.join(map(str, VERSION))
__all__ = ('__author__', '__version__', '__email__')
| mit | Python |
072d26d8e118a42c97e8fccd2ac50354aae912c8 | Enable pyparsing packrat. | pyrapt/rapt | rapt/treebrd/grammars/proto_grammar.py | rapt/treebrd/grammars/proto_grammar.py | from pyparsing import (alphanums, Regex, Word, alphas, quotedString,
removeQuotes, Combine, Optional, downcaseTokens, ParserElement)
ParserElement.enablePackrat()
class ProtoGrammar:
"""
A grammar with fundamental rules for characters, strings, and
numbers.
The rules are annot... | from pyparsing import (alphanums, Regex, Word, alphas, quotedString,
removeQuotes, Combine, Optional, downcaseTokens)
class ProtoGrammar:
"""
A grammar with fundamental rules for characters, strings, and
numbers.
The rules are annotated with their BNF equivalents. For a complet... | mit | Python |
73f1b9f2d4ed69c18346925d459fe105f918433a | fix test | josephkirk/PipelineTools,josephkirk/PipelineTools,josephkirk/PipelineTools,josephkirk/PipelineTools | tests/test_generalutils.py | tests/test_generalutils.py | # -*- coding: utf-8 -*-
import unittest
from context import pt
import pymel.core as pm
ul = pt.core.ul
class TestDoFunctionOn(unittest.TestCase):
"""Basic test cases."""
def setUp(self):
new_obs = []
collumn = 5
row = 6
for i in range(collumn):
new_ob = pm.polySphere... | # -*- coding: utf-8 -*-
import unittest
from context import pt
import pymel.core as pm
ul = pt.core.ul
class TestDoFunctionOn(unittest.TestCase):
"""Basic test cases."""
def setUp(self):
new_obs = []
collumn = 5
row = 6
for i in range(collumn):
new_ob = pm.polySphere... | bsd-2-clause | Python |
1518819f027afa1ae616c17eb7ff780d4fdcebcf | return TextStim with all attributes from GoogleTextAPIConverter | tyarkoni/featureX,tyarkoni/pliers | pliers/converters/google.py | pliers/converters/google.py | from .image import ImageToTextConverter
from pliers.stimuli.text import TextStim
from pliers.google import GoogleVisionAPITransformer
class GoogleVisionAPITextConverter(GoogleVisionAPITransformer, ImageToTextConverter):
request_type = 'TEXT_DETECTION'
response_object = 'textAnnotations'
def __init__(sel... | from .image import ImageToTextConverter
from pliers.stimuli.text import TextStim
from pliers.google import GoogleVisionAPITransformer
class GoogleVisionAPITextConverter(GoogleVisionAPITransformer, ImageToTextConverter):
request_type = 'TEXT_DETECTION'
response_object = 'textAnnotations'
def __init__(sel... | bsd-3-clause | Python |
616ea113fc16ff803a2eddd860fb95c7a358dfaf | Kill the celery indexes for now. | emawind84/readthedocs.org,kenshinthebattosai/readthedocs.org,safwanrahman/readthedocs.org,rtfd/readthedocs.org,hach-que/readthedocs.org,davidfischer/readthedocs.org,royalwang/readthedocs.org,d0ugal/readthedocs.org,istresearch/readthedocs.org,michaelmcandrew/readthedocs.org,asampat3090/readthedocs.org,pombredanne/readth... | readthedocs/projects/search_indexes.py | readthedocs/projects/search_indexes.py | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
from haystack import site
from haystack.indexes import *
#from celery_haystack.indexes import CelerySearchIndex
from projects.models import File, ImportedFile, Project
import logging
log = logging.getLogger(__name__)
class Pr... | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
from haystack import site
from haystack.indexes import *
from celery_haystack.indexes import CelerySearchIndex
from projects.models import File, ImportedFile, Project
import logging
log = logging.getLogger(__name__)
class Pro... | mit | Python |
2cffa6ec657bfc355838ba57ae3c5aa76c17c59b | Add basic auth check func for auth resource | tforrest/soda-automation,tforrest/soda-automation | app/api/api.py | app/api/api.py | from flask_restful import Resource, fields
from flask_restful import reqparse
from flask import request
from util.danger import gen_auth_token
from util.util import validate_memmber
from util.util import bad_resp_match
from mailchimp import chimp
from models.user import User
from redis_ops.init_redis import RedisServi... | from flask_restful import Resource, fields
from flask_restful import reqparse
from flask import request
from util.danger import gen_auth_token
from util.util import validate_memmber
from util.util import bad_resp_match
from mailchimp import chimp
from redis_ops.init_redis import RedisService
requester = chimp.ChimpRe... | mit | Python |
7b6bb4b67f564f3c650e4ba40aa96e87d87f0065 | Fix test on Windows | nabla-c0d3/sslyze | tests/test_https_tunnel.py | tests/test_https_tunnel.py | # -*- coding: utf-8 -*-
import unittest
from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin
from sslyze.server_connectivity import ServerConnectivityInfo, ServerConnectivityError
from sslyze.ssl_settings import HttpConnectTunnelingSettings
from tiny_proxy import ProxyHandler
from tiny_proxy import... | # -*- coding: utf-8 -*-
import unittest
from sslyze.plugins.certificate_info_plugin import CertificateInfoPlugin
from sslyze.server_connectivity import ServerConnectivityInfo, ServerConnectivityError
from sslyze.ssl_settings import HttpConnectTunnelingSettings
from tiny_proxy import ProxyHandler
from tiny_proxy import... | agpl-3.0 | Python |
a456f06c88d3332a41020412b54dfccc02ddfcea | add failing test that accounts for web users | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/apps/users/tests/test_analytics.py | corehq/apps/users/tests/test_analytics.py | from django.test import TestCase
from corehq.apps.users.analytics import update_analytics_indexes, get_count_of_active_commcare_users_in_domain, \
get_count_of_inactive_commcare_users_in_domain
from corehq.apps.users.dbaccessors.all_commcare_users import delete_all_users
from corehq.apps.users.models import CommCar... | from django.test import TestCase
from corehq.apps.users.analytics import update_analytics_indexes, get_count_of_active_commcare_users_in_domain, \
get_count_of_inactive_commcare_users_in_domain
from corehq.apps.users.dbaccessors.all_commcare_users import delete_all_users
from corehq.apps.users.models import CommCar... | bsd-3-clause | Python |
a3fb4782d87603758bea5babbb3565bc682513a1 | Fix C from row to column vector | agutieda/QuantEcon.py,oyamad/QuantEcon.py,gxxjjj/QuantEcon.py,andybrnr/QuantEcon.py,agutieda/QuantEcon.py,gxxjjj/QuantEcon.py,andybrnr/QuantEcon.py,QuantEcon/QuantEcon.py,QuantEcon/QuantEcon.py,oyamad/QuantEcon.py | examples/tsh_hg.py | examples/tsh_hg.py |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from quantecon import LinearStateSpace
phi_1, phi_2, phi_3, phi_4 = 0.5, -0.2, 0, 0.5
sigma = 0.1
A = [[phi_1, phi_2, phi_3, phi_4],
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0]]
C = [[sigma... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
from quantecon import LinearStateSpace
phi_1, phi_2, phi_3, phi_4 = 0.5, -0.2, 0, 0.5
sigma = 0.1
A = [[phi_1, phi_2, phi_3, phi_4],
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0]]
C = [sigma,... | bsd-3-clause | Python |
bcb0489f7d1efda6e97ab3e614de1e020fdcda9f | fix imports in defend_restart | RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software | rj_gameplay/rj_gameplay/play/defend_restart.py | rj_gameplay/rj_gameplay/play/defend_restart.py | import stp.play as play
import stp.tactic as tactic
from rj_gameplay.tactic import nmark_tactic, goalie_tactic, wall_tactic
import stp.skill as skill
import stp.role as role
from stp.role.assignment.naive import NaiveRoleAssignment
import stp.rc as rc
from typing import Dict, Generic, Iterator, List, Optional, Tuple, ... | import stp.play as play
import stp.tactic as tactic
from rj_gameplay.tactic import capture_tactic, nmark_tactic, goalie_tactic, wall_tactic
import stp.skill as skill
import stp.role as role
from stp.role.assignment.naive import NaiveRoleAssignment
import stp.rc as rc
from typing import Dict, Generic, Iterator, List, O... | apache-2.0 | Python |
958c2aae1af34dbb88e0e7ec8666418217398e08 | Update words.py | alexhsamuel/codex | exercises/words.py | exercises/words.py |
def count_words(text):
'''
Counts words in a text, and returns a dict from word to count.
'''
# FIXME: Write this! Try splitting the text into words, then counting each word.
| def split(text, sep):
'''
Divides up some a string 'text' at each occurrence of a separator 'sep'.
Returns a list of parts of the text, with the separators removed.
'''
# Start with an empty list of parts.
parts = []
while True:
# Find the next occurrence of the separator.
i... | mit | Python |
fac7e7d8759aab7e2bea666e55d71e35da45c334 | Implement Gref.tips() to fetch it's tips. | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | groundstation/gref.py | groundstation/gref.py | import os
class Gref(object):
def __init__(self, store, channel, identifier):
self.store = store
self.channel = channel.replace("/", "_")
self.identifier = identifier
self._node_path = os.path.join(self.store.gref_path(),
self.channel,
... | import os
class Gref(object):
def __init__(self, store, channel, identifier):
self.store = store
self.channel = channel.replace("/", "_")
self.identifier = identifier
self._node_path = os.path.join(self.store.gref_path(),
self.channel,
... | mit | Python |
6e2cbb2da770d73e12dfae7d36fd6f1ef00c4ed7 | Change start-weblogic-server using jdk as default. | gameduell/eclipselink.runtime,gameduell/eclipselink.runtime,gameduell/eclipselink.runtime,gameduell/eclipselink.runtime | jpa/eclipselink.jpa.test/resource/weblogic/wls_start.py | jpa/eclipselink.jpa.test/resource/weblogic/wls_start.py | ############################################################################
# Generic script applicable on any Operating Environments (Unix, Windows)
# ScriptName : wls_start.py
# Properties : weblogic.properties
# Author : Kevin Yuan
#############################################################... | ############################################################################
# Generic script applicable on any Operating Environments (Unix, Windows)
# ScriptName : wls_start.py
# Properties : weblogic.properties
# Author : Kevin Yuan
#############################################################... | epl-1.0 | Python |
021fef4da7b387cc34eed6c880e36bd315c9772c | Fix ok! price ceiled | ctmil/meli_oerp,ctmil/meli_oerp | currency.py | currency.py |
from openerp import models, fields, api, _
class res_currency_rate(models.Model):
_inherit = 'res.currency.rate'
@api.one
@api.onchange('rate') # if these fields are changed, call method
def check_change_rate(self):
self.update_prices()
@api.model
def update_prices(self):
#im... |
from openerp import models, fields, api, _
class res_currency_rate(models.Model):
_inherit = 'res.currency.rate'
@api.one
@api.onchange('rate') # if these fields are changed, call method
def check_change_rate(self):
self.update_prices()
@api.model
def update_prices(self):
#im... | agpl-3.0 | Python |
98efde1b8df89d7d06aa47ac0db198485a1452fe | return response instead of tuple | m000/django_generic_confirmation | generic_confirmation/views.py | generic_confirmation/views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from .forms import ConfirmationForm
def confirm_by_form(request, template_name='confirm.html',
success_template_name='confirmed.html',
succes... | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from .forms import ConfirmationForm
def confirm_by_form(request, template_name='confirm.html',
success_template_name='confirmed.html',
succes... | bsd-3-clause | Python |
f8866e2981937fea8041c973d5ade44757c1912c | comment out the static files storage, atleast while we are still compiling less in the browser | dstufft/jutils | crate_project/settings/production/base.py | crate_project/settings/production/base.py | from ..base import *
SITE_ID = 3
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
SERVER_EMAIL = "server@crate.io"
DEFAULT_FROM_EMAIL = "donald@crate.io"
CONTACT_EMAIL = "donald@crate.io"
MIDDLEWARE_CLASSES += ["privatebeta.middleware.PrivateBetaMiddleware"]
DEFAULT_FILE_STORAGE = "storages.backends.s... | from ..base import *
SITE_ID = 3
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
SERVER_EMAIL = "server@crate.io"
DEFAULT_FROM_EMAIL = "donald@crate.io"
CONTACT_EMAIL = "donald@crate.io"
MIDDLEWARE_CLASSES += ["privatebeta.middleware.PrivateBetaMiddleware"]
DEFAULT_FILE_STORAGE = "storages.backends.s... | bsd-2-clause | Python |
99edcc35b87c71c31167c02936430d5f4a21ad4b | Revert to previous version. | steenzout/python-barcode,kxepal/viivakoodi | barcode/__init__.py | barcode/__init__.py | # -*- coding: utf-8 -*-
"""
pyBarcode
=========
This package provides a simple way to create standard barcodes.
It needs no external packages to be installed, the barcodes are
created as SVG objects. If PIL (Python Imaging Library) is
installed, the barcodes can also be rendered as images (all
formats supported by P... | # -*- coding: utf-8 -*-
"""
pybarcode
=========
This package provides a simple way to create standard barcodes.
It needs no external packages to be installed, the barcodes are
created as SVG objects. If PIL (Python Imaging Library) is
installed, the barcodes can also be rendered as images (all
formats supported by P... | mit | Python |
c2dfb01a31bdcb819fee70fd627f275019323a62 | Combine a url pattern line. | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/urls.py | api/v2/urls.py | from django.conf.urls import patterns, include, url
from rest_framework import routers
from api.v2 import views
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'allocations', views.AllocationViewSet)
router.register(r'identities', views.IdentityViewSet)
router.register(r'images', views.ImageViewS... | from django.conf.urls import patterns, include, url
from rest_framework import routers
from api.v2 import views
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'allocations', views.AllocationViewSet)
router.register(r'identities', views.IdentityViewSet)
router.register(r'images', views.ImageViewS... | apache-2.0 | Python |
06a19b5c693b2b5b808f8e7b00136bef6b1a04c3 | Set a random session key if none is configured | mozilla-releng/services,andrei987/services,srfraser/services,andrei987/services,srfraser/services,lundjordan/services,mozilla/build-relengapi,garbas/mozilla-releng-services,garbas/mozilla-releng-services,lundjordan/services,andrei987/services,andrei987/services,garbas/mozilla-releng-services,srfraser/services,hwine/bui... | base/relengapi/app.py | base/relengapi/app.py | import os
from flask import current_app
from flask import Flask
from flask import g
from flask import jsonify
from flask import redirect
from flask import url_for
from relengapi import celery
from relengapi import db
import pkg_resources
def create_app(cmdline=False):
app = Flask('relengapi')
app.config.from_e... | from flask import current_app
from flask import Flask
from flask import g
from flask import jsonify
from flask import redirect
from flask import url_for
from relengapi import celery
from relengapi import db
import pkg_resources
def create_app(cmdline=False):
app = Flask('relengapi')
app.config.from_envvar('REL... | mpl-2.0 | Python |
1af37551cd8e68e84a25f77dc57e5c94b10d3b87 | Support for removing listeners by means of a listener id. | knowitnothing/btcx,knowitnothing/btcx | btcx/common.py | btcx/common.py | import os
from twisted.words.xish.utility import EventDispatcher
USER_AGENT = 'btcx-bot'
class ExchangeEvent(EventDispatcher):
def __init__(self, **kwargs):
EventDispatcher.__init__(self, **kwargs)
self.listener = {}
def listen(self, msg, cb):
event = "%s/%s" % (self.prefix, msg)
... | from twisted.words.xish.utility import EventDispatcher
USER_AGENT = 'btcx-bot'
class ExchangeEvent(EventDispatcher):
def __init__(self, **kwargs):
EventDispatcher.__init__(self, **kwargs)
def listen(self, msg, cb):
event = "%s/%s" % (self.prefix, msg)
self.addObserver(event, cb)
... | mit | Python |
3db68bc6df2435a9f8fa5795a0bf97cdbd7e36fb | remove print | Jpadilla1/notaso,Jpadilla1/notaso,Jpadilla1/notaso | notaso/professors/templatetags/graph_creation.py | notaso/professors/templatetags/graph_creation.py | import urllib
import hashlib
from django import template
from django.conf import settings
from GChartWrapper import *
# http://code.google.com/apis/chart/#sparkline
register = template.Library()
@register.simple_tag
def graph(comments):
scores = []
sum_responsibility = 0
sum_personality = 0
sum_work... | import urllib
import hashlib
from django import template
from django.conf import settings
from GChartWrapper import *
# http://code.google.com/apis/chart/#sparkline
register = template.Library()
@register.simple_tag
def graph(comments):
scores = []
sum_responsibility = 0
sum_personality = 0
sum_work... | mit | Python |
c2b5e4f3bbe2980072cfd21a8532718b8d7fdcfc | Update test to use parametrization instead of yield | stscieisenhamer/glue,stscieisenhamer/glue | glue/utils/tests/test_misc.py | glue/utils/tests/test_misc.py | from __future__ import absolute_import, division, print_function
import pytest
from ..misc import as_variable_name, file_format, DeferredMethod, nonpartial, lookup_class, as_list
INPUT_EXPECTED = [('x', 'x'),
('x2', 'x2'),
('2x', '_2x'),
('x!', 'x_'),
... | from __future__ import absolute_import, division, print_function
import pytest
from ..misc import as_variable_name, file_format, DeferredMethod, nonpartial, lookup_class, as_list
def test_as_variable_name():
def check(input, expected):
assert as_variable_name(input) == expected
tests = [('x', 'x'),... | bsd-3-clause | Python |
7b021f1b184aade6b45dbb61294a30dbe8d4ecc2 | Fix autodiscover on 1.7 | ionelmc/django-admin-utils,ionelmc/django-admin-utils,ionelmc/django-admin-utils | tests/test_project/urls.py | tests/test_project/urls.py | try:
from django.conf.urls import patterns, handler404, handler500, include, url
except ImportError:
from django.conf.urls.defaults import patterns, handler404, handler500, include, url
from django.contrib import admin
import django
if django.VERSION < (1, 7):
admin.autodiscover()
urlpatterns = patterns(''... | try:
from django.conf.urls import patterns, handler404, handler500, include, url
except ImportError:
from django.conf.urls.defaults import patterns, handler404, handler500, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)... | bsd-2-clause | Python |
a287d9e3509fa75eb64cc9beac25061142f52284 | Add id to product | AliGhahraei/phar-ant-colony | product.py | product.py | from datetime import datetime
from enum import Enum
import csv
class Phase(Enum):
TROQ = 1
class Product():
def __init__(self, cost, name, date, id_, passed_phases=None):
self.cost = cost
self.name = name
self.date = date
self.passed_phases = passed_phases or set()
se... | from datetime import datetime
from enum import Enum
import csv
class Phase(Enum):
TROQ = 1
class Product():
def __init__(self, cost, name, date, passed_phases=None):
self.cost = cost
self.name = name
self.date = date
self.passed_phases = passed_phases or set()
def days_l... | mit | Python |
6ffde058a4387889c62d673b53bf5f595ec168f7 | Bump version to 0.3.1 | CellProfiling/cam_acq | camacq/const.py | camacq/const.py | """Store common constants."""
__version__ = '0.3.1'
CONFIG_DIR = 'config_dir'
COORD_FILE = 'coord_file'
JOB_ID = '--E{:02d}'
WELL_U_ID = '--U{:02d}'
WELL_V_ID = '--V{:02d}'
FIELD_X_ID = '--X{:02d}'
FIELD_Y_ID = '--Y{:02d}'
CHANNEL_ID = '--C{:02d}'
WELL_NAME = (WELL_U_ID + WELL_V_ID)[2:]
FIELD_NAME = (FIELD_X_ID + FIEL... | """Store common constants."""
__version__ = '0.3.0'
CONFIG_DIR = 'config_dir'
COORD_FILE = 'coord_file'
JOB_ID = '--E{:02d}'
WELL_U_ID = '--U{:02d}'
WELL_V_ID = '--V{:02d}'
FIELD_X_ID = '--X{:02d}'
FIELD_Y_ID = '--Y{:02d}'
CHANNEL_ID = '--C{:02d}'
WELL_NAME = (WELL_U_ID + WELL_V_ID)[2:]
FIELD_NAME = (FIELD_X_ID + FIEL... | apache-2.0 | Python |
552b015fbc9471b6f6af4322b14133a38c37de9f | Improve docstring | rootpy/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,kreczko/rootpy,rootpy/rootpy,kreczko/rootpy,ndawe/rootpy | rootpy/plotting/style/cmstdr/labels.py | rootpy/plotting/style/cmstdr/labels.py | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
"""
Add the "CMS Preliminary" and \sqrt{s} blurbs to CMS plots.
"""
import ROOT
def CMS_label(text="Preliminary 2012", sqrts=8, pad=None):
""" Add a 'CMS Preliminary' style label to the current Pad.
The bl... | # Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
"""
Add the "CMS Preliminary" and \sqrt{s} blurbs to CMS plots.
The blurbs are drawn above the histogram frame.
"""
import ROOT
def CMS_label(text="Preliminary 2012", sqrts=8, pad=None):
if pad is None:
... | bsd-3-clause | Python |
ee67b8869f02cb3bdc405e0403cd71318edcf0de | Split AddTodoRenderer into TodoAddedRenderer and AlreadyToldTodoRenderer | johnlinp/telegram-good-timing-bot,johnlinp/telegram-good-timing-bot | goodtiming/modules/addtodo.py | goodtiming/modules/addtodo.py | import re
from goodtiming.core.request import Request
from goodtiming.core.response import Response
import goodtiming.core.database
class AddTodoModule:
def parsers(self):
return [AddTodoParser()]
def processors(self):
return [AddTodoProcessor()]
def renderers(self):
return [To... | import re
from goodtiming.core.request import Request
from goodtiming.core.response import Response
import goodtiming.core.database
class AddTodoModule:
def parsers(self):
return [AddTodoParser()]
def processors(self):
return [AddTodoProcessor()]
def renderers(self):
return [Ad... | bsd-3-clause | Python |
3b0179e4c12a4f29eb1b19e117c8659c24d5fc85 | Improve test robustness | rjeli/scikit-image,rjeli/scikit-image,paalge/scikit-image,Hiyorimi/scikit-image,ajaybhat/scikit-image,ofgulban/scikit-image,jwiggins/scikit-image,vighneshbirodkar/scikit-image,blink1073/scikit-image,pratapvardhan/scikit-image,jwiggins/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,ofgulban/scikit-image,... | skimage/segmentation/tests/test_clear_border.py | skimage/segmentation/tests/test_clear_border.py | import numpy as np
from numpy.testing import assert_array_equal
from skimage.segmentation import clear_border
def test_clear_border():
image = np.array(
[[0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 0, 0],
... | import numpy as np
from numpy.testing import assert_array_equal
from skimage.segmentation import clear_border
def test_clear_border():
image = np.array(
[[0, 0, 0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0, 0, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 1, 1, 0, 0],
... | bsd-3-clause | Python |
a58430126f385ec7c475f551dd65b0c064de2c47 | clear graphs between renderings | glebb/feelings,glebb/feelings | feelings/graphs.py | feelings/graphs.py | from matplotlib import pyplot
from matplotlib.dates import date2num
from datetime import datetime, timedelta
import os
def create_graph(data, pic_name):
X=[]
for row in data:
temp = datetime.strptime(row['date'], '%Y-%m-%d')
X.append(temp)
Y = [row['feelingavg']for row in data]
if (X and Y... | from matplotlib import pyplot
from matplotlib.dates import date2num
from datetime import datetime, timedelta
import os
def create_graph(data, pic_name):
X=[]
for row in data:
temp = datetime.strptime(row['date'], '%Y-%m-%d')
X.append(temp)
Y = [row['feelingavg']for row in data]
if (X and Y... | mit | Python |
4155d95833b9ddc5f3a47506ca01754d9b218742 | Remove white char from keywords | PyBossa/mnemosyne | project.py | project.py | # This file is part of PyBossa-links.
#
# PyBossa-links is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyBossa-links is dis... | # This file is part of PyBossa-links.
#
# PyBossa-links is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyBossa-links is dis... | agpl-3.0 | Python |
483398d8dd0a4152d459c23636c036c177609491 | add forgotten res_partner update | cyp-opennet/ons_cyp_github,cyp-opennet/ons_cyp_github,BT-fgarbely/l10n-switzerland,open-net-sarl/l10n-switzerland,BT-ojossen/l10n-switzerland,BT-ojossen/l10n-switzerland,ndtran/l10n-switzerland,open-net-sarl/l10n-switzerland,CompassionCH/l10n-switzerland,BT-fgarbely/l10n-switzerland,CompassionCH/l10n-switzerland,BT-aes... | l10n_ch_zip/migrations/8.0.2.0.0/post-migration.py | l10n_ch_zip/migrations/8.0.2.0.0/post-migration.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Mathias Neef
# Copyright 2015 copadoMEDIA UG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Mathias Neef
# Copyright 2015 copadoMEDIA UG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 | Python |
2bed9efe4eee3f6e4016247a60b663acb20f89d3 | Update __init__.py | mapado/haversine | haversine/__init__.py | haversine/__init__.py | from math import radians, cos, sin, asin, sqrt
AVG_EARTH_RADIUS = 6371 # in km
MILES_PER_KILOMETER = 0.621371
def haversine(point1, point2, miles=False):
""" Calculate the great-circle distance between two points on the Earth surface.
:input: two 2-tuples, containing the latitude and longitude of each point... | from math import radians, cos, sin, asin, sqrt
AVG_EARTH_RADIUS = 6371 # in km
def haversine(point1, point2, miles=False):
""" Calculate the great-circle distance between two points on the Earth surface.
:input: two 2-tuples, containing the latitude and longitude of each point
in decimal degrees.
... | mit | Python |
2a3d61e9c28ff170cc15a50d66946ddb7c5e3445 | Update version | Outernet-Project/bottle-utils-html | bottle_utils/__init__.py | bottle_utils/__init__.py | __version__ = '0.3.9'
__author__ = 'Outernet Inc <hello@outernet.is>'
| __version__ = '0.3.8'
__author__ = 'Outernet Inc <hello@outernet.is>'
| bsd-2-clause | Python |
0f1a7e7284d02b7c6bba6c6ad45c20606628b62e | Update bottlespin.py | kallerdaller/Cogs-Yorkfield | bottlespin/bottlespin.py | bottlespin/bottlespin.py | import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... | import discord
from discord.ext import commands
from random import choice
class Bottlespin:
"""Spins a bottle and lands on a random user."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, no_pm=True, alias=["bottlespin"])
async def spin(self, ctx, role):
... | mit | Python |
f7aaa5ccc5973b2c2f97dbd57be13daa6801f91c | Fix copyright, unused imports | thaim/ansible,thaim/ansible | lib/ansible/runner/lookup_plugins/random_choice.py | lib/ansible/runner/lookup_plugins/random_choice.py | # (c) 2013, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | mit | Python |
1b991412ef3657dd971e00b9774b25c643f00d6f | increase expiration date of confirmation messages to 1 day | franckinux/my-own-little-business,franckinux/my-own-little-business,franckinux/my-own-little-business,franckinux/my-own-little-business | molb/views/auth/token.py | molb/views/auth/token.py | from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
def generate_token(secret_key, expiration=86400, **token):
s = Serializer(secret_key, expiration)
return s.dumps(token).decode("ascii")
def get_token_data(token, secret_key):
s = Serializer(secret_key)
return s.loads(token)
| from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
def generate_token(secret_key, expiration=3600, **token):
s = Serializer(secret_key, expiration)
return s.dumps(token).decode("ascii")
def get_token_data(token, secret_key):
s = Serializer(secret_key)
return s.loads(token)
| agpl-3.0 | Python |
47d7eb7aa9c5cebbe541b4804ab88b12c2ad7655 | bump up version to 0.0.14 | mogproject/easy-alert | src/easy_alert/__init__.py | src/easy_alert/__init__.py | __version__ = '0.0.14'
| __version__ = '0.0.13'
| apache-2.0 | Python |
1ff14ee6f98611ed427d5aa2ffee2322d20114fd | update for release | JianCheng/bibtex2html.py | bibtex2html/__version__.py | bibtex2html/__version__.py | __version__ = '2.0'
| __version__ = '1.0.2'
| bsd-3-clause | Python |
08557fb1d73c4a8b2e68c7689292709599ae46b2 | Add alternative XML parsing code that works in Python 2.6 | MITLibraries/ebooks,MITLibraries/ebooks | queries.py | queries.py | import os
import requests
import xml.etree.ElementTree as ET
from string import index
def get_filetypes(file_id):
RESULTS = []
base_path = os.path.dirname(os.path.abspath(__file__))
files_path = os.path.join(base_path, 'static/files')
files = os.listdir(files_path)
for file in files:
i = file.index('.')
fil... | import os
import requests
import xml.etree.ElementTree as ET
from string import index
def get_filetypes(file_id):
RESULTS = []
base_path = os.path.dirname(os.path.abspath(__file__))
files_path = os.path.join(base_path, 'static/files')
files = os.listdir(files_path)
for file in files:
i = file.index('.')
fil... | mit | Python |
d7e1129b4449677333578d1b8313f451d73d5477 | Make HashPathStorage tests safe. | ovnicraft/django-storages,ovnicraft/django-storages | storages/tests/hashpath.py | storages/tests/hashpath.py | import os
import shutil
from django.test import TestCase
from django.core.files.base import ContentFile
from django.conf import settings
from storages.backends.hashpath import HashPathStorage
TEST_PATH_PREFIX = 'django-storages-test'
class HashPathStorageTest(TestCase):
def setUp(self):
self.test_path... | import os
import shutil
from django.test import TestCase
from django.core.files.base import ContentFile
from django.conf import settings
from storages.backends.hashpath import HashPathStorage
class HashPathStorageTest(TestCase):
def setUp(self):
self.storage = HashPathStorage()
# make ... | bsd-3-clause | Python |
a419f6dcb7968d6af1e3ef8eae29b723d96b5fd2 | Update for stayput master and ensure forward compatibility | veeti/stayput_jinja2 | stayput/jinja2/__init__.py | stayput/jinja2/__init__.py | from jinja2 import Environment, FileSystemLoader
from stayput import Templater
class Jinja2Templater(Templater):
def __init__(self, site, *args, **kwargs):
self.site = site
self.env = Environment(loader=FileSystemLoader(site.templates_path))
def template(self, item, site, *args, **kwargs):
... | from jinja2 import Environment, FileSystemLoader
from stayput import Templater
class Jinja2Templater(Templater):
def __init__(self, site, *args, **kwargs):
self.site = site
self.env = Environment(loader=FileSystemLoader(site.templates_path))
def template(self, item):
return self.env... | mit | Python |
8d45412b1135c0fbea72d4ec296daad7dd57f2c9 | Add index for token collection. | joyxu/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend,kernelci/kernelci-backend,joyxu/kernelci-backend | app/handlers/dbindexes.py | app/handlers/dbindexes.py | # Copyright (C) 2014 Linaro Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright (C) 2014 Linaro Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
f25a47a486dabd3fd91bacea818b1a156ac93835 | Fix tests for a problem that oddly exists. | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | tests/app/soc/mapreduce/test_convert_user.py | tests/app/soc/mapreduce/test_convert_user.py | # Copyright 2012 the Melange authors.
#
# 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 wr... | # Copyright 2012 the Melange authors.
#
# 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 wr... | apache-2.0 | Python |
68510f78c84565ad44f48544bb86c2b637b98377 | Bump version | nolze/ms-offcrypto-tool,nolze/msoffcrypto-tool,nolze/ms-offcrypto-tool,nolze/msoffcrypto-tool | msoffcrypto/__init__.py | msoffcrypto/__init__.py | import olefile
__version__ = "4.7.0"
def OfficeFile(file):
'''Return an office file object based on the format of given file.
Args:
file (:obj:`_io.BufferedReader`): Input file.
Returns:
BaseOfficeFile object.
Examples:
>>> f = open("tests/inputs/example_password.docx", "r... | import olefile
__version__ = "4.6.4"
def OfficeFile(file):
'''Return an office file object based on the format of given file.
Args:
file (:obj:`_io.BufferedReader`): Input file.
Returns:
BaseOfficeFile object.
Examples:
>>> f = open("tests/inputs/example_password.docx", "r... | mit | Python |
9983133b9d146f7290db867870d372f0a4243493 | Add more statuses | OleksiiZhmyrov/Aurora | bin/dummy_settings.py | bin/dummy_settings.py | # Copy this file as settings.py and fill in parameters
CONFLUENCE_SETTINGS = {
'login': '',
'password': '',
'namespace': '',
'uri': 'https://hostname:port/rpc/xmlrpc',
'pagename': '',
}
JIRA_SETTINGS = {
'login': '',
'password': '',
'project': '',
'uri': 'https://host... | # Copy this file as settings.py and fill in parameters
CONFLUENCE_SETTINGS = {
'login': '',
'password': '',
'namespace': '',
'uri': 'https://hostname:port/rpc/xmlrpc',
'pagename': '',
}
JIRA_SETTINGS = {
'login': '',
'password': '',
'project': '',
'uri': 'https://host... | bsd-2-clause | Python |
9bb6828de65a3f007ac00ef0229f6d7d6d948e5c | Update user model schema | Madmous/Trello-Clone,Madmous/madClones,Madmous/madClones,Madmous/madClones,Madmous/madClones,Madmous/Trello-Clone,Madmous/Trello-Clone | server/users-microservice/src/models/userModel.py | server/users-microservice/src/models/userModel.py | from bcrypt import hashpw, checkpw, gensalt
from models.index import db
class UserModel(db.Model):
__tablename__ = 'User'
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.String(80), unique=True, nullable=False)
fullname = db.Column(db.String(80), unique=True, nullable=... | from bcrypt import hashpw, checkpw, gensalt
from models.index import db
class UserModel(db.Model):
__tablename__ = 'User'
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.String(80), unique=True, nullable=False)
fullname = db.Column(db.String(80), unique=True, nullable=... | mit | Python |
df690e4c2f19e30c619db90b8b2dfd77dab54159 | Remove glob imports from sympy.printing. | Designist/sympy,emon10005/sympy,farhaanbukhsh/sympy,mafiya69/sympy,kaushik94/sympy,atreyv/sympy,kmacinnis/sympy,Mitchkoens/sympy,aktech/sympy,sunny94/temp,grevutiu-gabriel/sympy,wanglongqi/sympy,AunShiLord/sympy,jamesblunt/sympy,emon10005/sympy,shikil/sympy,rahuldan/sympy,diofant/diofant,yashsharan/sympy,kmacinnis/symp... | sympy/printing/__init__.py | sympy/printing/__init__.py | """Printing subsystem"""
from pretty import pager_print, pretty, pretty_print, pprint, \
pprint_use_unicode, pprint_try_use_unicode
from latex import latex, print_latex
from mathml import mathml, print_mathml
from python import python, print_python
from ccode import ccode, print_ccode
from fcode import fcode, prin... | """Printing subsystem"""
from pretty import *
from latex import latex, print_latex
from mathml import mathml, print_mathml
from python import python, print_python
from ccode import ccode, print_ccode
from fcode import fcode, print_fcode
from jscode import jscode, print_jscode
from gtk import *
from preview import prev... | bsd-3-clause | Python |
4ba6a1fbab57313ae1ce86fed759c138cfc88efa | Bump development version | yakky/django-cms,rscnt/django-cms,webu/django-cms,jeffreylu9/django-cms,FinalAngel/django-cms,SachaMPS/django-cms,nimbis/django-cms,datakortet/django-cms,rryan/django-cms,frnhr/django-cms,DylannCordel/django-cms,leture/django-cms,josjevv/django-cms,Jaccorot/django-cms,leture/django-cms,qnub/django-cms,Livefyre/django-c... | cms/__init__.py | cms/__init__.py | # -*- coding: utf-8 -*-
__version__ = '3.1.0rc1'
default_app_config = 'cms.apps.CMSConfig'
| # -*- coding: utf-8 -*-
__version__ = '3.1.0.b1'
default_app_config = 'cms.apps.CMSConfig'
| bsd-3-clause | Python |
c0dac1383d8ea4847f08a06f997bbf80f1cafca1 | Fix retrieval of model under viewsets without a statically defined queryset | Alphalink/netbox,Alphalink/netbox,snazy2000/netbox,digitalocean/netbox,Alphalink/netbox,lampwins/netbox,lampwins/netbox,lampwins/netbox,snazy2000/netbox,digitalocean/netbox,Alphalink/netbox,lampwins/netbox,snazy2000/netbox,digitalocean/netbox,digitalocean/netbox,snazy2000/netbox | netbox/utilities/api.py | netbox/utilities/api.py | from rest_framework.exceptions import APIException
from rest_framework.serializers import ModelSerializer
WRITE_OPERATIONS = ['create', 'update', 'partial_update', 'delete']
class ServiceUnavailable(APIException):
status_code = 503
default_detail = "Service temporarily unavailable, please try again later."
... | from rest_framework.exceptions import APIException
from rest_framework.serializers import ModelSerializer
WRITE_OPERATIONS = ['create', 'update', 'partial_update', 'delete']
class ServiceUnavailable(APIException):
status_code = 503
default_detail = "Service temporarily unavailable, please try again later."
... | apache-2.0 | Python |
0c9649dbc60e53120636982dae834a5d4e89e286 | Add constants and helper functions. | aclogreco/InventGamesWP | ch20/dodger.py | ch20/dodger.py | # dodger.py
# Dodger
# A simple graphical game where the
# player must dosge the bad guys.
"""
The Dodger game has the player control
a small person (which we call the
player’s character) who must dodge
a whole bunch of baddies that fall
from the top of the screen. The
longer the player can keep dodging
the baddies... | # dodger.py
# Dodger
# A simple graphical game where the
# player must dosge the bad guys.
"""
The Dodger game has the player control
a small person (which we call the
player’s character) who must dodge
a whole bunch of baddies that fall
from the top of the screen. The
longer the player can keep dodging
the baddies... | bsd-2-clause | Python |
ab889e99e78b16cacc2f1fbb86494b8a784c154a | Fix use of unicode() incompatible with Python 3 | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/plugins/image/admin.py | icekit/plugins/image/admin.py | from django.contrib import admin
from icekit.utils.admin.mixins import ThumbnailAdminMixin
from . import models
class ImageAdmin(ThumbnailAdminMixin, admin.ModelAdmin):
list_display = ['description', 'title', 'thumbnail']
list_display_links = ['description', 'thumbnail']
filter_horizontal = ['categories... | from django.contrib import admin
from icekit.utils.admin.mixins import ThumbnailAdminMixin
from . import models
class ImageAdmin(ThumbnailAdminMixin, admin.ModelAdmin):
list_display = ['description', 'title', 'thumbnail']
list_display_links = ['description', 'thumbnail']
filter_horizontal = ['categories... | mit | Python |
22814eb263c78f5d6bb25d0dba9f0dec69847ff9 | use forbid_events | Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,community-ssu/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,community-ssu/telepathy-gabble,jku/telepathy-gabble,jku/telepathy-gabble,community-ssu/telepathy-gabble,community-s... | tests/twisted/vcard/test-avatar-retrieved.py | tests/twisted/vcard/test-avatar-retrieved.py |
"""
Test that gabble emits only one AvatarRetrieved for multiple queued
RequestAvatar calls for the same contact.
"""
import base64
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq, make_result_iq
def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many... |
"""
Test that gabble emits only one AvatarRetrieved for multiple queued
RequestAvatar calls for the same contact.
"""
import base64
from servicetest import EventPattern
from gabbletest import exec_test, acknowledge_iq, make_result_iq
def test(q, bus, conn, stream):
conn.Connect()
_, iq_event = q.expect_many... | lgpl-2.1 | Python |
dcb23f3ec70d415186af693924bf352d606944a8 | Add report and visit count to metrics | der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles,der-michik/c3bottles | c3bottles/lib/metrics.py | c3bottles/lib/metrics.py | from prometheus_client import Counter, Histogram, start_http_server, Gauge
from time import time
from flask import request
from . import stats_obj
drop_point_count = Gauge(
"c3bottles_drop_point_count", "c3bottles total nmumber of drop points"
)
drop_point_count.set_function(lambda: stats_obj.drop_point_count)... | from prometheus_client import Counter, Histogram, start_http_server, Gauge
from time import time
from flask import request
from . import stats_obj
drop_point_count = Gauge(
"c3bottles_drop_point_count", "c3bottles dropoints"
)
drop_point_count.set_function(lambda: stats_obj.drop_point_count)
request_latency ... | mit | Python |
3d22271487ee839377e5310a09c737c9786212a4 | Improve python unit test for threshold image filter field. Issue 3662. | OpenCMISS/zinc,hsorby/zinc,hsorby/zinc,OpenCMISS/zinc,hsorby/zinc,hsorby/zinc,OpenCMISS/zinc,OpenCMISS/zinc | python/imageprocessing_tests/imagefilterthresholdtests.py | python/imageprocessing_tests/imagefilterthresholdtests.py | '''
Created on October 11, 2013
@author: Alan Wu
'''
import unittest
from opencmiss.zinc.context import Context
from opencmiss.zinc import status
class ImagefilterThresholdTestsCase(unittest.TestCase):
def setUp(self):
self.context = Context("ImagefilterThresholdTest")
root_region = self.context... | '''
Created on October 11, 2013
@author: Alan Wu
'''
import unittest
from opencmiss.zinc.context import Context
from opencmiss.zinc import status
class ImagefilterThresholdTestsCase(unittest.TestCase):
def setUp(self):
self.context = Context("ImagefilterThresholdTest")
root_region = self.context... | mpl-2.0 | Python |
4b679a686e7383f9e43bcc6e4a0147a2ab01a9f4 | Handle verbose_name as a keyword arg on SKUField. Closes #198 #200 | syaiful6/cartridge,dsanders11/cartridge,dsanders11/cartridge,wbtuomela/cartridge,Parisson/cartridge,jaywink/cartridge-reservable,Kniyl/cartridge,traxxas/cartridge,ryneeverett/cartridge,stephenmcd/cartridge,Kniyl/cartridge,wbtuomela/cartridge,stephenmcd/cartridge,wyzex/cartridge,stephenmcd/cartridge,syaiful6/cartridge,w... | cartridge/shop/fields.py | cartridge/shop/fields.py | """
Various model fields that mostly provide default field sizes to ensure
these are consistant when used across multiple models.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from future.builtins import super
from locale import localeconv
from django.db.models import CharField, D... | """
Various model fields that mostly provide default field sizes to ensure
these are consistant when used across multiple models.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from future.builtins import super
from locale import localeconv
from django.db.models import CharField, D... | bsd-2-clause | Python |
c8127da3bac2b602964b0676c04cc8adb4fbec2e | Update f5_ltm_ssh.py | jinesh-patel/netmiko,rdezavalia/netmiko,shamanu4/netmiko,rumo/netmiko,ktbyers/netmiko,isponline/netmiko,mzbenami/netmiko,brutus333/netmiko,ivandgreat/netmiko,MikeOfNoTrades/netmiko,nitzmahone/netmiko,mzbenami/netmiko,nitzmahone/netmiko,MikeOfNoTrades/netmiko,brutus333/netmiko,rdezavalia/netmiko,ktbyers/netmiko,enzzzy/n... | netmiko/f5/f5_ltm_ssh.py | netmiko/f5/f5_ltm_ssh.py | from netmiko.ssh_connection import SSHConnection
from netmiko.netmiko_globals import MAX_BUFFER
import time
import re
class F5LtmSSH(SSHConnection):
def __init__(self, ip, username, password, secret='', port=22, device_type='', verbose=True):
self.ip = ip
self.port = port
self.username =... | from netmiko.ssh_connection import SSHConnection
from netmiko.netmiko_globals import MAX_BUFFER
import time
import re
class F5LtmSSH(SSHConnection):
def __init__(self, ip, username, password, secret='', port=22, device_type='', verbose=True):
self.ip = ip
self.port = port
self.username =... | mit | Python |
bd22f8b4f9fdc89750d2e1d01f6c08e818cc8ce5 | monitor python for clients in ps.py | couchbase/cbagent | cbagent/collectors/ps.py | cbagent/collectors/ps.py | from cbagent.collectors.libstats.psstats import PSStats
from cbagent.collectors import Collector
class PS(Collector):
COLLECTOR = "atop" # Legacy
KNOWN_PROCESSES = ("beam.smp", "memcached", "indexer", "projector",
"cbq-engine", "sync_gateway")
def __init__(self, settings):
... | from cbagent.collectors.libstats.psstats import PSStats
from cbagent.collectors import Collector
class PS(Collector):
COLLECTOR = "atop" # Legacy
KNOWN_PROCESSES = ("beam.smp", "memcached", "indexer", "projector",
"cbq-engine", "sync_gateway")
def __init__(self, settings):
... | apache-2.0 | Python |
1eced8ccac121273ceac8e5f630ee4a9bb45022a | update tests and add some new for index and song views | Ilias95/guitarchords,Ilias95/guitarchords,Ilias95/guitarchords,Ilias95/guitarchords | chords/tests.py | chords/tests.py | from django.test import TestCase
from django.core.urlresolvers import reverse
from .models import Artist, Song
def dummy_artist(name='Some Artist'):
artist = Artist(name=name)
artist.save()
return artist
def dummy_song(title='Random Song'):
song = Song(title=title, artist=dummy_artist())
song.sa... | from django.test import TestCase
from .models import Artist, Song
class SongModelTests(TestCase):
def test_slug_line_creation(self):
"""
make sure that when we add a song an appropriate slug line is created
i.e. "Random Song" -> "random-song"
"""
artist = Artist(name='Some... | mit | Python |
588add1db74b0f18f6bbd1ed81ea58872285ddd2 | Update test code | chengdujin/newsman,chengdujin/newsman,chengdujin/newsman | newsman/test/test_rss.py | newsman/test/test_rss.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from spider import scraper
#entries = scraper.update(feed_id='5257d25509d1f72ff1aa8abc', feed_link='http://hilight.kapook.com/main/feed', language='th')
#entries = scraper.update(feed_id='5257d25... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from spider import scraper
#entries = scraper.update(feed_link='http://news.yahoo.com/rss/world', feed_id='520b7da3680ccf3c10e93d55', language='en')
entries = scraper.update(feed_id='5296e329f5d7... | agpl-3.0 | Python |
014c73cc54e6cfa3aa0e65625c927bf2fbf715e9 | revert changes to float_cmp | michaellaier/pymor,michaellaier/pymor,michaellaier/pymor,michaellaier/pymor | src/pymor/tools/floatcmp.py | src/pymor/tools/floatcmp.py | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
import numpy as np
from pymor import defaults
... | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
import numpy as np
from pymor import defaults
... | bsd-2-clause | Python |
50b534e52a91fa5bb37f8a92d11f5501cfb7bfc8 | Add InstitutionViewSet.perform_create | watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator | bliski_publikator/institutions/viewsets.py | bliski_publikator/institutions/viewsets.py | import django_filters
from rest_framework import filters, viewsets
from .models import Institution
from .serializers import InstitutionSerializer
class InstitutionFilter(filters.FilterSet):
region = django_filters.CharFilter()
class Meta:
model = Institution
fields = ['user', 'krs', 'regon']... | import django_filters
from rest_framework import filters, viewsets
from .models import Institution
from .serializers import InstitutionSerializer
class InstitutionFilter(filters.FilterSet):
region = django_filters.CharFilter()
class Meta:
model = Institution
fields = ['user', 'krs', 'regon']... | mit | Python |
5d01c58aef7f101531ecc7a44a83d225fa2fdcc8 | Add docstring to linters package | aurule/npc,aurule/npc | npc/linters/__init__.py | npc/linters/__init__.py | """
Linters for verifying the correctness of certain character types
The `commands.lint` function can lint all basic files, but special character
types sometimes need extra checks. The linters in this package encapsulate that
logic.
All linter packages have a single main entry point `lint` which accepts a
character i... | from . import changeling
| mit | Python |
f142311b94b711135f651c99e71ae656f6b16db3 | Add a basic __json_data__() to model base class | TangledWeb/tangled.site | tangled/site/model/base.py | tangled/site/model/base.py | from datetime import datetime
from sqlalchemy.schema import Column
from sqlalchemy.types import DateTime, Integer
from sqlalchemy.ext.declarative import declarative_base, declared_attr
Base = declarative_base()
class BaseMixin:
id = Column(Integer, primary_key=True)
@declared_attr
def __tablename__(... | from datetime import datetime
from sqlalchemy.schema import Column
from sqlalchemy.types import DateTime, Integer
from sqlalchemy.ext.declarative import declarative_base, declared_attr
Base = declarative_base()
class BaseMixin:
id = Column(Integer, primary_key=True)
@declared_attr
def __tablename__(... | mit | Python |
b898f8238d073aa3442817a6fc1b5d02e6a9cc4c | update timezone_format custom filter to display None if exception | greglinch/sourcelist,greglinch/sourcelist | sources/templatetags/sources_extras.py | sources/templatetags/sources_extras.py | from django import template
register = template.Library()
@register.filter
def timezone_format(value):
""" Check the value of the timezeone offset and, if postive, add a plus sign"""
try:
if int(value) > 0:
value = '+' + str(value)
except:
value = None
return value | from django import template
register = template.Library()
@register.filter
def timezone_format(value):
""" Check the value of the timezeone offset and, if postive, add a plus sign"""
try:
if int(value) > 0:
value = '+' + str(value)
except:
pass
return value | mit | Python |
49186b34a1ebb03783e1bfb195ebe032f3676e96 | Mark lemmatizer tests as models since they use installed data | aikramer2/spaCy,oroszgy/spaCy.hu,banglakit/spaCy,honnibal/spaCy,banglakit/spaCy,raphael0202/spaCy,explosion/spaCy,aikramer2/spaCy,spacy-io/spaCy,banglakit/spaCy,Gregory-Howard/spaCy,explosion/spaCy,explosion/spaCy,banglakit/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,recognai/spaCy,oroszgy/spaCy.... | spacy/tests/tagger/test_lemmatizer.py | spacy/tests/tagger/test_lemmatizer.py | # coding: utf-8
from __future__ import unicode_literals
from ...lemmatizer import read_index, read_exc
import pytest
@pytest.mark.models
@pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]),
("aardwolf", ["aardwolf"]),
... | # coding: utf-8
from __future__ import unicode_literals
from ...lemmatizer import read_index, read_exc
import pytest
@pytest.mark.parametrize('text,lemmas', [("aardwolves", ["aardwolf"]),
("aardwolf", ["aardwolf"]),
("planets", ["plan... | mit | Python |
5b120a8e97c42a1e7fced7ea9cb5f28320cd3679 | Add limit parameter | c2corg/v6_api,c2corg/v6_api,c2corg/v6_api | c2corg_api/views/search.py | c2corg_api/views/search.py | from cornice.resource import resource, view
from c2corg_api.views.validation import validate_pagination
from c2corg_api.models.route import Route, ROUTE_TYPE, schema_route
from c2corg_api.views import cors_policy
from c2corg_api.search import search
from c2corg_api.models.waypoint import Waypoint, WAYPOINT_TYPE, schem... | from cornice.resource import resource, view
from c2corg_api.models.route import Route, ROUTE_TYPE, schema_route
from c2corg_api.views import cors_policy
from c2corg_api.search import search
from c2corg_api.models.waypoint import Waypoint, WAYPOINT_TYPE, schema_waypoint
from c2corg_api.views.route import listing_schema... | agpl-3.0 | Python |
ad33a7d5e169ca124d2f2327e33a3de4e8a5ae7d | include dframe_currencystrip() | BMJHayward/infusionsoft_xpmt | src/pandaserv.py | src/pandaserv.py | import pandas as pd
import os
from dataserv import RAW_DATA_FILE
encodings = {
'iso' : 'ISO-8859-1',
'utf' : 'utf-8',
'win' : 'cp1252',
}
raw_data = os.listdir( RAW_DATA_FILE )
data_sheets = []
try:
data_sheets = [pd.read_csv(datafile) for datafile in raw_data]
exc... | import pandas as pd
import os
from dataserv import RAW_DATA_FILE
encodings = {
'iso' : 'ISO-8859-1',
'utf' : 'utf-8',
'win' : 'cp1252',
}
raw_data = os.listdir( RAW_DATA_FILE )
data_sheets = []
try:
data_sheets = [pd.read_csv(datafile) for datafile in raw_data]
exc... | mit | Python |
67e02b60f0553be33fada302e6463948091f6597 | tag for v0.7 | rovanleeuwen/informant-old,pandemicsyn/swift-informant,rackerlabs/swift-informant,ahale/swift-informant | informant/__init__.py | informant/__init__.py | import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 7)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('informant')
| import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 6)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('informant')
| apache-2.0 | Python |
9a9f99f492c398c4c6b4bd7d05b774bab5707c09 | Include a link to Python's formatting documentation | pklaus/bottlelog | bottlelog/__init__.py | bottlelog/__init__.py | # -*- coding: utf-8 -*-
"""
This is a plugin for Bottle web applications.
When you install it to an application, it will
log all requests to your site. It's even imitating
Apache's combined log format to allow you to use
any of the many tools for Apache log file analysis.
Homepage: https://github.com/pklaus/bottlelog... | # -*- coding: utf-8 -*-
"""
This is a plugin for Bottle web applications.
When you install it to an application, it will
log all requests to your site. It's even imitating
Apache's combined log format to allow you to use
any of the many tools for Apache log file analysis.
Homepage: https://github.com/pklaus/bottlelog... | bsd-3-clause | Python |
6cf06baacb3cb4e2cfe18ae85557243ea4184768 | Add registration URLs | supermitch/simple-author | author/urls.py | author/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'author.views.home', name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^books/', include('books.urls')),
url(r'^accounts/', include('registration.bac... | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'author.views.home', name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^books/', include('books.urls')),
)
| mit | Python |
9ffc996bbb269787aad451d105eb6b44773a9d2d | upgrade to 0.6.13 | wjo1212/aliyun-log-python-sdk | aliyun/log/version.py | aliyun/log/version.py | __version__ = '0.6.13'
USER_AGENT = 'log-python-sdk-v-' + __version__
API_VERSION = '0.6.0'
| __version__ = '0.6.12'
USER_AGENT = 'log-python-sdk-v-' + __version__
API_VERSION = '0.6.0'
| mit | Python |
1080b7f8f73fdcdbd3e00171402dade52dd9a3f3 | update logic for encrypted volumes | chilcote/unearth,chilcote/unearth | artifacts/drive_medium.py | artifacts/drive_medium.py | import subprocess
import plistlib
factoid = "drive_medium"
def fact():
'''
Returns the medium type for the boot drive of this Mac
Values include 'fusion', 'rotational', 'ssd' or 'None'
'''
result = 'None'
try:
# Check for Fusion drive
proc = subprocess.Popen(['/usr/sbin/diskut... | import subprocess
import plistlib
factoid = "drive_medium"
def fact():
'''
Returns the medium type for the boot drive of this Mac
Values include 'fusion', 'rotational', 'ssd' or 'None'
'''
result = 'None'
try:
# Check for Fusion drive
proc = subprocess.Popen(['/usr/sbin/diskut... | apache-2.0 | Python |
3983cd88a1c5030de797f06ae01a0978a41dfef6 | Fix indirect loads in java_classpath.bzl | bazelbuild/intellij,bazelbuild/intellij,bazelbuild/intellij,bazelbuild/intellij,bazelbuild/intellij,bazelbuild/intellij,bazelbuild/intellij | aspect/java_classpath.bzl | aspect/java_classpath.bzl | """An aspect which extracts the runtime classpath from a java target."""
load(
":artifacts.bzl",
"artifact_location",
)
def _runtime_classpath_impl(target, ctx):
"""The top level aspect implementation function.
Args:
target: Essentially a struct representing a BUILD target.
ctx: The cont... | """An aspect which extracts the runtime classpath from a java target."""
load(
":intellij_info_impl.bzl",
"artifact_location",
)
def _runtime_classpath_impl(target, ctx):
"""The top level aspect implementation function.
Args:
target: Essentially a struct representing a BUILD target.
ctx:... | apache-2.0 | Python |
0228128b2878c4d5f6942e751b48c8e52192245b | Use sort_keys=True for the ConsoleWritter pretty printing | scrapinghub/exporters | exporters/writers/console_writer.py | exporters/writers/console_writer.py | import json
from exporters.writers.base_writer import BaseWriter, ItemsLimitReached
class ConsoleWriter(BaseWriter):
"""
It is just a writer with testing purposes. It prints every item in console.
"""
def __init__(self, options):
super(ConsoleWriter, self).__init__(options)
self.logg... | import json
from exporters.writers.base_writer import BaseWriter, ItemsLimitReached
class ConsoleWriter(BaseWriter):
"""
It is just a writer with testing purposes. It prints every item in console.
"""
def __init__(self, options):
super(ConsoleWriter, self).__init__(options)
self.logg... | bsd-3-clause | Python |
42389e796acba99fe12e30e6ca08672b889bd5f2 | Make fields readonly, skips rest_framework, validation, speeds up queries | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data | infrastructure/serializers.py | infrastructure/serializers.py | from rest_framework import serializers
from . import models
from scorecard.serializers import GeographySerializer
class FinancialYearSerializer(serializers.ModelSerializer):
class Meta:
model = models.FinancialYear
fields = ["budget_year"]
read_only_fields = ["budget_year"]
class Budget... | from rest_framework import serializers
from . import models
from scorecard.serializers import GeographySerializer
class FinancialYearSerializer(serializers.ModelSerializer):
class Meta:
model = models.FinancialYear
fields = ["budget_year"]
class BudgetPhaseSerializer(serializers.ModelSerializer... | mit | Python |
8a95808117fa7cc5f6c0f9bee0852d15e6c75c60 | Add missing MIME types | alephdata/ingestors | ingestors/documents/office.py | ingestors/documents/office.py | from ingestors.base import Ingestor
from ingestors.support.soffice import LibreOfficeSupport
class DocumentIngestor(Ingestor, LibreOfficeSupport):
"""Office/Word document ingestor class.
Converts the document to PDF and extracts the text.
Mostly a slightly adjusted PDF ingestor.
Requires system tool... | from ingestors.base import Ingestor
from ingestors.support.soffice import LibreOfficeSupport
class DocumentIngestor(Ingestor, LibreOfficeSupport):
"""Office/Word document ingestor class.
Converts the document to PDF and extracts the text.
Mostly a slightly adjusted PDF ingestor.
Requires system tool... | mit | Python |
2fc3746924af46ed9f8b2114d9aa7336b5d2074a | reformat choices | geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx | osmaxx/excerptexport/models/excerpt.py | osmaxx/excerptexport/models/excerpt.py | from django.contrib.auth.models import User
from django.contrib.gis.db import models
from django.utils.translation import gettext_lazy as _
class Excerpt(models.Model):
EXCERPT_TYPE_USER_DEFINED = 'user-defined'
EXCERPT_TYPE_COUNTRY_BOUNDARY = 'country'
EXCERPT_TYPES = [
(EXCERPT_TYPE_USER_DEFINED... | from django.contrib.auth.models import User
from django.contrib.gis.db import models
from django.utils.translation import gettext_lazy as _
class Excerpt(models.Model):
EXCERPT_TYPE_USER_DEFINED = 'user-defined'
EXCERPT_TYPE_COUNTRY_BOUNDARY = 'country'
EXCERPT_TYPES = [
(
EXCERPT_TYPE... | mit | Python |
d25e259039cfd74fbbdfdce628ab430c1d5c63eb | remove extra space in dud backend output | jeroenh/OpenNSA,jab1982/opennsa,jab1982/opennsa,NORDUnet/opennsa,NORDUnet/opennsa,jeroenh/OpenNSA,NORDUnet/opennsa,jeroenh/OpenNSA | opennsa/backends/dud.py | opennsa/backends/dud.py | """
NRM backends which just logs actions performed.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011)
"""
import uuid
from twisted.python import log
from twisted.internet import defer
from zope.interface import implements
from opennsa import interface as nsainterface
from opennsa import err... | """
NRM backends which just logs actions performed.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011)
"""
import uuid
from twisted.python import log
from twisted.internet import defer
from zope.interface import implements
from opennsa import interface as nsainterface
from opennsa import err... | bsd-3-clause | Python |
53e961870da3aeebf62b39605dc2aab74639c0c7 | Add test for internode_compression: 'none' | blerer/cassandra-dtest,carlyeks/cassandra-dtest,bdeggleston/cassandra-dtest,stef1927/cassandra-dtest,blerer/cassandra-dtest,riptano/cassandra-dtest,snazy/cassandra-dtest,stef1927/cassandra-dtest,beobal/cassandra-dtest,thobbs/cassandra-dtest,pauloricardomg/cassandra-dtest,spodkowinski/cassandra-dtest,krummas/cassandra-d... | internode_ssl_test.py | internode_ssl_test.py | from dtest import Tester, debug
from tools import generate_ssl_stores, putget
class TestInternodeSSL(Tester):
def __init__(self, *args, **kwargs):
Tester.__init__(self, *args, **kwargs)
def putget_with_internode_ssl_test(self):
"""
Simple putget test with internode ssl enabled
... | from dtest import Tester, debug
from tools import generate_ssl_stores, putget
class TestInternodeSSL(Tester):
def __init__(self, *args, **kwargs):
Tester.__init__(self, *args, **kwargs)
def putget_with_internode_ssl_test(self):
"""
Simple putget test with internode ssl enabled
... | apache-2.0 | Python |
16c53c13394e9f69d8ce31c039906ed59397d309 | Add tests | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/members/tests/test_unit.py | bluebottle/members/tests/test_unit.py | from datetime import timedelta
from django.contrib.auth.password_validation import get_default_password_validators
from django.utils.timezone import now
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.test.factory_models.accounts import BlueBottleUserFacto... | from django.contrib.auth.password_validation import get_default_password_validators
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.test.utils import BluebottleTestCase
from bluebottle.test.utils import override_properties
class TestMonkeyPatchPasswordVal... | bsd-3-clause | Python |
7b7945c97361e3711279b36c6eaf3afec88c66b2 | Allow multiple values for ALLOWED_HOSTS (#398) | ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas | make_a_plea/settings/docker.py | make_a_plea/settings/docker.py | from .base import *
import os
DEBUG = os.environ.get("DJANGO_DEBUG", "") == "True"
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ.get('POSTGRES_DB', ''),
'USER': os.environ.get('DB_USERNAME', ''),
'PASSWORD'... | from .base import *
import os
DEBUG = os.environ.get("DJANGO_DEBUG", "") == "True"
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ.get('POSTGRES_DB', ''),
'USER': os.environ.get('DB_USERNAME', ''),
'PASSWORD'... | mit | Python |
ef28dbb7a5ad0c9e6fe99b6f750f3a7511cab7ee | upgrade version | timchen86/gdcmdtools,tienfuc/gdcmdtools,commonssibi/gdcmdtools | gdcmdtools/base.py | gdcmdtools/base.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client.tools import run
from apiclient.discovery import build
import httplib2
import pprint
import logging
logging.basicConfig()
logger = logging.getLogger... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client.tools import run
from apiclient.discovery import build
import httplib2
import pprint
import logging
logging.basicConfig()
logger = logging.getLogger... | bsd-2-clause | Python |
0f12f4a2e8b68cf48b9768a6b18a1a560068eac2 | Change meal name to charfield | teamtaverna/core | app/timetables/models.py | app/timetables/models.py | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | from __future__ import unicode_literals
from django.db import models
class Weekday(models.Model):
"""Model representing the day of the week."""
name = models.CharField(max_length=60, unique=True)
def clean(self):
"""
Capitalize the first letter of the first word to avoid case
in... | mit | Python |
ead78c44dbf3d180ba4ea99a6e107539166025f2 | Add typing to java. It's not right yet though :) | hatchery/Genepool2,hatchery/genepool | genes/java/main.py | genes/java/main.py | from typing import Callable, Dict
from genes.apt import commands as apt
from genes.brew import commands as brew
from genes.debconf import commands as debconf
from genes.debian.traits import is_debian
from genes.mac.traits import is_osx
from genes.ubuntu.traits import is_ubuntu
def main(config: Callable[[], Dict]):
... | from genes.apt import commands as apt
from genes.brew import commands as brew
from genes.debconf import commands as debconf
from genes.debian.traits import is_debian
from genes.mac.traits import is_osx
from genes.ubuntu.traits import is_ubuntu
def main(config):
if is_debian() or is_ubuntu():
if config.is_... | mit | Python |
4abc044183bc3c9eb3ae539aaf6a8317f520a4df | Add test | arijitkar98/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-rithms,EUNIX-TRIX/al-go-rithms,Deepak345/al-go-rithms,Cnidarias/al-go-rithms,Deepak345/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,Cnidarias/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,arijitkar98/al-go-rithms,manikT... | caesar_cipher/python/caesar_cipher.py | caesar_cipher/python/caesar_cipher.py | import string
def caesar_cipher(plaintext, shift):
# get all alphabets
alphabets = string.ascii_lowercase
shift_alphabets = alphabets[shift:] + alphabets[:shift]
table = string.maketrans(alphabets, shift_alphabets)
cipher_text = plaintext.translate(table)
return cipher_text
def test():
c... | import string
def caesar_cipher(plaintext, shift):
# get all alphabets
alphabets = string.ascii_lowercase
shift_alphabets = alphabets[shift:] + alphabets[:shift]
table = string.maketrans(alphabets, shift_alphabets)
cipher_text = plaintext.translate(table)
return cipher_text
if __name__ == "_... | cc0-1.0 | Python |
d39d561e44981ec531bbdd325a99cb7d8db60bcb | Update version.py | christiancarballo/bha | bha/version.py | bha/version.py | from __future__ import absolute_import, division, print_function
from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 1
_version_micro = '' # use '' for first of series, number for 1 and above
_version_extra = 'dev'
# _versi... | from __future__ import absolute_import, division, print_function
from os.path import join as pjoin
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
_version_major = 0
_version_minor = 1
_version_micro = '' # use '' for first of series, number for 1 and above
_version_extra = 'dev'
# _versi... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.