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 |
|---|---|---|---|---|---|---|---|---|
07f5e6445055353c097d4b5fd39524634e33168a | fix unicode issue with team address | synth3tk/the-blue-alliance,verycumbersome/the-blue-alliance,bvisness/the-blue-alliance,jaredhasenklein/the-blue-alliance,synth3tk/the-blue-alliance,phil-lopreiato/the-blue-alliance,phil-lopreiato/the-blue-alliance,the-blue-alliance/the-blue-alliance,josephbisch/the-blue-alliance,synth3tk/the-blue-alliance,bdaroz/the-bl... | datafeeds/parsers/fms_api/fms_api_team_details_parser.py | datafeeds/parsers/fms_api/fms_api_team_details_parser.py | import datetime
import json
import logging
from google.appengine.ext import ndb
from consts.district_type import DistrictType
from models.district_team import DistrictTeam
from models.team import Team
from models.robot import Robot
class FMSAPITeamDetailsParser(object):
def __init__(self, year, team_key):
... | import datetime
import json
import logging
from google.appengine.ext import ndb
from consts.district_type import DistrictType
from models.district_team import DistrictTeam
from models.team import Team
from models.robot import Robot
class FMSAPITeamDetailsParser(object):
def __init__(self, year, team_key):
... | mit | Python |
78bf394a9c8eceb0727d72d4755975f2bd526559 | Add docstring for Movement class | Skolopedrion/Theria | src/movement.py | src/movement.py | #!/usr/bin/env python3
# coding: utf-8
from sfml import sf
from .types import *
class Movement:
"""
Linear interpolation movement between two given positions.
"""
def __init__(self, vec, duration=sf.Time.ZERO):
if duration == sf.Time.ZERO:
self.speed = Vec(*vec)
self.duration = sf.Time()
self.durati... | #!/usr/bin/env python3
# coding: utf-8
from sfml import sf
from .types import *
class Movement:
def __init__(self, vec, duration=sf.Time.ZERO):
if duration == sf.Time.ZERO:
self.speed = Vec(*vec)
self.duration = sf.Time()
self.duration.microseconds = 1
else:
self.speed = Vec(*vec) / duration.second... | mit | Python |
2e1e86d979a358badab7e5e60463eda4af0699c7 | Use the name parameter of iverilog_compile to silence the buildifier warning. | hdl/bazel_rules_hdl,hdl/bazel_rules_hdl,hdl/bazel_rules_hdl,hdl/bazel_rules_hdl | dependency_support/com_icarus_iverilog/build-plugins.bzl | dependency_support/com_icarus_iverilog/build-plugins.bzl | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
f0929006965514982603fe58ebc3211acf021cce | Change mcf to use smred inputs so it doesn't take two days to run in o3. | KuroeKurose/gem5,KuroeKurose/gem5,cancro7/gem5,yb-kim/gemV,joerocklin/gem5,gedare/gem5,Weil0ng/gem5,kaiyuanl/gem5,yb-kim/gemV,gedare/gem5,qizenguf/MLC-STT,HwisooSo/gemV-update,samueldotj/TeeRISC-Simulator,sobercoder/gem5,rjschof/gem5,gem5/gem5,TUD-OS/gem5-dtu,briancoutinho0905/2dsampling,samueldotj/TeeRISC-Simulator,qi... | tests/long/10.mcf/test.py | tests/long/10.mcf/test.py | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | bsd-3-clause | Python |
bcc12c8bf97b8c74ea1541330544ab73a069b2f6 | Make sure no new document is generated if a already processed link is processed again | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | newsApp/linkProcessor.py | newsApp/linkProcessor.py | import json
import logging
import random
import urllib
from constants import *
from doc import Doc
from docManager import DocManager
from link import Link
from linkManager import LinkManager
import htmlProcessor as hp
from publisher import Publisher
from publisherManager import PublisherManager
logger = logging.getLo... | import json
import logging
import random
import urllib
from constants import *
from doc import Doc
from docManager import DocManager
from link import Link
from linkManager import LinkManager
import htmlProcessor as hp
from publisher import Publisher
from publisherManager import PublisherManager
logger = logging.getLo... | mit | Python |
19a3b57834ac3966a3edd7577447b434de8e31f7 | fix python script | PlazaRoute/PlazaRoute-doc,PlazaRoute/PlazaRoute-doc | build/upload-to-jira.py | build/upload-to-jira.py | #!/bin/python
import requests
import re
import os
import sys
base_url = "https://jira.robinsuter.ch"
api_url = "/rest/api/2/issue/{}/attachments"
headers = {"X-Atlassian-Token": "nocheck"}
jira_user = os.environ.get("JIRA_USER")
jira_pw = os.environ.get("JIRA_PW")
jira_prefix = "PZ"
branch = os.environ.get("TRAVIS_BR... | #!/bin/python
import requests
import re
import os
import sys
base_url = "https://jira.robinsuter.ch"
api_url = "/rest/api/2/issue/{}/attachments"
headers = {"X-Atlassian-Token": "nocheck"}
jira_user = os.environ.get("JIRA_USER")
jira_pw = os.environ.get("JIRA_PW")
jira_prefix = "PZ"
branch = os.environ("TRAVIS_BRANCH... | mit | Python |
b7a24dca6b52d8924f59dc0e8ecd8e25cac998a2 | Add options trailing slashes to the Enrollment API. | zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform,zhenzhai/edx-platform | common/djangoapps/enrollment/urls.py | common/djangoapps/enrollment/urls.py | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}/$'.... | """
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import patterns, url
from .views import (
EnrollmentView,
EnrollmentListView,
EnrollmentCourseDetailView
)
urlpatterns = patterns(
'enrollment.views',
url(
r'^enrollment/{username},{course_key}$'.f... | agpl-3.0 | Python |
048105271454c5f22fd91f2ae29c7cb6aa3afba9 | fix games bug | zhoutong/wwag | wwag/views/games.py | wwag/views/games.py | from flask import render_template, request, flash, redirect, url_for, make_response, session, g
from wwag import app, database, forms
from wwag.decorators import player_login_required
from MySQLdb import IntegrityError
@app.route("/games")
def games():
games = database.execute("SELECT * FROM Game ORDER BY StarRating... | from flask import render_template, request, flash, redirect, url_for, make_response, session, g
from wwag import app, database, forms
from wwag.decorators import player_login_required
from MySQLdb import IntegrityError
@app.route("/games")
def games():
games = database.execute("SELECT * FROM Game ORDER BY StarRating... | mit | Python |
7b5e59b6bbd9dd8fc80a9b5b200695aee6f7ea42 | Fix typo in image.setup. | lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,scipy/scipy-svn,lesserwhirls/scipy-cwt,scipy/scipy-svn,scipy/scipy-svn,lesserwhirls/scipy-cwt,scipy/scipy-svn,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor | Lib/sandbox/image/setup.py | Lib/sandbox/image/setup.py | #!/usr/bin/env python
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('image', parent_package, top_path)
config.add_data_files(*"""ciexyz31_1.txt ciexyz64_1.txt ciexyzjv.txt
linss2_10e_1.txt sbrgb2.txt""".split())
... | #!/usr/bin/env python
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('image', parent_package, top_path)
config.add_data_files("""ciexyz31_1.txt ciexyz64_1.txt ciexyzjv.txt
linss2_10e_1.txt sbrgb2.txt""".split())
r... | bsd-3-clause | Python |
623d3e2fed1bea9be1de1bb9555674088efb96c5 | bump to 0.18.1 | dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol,dataversioncontrol/dvc,dataversioncontrol/dvc,efiop/dvc,efiop/dvc | dvc/__init__.py | dvc/__init__.py | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.18.1'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path.... | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.18.0'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path.... | apache-2.0 | Python |
4d265795029898eec8f43aa11fee537b2e44c9a1 | Fix unit test. | alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph | aleph/tests/test_index.py | aleph/tests/test_index.py | from aleph.logic import delete_collection
from aleph.model import Collection
from aleph.tests.util import TestCase
class IndexTestCase(TestCase):
def setUp(self):
super(IndexTestCase, self).setUp()
self.load_fixtures('docs.yaml')
def test_delete_collection(self):
collection = Collect... | from aleph.logic import delete_collection
from aleph.model import Collection
from aleph.tests.util import TestCase
class IndexTestCase(TestCase):
def setUp(self):
super(IndexTestCase, self).setUp()
self.load_fixtures('docs.yaml')
def test_delete_collection(self):
collection = Collect... | mit | Python |
62317424b7e318ac9c59aecc768a4487788bd179 | Mark pixel tests as failing on all platform | lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,lihui7115/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBackend,CapOM/ChromiumGStreamerBackend,ltilve/ChromiumGStreamerBacke... | content/test/gpu/gpu_tests/pixel_expectations.py | content/test/gpu/gpu_tests/pixel_expectations.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class PixelExpectations(GpuTestExpectations):
... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class PixelExpectations(GpuTestExpectations):
... | bsd-3-clause | Python |
b5006a2820051e00c9fe4f5efe43e90129c12b4d | Update Cloudtrail per 2021-09-10 changes | cloudtools/troposphere,cloudtools/troposphere | troposphere/cloudtrail.py | troposphere/cloudtrail.py | from . import AWSObject, AWSProperty, Tags
from .validators import boolean
class DataResource(AWSProperty):
props = {
"Type": (str, True),
"Values": ([str], False),
}
class EventSelector(AWSProperty):
props = {
"DataResources": ([DataResource], False),
"ExcludeManagementE... | from . import AWSObject, AWSProperty, Tags
from .validators import boolean
class DataResource(AWSProperty):
props = {
"Type": (str, True),
"Values": ([str], False),
}
class EventSelector(AWSProperty):
props = {
"DataResources": ([DataResource], False),
"IncludeManagementE... | bsd-2-clause | Python |
fddd44624f1c8ff6f66a2f33cafe908a5853389d | Clean up dynamodb table when deleting an archive | carsonmcdonald/glacier-cmd | glaciercmd/command_delete_archive_from_vault.py | glaciercmd/command_delete_archive_from_vault.py | import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
from boto.dynamodb2.table import Table
from boto.dynamodb2.layer1 import DynamoDBConnection
class CommandDeleteArchiveFromVault(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=confi... | import boto
from boto.glacier.exceptions import UnexpectedHTTPResponseError
class CommandDeleteArchiveFromVault(object):
def execute(self, args, config):
glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_sec... | mit | Python |
053d6a2ca13b1f36a02fa3223092a10af35f6579 | Move reload doc before get query | gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext | erpnext/patches/v10_0/item_barcode_childtable_migrate.py | erpnext/patches/v10_0/item_barcode_childtable_migrate.py | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "item_barcode")
items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') })... | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') })
frappe.reload_doc("stock", "doctype", "item")
frappe... | agpl-3.0 | Python |
08a085a3a4c0daf5698b45e53edbd5e58c9ce98e | Use .get | cosenal/waterbutler,rdhyee/waterbutler,TomBaxter/waterbutler,chrisseto/waterbutler,rafaeldelucena/waterbutler,Ghalko/waterbutler,CenterForOpenScience/waterbutler,felliott/waterbutler,Johnetordoff/waterbutler,RCOSDP/waterbutler,kwierman/waterbutler,hmoco/waterbutler,icereval/waterbutler | waterbutler/providers/googledrive/metadata.py | waterbutler/providers/googledrive/metadata.py | import os
from urllib import parse
from waterbutler.core import metadata
from waterbutler.providers.googledrive import utils
class BaseGoogleDriveMetadata(metadata.BaseMetadata):
def __init__(self, raw, path):
super().__init__(raw)
self._path = path
@property
def provider(self):
... | import os
from urllib import parse
from waterbutler.core import metadata
from waterbutler.providers.googledrive import utils
class BaseGoogleDriveMetadata(metadata.BaseMetadata):
def __init__(self, raw, path):
super().__init__(raw)
self._path = path
@property
def provider(self):
... | apache-2.0 | Python |
dc0a1c3b26a3feaa695e21f7d9124df7ce010c32 | move settings to top of file | fivejjs/crosscat,probcomp/crosscat,probcomp/crosscat,JDReutt/BayesDB,poppingtonic/BayesDB,fivejjs/crosscat,JDReutt/BayesDB,mit-probabilistic-computing-project/crosscat,JDReutt/BayesDB,JDReutt/BayesDB,poppingtonic/BayesDB,mit-probabilistic-computing-project/crosscat,poppingtonic/BayesDB,mit-probabilistic-computing-proje... | analyze_2d/run_sampler.py | analyze_2d/run_sampler.py | import argparse
#
import numpy
import pylab
pylab.ion()
pylab.show()
#
import tabular_predDB.analyze_2d.make_ring as make_ring
import tabular_predDB.analyze_2d.sampler_helpers as sh
import tabular_predDB.cython.State as State
# generative settings
N_datapoints = 1000
gen_seed = 0
gen_noise_scale = 0.1
data_filename =... | import argparse
#
import numpy
import pylab
pylab.ion()
pylab.show()
#
import tabular_predDB.analyze_2d.make_ring as make_ring
import tabular_predDB.analyze_2d.sampler_helpers as sh
import tabular_predDB.cython.State as State
# generate the data
N_datapoints = 1000
gen_seed = 0
gen_noise_scale = 0.1
ring_data = make_... | apache-2.0 | Python |
aaaaabef5decdfc2d7887a53149f2aa205a56aa0 | Make tree children private | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/tree/read_only_tree.py | falcom/tree/read_only_tree.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class Tree:
def __init__ (self, tree = None):
if tree is None:
self.__value = None
self.__children = ()
... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class Tree:
def __init__ (self, tree = None):
if tree is None:
self.__value = None
self.children = ()
... | bsd-3-clause | Python |
16b9f48c2b6548a16e1c34a57c103b325fae381d | Repair bug in the Farmer model | tm-kn/farmers-api | farmers_api/farmers/models.py | farmers_api/farmers/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Farmer(models.Model):
first_name = models.CharField(_('first name'), max_length=50)
surname = models.CharField(_('surname'), max_length=50)
town = models.CharField(_('town'), max_length=50, db_index=True)
class... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Farmer(models.Model):
first_name = models.CharField(_('first name'), max_length=50)
surname = models.CharField(_('surname'), max_length=50)
town = models.CharField(_('town'), max_length=50, db_index=True)
class... | bsd-2-clause | Python |
7599b3d87ccbad35d8eae01ea50af4e64ae7b705 | Fix system auth tests. | wakermahmud/sync-engine,gale320/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,PriviPK/privipk-sync-engine,PriviPK/privipk-sync-engine,jobscore/sync-engine,nylas/sync-engine,jobscore/sync-engine,PriviPK/privipk-sync-engine,EthanBlackburn/sync-engine,gale320/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine... | tests/system/test_auth.py | tests/system/test_auth.py | import pytest
import time
from client import APIClient
from base import create_account
from inbox.models.session import session_scope
from conftest import (TEST_MAX_DURATION_SECS, TEST_GRANULARITY_CHECK_SECS,
passwords)
@pytest.mark.parametrize('email,password', passwords)
def test_password_auth... | import pytest
import time
from client import APIClient
from base import create_account
from inbox.models.session import session_scope
from conftest import (TEST_MAX_DURATION_SECS, TEST_GRANULARITY_CHECK_SECS,
passwords)
@pytest.mark.parametrize('email,password', passwords)
def test_password_auth... | agpl-3.0 | Python |
70f9275d7b87d56ae560a2ff60c3eed3469739af | Fix new lint errors now that we've dropped python 2 support. | edx/ecommerce-api-client,edx/edx-rest-api-client | edx_rest_api_client/tests/mixins.py | edx_rest_api_client/tests/mixins.py | import responses
class AuthenticationTestMixin:
""" Mixin for testing authentication. """
def setUp(self):
super(AuthenticationTestMixin, self).setUp()
responses.reset()
def _mock_auth_api(self, url, status, body=None):
body = body or {}
responses.add(
response... | import responses
class AuthenticationTestMixin(object):
""" Mixin for testing authentication. """
def setUp(self):
super(AuthenticationTestMixin, self).setUp()
responses.reset()
def _mock_auth_api(self, url, status, body=None):
body = body or {}
responses.add(
... | apache-2.0 | Python |
27528ab9b63005d11908b5535182aacb5982b81a | fix timezone | BayesianLogic/blog,BayesianLogic/blog,BayesianLogic/blog,BayesianLogic/blog,BayesianLogic/blog | docs/pelicanconf.py | docs/pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u''
SITENAME = u'BLOG Programming Language'
SITEURL = ''
TIMEZONE = 'America/Los_Angeles'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRAN... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u''
SITENAME = u'BLOG Programming Language'
SITEURL = ''
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION... | bsd-3-clause | Python |
b5e53377eb88e28e6572a48adb5ba8104fb34b0d | Fix issue | harshadyeola/easyengine,EasyEngine/easyengine,harshadyeola/easyengine,rtCamp/easyengine,harshadyeola/easyengine,rtCamp/easyengine,rtCamp/easyengine,EasyEngine/easyengine | ee/core/cron.py | ee/core/cron.py | from crontab import *
from ee.core.shellexec import EEShellExec
from ee.core.logging import Log
"""
Set CRON on LINUX system.
"""
class EECron():
def setcron_daily(self,cmd,comment='Cron set by EasyEngine',user='root',min=0,hour=12):
if not EEShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(... | from crontab import *
from ee.core.shellexec import EEShellExec
from ee.core.logging import Log
"""
Set CRON on LINUX system.
"""
class EECron():
def setcron_daily(self,cmd,comment='Cron set by EasyEngine',user='root',min=0,hour=12):
if not self.check_isexist(self,cmd):
tab = CronTab(user=user... | mit | Python |
02a203263d4a6a00249766d3c11928447e7f0521 | Allow the app to be served at *.herokuapp.com | lm-tools/sectors,lm-tools/situational,lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/sectors,lm-tools/situational,lm-tools/situational,lm-tools/sectors | situational/settings/heroku.py | situational/settings/heroku.py | import os
from .base import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Sym Roe', 'lmtools@talusdesign.co.uk'),
)
MANAGERS = ADMINS
ALLOWED_HOSTS = ['.herokuapp.com']
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django_postgrespool'
STATICF... | import os
from .base import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Sym Roe', 'lmtools@talusdesign.co.uk'),
)
MANAGERS = ADMINS
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django_postgrespool'
STATICFILES_STORAGE = 'whitenoise.django.Gz... | bsd-3-clause | Python |
cf5d1ca542ab9704d9effa4cc4fa75c2d594459b | Add docstrings to RawContent | matthiask/django-content-editor,nickburlett/feincms,joshuajonah/feincms,michaelkuty/feincms,matthiask/feincms2-content,michaelkuty/feincms,mjl/feincms,mjl/feincms,pjdelport/feincms,matthiask/django-content-editor,joshuajonah/feincms,nickburlett/feincms,feincms/feincms,hgrimelid/feincms,matthiask/django-content-editor,h... | feincms/content/raw/models.py | feincms/content/raw/models.py | from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
class RawContent(models.Model):
"""
Content type which can be used to input raw HTML code into the CMS.
The content isn't escaped and can be used to insert CSS or JS
snip... | from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django import forms
class RawContent(models.Model):
text = models.TextField(_('content'), blank=True)
class Meta:
abstract = True
verbose_name = _('raw conte... | bsd-3-clause | Python |
00531f6ee44b1af0b6ceb32efcb96af2e9e30e5e | fix code style test to work with newer versions of flake8 | rhaschke/catkin_tools,iwanders/catkin_tools,iwanders/catkin_tools,rhaschke/catkin_tools,scpeters/catkin_tools,iwanders/catkin_tools,catkin/catkin_tools,catkin/catkin_tools,scpeters/catkin_tools,catkin/catkin_tools,scpeters/catkin_tools,catkin/catkin_tools,iwanders/catkin_tools,scpeters/catkin_tools,rhaschke/catkin_tool... | tests/test_code_format.py | tests/test_code_format.py | import flake8.engine
import os
def test_flake8():
"""Test source code for pyFlakes and PEP8 conformance"""
flake8style = flake8.engine.StyleGuide(max_line_length=120)
report = flake8style.options.report
report.start()
this_dir = os.path.dirname(os.path.abspath(__file__))
try:
input_dir... | import flake8.engine
import os
def test_flake8():
"""Test source code for pyFlakes and PEP8 conformance"""
flake8style = flake8.engine.StyleGuide(max_line_length=120)
report = flake8style.options.report
report.start()
this_dir = os.path.dirname(os.path.abspath(__file__))
flake8style.input_dir(... | apache-2.0 | Python |
de62bbb9a83e2149ccbfd2d9e15ffdc62ecd01cf | Use temporal directory to write a video in test and close clips (#1408) | Zulko/moviepy | tests/test_compositing.py | tests/test_compositing.py | # -*- coding: utf-8 -*-
"""Compositing tests for use with pytest."""
from os.path import join
import pytest
from moviepy.editor import *
from moviepy.utils import close_all_clips
from tests.test_helper import TMP_DIR
def test_clips_array():
red = ColorClip((1024, 800), color=(255, 0, 0))
green = ColorClip(... | # -*- coding: utf-8 -*-
"""Compositing tests for use with pytest."""
from os.path import join
import pytest
from moviepy.editor import *
from moviepy.utils import close_all_clips
from tests.test_helper import TMP_DIR
def test_clips_array():
red = ColorClip((1024, 800), color=(255, 0, 0))
green = ColorClip(... | mit | Python |
791f2981b49fa23c9653efc45ce16f8bd8cef9e9 | rename a testcase class | agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | tests/test_dormitories.py | tests/test_dormitories.py | # Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from pycroft.helpers.dormitory_helper import sort_dormitories
from tests import OldPythonTestCase
class Test_01... | # Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from pycroft.helpers.dormitory_helper import sort_dormitories
from tests import OldPythonTestCase
class Test_01... | apache-2.0 | Python |
8962e03213081bedc94421fa8070f833bffed1dd | Use user variable in do() | skylines-project/skylines,shadowoneau/skylines,RBE-Avionik/skylines,dkm/skylines,RBE-Avionik/skylines,TobiasLohner/SkyLines,kerel-fs/skylines,Turbo87/skylines,Harry-R/skylines,Turbo87/skylines,Turbo87/skylines,shadowoneau/skylines,kerel-fs/skylines,dkm/skylines,TobiasLohner/SkyLines,snip/skylines,Harry-R/skylines,shado... | skylines/controllers/upload.py | skylines/controllers/upload.py | from tg import expose, request, redirect, flash
from tg.i18n import ugettext as _, lazy_ugettext as l_
from repoze.what.predicates import has_permission
from skylines.lib.base import BaseController
from skylines import files
from skylines.model import DBSession, Flight
from skylines.lib.analysis import analyse_flight
... | from tg import expose, request, redirect, flash
from tg.i18n import ugettext as _, lazy_ugettext as l_
from repoze.what.predicates import has_permission
from skylines.lib.base import BaseController
from skylines import files
from skylines.model import DBSession, Flight
from skylines.lib.analysis import analyse_flight
... | agpl-3.0 | Python |
597c1e3a3a2a392443c27287f6fa6e1a39d2ba76 | Bump minimum share count for countries to 500. | mozilla/mrburns,almossawi/mrburns,almossawi/mrburns,mozilla/mrburns,almossawi/mrburns,mozilla/mrburns,almossawi/mrburns | smithers/smithers/conf/base.py | smithers/smithers/conf/base.py | import os.path
from os import getenv
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
JSON_OUTPUT_DIR = os.path.join(BASE_DIR, 'JSON')
GEOIP_DB_FILE = os.path.join(BASE_DIR, 'GeoIP2-City.mmdb')
LOG_LEVEL = getenv('SMITHERS_LOG_LEVEL', 'INFO')
COUNTRY_MIN_SHARE = 500
REDIS_UNIX_SOCKET... | import os.path
from os import getenv
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
JSON_OUTPUT_DIR = os.path.join(BASE_DIR, 'JSON')
GEOIP_DB_FILE = os.path.join(BASE_DIR, 'GeoIP2-City.mmdb')
LOG_LEVEL = getenv('SMITHERS_LOG_LEVEL', 'INFO')
COUNTRY_MIN_SHARE = 20
REDIS_UNIX_SOCKET_... | mpl-2.0 | Python |
5d98a2a637965574966a33690a37ad8598391f2a | fix motors handling | Ecam-Eurobot-2017/main,Ecam-Eurobot-2017/main,Ecam-Eurobot-2017/main | code/raspberrypi/motors.py | code/raspberrypi/motors.py | from enum import IntEnum
from i2c import I2C
class Command(IntEnum):
Forward = 1
Backward = 2
TurnLeft = 3
TurnRight = 4
SetSpeed = 5
Stop = 6
DistanceTravelled = 7
IsDone = 8
IsStopped = 9
Resume = 10
class Motors(I2C):
def __init__(self, address):
super(Motors, ... | from enum import IntEnum
from i2c import I2C
class Command(IntEnum):
Forward = 1
Backward = 2
TurnLeft = 3
TurnRight = 4
SetSpeed = 5
Stop = 6
GetDistanceDone = 7
IsDone = 8
IsStopped = 9
Resume = 10
class Motors(I2C):
def __init__(self, address):
super(Motors, se... | mit | Python |
07c84a8d98c07f6c38557f7635ca1ca4e7cf2cd2 | Call module cleanup functions in reverse order | WopsS/sampgdk,Zeex/sampgdk,Zeex/sampgdk,WopsS/sampgdk,WopsS/sampgdk,Zeex/sampgdk | scripts/generate_init.py | scripts/generate_init.py | #!/usr/bin/env python
#
# Copyright (C) 2014 Zeex
#
# 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 a... | #!/usr/bin/env python
#
# Copyright (C) 2014 Zeex
#
# 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 a... | apache-2.0 | Python |
a2efdbc7c790df31f511d9a347774a961132d565 | Fix checking of limit parameter | DesertBus/txircd,Heufneutje/txircd,ElementalAlchemist/txircd | txircd/modules/cmode_l.py | txircd/modules/cmode_l.py | from twisted.words.protocols import irc
from txircd.modbase import Mode
class LimitMode(Mode):
def checkSet(self, user, target, param):
try:
intParam = int(param)
except ValueError:
return [False, param]
if str(intParam) != param:
return [False, param]
... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class LimitMode(Mode):
def checkSet(self, user, target, param):
intParam = int(param)
if str(intParam) != param:
return [False, param]
return [(intParam >= 0), param]
def checkPermission(self, user,... | bsd-3-clause | Python |
86ea47c8f6060e132fe8547c6cd7b32348e75309 | fix wrong BeautifulSoup conversion to string in tests | wdv4758h/rst2html5,wdv4758h/rst2html5,wdv4758h/rst2html5 | tests/test_html5writer.py | tests/test_html5writer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from functools import partial
from io import open
from tempfile import gettempdir
from bs4 import BeautifulSoup
from docutils.core import publish_parts
from nose.tools import assert_equals
from rst2html5 ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from functools import partial
from io import open
from tempfile import gettempdir
from bs4 import BeautifulSoup
from docutils.core import publish_parts
from nose.tools import assert_equals
from rst2html5 ... | mit | Python |
380331a54ae09a54e458b30a0fb6a459faa76f37 | Change the feature calculation to match the new unified format | e-mission/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,joshzarrabi/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission... | emission/analysis/point_features.py | emission/analysis/point_features.py | # Standard imports
import math
import logging
import numpy as np
import emission.core.common as ec
import emission.analysis.section_features as sf
def calDistance(point1, point2):
return ec.calDistance([point1.longitude, point1.latitude], [point2.longitude, point2.latitude])
def calHeading(point1, point2):
re... | # Standard imports
import math
import logging
import numpy as np
import emission.core.common as ec
import emission.analysis.section_features as sf
def calDistance(point1, point2):
return ec.calDistance([point1.longitude, point1.latitude], [point2.longitude, point2.latitude])
def calHeading(point1, point2):
re... | bsd-3-clause | Python |
82cd2f4ed6fdfc71c6fb52f9b6bcfbe674434b00 | Update eliqonline.py | oandrew/home-assistant,FreekingDean/home-assistant,morphis/home-assistant,dmeulen/home-assistant,nkgilley/home-assistant,Smart-Torvy/torvy-home-assistant,aoakeson/home-assistant,robbiet480/home-assistant,xifle/home-assistant,kennedyshead/home-assistant,alexmogavero/home-assistant,jamespcole/home-assistant,jnewland/home... | homeassistant/components/sensor/eliqonline.py | homeassistant/components/sensor/eliqonline.py | """
homeassistant.components.sensor.eliqonline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monitors home energy use for the eliq online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.eliqonline/
"""
import logging
from homeassistant.helper... | """
homeassistant.components.sensor.eliqonline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monitors home energy use for the eliq online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.eliqonline/
"""
import logging
from homeassistant.helper... | apache-2.0 | Python |
99868ed001a115d39cd299a1a4ff5def89e6cb48 | Update chuckie.py | Violet-Sloth/Project-Violet-Sloth | chuckie.py | chuckie.py | import boto3
from boto3.dynamodb.conditions import Key, Attr
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('wotd')
def lambda_handler(event, context):
wotd = table.query(
KeyConditionExpression=Key('language').eq(event['request']['intent']['slots']["Language"]["value"].lower()) & ... | import boto3
from boto3.dynamodb.conditions import Key, Attr
import os
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('wotd')
def lambda_handler(event, context):
wotd = table.query(
KeyConditionExpression=Key('language').eq(event["request"]["intent"]["slots"]["Language"]["value"].... | apache-2.0 | Python |
4de5050deda6c73fd9812a5e53938fea11e0b2cc | Add test for sock path length | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/unit/minion_test.py | tests/unit/minion_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Mike Place <mp@saltstack.com>`
'''
# Import python libs
import os
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, patch
# Import salt libs
f... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Mike Place <mp@saltstack.com>`
'''
# Import Salt Testing libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, patch
from salt import minion
from salt.exceptions import ... | apache-2.0 | Python |
a78aa6bb60520d4949f285d6aebcbd4bcab6993b | Use default build folder. | RedFox20/ReCpp,RedFox20/ReCpp | mamafile.py | mamafile.py | import mama
class ReCpp(mama.BuildTarget):
def dependencies(self):
pass
def package(self):
self.export_libs('.', ['ReCpp.lib', 'ReCpp.a'])
self.export_includes('.') # So: #include <rpp/strview.h>
if self.linux:
self.export_syslib('dl')
self.export_sysl... | import mama
class ReCpp(mama.BuildTarget):
local_workspace = 'build'
def dependencies(self):
pass
def package(self):
self.export_libs('.', ['ReCpp.lib', 'ReCpp.a'])
self.export_includes('.') # So: #include <rpp/strview.h>
if self.linux:
self.export_syslib('dl')... | mit | Python |
49eaed1b9224672f89d84fa12315f5d3566064c8 | Fix probability in make_mod.py | kenkov/kovlive | make_mod.py | make_mod.py | #! /usr/bin/env python
# coding:utf-8
import config
def make_model_mod(
phrase,
bigram,
):
'''
特別な語用の mod ファイルを生成する。
phrase で変換したい語を指定する。
bigram で組み合わせてはいけない語を指定する。
'''
phrase_fd = open(phrase, "w")
bigram_fd = open(bigram, "w")
# phrase
for word in config.XTU_REPLACE:
... | #! /usr/bin/env python
# coding:utf-8
import config
def make_model_mod(
phrase,
bigram,
):
'''
特別な語用の mod ファイルを生成する。
phrase で変換したい語を指定する。
bigram で組み合わせてはいけない語を指定する。
'''
phrase_fd = open(phrase, "w")
bigram_fd = open(bigram, "w")
# phrase
for word in config.XTU_REPLACE:
... | mit | Python |
87544f152e567970089f055b0002fe8922ae2346 | fix file issues | probml/pyprobml,probml/pyprobml,probml/pyprobml,probml/pyprobml | scripts/seq_logo_demo.py | scripts/seq_logo_demo.py | # DNA Sequence Demonstration
# Author: Drishtii@
# Based on
# https://github.com/probml/pmtk3/blob/master/demos/seqlogoDemo.m
#!pip install logomaker
import numpy as np
import pandas as pd
import pyprobml_utils as pml
import logomaker
import matplotlib.pyplot as plt
li = ['atagccggtacggca', 'ttagctgcaaccgca', 'tcagc... | # DNA Sequence Demonstration
# Author: Drishtii@
# Based on
# https://github.com/probml/pmtk3/blob/master/demos/seqlogoDemo.m
#!pip install logomaker
import numpy as np
import pandas as pd
import pyprobml_utils as pml
import logomaker
li = ['atagccggtacggca', 'ttagctgcaaccgca', 'tcagccactagagca', 'ataaccgcgaccgca', ... | mit | Python |
099693f7c5628c6769854eb5b9865debab4d9b89 | 更新 template tags, 新增 tag get_user_following_count 用來取得使用者之追蹤者數量 | yrchen/CommonRepo,yrchen/CommonRepo,yrchen/CommonRepo,yrchen/CommonRepo | commonrepo/main/templatetags/commonrepo_tags.py | commonrepo/main/templatetags/commonrepo_tags.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import template
from django.conf import settings
from django.contrib.auth import get_user_model
from commonrepo.users.models import User as User
register = template.Library()
# settings value
@register.simple_tag
def get_se... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import template
from django.conf import settings
from django.contrib.auth import get_user_model
from commonrepo.users.models import User as User
register = template.Library()
# settings value
@register.simple_tag
def get_se... | apache-2.0 | Python |
f727b6663a522577e7c51878de660f5d7306e9ba | Add custom Rheinland-Pfalz redirect | catcosmo/fragdenstaat_de,okfse/fragastaten_se,okfse/fragdenstaat_de,catcosmo/fragdenstaat_de,okfse/fragdenstaat_de,okfse/fragastaten_se | fragdenstaat_de/theme/urls.py | fragdenstaat_de/theme/urls.py | from django.conf.urls import patterns, url, include
from django.http import HttpResponseRedirect
urlpatterns = patterns('fragdenstaat_de.theme.views',
(r'^presse/(?P<slug>[-\w]+)/$', 'show_press', {}, 'fds-show_press'),
url(r'^nordrhein-westfalen/', lambda request: HttpResponseRedirect('/nrw/'),
name=... | from django.conf.urls import patterns, url, include
from django.http import HttpResponseRedirect
urlpatterns = patterns('fragdenstaat_de.theme.views',
(r'^presse/(?P<slug>[-\w]+)/$', 'show_press', {}, 'fds-show_press'),
url(r'^nordrhein-westfalen/', lambda request: HttpResponseRedirect('/nrw/'),
name=... | mit | Python |
0175e9408a0820d15c4c78eda528b93279d72d9d | fix docs for admins and add info root email | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient/clearinghouse/defaultsettings/admins.py | src/python/expedient/clearinghouse/defaultsettings/admins.py | '''Information on administrators and login in info.
Created on Aug 19, 2010
@author: jnaous
'''
ADMINS = ()
'''Should be a list of tuples [(<admin full name>, <admin email>)]'''
MANAGERS = ()
'''Same as L{ADMINS}'''
ROOT_USERNAME = "expedient"
ROOT_PASSWORD = "expedient"
ROOT_EMAIL = "expedient@expedient.com"
| '''
Created on Aug 19, 2010
@author: jnaous
'''
ADMINS = ()
'''See Django documentation.'''
MANAGERS = ()
'''See Django documentation.'''
ROOT_USERNAME = "expedient"
ROOT_PASSWORD = "expedient"
| bsd-3-clause | Python |
1fc6eb9ccc9789e2717898108f286adf5b351031 | Make sure this value is always an integer | wahuneke/django-stripe-payments,aibon/django-stripe-payments,boxysean/django-stripe-payments,crehana/django-stripe-payments,adi-li/django-stripe-payments,wahuneke/django-stripe-payments,jawed123/django-stripe-payments,jamespacileo/django-stripe-payments,ZeevG/django-stripe-payments,ZeevG/django-stripe-payments,crehana/... | payments/management/commands/init_plans.py | payments/management/commands/init_plans.py | from django.conf import settings
from django.core.management.base import BaseCommand
import stripe
class Command(BaseCommand):
help = "Make sure your Stripe account has the plans"
def handle(self, *args, **options):
stripe.api_key = settings.STRIPE_SECRET_KEY
for plan in settings.PAYMENTS_P... | from django.conf import settings
from django.core.management.base import BaseCommand
import stripe
class Command(BaseCommand):
help = "Make sure your Stripe account has the plans"
def handle(self, *args, **options):
stripe.api_key = settings.STRIPE_SECRET_KEY
for plan in settings.PAYMENTS_P... | bsd-3-clause | Python |
26233e1ccb6d63d8b3e0f23ef8e436bf675a24ae | Change assert(False) in tests to assert(True) so that tests don't fail on every run | xgds/xgds_video,xgds/xgds_video,xgds/xgds_video | xgds_video/tests.py | xgds_video/tests.py | # __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from django.test import TestCase
class xgds_videoTest(TestCase):
"""
Tests for xgds_video
"""
def... | # __BEGIN_LICENSE__
# Copyright (C) 2008-2010 United States Government as represented by
# the Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# __END_LICENSE__
from django.test import TestCase
class xgds_videoTest(TestCase):
"""
Tests for xgds_video
"""
def... | apache-2.0 | Python |
c85748cc5ce6cdf291ea4dd2765e71b6a58e25e9 | move func to training | galbiati/nns-for-mnk,galbiati/nns-for-mnk | run_fit.py | run_fit.py | # runs a fitting routine
# imports
import os
import sys
import numpy as np
import pandas as pd
import theano
import lasagne
import loading
from training import *
from network import *
from architectures import *
# aliases
L = lasagne.layers
nl = lasagne.nonlinearities
T = theano.tensor
# directories
headdir = os.pat... | # runs a fitting routine
# imports
import os
import sys
import numpy as np
import pandas as pd
import theano
import lasagne
import loading
from training import *
from network import *
from architectures import *
# aliases
L = lasagne.layers
nl = lasagne.nonlinearities
T = theano.tensor
# directories
headdir = os.pat... | mit | Python |
27ab83010f7cc8308debfec16fab38544a9c7ce7 | Print all hourly temperatures from run date | briansuhr/slowburn | running.py | running.py | import tcxparser
from configparser import ConfigParser
from datetime import datetime
import urllib.request
import dateutil.parser
import json
# Darksky weather API
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky', 'key')
tcx = tc... | import tcxparser
from configparser import ConfigParser
from datetime import datetime
import urllib.request
import dateutil.parser
t = '1984-06-02T19:05:00.000Z'
# Darksky weather API
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky... | mit | Python |
f0102e7a0c5fb6af8f4dbc52dfbb19bf5f119930 | include title in tagging | ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder | freelancefinder/jobs/tasks.py | freelancefinder/jobs/tasks.py | """Tasks to handle periodic tasks for jobs."""
from celery import Celery
from celery.utils.log import get_task_logger
celery_app = Celery()
logger = get_task_logger(__name__)
@celery_app.task
def process_new_posts():
"""Determine which posts are about freelance jobs."""
from .models import Post
for po... | """Tasks to handle periodic tasks for jobs."""
from celery import Celery
from celery.utils.log import get_task_logger
celery_app = Celery()
logger = get_task_logger(__name__)
@celery_app.task
def process_new_posts():
"""Determine which posts are about freelance jobs."""
from .models import Post
for po... | bsd-3-clause | Python |
7b6a5c35e7b53de9351ee9004638bfd90f8017e9 | Reformat decorators | vovanbo/aiohttp_json_api | aiohttp_json_api/decorators.py | aiohttp_json_api/decorators.py | """Handlers decorators."""
from functools import partial, wraps
from aiohttp import hdrs, web
from .common import JSONAPI, JSONAPI_CONTENT_TYPE, logger
from .errors import HTTPNotAcceptable, HTTPNotFound, HTTPUnsupportedMediaType
def jsonapi_handler(handler=None, resource_type=None,
content_type... | """Handlers decorators."""
from functools import partial, wraps
from aiohttp import hdrs, web
from .common import JSONAPI, JSONAPI_CONTENT_TYPE, logger
from .errors import HTTPNotAcceptable, HTTPNotFound, HTTPUnsupportedMediaType
def jsonapi_handler(handler=None, resource_type=None,
content_type... | mit | Python |
91a91dd3887e6a4bf27287b52210e2d809ac71f4 | Use '' instead of None to prevent errors with argparse. | normanheckscher/soundcloud-cli,zeekay/soundcloud-cli | sc/lame.py | sc/lame.py | import os
import re
import subprocess
import sys
from datetime import date
from . import settings
DEFAULT_YEAR = date.today().year
PROGRESS_RE = re.compile(r'\((\s?\d+)%\)')
class Progressbar(object):
def __init__(self, filename=None):
self.filename = filename
def __call__(self, line):
per... | import os
import re
import subprocess
import sys
from datetime import date
from . import settings
DEFAULT_YEAR = date.today().year
PROGRESS_RE = re.compile(r'\((\s?\d+)%\)')
class Progressbar(object):
def __init__(self, filename=None):
self.filename = filename
def __call__(self, line):
per... | mit | Python |
86c953f6488cbbfd69a866d1bcde362fb56a26ad | Debug faces. | Magnetic/opencv-cffi | example.py | example.py | import itertools
import sys
from bp.filepath import FilePath
from opencv_cffi.core import invert
from opencv_cffi.imaging import Camera
from opencv_cffi.gui import ESCAPE, Window, key_pressed
from opencv_cffi.object_detection import HaarClassifier
cascade_filepath = FilePath(sys.argv[1])
classifier = HaarClassifier... | import itertools
import sys
from bp.filepath import FilePath
from opencv_cffi.core import invert
from opencv_cffi.imaging import Camera
from opencv_cffi.gui import ESCAPE, Window, key_pressed
from opencv_cffi.object_detection import HaarClassifier
cascade_filepath = FilePath(sys.argv[1])
classifier = HaarClassifier... | mit | Python |
816420bf7cd0443a846bdcfc91e9510cd4999eee | Fix models.character imports | madcowfred/evething,cmptrgeekken/evething,madcowfred/evething,Gillingham/evething,madcowfred/evething,cmptrgeekken/evething,Gillingham/evething,Gillingham/evething,cmptrgeekken/evething,cmptrgeekken/evething,cmptrgeekken/evething,madcowfred/evething,Gillingham/evething | thing/models/character.py | thing/models/character.py | # ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | # ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | bsd-2-clause | Python |
678fe34d2c6163f3c6ee7e7904df95f9ae83129e | use raise_on_404 in example.py | hickford/MechanicalSoup,MechanicalSoup/MechanicalSoup,hemberger/MechanicalSoup | example.py | example.py | """Example app to login to GitHub using the StatefulBrowser class."""
from __future__ import print_function
import argparse
import mechanicalsoup
from getpass import getpass
parser = argparse.ArgumentParser(description="Login to GitHub.")
parser.add_argument("username")
args = parser.parse_args()
args.password = get... | """Example app to login to GitHub using the StatefulBrowser class."""
from __future__ import print_function
import argparse
import mechanicalsoup
from getpass import getpass
parser = argparse.ArgumentParser(description="Login to GitHub.")
parser.add_argument("username")
args = parser.parse_args()
args.password = get... | mit | Python |
fd15f73c33867a5a06e5c408f819b42d6729fa1c | test getting xml | step21/poerelief,step21/poerelief,step21/poerelief | epidat_parse.py | epidat_parse.py | from lxml import etree
from io import StringIO, BytesIO
from lxml import objectify
# Fixed baseurl for SI epidat records
baseurl = "http://steinheim-institut.de/cgi-bin/epidat?"
# The seperator
s = "-"
# specifies the format
format = "teip5"
# afaik records always start at 1
id = 1
# Fixed location for testing
loc = "a... | from lxml import etree
# Fixed baseurl for SI epidat records
baseurl = ""
# The seperator
s = "-"
# specifies the format
format = "t"
# afaik records always start at 1
id = 1
# Fixed location for testing
loc = "aha"
url = baseurl + loc + s + id + s + format
parser = new_parser | agpl-3.0 | Python |
06949a83dc64681a49851c490b7dc87b3350e930 | Remove unneeded bind() call in example.py | thobbs/python-driver,stef1927/python-driver,jregovic/python-driver,sontek/python-driver,vipjml/python-driver,mike-tr-adamson/python-driver,bbirand/python-driver,mambocab/python-driver,thelastpickle/python-driver,kracekumar/python-driver,mambocab/python-driver,HackerEarth/cassandra-python-driver,datastax/python-driver,j... | example.py | example.py | #!/usr/bin/env python
import logging
log = logging.getLogger()
log.setLevel('DEBUG')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandler(handler)
from cassandra import ConsistencyLevel
from cassandra.cluster import Cluster
from... | #!/usr/bin/env python
import logging
log = logging.getLogger()
log.setLevel('DEBUG')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandler(handler)
from cassandra import ConsistencyLevel
from cassandra.cluster import Cluster
from... | apache-2.0 | Python |
e57a176b4ead0d7cbaacc7b5670239ae87bd1285 | Update example.py | hickford/MechanicalSoup,MechanicalSoup/MechanicalSoup,hemberger/MechanicalSoup | example.py | example.py | """Example app to login to GitHub"""
import argparse
import mechanicalsoup
parser = argparse.ArgumentParser(description='Login to GitHub.')
parser.add_argument("username")
parser.add_argument("password")
args = parser.parse_args()
browser = mechanicalsoup.Browser()
# request github login page. the result is a reques... | """Example app to login to GitHub"""
import argparse
import mechanicalsoup
parser = argparse.ArgumentParser(description='Login to GitHub.')
parser.add_argument("username")
parser.add_argument("password")
args = parser.parse_args()
browser = mechanicalsoup.Browser()
# request github login page. the result is a reques... | mit | Python |
e7ca8b411e0f98386552b511933cb5b5c439b763 | remove unneeded logging in command line | rsalmei/clearly | clearly/command_line.py | clearly/command_line.py | import click
class AliasedGroup(click.Group):
"""Used to allow calling shorten commands, as long as they're unique.
Based on recipe from http://click.palletsprojects.com/en/7.x/advanced/
"""
def get_command(self, ctx, cmd_name):
rv = click.Group.get_command(self, ctx, cmd_name)
if rv... | import logging
import click
logger = logging.getLogger(__name__)
class AliasedGroup(click.Group):
"""Used to allow calling shorten commands, as long as they're unique.
Based on recipe from http://click.palletsprojects.com/en/7.x/advanced/
"""
def get_command(self, ctx, cmd_name):
rv = clic... | mit | Python |
39400e597a7ece17dce062bf2b696383d5ead782 | Prepare for compatibility_lib 0.0.15 (#195) | GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python | compatibility_lib/setup.py | compatibility_lib/setup.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
8636354ea22f36b630dbb665e959f3eab78af295 | Add a range filter for activity duration | GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa,GISAElkartea/tresna-kutxa | tk/material/filtersets.py | tk/material/filtersets.py | from django.contrib.postgres.fields import IntegerRangeField
from django_filters import FilterSet
from django_filters.filters import ChoiceFilter, NumericRangeFilter
from .fields import get_languages
from .models import Material, Activity, Reading, Video, Link, COMMON_LANGUAGES
from .widgets import RangeWidget
clas... | from django.contrib.postgres.fields import IntegerRangeField
from django_filters import FilterSet
from django_filters.filters import ChoiceFilter, NumericRangeFilter
from .fields import get_languages
from .models import Material, Activity, Reading, Video, Link, COMMON_LANGUAGES
from .widgets import RangeWidget
clas... | agpl-3.0 | Python |
8c59a619911190390af8f9348f9d0c0e07d4ce11 | Bump version to 0.8.0 | jreese/tasky | tasky/__init__.py | tasky/__init__.py | # Copyright 2016 John Reese
# Licensed under the MIT license
# flake8: noqa
from concurrent.futures import CancelledError
from .tasks import Task, PeriodicTask, TimerTask, QueueTask
from .config import Config, JsonConfig
from .stats import Stats
from .loop import Tasky
__version__ = '0.8.0'
| # Copyright 2016 John Reese
# Licensed under the MIT license
# flake8: noqa
from concurrent.futures import CancelledError
from .tasks import Task, PeriodicTask, TimerTask, QueueTask
from .config import Config, JsonConfig
from .stats import Stats
from .loop import Tasky
__version__ = '0.7.2'
| mit | Python |
0b4e81980ff0f448646804c91905a3b50259c64b | Add a hashbang to mcmanage.py | nerdzeu/NERDZCrush,nerdzeu/NERDZCrush,MediaCrush/MediaCrush,MediaCrush/MediaCrush,nerdzeu/NERDZCrush,roderickm/MediaCrush,roderickm/MediaCrush,roderickm/MediaCrush | mcmanage.py | mcmanage.py | #!/usr/bin/env python
"""MediaCrush manage.
Usage:
mcmanage.py database clear
mcmanage.py database upgrade
mcmanage.py admin list
mcmanage.py admin add <pwhash>
mcmanage.py admin delete <pwhash>
mcmanage.py report show
mcmanage.py report email
mcmanage.py files delete <hash>
"""
from d... | """MediaCrush manage.
Usage:
mcmanage.py database clear
mcmanage.py database upgrade
mcmanage.py admin list
mcmanage.py admin add <pwhash>
mcmanage.py admin delete <pwhash>
mcmanage.py report show
mcmanage.py report email
mcmanage.py files delete <hash>
"""
from docopt import docopt
... | mit | Python |
5de88f9652c05b1374599a968beb7c8313d84ee2 | Remove a print | jisaacks/MaxPane | max_pane.py | max_pane.py | import sublime, sublime_plugin
# ------
class PaneManager:
last_layout = False
# ------
class MaxPaneCommand(sublime_plugin.WindowCommand):
def run(self):
w = self.window
if PaneManager.last_layout:
w.run_command("unmaximize_pane")
else:
w.run_command("maximiz... | import sublime, sublime_plugin
# ------
class PaneManager:
last_layout = False
# ------
class MaxPaneCommand(sublime_plugin.WindowCommand):
def run(self):
print("MAX PANING")
w = self.window
if PaneManager.last_layout:
w.run_command("unmaximize_pane")
else:
... | mit | Python |
2f51b89f47930a7313fa6a4a469a014aa6112ee3 | fix path problem | stephenhky/PyShortTextCategorization | shorttext/stack/__init__.py | shorttext/stack/__init__.py | from .stacking import StackedGeneralization, LogisticStackedGeneralization | from stacking import StackedGeneralization, LogisticStackedGeneralization | mit | Python |
7bfd5e279b76abd153c957ef22f221570b1145a9 | exclude '@xmlns' from case properties | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/ex-submodules/casexml/apps/case/const.py | corehq/ex-submodules/casexml/apps/case/const.py | # how cases/referrals are tagged in the xform/couch
CASE_TAG = "case"
REFERRAL_TAG = "referral"
# internal case identifiers
CASE_ACTION_INDEX = "index"
CASE_ACTION_CREATE = "create"
CASE_ACTION_UPDATE = "update"
CASE_ACTION_CLOSE = "close"
CASE_ACTION_ATTACHMENT = "attachment"
CASE_ACTION_COMMTRACK = "commtrack"
CASE_... | # how cases/referrals are tagged in the xform/couch
CASE_TAG = "case"
REFERRAL_TAG = "referral"
# internal case identifiers
CASE_ACTION_INDEX = "index"
CASE_ACTION_CREATE = "create"
CASE_ACTION_UPDATE = "update"
CASE_ACTION_CLOSE = "close"
CASE_ACTION_ATTACHMENT = "attachment"
CASE_ACTION_COMMTRACK = "commtrack"
CASE_... | bsd-3-clause | Python |
8d59724b137a4413736127a4eff3c2e1e41dfd44 | Remove dumb code | fabianvf/nltk-keyword-extractor | extract.py | extract.py | import functools
from nltk import pos_tag
from nltk.tokenize import word_tokenize
from nltk.collocations import (
BigramAssocMeasures,
TrigramAssocMeasures,
BigramCollocationFinder,
TrigramCollocationFinder,
)
# Just leaving this here for now, need to install these
nltk_dependencies = (
'averaged_... | import functools
from nltk import pos_tag
from nltk.tokenize import word_tokenize
from nltk.collocations import (
BigramAssocMeasures,
TrigramAssocMeasures,
BigramCollocationFinder,
TrigramCollocationFinder,
)
# Just leaving this here for now, need to install these
nltk_dependencies = (
'averaged_... | mit | Python |
e379aa75690d5bacc1d0bdec325ed4c16cf1a183 | Add search functionality to permissions endpoint | GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend | lims/permissions/views.py | lims/permissions/views.py | from django.contrib.auth.models import Permission
from rest_framework import viewsets
from .serializers import PermissionSerializer
class PermissionViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Permission.objects.all()
serializer_class = PermissionSerializer
search_fields = ('name',)
| from django.contrib.auth.models import Permission
from rest_framework import viewsets
from .serializers import PermissionSerializer
class PermissionViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Permission.objects.all()
serializer_class = PermissionSerializer
| mit | Python |
57743c3a104bf30f67db727ca5f6630dae110191 | Add exception handling and error for using fastai | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon_client/tracking/contrib/fastai.py | polyaxon_client/tracking/contrib/fastai.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_client.exceptions import PolyaxonClientException
try:
from fastai.callbacks import TrackerCallback
except ImportError:
raise PolyaxonClientException('Fastai is required to use PolyaxonFastai')
class Polyax... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from fastai.callbacks import TrackerCallback
class PolyaxonFastai(TrackerCallback):
def __init__(self, learn, experiment, monitor='val_loss', mode='auto'):
super().__init__(learn, monitor=monitor, mode=mode)
... | apache-2.0 | Python |
c8dbbd82315a9f4392373ad38970b2159bfcd34e | Add users to fabfile. | alex/braid,alex/braid | fabfile.py | fabfile.py | """
Collection of utilities to automate the administration of Twisted's
infrastructure. Use this utility to install, update and start/stop/restart
services running on twistedmatrix.com.
"""
"""
This file is a simple entry point, nothing is final about it!
Just experimenting for now.
"""
from braid import base, users... | """
Collection of utilities to automate the administration of Twisted's
infrastructure. Use this utility to install, update and start/stop/restart
services running on twistedmatrix.com.
"""
"""
This file is a simple entry point, nothing is final about it!
Just experimenting for now.
"""
from braid import base
from b... | mit | Python |
15e01f3486fb00a840d11038bebe744089d199fe | Upgrade to fabric 2.0 | exhuma/puresnmp,exhuma/puresnmp | fabfile.py | fabfile.py | from invoke import task
def generate_type_hierarchy(ctx):
"""
Generate a document containing the available variable types.
"""
ctx.run('./env/bin/python -m puresnmp.types > docs/typetree.rst')
@task
def doc(ctx):
generate_type_hierarchy(ctx)
ctx.run('sphinx-apidoc '
'-o docs/deve... | import fabric.api as fab
def generate_type_hierarchy():
"""
Generate a document containing the available variable types.
"""
fab.local('./env/bin/python -m puresnmp.types > docs/typetree.rst')
@fab.task
def doc():
generate_type_hierarchy()
fab.local('sphinx-apidoc '
'-o docs/de... | mit | Python |
93a9f893b74f99fa39dea3d5d8c251b2bc6e86d9 | Update fabfile for docker | ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo | fabfile.py | fabfile.py | import os
from fabric.api import *
LOCAL_ROOT = os.path.dirname(os.path.realpath(__file__))
LOCAL_VIRTUALENV = '~/.virtualenv/tomo'
TOMO_HOST = 'www.projekt-tomo.si'
env.hosts = [TOMO_HOST]
env.timeout = 20
env.connection_attempts = 3
# MAIN TASKS
@task
def test():
with lcd(LOCAL_ROOT), activate_virtualenv():
... | import os
from fabric.api import *
LOCAL_ROOT = os.path.dirname(os.path.realpath(__file__))
TOMO_HOST = 'tomo.fmf.uni-lj.si'
TOMO_DIR = '/srv/tomodev/'
TOMO_VIRTUALENV = '/srv/tomodev/virtualenv'
env.hosts = [TOMO_HOST]
# MAIN TASKS
@task
def test():
with prefix('source ~/.virtualenv/tomo/bin/activate'):
... | agpl-3.0 | Python |
c03ca7300969bba583301f0d38f1c64aa5e4148c | configure verbosity globally, instead for each task | tomster/ezjail-remote | fabfile.py | fabfile.py | import sys
from os import path
from datetime import datetime
from fabric.api import run, sudo, put, env, settings
from fabric.state import output
EZJAIL_JAILDIR = '/usr/jails'
EZJAIL_RC = '/usr/local/etc/rc.d/ezjail.sh'
env['shell'] = '/bin/sh -c'
output['running'] = False
def jls():
run('jls')
def create(nam... | import sys
from os import path
from datetime import datetime
from fabric.api import run, sudo, put, env, settings, hide
EZJAIL_JAILDIR = '/usr/jails'
EZJAIL_RC = '/usr/local/etc/rc.d/ezjail.sh'
env['shell'] = '/bin/sh -c'
def jls():
run('jls')
def create(name,
ip,
admin=u'root',
keyfile=None,
... | bsd-2-clause | Python |
41e9db1565a3371fd7f13428964e026df673ca96 | add exception logging for send_global_chat | lsaffre/lino,lino-framework/lino,lsaffre/lino,lsaffre/lino,lino-framework/lino,lino-framework/lino,lsaffre/lino,lsaffre/lino,lino-framework/lino,lino-framework/lino | lino/modlib/notify/api.py | lino/modlib/notify/api.py | # -*- coding: UTF-8 -*-
# Copyright 2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
import json
from lino.api import rt
import logging
logger = logging.getLogger(__name__)
NOTIFICATION = "NOTIFICATION"
CHAT = "CHAT"
NOTIFICATION_TYPES = [
NOTIFICATION, CHAT
]
def send_notification(user, id, ... | # -*- coding: UTF-8 -*-
# Copyright 2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
import json
from lino.api import rt
NOTIFICATION = "NOTIFICATION"
CHAT = "CHAT"
NOTIFICATION_TYPES = [
NOTIFICATION, CHAT
]
def send_notification(user, id, subject, body, created):
"""
:param user:
... | unknown | Python |
8e2359d8ed6b17fc6cad99d617c889c754eb44c1 | Fix Logging around the Videomixer creation | h01ger/voctomix,voc/voctomix,h01ger/voctomix,voc/voctomix | voctocore/lib/pipeline.py | voctocore/lib/pipeline.py | #!/usr/bin/python3
import logging
from gi.repository import Gst
# import library components
from lib.config import Config
from lib.avsource import AVSource
from lib.asource import ASource
from lib.vsource import VSource
from lib.avrawoutput import AVRawOutput
from lib.avpreviewoutput import AVPreviewOutput
from lib.vi... | #!/usr/bin/python3
import logging
from gi.repository import Gst
# import library components
from lib.config import Config
from lib.avsource import AVSource
from lib.asource import ASource
from lib.vsource import VSource
from lib.avrawoutput import AVRawOutput
from lib.avpreviewoutput import AVPreviewOutput
from lib.vi... | mit | Python |
3cdc56a14424bbf7281d20809f2928dd5d5d5140 | update sample app | MiCHiLU/gae-tap,MiCHiLU/gae-tap,MiCHiLU/gae-tap,MiCHiLU/gae-tap | gae/app_sample/v1/__init__.py | gae/app_sample/v1/__init__.py | import webapp2
from . import app
prefixed = lambda s: "{0}.app.{1}".format(__package__, s)
routes = [
webapp2.Route("/", prefixed("Index")),
webapp2.Route("/index.html", app.ForMobile),
]
| import webapp2
from . import app
routes = [
webapp2.Route("/", app.Index),
webapp2.Route("/index.html", app.ForMobile),
]
| mit | Python |
650b586311e6883d27a912e0b46c521ed5644ff3 | Fix npm test coverage script name (#1082) | cloudify-cosmo/cloudify-system-tests,cloudify-cosmo/cloudify-system-tests | cosmo_tester/test_suites/ui_tests/stage_test.py | cosmo_tester/test_suites/ui_tests/stage_test.py | import subprocess
import os
def test_stage(test_ui_manager, ssh_key, logger, test_config):
logger.info('Installing dependencies to run system tests...')
subprocess.call(['npm', 'run', 'beforebuild'],
cwd=test_config['ui']['stage_repo'])
logger.info('Starting update of Stage package on... | import subprocess
import os
def test_stage(test_ui_manager, ssh_key, logger, test_config):
logger.info('Installing dependencies to run system tests...')
subprocess.call(['npm', 'run', 'beforebuild'],
cwd=test_config['ui']['stage_repo'])
logger.info('Starting update of Stage package on... | apache-2.0 | Python |
c54a759e1044dbf49eeab3ba79758b97e6aee1ae | split out functions | sk2/autonetkit | example/diff.py | example/diff.py | import time
import autonetkit.diff
from autonetkit.nidb import NIDB
import autonetkit.verify
import autonetkit.push_changes
#TODO: write monitor that checks to see if latest file has changed in version directory
def main():
nidb_versions_dir = "../versions/nidb/"
nidb_a = NIDB()
#TODO: need to restore secon... | import glob
import json
import time
import pprint
import autonetkit.ank_messaging as ank_messaging
import autonetkit.measure as measure
nodes = ["8"]
import autonetkit.diff
from autonetkit.nidb import NIDB
import autonetkit.verify
"""
nidb_b = NIDB()
nidb_a.restore("diff/nidb_20130411_095950.json.gz")
nidb_b.resto... | bsd-3-clause | Python |
e943687997d2e40d6c49b0af0ab8d34a44f7a535 | Comment urls | callowayproject/django-pollit,callowayproject/django-pollit | example/urls.py | example/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^example/', include('example.foo.urls')),
# Uncomment the admin/doc line below and ... | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^example/', include('example.foo.urls')),
# Uncomment the admin/doc line below and ... | apache-2.0 | Python |
00922099d6abb03a0dbcca19781eb586d367eab0 | Remove double import of find contours. | robintw/scikit-image,WarrenWeckesser/scikits-image,ofgulban/scikit-image,ajaybhat/scikit-image,rjeli/scikit-image,SamHames/scikit-image,chintak/scikit-image,ofgulban/scikit-image,SamHames/scikit-image,dpshelio/scikit-image,chintak/scikit-image,rjeli/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,pratapvardha... | skimage/measure/__init__.py | skimage/measure/__init__.py | from .find_contours import find_contours
from ._regionprops import regionprops
from ._structural_similarity import ssim
| from .find_contours import find_contours
from ._regionprops import regionprops
from .find_contours import find_contours
from ._structural_similarity import ssim
| bsd-3-clause | Python |
e0e04d6d9c286d8dc6cbca087a693ea6cefac5a0 | Implement lazy loading in leaves.py. | TC01/Treemaker,TC01/Treemaker | Treemaker/python/leaves.py | Treemaker/python/leaves.py | """
Code to retrieve a list of leaves in a given ttree.
TTree equivalent to labels.py
Based off of treeviewer code: https://github.com/TC01/rootscripts/blob/master/treeviewer
"""
import os
import sys
import ROOT
# Leaf sub-dictionary, subclass of actual dict. Does lazy loading!
# Based on the LabelSubDict. I didn't ... | """
Code to retrieve a list of leaves in a given ttree.
TTree equivalent to labels.py
Based off of treeviewer code: https://github.com/TC01/rootscripts/blob/master/treeviewer
"""
import os
import sys
import ROOT
def getTreeLeaves(tree):
leafDict = {}
leaves = tree.GetListOfLeaves()
for leaf in leaves:
leafDict[... | mit | Python |
ed2dc8f8610a8e79efdc614c593e021847f50c15 | Change blood group to "O" | joke2k/faker,danhuss/faker,joke2k/faker | faker/providers/profile/__init__.py | faker/providers/profile/__init__.py | # coding=utf-8
from .. import BaseProvider
import itertools
class Provider(BaseProvider):
"""
This provider is a collection of functions to generate personal profiles and identities.
"""
def simple_profile(self, sex=None):
"""
Generates a basic profile with personal informations
... | # coding=utf-8
from .. import BaseProvider
import itertools
class Provider(BaseProvider):
"""
This provider is a collection of functions to generate personal profiles and identities.
"""
def simple_profile(self, sex=None):
"""
Generates a basic profile with personal informations
... | mit | Python |
2640759e66317c2a5bbf04bb03c657b05f90374f | add layout to admin | pkimber/old_cms | cms/admin.py | cms/admin.py | from django.contrib import admin
from .models import (
Layout,
Page,
Section,
)
class LayoutAdmin(admin.ModelAdmin):
pass
admin.site.register(Layout, LayoutAdmin)
class PageAdmin(admin.ModelAdmin):
pass
admin.site.register(Page, PageAdmin)
class SectionAdmin(admin.ModelAdmin):
list_disp... | from django.contrib import admin
from .models import (
Page,
Section,
)
class PageAdmin(admin.ModelAdmin):
pass
admin.site.register(Page, PageAdmin)
class SectionAdmin(admin.ModelAdmin):
list_display = ('page',)
admin.site.register(Section, SectionAdmin)
| apache-2.0 | Python |
dc49e17e47329d7615387f1dcc0348d6f6fae1e2 | bump version to 0.6.6-dev | cameronbracken/ulmo,ocefpaf/ulmo,nathanhilbert/ulmo,nathanhilbert/ulmo,cameronbracken/ulmo,ocefpaf/ulmo | ulmo/version.py | ulmo/version.py | # set version number
__version__ = '0.6.6-dev'
| # set version number
__version__ = '0.6.5'
| bsd-3-clause | Python |
ea78a5f6f4813f824750cb1e34f499bdab8e0cbd | Fix token | Cyclohexanol/WorKit | fetcher.py | fetcher.py | import json
import time
import WorKit
import requests
from slackclient import SlackClient
from flask import Flask, g, jsonify, request, redirect
sc = SlackClient(WorKit.bot_token)
def loop():
if sc.rtm_connect():
while True:
message = sc.rtm_read()
interpret(message)
ti... | import json
import time
import requests
import WorKit
from slackclient import SlackClient
from flask import Flask, g, jsonify, request, redirect
sc = SlackClient("xoxp-107526814087-107526814135-106257538753-c1bf72ee3f0f3f2ea7501c37af1c3f65")
def loop():
if sc.rtm_connect():
while True:
message... | mit | Python |
c2ad7a08304ea08c08037fb4f89c4ab71b8acb0d | handle adding WORKFLOW_DEFAULT tag to messages for the fallback handler | dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/sms/handlers/fallback.py | corehq/apps/sms/handlers/fallback.py | from corehq.apps.domain.models import Domain
from corehq.apps.sms.api import (
send_sms_to_verified_number,
MessageMetadata,
add_msg_tags,
)
from corehq.apps.sms.models import WORKFLOW_DEFAULT
def fallback_handler(v, text, msg):
domain_obj = Domain.get_by_name(v.domain, strict=True)
default_workfl... | from corehq.apps.domain.models import Domain
from corehq.apps.sms.api import send_sms_to_verified_number
def fallback_handler(v, text, msg):
domain_obj = Domain.get_by_name(v.domain, strict=True)
if domain_obj.use_default_sms_response and domain_obj.default_sms_response:
send_sms_to_verified_number(v, ... | bsd-3-clause | Python |
31a826142a5adcfc9dd4df28efe3be6f35b7aa14 | Update models.py | clede/Radiotrack,clede/Radiotrack | users/models.py | users/models.py | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
import pytz
TZ_CHOICES = [(tz, tz.replace('_', ' ')) for tz in pytz.all_timezones]
# Create your models here.
class UserProfile(models.Model):
"""A profile associated with a specific user. Addit... | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
import pytz
TZ_CHOICES = [(tz, tz.replace('_', ' ')) for tz in pytz.all_timezones]
# Create your models here.
class UserProfile(models.Model):
user = models.OneToOneField(User)
tz = models.C... | apache-2.0 | Python |
22dc7d9c980fb6a15e8c9c8601388a3e2c3bc0f4 | Remove whitespace for flake8 | marcelometal/pyvows,heynemann/pyvows | tests/__init__.py | tests/__init__.py | # -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
| # -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
| mit | Python |
f80215780185e27423a0ee78a7b66be8bcadca77 | Fix test failure | puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/apps/commtrack/tests/test_settings.py | corehq/apps/commtrack/tests/test_settings.py | from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.commtrack.models import CommtrackConfig, ConsumptionConfig, StockRestoreConfig
from corehq.apps.commtrack.tests.util import bootstrap_domain
from corehq.apps.commtrack.const import DAYS_IN_MONTH
from corehq.apps.consumpt... | from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.commtrack.models import CommtrackConfig, ConsumptionConfig, StockRestoreConfig
from corehq.apps.commtrack.tests.util import bootstrap_domain
from corehq.apps.commtrack.const import DAYS_IN_MONTH
from corehq.apps.consumpt... | bsd-3-clause | Python |
ad39a4f15ccc2ab404c95dc842fe2ba299451b78 | Update script to find contrastive opinions for topic words | NLeSC/cptm,NLeSC/cptm | cptm/experiment_find_contrastive_opinions.py | cptm/experiment_find_contrastive_opinions.py | import logging
import pandas as pd
import argparse
import ast
from cptm.utils.experiment import load_config, get_corpus, load_topics, \
load_opinions, load_nks
from cptm.utils.controversialissues import contrastive_opinions, \
jsd_opinions, filter_opinions
logger = logging.getLogger(__name__)
logging.basicCon... | import logging
import pandas as pd
import argparse
from cptm.utils.experiment import load_config, get_corpus, load_topics, \
load_opinions, load_nks
from cptm.utils.controversialissues import contrastive_opinions, \
jsd_opinions
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : ... | apache-2.0 | Python |
7e0cf89cf0bfb00729f026df7a80d5642b043933 | update __init__ to include redundent fucntions for now | tsherwen/AC_tools,tsherwen/AC_tools | AC_tools/__init__.py | AC_tools/__init__.py | # compatibility with both python 2 and 3
from __future__ import print_function
from . plotting_REDUNDENT import *
from . plotting import *
from . variables import *
from . AC_time import *
from . planeflight import *
from . generic import *
from . core import *
from . GEOSChem_bpch import *
from . GEOSChem_nc import *
... | # compatibility with both python 2 and 3
from __future__ import print_function
from . plotting import *
from . variables import *
from . AC_time import *
from . planeflight import *
from . generic import *
from . core import *
from . GEOSChem_bpch import *
from . GEOSChem_nc import *
import numpy as np
"""
AC_tools is ... | mit | Python |
493e5e4fa435f5ed6661d70380f2ce861813a7d6 | add to_values test for Zip | spirali/haydi,spirali/haydi,Kobzol/haydi,Kobzol/haydi | tests/test_zip.py | tests/test_zip.py | import itertools
from testutils import init
init()
import haydi as hd # noqa
def test_zip_range_iterate():
d1 = hd.Range(1, 3)
d2 = hd.Range(4, 5)
d3 = hd.Range(6, 7)
expected = zip(d1, d2, d3)
result = list(hd.Zip((d1, d2, d3)))
assert expected == result
def test_zip_range_generate():
... | import itertools
from testutils import init
init()
import haydi as hd # noqa
def test_zip_range_iterate():
d1 = hd.Range(1, 3)
d2 = hd.Range(4, 5)
d3 = hd.Range(6, 7)
expected = zip(d1, d2, d3)
result = list(hd.Zip((d1, d2, d3)))
assert expected == result
def test_zip_range_generate():
... | mit | Python |
dfefc17eb6e864966d378a10c1f0523cd712bdff | Set level/handler on root logger instead of 'edi' | jreese/edi | edi/log.py | edi/log.py | # Copyright 2016 John Reese
# Licensed under the MIT license
import logging
import sys
from logging import Formatter, StreamHandler, FileHandler
Log = logging.getLogger('edi')
def init_logger(stdout: bool=True, file_path: str=None,
debug: bool=False) -> logging.Logger:
'''Initialize the logging... | # Copyright 2016 John Reese
# Licensed under the MIT license
import logging
import sys
from logging import Formatter, StreamHandler, FileHandler
Log = logging.getLogger('edi')
def init_logger(stdout: bool=True, file_path: str=None,
debug: bool=False) -> logging.Logger:
'''Initialize the logging... | mit | Python |
f06124639a89244ee44e78d91d00b1ceaee0e4b1 | Drop unneeded sys.exit | galaxyproject/gravity | gravity/commands/cmd_start.py | gravity/commands/cmd_start.py | import click
from gravity import config_manager, options
from gravity import process_manager
from gravity.io import info, exception
@click.command("start")
@options.required_instance_arg()
@click.option("-f", "--foreground", is_flag=True, default=False, help="Run in foreground")
@options.no_log_option()
@click.pass_... | import sys
import click
from gravity import config_manager, options
from gravity import process_manager
from gravity.io import info, exception
@click.command("start")
@options.required_instance_arg()
@click.option("-f", "--foreground", is_flag=True, default=False, help="Run in foreground")
@options.no_log_option()
... | mit | Python |
e3b263b2b53caa8a677ba30dc5ebea9b06fd4c5d | remove redundant comments | Czxck001/wordlists | console.py | console.py | #!/usr/bin/env python3
''' Interactive prompt to inspect specified wordlist
'''
import json
import argparse
from cmd import Cmd
import readline
from collections import OrderedDict
readline.set_completer_delims(' \t\n')
class WordlistConsole(Cmd):
def __init__(self, worddict, dict_name=None):
... | #!/usr/bin/env python3
''' Interactive prompt to inspect specified wordlist
'''
import json
import argparse
from cmd import Cmd
import readline
from collections import OrderedDict
readline.set_completer_delims(' \t\n')
class WordlistConsole(Cmd):
def __init__(self, worddict, dict_name=None):
... | mit | Python |
f528382076f774a5f08e1a497af88dab43d318fa | Use InMemoryCache for sessionend handler in SOAP client | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firecares_core/signals.py | firecares/firecares_core/signals.py | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.db.models import Q
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from guardian.... | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.db.models import Q
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from guardian.... | mit | Python |
4bd0052e960663991e3b9b636ee3af623e6797a8 | add date joined to user admin page | MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock | src/muckrock/accounts/admin.py | src/muckrock/accounts/admin.py | """
Admin registration for accounts models
"""
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django.contrib import admin
from django.http import HttpResponse
import csv
from accounts.models import Profile, Statisti... | """
Admin registration for accounts models
"""
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from django.http import HttpResponse
import csv
from accounts.models import Profile, Statistics
# These inhereit more than the allowed number of public methods
# pylint: disable=R0904
... | agpl-3.0 | Python |
c92db304fda1692b61f973ecaac27a9dc9e54727 | update wsgi | arthurio/coc_war_planner,arthurio/coc_war_planner,arthurio/coc_war_planner,arthurio/coc_war_planner | coc_war_planner/wsgi.py | coc_war_planner/wsgi.py | """
WSGI config for coc_war_planner project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
application = get_wsgi_appl... | """
WSGI config for coc_war_planner project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJAN... | mit | Python |
f7844548869f38f707e6fb07c2d241e2ba6d89a6 | add graceful exit when keyboard interrupted | bcbwilla/skatewords | collector.py | collector.py | """ Define the class which listens to the twitter stream and run it. """
import sys
from tweepy import Stream, OAuthHandler
import sw_auth as swa
from skatewords import StdOutListener
# authorize bot
auth = OAuthHandler(swa.consumer_key, swa.consumer_secret)
auth.set_access_token(swa.access_token, swa.access_token_... | """ Define the class which listens to the twitter stream and run it. """
from tweepy import Stream, OAuthHandler
import sw_auth as swa
from skatewords import StdOutListener
# authorize bot
auth = OAuthHandler(swa.consumer_key, swa.consumer_secret)
auth.set_access_token(swa.access_token, swa.access_token_secret)
# r... | mit | Python |
985cefd81472069240b074423a831fe6031d6887 | FIX sale_available integration with delivery | it-projects-llc/website-addons,it-projects-llc/website-addons,it-projects-llc/website-addons | website_sale_available/controllers/website_sale_available.py | website_sale_available/controllers/website_sale_available.py | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.addons.website_sale.controllers.main import website_sale
class controller(website_sale):
@http.route(['/shop/confirm_order'], type='http', auth="public", website=True)
def confirm_order(self, **post):
res ... | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.addons.website_sale.controllers.main import website_sale
class controller(website_sale):
@http.route(['/shop/confirm_order'], type='http', auth="public", website=True)
def confirm_order(self, **post):
res ... | mit | Python |
e5ccd2a5e4a11a567720e481f9d5a8c70d331a8f | Update version to 0.13.1 | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | metadata.py | metadata.py | __name__ = "Augur"
__slug__ = "augur"
__url__ = "https://github.com/chaoss/augur"
__short_description__ = "Python 3 package for free/libre and open-source software community metrics & data collection"
__version__ = "0.13.1"
__release__ = "v0.13.1"
__license__ = "MIT"
__copyright__ = "CHAOSS & Augurlabs 2020"
| __name__ = "Augur"
__slug__ = "augur"
__url__ = "https://github.com/chaoss/augur"
__short_description__ = "Python 3 package for free/libre and open-source software community metrics & data collection"
__version__ = "0.13.0"
__release__ = "v0.13.0"
__license__ = "MIT"
__copyright__ = "CHAOSS & Augurlabs 2020"
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.