commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
4fa157dbb0fc7323ca89b3e655469062935f84c1
Main.py
Main.py
"""Main Module of PDF Splitter""" import argparse import os from PyPDF2 import PdfFileWriter from Util import all_pdf_files_in_directory, split_on_condition, concat_pdf_pages parser = \ argparse.ArgumentParser( description='Split all the pages of multiple PDF files in a directory by document number' ...
"""Main Module of PDF Splitter""" import argparse import os from PyPDF2 import PdfFileWriter from Util import all_pdf_files_in_directory, split_on_condition, concat_pdf_pages parser = \ argparse.ArgumentParser( description='Split all the pages of multiple PDF files in a directory by document number' ...
Refactor main as a separate function
Refactor main as a separate function
Python
mit
shunghsiyu/pdf-processor
a4740e9c2bf2e582ab78b8fa1aaf904c72501ee2
multivid_cl.py
multivid_cl.py
#!/usr/bin/env python import search import tmap if __name__ == "__main__": from pprint import pprint as pp import sys to_dict = lambda r: r.to_dict() h = search.HuluSearch() a = search.AmazonSearch() n = search.NetflixSearch() # get the query from the first argument or from user input ...
#!/usr/bin/env python import search import tmap if __name__ == "__main__": from pprint import pprint as pp import sys to_dict = lambda r: r.to_dict() h = search.HuluSearch() a = search.AmazonSearch() n = search.NetflixSearch() # get the query from the first argument or from user input ...
Change CL to require a non-blank query
Change CL to require a non-blank query
Python
mit
jasontbradshaw/multivid,jasontbradshaw/multivid
d92c2dba7e549cee8059ecf4f1017956a630cd7a
web3/utils/validation.py
web3/utils/validation.py
from eth_utils import ( is_address, is_checksum_address, is_checksum_formatted_address, is_dict, is_list_like, ) def validate_abi(abi): """ Helper function for validating an ABI """ if not is_list_like(abi): raise ValueError("'abi' is not a list") for e in abi: ...
from eth_utils import ( is_address, is_checksum_address, is_checksum_formatted_address, is_dict, is_list_like, ) def validate_abi(abi): """ Helper function for validating an ABI """ if not is_list_like(abi): raise ValueError("'abi' is not a list") for e in abi: ...
Raise error specific to address checksum failure
Raise error specific to address checksum failure Because is_address() also checks for a valid checksum, the old code showed a generic "not an address" error if the checksum failed.
Python
mit
pipermerriam/web3.py
6a827bee5263c9bb5d34d6ac971581c62e827e7d
pinax/comments/models.py
pinax/comments/models.py
from datetime import datetime from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Comm...
from datetime import datetime from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models class Comment(models.Model): author = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, rel...
Change syntax to drop support
Change syntax to drop support
Python
mit
pinax/pinax-comments,pinax/pinax-comments,eldarion/dialogos
af51ef98d8575e7832d79c1068c092d388866dcb
donut/donut_SMTP_handler.py
donut/donut_SMTP_handler.py
from logging.handlers import SMTPHandler DEV_TEAM_EMAILS_QUERY = '''SELECT DISTINCT email FROM members NATURAL JOIN current_position_holders NATURAL JOIN positions NATURAL JOIN groups WHERE group_name = "Devteam" ''' class DonutSMTPHandler(SMTPHandler): def __init__(self, ...
from logging.handlers import SMTPHandler DEV_TEAM_EMAILS_QUERY = '''SELECT DISTINCT email FROM members NATURAL JOIN current_position_holders NATURAL JOIN positions NATURAL JOIN groups WHERE group_name = "Devteam" ''' DEFAULT_DEV_TEAM_EMAILS = ['devteam@donut.caltech.edu'] class DonutS...
Allow error email to still be sent if DB is down
Allow error email to still be sent if DB is down We were seeing errors in the logs where the database was inaccessible, but the errors were not being emailed out because the handler makes a DB query.
Python
mit
ASCIT/donut,ASCIT/donut,ASCIT/donut
185f429f2a4309addf446fb382434e1a0ecafb9a
crm_employees/models/crm_employees_range.py
crm_employees/models/crm_employees_range.py
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields class CrmEmployeesRa...
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields class CrmEmployeesRa...
Set some fields as tranlate
Set some fields as tranlate
Python
agpl-3.0
Therp/partner-contact,open-synergy/partner-contact,diagramsoftware/partner-contact,Endika/partner-contact,acsone/partner-contact
78b62cd865b5c31a17c982b78dc91127ebf54525
erpnext/patches/may_2012/same_purchase_rate_patch.py
erpnext/patches/may_2012/same_purchase_rate_patch.py
def execute(): import webnotes gd = webnotes.model.code.get_obj('Global Defaults') gd.doc.maintain_same_rate = 1 gd.doc.save() gd.on_update()
def execute(): import webnotes from webnotes.model.code import get_obj gd = get_obj('Global Defaults') gd.doc.maintain_same_rate = 1 gd.doc.save() gd.on_update()
Maintain same rate throughout pur cycle: in global defaults, by default set true
Maintain same rate throughout pur cycle: in global defaults, by default set true
Python
agpl-3.0
rohitwaghchaure/digitales_erpnext,gangadhar-kadam/smrterp,pombredanne/erpnext,saurabh6790/test-med-app,gangadharkadam/johnerp,indictranstech/erpnext,hernad/erpnext,gangadhar-kadam/helpdesk-erpnext,gangadhar-kadam/mic-erpnext,mbauskar/Das_Erpnext,hernad/erpnext,Tejal011089/huntercamp_erpnext,saurabh6790/ON-RISAPP,mbausk...
840af484f3b0f615167adf9600263e0d8c2e3875
wrappers/python/setup.py
wrappers/python/setup.py
from distutils.core import setup import os PKG_VERSION = os.environ.get('PACKAGE_VERSION') or '1.9.0' setup( name='python3-indy', version=PKG_VERSION, packages=['indy'], url='https://github.com/hyperledger/indy-sdk', license='MIT/Apache-2.0', author='Vyacheslav Gudkov', author_email='vyach...
from distutils.core import setup import os PKG_VERSION = os.environ.get('PACKAGE_VERSION') or '1.9.0' setup( name='python3-indy', version=PKG_VERSION, packages=['indy'], url='https://github.com/hyperledger/indy-sdk', license='MIT/Apache-2.0', author='Vyacheslav Gudkov', author_email='vyach...
Remove install dependency of pytest from python wrapper
Remove install dependency of pytest from python wrapper Signed-off-by: Daniel Bluhm <6df8625bb799b640110458f819853f591a9910cb@sovrin.org>
Python
apache-2.0
Artemkaaas/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/indy-sdk,peacekeeper/...
061e0e0702025d99956b7dc606ea0bb4fa5c84ea
flocker/restapi/_logging.py
flocker/restapi/_logging.py
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ This module defines the Eliot log events emitted by the API implementation. """ __all__ = [ "JSON_REQUEST", "REQUEST", ] from eliot import Field, ActionType LOG_SYSTEM = u"api" METHOD = Field(u"method", lambda method: method, ...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ This module defines the Eliot log events emitted by the API implementation. """ __all__ = [ "JSON_REQUEST", "REQUEST", ] from eliot import Field, ActionType LOG_SYSTEM = u"api" METHOD = Field(u"method", lambda method: method, ...
Address review comment: Better documentation.
Address review comment: Better documentation.
Python
apache-2.0
Azulinho/flocker,moypray/flocker,wallnerryan/flocker-profiles,mbrukman/flocker,w4ngyi/flocker,adamtheturtle/flocker,runcom/flocker,mbrukman/flocker,LaynePeng/flocker,achanda/flocker,jml/flocker,hackday-profilers/flocker,AndyHuu/flocker,jml/flocker,lukemarsden/flocker,LaynePeng/flocker,achanda/flocker,1d4Nf6/flocker,Azu...
d2536523770a59ed60bf27e8c0e456a33ca1a804
billabong/tests/test_main.py
billabong/tests/test_main.py
# Copyright (c) 2015 "Hugo Herter http://hugoherter.com" # # This file is part of Billabong. # # Intercom is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your o...
# Copyright (c) 2015 "Hugo Herter http://hugoherter.com" # # This file is part of Billabong. # # Intercom is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your o...
Add test for cli 'add' command
Add test for cli 'add' command
Python
agpl-3.0
hoh/Billabong,hoh/Billabong
32ca774aca8fd60a26f6144a98f25fa8b65ad22b
yak/rest_social_auth/serializers.py
yak/rest_social_auth/serializers.py
from django.contrib.auth import get_user_model from rest_framework import serializers from yak.rest_user.serializers import SignUpSerializer User = get_user_model() class SocialSignUpSerializer(SignUpSerializer): password = serializers.CharField(required=False, write_only=True) class Meta: model = U...
from django.contrib.auth import get_user_model from rest_framework import serializers from yak.rest_user.serializers import LoginSerializer User = get_user_model() class SocialSignUpSerializer(LoginSerializer): fullname = serializers.CharField(read_only=True) username = serializers.CharField(read_only=True) ...
Update social sign up serializer to avoid new validation on regular sign up
Update social sign up serializer to avoid new validation on regular sign up
Python
mit
ParableSciences/YAK-server,sventech/YAK-server,yeti/YAK-server,sventech/YAK-server,ParableSciences/YAK-server,yeti/YAK-server
a42b6d1faa38f92b21d74c1cf258f4b0e9800401
search/urls.py
search/urls.py
from django.conf.urls import patterns, url from django.views.generic import TemplateView from core.auth import perm import search.views urlpatterns = patterns('', url(r'^document/$', perm('any', search.views.DocumentSearchTemplate), name='search'), url(r'^document/query/$',perm('any', search.views.Docum...
from django.conf.urls import patterns, url from django.views.generic import TemplateView from core.auth import perm import search.views urlpatterns = patterns('', url(r'^document/$', perm('any', search.views.DocumentSearchTemplate), name='search'), url(r'^document/query/$',perm('any', search.views.Docum...
Allow any logged-in user to perform image searches.
Allow any logged-in user to perform image searches.
Python
mit
occrp/id-backend
afc0ace0767e29f8c2b71ed5ba7f8139e24fc020
categories/serializers.py
categories/serializers.py
from .models import Category, Keyword, Subcategory from rest_framework import serializers class CategorySerializer(serializers.ModelSerializer): class Meta: model = Category fields = ('pk', 'name', 'weight', 'comment_required') class KeywordSerializer(serializers.ModelSerializer): ...
from .models import Category, Keyword, Subcategory from rest_framework import serializers class KeywordSerializer(serializers.ModelSerializer): class Meta: model = Keyword fields = ('pk', 'name') class KeywordListSerializer(serializers.ModelSerializer): class Meta: model ...
Add reverse relationship serializer to Category
Add reverse relationship serializer to Category
Python
apache-2.0
belatrix/BackendAllStars
8e9889bb9c2d916f61e5e08416a171777f1c6a2e
samples/gpio_write.py
samples/gpio_write.py
import asyncio import apigpio LED_GPIO = 21 @asyncio.coroutine def start_blink(pi, address): yield from pi.connect(address) # running this in this order blocks :( # only in run, when debuging it does not block... # blocks on set_mode for the second gpio yield from pi.set_mode(LED_GPIO, apigpio.O...
import asyncio import apigpio LED_GPIO = 21 @asyncio.coroutine def start_blink(pi, address): yield from pi.connect(address) yield from pi.set_mode(LED_GPIO, apigpio.OUTPUT) while True: yield from pi.write(LED_GPIO, 0) yield from asyncio.sleep(1) yield from pi.write(LED_GPIO, 1) ...
Remove wrong comments on samples.
Remove wrong comments on samples.
Python
mit
PierreRust/apigpio
ffde5305a2182e566384887d51e4fde90adc9908
runtests.py
runtests.py
#!/usr/bin/env python import os import sys import django from django.conf import settings from django.test.utils import get_runner if __name__ == "__main__": os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() TestRunner = get_runner(settings) test_runner = TestRunner() fai...
#!/usr/bin/env python import os import sys import django from django.conf import settings from django.test.utils import get_runner if __name__ == "__main__": tests = "tests" if len(sys.argv) == 1 else sys.argv[1] os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() TestRunner = ...
Make it possible to run individual tests.
Tests: Make it possible to run individual tests.
Python
agpl-3.0
etesync/journal-manager
16b2de5a1c4965b1e3a2cb96c6ea3bd847e85c95
hxl/commands/hxlvalidate.py
hxl/commands/hxlvalidate.py
""" Command function to schema-validate a HXL dataset. David Megginson November 2014 Can use a whitelist of HXL tags, a blacklist, or both. Usage: import sys from hxl.scripts.hxlvalidate import hxlvalidate hxlvalidate(sys.stdin, sys.stdout, open('MySchema.csv', 'r')) License: Public Domain Documentation: htt...
""" Command function to schema-validate a HXL dataset. David Megginson November 2014 Can use a whitelist of HXL tags, a blacklist, or both. Usage: import sys from hxl.scripts.hxlvalidate import hxlvalidate hxlvalidate(sys.stdin, sys.stdout, open('MySchema.csv', 'r')) License: Public Domain Documentation: htt...
Return result of validation from the command script.
Return result of validation from the command script.
Python
unlicense
HXLStandard/libhxl-python,HXLStandard/libhxl-python
08542b47b127d6bcf128bdedb5f25956f909784e
website_snippet_anchor/__openerp__.py
website_snippet_anchor/__openerp__.py
# -*- coding: utf-8 -*- # © 2015 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Set Snippet's Anchor", "summary": "Allow to reach a concrete section in the page", "version": "8.0.1.0.0", "category": "Website", "website": "http://...
# -*- coding: utf-8 -*- # © 2015 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Set Snippet's Anchor", "summary": "Allow to reach a concrete section in the page", "version": "8.0.1.0.0", "category": "Website", "website": "http://...
Remove unused keys from manifest.
Remove unused keys from manifest.
Python
agpl-3.0
pedrobaeza/website,brain-tec/website,LasLabs/website,gfcapalbo/website,gfcapalbo/website,acsone/website,LasLabs/website,LasLabs/website,open-synergy/website,pedrobaeza/website,brain-tec/website,pedrobaeza/website,nuobit/website,nuobit/website,nuobit/website,gfcapalbo/website,Endika/website,pedrobaeza/website,Yajo/websi...
804b117849df07ce550da314d44d1ade06e1fcb1
app/worker.py
app/worker.py
#!/usr/bin/env python import os from apiclient.discovery import build from apiclient import errors PROJECT_NAME = os.getenv('PROJECT_NAME') TASK_QUEUE_NAME = os.getenv('QUEUE_NAME') TASK_LEASE_SECONDS = os.getenv('TASK_LEASE_SECONDS', 300) TASK_BATCH_SIZE = os.getenv('TASK_BATCH_SIZE', 10) assert PROJECT_NAME assert ...
#!/usr/bin/env python import os import logging from apiclient.discovery import build from apiclient import errors PROJECT_NAME = os.getenv('PROJECT_NAME') TASKQUEUE_NAME = os.getenv('TASKQUEUE_NAME', 'builds') TASKQUEUE_LEASE_SECONDS = os.getenv('TASKQUEUE_LEASE_SECONDS', 300) TASKQUEUE_BATCH_SIZE = os.getenv('TASKQU...
Fix up logging and env vars.
Fix up logging and env vars.
Python
mit
grow/buildbot,grow/buildbot,grow/buildbot
2020838fb456e6118f78ca7288cc14f3046b73eb
oxauth/auth.py
oxauth/auth.py
import json import base64 import urllib from Crypto.Cipher import AES from Crypto.Protocol.KDF import PBKDF2 class OXSessionDecryptor(object): def __init__(self, secret_key_base, salt="encrypted cookie", keylen=64, iterations=1000): self.secret = PBKDF2(secret_key_base, salt.encode(), keylen, iterations) ...
import json import base64 import urllib from Crypto.Cipher import AES from Crypto.Protocol.KDF import PBKDF2 unpad = lambda s: s[:-ord(s[len(s) - 1:])] class OXSessionDecryptor(object): def __init__(self, secret_key_base, salt="encrypted cookie", keylen=64, iterations=1000): self.secret = PBKDF2(secret_ke...
Add unpad function for unpacking cookie
Add unpad function for unpacking cookie
Python
agpl-3.0
openstax/openstax-cms,Connexions/openstax-cms,Connexions/openstax-cms,openstax/openstax-cms,openstax/openstax-cms,openstax/openstax-cms
de56d3d78f546750849d2ba915e426a5e40c5d8d
account_fiscal_position_no_source_tax/account.py
account_fiscal_position_no_source_tax/account.py
from openerp import models, api, fields class account_fiscal_position(models.Model): _inherit = 'account.fiscal.position' @api.v7 def map_tax(self, cr, uid, fposition_id, taxes, context=None): result = super(account_fiscal_position, self).map_tax( cr, uid, fposition_id, taxes, contex...
from openerp import models, api, fields class account_fiscal_position(models.Model): _inherit = 'account.fiscal.position' @api.v7 def map_tax(self, cr, uid, fposition_id, taxes, context=None): result = super(account_fiscal_position, self).map_tax( cr, uid, fposition_id, taxes, contex...
FIX fiscal position no source tax
FIX fiscal position no source tax
Python
agpl-3.0
levkar/odoo-addons,HBEE/odoo-addons,ingadhoc/product,syci/ingadhoc-odoo-addons,adhoc-dev/odoo-addons,ingadhoc/account-financial-tools,jorsea/odoo-addons,adhoc-dev/odoo-addons,syci/ingadhoc-odoo-addons,dvitme/odoo-addons,bmya/odoo-addons,ClearCorp/account-financial-tools,dvitme/odoo-addons,ingadhoc/sale,adhoc-dev/odoo-a...
bf39b4dbe258e62b6172b177fc9e6cf8a0c44f9a
expr/common.py
expr/common.py
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : from __future__ import print_function ADD_OP = '+' MULTIPLY_OP = '*' OPERATORS = [ADD_OP, MULTIPLY_OP] def pprint_expr_trees(trees): from parser import ExprParser print('[') for t in trees: print(' ', ExprParser(t)) print(']')
#!/usr/bin/env python # vim: set fileencoding=UTF-8 : from __future__ import print_function ADD_OP = '+' MULTIPLY_OP = '*' OPERATORS = [ADD_OP, MULTIPLY_OP] def pprint_expr_trees(trees): print('[') for t in trees: print(' ', t) print(']')
Update pprint_expr_trees to adopt Expr
Update pprint_expr_trees to adopt Expr
Python
mit
admk/soap
4c092df630ee645c510199031503585d2b731668
dht.py
dht.py
#!/usr/bin/env python import time import thread import Adafruit_DHT as dht import config import gpio_lock h = 0.0 t = 0.0 def get_ht_thread(): global h global t while True: gpio_lock.acquire() ht = dht.read_retry(dht.DHT22, config.DHT22_GPIO_NUM) gpio_lock.release() h = '{...
#!/usr/bin/env python import time import thread import string import Adafruit_DHT as dht import config import gpio_lock h = 0.0 t = 0.0 def get_ht_thread(): global h global t while True: gpio_lock.acquire() ht = dht.read_retry(dht.DHT22, config.DHT22_GPIO_NUM) gpio_lock.release() ...
Change a report data format
Change a report data format
Python
mit
yunbademo/yunba-smarthome,yunbademo/yunba-smarthome
01b8f325b0108ca1d1456fd2510e2d7fce678a57
turbustat/tests/test_pspec.py
turbustat/tests/test_pspec.py
# Licensed under an MIT open source license - see LICENSE ''' Test functions for PSpec ''' from unittest import TestCase import numpy as np import numpy.testing as npt from ..statistics import PowerSpectrum, PSpec_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances cla...
# Licensed under an MIT open source license - see LICENSE ''' Test functions for PSpec ''' from unittest import TestCase import numpy as np import numpy.testing as npt from ..statistics import PowerSpectrum, PSpec_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances cla...
Add test to ensure power spectrum slope is same w/ transposed array
Add test to ensure power spectrum slope is same w/ transposed array
Python
mit
Astroua/TurbuStat,e-koch/TurbuStat
63946ef78a842b82064b560dd0f73c9a5fe7ac82
puzzle/urls.py
puzzle/urls.py
""" Map puzzle URLs to views. Also maps the root URL to the latest puzzle. """ from django.conf.urls import include, url from django.contrib.auth import views as auth_views from puzzle import views from puzzle.feeds import PuzzleFeed urlpatterns = [ #pylint: disable=invalid-name url(r'^$', views.latest, name='lat...
""" Map puzzle URLs to views. Also maps the root URL to the latest puzzle. """ from django.conf.urls import include, url from django.contrib.auth import views as auth_views from puzzle import views from puzzle.feeds import PuzzleFeed urlpatterns = [ #pylint: disable=invalid-name url(r'^$', views.latest, name='lat...
Replace deprecated login/logout function-based views
Replace deprecated login/logout function-based views
Python
mit
jomoore/threepins,jomoore/threepins,jomoore/threepins
afeccc72042f1cfa69c07814420b3aeedeeab9e5
main.py
main.py
# -*- coding: utf-8 -*- import sys from PyQt4 import QtCore, QtGui from UI.utilities.account_manager import AccountManager from UI.mainUI import MainUI from UI.initial_window import InitialWindowUI if __name__ == "__main__": QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads) app = QtGui.QAppli...
# -*- coding: utf-8 -*- import sys from PyQt4 import QtCore, QtGui from UI.utilities.account_manager import AccountManager from UI.mainUI import MainUI from UI.initial_window import InitialWindowUI import configparser # needed for Windows package builder if __name__ == "__main__": QtCore.QCoreApplication.setAttr...
Add configparser import to avoid windows packager error
Add configparser import to avoid windows packager error
Python
mit
lakewik/storj-gui-client
324beaae091b2bc4699d4840ccd313aa0645b07e
nets.py
nets.py
class FeedForwardNet: pass
from layers import InputLayer, Layer, OutputLayer import math import random class FeedForwardNet(object): def __init__(self, inlayersize, layersize, outlayersize): self._inlayer = InputLayer(inlayersize) self._middlelayer = Layer(layersize) self._outlayer = OutputLayer(outlayersize) ...
Add main code and feed forward net class
Add main code and feed forward net class It can XOR, but sin function still fails
Python
mit
tmerr/trevornet
ef4da4f081c083d88297795d145529c543d2595e
spam.py
spam.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from sklearn.cross_validation import train_test_split from dataset_meta import DATASET_META from spam.common.utils import get_file_path_list file_path_list = get_file_path_list(DATASET_META) path, classification = zip(*file_path_list) unlabeled_path, labeled_path, \ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from sklearn.cross_validation import train_test_split from dataset_meta import DATASET_META from spam.common.utils import get_file_path_list file_path_list = get_file_path_list(DATASET_META) # transform list of tuple into two list # e.g. [('/path/to/file', 'spam')] ==...
Set random state to 0, add comments and remove print.
Set random state to 0, add comments and remove print.
Python
mit
benigls/spam,benigls/spam
718bd57ff648d431d8986a48d1c66877098c4081
urls.py
urls.py
# -*- coding: utf-8 -*- from django.conf.urls import patterns, include, url from . import methods urlpatterns = patterns('', url(r'^crashreport\/submit\.php$', methods.post_crashreport, name='post_crashreport'), url(r'^issues\.xml$', methods.post_issue, name='post_issue'), )
# -*- coding: utf-8 -*- from django.conf.urls import include, url from . import methods urlpatterns = ( url(r'^crashreport\/submit\.php$', methods.post_crashreport, name='post_crashreport'), url(r'^issues\.xml$', methods.post_issue, name='post_issue'), )
Update to Django 1.11.19 including updates to various dependencies
Update to Django 1.11.19 including updates to various dependencies
Python
mit
mback2k/django-app-bugs
d5240626528547e112c78af633c1f4494a5c6d91
common/lib/xmodule/xmodule/modulestore/django.py
common/lib/xmodule/xmodule/modulestore/django.py
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module from django.conf import settings _MODULESTORES = {} FUNCTION_KEYS = ['render_template'...
""" Module that provides a connection to the ModuleStore specified in the django settings. Passes settings.MODULESTORE as kwargs to MongoModuleStore """ from __future__ import absolute_import from importlib import import_module from os import environ from django.conf import settings _MODULESTORES = {} FUNCTION_KEY...
Put quick check so we don't load course modules on init unless we're actually running in Django
Put quick check so we don't load course modules on init unless we're actually running in Django
Python
agpl-3.0
knehez/edx-platform,sudheerchintala/LearnEraPlatForm,lduarte1991/edx-platform,nanolearningllc/edx-platform-cypress,eestay/edx-platform,prarthitm/edxplatform,caesar2164/edx-platform,atsolakid/edx-platform,chauhanhardik/populo,CredoReference/edx-platform,motion2015/edx-platform,shabab12/edx-platform,shubhdev/openedx,Shrh...
98d87d447ae0f84bdbd1bee3ecd4a842acfeacbc
ibmcnx/test/loadFunction.py
ibmcnx/test/loadFunction.py
import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java import lotusConnectionsCommonAdmin globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
Customize scripts to work with menu
Customize scripts to work with menu
Python
apache-2.0
stoeps13/ibmcnx2,stoeps13/ibmcnx2
08e54777f2d43243152ba9aa2e3519c3268fbb92
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://softwarejourneyman.com' RELATIVE_URLS = False FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' DELETE_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://samroeca.com' RELATIVE_URLS = False FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' DELETE_OUTPUT_DIR...
Add samroeca.com to url pointing
Add samroeca.com to url pointing
Python
mit
pappasam/pappasam.github.io,pappasam/pappasam.github.io
7f317126d7d422b073cb4e4a8698757fe1e763f3
wqflask/wqflask/decorators.py
wqflask/wqflask/decorators.py
"""This module contains gn2 decorators""" from flask import g from functools import wraps def edit_access_required(f): """Use this for endpoints where admins are required""" @wraps(f) def wrap(*args, **kwargs): if g.user_session.record.get(b"user_email_address") not in [ b"labwilli...
"""This module contains gn2 decorators""" from flask import g from typing import Dict from functools import wraps from utility.hmac import hmac_creation import json import requests def edit_access_required(f): """Use this for endpoints where admins are required""" @wraps(f) def wrap(*args, **kwargs): ...
Replace hard-coded e-mails with gn-proxy queries
Replace hard-coded e-mails with gn-proxy queries * wqflask/wqflask/decorators.py (edit_access_required.wrap): Query the proxy to see the access rights of a given user.
Python
agpl-3.0
genenetwork/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2
28353efe2802059c1da8b1c81b157dc6e773032e
salt/modules/monit.py
salt/modules/monit.py
''' Salt module to manage monit ''' def version(): ''' List monit version Cli Example:: salt '*' monit.version ''' cmd = 'monit -V' res = __salt__['cmd.run'](cmd) return res.split("\n")[0] def status(): ''' Monit status CLI Example:: salt '*' monit.status ...
''' Monit service module. This module will create a monit type service watcher. ''' import os def start(name): ''' CLI Example:: salt '*' monit.start <service name> ''' cmd = "monit start {0}".format(name) return not __salt__['cmd.retcode'](cmd) def stop(name): ''' Stops servic...
Check to see if we are going donw the right path
Check to see if we are going donw the right path
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
4ec2b94551858e404f0de6d8ad3827d9c6138491
slurmec2utils/sysinit.py
slurmec2utils/sysinit.py
#!/usr/bin/python from __future__ import absolute_import, print_function import boto.s3 from boto.s3.key import Key from .clusterconfig import ClusterConfiguration from .instanceinfo import get_instance_id def check_munge_
#!/usr/bin/python from __future__ import absolute_import, print_function import boto.s3 from boto.s3.key import Key from .clusterconfig import ClusterConfiguration from .instanceinfo import get_instance_id def get_munge_key(cluster_configuration=None): if cluster_configuration is None: cluster_configuratio...
Fix syntax errors. (preventing install)
Fix syntax errors. (preventing install)
Python
apache-2.0
dacut/slurm-ec2-utils,dacut/slurm-ec2-utils
0464ac83d8aca12193a7629e72b880d5b8e2707a
plinth/modules/first_boot/templatetags/firstboot_extras.py
plinth/modules/first_boot/templatetags/firstboot_extras.py
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
Add doc strings for custom tags
firstboot: Add doc strings for custom tags
Python
agpl-3.0
vignanl/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,kkampardi/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,vignanl/Plinth,kkampardi/Plinth,vignanl/Plinth,kkampardi/Plinth,vignanl/Plinth,harry-7/Plinth,harry-7/Plinth,kkampardi/Plinth,vignanl/Plinth,f...
00229b2ced2f042cdcbb24bfaac4d33051930b86
source/bark/logger.py
source/bark/logger.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import copy import bark from .log import Log class Logger(Log): '''Helper for emitting logs. A logger can be used to preset common information (such as a name) and then emit :py:class:`~bark.log.Log`...
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import copy import bark from .log import Log class Logger(Log): '''Helper for emitting logs. A logger can be used to preset common information (such as a name) and then emit :py:class:`~bark.log.Log`...
Allow handle to be passed in to avoid embedded global reference.
Allow handle to be passed in to avoid embedded global reference.
Python
apache-2.0
4degrees/mill,4degrees/sawmill
d504abc78d94e8af90a5bf8950f3ad4e2d47e5f7
src/ansible/models.py
src/ansible/models.py
from django.db import models class Playbook(models.Model): class Meta: verbose_name_plural = "playbooks" name = models.CharField(max_length=200) path = models.CharField(max_length=200, default="~/") ansible_config = models.CharField(max_length=200, default="~/") inventory = models.CharFie...
from django.db import models class Playbook(models.Model): class Meta: verbose_name_plural = "playbooks" name = models.CharField(max_length=200) path = models.CharField(max_length=200, default="~/") ansible_config = models.CharField(max_length=200, default="~/") inventory = models.CharFie...
Fix string output of Playbook
Fix string output of Playbook
Python
bsd-3-clause
lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin
0d1aa7e08ef2572d2e13218d7d8942d8d2a7550e
app/logic/latexprinter.py
app/logic/latexprinter.py
import sympy from sympy.printing.latex import LatexPrinter class GammaLatexPrinter(LatexPrinter): def _needs_function_brackets(self, expr): if expr.func == sympy.Abs: return False return super(GammaLatexPrinter, self)._needs_function_brackets(expr) def latex(expr, **settings): set...
import sympy from sympy.printing.latex import LatexPrinter class GammaLatexPrinter(LatexPrinter): def _needs_function_brackets(self, expr): if expr.func == sympy.Abs: return False return super(GammaLatexPrinter, self)._needs_function_brackets(expr) def latex(expr, **settings): set...
Print inverse trig functions using powers
Print inverse trig functions using powers
Python
bsd-3-clause
bolshoibooze/sympy_gamma,iScienceLuvr/sympy_gamma,debugger22/sympy_gamma,debugger22/sympy_gamma,iScienceLuvr/sympy_gamma,kaichogami/sympy_gamma,bolshoibooze/sympy_gamma,iScienceLuvr/sympy_gamma,kaichogami/sympy_gamma,bolshoibooze/sympy_gamma,github4ry/sympy_gamma,github4ry/sympy_gamma,github4ry/sympy_gamma,kaichogami/s...
311b0d5a0baabbb9c1476a156dbae1b919478704
src/upgradegit/cli.py
src/upgradegit/cli.py
import click import requirements import os import re @click.command() @click.option('--file', default='requirements.txt', help='File to upgrade') @click.option('--branch', default='master', help='Branch to upgrade from') def upgrade(file, branch): lines = [] with open(file, 'r') as f: for req in requi...
import click import requirements import os import re @click.command() @click.option('--file', default='requirements.txt', help='File to upgrade') @click.option('--branch', default='master', help='Branch to upgrade from') def upgrade(file, branch): lines = [] with open(file, 'r') as f: for req in requi...
Allow for requirements without a hash
Allow for requirements without a hash
Python
mit
bevanmw/gitupgrade
2ba5f562edb568653574d329a9f1ffbe8b15e7c5
tests/test_caching.py
tests/test_caching.py
import os import tempfile from . import RTRSSTestCase from rtrss import caching, config class CachingTestCase(RTRSSTestCase): def setUp(self): fh, self.filename = tempfile.mkstemp(dir=config.DATA_DIR) os.close(fh) def tearDown(self): os.remove(self.filename) def test_open_for_at...
import os import tempfile from . import TempDirTestCase from rtrss import caching class CachingTestCase(TempDirTestCase): def setUp(self): super(CachingTestCase, self).setUp() fh, self.filename = tempfile.mkstemp(dir=self.dir.path) os.close(fh) def tearDown(self): os.remove(s...
Update test case to use new base class
Update test case to use new base class
Python
apache-2.0
notapresent/rtrss,notapresent/rtrss,notapresent/rtrss,notapresent/rtrss
39d45a64221b8146ac318cfeb833f977ad32fe48
app.py
app.py
import eventlet eventlet.monkey_patch() # NOLINT import importlib import sys from weaveserver.main import create_app from weaveserver.core.logger import configure_logging def handle_launch(): import signal from weaveserver.core.config_loader import get_config configure_logging() token = sys.stdin....
import eventlet eventlet.monkey_patch() # NOLINT import importlib import os import sys from weaveserver.main import create_app from weaveserver.core.logger import configure_logging def handle_launch(): import signal from weaveserver.core.config_loader import get_config configure_logging() token = ...
Support 2nd parameter for weave-launch so that a plugin from any directory can be loaded.
Support 2nd parameter for weave-launch so that a plugin from any directory can be loaded.
Python
mit
supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer
435e27f3104cfe6e4f6577c2a5121ae2a6347eb1
tornado_aws/exceptions.py
tornado_aws/exceptions.py
""" The following exceptions may be raised during the course of using :py:class:`tornado_aws.client.AWSClient` and :py:class:`tornado_aws.client.AsyncAWSClient`: """ class AWSClientException(Exception): """Base exception class for AWSClient :ivar msg: The error message """ fmt = 'An error occurred'...
""" The following exceptions may be raised during the course of using :py:class:`tornado_aws.client.AWSClient` and :py:class:`tornado_aws.client.AsyncAWSClient`: """ class AWSClientException(Exception): """Base exception class for AWSClient :ivar msg: The error message """ fmt = 'An error occurred'...
Add a new generic AWS Error exception
Add a new generic AWS Error exception
Python
bsd-3-clause
gmr/tornado-aws,gmr/tornado-aws
35529cfd3f93723e8d60b43f58419385137b9a01
saltapi/cli.py
saltapi/cli.py
''' CLI entry-point for salt-api ''' # Import salt libs from salt.utils.parsers import ( ConfigDirMixIn, DaemonMixIn, LogLevelMixIn, MergeConfigMixIn, OptionParser, OptionParserMeta, PidfileMixin) # Import salt-api libs import saltapi.client import saltapi.config import saltapi.version cl...
''' CLI entry-point for salt-api ''' # Import salt libs from salt.utils.parsers import ( ConfigDirMixIn, DaemonMixIn, LogLevelMixIn, MergeConfigMixIn, OptionParser, OptionParserMeta, PidfileMixin) # Import salt-api libs import saltapi.client import saltapi.config import saltapi.version cl...
Remove unnecessary call to `process_config_dir()`.
Remove unnecessary call to `process_config_dir()`.
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
38b5438ab6823c7aa352a52d4c61944555b80abe
pyramidpayment/scripts/add_demo_data.py
pyramidpayment/scripts/add_demo_data.py
import os import sys import transaction from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from ..models import ( DBSession, Order, ) def usage(argv): cmd = os.path.basename(argv[0]) print('usage: %s <config_uri>\n' '(ex...
import os import sys import transaction from sqlalchemy import engine_from_config from pyramid.paster import ( get_appsettings, setup_logging, ) from ..models import ( DBSession, Order, ) def usage(argv): cmd = os.path.basename(argv[0]) print('usage: %s <config_uri>\n' '(ex...
Add a little bit of demo data to show what the list_orders view does
Add a little bit of demo data to show what the list_orders view does
Python
mit
rijkstofberg/pyramid.payment
c02b2711f1b18bba85155f8bf402b5b9824b6502
test/test_producer.py
test/test_producer.py
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") def test_end_to_end(kafka_broker): connect_str = 'localhost:' + str(kafka_broker.port) producer = KafkaProdu...
import pytest from kafka import KafkaConsumer, KafkaProducer from test.conftest import version from test.testutil import random_string @pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set") def test_end_to_end(kafka_broker): connect_str = 'localhost:' + str(kafka_broker.port) producer = KafkaProdu...
Disable auto-commit / group assignment in producer test
Disable auto-commit / group assignment in producer test
Python
apache-2.0
Aloomaio/kafka-python,zackdever/kafka-python,wikimedia/operations-debs-python-kafka,ohmu/kafka-python,ohmu/kafka-python,mumrah/kafka-python,Yelp/kafka-python,Yelp/kafka-python,dpkp/kafka-python,wikimedia/operations-debs-python-kafka,dpkp/kafka-python,scrapinghub/kafka-python,mumrah/kafka-python,zackdever/kafka-python,A...
84ad348562e64084894e7c033de870a016390134
server/auth/auth.py
server/auth/auth.py
import json from flask import Blueprint, request from flask.ext.login import current_user, logout_user, login_user from flask.ext.restful import Api, Resource, abort from server.models import Lecturer, db auth = Blueprint('auth', __name__) api = Api(auth) class LoginResource(Resource): def get(self): ...
import json from flask import Blueprint, request from flask.ext.login import current_user, logout_user, login_user from flask.ext.restful import Api, Resource, abort, reqparse from server.models import Lecturer, db auth = Blueprint('auth', __name__) api = Api(auth) class LoginResource(Resource): def get(self)...
Fix Login API implementation not parsing JSON POST data
Fix Login API implementation not parsing JSON POST data
Python
mit
MACSIFS/IFS,MACSIFS/IFS,MACSIFS/IFS,MACSIFS/IFS
645265be1097f463e9d12f2be1a3a4de2b136f0c
tests/test_pooling.py
tests/test_pooling.py
try: import queue except ImportError: import Queue as queue import pylibmc from nose.tools import eq_, ok_ from tests import PylibmcTestCase class PoolTestCase(PylibmcTestCase): pass class ClientPoolTests(PoolTestCase): def test_simple(self): a_str = "a" p = pylibmc.ClientPool(self.mc...
try: import queue except ImportError: import Queue as queue import pylibmc from nose.tools import eq_, ok_ from tests import PylibmcTestCase class PoolTestCase(PylibmcTestCase): pass class ClientPoolTests(PoolTestCase): def test_simple(self): a_str = "a" p = pylibmc.ClientPool(self.mc...
Add rudimentary testing for thread-mapped pools
Add rudimentary testing for thread-mapped pools Refs #174
Python
bsd-3-clause
lericson/pylibmc,lericson/pylibmc,lericson/pylibmc
f33bbdaae182eee27ad372a6f0d10e9c7be66a6f
polygraph/types/__init__.py
polygraph/types/__init__.py
from .enum import EnumType from .field import field from .input_object import InputObject from .interface import Interface from .lazy_type import LazyType from .list import List from .nonnull import NonNull from .object_type import ObjectType from .scalar import ID, Boolean, Float, Int, String from .union import Union ...
from .enum import EnumType, EnumValue from .field import field from .input_object import InputObject, InputValue from .interface import Interface from .lazy_type import LazyType from .list import List from .nonnull import NonNull from .object_type import ObjectType from .scalar import ID, Boolean, Float, Int, String fr...
Fix polygraph.types import to include EnumValue and InputValue
Fix polygraph.types import to include EnumValue and InputValue
Python
mit
polygraph-python/polygraph
7eaa1cf6f8e572ce5b854fffce10b05628c79c0f
tools/marvin/setup.py
tools/marvin/setup.py
#!/usr/bin/env python # Copyright 2012 Citrix Systems, Inc. Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this # file except in compliance with the License. Citrix Systems, Inc. from distutils.core import setup from sys import version if version < "2.7": print "Marvin needs at ...
#!/usr/bin/env python # Copyright 2012 Citrix Systems, Inc. Licensed under the # Apache License, Version 2.0 (the "License"); you may not use this # file except in compliance with the License. Citrix Systems, Inc. from distutils.core import setup from sys import version if version < "2.7": print "Marvin needs at ...
Install paramiko as a dependency, don't complain about the requirement
Install paramiko as a dependency, don't complain about the requirement
Python
apache-2.0
mufaddalq/cloudstack-datera-driver,jcshen007/cloudstack,cinderella/incubator-cloudstack,cinderella/incubator-cloudstack,wido/cloudstack,jcshen007/cloudstack,resmo/cloudstack,argv0/cloudstack,mufaddalq/cloudstack-datera-driver,mufaddalq/cloudstack-datera-driver,wido/cloudstack,jcshen007/cloudstack,resmo/cloudstack,DaanH...
fb3fd1625cbf8e8181768748bbbba72fddf90945
webview/js/drag.py
webview/js/drag.py
src = """ (function() { var initialX = 0; var initialY = 0; function onMouseMove(ev) { var x = ev.screenX - initialX; var y = ev.screenY - initialY; window.pywebview._bridge.call('moveWindow', [x, y], 'move'); } function onMouseUp() { window.removeEventListener('mou...
src = """ (function() { var initialX = 0; var initialY = 0; function onMouseMove(ev) { var x = ev.screenX - initialX; var y = ev.screenY - initialY; window.pywebview._bridge.call('moveWindow', [x, y], 'move'); } function onMouseUp() { window.removeEventListener('mou...
Use old JS for loop over forEach for backwards compatibility.
Use old JS for loop over forEach for backwards compatibility.
Python
bsd-3-clause
r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview
8c6940a82b4504786e221f0603b8995db41adcae
reddit2telegram/channels/r_wholesome/app.py
reddit2telegram/channels/r_wholesome/app.py
#encoding:utf-8 subreddit = 'wholesome' t_channel = '@r_wholesome' def send_post(submission, r2t): return r2t.send_simple(submission)
#encoding:utf-8 subreddit = 'wholesome+WholesomeComics+wholesomegifs+wholesomepics+wholesomememes' t_channel = '@r_wholesome' def send_post(submission, r2t): return r2t.send_simple(submission)
Add a few subreddits to @r_wholesome
Add a few subreddits to @r_wholesome
Python
mit
Fillll/reddit2telegram,Fillll/reddit2telegram
ba4589e727a49486134e0cceab842510be9661f4
mobile_app_connector/models/privacy_statement.py
mobile_app_connector/models/privacy_statement.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2019 Compassion CH (http://www.compassion.ch) # @author: Emanuel Cino <ecino@compassion.ch> # @author: Théo Nikles <theo.nikles@gmail.com> # # The licence is in the file __manifest__.py #...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2019 Compassion CH (http://www.compassion.ch) # @author: Emanuel Cino <ecino@compassion.ch> # @author: Théo Nikles <theo.nikles@gmail.com> # # The licence is in the file __manifest__.py #...
FIX language of privacy statement
FIX language of privacy statement
Python
agpl-3.0
eicher31/compassion-modules,ecino/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,ecino/compassion-modules,CompassionCH/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,eicher31/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,CompassionCH/co...
e5b802b62c3c13aa9d213ddf4f51706921904dd1
src/texture.py
src/texture.py
""" A OpenGL texture class """ from OpenGL.GL import * import pygame class Texture(object): """An OpenGL texture""" def __init__(self, file_): # Load and allocate the texture self.surface = pygame.image.load(file_).convert_alpha() self.__texture = glGenTextures(1) self.reload() def reload(self...
""" A OpenGL texture class """ from OpenGL.GL import * import pygame class Texture(object): """An OpenGL texture""" def __init__(self, file_): """Allocate and load the texture""" self.surface = pygame.image.load(file_).convert_alpha() self.__texture = glGenTextures(1) self.reload() def __del__...
Remove resource leak in Texture
Remove resource leak in Texture This commit adds code to Texture to delete allocated textures when they are garbage collected. Comments in Texture are also updated.
Python
mit
aarmea/mumei,aarmea/mumei,aarmea/mumei
f44681ffc93ba85add8aeacc55eb8946b03b68a2
1_boilerpipe_lib.py
1_boilerpipe_lib.py
# -*- coding: UTF-8 -*- from boilerpipe.extract import Extractor URL='http://sportv.globo.com/site/eventos/mundial-de-motovelocidade/noticia/2016/06/em-duelo-eletrizante-rossi-vence-marquez-salom-e-homenageado.html' extractor = Extractor(extractor='ArticleExtractor', url=URL) print extractor.getText().encode('utf-8...
# -*- coding: UTF-8 -*- from boilerpipe.extract import Extractor URL='http://sportv.globo.com/site/eventos/mundial-de-motovelocidade/noticia/2016/06/em-duelo-eletrizante-rossi-vence-marquez-salom-e-homenageado.html' # URL='http://grandepremio.uol.com.br/motogp/noticias/rossi-supera-largada-ruim-vence-duelo-com-marque...
Add one more url to example 1
Add one more url to example 1
Python
apache-2.0
fabriciojoc/redes-sociais-web,fabriciojoc/redes-sociais-web
129b4d169f33e46547a7a701e4e50b7dd9fe8468
traits/qt/__init__.py
traits/qt/__init__.py
#------------------------------------------------------------------------------ # Copyright (c) 2010, Enthought Inc # All rights reserved. # # This software is provided without warranty under the terms of the BSD license. # # Author: Enthought Inc # Description: Qt API selector. Can be used to switch between pyQt and ...
#------------------------------------------------------------------------------ # Copyright (c) 2010, Enthought Inc # All rights reserved. # # This software is provided without warranty under the terms of the BSD license. # # Author: Enthought Inc # Description: Qt API selector. Can be used to switch between pyQt and ...
Fix error message for invalid QT_API.
Fix error message for invalid QT_API.
Python
bsd-3-clause
burnpanck/traits,burnpanck/traits
b66143e2984fb390766cf47dd2297a3f06ad26d0
apps/home/views.py
apps/home/views.py
# (c) Crown Owned Copyright, 2016. Dstl. from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.views.generic.base import View from django.contrib.auth import login class Home(View): # Get the homepage. If the user isn't logged in, (we can find no trace # of the us...
# (c) Crown Owned Copyright, 2016. Dstl. from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.views.generic.base import View from django.contrib.auth import login from django.contrib.auth import get_user_model class Home(View): # Get the homepage. If the user isn't log...
Add import statement for get_user_model.
Add import statement for get_user_model.
Python
mit
dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse,dstl/lighthouse
f9332afe031f4d7875b8c6dd53392a46a198fc9e
evaluation/packages/utils.py
evaluation/packages/utils.py
# Compute the distance between points of cloud assigned to a primitive # Return an array with len=len(assign) def distanceToPrimitives(cloud, assign, primitives): return [ [primVar.distanceTo(cloud[a[0]]) for primVar in primitives if primVar.uid == a[1]] for a in assign]
# Compute the distance between points of cloud assigned to a primitive # Return an array with len=len(assign) def distanceToPrimitives(cloud, assign, primitives): return [ [primVar.distanceTo(cloud[a[0]]) for primVar in primitives if primVar.uid == a[1]] for a in assign] import packages.orderedSet as...
Add method to parse angle command line arguments
Add method to parse angle command line arguments
Python
apache-2.0
amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt
21368fc9354e3c55132a0d42a734802c00466cb6
blimpy/__init__.py
blimpy/__init__.py
from __future__ import absolute_import try: from . import waterfall from .waterfall import Waterfall from .guppi import GuppiRaw from . import utils from . import fil2h5 from . import h52fil from . import h5diag from . import bl_scrunch from . import calcload from . import rawhd...
from __future__ import absolute_import try: from . import waterfall from .waterfall import Waterfall from .guppi import GuppiRaw from . import utils from . import fil2h5 from . import h52fil from . import h5diag from . import bl_scrunch from . import calcload from . import rawhd...
Make dsamp a visible component of blimpy
Make dsamp a visible component of blimpy
Python
bsd-3-clause
UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy
a6fda9344461424d9da4f70772443a2a283a8da1
test/test_client.py
test/test_client.py
import unittest import delighted class ClientTest(unittest.TestCase): def test_instantiating_client_requires_api_key(self): self.assertRaises(ValueError, lambda: delighted.Client()) delighted.Client(api_key='abc123')
import unittest import delighted class ClientTest(unittest.TestCase): def test_instantiating_client_requires_api_key(self): original_api_key = delighted.api_key try: delighted.api_key = None self.assertRaises(ValueError, lambda: delighted.Client()) delighted.C...
Make no-api-key test more reliable
Make no-api-key test more reliable
Python
mit
mkdynamic/delighted-python,delighted/delighted-python,kaeawc/delighted-python
45990438d22dc15cdd62f85e541f929ca88eed6b
ggp-base/src_py/random_gamer.py
ggp-base/src_py/random_gamer.py
''' @author: Sam ''' import random from org.ggp.base.util.statemachine import MachineState from org.ggp.base.util.statemachine.implementation.prover import ProverStateMachine from org.ggp.base.player.gamer.statemachine import StateMachineGamer from org.ggp.base.player.gamer.statemachine.reflex.event import...
''' @author: Sam ''' import random from org.ggp.base.util.statemachine import MachineState from org.ggp.base.util.statemachine.implementation.prover import ProverStateMachine from org.ggp.base.player.gamer.statemachine import StateMachineGamer class PythonRandomGamer(StateMachineGamer): def getName(...
Fix a bug in the example python gamer.
Fix a bug in the example python gamer. git-svn-id: 4739e81c2fe647bfb539b919360e2c658e6121ea@552 716a755e-b13f-cedc-210d-596dafc6fb9b
Python
bsd-3-clause
cerebro/ggp-base,cerebro/ggp-base
9548247251399a4fbe7a140c5d8db64e8dd71b46
cobe/instatrace.py
cobe/instatrace.py
# Copyright (C) 2010 Peter Teichman import datetime import math import os import time def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls] return getinstance @singleton class Instatrace: def __init__(se...
# Copyright (C) 2010 Peter Teichman import datetime import math import os import time def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls] return getinstance @singleton class Instatrace: def __init__(se...
Remove a debugging flush() after every trace
Remove a debugging flush() after every trace
Python
mit
wodim/cobe-ng,wodim/cobe-ng,tiagochiavericosta/cobe,LeMagnesium/cobe,LeMagnesium/cobe,DarkMio/cobe,pteichman/cobe,meska/cobe,meska/cobe,pteichman/cobe,DarkMio/cobe,tiagochiavericosta/cobe
a456449c5a30ea9ad9af308ea407246425ad288e
students/crobison/session04/file_lab.py
students/crobison/session04/file_lab.py
# Charles Robison # 2016.10.21 # File Lab #!/usr/bin/env python import os cwd = os.getcwd() # write a program which prints the full path to all files # in the current directory, one per line for item in os.listdir(cwd): print(cwd + "/" + item) # write a program which copies a file from a source, to a # destinat...
# Charles Robison # 2016.10.21 # File Lab #!/usr/bin/env python import os cwd = os.getcwd() # write a program which prints the full path to all files # in the current directory, one per line for item in os.listdir(cwd): print(cwd + "/" + item) # write a program which copies a file from a source, to a # destinat...
Fix section to read and write large files.
Fix section to read and write large files.
Python
unlicense
UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,Baumelbi/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016
818fdb1a2d2cfbe0ef3de66443eb726c4b0cead5
test/cli/test_cmd_piper.py
test/cli/test_cmd_piper.py
from piper import build from piper.db import core as db from piper.cli import cmd_piper import mock class TestEntry(object): @mock.patch('piper.cli.cmd_piper.CLIBase') def test_calls(self, clibase): self.mock = mock.Mock() cmd_piper.entry(self.mock) clibase.assert_called_once_with( ...
from piper import build from piper.db import core as db from piper.cli import cmd_piper from piper.cli.cli import CLIBase import mock class TestEntry(object): @mock.patch('piper.cli.cmd_piper.CLIBase') def test_calls(self, clibase): self.mock = mock.Mock() cmd_piper.entry(self.mock) c...
Add integration test for db init
Add integration test for db init
Python
mit
thiderman/piper
2d889811b35e9f922f3ec9a6276e44d380ed6c14
python-pscheduler/pscheduler/pscheduler/filestring.py
python-pscheduler/pscheduler/pscheduler/filestring.py
""" Functions for retrieving strings from files """ import os def string_from_file(string, strip=True): """ Return an unaltered string or the contents of a file if the string begins with @ and the rest of it points at a path. If 'strip' is True, remove leading and trailing whitespace (default beh...
""" Functions for retrieving strings from files """ import os def string_from_file(string, strip=True): """ Return an unaltered string or the contents of a file if the string begins with @ and the rest of it points at a path. If 'strip' is True, remove leading and trailing whitespace (default beh...
Expand ~ and ~xxx at the start of filenames.
Expand ~ and ~xxx at the start of filenames.
Python
apache-2.0
perfsonar/pscheduler,mfeit-internet2/pscheduler-dev,perfsonar/pscheduler,perfsonar/pscheduler,perfsonar/pscheduler,mfeit-internet2/pscheduler-dev
256dc6da740050f71615f00924cd85346aaa1e99
rotational-cipher/rotational_cipher.py
rotational-cipher/rotational_cipher.py
import string UPPER = string.ascii_uppercase LOWER = string.ascii_lowercase def rotate(s, n): rules = shift_rules(n) return "".join(map(lambda k: rules.get(k, k), s)) def shift_rules(n): shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n] return {k:v for k,v in zip(UPPER+LOWER, shifted)}
import string UPPER = string.ascii_uppercase LOWER = string.ascii_lowercase def rotate(s, n): rules = shift_rules(n) return "".join(rules.get(ch, ch) for ch in s) def shift_rules(n): shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n] return {k:v for k,v in zip(UPPER+LOWER, shifted)}
Use a comprehension instead of a lambda function
Use a comprehension instead of a lambda function
Python
agpl-3.0
CubicComet/exercism-python-solutions
f1df5f74699a152d8dc2cac8e4dcf80a1523ca99
setup.py
setup.py
from distutils.core import setup setup(name='dshelpers', version='1.3.0', description="Provides some helper functions used by the ScraperWiki Data Services team.", long_description="Provides some helper functions used by the ScraperWiki Data Services team.", classifiers=["Development Status :: 5...
from distutils.core import setup setup(name='dshelpers', version='1.3.0', description="Provides some helper functions used by The Sensible Code Company's Data Services team.", long_description="Provides some helper functions used by the The Sensible Code Company's Data Services team.", classifie...
Rename ScraperWiki to Sensible Code in README
Rename ScraperWiki to Sensible Code in README
Python
bsd-2-clause
scraperwiki/data-services-helpers
6353a3d1443c717b2d2e804190153f8be605c2f1
setup.py
setup.py
# encoding: utf-8 from distutils.core import setup with open('README.rst') as readme: long_description = readme.read() setup( name='udiskie', version='0.4.2', description='Removable disk automounter for udisks', long_description=long_description, author='Byron Clark', author_email='byron@t...
# encoding: utf-8 from distutils.core import setup with open('README.rst') as readme: long_description = readme.read() setup( name='udiskie', version='0.4.2', description='Removable disk automounter for udisks', long_description=long_description, author='Byron Clark', author_email='byron@t...
Include udiskie-mount in binary distribution
Include udiskie-mount in binary distribution
Python
mit
khardix/udiskie,pstray/udiskie,coldfix/udiskie,coldfix/udiskie,mathstuf/udiskie,pstray/udiskie
82cb12c07e05814f8ef46554d08c5e818ab5f406
openprescribing/frontend/management/commands/resend_confirmation_emails.py
openprescribing/frontend/management/commands/resend_confirmation_emails.py
from allauth.account.utils import send_email_confirmation from django.conf import settings from django.core.management.base import BaseCommand from django.test import RequestFactory from frontend.models import User class Command(BaseCommand): """Command to resend confirmation emails to unverified users with ...
from allauth.account.utils import send_email_confirmation from django.conf import settings from django.core.management.base import BaseCommand from django.test import RequestFactory from frontend.models import User class Command(BaseCommand): """Command to resend confirmation emails to unverified users with ...
Add a simple log file to prevent double sending
Add a simple log file to prevent double sending
Python
mit
ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc
dea503e03a7c18c256d902b0b6ad3cb66a7ce9a2
examples/flexure/example_point_load.py
examples/flexure/example_point_load.py
#! /usr/bin/env python """ """ from landlab import RasterModelGrid from landlab.components.flexure import Flexure def add_load_to_middle_of_grid(grid, load): shape = grid.shape load_array = grid.field_values( "node", "lithosphere__overlying_pressure_increment" ).view() load_array.shape = s...
#! /usr/bin/env python """ """ from landlab import RasterModelGrid from landlab.components.flexure import Flexure def add_load_to_middle_of_grid(grid, load): shape = grid.shape load_array = grid.field_values( "node", "lithosphere__overlying_pressure_increment" ).view() load_array.shape = s...
Fix F841: local variable is assigned to but never used.
Fix F841: local variable is assigned to but never used.
Python
mit
amandersillinois/landlab,cmshobe/landlab,landlab/landlab,cmshobe/landlab,amandersillinois/landlab,cmshobe/landlab,landlab/landlab,landlab/landlab
584956dce7cd607c6cb0d24d360d65d1c0be7005
lib/pylprof/dump-stats.py
lib/pylprof/dump-stats.py
import json stats = lp.get_stats() unit = stats.unit results = {} for function, timings in stats.timings.iteritems(): module, line, fname = function results[module] = {} for sample in timings: linenumber, ncalls, timing = sample if not results[module].get(linenumber): results[mod...
import json import sys from collections import defaultdict stats = lp.get_stats() unit = stats.unit results = {} for loc, timings in stats.timings.iteritems(): module, line, fname = loc if not results.get(module): results[module] = defaultdict(list) for sample in timings: linenumber, ncalls...
Fix bug when profiling multiple fcts per module
[pylprof] Fix bug when profiling multiple fcts per module
Python
mit
iddl/pprofile,iddl/pprofile
2b58374504242d4019fde208296802fe4fb1c4b3
Lib/__init__.py
Lib/__init__.py
"""\ SciPy --- A scientific computing package for Python =================================================== You can support the development of SciPy by purchasing documentation at http://www.trelgol.com It is being distributed for a fee for a limited time to try and raise money for development. Documentation is ...
"""\ SciPy --- A scientific computing package for Python =================================================== You can support the development of SciPy by purchasing documentation at http://www.trelgol.com It is being distributed for a fee for a limited time to try and raise money for development. Documentation is ...
Remove auto include of numpy namespace.
Remove auto include of numpy namespace. git-svn-id: 003f22d385e25de9cff933a5ea4efd77cb5e7b28@1522 d6536bca-fef9-0310-8506-e4c0a848fbcf
Python
bsd-3-clause
scipy/scipy-svn,jasonmccampbell/scipy-refactor,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,jasonmccampbell/scipy-refactor,lesserwhirls/scipy-cwt,scipy/scipy-svn,lesserwhirls/scipy-cwt,lesserwhirls/scipy-cwt,scipy/scipy-svn,scipy/scipy-svn,jasonmccampbell/scipy-refactor
e9c4881ee29ba104caf9fc8330583c254fe52c06
scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py
scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py
# Deep Sleep Mode Example # This example demonstrates the low-power deep sleep mode plus sensor shutdown. # Note the camera will reset after wake-up from deep sleep. To find out if the cause of reset # is deep sleep, call the machine.reset_cause() function and test for machine.DEEPSLEEP_RESET import pyb, machine, senso...
# Deep Sleep Mode Example # This example demonstrates the low-power deep sleep mode plus sensor shutdown. # Note the camera will reset after wake-up from deep sleep. To find out if the cause of reset # is deep sleep, call the machine.reset_cause() function and test for machine.DEEPSLEEP_RESET import pyb, machine, senso...
Remove sensor setting from deep sleep example
Remove sensor setting from deep sleep example
Python
mit
iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv
ae8273f86fc3cc7fdacadf495aa148dda796f11b
printcli.py
printcli.py
#!/usr/bin/env python2 import argparse import os from labelprinter import Labelprinter if os.path.isfile('labelprinterServeConf_local.py'): import labelprinterServeConf_local as conf else: import labelprinterServeConf as conf def text(args, labelprinter): bold = 'on' if args.bold else 'off' labelpri...
#!/usr/bin/env python2 import argparse import os from labelprinter import Labelprinter import labelprinterServeConf as conf def text(args, labelprinter): bold = 'on' if args.bold else 'off' labelprinter.printText(args.text, charSize=args.char_size, font=args.font, ...
Make the CLI use the new config (see e4054fb).
Make the CLI use the new config (see e4054fb).
Python
mit
chaosdorf/labello,chaosdorf/labello,chaosdorf/labello
68e6321113c249508dad89688e58860ef5728d64
microscopes/lda/runner.py
microscopes/lda/runner.py
"""Implements the Runner interface fo LDA """ from microscopes.common import validator from microscopes.common.rng import rng from microscopes.lda.kernels import lda_crp_gibbs from microscopes.lda.kernels import lda_sample_dispersion class runner(object): """The LDA runner Parameters ---------- defn...
"""Implements the Runner interface fo LDA """ from microscopes.common import validator from microscopes.common.rng import rng from microscopes.lda.kernels import lda_crp_gibbs from microscopes.lda.kernels import sample_gamma, sample_alpha class runner(object): """The LDA runner Parameters ---------- ...
Use C++ implementations of hp sampling
Use C++ implementations of hp sampling
Python
bsd-3-clause
datamicroscopes/lda,datamicroscopes/lda,datamicroscopes/lda
a32e61e9cdf2eababb568659766688a731b121cb
warlock/__init__.py
warlock/__init__.py
# Copyright 2012 Brian Waldon # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2012 Brian Waldon # # 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,...
Apply 'no blanket NOQA statements' fixes enforced by pre-commit hook
Apply 'no blanket NOQA statements' fixes enforced by pre-commit hook
Python
apache-2.0
bcwaldon/warlock
3dae7f461d34efceb2e8b0194306d85236fea1fc
src/main/python/piglatin.py
src/main/python/piglatin.py
import sys def parseCommandLine(argv): print 'Inside parser' return argv[1] if len(argv) > 1 else "" if __name__ == "__main__": latin = parseCommandLine(sys.argv) print(latin) print("igpay atinlay")
import sys def parseCommandLine(argv): return argv[1] if len(argv) > 1 else "" if __name__ == "__main__": latin = parseCommandLine(sys.argv) print(latin) print("igpay atinlay")
Test case failing for python3 removed
Test case failing for python3 removed
Python
mit
oneyoke/sw_asgmt_2
cdbe3f5ed5e65a14c1f40cc5daa84a9103e4322d
tests/test_boto_store.py
tests/test_boto_store.py
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
#!/usr/bin/env python import os from tempdir import TempDir import pytest boto = pytest.importorskip('boto') from simplekv.net.botostore import BotoStore from basic_store import BasicStore from url_store import UrlStore from bucket_manager import boto_credentials, boto_bucket @pytest.fixture(params=boto_credentia...
Use key fixture in boto tests.
Use key fixture in boto tests.
Python
mit
fmarczin/simplekv,fmarczin/simplekv,karteek/simplekv,mbr/simplekv,karteek/simplekv,mbr/simplekv
d65f39d85e98be8651863bcf617fb218e266d0bb
mpfmc/uix/relative_animation.py
mpfmc/uix/relative_animation.py
from kivy.animation import Animation class RelativeAnimation(Animation): """Class that extends the Kivy Animation base class to add relative animation property target values that are calculated when the animation starts.""" def _initialize(self, widget): """Initializes the animation and calculat...
from kivy.animation import Animation class RelativeAnimation(Animation): """Class that extends the Kivy Animation base class to add relative animation property target values that are calculated when the animation starts.""" def _initialize(self, widget): """Initializes the animation and calculat...
Fix relative animation of list values
Fix relative animation of list values
Python
mit
missionpinball/mpf-mc,missionpinball/mpf-mc,missionpinball/mpf-mc
12585ce38fc3ec7a0ddcf448cc398f694c7e29fb
dakis/api/views.py
dakis/api/views.py
from rest_framework import serializers, viewsets from rest_framework import filters from django.contrib.auth.models import User from dakis.core.models import Experiment, Task class ExperimentSerializer(serializers.HyperlinkedModelSerializer): id = serializers.IntegerField(label='ID', read_only=True) class ...
from rest_framework import serializers, viewsets from rest_framework import filters from django.contrib.auth.models import User from dakis.core.models import Experiment, Task class ExperimentSerializer(serializers.HyperlinkedModelSerializer): id = serializers.IntegerField(label='ID', read_only=True) class ...
Exclude details field from editable through API
Exclude details field from editable through API
Python
agpl-3.0
niekas/dakis,niekas/dakis,niekas/dakis
cfb50f4ff62770c397634897e09497b74b396067
notifications/level_starting.py
notifications/level_starting.py
from consts.notification_type import NotificationType from notifications.base_notification import BaseNotification class CompLevelStartingNotification(BaseNotification): def __init__(self, match, event): self.match = match self.event = event def _build_dict(self): data = {} d...
from consts.notification_type import NotificationType from notifications.base_notification import BaseNotification class CompLevelStartingNotification(BaseNotification): def __init__(self, match, event): self.match = match self.event = event def _build_dict(self): data = {} d...
Add event key to comp level starting notification
Add event key to comp level starting notification
Python
mit
josephbisch/the-blue-alliance,synth3tk/the-blue-alliance,phil-lopreiato/the-blue-alliance,phil-lopreiato/the-blue-alliance,fangeugene/the-blue-alliance,bvisness/the-blue-alliance,nwalters512/the-blue-alliance,nwalters512/the-blue-alliance,josephbisch/the-blue-alliance,the-blue-alliance/the-blue-alliance,verycumbersome/...
0177066012b3373753cba8baf86f00a365d7147b
findaconf/tests/config.py
findaconf/tests/config.py
# coding: utf-8 from decouple import config from findaconf.tests.fake_data import fake_conference, seed def set_app(app, db=False): unset_app(db) app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False if db: app.config['SQLALCHEMY_DATABASE_URI'] = config( 'DATABASE_UR...
# coding: utf-8 from decouple import config from findaconf.tests.fake_data import fake_conference, seed def set_app(app, db=False): # set test vars app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False # set test db if db: app.config['SQLALCHEMY_DATABASE_URI'] = co...
Fix bug that used dev db instead of test db
Fix bug that used dev db instead of test db
Python
mit
cuducos/findaconf,koorukuroo/findaconf,cuducos/findaconf,koorukuroo/findaconf,koorukuroo/findaconf,cuducos/findaconf
592df76f77c3450ba56b249ab0cd4404c8dd99e2
bundle_graph.py
bundle_graph.py
#!/usr/bin/python3 from random import randint class Student: def __init__(self, id): self.id = id self.papers = [] def assign_paper(self, paper): self.papers.append(paper) def __str__(self): return str(self.id) + ": " + str(self.papers) class Paper: def __init__(self, ...
#!/usr/bin/python3 from random import randint class Student: def __init__(self, id): self.id = id self.papers = [] def assign_paper(self, paper): self.papers.append(paper) def __str__(self): return str(self.id) + ": " + str(self.papers) class Paper: def __init__(self, ...
Update validation check for paper bundles.
Update validation check for paper bundles.
Python
mit
haoyueping/peer-grading-for-MOOCs
5053d6e6525fd4141e4a959ca6ca415201154ed2
src/main/java/io/github/saidie/plantuml_api/Account.java
src/main/java/io/github/saidie/plantuml_api/Account.java
package io.github.saidie.plantuml_api; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.validation.constraints.NotNull; im...
package io.github.saidie.plantuml_api; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Entity @Da...
Remove a dependency from account to federations
Remove a dependency from account to federations
Java
mit
saidie/plantuml-api,saidie/plantuml-api
3b139e7da28abe8f15b09dd9da8ed094b85d8a35
src/test/java/seedu/address/commons/core/ConfigTest.java
src/test/java/seedu/address/commons/core/ConfigTest.java
package seedu.address.commons.core; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import seedu.task.commons.core.Config; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class ConfigTe...
package seedu.address.commons.core; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import seedu.task.commons.core.Config; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class ConfigTe...
Change 'Address App' to Task Manager'
Change 'Address App' to Task Manager'
Java
mit
CS2103AUG2016-T15-C1/main
c857c531c5473ae9920c1f0308c29ac327ced0ea
OpenEdXMobile/src/main/java/org/edx/mobile/base/BaseFragment.java
OpenEdXMobile/src/main/java/org/edx/mobile/base/BaseFragment.java
package org.edx.mobile.base; import android.app.Activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import org.edx.mobile.event.NewRelicEvent; import de.greenrobot.event.EventBus; import roboguice...
package org.edx.mobile.base; import android.app.Activity; import android.os.Bundle; import org.edx.mobile.event.NewRelicEvent; import de.greenrobot.event.EventBus; import roboguice.fragment.RoboFragment; public class BaseFragment extends RoboFragment { private boolean isFirstVisit = true; @Override pub...
Fix 'onRevisit' callback calls wrongly issue.
Fix 'onRevisit' callback calls wrongly issue. - LEARNER-3953
Java
apache-2.0
edx/edx-app-android,edx/edx-app-android,edx/edx-app-android,edx/edx-app-android,edx/edx-app-android,edx/edx-app-android
3609489c0cfd14f9f28a46555f099adcbc29b539
generators/server/templates/src/main/java/package/web/rest/errors/_CustomParameterizedException.java
generators/server/templates/src/main/java/package/web/rest/errors/_CustomParameterizedException.java
package <%=packageName%>.web.rest.errors; import java.util.HashMap; import java.util.Map; /** * Custom, parameterized exception, which can be translated on the client side. * For example: * * <pre> * throw new CustomParameterizedException(&quot;myCustomError&quot;, &quot;hello&quot;, &quot;world&quot;); * </pre...
package <%=packageName%>.web.rest.errors; import java.util.HashMap; import java.util.Map; /** * Custom, parameterized exception, which can be translated on the client side. * For example: * * <pre> * throw new CustomParameterizedException(&quot;myCustomError&quot;, &quot;hello&quot;, &quot;world&quot;); * </pre...
Change code to make Sonar happy
Change code to make Sonar happy See #5489
Java
apache-2.0
cbornet/generator-jhipster,jhipster/generator-jhipster,sohibegit/generator-jhipster,PierreBesson/generator-jhipster,stevehouel/generator-jhipster,stevehouel/generator-jhipster,siliconharborlabs/generator-jhipster,gzsombor/generator-jhipster,jhipster/generator-jhipster,duderoot/generator-jhipster,mraible/generator-jhips...
951e4508c8d0612dbcecbedb25a0ec60689b5fa5
plugins/org.yakindu.base.expressions.ui/src/org/yakindu/base/expressions/ui/ExpressionsUiModule.java
plugins/org.yakindu.base.expressions.ui/src/org/yakindu/base/expressions/ui/ExpressionsUiModule.java
/* * generated by Xtext */ package org.yakindu.base.expressions.ui; import org.eclipse.ui.plugin.AbstractUIPlugin; /** * Use this class to register components to be used within the IDE. */ public class ExpressionsUiModule extends org.yakindu.base.expressions.ui.AbstractExpressionsUiModule { public ExpressionsUiM...
/* * generated by Xtext */ package org.yakindu.base.expressions.ui; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.xtext.ui.editor.model.IResourceForEditorInputFactory; import org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory; import org.eclipse.xtext.ui.editor.model.Re...
Check if JST is available
Check if JST is available
Java
epl-1.0
Yakindu/statecharts,Yakindu/statecharts,Yakindu/statecharts,Yakindu/statecharts,Yakindu/statecharts,Yakindu/statecharts,Yakindu/statecharts
6588a9e4f5e8489330cb013476988b547efc8d8d
plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/BaseClickHouseConnectorSmokeTest.java
plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/BaseClickHouseConnectorSmokeTest.java
/* * 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 * distribut...
/* * 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 * distribut...
Enable testRenameSchema in ClickHouse smoke test
Enable testRenameSchema in ClickHouse smoke test
Java
apache-2.0
smartnews/presto,smartnews/presto,smartnews/presto,smartnews/presto,smartnews/presto
69726e32ec5d7e90f4ef027a971516d178e31ccd
client/src/test/java/replicant/ConvergerTest.java
client/src/test/java/replicant/ConvergerTest.java
package replicant; import org.testng.annotations.Test; import static org.testng.Assert.*; public class ConvergerTest extends AbstractReplicantTest { @Test public void construct_withUnnecessaryContext() { final ReplicantContext context = Replicant.context(); final IllegalStateException exception = ...
package replicant; import org.testng.annotations.Test; import static org.testng.Assert.*; public class ConvergerTest extends AbstractReplicantTest { @Test public void construct_withUnnecessaryContext() { final ReplicantContext context = Replicant.context(); final IllegalStateException exception = ...
Add test for getReplicantContext with zones enabled
Add test for getReplicantContext with zones enabled
Java
apache-2.0
realityforge/replicant,realityforge/replicant
968a039501401b9776ace4d38fbcef71fdf4d03d
src/bwyap/familyfeud/game/fastmoney/state/FFFastMoneyStateType.java
src/bwyap/familyfeud/game/fastmoney/state/FFFastMoneyStateType.java
package bwyap.familyfeud.game.fastmoney.state; /** * States in a family feud game whilst playing Fast Money * @author bwyap * */ public enum FFFastMoneyStateType { // TODO ; private String name; private FFFastMoneyStateType(String name) { this.name = name; } @Override public String toString() { re...
package bwyap.familyfeud.game.fastmoney.state; /** * States in a family feud game whilst playing Fast Money * @author bwyap * */ public enum FFFastMoneyStateType { P1_ANSWER("p1 answer"), P1_REVEAL("p1 reveal"), P2_ANSWER("p2 answer"), P2_REVEAL("p2 reveal"); private String name; private FFFastMoneySta...
Add Fast Money state types
Add Fast Money state types
Java
mit
bwyap/java-familyfeud
6b2e3456b0ac40ea4c95944be2ffbeea58ddac49
jar-class-loader/src/main/java/com/thoughtworks/gocd/AssertJava.java
jar-class-loader/src/main/java/com/thoughtworks/gocd/AssertJava.java
/* * Copyright 2020 ThoughtWorks, 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 agr...
/* * Copyright 2020 ThoughtWorks, 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 agr...
Allow JDK 15 in prep for 20.9.0
Allow JDK 15 in prep for 20.9.0
Java
apache-2.0
marques-work/gocd,GaneshSPatil/gocd,gocd/gocd,marques-work/gocd,Skarlso/gocd,Skarlso/gocd,ketan/gocd,gocd/gocd,Skarlso/gocd,Skarlso/gocd,ketan/gocd,gocd/gocd,ketan/gocd,marques-work/gocd,Skarlso/gocd,gocd/gocd,ketan/gocd,GaneshSPatil/gocd,GaneshSPatil/gocd,marques-work/gocd,marques-work/gocd,GaneshSPatil/gocd,ketan/goc...
e387435680c658dd8182b1542b70a1ebba85f10e
junit/src/main/java/io/cucumber/junit/Assertions.java
junit/src/main/java/io/cucumber/junit/Assertions.java
package io.cucumber.junit; import io.cucumber.core.exception.CucumberException; import java.lang.annotation.Annotation; import java.lang.reflect.Method; final class Assertions { private Assertions() { } static void assertNoCucumberAnnotatedMethods(Class clazz) { for (Method method : clazz.getDec...
package io.cucumber.junit; import io.cucumber.core.exception.CucumberException; import java.lang.annotation.Annotation; import java.lang.reflect.Method; final class Assertions { private Assertions() { } static void assertNoCucumberAnnotatedMethods(Class clazz) { for (Method method : clazz.getDec...
Remove cucumber.api glue annotation check
[JUnit] Remove cucumber.api glue annotation check
Java
mit
cucumber/cucumber-jvm,cucumber/cucumber-jvm,cucumber/cucumber-jvm,cucumber/cucumber-jvm,cucumber/cucumber-jvm
f049910d9154bd7ad7a8a31e5712d75f4ee75fa3
src/main/java/net/glowstone/scoreboard/GlowScore.java
src/main/java/net/glowstone/scoreboard/GlowScore.java
package net.glowstone.scoreboard; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.S...
package net.glowstone.scoreboard; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import net.glowstone.net.message.play.scoreboard.ScoreboardScoreMessage; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.S...
Revert getLocked (Lombokified name was isLocked)
Revert getLocked (Lombokified name was isLocked)
Java
mit
GlowstonePlusPlus/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus
152ec3240776d42e23b534e4482d37586d790d22
src/com/java/laiy/Main.java
src/com/java/laiy/Main.java
package com.java.laiy; import com.java.laiy.controller.Game; import com.java.laiy.controller.GameController; import com.java.laiy.model.Board; import com.java.laiy.model.Figure; import com.java.laiy.model.Player; import com.java.laiy.view.ConsoleView; public class Main { public static void main(final String[] ar...
package com.java.laiy; import com.java.laiy.view.ConsoleMenuView; public class Main { public static void main(final String[] args) { ConsoleMenuView.showMenuWithResult(); } }
Move game start and settings to MenuView, MenuView renamed in ConsoleMenuView
Move game start and settings to MenuView, MenuView renamed in ConsoleMenuView
Java
mit
b0noI/TicTacToe,kphanjsu/TicTacToe-1
f2efe5db345ff4ecd1410d668708c0fdb81ccd9d
src/main/java/info/sleeplessacorn/nomagi/client/StateMapperNoCTM.java
src/main/java/info/sleeplessacorn/nomagi/client/StateMapperNoCTM.java
package info.sleeplessacorn.nomagi.client; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.Loader; ...
package info.sleeplessacorn.nomagi.client; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.Loader; ...
Update CTM statemapper to check for ConnectedTexturesMod
Update CTM statemapper to check for ConnectedTexturesMod
Java
mit
SleeplessAcorn/DimensionallyTranscendentalTents
ab54ffc404cdff1ce6a2c2a3fabe6cc86a8a7aed
engine/packaging-utils/src/main/java/com/torodb/packaging/config/validation/MutualExclusiveReplSetOrShardsValidator.java
engine/packaging-utils/src/main/java/com/torodb/packaging/config/validation/MutualExclusiveReplSetOrShardsValidator.java
/* * ToroDB * Copyright © 2014 8Kdata Technology (www.8kdata.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later...
/* * ToroDB * Copyright © 2014 8Kdata Technology (www.8kdata.com) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later...
Allow a commond replSetName for all shards
Allow a commond replSetName for all shards
Java
agpl-3.0
torodb/server,torodb/engine,torodb/server,teoincontatto/engine,torodb/stampede,torodb/engine,torodb/stampede
6f29955aeec4112318ab9ee5cdd52318376737c2
eagle-core/eagle-data-process/eagle-storm-jobrunning-spout/src/main/java/org/apache/eagle/jobrunning/url/JobCompletedConfigServiceURLBuilderImpl.java
eagle-core/eagle-data-process/eagle-storm-jobrunning-spout/src/main/java/org/apache/eagle/jobrunning/url/JobCompletedConfigServiceURLBuilderImpl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Add a missing anonymous parameter in hive running spout
[EAGLE-55] Add a missing anonymous parameter in hive running spout Author: 38aa841db38ea48e0419af2a083503ced2375284@ebay.com Reviewer: 32da457b72ebfbb2f00ec273d0f0df9d3f712280@apache.org
Java
apache-2.0
DadanielZ/incubator-eagle,yonzhang/incubator-eagle,rlugojr/incubator-eagle,zombieJ/incubator-eagle,Jashchahal/incubator-eagle,zombieJ/incubator-eagle,haoch/incubator-eagle,anyway1021/incubator-eagle,yonzhang/incubator-eagle,sunlibin/incubator-eagle,Jashchahal/incubator-eagle,rlugojr/incubator-eagle,rlugojr/incubator-ea...
1896776f9811f953fd50f3e24f782cb26430af70
lang-impl/src/com/intellij/find/findUsages/CommonFindUsagesDialog.java
lang-impl/src/com/intellij/find/findUsages/CommonFindUsagesDialog.java
package com.intellij.find.findUsages; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement; import com.intellij.usageView.UsageViewUtil; import javax.swing.*; /** * Created by IntelliJ IDEA. * User: max * Date: Feb 14, 2005 * Time: 5:40...
package com.intellij.find.findUsages; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement; import com.intellij.usageView.UsageViewUtil; import javax.swing.*; /** * Created by IntelliJ IDEA. * User: max * Date: Feb 14, 2005 * Time: 5:40...
Fix non-java find usages dialogs.
Fix non-java find usages dialogs.
Java
apache-2.0
Distrotech/intellij-community,ahb0327/intellij-community,amith01994/intellij-community,izonder/intellij-community,apixandru/intellij-community,asedunov/intellij-community,semonte/intellij-community,Distrotech/intellij-community,vladmm/intellij-community,vladmm/intellij-community,supersven/intellij-community,clumsy/inte...
e774a4c152653b5d667a39033b70d6285083897e
portfolio/src/main/java/com/google/sps/servlets/AudioInputServlet.java
portfolio/src/main/java/com/google/sps/servlets/AudioInputServlet.java
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
Add get retrieval of FormData
Add get retrieval of FormData
Java
apache-2.0
googleinterns/step43-2020,googleinterns/step43-2020,googleinterns/step43-2020,googleinterns/step43-2020
81b45700c57e7ccf096860117d039937413ec441
core/src/uk/co/alynn/games/ld30/world/Invader.java
core/src/uk/co/alynn/games/ld30/world/Invader.java
package uk.co.alynn.games.ld30.world; public abstract class Invader implements Adversary { private final float m_x, m_y; public Invader(float x, float y) { m_x = x; m_y = y; } @Override public String getImage() { return "invader"; } @Override public f...
package uk.co.alynn.games.ld30.world; public abstract class Invader implements Adversary { private final float m_x, m_y; public Invader(float x, float y) { m_x = x; m_y = y; } @Override public String getImage() { return "invader"; } @Override public f...
Make collisions with invaders destroy the player
Make collisions with invaders destroy the player
Java
mit
prophile/ludum-dare-30,prophile/ludum-dare-30