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 |
|---|---|---|---|---|---|---|---|---|
d14bb1d28651aedc1ba3c1dd8b80c2c7382f0639 | Refactor to Linter v2 API | incorrectusername/coala-bears,naveentata/coala-bears,naveentata/coala-bears,SanketDG/coala-bears,yash-nisar/coala-bears,kaustubhhiware/coala-bears,aptrishu/coala-bears,mr-karan/coala-bears,aptrishu/coala-bears,gs0510/coala-bears,chriscoyfish/coala-bears,coala/coala-bears,sounak98/coala-bears,horczech/coala-bears,incorr... | bears/c_languages/GNUIndentBear.py | bears/c_languages/GNUIndentBear.py | import platform
from shlex import split
from coalib.bearlib.abstractions.Linter import linter
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
@linter(executable="indent" if platform.system() != "Darwin" else "gindent",
use_stdin=True,
output_format='corrected',
diff_message="In... | import platform
from coalib.bearlib.abstractions.Lint import Lint
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.LocalBear import LocalBear
class GNUIndentBear(Lint, LocalBear):
executable = "indent" if platform.system() != "Darwin" else "gindent"
diff_message = "Indentation... | agpl-3.0 | Python |
a8413c1230dbd709c41c58fcc6835c7ee1049d46 | Remove erronous prints from form. | StephenSwat/eve_lunar_mining_organiser,StephenSwat/eve_lunar_mining_organiser | elmo/moon_tracker/forms.py | elmo/moon_tracker/forms.py | from django import forms
import csv
from io import StringIO
class BatchMoonScanForm(forms.Form):
data = forms.CharField(
widget=forms.Textarea(attrs={'class':'form-control monospace'}),
)
def clean(self):
cleaned_data = super(BatchMoonScanForm, self).clean()
if 'data' not in clea... | from django import forms
import csv
from io import StringIO
class BatchMoonScanForm(forms.Form):
data = forms.CharField(
widget=forms.Textarea(attrs={'class':'form-control monospace'}),
)
def clean(self):
cleaned_data = super(BatchMoonScanForm, self).clean()
if 'data' not in clea... | mit | Python |
3e7bd6d02a1d94c35fa4e0f7fec53a12429826e1 | add get_next_season_week see #89 | adamjmcgrath/fridayfilmclub,adamjmcgrath/fridayfilmclub,adamjmcgrath/fridayfilmclub,adamjmcgrath/fridayfilmclub | src/settings.py | src/settings.py | #!/usr/bin/python
#
# Copyright 2011 Friday Film Club. All Rights Reserved.
"""Main views of the Friday Film Club app."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
import os
import datetime
from dateutil import relativedelta
import math
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
STAR... | #!/usr/bin/python
#
# Copyright 2011 Friday Film Club. All Rights Reserved.
"""Main views of the Friday Film Club app."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
import os
import datetime
from dateutil import relativedelta
import math
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
STAR... | mpl-2.0 | Python |
9f2a880246c1aea61b3cb9feb21f3a58d38b219a | Add readonly_fields = ('score',) to TaskTakenAdmin | znick/anytask,znick/anytask,znick/anytask,znick/anytask | anytask/tasks/admin.py | anytask/tasks/admin.py | from tasks.models import Task, TaskTaken, TaskLog, TaskGroupRelations
from django.contrib import admin
import reversion
class TaskBaseAdmin(admin.ModelAdmin):
list_display = ('title', 'course', 'get_groups', 'weight', 'parent_task', 'score_max')
list_filter = ('groups', 'course', 'course__year__start_year')
... | from tasks.models import Task, TaskTaken, TaskLog, TaskGroupRelations
from django.contrib import admin
import reversion
class TaskBaseAdmin(admin.ModelAdmin):
list_display = ('title', 'course', 'get_groups', 'weight', 'parent_task', 'score_max')
list_filter = ('groups', 'course', 'course__year__start_year')
... | mit | Python |
e86e069dcf872d4e4209ff8c7475039db50bfb28 | update caps test | bird-house/emu | emu/tests/test_wps_caps.py | emu/tests/test_wps_caps.py | from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from emu.processes import processes
def test_wps_caps():
client = client_for(Service(processes=processes))
resp = client.get(service='wps', request='getcapabilities', version='1.0.0')
names = resp.xpa... | from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from emu.processes import processes
def test_wps_caps():
client = client_for(Service(processes=processes))
resp = client.get(service='wps', request='getcapabilities', version='1.0.0')
names = resp.xpa... | apache-2.0 | Python |
13c8d1ab9a90515b5a52fd8c4051c6ee50a0caea | Bump to version 0.3.0 | jrief/django-sass-processor,jrief/django-sass-processor | sass_processor/__init__.py | sass_processor/__init__.py | __version__ = '0.3.0'
| __version__ = '0.2.6'
| mit | Python |
637382673ec539172c9a3bb64b0bb5e1b9851f40 | fix windowsacces and security module | k-team/KHome,k-team/KHome,k-team/KHome | modules/window_sensor/local_module.py | modules/window_sensor/local_module.py | import module
import fields
import fields.sensor
import fields.io
import fields.persistant
import fields.syntax
class WindowSensor(module.Base):
update_rate = 10
class window(fields.syntax.Boolean,
fields.sensor.WindowsContact,
fields.io.Readable,
... | import module
import fields
import fields.sensor
import fields.io
import fields.persistant
import fields.syntax
class WindowSensor(module.Base):
update_rate = 10
class window(fields.syntax.Boolean, fields.sensor.WindowsContact, fields.io.Readable, fields.persistant.Volatile, fields.Base):
pass
| mit | Python |
7052eed48c7d9195720cfc380f03bfe89817bcfa | move things around to get static files working | JsonChiu/openrunlog,JsonChiu/openrunlog,JsonChiu/openrunlog,JsonChiu/openrunlog | app/main.py | app/main.py |
import orl_settings
import sys
import os
import mongoengine
from tornado import web, ioloop
config = orl_settings.ORLSettings()
settings = {
'debug': config.debug,
'cookie_secret': config.cookie_secret,
'template_path': 'templates/',
'static_path': os.path.join(os.path.dirname(os.path... |
import orl_settings
import sys
import os
import mongoengine
from tornado import web, ioloop
application = web.Application([
(r'/', 'home.HomeHandler'),
(r'/login', 'login.LoginHandler'),
(r'/logout', 'login.LogoutHandler'),
(r'/register', 'login.RegisterHandler'),
(r'/dashboard', 'dashboard.Dashb... | bsd-2-clause | Python |
9fd1b50789bd4a9343651f2b2684806fbad57a57 | Add env | yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado,yukirin/skel_tornado | app/main.py | app/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import binascii
import pathlib
import tornado.ioloop
import tornado.web
from tornado import gen
from tornado.escape import to_unicode
class TornadoApp(tornado.web.Application):
def __init__(self, env):
debug = True
traceback = True
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import binascii
import pathlib
import tornado.ioloop
import tornado.web
from tornado import gen
from tornado.escape import to_unicode
class TornadoApp(tornado.web.Application):
def __init__(self):
settings = {
'template_path': str(pathl... | mit | Python |
fa72f2e060a1e7d6d42fccf077570b723ae716b9 | complete draft of getting time serie data | ITHACA-org/gpm-accumul,ITHACA-org/gpm-accumul | gpm_repo/rain_chart.py | gpm_repo/rain_chart.py | import datetime
import h5py
import numpy as np
TEST_FILEPATH = r'G:\progetti\ITHACA\tribute\gpm-accumul\data\gpm_data\sample_rainoi.hdf5'
def get_rain_serie(lon, lat, duration):
lon_index = get_lon_index(lon)
lat_index = get_lat_index(lat)
loc_index = lon_index * 10000 + lat_index
delta_dur = date... | import datetime
import h5py
import numpy as np
TEST_FILEPATH = r'G:\progetti\ITHACA\tribute\gpm-accumul\data\gpm_data\sample_rainoi.hdf5'
def get_rain(lon, lat, duration):
lon_index = get_lon_index(lon)
lat_index = get_lat_index(lat)
loc_index = lon_index * 10000 + lat_index
delta_dur = datetime.t... | mit | Python |
a02c2fdb18b7f2fcb3c58b55653c13a6d36a30ed | Correct column names | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | luigi/tasks/eco/pgload_eco_code.py | luigi/tasks/eco/pgload_eco_code.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... | apache-2.0 | Python |
1f8edab750a30573994abe2834b56e09544647bf | support organizing by user_id | hsharrison/tweetstash | src/tweetstash/stash.py | src/tweetstash/stash.py | from abc import ABCMeta, abstractmethod
from pathlib import Path
import json
class Stash(metaclass=ABCMeta):
"""Abstract base class for tweetstash backends."""
@abstractmethod
def is_stashed(self, tweet_id):
pass
@abstractmethod
def stash(self, tweet):
pass
def stash_many(sel... | from abc import ABCMeta, abstractmethod
from pathlib import Path
import json
class Stash(metaclass=ABCMeta):
"""Abstract base class for tweetstash backends."""
@abstractmethod
def is_stashed(self, tweet_id):
pass
@abstractmethod
def stash(self, tweet):
pass
def stash_many(sel... | bsd-2-clause | Python |
ecdf7512e84351a784443e2912ad043cc15f668a | fix templatetags | dinoperovic/djangocms-blogit,dinoperovic/djangocms-blogit,dinoperovic/djangocms-blogit | blogit/templatetags/blogit_tags.py | blogit/templatetags/blogit_tags.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import template
from django.utils.six import string_types
from blogit.models import Post, Category
register = template.Library()
@register.assignment_tag(takes_context=True)
def get_posts(context, limit=None, category=None):
request =... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import template
from django.utils.six import string_types
from blogit.models import Post, Category
register = template.Library()
@register.assignment_tag
def get_posts(limit=None, category=None):
filters = {'active': True}
if cat... | bsd-3-clause | Python |
09eb51ecc48b7143bf89abec31e53b0cd4abb0cd | include rpcs in ipe metadata | DigitalGlobe/gbdxtools,DigitalGlobe/gbdxtools | gbdxtools/ipe/graph.py | gbdxtools/ipe/graph.py | import json
import requests
VIRTUAL_IPE_URL = "https://idahoapi.geobigdata.io/v1"
from gbdxtools.ipe.error import NotFound
def get_ipe_graph(conn, graph_id):
url = "{}/graph/{}".format(VIRTUAL_IPE_URL, graph_id)
req = conn.get(url)
if req.status_code == 200:
return req.json()
else:
ra... | import json
import requests
VIRTUAL_IPE_URL = "https://idahoapi.geobigdata.io/v1"
from gbdxtools.ipe.error import NotFound
def get_ipe_graph(conn, graph_id):
url = "{}/graph/{}".format(VIRTUAL_IPE_URL, graph_id)
req = conn.get(url)
if req.status_code == 200:
return req.json()
else:
ra... | mit | Python |
abed8a7c3ca6dabbadb0d36552bbd87d74092e1f | Fix for python3 | lqez/django-d2m | django_d2m/__init__.py | django_d2m/__init__.py | version_info = (0, 1, 4)
__version__ = VERSION = '.'.join(map(str, version_info))
from .d2m import queryset_to_model, list_to_model, dict_to_model
__all__ = ['queryset_to_model', 'list_to_model', 'dict_to_model']
| version_info = (0, 1, 4)
__version__ = VERSION = '.'.join(map(str, version_info))
from d2m import queryset_to_model, list_to_model, dict_to_model
__all__ = ['queryset_to_model', 'list_to_model', 'dict_to_model']
| mit | Python |
41b6a1ac9f1d4b478eb05305c8d37c0edbc1a146 | Use correct dict init for versions < 2.7 | arcticshores/django-pandas,sternb0t/django-pandas,perpetua1/django-pandas,chrisdev/django-pandas | django_pandas/utils.py | django_pandas/utils.py | # coding: utf-8
from django.core.cache import cache
from django.utils.encoding import force_text
def replace_from_choices(choices):
def inner(values):
return [choices.get(v, v) for v in values]
return inner
def get_base_cache_key(model):
return 'pandas_%s_%s_%%d_rendering' % (
model._me... | # coding: utf-8
from django.core.cache import cache
from django.utils.encoding import force_text
def replace_from_choices(choices):
def inner(values):
return [choices.get(v, v) for v in values]
return inner
def get_base_cache_key(model):
return 'pandas_%s_%s_%%d_rendering' % (
model._me... | bsd-3-clause | Python |
4925deab0b57bf421bdbb9c34851b0d0614692f0 | add test method for bernoulli environment. add doc strings for both methods | okkhoy/minecraft-rl | environments/BernoulliEnvironment.py | environments/BernoulliEnvironment.py | """
Created on May 7, 2017
@author: Akshay Narayan
This code is shared under The MIT License
-----------------------------------------
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated document... | """
Created on May 7, 2017
@author: Akshay Narayan
This code is shared under The MIT License
-----------------------------------------
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated document... | mit | Python |
072b4ff4740ae72a777f62426290a3a8aed5bf99 | fix bcm factory bug | a10networks/a10-neutron-lbaas,a10networks/a10-neutron-lbaas,hthompson6/a10-neutron-lbaas,Cedev/a10-neutron-lbaas,hthompson6/a10-neutron-lbaas,dougwig/a10-neutron-lbaas,Cedev/a10-neutron-lbaas,dougwig/a10-neutron-lbaas | a10_neutron_lbaas/v2/neutron_ops.py | a10_neutron_lbaas/v2/neutron_ops.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | Python |
efb51b23b1dce63e493e47ffebc78dc1181981f2 | Update version 0.9.0.dev2 -> 0.9.0.dev3 | dwavesystems/dimod,dwavesystems/dimod | dimod/package_info.py | dimod/package_info.py | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | Python |
3956327aa3ba0db902bfcf079420642fb7d2546d | Fix Oron Account plugin `loadAccountInfo` signature | pyblub/pyload,pyblub/pyload | module/plugins/accounts/OronCom.py | module/plugins/accounts/OronCom.py | # -*- coding: utf-8 -*-
"""
This program 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 later version.
This program is distributed in... | # -*- coding: utf-8 -*-
"""
This program 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 later version.
This program is distributed in... | agpl-3.0 | Python |
41d1290c38f997424c459c6984a86521e09f01c2 | use "shared_task" | Hipo/django-sloop,Hipo/django-sloop | django_sloop/tasks.py | django_sloop/tasks.py | from celery import shared_task
from .utils import get_device_model
@shared_task()
def send_push_notification(device_id, message, url, badge_count, sound, extra, category, **kwargs):
"""
Sends a push notification message to the specified tokens
"""
device_model = get_device_model()
device = device... | from celery.task import task
from .utils import get_device_model
@task()
def send_push_notification(device_id, message, url, badge_count, sound, extra, category, **kwargs):
"""
Sends a push notification message to the specified tokens
"""
device_model = get_device_model()
device = device_model.ob... | apache-2.0 | Python |
da2bd49814f8494038f4937aeabde26139e93722 | update tests | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq | corehq/apps/domain/tests/test_domain_name_generation.py | corehq/apps/domain/tests/test_domain_name_generation.py | from __future__ import print_function, unicode_literals
from django.test import TestCase
from django.test.testcases import SimpleTestCase
from corehq.apps.domain.exceptions import NameUnavailableException
from corehq.apps.domain.models import Domain
from corehq.apps.domain.utils import get_domain_url_slug
from corehq... | from __future__ import print_function, unicode_literals
from django.test import TestCase
from django.test.testcases import SimpleTestCase
from corehq.apps.domain.exceptions import NameUnavailableException
from corehq.apps.domain.models import Domain
from corehq.apps.domain.utils import get_domain_url_slug
from corehq... | bsd-3-clause | Python |
f4aedf0516dfe2d93db78ec7d4ecf18953e869db | Fix migration script | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/export/migrations/0005_datafile_blobmeta.py | corehq/apps/export/migrations/0005_datafile_blobmeta.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-03 17:32
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.blobs import CODES
from corehq.sql_db.operations import HqRunPython
from corehq.sql_db.util import get_db_alias_for_part... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-03 17:32
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.blobs import CODES
from corehq.sql_db.operations import HqRunPython
from corehq.sql_db.util import get_db_alias_for_part... | bsd-3-clause | Python |
71873250bc92a65796a0c7cafb0483b04db525da | configure production beanstalk to use arbitrary RDS database | 4dn-dcic/fourfront,4dn-dcic/fourfront,hms-dbmi/fourfront,hms-dbmi/fourfront,hms-dbmi/fourfront,hms-dbmi/fourfront,4dn-dcic/fourfront,4dn-dcic/fourfront,hms-dbmi/fourfront | deploy/set_beanstalk_config.py | deploy/set_beanstalk_config.py | '''
take environment variables for postgresql and
ensure that get into production.ini
'''
import os
import subprocess
def dbconn_from_env():
if 'RDS_DB_NAME' in os.environ:
override_prefix_name = "RDS"
if (os.environ.get("$ENV_NAME","") == "PROD"):
prfx = "bnSTaLk"
db = os.envi... | '''
take environment variables for postgresql and
ensure that get into production.ini
'''
import os
import subprocess
def dbconn_from_env():
if 'RDS_DB_NAME' in os.environ:
db = os.environ['RDS_DB_NAME']
user = os.environ['RDS_USERNAME']
pwd = os.environ['RDS_PASSWORD']
host = os.e... | mit | Python |
22eda7c2b844c9dccb31ad9cce882cc13d1adf75 | Add name to patterns in urlpatterns | apel/rest,apel/rest | apel_rest/urls.py | apel_rest/urls.py | """This file maps url patterns to classes."""
from django.conf.urls import patterns, include, url
from django.contrib import admin
from api.views.CloudRecordSummaryView import CloudRecordSummaryView
from api.views.CloudRecordView import CloudRecordView
admin.autodiscover()
urlpatterns = patterns('',
... | """This file maps url patterns to classes."""
from django.conf.urls import patterns, include, url
from django.contrib import admin
from api.views.CloudRecordSummaryView import CloudRecordSummaryView
from api.views.CloudRecordView import CloudRecordView
admin.autodiscover()
urlpatterns = patterns('',
... | apache-2.0 | Python |
99321c9110ac2b02f8cf7a543ce72391ec61e08c | test for historic stops | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | integration-test/661-historic-transit-stops.py | integration-test/661-historic-transit-stops.py | # Check if historic stops are shown in pois and in transit layers.
# Historic railway stop
# https://www.openstreetmap.org/node/3039734894
assert_no_matching_feature(
13, 2412, 3081, 'pois',
{'id': 3039734894})
# Historic tram stop
# http://www.openstreetmap.org/node/413573669
assert_no_matching_feature(
... | # Check if historic stops are shown in pois and in transit layers.
# Historic railway stop
# https://www.openstreetmap.org/node/3039734894
assert_no_matching_feature(
13, 2412, 3081, 'pois',
{'id': 3039734894})
# Historic tram stop
# http://www.openstreetmap.org/node/413573669
assert_no_matching_feature(
... | mit | Python |
e081e9cfd49b9850819f95dab123a6ea4517389f | Remove `xrange` in doosabin/verification/evaluation.py | rstebbing/subdivision,rstebbing/subdivision | doosabin/verification/evaluation.py | doosabin/verification/evaluation.py | # evaluation.py
# Imports
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import doosabin
from common import example_extraordinary_patch
# main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('N', nargs='?', type=int, default=6)
... | # evaluation.py
# Imports
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import doosabin
from common import example_extraordinary_patch
# main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('N', nargs='?', type=int, default=6)
... | mit | Python |
ad78de49c8ed0f8c766d3098ceaa07dd60ddc865 | Change name of constant to match code. | lifted-studios/AutoCopyright,lifted-studios/AutoCopyright | constants.py | constants.py | #
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
ERROR_MISSING_OWNER = 'Default copyright owner not set. Please edit the settings file to correct this.'
LINE_ENDING_UNIX = 'Unix'
LINE_ENDING_WINDOWS = 'Windows'
PLUGIN_NAME = 'AutoCopyright'
SETTING_COPYRIGHT_MESSAGE = 'copyright message'
SETTING_OW... | #
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
ERROR_MISSING_OWNERS = 'Default copyright owner not set. Please edit the settings file to correct this.'
LINE_ENDING_UNIX = 'Unix'
LINE_ENDING_WINDOWS = 'Windows'
PLUGIN_NAME = 'AutoCopyright'
SETTING_COPYRIGHT_MESSAGE = 'copyright message'
SETTING_O... | mit | Python |
27039ff9892a54477672598d1b63a5b8671be6fa | Adjust search width config | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ab_game.py | ab_game.py | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | mit | Python |
d2ce7b64c14e18ca395a2d1dc03123ae8a5735b7 | Enable min_priority again - seems to be working? | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ab_game.py | ab_game.py | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | #!/usr/bin/python
import board
import pente_exceptions
from ab_state import *
CAPTURE_SCORE_BASE = 120 ** 3
class ABGame():
""" This class acts as a bridge between the AlphaBeta code and my code """
def __init__(self, base_game):
s = self.current_state = ABState()
s.set_state(base_game.curre... | mit | Python |
04acce90e4799353352c20b96b1896512e35c770 | Add packageGroups() to dqpackages.py | pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality | iatidq/dqpackages.py | iatidq/dqpackages.py |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | agpl-3.0 | Python |
724455bdfe534e15e01444a2a7836a7b4d4d2a91 | Add -b option and sleep shorter. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Demo/sockets/mcast.py | Demo/sockets/mcast.py | # Send/receive UDP multicast packets (SGI)
# After /usr/people/4Dgifts/examples/network/mcast.c
# Usage:
# mcast -s (sender)
# mcast -b (sender, using broadcast instead multicast)
# mcast (receivers)
MYPORT = 8123
MYGROUP_BYTES = 225, 0, 0, 250
import sys
import time
import struct
from socket import *
from S... | # Send/receive UDP multicast packets (SGI)
# After /usr/people/4Dgifts/examples/network/mcast.c
# Usage:
# mcast -s (sender)
# mcast (receivers)
MYPORT = 8123
MYGROUP_BYTES = 225, 0, 0, 250
import sys
import time
import struct
from socket import *
from SOCKET import *
from IN import *
sender = (sys.argv[1:2] ... | mit | Python |
74d3bc21d7e8f362765c8087f6c30632f63a4107 | Add version_info >= 3.3 case to import_file | ErwinJanssen/dymport.py | dymport/import_file.py | dymport/import_file.py | """
Various functions to dynamically import (abitrary names from) arbitrary files.
To import a file like it is a module, use `import_file`.
"""
from sys import version_info
def import_file(name, file):
"""
Import `file` as a module with _name_.
Raises an ImportError if it could not be imported.
"""... | """
Various functions to dynamically import (abitrary names from) arbitrary files.
To import a file like it is a module, use `import_file`.
"""
from sys import version_info
def import_file(name, file):
"""
Import `file` as a module with _name_.
Raises an ImportError if it could not be imported.
"""... | mit | Python |
e9c8a44f594f414cf502b6315e54b893d87f3edb | Fix hash sorter | blixt/py-starbound,6-lasers/py-starbound | export.py | export.py | #!/usr/bin/env python
import hashlib
import optparse
import os
import sys
import starbound
def path_key(path):
return hashlib.sha256(path.encode('utf-8')).digest()
def main():
p = optparse.OptionParser()
p.add_option('-d', '--destination', dest='path',
help='Destination directory')
... | #!/usr/bin/env python
import optparse
import os
import sys
import starbound
def path_key(path):
# TODO: If Starbound fixes their SHA-256 algorithm, switch to hashlib.
return starbound.sha256(path.encode('utf-8')).digest()
def main():
p = optparse.OptionParser()
p.add_option('-d', '--destination', de... | mit | Python |
ac77b36b4d81224f8f61ff9eea591f3a1aa5bec9 | solve translate string error | alqfahad/odoo,Nowheresly/odoo,hopeall/odoo,stephen144/odoo,ramadhane/odoo,MarcosCommunity/odoo,demon-ru/iml-crm,bakhtout/odoo-educ,salaria/odoo,hopeall/odoo,Drooids/odoo,sv-dev1/odoo,arthru/OpenUpgrade,naousse/odoo,ojengwa/odoo,kittiu/odoo,dgzurita/odoo,draugiskisprendimai/odoo,zchking/odoo,nagyistoce/odoo-dev-odoo,pat... | addons/base_module_quality/wizard/module_quality_check.py | addons/base_module_quality/wizard/module_quality_check.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | Python |
6d4a3485ccdce855b9e9aeedac73b5534f1f26a8 | Bump version number to 0.0.7 | Alexis-benoist/CaTeX | catex/version.py | catex/version.py | version = '0.0.7' | version = '0.0.6' | apache-2.0 | Python |
1a4d15ca137ad9c09fc474500303142e118335ff | Change the sample command. | cloudpipe/cloudpipe,cloudpipe/cloudpipe,cloudpipe/cloudpipe | script/sample/submitshell.py | script/sample/submitshell.py | #!/usr/bin/env python
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/api')
jid = multyvac.shell_submit(cmd='for i in {1..10}; do echo $i && sleep 10; done')
print("Submitted job [{}].".format(jid))
job = multyvac.get(jid)
result = job.get_result()
print(... | #!/usr/bin/env python
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/api')
jid = multyvac.shell_submit(cmd='id')
print("Submitted job [{}].".format(jid))
job = multyvac.get(jid)
result = job.get_result()
print("Result: [{}]".format(result))
| bsd-3-clause | Python |
2c880e949664d3c31f37b6f13c46c0137f11b273 | Change to django 1.10 | allan-simon/taiga-contrib-ping-federate-auth,allan-simon/taiga-contrib-ping-federate-auth | back/taiga_contrib_ping_federate_auth/apps.py | back/taiga_contrib_ping_federate_auth/apps.py | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Allan Simon <allan.simon@supinfo.com>
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# ... | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Allan Simon <allan.simon@supinfo.com>
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | Python |
4d85cc01680a6ecf3fcdf2d966734f194294888d | use flake always, as it it's better and depends on pep8 anyways. | pebete/pbt,pebete/pbt | plugins/check/main.py | plugins/check/main.py | """The check plugin: your best friend and your worst nightmare"""
import pbt
# flake8 is more complete than pep8, and depends on it anyways
import flake8.engine
@pbt.command(name="check")
def main(ctx, args, prj):
"""Checks the project with some checkers, like pep8 or pylint."""
check_pep8(ctx, args, prj)
d... | """The check plugin: your best friend and your worst nightmare"""
import pbt
@pbt.command(name="check")
def main(ctx, args, prj):
"""Checks the project with some checkers, like pep8 or pylint."""
check_pep8(ctx, args, prj)
def check_pep8(ctx, args, prj):
"""The pepocher"""
try:
# flake8 seem... | apache-2.0 | Python |
8bd5778d571195ff2ded1b31bc644352215a81f7 | Rename email: to item: | zarafagroupware/python-zarafa,zarafagroupware/python-zarafa,hoffie/python-zarafa | scripts/delete_olditems.py | scripts/delete_olditems.py | #!/usr/bin/env python
import zarafa
from MAPI.Util import *
from types import *
import datetime
import time
import sys
def opt_args():
parser = zarafa.parser('skpcufm')
parser.add_option('-v','--verbose', dest='verbose', action='store_true', help='enable verbose mode')
return parser.parse_args()
def getM... | #!/usr/bin/env python
import zarafa
from MAPI.Util import *
from types import *
import datetime
import time
import sys
def opt_args():
parser = zarafa.parser('skpcufm')
parser.add_option('-v','--verbose', dest='verbose', action='store_true', help='enable verbose mode')
return parser.parse_args()
def getM... | agpl-3.0 | Python |
d74180a340989a5a06e74d51368b6c4c8ef1f265 | Fix Shifting Sands example (#34) | a5kin/hecate,a5kin/hecate | examples/shifting_sands.py | examples/shifting_sands.py | """
Factitious CA to test non-uniform buffer interactions.
Experiment classes included.
"""
from xentica import core
from xentica import seeds
from xentica.core import color_effects
class ShiftingSands(core.CellularAutomaton):
"""
CA for non-uniform buffer interactions test.
It emits the whole value to... | """
Factitious CA to test non-uniform buffer interactions.
Experiment classes included.
"""
from xentica import core
from xentica import seeds
from xentica.core import color_effects
class ShiftingSands(core.CellularAutomaton):
"""
CA for non-uniform buffer interactions test.
It emits the whole value to... | mit | Python |
77c6de769678f1b158aea753910f1f6b6afa64a3 | Add form errors as messages | taedori81/shoop,jorge-marques/shoop,hrayr-artunyan/shuup,taedori81/shoop,taedori81/shoop,akx/shoop,suutari-ai/shoop,shawnadelic/shuup,suutari-ai/shoop,suutari/shoop,akx/shoop,jorge-marques/shoop,shoopio/shoop,shoopio/shoop,suutari/shoop,shoopio/shoop,suutari-ai/shoop,shawnadelic/shuup,shawnadelic/shuup,akx/shoop,hrayr-... | shoop/admin/modules/shops/views/edit.py | shoop/admin/modules/shops/views/edit.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import settings
fr... | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import settings
fr... | agpl-3.0 | Python |
e15ce0b8a037422a657e0b5c4de89432a8fc821a | add type for arg | adrn/StreamMorphology,adrn/StreamMorphology,adrn/StreamMorphology | scripts/ensemble/status.py | scripts/ensemble/status.py | # coding: utf-8
""" Check the status of frequency mapping. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
from streammorphology.ensemble import read_allkld
def main(path, nkld):
# read allfreqs into structured array
d = read_allkld(path, nkld=nkld)
nd... | # coding: utf-8
""" Check the status of frequency mapping. """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
from streammorphology.ensemble import read_allkld
def main(path, nkld):
# read allfreqs into structured array
d = read_allkld(path, nkld=nkld)
nd... | mit | Python |
76600b63940da9322673ce6cd436129a7d65f10d | Add import statement for os | manpen/thrill,manpen/thrill,manpen/thrill,manpen/thrill,manpen/thrill | scripts/ec2/terminate_all.py | scripts/ec2/terminate_all.py | #!/usr/bin/env python
##########################################################################
# scripts/ec2/terminate_all.py
#
# Part of Project Thrill - http://project-thrill.org
#
# Copyright (C) 2015 Timo Bingmann <tb@panthema.net>
#
# All rights reserved. Published under the BSD-2 license in the LICENSE file.
##... | #!/usr/bin/env python
##########################################################################
# scripts/ec2/terminate_all.py
#
# Part of Project Thrill - http://project-thrill.org
#
# Copyright (C) 2015 Timo Bingmann <tb@panthema.net>
#
# All rights reserved. Published under the BSD-2 license in the LICENSE file.
##... | bsd-2-clause | Python |
c64f8f1cc0f14705a67bb9e6c708acf05d71db72 | Improve Result.args_str - handle dicts & convert values to str | wylee/runcommands,wylee/runcommands | runcommands/result.py | runcommands/result.py | import os
from subprocess import CompletedProcess
from typing import Mapping
from .exc import RunCommandsError
from .util import cached_property
class Result(RunCommandsError):
def __init__(self, args, return_code, stdout, stderr):
self.args = args
self.return_code = return_code
self.std... | import os
from subprocess import CompletedProcess
from .exc import RunCommandsError
from .util import cached_property
class Result(RunCommandsError):
def __init__(self, args, return_code, stdout, stderr):
self.args = args
self.args_str = args if isinstance(args, str) else ' '.join(args)
... | mit | Python |
afe5d9bbe6900b8a171f8136b704bf7d74d487f6 | Support the new clang-db format too | nyalldawson/clazy,nyalldawson/clazy,nyalldawson/clazy,nyalldawson/clazy | scripts/fix_json_database.py | scripts/fix_json_database.py | #!/usr/bin/env python2
# This file is part of the clazy static checker.
# Copyright (C) 2017 Sergio Martins <smartins@kde.org>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
... | #!/usr/bin/env python2
# This file is part of the clazy static checker.
# Copyright (C) 2017 Sergio Martins <smartins@kde.org>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
... | lgpl-2.1 | Python |
0ebc564f5a4fb7ee622595d7df6a9a9e48269ec8 | define from interface object from manager | mjdorma/pyvbox | virtualbox/library_ext/__init__.py | virtualbox/library_ext/__init__.py | import inspect
import virtualbox
from virtualbox import library
"""
This module is responsible for shimming out the auto generated libraries found
under librar.py. The intension for the extension classes is to fix up or
improve on the default COM API behaviour and auto generated Python library
file when interact... | import inspect
import virtualbox
from virtualbox import library
"""
This module is responsible for shimming out the auto generated libraries found
under librar.py. The intension for the extension classes is to fix up or
improve on the default COM API behaviour and auto generated Python library
file when interact... | apache-2.0 | Python |
e5eb6ad4aebcdfc42120be6bec81cdf80065e5b5 | add debug | leonwolfus/masterbrick,leonwolfus/masterbrick,leonwolfus/masterbrick,leonwolfus/masterbrick | wagtaildemo/settings/production.py | wagtaildemo/settings/production.py | from .base import *
DEBUG = False
env = os.environ.copy()
SECRET_KEY = env['SECRET_KEY']
DEBUG = env['DEBUG']
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACK... | from .base import *
DEBUG = False
env = os.environ.copy()
SECRET_KEY = env['SECRET_KEY']
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'INDEX': 'wagtaildemo'
}
}
CACHES = {
'default': {
'BACKEND': 'redis_cache.ca... | bsd-3-clause | Python |
02a46a3626986366be1903a95ee5cbdd0a75006f | Update __init__.py | qpxu007/Flask-AppBuilder,rpiotti/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,rpiotti/Flask-AppBuilder,rpiotti/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,qpxu007/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,qpxu007/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,rpiotti/Flask-AppBuilder,zhounansh... | examples/quickimages/app/__init__.py | examples/quickimages/app/__init__.py | import os
import logging
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.engine import Engine
from sqlalchemy import event
from config import basedir
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
logging.basicConfig(format='%(asctime)s:%(levelname)s:%... | import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.engine import Engine
from sqlalchemy import event
from config import basedir
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
@event.listens_for(Engine, "connect")
def set_sqlite_pragma(dbapi_con... | bsd-3-clause | Python |
103666777ace091d6f04db794f34016c427d9e6c | refactor assembly benchmark run command | michaelbarton/command-line-interface,pbelmann/command-line-interface,pbelmann/command-line-interface,bioboxes/command-line-interface,bioboxes/command-line-interface,michaelbarton/command-line-interface | biobox_cli/biobox_type/assembler_benchmark.py | biobox_cli/biobox_type/assembler_benchmark.py | """
Usage:
biobox run assembler_benchmark <image> [--no-rm] --input-fasta=FILE --input-ref=DIR --output=FILE [--task=TASK]
Options:
-h, --help Show this screen.
-v, --version Show version.
-if FILE, --input-fasta=FILE Source FASTA file
-ir DIR, --input-ref=DIR S... | """
Usage:
biobox run assembler_benchmark <image> --input-fasta=FILE --input-ref=DIR --output=FILE [--task=TASK]
Options:
-h, --help Show this screen.
-v, --version Show version.
-if FILE, --input-fasta=FILE Source FASTA file
-ir DIR, --input-ref=DIR Source dire... | mit | Python |
37a6749e1d688e3cf701b6a8d6ae892986c10a0f | Remove the help test until we can style it better. | paulcwatts/1hph,paulcwatts/1hph,paulcwatts/1hph | gonzo/account/forms.py | gonzo/account/forms.py | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from gonzo import settings
from gonzo.account.models import Profile
class UserCreationFormWithEmail(UserCreationForm):
error_css_class = 'error'
required_css_class = 'required'
emai... | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from gonzo import settings
from gonzo.account.models import Profile
class UserCreationFormWithEmail(UserCreationForm):
error_css_class = 'error'
required_css_class = 'required'
emai... | bsd-3-clause | Python |
fd4e237f87bdbac1a42f180371992f153f6a249d | remove TODO comments | architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS | cea/reporting.py | cea/reporting.py | """
===============================
Functions for Report generation
===============================
File history and credits:
G. Happle ... 13.05.2016
D. Thomas, 18.05.2016: refactoring
"""
import pandas as pd
import datetime
import xlwt
import os
def full_report_to_xls(template, variables, output_folder, basename... | """
===============================
Functions for Report generation
===============================
File history and credits:
G. Happle ... 13.05.2016
D. Thomas, 18.05.2016: refactoring
"""
import pandas as pd
import datetime
import xlwt
import os
def full_report_to_xls(template, variables, output_folder, basename... | mit | Python |
7605385a113536cbf9e35479fc58878beddc2f6a | fix indentation | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | fbmsgbot/models/receipt.py | fbmsgbot/models/receipt.py | from attachment import Element
required_properties = {
'price',
}
class ReceiptElement(Element):
def __init__(self, quantity=None, price=None,
currency="CAD", **kwargs):
self.kwargs = kwargs
super(ReceiptElement, self).__init__(**self.kwargs)
if pric... | from attachment import Element
required_properties = {
'price',
}
class ReceiptElement(Element):
def __init__(self, quantity=None, price=None,
currency="CAD", **kwargs):
self.kwargs = kwargs
super(ReceiptElement, self).__init__(**self.kwargs)
if pric... | mit | Python |
4156d1412bcbd963604bddd8687d31a568541e42 | remove six | UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator | incubator/hashers.py | incubator/hashers.py | import hashlib
from collections import OrderedDict
from django.utils.crypto import get_random_string
from django.contrib.auth.hashers import BasePasswordHasher
from django.utils.crypto import constant_time_compare
from django.contrib.auth.hashers import mask_hash
class MediaWikiHasher(BasePasswordHasher):
"""
... | import hashlib
from collections import OrderedDict
from django.utils.crypto import get_random_string
from django.contrib.auth.hashers import BasePasswordHasher
from django.utils.crypto import constant_time_compare
from django.contrib.auth.hashers import mask_hash
from django.utils import six
class MediaWikiHasher(Bas... | agpl-3.0 | Python |
b611edc590765be7c4dc73dabbdd9c6718b5bec4 | add type args | congminghaoxue/learn_python | change_pic_px.py | change_pic_px.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-08-23 18:48:00
# @Author : Zhou Bo (zhoub@suooter.com)
# @Link : http://onlyus.online
#function: 更改图片尺寸大小
import os
import os.path
import sys, getopt, argparse
from PIL import Image
def ResizeImage(filein, fileout, width, height, type):
'''
fi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-08-23 18:48:00
# @Author : Zhou Bo (zhoub@suooter.com)
# @Link : http://onlyus.online
#function: 更改图片尺寸大小
import os
import os.path
import sys, getopt, argparse
from PIL import Image
def ResizeImage(filein, fileout, width, height, type):
'''
fi... | apache-2.0 | Python |
cd48fd055df961a08c0fa7365b65b99d5c81e98d | Handle nonexistant mountpoint in `find_mountpoint` | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/snippet/mountpoint_service.py | byceps/services/snippet/mountpoint_service.py | """
byceps.services.snippet.mountpoint_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional, Set
from ...database import db
from ..site.transfer.models import SiteID
from .models.mountpoi... | """
byceps.services.snippet.mountpoint_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Optional, Set
from ...database import db
from ..site.transfer.models import SiteID
from .models.mountpoi... | bsd-3-clause | Python |
1a166c0fb5316d6e4bcd5cc65f139fad8af50bce | Update URL to calculator server | BiohZn/Cardinal,JohnMaguire/Cardinal | plugins/calculator/plugin.py | plugins/calculator/plugin.py | import sys
import json
import urllib
import urllib2
import logging
MATHJS_API = "http://math.leftforliving.com"
class CalculatorPlugin(object):
logger = None
"""Logging object for CalculatorPlugin"""
def __init__(self):
# Initialize logging
self.logger = logging.getLogger(__name__)
d... | import sys
import json
import urllib
import urllib2
import logging
class CalculatorPlugin(object):
logger = None
"""Logging object for CalculatorPlugin"""
def __init__(self):
# Initialize logging
self.logger = logging.getLogger(__name__)
def calculate(self, cardinal, user, channel, ms... | mit | Python |
c514f8b71a424a8c342228fe17834b9d16cce89d | Add method for clearing input | pkronstrom/intercom | client.py | client.py | from pymumble.pymumble_py3 import Mumble, constants
import alsaaudio
class MumbleClient:
def __init__(self, config):
debug = int(config['debug']) == 1
self.mumble = Mumble(config['host'], config['user'], debug=debug)
self.mumble.start()
self.mumble.is_ready()
self.mumble.se... | from pymumble.pymumble_py3 import Mumble, constants
import alsaaudio
class MumbleClient:
def __init__(self, config):
debug = int(config['debug']) == 1
self.mumble = Mumble(config['host'], config['user'], debug=debug)
self.mumble.start()
self.mumble.is_ready()
self.mumble.se... | mit | Python |
63560607add8fd84d95eb86207045e489f9b19f7 | fix mediawiki-comment | jpope777/searx,gugod/searx,jpope777/searx,gugod/searx,PwnArt1st/searx,dalf/searx,PwnArt1st/searx,asciimoo/searx,potato/searx,matejc/searx,dzc34/searx,gugod/searx,jcherqui/searx,misnyo/searx,kdani3/searx,pointhi/searx,misnyo/searx,asciimoo/searx,potato/searx,potato/searx,framasoft/searx,jcherqui/searx,framasoft/searx,ji... | searx/engines/mediawiki.py | searx/engines/mediawiki.py | ## general mediawiki-engine (Web)
#
# @website websites built on mediawiki (https://www.mediawiki.org)
# @provide-api yes (http://www.mediawiki.org/wiki/API:Search)
#
# @using-api yes
# @results JSON
# @stable yes
# @parse url, title
#
# @todo content
from json import loads
from urllib i... | ## Wikipedia (Web)
#
# @website http://www.wikipedia.org
# @provide-api yes (http://www.mediawiki.org/wiki/API:Search)
#
# @using-api yes
# @results JSON
# @stable yes
# @parse url, title
#
# @todo content
from json import loads
from urllib import urlencode, quote
# engine dependent con... | agpl-3.0 | Python |
eaa1eb7050a917320091e45d6deed6f6146373d8 | Extend import statement to support Python 3 | plotly/dash-core-components | dash_core_components/__init__.py | dash_core_components/__init__.py | import os as _os
import dash as _dash
import sys as _sys
from .version import __version__
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
'dash_core_components'
)
_this_module = _sys.... | import os as _os
import dash as _dash
import sys as _sys
from version import __version__
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
'dash_core_components'
)
_this_module = _sys.m... | mit | Python |
00c714977ae0b3baa7930ab899bae6f808a0afae | fix contract lookup field | hacklabr/django-discussion,hacklabr/django-discussion,hacklabr/django-discussion | discussion/admin.py | discussion/admin.py | from django.contrib import admin
from discussion.models import Category, Forum, Topic, Comment, Tag, TopicNotification
class TopicAdmin(admin.ModelAdmin):
search_fields = ['title', 'content']
class ForumAdmin(admin.ModelAdmin):
list_filter = ['groups__contract']
admin.site.register(Category)
admin.site.reg... | from django.contrib import admin
from discussion.models import Category, Forum, Topic, Comment, Tag, TopicNotification
class TopicAdmin(admin.ModelAdmin):
search_fields = ['title', 'content']
class ForumAdmin(admin.ModelAdmin):
list_filter = ['groups__contracts']
admin.site.register(Category)
admin.site.re... | agpl-3.0 | Python |
2d64c01daebd918c3e6196b1eb3ad62f105c56e0 | Make this Python 2.x compatible | danpalmer/django-google-charts,danpalmer/django-google-charts | django_google_charts/charts.py | django_google_charts/charts.py | import six
import json
from django.core.urlresolvers import reverse
from django.utils.html import format_html, mark_safe
from django.utils.encoding import python_2_unicode_compatible
CHARTS = {}
class ChartMeta(type):
def __new__(cls, name, bases, attrs):
klass = super(ChartMeta, cls).__new__(cls, name, ... | import six
import json
from django.core.urlresolvers import reverse
from django.utils.html import format_html, mark_safe
CHARTS = {}
class ChartMeta(type):
def __new__(cls, name, bases, attrs):
klass = super(ChartMeta, cls).__new__(cls, name, bases, attrs)
if klass.chart_slug:
CHARTS... | mit | Python |
947f8d3855ef5a71bbb8726aa73d0694cb8a3416 | Prepend assets dict keys with './' to match filenames in XML | deepmind/dm_control | dm_control/suite/common/__init__.py | dm_control/suite/common/__init__.py | # Copyright 2017 The dm_control 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 i... | # Copyright 2017 The dm_control 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 i... | apache-2.0 | Python |
0bcecfdf33f42f85bb9a8e32e79686a41fb5226a | Fix Validation import error in older DRF. | romain-li/django-validator,romain-li/django-validator | django_validator/exceptions.py | django_validator/exceptions.py | from rest_framework import status
import rest_framework.exceptions
class ValidationError(rest_framework.exceptions.APIException):
code = ''
def __init__(self, detail, code=None, status_code=status.HTTP_400_BAD_REQUEST):
super(ValidationError, self).__init__(detail)
self.code = code
se... | from rest_framework import status
import rest_framework.exceptions
class ValidationError(rest_framework.exceptions.ValidationError):
code = ''
def __init__(self, detail, code=None, status_code=status.HTTP_400_BAD_REQUEST):
super(ValidationError, self).__init__(detail)
self.status_code = statu... | mit | Python |
c304834e459f2536e788e845178de46551e1d7b0 | Add missing import | honnibal/spaCy,aikramer2/spaCy,recognai/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,banglakit/spaCy,recognai/spaCy,aikramer2/spaCy,oroszgy/spaCy.hu,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,aikramer2/spaCy,oroszgy/spaCy.hu,b... | spacy/tests/regression/test_issue792.py | spacy/tests/regression/test_issue792.py | # coding: utf-8
from __future__ import unicode_literals
import pytest
@pytest.mark.xfail
@pytest.mark.parametrize('text', ["This is a string ", "This is a string\u0020"])
def test_issue792(en_tokenizer, text):
"""Test for Issue #792: Trailing whitespace is removed after parsing."""
doc = en_tokenizer(text)
... | # coding: utf-8
from __future__ import unicode_literals
@pytest.mark.xfail
@pytest.mark.parametrize('text', ["This is a string ", "This is a string\u0020"])
def test_issue792(en_tokenizer, text):
"""Test for Issue #792: Trailing whitespace is removed after parsing."""
doc = en_tokenizer(text)
assert(doc.t... | mit | Python |
0caca6ce9b2dcb8b5136ef3d238caa69e7e9bffd | bump version (#103) | edx/edx-submissions,edx/edx-submissions | submissions/__init__.py | submissions/__init__.py | __version__ = u'3.0.2'
| __version__ = u'3.0.1'
| agpl-3.0 | Python |
c76467ac53c2173f94946db8a03e15b7cf5a9d89 | Update __openerp__.py | gfcapalbo/website,LasLabs/website,pedrobaeza/website,open-synergy/website,Yajo/website,Yajo/website,LasLabs/website,Endika/website,kaerdsar/website,gfcapalbo/website,nuobit/website,open-synergy/website,open-synergy/website,kaerdsar/website,nuobit/website,pedrobaeza/website,gfcapalbo/website,Yajo/website,nuobit/website,... | website_portal_sale/__openerp__.py | website_portal_sale/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Website Portal for Sales',
'category': 'Website',
'summary': (
'Add your sales document in the frontend portal (sales order'
', quotations, invoices)'
),
'version': '8.0.1.0.0',
'author': 'Odoo SA, '
'MONK Software, '
... | # -*- coding: utf-8 -*-
{
'name': 'Website Portal for Sales',
'category': 'Website',
'summary': (
'Add your sales document in the frontend portal (sales order'
', quotations, invoices)'
),
'version': '8.0.1.0.0',
'author': 'Odoo SA, '
'MONK Software, '
... | agpl-3.0 | Python |
5b8a73c4d190ac011c0419f646c5a0832d208bc0 | remove prevasive | eladhoffer/seq2seq.pytorch,eladhoffer/seq2seq.pytorch | seq2seq/models/__init__.py | seq2seq/models/__init__.py | from .transformer import Transformer, TransformerAttentionDecoder, TransformerAttentionEncoder
from .bytenet import ByteNet
from .seq2seq_base import Seq2Seq
from .seq2seq_generic import HybridSeq2Seq
from .recurrent import RecurrentAttentionSeq2Seq, RecurrentEncoder, RecurrentAttentionDecoder
from .img2seq import Img2... | from .transformer import Transformer, TransformerAttentionDecoder, TransformerAttentionEncoder
from .bytenet import ByteNet
from .seq2seq_base import Seq2Seq
from .seq2seq_generic import HybridSeq2Seq
from .recurrent import RecurrentAttentionSeq2Seq, RecurrentEncoder, RecurrentAttentionDecoder
from .img2seq import Img2... | mit | Python |
627edb62f1d979d3c7a94e4dcc67a3d7810904c6 | Fix python2 compatibility. | h-s-c/ci-tools | run_ctest.py | run_ctest.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import platform
import os
import subprocess
if __name__ == "__main__":
# Start persistent wineserver for faster MinGW tests
if platform.system() == "Linux":
subprocess.call("wineserver -p", shell=True)
# Figure out path of our own cmake install
CITOOL... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import platform
import os
import subprocess
import shutil
if __name__ == "__main__":
# Start persistent wineserver for faster MinGW tests
if platform.system() == "Linux":
if shutil.which("wineserver"):
subprocess.call("wineserver -p", shell=True)
... | unlicense | Python |
b2a123e5620c314e92c9a4181aed23f940072b6f | make staticmethod | orangejulius/donationparty,orangejulius/donationparty,orangejulius/donationparty | donationparty/email.py | donationparty/email.py | from datetime import datetime
from django.conf import settings
from django.core.mail import send_mass_mail
class Emailer:
@staticmethod
def email_invitees(round_url, round_creator, round_expiration, round_invitees):
invitees_list = round_invitees.split(',')
subject = "%s has invited you to a Donation Part... | from datetime import datetime
from django.conf import settings
from django.core.mail import send_mass_mail
class Emailer:
@classmethod
def email_invitees(round_url, round_creator, round_expiration, round_invitees):
invitees_list = round_invitees.split(',')
subject = "%s has invited you to a Donation Part... | mit | Python |
e908ec28ceb67006afe4ebba0127f10357b3df6a | Add missing views | andreagrandi/floggr | floggr.py | floggr.py | # all the imports
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create our little application :)
app = Flask(__name__)
app.config.from_object(__name__)
# Load default config and override config from an environment variable
app.config.u... | # all the imports
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
# create our little application :)
app = Flask(__name__)
app.config.from_object(__name__)
# Load default config and override config from an environment variable
app.config.u... | mit | Python |
054fd3e33ff0457e3b15885fbae61bbbdbf13751 | Remove useless print | SaturDJang/warp,SaturDJang/warp,SaturDJang/warp,SaturDJang/warp | presentation/forms.py | presentation/forms.py | import re
from django import forms
from django.core.exceptions import ValidationError
from django.forms import RadioSelect
from .models import Presentation, Slide
class PresentationBaseForm(forms.ModelForm):
subject = forms.CharField(max_length=50)
markdown = forms.CharField(widget=forms.HiddenInput(), requ... | import re
from django import forms
from django.core.exceptions import ValidationError
from django.forms import RadioSelect
from .models import Presentation, Slide
class PresentationBaseForm(forms.ModelForm):
subject = forms.CharField(max_length=50)
markdown = forms.CharField(widget=forms.HiddenInput(), requ... | mit | Python |
a38093dc40708620105832e98879747d8da3aa80 | add shebang to runpigeon | jaffee/pigeon | runpigeon.py | runpigeon.py | #!/usr/bin/env python
from pigeon import app
app.run(debug=app.config.get('DEBUG', False),
host='0.0.0.0',
port=5654)
| from pigeon import app
app.run(debug=app.config.get('DEBUG', False), host='0.0.0.0', port=5654)
| mit | Python |
b08cbeecd0518bdcd21805d94347f94ab5a0a04d | load view before security | Vauxoo/hr,Vauxoo/hr | hr_loan/__openerp__.py | hr_loan/__openerp__.py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
###############################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
# All Rights Reserved
############# Credits ######################... | #!/usr/bin/python
# -*- encoding: utf-8 -*-
###############################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
# All Rights Reserved
############# Credits ######################... | agpl-3.0 | Python |
1abf8851818b9b4b7336698ec9b492fbaba81ee2 | Use Q-learning | rmoehn/cartpole | forgym.py | forgym.py | import functools
import gym
import matplotlib
matplotlib.use('GTK3Agg')
from matplotlib import pyplot
import numpy as np
import gym_ext.tools as gym_tools
from hiora_cartpole import driver
from hiora_cartpole import fourier_fa
from hiora_cartpole import linfa
from hiora_cartpole import offswitch_hfa
clipped_high = n... | import functools
import gym
import matplotlib
matplotlib.use('GTK3Agg')
from matplotlib import pyplot
import numpy as np
import gym_ext.tools as gym_tools
from hiora_cartpole import driver
from hiora_cartpole import fourier_fa
from hiora_cartpole import linfa
from hiora_cartpole import offswitch_hfa
clipped_high = n... | mit | Python |
3f8cdf3f71a190048f37993f730be5175a9f5b20 | Add a couple of non-addons repos | acsone/maintainer-tools,OCA/maintainer-tools,OCA/maintainer-tools,OCA/maintainer-tools,OCA/maintainer-tools,acsone/maintainer-tools,acsone/maintainer-tools,acsone/maintainer-tools | tools/config.py | tools/config.py | # -*- coding: utf-8 -*-
# License AGPLv3 (https://www.gnu.org/licenses/agpl-3.0-standalone.html)
from __future__ import absolute_import, print_function
import configparser
import os
CREDENTIALS_FILE = 'oca.cfg'
def init_config():
config = configparser.ConfigParser()
config.add_section("GitHub")
config.s... | # -*- coding: utf-8 -*-
# License AGPLv3 (https://www.gnu.org/licenses/agpl-3.0-standalone.html)
from __future__ import absolute_import, print_function
import configparser
import os
CREDENTIALS_FILE = 'oca.cfg'
def init_config():
config = configparser.ConfigParser()
config.add_section("GitHub")
config.s... | agpl-3.0 | Python |
b1155d94c61744bbb601957277ae7c32122c4270 | add new newsletter for job profile | stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment | private/scripts/send-mail.py | private/scripts/send-mail.py | """
Copyright (c) 2015-2019 Raj Patel(raj454raj@gmail.com), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... | """
Copyright (c) 2015-2019 Raj Patel(raj454raj@gmail.com), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... | mit | Python |
3cdca61da41fcd2480edcdfa35c47c5b13070ab5 | Fix charts() test (now there are only 174 charts) | guoguo12/billboard-charts,guoguo12/billboard-charts | tests/test_misc.py | tests/test_misc.py | # -*- coding: utf-8 -*-
import billboard
import unittest
from nose.tools import raises
from requests.exceptions import ConnectionError
import six
class MiscTest(unittest.TestCase):
@raises(ConnectionError)
def testTimeout(self):
"""Checks that using a very small timeout prevents connection."""
... | # -*- coding: utf-8 -*-
import billboard
import unittest
from nose.tools import raises
from requests.exceptions import ConnectionError
import six
class MiscTest(unittest.TestCase):
@raises(ConnectionError)
def testTimeout(self):
"""Checks that using a very small timeout prevents connection."""
... | mit | Python |
b8aed50272b0f0f6df09d92efca5b7d29b6307ac | Add description to problem_subs.py | MichaelAquilina/rosalind-solutions | src/problem_subs.py | src/problem_subs.py | """
Given: Two DNA strings s and t (each of length at most 1 kbp).
Return: All locations of t as a substring of s.
"""
def occurrences(s, t):
if len(t) > len(s):
return None
results = []
for i, _ in enumerate(s):
if s[i:i + len(t)] == t:
results.append(i + 1)
return res... |
def occurrences(s, t):
if len(t) > len(s):
return None
results = []
for i, _ in enumerate(s):
if s[i:i + len(t)] == t:
results.append(i + 1)
return results
if __name__ == '__main__':
with open('data/rosalind_subs.txt') as f:
s = f.readline().rstrip()
... | mit | Python |
53f5c87981291a415b4ed3f752b815e39db60528 | add logger | anvanza/invenavi,anvanza/invenavi,anvanza/invenavi | config.py | config.py | import logging
import logging.handlers
import os
import time
class invenaviConfig(object):
_root_dir = os.path.join(os.getenv("HOME"), "invenavi")
def __init__(self):
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
console = logging.StreamHandler()
logger.addHandl... | import logging
import logging.handlers
import os
import time
class invenaviConfig(object):
_root_dir = os.path.join(os.getenv("HOME"), "invenavi")
def __init__(self):
# create directory
if not os.path.exists(self.logs_path):
os.makedirs(self.logs_path)
# add file lo... | mit | Python |
17fefd1d71cfd88f9467b005ebfb736cd8947f23 | Update config. | wei2912/WiktionaryCrawler,wei2912/WiktionaryCrawler | config.py | config.py | # coding=utf8
start_cat = "Category:Mandarin language"
crawl_delay = 1 # in seconds
lang = "zh"
wiki_lang = "en"
# blacklists
subcats_bl = [
"Category:cmn.*",
".* derived from Mandarin"
]
pages_bl = [
"Appendix:.*",
"Template:.*"
]
## lang-specific config vals ##
## zh - Default
zh_s = True # (true) crawl only simp... | # coding=utf8
start_cat = "Category:Mandarin language"
crawl_delay = 1 # in seconds
lang = "zh"
wiki_lang = "en"
# blacklists
subcats_bl = []
pages_bl = [
"Appendix:.*",
"Template:.*"
]
## lang-specific config vals ##
## zh - Default
zh_s = True # (true) crawl only simplified chinese
zh_t = False # (true) crawl onl... | mit | Python |
b967d60d038d8bfc9b04ca928cf50501b9eb2417 | switch input argument | nypl-spacetime/map-vectorizer,NYPL/map-vectorizer,nypl-spacetime/map-vectorizer,tlevine/map-vectorizer,NYPL/map-vectorizer,tlevine/map-vectorizer | config.py | config.py | #!/usr/bin/python
import subprocess
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input', metavar = '<input file or dir>')
args = parser.parse_args()
print(args)
print(args.input)
exit()
if os.name == 'posix':
try:
defaultgimp = subprocess.check_output(["which", "gimp... | #!/usr/bin/python
import subprocess
import os
instructions = 'vectorize_map.py <input file or dir>'
if os.name == 'posix':
try:
defaultgimp = subprocess.check_output(["which", "gimp"])[:-1]
except subprocess.CalledProcessError:
defaultgimp = '/Applications/Gimp.app/Contents/MacOS/gimp-2.8'
else... | mit | Python |
2c2fddd88cc71cebe72a8840b18b02d5658aaa71 | Remove depreciation warnings | lasa/website,lasa/website,lasa/website | config.py | config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__))
WTF_CSRF_ENABLED = True
SECRET_KEY = "lol"
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_TRACK_MODIFICATIONS = False
| import os
basedir = os.path.abspath(os.path.dirname(__file__))
WTF_CSRF_ENABLED = True
SECRET_KEY = "lol"
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
| agpl-3.0 | Python |
c901843c3b11ca065247515002b0cda90c5420f3 | reset the database | BedquiltDB/bedquilt-core | tests/testutils.py | tests/testutils.py | import psycopg2
import os
import getpass
# CREATE DATABASE bedquilt_test
# WITH OWNER = {{owner}}
# ENCODING = 'UTF8'
# TABLESPACE = pg_default
# LC_COLLATE = 'en_GB.UTF-8'
# LC_CTYPE = 'en_GB.UTF-8'
# CONNECTION LIMIT = -1;
def get_pg_connection():
return psycopg2.connect(
... | import psycopg2
import os
import getpass
# CREATE DATABASE bedquilt_test
# WITH OWNER = {{owner}}
# ENCODING = 'UTF8'
# TABLESPACE = pg_default
# LC_COLLATE = 'en_GB.UTF-8'
# LC_CTYPE = 'en_GB.UTF-8'
# CONNECTION LIMIT = -1;
def get_pg_connection():
return psycopg2.connect(
... | mit | Python |
e1c8ed58e4dd5ff5e10083d7967c01a0af6dfccf | Update Docker’s config settings | KIGOTHO/hdx-age-api,reubano/HDX-Age-API,KIGOTHO/hdx-age-api,reubano/HDX-Age-API,luiscape/hdx-monitor-ageing-service,luiscape/hdx-monitor-ageing-service | config.py | config.py | import os
from os import path as p
# module vars
_user = 'reubano'
_basedir = p.dirname(__file__)
# configurable vars
__APP_NAME__ = 'HDX-Age-API'
__YOUR_NAME__ = 'Reuben Cummings'
__YOUR_EMAIL__ = 'reubano@gmail.com'
__YOUR_WEBSITE__ = 'http://%s.github.io' % _user
# configuration
class Config(object):
#######... | import os
from os import path as p
# module vars
_user = 'reubano'
_basedir = p.dirname(__file__)
# configurable vars
__APP_NAME__ = 'HDX-Age-API'
__YOUR_NAME__ = 'Reuben Cummings'
__YOUR_EMAIL__ = 'reubano@gmail.com'
__YOUR_WEBSITE__ = 'http://%s.github.io' % _user
# configuration
class Config(object):
#######... | mit | Python |
7d7710b6606338f3e57233759a0ea8450b4fae71 | Refactor config | reubano/hdxscraper-acled,reubano/hdxscraper-acled,reubano/hdxscraper-acled | config.py | config.py | from os import path as p
# module vars
_basedir = p.dirname(__file__)
_parentdir = p.dirname(_basedir)
_db_name = 'scraperwiki.sqlite'
_project = 'hdxscraper-acled'
# configuration
class Config(object):
BASE_URL = 'http://www.acleddata.com/wp-content/uploads/'
TABLE = 'ACLED'
SQLALCHEMY_DATABASE_URI = 's... | from os import path as p
# module vars
_basedir = p.dirname(__file__)
_parentdir = p.dirname(_basedir)
_db_name = 'scraperwiki.sqlite'
_project = 'hdxscraper-acled'
# configuration
class Config(object):
BASE_URL = 'http://www.acleddata.com/wp-content/uploads/'
TABLE = 'ACLED'
SQLALCHEMY_DATABASE_URI = 's... | mit | Python |
e484ea554011c032c8152dc5aed65cdceaa1ba01 | Update semantic version to 1.0 | deepmind/dm_env | dm_env/_metadata.py | dm_env/_metadata.py | # pylint: disable=g-bad-file-header
# Copyright 2019 The dm_env Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | # pylint: disable=g-bad-file-header
# Copyright 2019 The dm_env Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | apache-2.0 | Python |
3f9db0744d60bf74af4cbd93b30534a30ca69fe8 | refactor arg parsing | tstringer/pypic,tstringer/pypic | app/app.py | app/app.py | """Do work"""
import argparse
import logging
import os
import sys
from cameracontroller import CameraController
from storage import CloudStorage
def setup_logger():
"""Create the log directory if
it doesn't exist and setup the
logging configuration
"""
logger = logging.getLogger('pypic')
log_... | """Do work"""
import argparse
import logging
import os
import sys
from cameracontroller import CameraController
from storage import CloudStorage
def setup_logger():
"""Create the log directory if
it doesn't exist and setup the
logging configuration
"""
logger = logging.getLogger('pypic')
log_... | mit | Python |
c26e0544fc2521c7b82752d622ef465c60a099cb | Fix spacing | reubano/hdxscraper-undp-climate,reubano/hdxscraper-undp-climate,reubano/hdxscraper-undp-climate | config.py | config.py | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
config
~~~~~~
Provides app configuration settings
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
BASEDIR = p.dirname(__file__)
PARENTDIR = p.dirname(BASEDIR)
DB_NAME = ... | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
config
~~~~~~
Provides app configuration settings
"""
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
BASEDIR = p.dirname(__file__)
PARENTDIR = p.dirname(BASEDIR)
DB_NAME = ... | mit | Python |
cbb03678fe8c88ede28b40c68261999ca181cc7e | switch on debug | fabiansinz/pipecontrol,fabiansinz/pipecontrol,fabiansinz/pipecontrol | config.py | config.py | import os
basedir = os.path.abspath(os.path.dirname(__file__)) + '/databases/'
# --- import environment variables from hidden file
if os.path.exists('.env'):
print('Importing environment from .env...')
for line in open('.env'):
var = line.strip().split('=')
if len(var) == 2:
os.env... | import os
basedir = os.path.abspath(os.path.dirname(__file__)) + '/databases/'
# --- import environment variables from hidden file
if os.path.exists('.env'):
print('Importing environment from .env...')
for line in open('.env'):
var = line.strip().split('=')
if len(var) == 2:
os.env... | mit | Python |
9e3f1c5a9f29d20a7b6c5127c2d9ab917ecbebec | reduce unnecessary instance variables in config.py | cfairbanks/calibre-comicvine | config.py | config.py | '''
Configuration for the Comicvine metadata source
'''
import time
from PyQt5.Qt import QWidget, QGridLayout, QLabel, QLineEdit
from calibre.utils.config import JSONConfig
from calibre_plugins.comicvine import pycomicvine
PREFS = JSONConfig('plugins/comicvine')
PREFS.defaults['api_key'] = ''
PREFS.defaults['worker_... | '''
Configuration for the Comicvine metadata source
'''
import time
from PyQt5.Qt import QWidget, QGridLayout, QLabel, QLineEdit
from calibre.utils.config import JSONConfig
from calibre_plugins.comicvine import pycomicvine
PREFS = JSONConfig('plugins/comicvine')
PREFS.defaults['api_key'] = ''
PREFS.defaults['worker_... | mit | Python |
7e172f9ff8c1c2171b770512e8fa6ed214ba48a0 | Add Facebook | foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org | config.py | config.py | import os
from flask import Flask
from services import bitbucket
from services import deviantart
from services import digg
from services import disqus
from services import dropbox
from services import etsy
from services import facebook
from services import fitbit
from services import flickr
from services import github... | import os
from flask import Flask
from services import bitbucket
from services import deviantart
from services import digg
from services import disqus
from services import dropbox
from services import etsy
from services import fitbit
from services import flickr
from services import github
from services import instagra... | bsd-3-clause | Python |
f7f8070dee30e856ca6ad49538c196a05888cec3 | Remove UVic config | hep-gc/cloud-monitoring,hep-gc/cloud-monitoring,hep-gc/cloud-monitoring | config.py | config.py | from collections import OrderedDict
# Graphite render API endpoint
GRAPHITE_HOST = 'localhost'
# Metrics to query for the summary view
SUMMARY_METRICS = [
'grids.*.clouds.*.enabled',
'grids.*.clouds.*.idle.*',
'grids.*.clouds.*.quota',
'grids.*.clouds.*.slots.*.*',
'grids.*.clouds.*.vms.*.*',
... | from collections import OrderedDict
# Graphite render API endpoint
GRAPHITE_HOST = 'localhost'
# Metrics to query for the summary view
SUMMARY_METRICS = [
'grids.*.clouds.*.enabled',
'grids.*.clouds.*.idle.*',
'grids.*.clouds.*.quota',
'grids.*.clouds.*.slots.*.*',
'grids.*.clouds.*.vms.*.*',
... | mit | Python |
a3616c0aa252e00e48609f5bb1779696bf4ca07d | Use file_io in crypto functions | kvikshaug/pwkeeper | crypto.py | crypto.py | from Crypto.Cipher import AES
import os
from file_io import *
from settings import *
def get_cipher(iv, text):
try:
key = read_file(KEY_FILE, 'rt').strip()
except IOError:
key = input(text)
return AES.new(key, AES.MODE_CBC, iv)
def encrypt(bytes):
iv = os.urandom(16)
c = get_ciphe... | from Crypto.Cipher import AES
import os
from settings import *
def get_cipher(iv, text):
try:
key = open(KEY_FILE, 'rb').read().strip()
except IOError:
key = input(text)
return AES.new(key, AES.MODE_CBC, iv)
def encrypt(bytes):
iv = os.urandom(16)
c = get_cipher(iv, "Please enter ... | unlicense | Python |
56c0d2ea610aae35edfef2d242e0c4ca6a236a4d | Replace file_io usage with open | kvikshaug/pwkeeper | crypto.py | crypto.py | from Crypto.Cipher import AES
import os
from settings import *
def get_cipher(iv, text):
try:
with open(KEY_FILE, 'rt') as f:
key = f.read().strip()
except IOError:
key = input(text)
return AES.new(key, AES.MODE_CBC, iv)
def encrypt(bytes):
iv = os.urandom(16)
c = get_... | from Crypto.Cipher import AES
import os
from file_io import *
from settings import *
def get_cipher(iv, text):
try:
key = read_file(KEY_FILE, 'rt').strip()
except IOError:
key = input(text)
return AES.new(key, AES.MODE_CBC, iv)
def encrypt(bytes):
iv = os.urandom(16)
c = get_ciphe... | unlicense | Python |
b9cdc1e7f1f18bd43a513d91ab3b9cc755c50019 | modify extractor name and slug | MTG/pycompmusic | compmusic/extractors/andalusian.py | compmusic/extractors/andalusian.py | import numpy
import compmusic.extractors
from tomato.audio.predominantmelody import PredominantMelody
from tomato.audio.pitchdistribution import PitchDistribution
class AndalusianPitch(compmusic.extractors.ExtractorModule):
_version = "0.1"
_sourcetype = "mp3"
_slug = "andalusianpitch"
_output = {
... | import numpy
import compmusic.extractors
from tomato.audio.predominantmelody import PredominantMelody
from tomato.audio.pitchdistribution import PitchDistribution
class Andalusian(compmusic.extractors.ExtractorModule):
_version = "0.1"
_sourcetype = "mp3"
_slug = "andalusian"
_output = {
"pi... | agpl-3.0 | Python |
178558665904a0024aa1b42645d4488b48723205 | Mend build_pins,as_bin to work with 8+ bit components | Mause/circuitry | circuitry/util.py | circuitry/util.py | import string
from os.path import join, dirname
from collections import namedtuple
HERE = join(dirname(__file__), '..', 'tests')
Pos = namedtuple('Pos', 'line,column')
def get_pos(pos, instring):
preceding = instring[:pos]
line = preceding.count('\n') + 1
column = preceding.rfind('\n')
if column =... | from os.path import join, dirname
from collections import namedtuple
ALPHA_8BIT = 'abcdefgh'
HERE = join(dirname(__file__), '..', 'tests')
Pos = namedtuple('Pos', 'line,column')
def get_pos(pos, instring):
preceding = instring[:pos]
line = preceding.count('\n') + 1
column = preceding.rfind('\n')
i... | mit | Python |
bb2e3dd8280539c0dc9d2821fd7021b54a72288f | Update field name in search_index | rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,litui/openparliament,rhymeswithcycle/openparliament,litui/openparliament,litui/openparliament | parliament/hansards/search_indexes.py | parliament/hansards/search_indexes.py | from haystack import indexes
from parliament.hansards.models import Statement
class StatementIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, model_attr='text_plain')
searchtext = indexes.CharField(stored=False, use_template=True)
date = indexes.DateTimeField(model_at... | from haystack import indexes
from parliament.hansards.models import Statement
class StatementIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, model_attr='text_plain')
searchtext = indexes.CharField(stored=False, use_template=True)
date = indexes.DateTimeField(model_at... | agpl-3.0 | Python |
f99d9ff7ab369a6f62e3ed9f3c229ce0967d662b | remove gtk/pygtk, using gobject mainloop | flavioribeiro/playmobil,flavioribeiro/playmobil | client/client.py | client/client.py | import sys
sys.path.append("/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/python2.7/site-packages/")
import gobject
gobject.threads_init()
import pygst
pygst.require("0.10")
import gst
class Client(object):
def __init__(self):
self.pipeline = gst.Pipeline('client')
self.videotestsrc = s... | import sys
sys.path.append("/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/python2.7/site-packages/")
import gobject
gobject.threads_init()
import pygst
pygst.require("0.10")
import gst
import pygtk
pygtk.require("2.0")
import gtk
class Client(object):
def __init__(self):
self.pipeline = gst.Pip... | apache-2.0 | Python |
6e0ddf24d9bf0fb6e7b90147fddd50755c25d774 | fix c4ddev/scripting/localimport and add python/ to PYTHONPATH | nr-plugins/c4ddev,nr-plugins/c4ddev | lib/c4ddev/scripting/localimport.py | lib/c4ddev/scripting/localimport.py | # Copyright (C) 2016 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, ... | # Copyright (C) 2016 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, ... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.