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 |
|---|---|---|---|---|---|---|---|---|
4c2fe580aa549f64722ca15d37c1065f62fd885f | implement the view | TheBlackDude/mudu45,TheBlackDude/mudu45,TheBlackDude/mudu45 | mudu/views.py | mudu/views.py | from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .models import About, Contact
from .serializers import AboutSerializer, ContactSerializer
@api_view(['GET', 'POST'])
def api(request):
""" List my Info, or Contact Me """
if request.meth... | from django.shortcuts import render
# Create your views here.
| mit | Python |
58c59697039b48ef48f14cd9eb62205c2db91972 | Add test boilerplatte | ashwoods/cachefunk | tests/conftest.py | tests/conftest.py | import pytest
| mit | Python | |
64afd914e58f0abe52030d6ee4279fb0757b1ab6 | Use `prawtest_` prefix for environment test settings. | RGood/praw,nmtake/praw,darthkedrik/praw,13steinj/praw,leviroth/praw,gschizas/praw,praw-dev/praw,13steinj/praw,praw-dev/praw,leviroth/praw,RGood/praw,darthkedrik/praw,gschizas/praw,nmtake/praw | tests/conftest.py | tests/conftest.py | """Prepare py.test."""
import os
import time
from base64 import b64encode
import betamax
from betamax_serializers import pretty_json
# Prevent calls to sleep
def _sleep(*args):
raise Exception('Call to sleep')
time.sleep = _sleep
def b64_string(input_string):
"""Return a base64 encoded string (not bytes) f... | """Prepare py.test."""
import os
import time
from base64 import b64encode
import betamax
from betamax_serializers import pretty_json
# Prevent calls to sleep
def _sleep(*args):
raise Exception('Call to sleep')
time.sleep = _sleep
def b64_string(input_string):
"""Return a base64 encoded string (not bytes) f... | bsd-2-clause | Python |
2ad088102d5022027bcbd507ed784b3cc2d9fab6 | bump version to 0.9.4 | deadscivey/mockthink,scivey/mockthink | mockthink/version.py | mockthink/version.py | VERSION = '0.9.4'
| VERSION = '0.9.3'
| mit | Python |
ce92d99fd87e5935de954af75ae39481d04711ea | Change morse simulation environment to demo_wildfire | fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop,fire-rs-laas/fire-rs-saop | morse_sim/default.py | morse_sim/default.py | #! /usr/bin/env morseexec
""" Basic MORSE simulation scene for <morse_sim> environment
Feel free to edit this template as you like!
"""
import os
import os.path
import numpy as np
os.chdir(os.path.dirname(__file__))
from morse.builder import *
from morse_sim.builder.actuators.absolute_teleport import AbsoluteTel... | #! /usr/bin/env morseexec
""" Basic MORSE simulation scene for <morse_sim> environment
Feel free to edit this template as you like!
"""
import os
import os.path
import numpy as np
os.chdir(os.path.dirname(__file__))
from morse.builder import *
from morse_sim.builder.actuators.absolute_teleport import AbsoluteTel... | bsd-2-clause | Python |
a3392a89b71e262783caaf4acdddbb2577103cee | Improve list displays in admin interface. | ast0815/mqtt-hub,ast0815/mqtt-hub | mqtt_logger/admin.py | mqtt_logger/admin.py | from django.contrib import admin
from models import *
class MessageAdmin(admin.ModelAdmin):
readonly_fields = ('subscription', 'time_recorded', 'topic', 'payload')
date_hierarchy = 'time_recorded'
list_display = ('time_recorded', 'subscription', 'topic', 'payload')
list_display_links = ('payload',)
... | from django.contrib import admin
from models import *
class MessageAdmin(admin.ModelAdmin):
readonly_fields = ['subscription', 'time_recorded', 'topic', 'payload']
admin.site.register(MQTTMessage, MessageAdmin)
admin.site.register(MQTTSubscription)
| mit | Python |
8b939af8909d424b2a6b73194b257724ecc8c349 | add more tests | jlaine/django-coconuts,jlaine/django-coconuts,jlaine/django-coconuts | coconuts/tests/test_exif.py | coconuts/tests/test_exif.py | # -*- coding: utf-8 -*-
#
# django-coconuts
# Copyright (c) 2008-2013, Jeremy Lainé
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above ... | # -*- coding: utf-8 -*-
#
# django-coconuts
# Copyright (c) 2008-2013, Jeremy Lainé
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above ... | bsd-2-clause | Python |
7d1dabd9a7120e0a24c54aa9c1f7ab9c13683dfa | Remove unused Keyword lexeme | pdarragh/Viper | viper/lexer/lexemes.py | viper/lexer/lexemes.py | INDENT_SIZE = 4
class Lexeme:
def __init__(self, text, repl_with_text=True):
self.text = text
self._repl_with_text = repl_with_text
def __repr__(self):
if self._repl_with_text:
return f'{type(self).__name__}({self.text})'
else:
return type(self).__name_... | INDENT_SIZE = 4
class Lexeme:
def __init__(self, text, repl_with_text=True):
self.text = text
self._repl_with_text = repl_with_text
def __repr__(self):
if self._repl_with_text:
return f'{type(self).__name__}({self.text})'
else:
return type(self).__name_... | apache-2.0 | Python |
35aa5f3928a6d1b60e2412f0d075f7dfc4738b04 | Bump version because I can! | RealDolos/volaupload | volaupload/_version.py | volaupload/_version.py | """
Version information for volaupload
"""
__version__ = "0.9.4"
| """
Version information for volaupload
"""
__version__ = "0.9.3"
| mit | Python |
6b32ddf59db6b2bb1865d37e9e41c9b2308a7e69 | add version info | benoitc/offset | offset/__init__.py | offset/__init__.py | # -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.
version_info = (0, 1, 0)
__version__ = ".".join([str(v) for v in version_info])
# scheduler functions
from .core import go, run, gosched, maintask
# channel functions
from .core.chan import makechan, select, default
# except... | # -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.
# scheduler functions
from .core import go, run, gosched, maintask
# channel functions
from .core.chan import makechan, select, default
# exceptions
from .core.exc import PanicError
| mit | Python |
197fbb2793ccba85a00711d39fcd3af4fe4bc66e | Correct precipitation probability | ericfourrier/raspberry-scripts,ericfourrier/raspberry-scripts | weather_pred/main.py | weather_pred/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-u
"""
Purpose : Get weather predition using https://developer.forecast.io/ and
the pip install python-forecastio python wrapper
Requirements
------------
* pip install python-forecastio
"""
import os
import forecastio
import datetime
import time
import RPi.GPIO as GPIO
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-u
"""
Purpose : Get weather predition using https://developer.forecast.io/ and
the pip install python-forecastio python wrapper
Requirements
------------
* pip install python-forecastio
"""
import os
import forecastio
import datetime
import time
import RPi.GPIO as GPIO
... | mit | Python |
242acb878fbfad2b70f9c64b360bdc8db7a9e340 | Clean up setup/teardown | tpflueger/CSCI4900 | tests/test_dependency_node.py | tests/test_dependency_node.py | from scripts import dependency_node
from tempfile import mkdtemp
import shutil
import os
import glob
class TestDependencyNode:
def setup_class(self):
self.node = dependency_node.DependencyNode('org.joda', 'joda-money', '0.11', '1')
os.chdir(os.path.abspath('./tests'))
self.tempDirectoryPath... | from scripts import dependency_node
from tempfile import mkdtemp
import shutil
import os
import glob
class TestDependencyNode:
def setup(self):
self.node = dependency_node.DependencyNode('org.joda', 'joda-money', '0.11', '1')
os.chdir(os.path.abspath('./tests'))
def teardown(self):
os.... | mit | Python |
e45971c740b8b723901b9c56bb56cb84f581834c | fix import. Dbref isn't in pymongo package anymore | goanpeca/mongokit,aquavitae/mongokit-py3,namlook/mongokit,wshcdr/mongokit | mongokit/__init__.py | mongokit/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2010, Nicolas Clairon
# 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 abov... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2010, Nicolas Clairon
# 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 abov... | bsd-3-clause | Python |
e87d68fb0f7094c38dc931c9062f13015a725980 | normalize the PK values | pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity | localtv/search_indexes.py | localtv/search_indexes.py | from haystack import indexes
from haystack import site
from localtv.models import Video, VIDEO_STATUS_ACTIVE
class VideoIndex(indexes.SearchIndex):
text = indexes.CharField(document=True, use_template=True)
feed = indexes.IntegerField(model_attr='feed__pk', null=True)
search = indexes.IntegerField(model_a... | from haystack import indexes
from haystack import site
from localtv.models import Video, VIDEO_STATUS_ACTIVE
class VideoIndex(indexes.SearchIndex):
text = indexes.CharField(document=True, use_template=True)
feed = indexes.IntegerField(model_attr='feed__pk', null=True)
search = indexes.IntegerField(model_a... | agpl-3.0 | Python |
1580b8dcc4413b43ff6263d3ac4581196b887f27 | Add custom action to re-send confirmation emails | gdetrez/fscons-ticketshop,gdetrez/fscons-ticketshop,gdetrez/fscons-ticketshop | ticketshop/ticketapp/admin.py | ticketshop/ticketapp/admin.py | from django.contrib import admin
from django.contrib import messages
from .models import TicketPurchase, Ticket, TicketType, Coupon
from .mails import send_confirmation_email
# ~~~ Ticket purchase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class TicketInline(admin.TabularInline):
"""
This is use... | from django.contrib import admin
from .models import TicketPurchase, Ticket, TicketType, Coupon
# ~~~ Ticket purchase ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class TicketInline(admin.TabularInline):
"""
This is used to displayed the purchased ticket inline in the
page showing the details o... | mit | Python |
42d965e3c021c65c24fbe0ff6972bd678d851a28 | Remove duplicate datetime clause from OPALSerializer | khchine5/opal,khchine5/opal,khchine5/opal | opal/core/views.py | opal/core/views.py | """
Re-usable view components
"""
import functools
import json
import datetime
from django.utils.dateformat import format
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.serializers.json import DjangoJS... | """
Re-usable view components
"""
import functools
import json
import datetime
from django.utils.dateformat import format
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.core.serializers.json import DjangoJS... | agpl-3.0 | Python |
d8e3c6b02d7fca6f3a1851fe6ae13428dac97e31 | use READ COMMITTED isolation level | opmuse/opmuse,opmuse/opmuse,opmuse/opmuse,opmuse/opmuse | opmuse/database.py | opmuse/database.py | import cherrypy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
Base = declarative_base()
def get_session():
url = cherrypy.config['opmuse']['database.url']
return sessionmaker(bind=create_engine(url))()
clas... | import cherrypy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
Base = declarative_base()
def get_session():
url = cherrypy.config['opmuse']['database.url']
return sessionmaker(bind=create_engine(url))()
clas... | agpl-3.0 | Python |
f2241e27a77f7bdae908a4a5db2766389850fdf9 | bump to 0.12.1 | Hanaasagi/sorator | orator/__init__.py | orator/__init__.py | # -*- coding: utf-8 -*-
__version__ = '0.12.1'
from .orm import Model, SoftDeletes, Collection, accessor, mutator, scope # noqa
from .database_manager import DatabaseManager # noqa
from .query.expression import QueryExpression # noqa
from .schema import Schema # noqa
from .pagination import Paginator, LengthAwarePagi... | # -*- coding: utf-8 -*-
__version__ = '0.12.0'
from .orm import Model, SoftDeletes, Collection, accessor, mutator, scope # noqa
from .database_manager import DatabaseManager # noqa
from .query.expression import QueryExpression # noqa
from .schema import Schema # noqa
from .pagination import Paginator, LengthAwarePagi... | mit | Python |
8376dd781118681bfa30f6cdf1e6d7906d5c3abb | change invocation to drop users_list | royrapoport/destalinator,randsleadershipslack/destalinator,randsleadershipslack/destalinator,royrapoport/destalinator | tests/test_announcer.py | tests/test_announcer.py | import os
import time
import unittest
import mock
import announcer
from tests.test_destalinator import MockValidator
import tests.fixtures as fixtures
import tests.mocks as mocks
class AnnouncerAnnounceTest(unittest.TestCase):
def setUp(self):
slacker_obj = mocks.mocked_slacker_object(channels_list=fixtu... | import os
import time
import unittest
import mock
import announcer
from tests.test_destalinator import MockValidator
import tests.fixtures as fixtures
import tests.mocks as mocks
class AnnouncerAnnounceTest(unittest.TestCase):
def setUp(self):
slacker_obj = mocks.mocked_slacker_object(channels_list=fixtu... | apache-2.0 | Python |
0f68dc6b7b35aa22e08517a80cf5f4b672f88eca | Add tests for version upgrade | nevercast/home-assistant,jabesq/home-assistant,hmronline/home-assistant,Julian/home-assistant,tboyce1/home-assistant,caiuspb/home-assistant,robbiet480/home-assistant,titilambert/home-assistant,jnewland/home-assistant,ct-23/home-assistant,aoakeson/home-assistant,tboyce1/home-assistant,open-homeautomation/home-assistant,... | tests/test_bootstrap.py | tests/test_bootstrap.py | """
tests.test_bootstrap
~~~~~~~~~~~~~~~~~~~~
Tests bootstrap.
"""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
import unittest
from unittest import mock
from homeassistant import core, bootstrap
from homeassistant.const import __version__
import homeassistant.util.dt as dt_uti... | """
tests.test_bootstrap
~~~~~~~~~~~~~~~~~~~~
Tests bootstrap.
"""
# pylint: disable=too-many-public-methods,protected-access
import tempfile
import unittest
from unittest import mock
from homeassistant import bootstrap
import homeassistant.util.dt as dt_util
from tests.common import mock_detect_location_info
clas... | mit | Python |
932edca06dd726d227db6c092b7f733f94d63f60 | Add correct datastore CSV download The URL for the production datastore is added following a fix made in https://github.com/IATI/IATI-Datastore/commit/30177c556ccacdc5fe6a2967b272ecef8aa9dee1 | IATI/IATI-Website-Tests | tests/test_datastore.py | tests/test_datastore.py | import pytest
from web_test_base import *
class TestIATIDatastore(WebTestBase):
requests_to_load = {
'Datastore Homepage': {
'url': 'http://datastore.iatistandard.org/'
},
'Datastore download: csv': {
'url': 'http://datastore.iatistandard.org/api/1/access/activity.cs... | import pytest
from web_test_base import *
class TestIATIDatastore(WebTestBase):
requests_to_load = {
'Datastore Homepage': {
'url': 'http://datastore.iatistandard.org/'
},
'Datastore download: csv': {
'url': 'http://dev.datastore.iatistandard.org/api/1/access/activit... | mit | Python |
75f236f8fd0ba368197da3070002b60233a01d49 | Test routines to the BED writer added | gtamazian/Chromosomer | tests/test_track_bed.py | tests/test_track_bed.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Gaik Tamazian
# gaik (dot) tamazian (at) gmail (dot) com
import os
import logging
import unittest
from chromosomer.track.bed import BedRecord
from chromosomer.track.bed import Reader
from chromosomer.track.bed import Writer
from itertools import iz... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Gaik Tamazian
# gaik (dot) tamazian (at) gmail (dot) com
import os
import logging
import unittest
from chromosomer.track.bed import BedRecord
from chromosomer.track.bed import Reader
path = os.path.dirname(__file__)
os.chdir(path)
class TestBedR... | mit | Python |
69f45f0f490d854335eed03198754fbb65fc9110 | Improve importation form wording | TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio | td_biblio/forms.py | td_biblio/forms.py | from operator import methodcaller
from django import forms
from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _
DOI_REGEX = '(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?!["&\'<>])\S)+)'
doi_validator = RegexValidator(
DOI_REGEX,
_("One (or more) DOI is not valid"),... | from operator import methodcaller
from django import forms
from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _
DOI_REGEX = '(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?!["&\'<>])\S)+)'
doi_validator = RegexValidator(
DOI_REGEX,
_("One (or more) DOI is not valid"),... | mit | Python |
088a248a2276e46bcf58abc0873913680724534e | make the server visible to the internet | lex/gg-no-re,lex/gg-no-re,lex/gg-no-re,lex/gg-no-re | main.py | main.py | from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return 'ok'
if __name__ == '__main__':
app.debug = True
app.run(host='0.0.0.0')
| from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return 'ok'
if __name__ == '__main__':
app.run()
| bsd-3-clause | Python |
3a6b65125ddaaf97348d41082a70505ce99d8edc | Add route for setting max cache age to 0 | J216/band_name_generator,J216/band_name_generator,J216/band_name_generator | main.py | main.py | from flask import Flask, render_template
from os import listdir
from os.path import isfile, join
import twitter as tw
import image_overlay as ilay
import band_name as bn
app = Flask(__name__)
app.debug = True
names_made=0
page_info = {}
page_info['business_name'] = u"Band Name Generator"
page_info['desciption'] = u"G... | from flask import Flask, render_template
from os import listdir
from os.path import isfile, join
import twitter as tw
import image_overlay as ilay
import band_name as bn
app = Flask(__name__)
app.debug = True
names_made=0
page_info = {}
page_info['business_name'] = u"Band Name Generator"
page_info['desciption'] = u"G... | mit | Python |
59ba6a03afbcb91dbca1f639febaf7eee3283109 | Add minor updates. | haoyueping/peer-grading-for-MOOCs | main.py | main.py | #!/usr/bin/python3
from time import time
import pandas as pd
from scipy.stats import kendalltau
from algorithms.EM import em
from algorithms.PageRank import page_rank
from algorithms.borda_ordering import borda_ordering
from algorithms.random_circle_removal import random_circle_removal
from utils.gradings import get... | #!/usr/bin/python3
from time import time
import pandas as pd
from scipy.stats import kendalltau
from algorithms.EM import em
from algorithms.PageRank import page_rank
from algorithms.borda_ordering import borda_ordering
from algorithms.random_circle_removal import random_circle_removal
from utils.gradings import get... | mit | Python |
9e666e97b07d7c08e434791a061086010da6e6eb | Add ability to get the latest TwoHeadlines tweet | underyx/TheMajorNews | main.py | main.py | # -*- coding: utf-8 -*-
import config
import requests
from base64 import b64encode
def get_access_token():
token = config.twitter_key + ':' + config.twitter_secret
h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': b'Basic ' + b64encode(bytes(token, 'utf8'))}
... | # -*- utf-8 -*-
import config
import requests
from base64 import b64encode
def get_access_token():
token = config.twitter_key + ':' + config.twitter_secret
h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': b'Basic ' + b64encode(bytes(token, 'utf8'))}
print(... | mit | Python |
760a3280015a9bb9b6fdbbeda7ace5048708b892 | set default run to lunar_dqn | kengz/openai_lab,kengz/openai_gym,kengz/openai_lab,kengz/openai_lab,kengz/openai_gym,kengz/openai_gym | main.py | main.py | from rl.experiment import run
if __name__ == '__main__':
# run('dev_dqn', times=2, param_selection=True)
# run('dqn', times=2, param_selection=False)
run('lunar_dqn', times=3, param_selection=True)
# run('DevCartPole-v0_DQN_HighLowMemoryWithForgetting_BoltzmannPolicy_NoPreProcessor_2017-01-21_191023_e0... | from rl.experiment import run
if __name__ == '__main__':
run('dev_dqn', times=2, param_selection=True)
# run('dqn', times=2, param_selection=False)
# run('lunar_dqn', times=1, param_selection=False)
# run('DevCartPole-v0_DQN_HighLowMemoryWithForgetting_BoltzmannPolicy_NoPreProcessor_2017-01-21_191023_e... | mit | Python |
2dec070daca154b26b880147d29ba80af99dd5ee | Fix is_worker_running | UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine,UPOLSearch/UPOL-Search-Engine | main.py | main.py | from crawler import tasks
from crawler.db import db_mongodb as db
from time import sleep
from celery.app.control import Control
from crawler.celery import app
# Temporal solution
db.insert_url("http://www.inf.upol.cz")
def is_worker_running():
inspect = app.control.inspect()
active = inspect.active()
s... | from crawler import tasks
from crawler.db import db_mongodb as db
from time import sleep
from celery.app.control import Control
from crawler.celery import app
# Temporal solution
db.insert_url("http://www.inf.upol.cz")
def is_worker_running():
inspect = app.control.inspect()
active = inspect.active()
s... | mit | Python |
7ef70ed9bd1a2e16ff046e8d805d88dab439e9d7 | Use ThreadPoolExecutor to send statistics in parallel | luigiberrettini/build-deploy-stats | main.py | main.py | #!/usr/bin/env python3
import asyncio
from concurrent.futures import ThreadPoolExecutor
from configuration.settings import Settings
from reporting.shellReporter import ShellReporter
from reporting.zabbixReporter import ZabbixReporter
from statsSend.teamCity.teamCityStatisticsSender import TeamCityStatisticsSender
fr... | #!/usr/bin/env python3
import asyncio
from configuration.settings import Settings
from reporting.shellReporter import ShellReporter
from reporting.zabbixReporter import ZabbixReporter
from statsSend.teamCity.teamCityStatisticsSender import TeamCityStatisticsSender
from statsSend.jenkins.jenkinsStatisticsSender import... | mit | Python |
620182c6cad11907751146a5c66a19478aad0c18 | Update SVM.py | mahesh-9/ML,konemshad/ML | ml/GLM/SVM.py | ml/GLM/SVM.py | from math import log,e
from ..numc import *
from .lr import LR
from .LogisticRegr import LogisticRegression
""" trying to implement linear kernel using SVC """
class SVM():
def fit(self,X,Y):
LR.fit(self,X,Y)
return self
def hypo(self,it):
res= 1/(1+e**(-LR.hyp(self,it)))
return res
def cost1(self):
cos1... | from math import log,e
from ..numc import *
from .lr import LR
from .LogisticRegr import LogisticRegression
""" trying to implement linear kernel using SVC """
class SVM():
def fit(self,X,Y):
LR.fit(self,X,Y)
return self
def hypo(self,it):
res= 1/(1+e**(-LR.hyp(self,it)))
return res
def cost1(self):
cos1... | mit | Python |
95d0ec44a7c2556577bebb9ef5afa3e9401a1c10 | add hll | Parsely/probably | pds/hll.py | pds/hll.py | import smhasher
import numpy as np
from hashfunctions import get_raw_hashfunctions
class HyperLogLog(object):
""" Basic Hyperloglog """
def __init__(self, error_rate):
b = int(np.ceil(np.log2((1.04 / error_rate) ** 2)))
self.precision = 64
self.alpha = self._get_alpha(b)
self... | mit | Python | |
800a03a6e24136623fd5ef3a892630fcc045100e | adjust import for new conary module layout | fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary | conary/commit.py | conary/commit.py | #
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... | #
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... | apache-2.0 | Python |
211fadd16c8fb63c61c0e6378e2d9607d61f932c | Bump version to 8.0.0a2 | jberci/resolwe,genialis/resolwe,genialis/resolwe,jberci/resolwe | resolwe/__about__.py | resolwe/__about__.py | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | apache-2.0 | Python |
7e74eb64697b410f38e7039b9a26b6cdd36275c6 | add doctest | amygdalama/stardatetime | stardatetime/conversion.py | stardatetime/conversion.py | from datetime import date
def earth_date_to_star_date(earth_year, earth_month, earth_day):
"""Converts an Earth date to a star date.
>>> earth_date_to_star_date(2323, 1, 1)
0.0
>>> earth_date_to_star_date(2015, 1, 1)
-308000.0
>>> earth_date_to_star_date(2014, 12, 31)
-308002.7
"""
... | from datetime import date
def earth_date_to_star_date(earth_year, earth_month, earth_day):
star_year = (earth_year - 2323) * 1000
first_date_of_year = date(year=earth_year, month=1, day=1)
earth_date = date(year=earth_year, month=earth_month, day=earth_day)
days_elapsed_in_year = earth_date - first_da... | mit | Python |
178736aa0d9c44fe7cb94cbbf1597b256e091773 | Fix error if no organisation is selected | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | meinberlin/apps/newsletters/emails.py | meinberlin/apps/newsletters/emails.py | from email.mime.image import MIMEImage
from django.apps import apps
from django.conf import settings
from django.contrib import auth
from django.contrib.staticfiles import finders
from meinberlin.apps.contrib.emails import Email
Organisation = apps.get_model(settings.A4_ORGANISATIONS_MODEL)
User = auth.get_user_mode... | from email.mime.image import MIMEImage
from django.apps import apps
from django.conf import settings
from django.contrib import auth
from django.contrib.staticfiles import finders
from meinberlin.apps.contrib.emails import Email
Organisation = apps.get_model(settings.A4_ORGANISATIONS_MODEL)
User = auth.get_user_mode... | agpl-3.0 | Python |
94625711fe2503dd8a2efbe367ec3d494810bf80 | Remove rogue print | mozata/menpo,menpo/menpo,menpo/menpo,grigorisg9gr/menpo,patricksnape/menpo,patricksnape/menpo,yuxiang-zhou/menpo,menpo/menpo,patricksnape/menpo,mozata/menpo,grigorisg9gr/menpo,mozata/menpo,mozata/menpo,yuxiang-zhou/menpo,grigorisg9gr/menpo,yuxiang-zhou/menpo | menpo/image/test/image_masked_test.py | menpo/image/test/image_masked_test.py | import numpy as np
from numpy.testing import assert_allclose
from menpo.shape import PointCloud
from menpo.image import MaskedImage, BooleanImage
def test_constrain_mask_to_landmarks():
img = MaskedImage.init_blank((10, 10))
img.landmarks['box'] = PointCloud(np.array([[0.0, 0.0], [5.0, 0.0],
... | import numpy as np
from numpy.testing import assert_allclose
from menpo.shape import PointCloud
from menpo.image import MaskedImage, BooleanImage
def test_constrain_mask_to_landmarks():
img = MaskedImage.init_blank((10, 10))
img.landmarks['box'] = PointCloud(np.array([[0.0, 0.0], [5.0, 0.0],
... | bsd-3-clause | Python |
2810780806628074a803fe92cb31e56751ba08d7 | add long cache headers to the geojson resource | texas/tx_mixed_beverages,texas/tx_mixed_beverages,texas/tx_mixed_beverages,texas/tx_mixed_beverages | mixed_beverages/apps/lazy_geo/urls.py | mixed_beverages/apps/lazy_geo/urls.py | from django.conf.urls import url
from django.views.decorators.cache import cache_control
from . import views
ONE_DAY = 86400
ONE_WEEK = ONE_DAY * 7
urlpatterns = [
url(r'^data.geojson$',
cache_control(max_age=ONE_WEEK)(views.MarkerList.as_view()),
name='geo'),
]
| from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^data.geojson$', views.MarkerList.as_view(), name='geo'),
]
| apache-2.0 | Python |
c45bc3e57f0c0fce9990488d13766875e33787a9 | add ability to load students from DB | samitnuk/studentsdb,samitnuk/studentsdb,samitnuk/studentsdb | students/views/students.py | students/views/students.py | from django.shortcuts import render
from django.http import HttpResponse
from ..models import Student
def students_list(request):
students = Student.objects.all()
return render(request, 'students/students_list.html',
{'students': students})
def students_add(request):
return HttpResponse('<h1>Stu... | from django.shortcuts import render
from django.http import HttpResponse
def students_list(request):
students = (
{'id': 1,
'first_name': 'Віталій',
'last_name': 'Подоба',
'ticket': 235,
'image': 'img/image1.jpg'},
{'id': 2,
'first_name': 'Андрій',
... | mit | Python |
4bd88c81a0ca52d8dc9b4a228e3a74d8d51bf65e | Implement equality checking with default values | jshholland/dutch-bits | inflist.py | inflist.py | """
Provide services for automatically extending lists.
inflist provides a list subclass to allow for automagically extending lists.
InfList represents a list that allows extending indefinitely without any fuss.
Indexing a non-assigned thing works as expected; first, normal lookup is tried
like normal lists. If that f... | """
Provide services for automatically extending lists.
inflist provides a list subclass to allow for automagically extending lists.
InfList represents a list that allows extending indefinitely without any fuss.
Indexing a non-assigned thing works as expected; first, normal lookup is tried
like normal lists. If that f... | bsd-3-clause | Python |
7f639d77caa3120745ab1a42c517d396664c17f9 | bump version to 0.4.33 | nickp60/riboSeed,nickp60/riboSeed,nickp60/riboSeed | riboSeed/_version.py | riboSeed/_version.py | __version__ = '0.4.33'
| __version__ = '0.4.32'
| mit | Python |
fd905b25b81419c3896d1177edd05709a5a78ad5 | Fix missing variable | vrs01/mopidy,liamw9534/mopidy,hkariti/mopidy,pacificIT/mopidy,priestd09/mopidy,jodal/mopidy,adamcik/mopidy,hkariti/mopidy,swak/mopidy,pacificIT/mopidy,woutervanwijk/mopidy,jcass77/mopidy,jcass77/mopidy,quartz55/mopidy,ali/mopidy,bacontext/mopidy,tkem/mopidy,vrs01/mopidy,bacontext/mopidy,bencevans/mopidy,vrs01/mopidy,ab... | mopidy/backends/libspotify/library.py | mopidy/backends/libspotify/library.py | import logging
import multiprocessing
from spotify import Link, SpotifyError
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
logger = logging.getLogger('mopidy.backends.libspotify.library')
... | import logging
import multiprocessing
from spotify import Link, SpotifyError
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
logger = logging.getLogger('mopidy.backends.libspotify.library')
... | apache-2.0 | Python |
802811e43524a93d3adb138a8159fc47775dc2bb | Return all tracks in stored playlists upon empty search query | tkem/mopidy,ali/mopidy,rawdlite/mopidy,quartz55/mopidy,hkariti/mopidy,ali/mopidy,priestd09/mopidy,jcass77/mopidy,jmarsik/mopidy,mokieyue/mopidy,diandiankan/mopidy,glogiotatidis/mopidy,woutervanwijk/mopidy,tkem/mopidy,abarisain/mopidy,dbrgn/mopidy,dbrgn/mopidy,pacificIT/mopidy,adamcik/mopidy,ZenithDK/mopidy,mokieyue/mop... | mopidy/backends/libspotify/library.py | mopidy/backends/libspotify/library.py | import logging
import multiprocessing
from spotify import Link
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
from mopidy.models import Playlist
logger = logging.getLogger('mopidy.backends.l... | import logging
import multiprocessing
from spotify import Link
from mopidy.backends.base import BaseLibraryController
from mopidy.backends.libspotify import ENCODING
from mopidy.backends.libspotify.translator import LibspotifyTranslator
logger = logging.getLogger('mopidy.backends.libspotify.library')
class Libspoti... | apache-2.0 | Python |
c4522ef2659e0f50bd240f9a3407721bc8ad6177 | add default post and pages | bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base | initial.py | initial.py | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | mit | Python |
363979820d537b940d334296e9b5a9b23c05a24e | fix unicode error | CARocha/sitioreddes,CARocha/sitioreddes,CARocha/sitioreddes | multimedia/models.py | multimedia/models.py | #encoding: utf-8
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from sorl.thumbnail import ImageField
from sitioreddes.utils import get_file_path
from taggit.managers import TaggableManager
from django.contrib.auth.models import U... | #encoding: utf-8
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from sorl.thumbnail import ImageField
from sitioreddes.utils import get_file_path
from taggit.managers import TaggableManager
from django.contrib.auth.models import U... | mit | Python |
5aa65dca88661220645df2ce598b83b04fce94d3 | Add some fields for display | kboard/kboard,kboard/kboard,hyesun03/k-board,hyesun03/k-board,guswnsxodlf/k-board,darjeeling/k-board,cjh5414/kboard,guswnsxodlf/k-board,cjh5414/kboard,hyesun03/k-board,kboard/kboard,guswnsxodlf/k-board,cjh5414/kboard | kboard/accounts/admin.py | kboard/accounts/admin.py | from django import forms
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from .models import Account
class UserCreationForm(forms.ModelForm):
password1 = ... | from django import forms
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from .models import Account
class UserCreationForm(forms.ModelForm):
password1 = ... | mit | Python |
01c50698e1640edb4417c71ec7a58ad034d5fda4 | Rename invalid model exception | QuLogic/ocropy,QuLogic/ocropy,mittagessen/kraken,mittagessen/kraken,mittagessen/kraken,mittagessen/kraken | kraken/lib/exceptions.py | kraken/lib/exceptions.py | # -*- coding: utf-8 -*-
"""
kraken.lib.exceptions
~~~~~~~~~~~~~~~~~~~~~
All custom exceptions raised by kraken's modules and packages. Packages should
always define their exceptions here.
"""
class KrakenRecordException(Exception):
def __init__(self, message=None):
Exception.__init__(self, message)
clas... | # -*- coding: utf-8 -*-
"""
kraken.lib.exceptions
~~~~~~~~~~~~~~~~~~~~~
All custom exceptions raised by kraken's modules and packages. Packages should
always define their exceptions here.
"""
class KrakenRecordException(Exception):
def __init__(self, message=None):
Exception.__init__(self, message)
| apache-2.0 | Python |
9113ea5813dabd746c2344e076bc3827aa2ec117 | Add restore functions to numpy.dual | efiring/numpy-work,jasonmccampbell/numpy-refactor-sprint,illume/numpy3k,efiring/numpy-work,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,chadnetzer/numpy-gaurdro,Ademan/NumPy-GSoC,efiring/numpy-work,chadnetzer/numpy-gaurdro,efir... | numpy/dual.py | numpy/dual.py | # This module should be used for functions both in numpy and scipy if
# you want to use the numpy version if available but the scipy version
# otherwise.
# Usage --- from numpy.dual import fft, inv
__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',
'inv','svd','solve','det','eig','eigvals','lstsq',
... | # This module should be used for functions both in numpy and scipy if
# you want to use the numpy version if available but the scipy version
# otherwise.
# Usage --- from numpy.dual import fft, inv
__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',
'inv','svd','solve','det','eig','eigvals','lstsq',
... | bsd-3-clause | Python |
ab823cb476c4b2244ab360e0ac9e95f26f06b972 | Bring back a needed import, and exclude it from flake checks | gentoo/identity.gentoo.org,gentoo/identity.gentoo.org,dastergon/identity.gentoo.org,dastergon/identity.gentoo.org | okupy/wsgi.py | okupy/wsgi.py | # vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
"""
WSGI config for okupy project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands disc... | # vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python
"""
WSGI config for okupy project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands disc... | agpl-3.0 | Python |
6fc1e3a51dbabe096478e78ceb6c3aaff95ead32 | test commit for website | opalmer/pyfarm,opalmer/pyfarm | trunk/pyfarm/client/master.py | trunk/pyfarm/client/master.py | # No shebang line, this module is meant to be imported
#
# This file is part of PyFarm.
# Copyright (C) 2008-2012 Oliver Palmer
#
# PyFarm is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version ... | # No shebang line, this module is meant to be imported
#
# This file is part of PyFarm.
# Copyright (C) 2008-2012 Oliver Palmer
#
# PyFarm is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version ... | apache-2.0 | Python |
9ca655edd5b03fadcb72fd976df6d77f9af8d277 | change quickstart | elastic-event-components/e2c,elastic-event-components/e2c,elastic-event-components/e2c,elastic-event-components/e2c | examples/python/quick_start/app.py | examples/python/quick_start/app.py | from e2c import E2c
config = (
'.run -- action',
'action.out -- print')
e2c = E2c[str, str](config)
e2c.actor('action', lambda data, out: out(data))
e2c.actor('print', lambda data: print(data))
e2c.visualize()
e2c.run('hello')
| from e2c import E2c
config = (
'.run -- action',
'action.out -- print',
'action.out -- print')
def print_data(x: int, data):
print(x, data)
e2c = E2c[str, str](config)
e2c.actor('action', lambda data, out: out(data, {'a': 1}))
e2c.actor('print', print_data)
e2c.visualize()
e2c.run('hello')
| apache-2.0 | Python |
deba1c0bb985fe62000b4474744df9ee1170a8a1 | Use numpy testing | Astroua/TurbuStat,e-koch/TurbuStat | turbustat/tests/test_delvar.py | turbustat/tests/test_delvar.py | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for Delta Variance
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import DeltaVariance, DeltaVariance_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, compute... | # Licensed under an MIT open source license - see LICENSE
'''
Test functions for Delta Variance
'''
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from ..statistics import DeltaVariance, DeltaVariance_Distance
from ._testing_data import \
dataset1, dataset2, computed_data, compute... | mit | Python |
57084fd911c5cef48da11d64b71763d8f922c038 | Check final memory usage, not peak memory usage, in Repeat_Load test | Zorro666/renderdoc,TurtleRockStudios/renderdoc_public,Zorro666/renderdoc,Zorro666/renderdoc,TurtleRockStudios/renderdoc_public,baldurk/renderdoc,Zorro666/renderdoc,baldurk/renderdoc,baldurk/renderdoc,baldurk/renderdoc,baldurk/renderdoc,TurtleRockStudios/renderdoc_public,baldurk/renderdoc,Zorro666/renderdoc,TurtleRockSt... | util/test/tests/Repeat_Load.py | util/test/tests/Repeat_Load.py | import rdtest
import os
import renderdoc as rd
class Repeat_Load(rdtest.TestCase):
slow_test = True
def repeat_load(self, path):
memory_usage = memory_baseline = 0
for i in range(20):
rdtest.log.print("Loading for iteration {}".format(i+1))
try:
contr... | import rdtest
import os
import renderdoc as rd
class Repeat_Load(rdtest.TestCase):
slow_test = True
def repeat_load(self, path):
memory_peak = memory_baseline = 0
for i in range(20):
rdtest.log.print("Loading for iteration {}".format(i))
try:
controll... | mit | Python |
77f410d03d4d182fd7210626ba804767768e3583 | Update C_Salinity_Vertical_sections.py | Herpinemmanuel/Oceanography | Cas_1/Salinity/C_Salinity_Vertical_sections.py | Cas_1/Salinity/C_Salinity_Vertical_sections.py | import numpy as np
import matplotlib.pyplot as plt
from xmitgcm import open_mdsdataset
plt.ion()
dir1 = '/homedata/bderembl/runmit/test_southatlgyre'
ds1 = open_mdsdataset(dir1,iters='all',prefix=['S'])
Height = ds1.S.Z
print(Height)
nx = len(ds1.S.XC)/2
print(nx)
ny = len(ds1.S.YC)/2
print(ny)
nt = -1 #... | import numpy as np
import matplotlib.pyplot as plt
from xmitgcm import open_mdsdataset
plt.ion()
dir1 = '/homedata/bderembl/runmit/test_southatlgyre'
ds1 = open_mdsdataset(dir1,iters='all',prefix=['S'])
Height = ds1.S.Z
print(Height)
nx = len(ds1.S.XC)/2
print(nx)
ny = len(ds1.S.YC)/2
print(ny)
nt = -1 #... | mit | Python |
2f76a3ef654a56f1f881c266da96f4fa72703d3d | fix extending command regardless of platform | alfredodeza/ceph-doctor | ceph_medic/util/hosts.py | ceph_medic/util/hosts.py | import json
from ceph_medic import config, terminal
from remoto import connection, process
def _platform_options(platform):
try:
namespace = config.file.get_safe(platform, 'namespace', 'rook-ceph')
context = config.file.get_safe(platform, 'context', None)
except RuntimeError:
namespace... | import json
from ceph_medic import config, terminal
from remoto import connection, process
def _platform_options(platform):
namespace = config.file.get_safe(platform, 'namespace', 'rook-ceph')
context = config.file.get_safe(platform, 'context', None)
return {'namespace': namespace, 'context': context}
d... | mit | Python |
e90211ac7a17118a085ab2cfdf621569ee7eab5a | Fix import path | freeekanayaka/charm-test,freeekanayaka/charmfixture | charmfixtures/testing.py | charmfixtures/testing.py | from testtools import (
TestCase,
try_import,
)
from charmfixtures.filesystem import Filesystem
from charmfixtures.users import Users
from charmfixtures.groups import Groups
from charmfixtures.hooktools.fixture import HookTools
hookenv = try_import("charmhelpers.core.hookenv")
class CharmTest(TestCase):
... | from testtools import (
TestCase,
try_import,
)
from charmfixtures.filesystem import Filesystem
from charmfixtures.users import Users
from charmfixtures.groups import Groups
from charmfixtures.hooktools.fixture import HookTools
hookenv = try_import("from charmhelpers.core.hookenv")
class CharmTest(TestCase)... | agpl-3.0 | Python |
cdd2e19aff6fcd86496c35bf39ac1f42d3139c31 | Fix test volume of interest to match data extents | keithroe/vtkoptix,sankhesh/VTK,candy7393/VTK,sumedhasingla/VTK,SimVascular/VTK,msmolens/VTK,sankhesh/VTK,demarle/VTK,gram526/VTK,sankhesh/VTK,candy7393/VTK,keithroe/vtkoptix,demarle/VTK,gram526/VTK,jmerkow/VTK,jmerkow/VTK,SimVascular/VTK,gram526/VTK,keithroe/vtkoptix,jmerkow/VTK,msmolens/VTK,SimVascular/VTK,candy7393/V... | Imaging/Core/Testing/Python/resampledTexture.py | Imaging/Core/Testing/Python/resampledTexture.py | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Demonstrate automatic resampling of textures (i.e., OpenGL only handles
# power of two texture maps. This examples exercise's vtk's automatic
# power of two resampling).
#
# get the... | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Demonstrate automatic resampling of textures (i.e., OpenGL only handles
# power of two texture maps. This examples exercise's vtk's automatic
# power of two resampling).
#
# get the... | bsd-3-clause | Python |
7240c24933e712fe98c8cb06670e66f470205e4c | Add start and end options as well as days back for harvesting | zamattiac/SHARE,laurenbarker/SHARE,aaxelb/SHARE,laurenbarker/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,zamattiac/SHARE,CenterForOpenScience/SHARE,CenterForOpenScience/SHARE,zamattiac/SHARE,aaxelb/SHARE | share/management/commands/harvest.py | share/management/commands/harvest.py | import arrow
import datetime
from django.apps import apps
from django.core.management.base import BaseCommand
from django.conf import settings
from share.models import ShareUser
from share.tasks import HarvesterTask
from share.provider import ProviderAppConfig
class Command(BaseCommand):
def add_arguments(self... | import datetime
from django.apps import apps
from django.core.management.base import BaseCommand
from django.conf import settings
from share.models import ShareUser
from share.tasks import HarvesterTask
from share.provider import ProviderAppConfig
class Command(BaseCommand):
def add_arguments(self, parser):
... | apache-2.0 | Python |
00ad8303d7b1dcdba9eebfd95ea4ef49662023a2 | Remove test_tvnamer from runtest [#85] | Collisionc/sickbeard_mp4_automator,Filechaser/sickbeard_mp4_automator,dpimenov/tvdb_api,phtagn/sickbeard_mp4_automator,Collisionc/sickbeard_mp4_automator,dbr/tvdb_api,Filechaser/sickbeard_mp4_automator,dpimenov/tvdb_api,phtagn/sickbeard_mp4_automator | tests/runtests.py | tests/runtests.py | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:unlicense (http://unlicense.org/)
import sys
import unittest
import test_tvdb_api
def main():
suite = unittest.TestSuite([
unittest.TestLoader().loadTestsFromModule(test_tvdb_api)
... | #!/usr/bin/env python
#encoding:utf-8
#author:dbr/Ben
#project:tvdb_api
#repository:http://github.com/dbr/tvdb_api
#license:unlicense (http://unlicense.org/)
import sys
import unittest
import test_tvdb_api
import test_tvnamer
def main():
suite = unittest.TestSuite([
unittest.TestLoader().loadTestsFromMod... | mit | Python |
c9da0810109479f32c746eaec8e8520448ea9ad1 | Bump version | Motiejus/django-webtopay,Motiejus/django-webtopay | webtopay/__init__.py | webtopay/__init__.py | __version__ = (1, 0, 1)
| __version__ = (1, 0, 0)
| mit | Python |
385938c0014c0dffcb8524ef99b374e15af99a34 | handle local imports more effectively; add initial stub XML classification document test | EsriOceans/btm | tests/testMain.py | tests/testMain.py | import os
import unittest
import numpy
import arcpy
from utils import *
# import our constants;
# configure test data
# XXX: use .ini files for these instead? used in other 'important' unit tests
from config import *
# import our local directory so we can use the internal modules
import_paths = ['../Insta... | import os
import sys
import unittest
import numpy
import arcpy
# import our local directory so we can use the internal modules
local_path = os.path.dirname(__file__)
scripts_path = os.path.join(local_path, '..', 'Install/toolbox')
abs_path = os.path.abspath(scripts_path)
sys.path.insert(0, abs_path)
from ... | mpl-2.0 | Python |
83bf1a8b682c1c6595bfe82749aac1b1077dc07b | fix style | jendrikseipp/vulture,jendrikseipp/vulture | whitelists/stdlib.py | whitelists/stdlib.py | """
Vulture sometimes reports used code as unused. To avoid these
false-positives, you can write a Python file that explicitly uses the
code and pass it to vulture:
vulture myscript.py mydir mywhitelist.py
This file explicitly uses code from the Python standard library that is
often incorrectly detected as unused.
... | """
Vulture sometimes reports used code as unused. To avoid these
false-positives, you can write a Python file that explicitly uses the
code and pass it to vulture:
vulture myscript.py mydir mywhitelist.py
This file explicitly uses code from the Python standard library that is
often incorrectly detected as unused.
... | mit | Python |
8fe19b02e565da38cd965174e21b80b229cae0a4 | test added. module must has version | oriontvv/pyaspeller | tests/test_cli.py | tests/test_cli.py | from __future__ import print_function
import unittest
import pyaspeller
class TestCLI(unittest.TestCase):
def setUp(self):
print("setUp")
pyaspeller.main()
def tearDown(self):
print("tearDown")
def test_pyaspeller_has_version(self):
self.assertTrue(hasattr(pyasp... | from __future__ import print_function
import unittest
import pyaspeller
class TestCLI(unittest.TestCase):
def setUp(self):
print("setUp")
pyaspeller.main()
def tearDown(self):
print("tearDown")
def test_simple(self):
self.assertTrue(2 * 2 == 4, "simple")
def test_s... | apache-2.0 | Python |
44cb01a4ed7f1fcae4cd76c367a479b389e59418 | Update test_toy.py | iminuit/probfit,iminuit/probfit | tests/test_toy.py | tests/test_toy.py | import numpy as np
import matplotlib
matplotlib.use('Agg', warn=False)
from probfit.nputil import mid
from probfit.pdf import crystalball, gaussian, doublecrystalball
from probfit.functor import Normalized
from probfit.toy import gen_toy
from probfit._libstat import compute_chi2
from probfit.nputil import vector_apply
... | import numpy as np
import matplotlib
matplotlib.use('Agg', warn=False)
from probfit.nputil import mid
from probfit.pdf import crystalball, gaussian
from probfit.functor import Normalized
from probfit.toy import gen_toy
from probfit._libstat import compute_chi2
from probfit.nputil import vector_apply
from probfit.costfu... | mit | Python |
03b2aff24014d8860e308486d7fc0256d3e903f3 | change item status | pbl-cloud/paas-manager,pbl-cloud/paas-manager,pbl-cloud/paas-manager | paas_manager/app/app.py | paas_manager/app/app.py | from flask import Flask, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
class Item:
def __init__(item, name, filename, status):
item.name = name
item.filename = filename
item.status = status
items = []
@app.route("/")
def view_index():
return render_te... | from flask import Flask, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
class Item:
def __init__(item, name, filename, status):
item.name = name
item.filename = filename
item.status = status
items = []
@app.route("/")
def view_index():
return render_te... | mit | Python |
789ac1de1e94eda1224fb314ccad14c061c58ad4 | Create empty PactGroup if no arguments given | vmalloc/pact | pact/group.py | pact/group.py | from .base import PactBase
from .utils import GroupWaitPredicate
class PactGroup(PactBase):
def __init__(self, pacts=None):
self._pacts = [] if pacts is None else list(pacts)
super(PactGroup, self).__init__()
def __iadd__(self, other):
self._pacts.append(other)
return self
... | from .base import PactBase
from .utils import GroupWaitPredicate
class PactGroup(PactBase):
def __init__(self, pacts):
self._pacts = list(pacts)
super(PactGroup, self).__init__()
def __iadd__(self, other):
self._pacts.append(other)
return self
def _is_finished(self):
... | bsd-3-clause | Python |
198d399f0339b1a1b856721cabb3f4c66c203b92 | fix bug | myyyy/wechatserver | wechatclient/clinet.py | wechatclient/clinet.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
import os
import json
import tornado
import tornado.web
import tornado.ioloop
from tornado import gen
from tornado.gen import coroutine
from wechatpy import WeChatClient
from wechatpy.parser import parse_message
import json... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
import os
import json
import tornado
import tornado.web
import tornado.ioloop
from tornado import gen
from tornado.gen import coroutine
from wechatpy import WeChatClient
from wechatpy.parser import parse_message
import json... | mit | Python |
c1e1fc49a92b1c608293adad4810df1ff4f08f19 | fix import order | vicalloy/django-lb-workflow,vicalloy/django-lb-workflow,vicalloy/django-lb-workflow | lbworkflow/tests/urls.py | lbworkflow/tests/urls.py | from django.conf.urls import include
from django.conf.urls import url
urlpatterns = [
url(r'^wf/', include('lbworkflow.urls')),
]
| from django.conf.urls import url
from django.conf.urls import include
urlpatterns = [
url(r'^wf/', include('lbworkflow.urls')),
]
| mit | Python |
927bd523d7f42d9fc151b2cf223107f93846a77b | remove utf8 annotations | ResolveWang/WeiboSpider,ResolveWang/WeiboSpider | logger/log.py | logger/log.py | import os
import logging
import logging.config as log_conf
log_dir = os.path.dirname(os.path.dirname(__file__))+'/logs'
if not os.path.exists(log_dir):
os.mkdir(log_dir)
log_path = os.path.join(log_dir, 'weibo.log')
log_config = {
'version': 1.0,
'formatters': {
'detail': {
'format': ... | # coding:utf-8
import os
import logging
import logging.config as log_conf
log_dir = os.path.dirname(os.path.dirname(__file__))+'/logs'
if not os.path.exists(log_dir):
os.mkdir(log_dir)
log_path = os.path.join(log_dir, 'weibo.log')
log_config = {
'version': 1.0,
'formatters': {
'detail': {
... | mit | Python |
7b40cb4f7e1e01d8b0e63c7310867cd1b7daf48e | update version | arcticfoxnv/slackminion,arcticfoxnv/slackminion | slackminion/plugins/core/__init__.py | slackminion/plugins/core/__init__.py | version = '0.9.11'
| version = '0.9.10'
| mit | Python |
df3a1860ec4debc432ad214a0b88e6461cb30879 | Fix octohatrack.py | glasnt/octohat,LABHR/octohatrack | octohatrack.py | octohatrack.py | import octohatrack
octohatrack.main()
| import octohat
octohat.main()
| bsd-3-clause | Python |
d1ec190f1a4dc84db0540481f2489f1db8421799 | Enable specifying the password in `config.ini` | oemof/oemof.db | oemof_pg/db.py | oemof_pg/db.py | from configparser import NoOptionError as option, NoSectionError as section
from sqlalchemy import create_engine
import keyring
from . import config as cfg
def connection():
pw = keyring.get_password(cfg.get("postGIS", "database"),
cfg.get("postGIS", "username"))
if pw is None:
... | from sqlalchemy import create_engine
import keyring
from . import config as cfg
def connection():
engine = create_engine(
"postgresql+psycopg2://{user}:{passwd}@{host}:{port}/{db}".format(
user=cfg.get("postGIS", "username"),
passwd=keyring.get_password(
cfg.get("po... | mit | Python |
2ae5c6cb0a82e15ee224b2772b9390c6caf764af | Remove unused code | stevecshanks/trello-next-actions | nextactions/board.py | nextactions/board.py | from nextactions.list import List
class Board:
def __init__(self, trello, json):
self._trello = trello
self.id = json['id']
self.name = json['name']
def getLists(self):
json = self._trello.get(
'https://api.trello.com/1/boards/' + self.id + '/lists',
{... | from nextactions.list import List
class Board:
def __init__(self, trello, json):
self._trello = trello
self.id = json['id']
self.name = json['name']
# TODO remove me
self.nextActionList = []
def getLists(self):
json = self._trello.get(
'https://api... | mit | Python |
d66c95a6441d9c872819916d80b70f15580580eb | create a command line interface | ioO/nommer | nommer_cli.py | nommer_cli.py | import argparse
from nommer import *
def main():
parser = argparse.ArgumentParser()
parser.add_argument("words", help="list of words separated by coma", type=str)
args = parser.parse_args()
if args.words:
names = process(args.words)
display(names)
def process(words):
word_list = wo... | unlicense | Python | |
d50281dcaee29d9879ec88e517a723b5fafe6cdf | fix ics files for outlook 2003 | allink/woodstock | woodstock/views/ics.py | woodstock/views/ics.py | from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from woodstock.models import EventPart
from woodstock.views.decorators import registration_required
from woodstock import settings
import icalendar
import datetime
import random
import hashlib
def _event_part_ics(event_parts):
ca... | from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from woodstock.models import EventPart
from woodstock.views.decorators import registration_required
from woodstock import settings
import icalendar
import datetime
import random
import hashlib
def _event_part_ics(event_parts):
ca... | bsd-3-clause | Python |
33dcaee26c1df5ce690eeb9c2104904bb49043a3 | create classifier for each request | mgp4/prague-transport-2017,mgp4/prague-transport-2017,mgp4/prague-transport-2017 | task2/task.py | task2/task.py | from sklearn import tree
def prepare_classifier(clf, data):
target = []
_input = []
for a in data:
target.append(a['type'])
_input.append((a['noise-level'], a['brake-distance'], a['vibrations']))
clf.fit(_input, target)
def predict(clf, data):
result = []
for a in data:
... | from sklearn import tree
clf = tree.DecisionTreeClassifier()
def prepare_classifier(data):
target = []
_input = []
for a in data:
target.append(a['type'])
_input.append((a['noise-level'], a['brake-distance'], a['vibrations']))
clf.fit(_input, target)
def predict(data):
result = [... | mit | Python |
b73e7fb61b08c3322ba0c6796d87ec79f5451a93 | Update exceptions.py | Intelworks/cabby | taxii_client/exceptions.py | taxii_client/exceptions.py |
class ClientException(Exception):
pass
class UnsuccessfulStatusError(ClientException):
def __init__(self, taxii_status, *args, **kwargs):
super(UnsuccessfulStatusError, self).__init__(status_to_message(taxii_status), *args, **kwargs)
self.status = taxii_status.status_type
self.text... |
class ClientException(Exception):
pass
class UnsuccessfulStatusError(ClientException):
def __init__(self, taxii_status, *args, **kwargs):
super(UnsuccessfulStatusError, self).__init__(status_to_message(taxii_status), *args, **kwargs)
self.status = taxii_status.status_type
self.text... | bsd-3-clause | Python |
836002d3d0957ea74e6d456afb5bdfd282377875 | use correct template names | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/extend.py | salt/utils/extend.py | # -*- coding: utf-8 -*-
'''
SaltStack Extend
'''
from __future__ import absolute_import
from datetime import date
import tempfile
from shutil import copytree
import logging
log = logging.getLogger(__name__)
try:
from cookiecutter.main import cookiecutter as cookie
import cookiecutter.prompt as prompt
HAS_... | # -*- coding: utf-8 -*-
'''
SaltStack Extend
'''
from __future__ import absolute_import
from datetime import date
import tempfile
from shutil import copytree
try:
import logging
log = logging.getLogger(__name__)
from cookiecutter.main import cookiecutter as cookie
import cookiecutter.prompt as prompt
... | apache-2.0 | Python |
3f9685420f55fbfb910744a1d5d9c6aa0f29b78e | Set version to 0.5.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | saltcloud/version.py | saltcloud/version.py | __version_info__ = (0, 5, 0)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (0, 2)
__version__ = '.'.join(map(str, __version_info__))
| apache-2.0 | Python |
2a65ca70cb35983ce2b7d2f921e816780855731b | Test kifparse()/kifserialize() invariance. | pySUMO/pysumo,pySUMO/pysumo | test/lib/parser.py | test/lib/parser.py | """ The PyUnit test framework for the parser. """
import unittest
import subprocess
from tempfile import mkdtemp
from shutil import rmtree
from lib import parser
class wParseTestCase(unittest.TestCase):
def test0Tokenize(self):
line = '10495555 18 n 05 pusher 1 drug_peddler 0 peddler 1 drug_dealer 0 drug... | """ The PyUnit test framework for the parser. """
import unittest
from lib import parser
class wParseTestCase(unittest.TestCase):
def test0Tokenize(self):
line = '10495555 18 n 05 pusher 1 drug_peddler 0 peddler 1 drug_dealer 0 drug_trafficker 0 004 @ 10721470 n 0000 @ 09977660 n 0000 + 02302817 v 0301 +... | bsd-2-clause | Python |
901a47adf6726d50c01ac743e9661c0caac2b555 | Check to ensure the excpetions return the text we expect. | golliher/dg-tickler-file | test_openfolder.py | test_openfolder.py | import pytest
from mock import patch, MagicMock
from open_folder import *
def test_folder_exists():
with patch('subprocess.check_call', MagicMock(return_value="NOOP")):
result = open_folder(".")
assert result == None
def test_folder_does_not_exists():
with patch('subprocess.check_call', Magic... | import pytest
from mock import patch, MagicMock
from open_folder import *
def test_folder_exists():
with patch('subprocess.check_call', MagicMock(return_value="NOOP")):
result = open_folder(".")
assert result == None
def test_folder_does_not_exists():
with patch('subprocess.check_call', Magic... | mit | Python |
b8ae587da8b3cecf6b1f2fbe8899f0629e24448b | remove main mathod | rahulrrixe/libcloudCLI | libcloudcli/configure.py | libcloudcli/configure.py | import os
import re
import sys
import logging
import configparser
def readConfigure():
try:
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# currently config.ini is in example folder
config_path = os.path.join(root, 'examples/config.ini')
# TODO: There is a bet... | import os
import re
import sys
import logging
import configparser
def main():
try:
root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
# currently config.ini is in example folder
config_path = os.path.join(root, 'examples/config.ini')
# TODO: There is a better way t... | apache-2.0 | Python |
4a4b1ec09d0c0757ff5dd5a91ab59406903f96fa | Fix api routes | alexandermendes/pybossa-analyst,LibCrowds/libcrowds-analyst,alexandermendes/pybossa-analyst,alexandermendes/pybossa-analyst | libcrowds_analyst/api.py | libcrowds_analyst/api.py | # -*- coding: utf8 -*-
import json
from rq import Queue
from redis import Redis
from flask import Blueprint, request, current_app, jsonify, abort
from libcrowds_analyst import analysis
BP = Blueprint('api', __name__)
QUEUE = Queue('libcrowds_analyst', connection=Redis())
MINUTE = 60
def analyse(func):
"""Analy... | # -*- coding: utf8 -*-
import json
from rq import Queue
from redis import Redis
from flask import Blueprint, request, current_app, jsonify, abort
from libcrowds_analyst import analysis
BP = Blueprint('api', __name__)
QUEUE = Queue('libcrowds_analyst', connection=Redis())
MINUTE = 60
def analyse(func):
"""Analy... | unknown | Python |
2d7dbe1a30edd2a915e8b1b60db8fe8dbf6402e0 | bump version | ingresse/message-queue-python | message_queue/__init__.py | message_queue/__init__.py | __version__ = '0.3.3'
from message_queue.logger import *
from message_queue.publisher import Publisher
from message_queue.message import Message
from message_queue.subscriber import Subscriber
from message_queue.adapters import *
| __version__ = '0.3.2'
from message_queue.logger import *
from message_queue.publisher import Publisher
from message_queue.message import Message
from message_queue.subscriber import Subscriber
from message_queue.adapters import *
| bsd-3-clause | Python |
abd85c1ade671ba991caacd73dad0dc77190c865 | Fix upload field character limit | cweems/sendcertified,cweems/sendcertified,cweems/sendcertified | main/forms.py | main/forms.py | from django import forms
from .models import MailOrder
from tinymce.widgets import TinyMCE
class GoogleAddressForm(forms.Form):
sender_street_number = forms.CharField(max_length=100, required=False, widget=forms.HiddenInput())
sender_route = forms.CharField(max_length=100, required=False, widget=forms.HiddenIn... | from django import forms
from .models import MailOrder
from tinymce.widgets import TinyMCE
class GoogleAddressForm(forms.Form):
sender_street_number = forms.CharField(max_length=100, required=False, widget=forms.HiddenInput())
sender_route = forms.CharField(max_length=100, required=False, widget=forms.HiddenIn... | mit | Python |
a9b2b5acd3b629aeb7d6254f3a346619028fe9ba | Add sketch column | alanhdu/nycodex | nycodex/db/schema.py | nycodex/db/schema.py | import enum
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from .base import Base
from .utils import UpsertMixin
@enum.unique
class AssetType(enum.Enum):
calendar = "calendar"
chart = "chart"
datalens = "datalens"
dataset = "dataset"
file = "file"
filter = "filter"
hr... | import enum
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from .base import Base
from .utils import UpsertMixin
@enum.unique
class AssetType(enum.Enum):
calendar = "calendar"
chart = "chart"
datalens = "datalens"
dataset = "dataset"
file = "file"
filter = "filter"
hr... | apache-2.0 | Python |
b13ecb2e802f832d028e246f5edc88ec36844da2 | Bump minor version | ForeverWintr/metafunctions | metafunctions/__init__.py | metafunctions/__init__.py | __version__ = '0.2.1'
| __version__ = '0.2.0'
| mit | Python |
ae8c3b4817dfd9d47275c8ddfe9240ae1825b4e2 | Fix argument | lightning-viz/lightning-python,garretstuber/lightning-python,peterkshultz/lightning-python,lightning-viz/lightning-python,garretstuber/lightning-python,garretstuber/lightning-python,peterkshultz/lightning-python,peterkshultz/lightning-python | lightning/types/three.py | lightning/types/three.py | from lightning.types.base import Base
from lightning.types.decorators import viztype
from lightning.types.utils import vecs_to_points_three, add_property
from numpy import ndarray, asarray
from lightning.types.utils import array_to_im
@viztype
class Scatter3(Base):
_name = 'scatter-3'
_func = 'scatter3'
... | from lightning.types.base import Base
from lightning.types.decorators import viztype
from lightning.types.utils import vecs_to_points_three, add_property
from numpy import ndarray, asarray
from lightning.types.utils import array_to_im
@viztype
class Scatter3(Base):
_name = 'scatter-3'
_func = 'scatter3'
... | mit | Python |
224dec2f90350c7fd8266a8421a0df199084c7ce | Read site configuration file in wmt-script | csdms/wmt-exe,csdms/wmt-exe,csdms/wmt-exe,csdms/wmt-exe | wmtexe/cmd/script.py | wmtexe/cmd/script.py | """Launch a WMT simulation using `bash` or `qsub`."""
from __future__ import print_function
import sys
import os
from ..launcher import BashLauncher, QsubLauncher, SbatchLauncher
from ..config import load_configuration
_LAUNCHERS = {
'bash': BashLauncher,
'qsub': QsubLauncher,
'sbatch': SbatchLauncher,
... | """Launch a WMT simulation using `bash` or `qsub`."""
from __future__ import print_function
import sys
import os
from ..launcher import BashLauncher, QsubLauncher, SbatchLauncher
_LAUNCHERS = {
'bash': BashLauncher,
'qsub': QsubLauncher,
'sbatch': SbatchLauncher,
}
def main():
import argparse
... | mit | Python |
8bbcd20e119a3241cfb022945bfbe59ebb0f6cf3 | Fix bad function call in memoization | MOLSSI-BSE/basis_set_exchange | basis_set_exchange/memo.py | basis_set_exchange/memo.py | '''
Class/decorator for memoizing BSE functionality
'''
import functools
import pickle
import inspect
# If set to True, memoization of some internal functions
# will be used. Generally safe to leave enabled - it
# won't use that much memory
memoize_enabled = True
def _make_key(args_spec, *args, **kwargs):
left_... | '''
Class/decorator for memoizing BSE functionality
'''
import functools
import pickle
import inspect
# If set to True, memoization of some internal functions
# will be used. Generally safe to leave enabled - it
# won't use that much memory
memoize_enabled = True
def _make_key(args_spec, *args, **kwargs):
left_... | bsd-3-clause | Python |
75f1f5891b0e5dbe5562dac7b488ed731dbab3fb | Add CAN_DETECT | sounak98/coala-bears,Vamshi99/coala-bears,SanketDG/coala-bears,LWJensen/coala-bears,chriscoyfish/coala-bears,damngamerz/coala-bears,refeed/coala-bears,coala/coala-bears,Shade5/coala-bears,yashtrivedi96/coala-bears,ku3o/coala-bears,refeed/coala-bears,vijeth-aradhya/coala-bears,ankit01ojha/coala-bears,naveentata/coala-be... | bears/rest/reSTLintBear.py | bears/rest/reSTLintBear.py | from restructuredtext_lint import lint
from coalib.bears.LocalBear import LocalBear
from coalib.bears.requirements.PipRequirement import PipRequirement
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
class reSTLintBear(LocalBear):
LANGUAGES = {"reStructuredText... | from restructuredtext_lint import lint
from coalib.bears.LocalBear import LocalBear
from coalib.bears.requirements.PipRequirement import PipRequirement
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
class reSTLintBear(LocalBear):
LANGUAGES = {"reStructuredText... | agpl-3.0 | Python |
b8638ab2befa55029f2aeb8a907acb1a94aba3a9 | Decrease sensitivity of dark ground checking. | legorovers/legoflask,legorovers/legoflask,legorovers/legoflask | app/rules.py | app/rules.py |
class Rule(object):
def __init__(self, trigger, actions):
self.trigger = trigger
print "trigger: %s" % trigger
self.code = []
time = 0
for a in actions:
print "action: %s" % a
if a == 'back':
action = ('reverse', 40)
elif... |
class Rule(object):
def __init__(self, trigger, actions):
self.trigger = trigger
print "trigger: %s" % trigger
self.code = []
time = 0
for a in actions:
print "action: %s" % a
if a == 'back':
action = ('reverse', 40)
elif... | bsd-2-clause | Python |
191ce55833aee3f9b313da78918bc3a9a4fe8f58 | Test #84 | borntyping/python-colorlog | colorlog/tests/conftest.py | colorlog/tests/conftest.py | """Fixtures that can be used in other tests."""
from __future__ import print_function
import inspect
import logging
import sys
import pytest
import colorlog
class TestingStreamHandler(logging.StreamHandler):
"""Raise errors to be caught by py.test instead of printing to stdout."""
def handleError(self, r... | """Fixtures that can be used in other tests."""
from __future__ import print_function
import inspect
import logging
import sys
import pytest
import colorlog
class TestingStreamHandler(logging.StreamHandler):
"""Raise errors to be caught by py.test instead of printing to stdout."""
def handleError(self, r... | mit | Python |
120822fe10326fad9e7b9e82a2ac9a6d4f09821b | Set version for next tag | tskisner/pytoast,tskisner/pytoast | toast/_version.py | toast/_version.py | __version__ = '2.01'
| __version__ = '2.0'
| bsd-2-clause | Python |
5ba54bcea283361bdd97cd35354a8490f2ee6c7b | Work around a docutils bug. | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | tools/demodata.py | tools/demodata.py | #!/usr/bin/python
import sys, os, urllib
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)
# Work around http://sourceforge.net/p/docutils/bugs/214/
import docutils.utils
import admin, store, config
cfg = config.Config(root+'/config.ini')
st = store.Store(cfg)
# classifiers
for... | #!/usr/bin/python
import sys, os, urllib
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)
import admin, store, config
cfg = config.Config(root+'/config.ini')
st = store.Store(cfg)
# classifiers
for c in urllib.urlopen("http://pypi.python.org/pypi?%3Aaction=list_classifiers").r... | bsd-3-clause | Python |
da48827efd87a60386316d835aa1d79aaf366da3 | fix name | xuhdev/nikola,damianavila/nikola,getnikola/nikola,immanetize/nikola,getnikola/nikola,Proteus-tech/nikola,okin/nikola,x1101/nikola,immanetize/nikola,s2hc-johan/nikola,JohnTroony/nikola,xuhdev/nikola,jjconti/nikola,andredias/nikola,jjconti/nikola,andredias/nikola,wcmckee/nikola,yamila-moreno/nikola,knowsuchagency/nikola,... | nikola/plugins/task_render_sources.py | nikola/plugins/task_render_sources.py | import os
from nikola.plugin_categories import Task
from nikola import utils
class Sources(Task):
"""Copy page sources into the output."""
name = "render_sources"
def gen_tasks(self):
"""Publish the page sources into the output.
Required keyword arguments:
translations
... | import os
from nikola.plugin_categories import Task
from nikola import utils
class Sources(Task):
"""Copy page sources into the output."""
name = "render_sources"
def gen_tasks(self):
"""Publish the page sources into the output.
Required keyword arguments:
translations
... | mit | Python |
2d4063e936b3e739d03145891135fa0349e9a53d | fix spelling of `render_admin_panel` in the definition of the `IAdminPanelProvider` interface | rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac | trac/admin/api.py | trac/admin/api.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists ... | bsd-3-clause | Python |
790de15cc1a1eb680af319346ef8f90cfe8caffc | Add basic models. | GeneralMaximus/secondhand | tracker/models.py | tracker/models.py | from django.db import models
from django.contrib.auth.models import User
class Task(models.Model):
name = models.DateTimeField()
user = models.ForeignKey(User)
class WorkSession(models.Model):
task = models.ForeignKey('Task')
user = models.ForeignKey(User)
start_time = models.DateTimeField()
... | from django.db import models
# Create your models here.
| mit | Python |
3214f9ab9ca35ca227377459eed77a9e97d8997a | Remove unused module | mjschultz/django-tracking2,bruth/django-tracking2,bruth/django-tracking2 | tracking/views.py | tracking/views.py | import logging
from datetime import timedelta
from django import forms
from django.shortcuts import render
from django.contrib.auth.decorators import permission_required
from django.utils.timezone import now
from tracking.models import Visitor, Pageview
from tracking.settings import TRACK_PAGEVIEWS
log = logging.ge... | import logging
import calendar
from datetime import timedelta
from django import forms
from django.shortcuts import render
from django.contrib.auth.decorators import permission_required
from django.utils.timezone import now
from tracking.models import Visitor, Pageview
from tracking.settings import TRACK_PAGEVIEWS
... | bsd-2-clause | Python |
5a714bb3878890e5f4b36503585d361263103c7d | Remove dev only app | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/server/test_settings.py | nodeconductor/server/test_settings.py | # Django test settings for nodeconductor project.
from nodeconductor.server.base_settings import *
SECRET_KEY = 'test-key'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_AP... | # Django test settings for nodeconductor project.
from nodeconductor.server.base_settings import *
SECRET_KEY = 'test-key'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_AP... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.