commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
4752f704596613bbb80a649b275c79ce156b32ec | Fix library not found on linux | gpuopenanalytics/libgdf,gpuopenanalytics/libgdf,gpuopenanalytics/libgdf,gpuopenanalytics/libgdf | python/libgdf_cffi/__init__.py | python/libgdf_cffi/__init__.py | from __future__ import absolute_import
import os
import sys
from .wrapper import _libgdf_wrapper
from .wrapper import GDFError # re-exported
try:
from .libgdf_cffi import ffi
except ImportError:
pass
else:
def _get_lib_name():
if os.name == 'posix':
# TODO this will need to ... | from __future__ import absolute_import
import os, sys
from .wrapper import _libgdf_wrapper
from .wrapper import GDFError # re-exported
try:
from .libgdf_cffi import ffi
except ImportError:
pass
else:
def _get_lib_name():
if os.name == 'posix':
# TODO this will need to be cha... | apache-2.0 | Python |
70ae46aab717a7695239bc36ca2aa2db764e6d3e | Fix small mistake in CV example comment | Saurabh7/shogun,lisitsyn/shogun,Saurabh7/shogun,karlnapf/shogun,geektoni/shogun,lambday/shogun,geektoni/shogun,Saurabh7/shogun,besser82/shogun,sorig/shogun,shogun-toolbox/shogun,lisitsyn/shogun,geektoni/shogun,besser82/shogun,lisitsyn/shogun,shogun-toolbox/shogun,Saurabh7/shogun,sorig/shogun,shogun-toolbox/shogun,lambd... | examples/undocumented/python_modular/evaluation_cross_validation_classification.py | examples/undocumented/python_modular/evaluation_cross_validation_classification.py | #!/usr/bin/env python
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Written (W) 2012 Heiko Strathmann
# Copyrigh... | #!/usr/bin/env python
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Written (W) 2012 Heiko Strathmann
# Copyrigh... | bsd-3-clause | Python |
414a991d850ee21f682015c3c277170842f44404 | fix translation string | SEL-Columbia/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,gmimano/commcaretest,gmimano/commcaretest,qedsoftware/commcare-hq,qedsoftware/commcare-hq,gmimano/commcaretest,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbi... | corehq/apps/api/util.py | corehq/apps/api/util.py | from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from couchdbkit.exceptions import ResourceNotFound
def get_object_or_not_exist(cls, doc_id, domain):
"""
Given a Document class, id, and domain, get that object or raise
an ObjectDoesNotExist exception ... | from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from couchdbkit.exceptions import ResourceNotFound
def get_object_or_not_exist(cls, doc_id, domain):
"""
Given a Document class, id, and domain, get that object or raise
an ObjectDoesNotExist exception ... | bsd-3-clause | Python |
e6e144c38edb9121f7f03b5b8ed164692e4b36b9 | Remove failing test assertion. | wakermahmud/sync-engine,nylas/sync-engine,gale320/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,closeio/nylas,closeio/nylas,Eagles2F/sync-engine,jobscore/sync-engine,nylas/sync-engine,nylas/sync-engine,closeio/nylas,Eagles2F/sync-engine,ErinCall/sync-engine,gale320/sync-engine,ErinCall/sync-engine,ErinCall/s... | tests/events/test_inviting.py | tests/events/test_inviting.py | from tests.util.base import event
def test_invite_generation(event, default_account):
from inbox.events.ical import generate_icalendar_invite
event.sequence_number = 1
event.participants = [{'email': 'helena@nylas.com'},
{'email': 'myles@nylas.com'}]
cal = generate_icalendar... | from tests.util.base import event
def test_invite_generation(event, default_account):
from inbox.events.ical import generate_icalendar_invite
event.sequence_number = 1
event.participants = [{'email': 'helena@nylas.com'},
{'email': 'myles@nylas.com'}]
cal = generate_icalendar... | agpl-3.0 | Python |
30198bad431b5dbaa9a5355d64aca1ff92beb54d | Update 01_Blinking_and_Fading_a_LED.py | userdw/RaspberryPi_3_Starter_Kit | 01_Blinking_and_Fading_a_LED/01_Blinking_and_Fading_a_LED.py | 01_Blinking_and_Fading_a_LED/01_Blinking_and_Fading_a_LED.py | import wiringpi # import library WiringPi-Python
from time import sleep # import library sleep
wiringpi.wiringPiSetup() # Must be called before using IO function
wiringpi.pinMode(1,1) # Set pin 9 to 1 (OUTPUT) / 0 (INPUT)
wiringpi.softPwmCreate(1,0,100) # Set PWM on pin 9... |
import wiringpi # import library WiringPi-Python
from time import sleep # import library sleep
wiringpi.wiringPiSetup() # Must be called before using IO function
wiringpi.pinMode(1,1) # Set pin 9 to 1 (OUTPUT) / 0 (INPUT)
wiringpi.softPwmCreate(1,0,100) # Set PWM on pin ... | mit | Python |
76ef4b051dec7564150939a279f903a404191b1d | Fix reading calc report [skip CI] | gem/oq-svir-qgis,gem/oq-svir-qgis,gem/oq-svir-qgis,gem/oq-svir-qgis | svir/dialogs/show_full_report_dialog.py | svir/dialogs/show_full_report_dialog.py |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... | agpl-3.0 | Python |
2a82d102d7bc7377a8766485e7f484392ac0d5a8 | Disable debug logging | beerfactory/hbmqtt | tests/plugins/test_manager.py | tests/plugins/test_manager.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
import unittest
import logging
import asyncio
from hbmqtt.plugins.manager import PluginManager
#formatter = "[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s"
#logging.basicConfig(level=logging.DEBUG, format=fo... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
import unittest
import logging
import asyncio
from hbmqtt.plugins.manager import PluginManager
formatter = "[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s"
logging.basicConfig(level=logging.DEBUG, format=form... | mit | Python |
b1dcf10e4c8cbc3f380cb812bfe65dea2a1753f3 | Fix test | QuantCrimAtLeeds/PredictCode | tests/sources/chicago_test.py | tests/sources/chicago_test.py | import pytest
import unittest.mock as mock
from tests.helpers import MockOpen
import os.path
import numpy as np
import open_cp.sources.chicago as chicago
def test_set_data_dir():
chicago.set_data_directory("..")
assert chicago.get_default_filename() == os.path.join("..", "chicago.csv")
@pytest.fixture
def st... | import pytest
import unittest.mock as mock
from tests.helpers import MockOpen
import os.path
import numpy as np
import open_cp.sources.chicago as chicago
def test_set_data_dir():
chicago.set_data_directory("..")
assert chicago.get_default_filename() == os.path.join("..", "chicago.csv")
@pytest.fixture
def st... | artistic-2.0 | Python |
60a73b46c537fc27f6ea92a91dec851361da12a2 | Move plugins to Custom | spacetelescope/stginga,pllim/stginga | stginga/plugin_info.py | stginga/plugin_info.py | """This module contains functions to handle ``stginga`` plugins.
See :ref:`stginga-run`.
"""
from __future__ import absolute_import, division, print_function
# GINGA
from ginga.misc.Bunch import Bunch
__all__ = ['load_plugins', 'show_plugin_install_info']
def load_plugins(ginga):
"""Load the ``stginga`` plugin... | """This module contains functions to handle ``stginga`` plugins.
See :ref:`stginga-run`.
"""
from __future__ import absolute_import, division, print_function
# GINGA
from ginga.misc.Bunch import Bunch
__all__ = ['load_plugins', 'show_plugin_install_info']
def load_plugins(ginga):
"""Load the ``stginga`` plugin... | bsd-3-clause | Python |
2b99ef66938ed71853c8746ca301704e2be5d0e4 | fix condition when normalize_memory tries to use integer as a string | D3DeFi/vmcli | lib/tools/__init__.py | lib/tools/__init__.py | from lib.constants import VM_MIN_MEM, VM_MAX_MEM
from lib.exceptions import VmCLIException
def normalize_memory(value):
"""Function converts passed value to integer, which will represent size in megabytes
as well as performs control whether the value sits between global limits."""
if isinstance(value, st... | from lib.constants import VM_MIN_MEM, VM_MAX_MEM
from lib.exceptions import VmCLIException
def normalize_memory(value):
"""Function converts passed value to integer, which will represent size in megabytes
as well as performs control whether the value sits between global limits."""
if value.endswith('T'):... | apache-2.0 | Python |
b61dfffa600c05eed34c5bcc30a2da61f0f6bd73 | Update __version__.py | payplug/payplug-python | payplug/__version__.py | payplug/__version__.py | # -*- coding: utf-8 -*-
__version__ = '1.3.1'
| # -*- coding: utf-8 -*-
__version__ = '1.3.0'
| mit | Python |
0d66e594eeb09c1415964a00a4cfa2280464f840 | add allow empty and not in for states | buxx/synergine | synergine/core/simulation/MetaStates.py | synergine/core/simulation/MetaStates.py | from synergine.synergy.Simulation import Simulation
class MetaStates():
def __init__(self, list):
self._list = list
# TODO: have_list etc
def have_list(self, object_id, states):
for state in states:
if not self._list.have(Simulation.STATE, object_id, state, allow_empty=True):
... | from synergine.synergy.Simulation import Simulation
class MetaStates():
def __init__(self, list):
self._list = list
# TODO: have_list etc
def have_list(self, object_id, states):
for state in states:
if not self._list.have(Simulation.STATE, object_id, state, allow_empty=True):
... | apache-2.0 | Python |
88e839144f4a1dac1468e03f5cd506841caadc84 | Fix typo in 'job not found message' and jobs list output code | marcoacierno/django-schedulermanager | django_schedulermanager/management/commands/schedulejob.py | django_schedulermanager/management/commands/schedulejob.py | from django.core.management.base import BaseCommand
from django_schedulermanager.manager import manager
class Command(BaseCommand):
help = 'Schedules a job'
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('jobs_name', nargs='+')
def handle(self, *args, **opti... | from django.core.management.base import BaseCommand
from django_schedulermanager.manager import manager
class Command(BaseCommand):
help = 'Schedules a job'
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('jobs_name', nargs='+')
def handle(self, *args, **opti... | mit | Python |
bd166b623a3a92c1ae21bc3e8a091b68dcba089a | Test cosmetics. | ofgulban/tetrahydra | tetrahydra/tests/test_core.py | tetrahydra/tests/test_core.py | """Test core functions."""
import pytest
import numpy as np
from tetrahydra.core import closure, perturb, power
def test_closure():
"""Test closure operator."""
# Given
data = np.random.random([2, 3])
expected = np.ones(2)
# When
output = np.sum(closure(data), axis=1)
# Then
assert ou... | """Test core functions."""
import pytest
import numpy as np
from tetrahydra.core import closure, perturb, power
def test_closure():
"""Test closure operator."""
data = np.random.random([2, 3])
assert np.sum(closure(data), axis=1) == pytest.approx(np.ones(2))
def test_perturb():
"""Test perturbation... | bsd-3-clause | Python |
fee4b8137961ed828ebcabae3a2e7270601a1ce1 | Fix version number | lightning-viz/lightning-python,garretstuber/lightning-python,garretstuber/lightning-python,peterkshultz/lightning-python,lightning-viz/lightning-python,peterkshultz/lightning-python,peterkshultz/lightning-python,garretstuber/lightning-python | lightning/__init__.py | lightning/__init__.py | from .main import Lightning
from .session import Session
from .visualization import Visualization
from .types.plots import *
from .types.images import *
from .types.streaming import *
from .types.three import *
__version__ = "1.0.8"
| from .main import Lightning
from .session import Session
from .visualization import Visualization
from .types.plots import *
from .types.images import *
from .types.streaming import *
from .types.three import *
__version__ = "1.0.6"
| mit | Python |
02535df1ce4ae43ba142a169810910d375605792 | Fix the space correcting code because restructured text still adds a bunch of paragraph tags | Justasic/StackSmash,Justasic/StackSmash | StackSmash/apps/lib/templatetags/restructuredtext_filter.py | StackSmash/apps/lib/templatetags/restructuredtext_filter.py | from django import template
from django.core.cache import cache
from docutils import nodes
from docutils.core import publish_parts
from docutils.parsers.rst import directives, Directive
from docutils.core import publish_cmdline, default_description
from pygments import highlight
from pygments.lexers import get_lexer_by... | from django import template
from django.core.cache import cache
from docutils import nodes
from docutils.core import publish_parts
from docutils.parsers.rst import directives, Directive
from docutils.core import publish_cmdline, default_description
from pygments import highlight
from pygments.lexers import get_lexer_by... | bsd-2-clause | Python |
b8597aa3d53a0d68b8ac1e61bce97804fa02ba3a | Add versioning support to ryu controller | pablomuri/Engine,pablomuri/Engine,fp7-netide/Engine,pablomuri/Engine,fp7-netide/Engine,fp7-netide/Engine,fp7-netide/Engine,fp7-netide/Engine | loader/controllers.py | loader/controllers.py | # coding=utf-8
"""
Copyright (c) 2015, NetIDE Consortium (Create-Net (CN), Telefonica Investigacion Y Desarrollo SA (TID), Fujitsu
Technology Solutions GmbH (FTS), Thales Communications & Security SAS (THALES), Fundacion Imdea Networks (IMDEA),
Universitaet Paderborn (UPB), Intel Research & Innovation Ireland Ltd (I... | # coding=utf-8
"""
Copyright (c) 2015, NetIDE Consortium (Create-Net (CN), Telefonica Investigacion Y Desarrollo SA (TID), Fujitsu
Technology Solutions GmbH (FTS), Thales Communications & Security SAS (THALES), Fundacion Imdea Networks (IMDEA),
Universitaet Paderborn (UPB), Intel Research & Innovation Ireland Ltd (I... | epl-1.0 | Python |
d2d743248a97f7045d50e29541bb513efeed3f44 | Add missing numpy import to pytools.io | carthach/essentia,MTG/essentia,carthach/essentia,carthach/essentia,MTG/essentia,MTG/essentia,carthach/essentia,carthach/essentia,MTG/essentia,MTG/essentia | src/python/essentia/pytools/io.py | src/python/essentia/pytools/io.py | # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | agpl-3.0 | Python |
939e449887a9354a43944acb6137fac4ff7a5daf | Print % completion in 'importdata' command | rafidka/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse | HadithHouseWebsite/hadiths/management/commands/importdata.py | HadithHouseWebsite/hadiths/management/commands/importdata.py | import codecs
import os
from django.core.management.base import BaseCommand, CommandError
from hadiths.models import Hadith, Book
from hadiths import initial_data
class Command(BaseCommand):
help = 'Import data to the website'
def add_arguments(self, parser):
parser.add_argument('dataname', nargs=1, type=st... | import codecs
import os
from django.core.management.base import BaseCommand, CommandError
from hadiths.models import Hadith, Book
from hadiths import initial_data
class Command(BaseCommand):
help = 'Import data to the website'
def add_arguments(self, parser):
parser.add_argument('dataname', nargs=1, type=st... | mit | Python |
86227c6cbe7003ad39af1342fd5fc03d577675d5 | Add an additional nbgrader update test | jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,jupyter/nbgrader | nbgrader/tests/apps/test_nbgrader_update.py | nbgrader/tests/apps/test_nbgrader_update.py | from os.path import join
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderUpdate(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["update", "--help-all"])
def test_no_args(self):
"""Is there an error if no argumen... | from os.path import join
from .. import run_nbgrader
from .base import BaseTestApp
class TestNbGraderUpdate(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_nbgrader(["update", "--help-all"])
def test_no_args(self):
"""Is there an error if no argumen... | bsd-3-clause | Python |
cdf6ab90f77583c9a716afd9d751b417396fe976 | add SESSION_COOKIE_NAME setting | djaodjin/djaodjin-deployutils,djaodjin/djaodjin-deployutils,djaodjin/djaodjin-deployutils | deployutils/settings.py | deployutils/settings.py | # Copyright (c) 2014, Djaodjin Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | # Copyright (c) 2014, Djaodjin Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | bsd-2-clause | Python |
8a5984f9b49c978e296a315ed62b52c92548636c | fix populate wikivoyage | whosken/destinate | destinate/wikivoyage.py | destinate/wikivoyage.py | import mwclient
import mwparserfromhell
HOST = 'en.wikivoyage.org'
def find_city(city_name):
return fetch(city_name)
def fetch(page_name):
page = site.Pages[page_name]
retun {
'guide': build_guide(page.text()),
'images': format_image(page.images())
}
def format_image(imag... | import mwclient
def find_city(city_name):
pass
| apache-2.0 | Python |
7758988978e5ea3de9020673cf77890036ca3b99 | allow blank columns | neuropower/neuropower,neuropower/neuropower,neuropower/neuropower,neuropower/neuropower | neuropower/apps/neuropowertoolbox/models.py | neuropower/apps/neuropowertoolbox/models.py | from __future__ import unicode_literals
from django.db import models
from picklefield.fields import PickledObjectField
import os
from django.conf import settings
#import tempfile
#temp_dir = tempfile.gettempdir()
class NeuropowerModel(models.Model):
SID = models.CharField(max_length=300,default="")
step = mo... | from __future__ import unicode_literals
from django.db import models
from picklefield.fields import PickledObjectField
import os
from django.conf import settings
#import tempfile
#temp_dir = tempfile.gettempdir()
class NeuropowerModel(models.Model):
SID = models.CharField(max_length=300,default="")
step = mo... | mit | Python |
cc3863493d77f60fae78e3d13bc8205a673cdafd | fix import operators for Arriva North East et al | stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk | busstops/management/commands/import_operators.py | busstops/management/commands/import_operators.py | """
Usage:
./manage.py import_operators < NOC_db.csv
"""
import sys
import csv
from django.core.management.base import BaseCommand
from busstops.models import Operator, Region
class Command(BaseCommand):
@staticmethod
def row_to_operator(row):
"Given a CSV row (a list), returns an Operator object... | """
Usage:
./manage.py import_operators < NOC_db.csv
"""
import sys
import csv
from django.core.management.base import BaseCommand
from busstops.models import Operator, Region
class Command(BaseCommand):
@staticmethod
def row_to_operator(row):
"Given a CSV row (a list), returns an Operator object... | mpl-2.0 | Python |
f2ef01e183e9775f05f4c897c2c29248f5c6c927 | exclude data no longer used. | UWIT-IAM/uw-restclients,uw-it-cte/uw-restclients,UWIT-IAM/uw-restclients,uw-it-cte/uw-restclients,uw-it-cte/uw-restclients,uw-it-aca/uw-restclients,UWIT-IAM/uw-restclients,uw-it-aca/uw-restclients | restclients/models/iasystem.py | restclients/models/iasystem.py | from django.db import models
class Evaluation(models.Model):
section_sln = models.IntegerField(max_length=5)
eval_open_date = models.DateTimeField()
eval_close_date = models.DateTimeField()
eval_status = models.CharField(max_length=7)
eval_url = models.URLField()
def __init__(self, *args, **k... | from django.db import models
class Evaluation(models.Model):
section_sln = models.IntegerField(max_length=5)
eval_open_date = models.DateTimeField()
eval_close_date = models.DateTimeField()
eval_status = models.CharField(max_length=7)
eval_is_online = models.BooleanField(default=False)
eval_ur... | apache-2.0 | Python |
8372543f62f0fd01b8661f4d6e64503cdd78e5ea | remove RPC | XertroV/opreturn-ninja,XertroV/opreturn-ninja,XertroV/opreturn-ninja | opreturnninja/views.py | opreturnninja/views.py | import json
import random
from pyramid.view import view_config
from .constants import ELECTRUM_SERVERS
from bitcoin.rpc import RawProxy, DEFAULT_USER_AGENT
import socket
@view_config(route_name='api', renderer='json')
def api_view(request):
global rpc
assert hasattr(request, 'json_body')
assert 'meth... | import json
import random
from pyramid.view import view_config
from .constants import ELECTRUM_SERVERS
from bitcoin.rpc import RawProxy, DEFAULT_USER_AGENT
import socket
class RPC(RawProxy):
def passJson(self, json_to_dump):
self.__dict__['_RawProxy__conn'].request('POST', self.__dict__['_RawProxy__u... | mit | Python |
2abb2227fb4f8c6d0cb855724a1f8d1380fc158c | Use open with | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem | netsecus/korrekturtools.py | netsecus/korrekturtools.py | from __future__ import unicode_literals
import os
from . import helper
def readStatus(student):
student = student.lower()
path = helper.getConfigValue("settings", "attachment_path")
if not os.path.exists(path):
return
path = os.path.join(path, student)
if not os.path.exists(path):
... | from __future__ import unicode_literals
import os
from . import helper
def readStatus(student):
student = student.lower()
path = helper.getConfigValue("settings", "attachment_path")
if not os.path.exists(path):
return
path = os.path.join(path, student)
if not os.path.exists(path):
... | mit | Python |
c3878e39e97dd2390c3be3dd0229b3dbb4f0c885 | Add walls to the map. | codypiersall/platformer | structured_mainloop.py | structured_mainloop.py | import pygame
SCREEN_SIZE = (640, 480)
class Player(pygame.sprite.Sprite):
SPEED = 200
def __init__(self, *groups):
super().__init__(*groups)
self.image = pygame.image.load('frog.gif')
self.rect = pygame.rect.Rect((320, 240), self.image.get_size())
def update(self, dt, ... | import pygame
SCREEN_SIZE = (640, 480)
class Player(pygame.sprite.Sprite):
SPEED = 300
def __init__(self, *groups):
super().__init__(*groups)
self.image = pygame.image.load('frog.gif')
self.rect = pygame.rect.Rect((320, 240), self.image.get_size())
def update(self, dt):... | bsd-3-clause | Python |
0edb45d851d7882ee1b9843e04f1d8fd3ff0abe4 | Add Pool to subliminal | Diaoul/subliminal,neo1691/subliminal,getzze/subliminal,SickRage/subliminal,hpsbranco/subliminal,kbkailashbagaria/subliminal,ratoaq2/subliminal,h3llrais3r/subliminal,ravselj/subliminal,fernandog/subliminal,ofir123/subliminal,juanmhidalgo/subliminal,nvbn/subliminal,bogdal/subliminal,Elettronik/subliminal,t4lwh/subliminal... | subliminal/__init__.py | subliminal/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | mit | Python |
f0ad9568c907eac93662357482db346928bddb95 | add verify ssl option to global configuration schema. | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon_cli/schemas/global_configuration.py | polyaxon_cli/schemas/global_configuration.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from marshmallow import fields
from polyaxon_cli.schemas.base import BaseConfig, BaseSchema
class GlobalConfigurationSchema(BaseSchema):
verbose = fields.Bool(allow_none=True)
host = fields.Str(allow_none=True)
http... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from marshmallow import fields
from polyaxon_cli.schemas.base import BaseConfig, BaseSchema
class GlobalConfigurationSchema(BaseSchema):
verbose = fields.Bool(allow_none=True)
host = fields.Str(allow_none=True)
http... | apache-2.0 | Python |
40c61b8dce69a54d8e8a019615ba3e26c089d7d7 | use substance-box 1.0 as default box | turbulent/substance,turbulent/substance | substance/constants.py | substance/constants.py |
class Constants(object):
class ConstError(TypeError):
pass
def __init__(self, **kwargs):
for name, value in list(kwargs.items()):
super(Constants, self).__setattr__(name, value)
def __setattr__(self, name, value):
if name in self.__dist__:
raise self.Const... |
class Constants(object):
class ConstError(TypeError):
pass
def __init__(self, **kwargs):
for name, value in list(kwargs.items()):
super(Constants, self).__setattr__(name, value)
def __setattr__(self, name, value):
if name in self.__dist__:
raise self.Const... | apache-2.0 | Python |
c84877afceed7a0eddf10ac62be86ec0027541ae | Use skipFields method in the expando base logic. | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/logic/models/expando_base.py | app/soc/logic/models/expando_base.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
443d435076858cdd63c9e908c606e26e120fa01e | Change celery beat schedule definition. | mozilla/mozillians,mozilla/mozillians,mozilla/mozillians,johngian/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,johngian/mozillians,mozilla/mozillians,johngian/mozillians,johngian/mozillians | mozillians/celery.py | mozillians/celery.py | from __future__ import absolute_import
import os
from celery import Celery as BaseCelery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mozillians.settings')
from django.conf import settings # noqa
RUN_DAILY = 60 * 60 * 24
RUN_HOURLY = 60 * 60
R... | from __future__ import absolute_import
import os
from celery import Celery as BaseCelery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mozillians.settings')
from django.conf import settings # noqa
RUN_DAILY = 60 * 60 * 24
RUN_HOURLY = 60 * 60
R... | bsd-3-clause | Python |
23b76d2aace3b64487c4715cbc2371c5eb7b80f4 | Fix royalroadl.com chapter dates | kemayo/leech,Zomega/leech | sites/royalroad.py | sites/royalroad.py | #!/usr/bin/python
import http.client
import logging
import datetime
import re
import urllib
from . import register, Site, Section, Chapter
logger = logging.getLogger(__name__)
@register
class RoyalRoad(Site):
"""Royal Road: a place where people write novels, mostly seeming to be light-novel in tone."""
@sta... | #!/usr/bin/python
import http.client
import logging
import datetime
import re
import urllib
from . import register, Site, Section, Chapter
logger = logging.getLogger(__name__)
@register
class RoyalRoad(Site):
"""Royal Road: a place where people write novels, mostly seeming to be light-novel in tone."""
@sta... | mit | Python |
7a59903500bd766cd51aca28f679c846bc59389b | read url parameter per request | EndPointCorp/appctl,EndPointCorp/appctl | catkin/src/portal_config/scripts/serve_config.py | catkin/src/portal_config/scripts/serve_config.py | #!/usr/bin/env python
import rospy
import urllib2
from portal_config.srv import *
NODE_NAME = 'portal_config'
SRV_QUERY = '/'.join(('', NODE_NAME, 'query'))
PARAM_URL = '~url'
DEFAULT_URL = 'http://lg-head/portal/config.json'
# XXX TODO: return an error if the config file isn't valid JSON
class ConfigRequestHandler... | #!/usr/bin/env python
import rospy
import urllib2
from portal_config.srv import *
# XXX TODO: return an error if the config file isn't valid JSON
class ConfigRequestHandler():
def __init__(self, url):
self.url = url
def get_config(self):
response = urllib2.urlopen(self.url)
return re... | apache-2.0 | Python |
0406cc1352cbdec15c8a885e3c875ea94e3677a5 | add post_message method to client | llimllib/slackrtm | slackrtm/client.py | slackrtm/client.py | #!/usr/bin/python
# mostly a proxy object to abstract how some of this works
import json
from .server import Server
class SlackClient(object):
def __init__(self, token):
self.token = token
self.server = Server(self.token, False)
def rtm_connect(self):
self.server.rtm_connect()
d... | #!/usr/bin/python
# mostly a proxy object to abstract how some of this works
import json
from .server import Server
class SlackClient(object):
def __init__(self, token):
self.token = token
self.server = Server(self.token, False)
def rtm_connect(self):
self.server.rtm_connect()
d... | mit | Python |
ba77b9a4fc56fe979cd709c584f055370db5d153 | Update __init__.py to reflect renaming. | emrob/sleuth | sleuth/__init__.py | sleuth/__init__.py | """
Sleuth: A debugging and diagnostic tool for Python.
------
"""
import sys
if sys.version_info[:2] < (3, 0):
raise ImportError("Sleuth requires Python 3.")
del sys
__version__ = '0.2.0d'
from .__main__ import main
from .error import *
from .inject import *
from .wrap import *
| """
Sleuth: A debugging and diagnostic tool for Python.
------
"""
import sys
if sys.version_info[:2] < (3, 0):
raise ImportError("Sleuth requires Python 3.")
del sys
__version__ = '0.2.0d'
from .__main__ import main
from .error import *
from .inject import *
from .sleuth import *
| mit | Python |
2ba9eaba0bcb229055db09147f1cb654190badbf | Use a list for the style cycle so that subsequent calls to the plotting functions don't mix up the line styles. | maxalbert/paper-supplement-nanoparticle-sensing | notebooks/style_helpers.py | notebooks/style_helpers.py | import brewer2mpl
from cycler import cycler
N = 5
cmap = brewer2mpl.get_map('Set1', 'Qualitative', N, reverse=False)
color_cycle = cycler('color', cmap.hex_colors)
marker_cycle = cycler('marker', ['s', '^', 'o', 'D', 'v'])
markersize_cycle = cycler('markersize', [10, 12, 11, 10, 12])
style_cycle = list(color_cycle + ... | import brewer2mpl
import itertools
from cycler import cycler
cmap = brewer2mpl.get_map('Set1', 'Qualitative', 5, reverse=False)
color_cycle = cycler('color', cmap.hex_colors)
marker_cycle = cycler('marker', ['s', '^', 'o', 'D', 'v'])
markersize_cycle = cycler('markersize', [10, 12, 11, 10, 12])
style_cycle = itertool... | mit | Python |
1c5d204096947658feef7fa19479961727a4af9a | Fix #519 | hzy/raven-python,jbarbuto/raven-python,arthurlogilab/raven-python,akheron/raven-python,percipient/raven-python,arthurlogilab/raven-python,akheron/raven-python,getsentry/raven-python,nikolas/raven-python,getsentry/raven-python,recht/raven-python,lepture/raven-python,jmagnusson/raven-python,danriti/raven-python,dbravende... | raven/contrib/celery/__init__.py | raven/contrib/celery/__init__.py | """
raven.contrib.celery
~~~~~~~~~~~~~~~~~~~~
>>> class CeleryClient(CeleryMixin, Client):
>>> def send_encoded(self, *args, **kwargs):
>>> "Errors through celery"
>>> self.send_raw.delay(*args, **kwargs)
>>> @task(routing_key='sentry')
>>> def send_raw(*args, **kwargs):
>>> return super(clien... | """
raven.contrib.celery
~~~~~~~~~~~~~~~~~~~~
>>> class CeleryClient(CeleryMixin, Client):
>>> def send_encoded(self, *args, **kwargs):
>>> "Errors through celery"
>>> self.send_raw.delay(*args, **kwargs)
>>> @task(routing_key='sentry')
>>> def send_raw(*args, **kwargs):
>>> return super(clien... | bsd-3-clause | Python |
1c51fc78e072eee4bd62964ff71629f13e200975 | fix Python ModuleLinkTest | TresAmigosSD/SMV,TresAmigosSD/SMV,TresAmigosSD/SMV,TresAmigosSD/SMV | src/test/python/testModuleLink.py | src/test/python/testModuleLink.py | #
# This file is 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
# distr... | #
# This file is 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
# distr... | apache-2.0 | Python |
0f4290101e300c179de532d0cf7ae5133602b7d9 | Update the default CLANG_USER_VISIBLE_VERSION to 6.0.0 | practicalswift/swift,ahoppen/swift,jopamer/swift,shahmishal/swift,glessard/swift,aschwaighofer/swift,shahmishal/swift,danielmartin/swift,amraboelela/swift,rudkx/swift,amraboelela/swift,natecook1000/swift,apple/swift,gregomni/swift,tkremenek/swift,airspeedswift/swift,parkera/swift,jckarter/swift,apple/swift,karwa/swift,... | utils/build_swift/defaults.py | utils/build_swift/defaults.py | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... | apache-2.0 | Python |
08bcc2b60ead91d9c0e2492338e2b360edd88def | update jsonp middleware for 1.3 cache framework | sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,propublica/Capitol-Words,propublica/Capitol-Words,propublica/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,propublica/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words,sunlightlabs/Capitol-Words | cwod_site/cwod_api/middleware/jsonp.py | cwod_site/cwod_api/middleware/jsonp.py | import re
import urllib
class JSONPMiddleware(object):
'''
Middleware to handle jsonp requests on projects while still providing for
caching of content. What happens here is:
1. Some page makes a jquery $.getJSON request to foo.json?callback=? on projects
2. jquery replaces callback=? with callba... | import re
class JSONPMiddleware(object):
'''
Middleware to handle jsonp requests on projects while still providing for
caching of content. What happens here is:
1. Some page makes a jquery $.getJSON request to foo.json?callback=? on projects
2. jquery replaces callback=? with callback=foo, where ... | bsd-3-clause | Python |
a68df85c1124331003d69c6da7fcdfe2cbd279e5 | Fix versioning | PhonologicalCorpusTools/PolyglotDB,PhonologicalCorpusTools/PyAnnotationGraph,PhonologicalCorpusTools/PolyglotDB,PhonologicalCorpusTools/PyAnnotationGraph,MontrealCorpusTools/PolyglotDB,MontrealCorpusTools/PolyglotDB | polyglotdb/__init__.py | polyglotdb/__init__.py | __ver_major__ = 1
__ver_minor__ = 2
__ver_patch__ = '0a'
__version__ = f"{__ver_major__}.{__ver_minor__}.{__ver_patch__}"
__all__ = ['query', 'io', 'corpus', 'config', 'exceptions', 'CorpusContext', 'CorpusConfig']
import polyglotdb.query.annotations as graph
import polyglotdb.io as io
import polyglotdb.corpus as c... | __ver_major__ = 1
__ver_minor__ = 1
__ver_patch__ = '3a'
__version__ = f"{__ver_major__}.{__ver_minor__}.{__ver_patch__}"
__all__ = ['query', 'io', 'corpus', 'config', 'exceptions', 'CorpusContext', 'CorpusConfig']
import polyglotdb.query.annotations as graph
import polyglotdb.io as io
import polyglotdb.corpus as c... | mit | Python |
1449131d87e3def4bd23835dd37d9f4744f2f62d | revert hostname calculation due to changed upgrade process | Mirantis/octane,Mirantis/octane,stackforge/fuel-octane,stackforge/fuel-octane | octane/commands/cleanup.py | octane/commands/cleanup.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # 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
# distributed under t... | apache-2.0 | Python |
829c051ee4cc25b7dffc60147090f095207ebe96 | update TestProgressMonitor | alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl | tests/unit/ProgressBar/test_ProgressMonitor.py | tests/unit/ProgressBar/test_ProgressMonitor.py | from AlphaTwirl.ProgressBar import ProgressReporter, Queue, ProgressMonitor
import unittest
##__________________________________________________________________||
class MockPresentation(object):
def __init__(self): self.reports = [ ]
def present(self, report): self.reports.append(report)
##___________________... | from AlphaTwirl.ProgressBar import ProgressReporter, Queue, ProgressMonitor
import unittest
##__________________________________________________________________||
class MockPresentation(object):
def __init__(self): self.reports = [ ]
def present(self, report): self.reports.append(report)
##___________________... | bsd-3-clause | Python |
e3f9250acbb4db849e97158780ace3dc9b37873c | add missing import | gentoo/identity.gentoo.org,gentoo/identity.gentoo.org,dastergon/identity.gentoo.org,dastergon/identity.gentoo.org | okupy/common/encryption.py | okupy/common/encryption.py | from Crypto.Cipher import AES
from django.conf import settings
from random import choice
import base64
import hashlib
import os
import string
def sha1_password(password):
'''
Create a SHA1 salted hash
'''
salt = os.urandom(4)
h = hashlib.sha1(password)
h.update(salt)
return "{SSHA}" + base6... | from Crypto.Cipher import AES
from django.conf import settings
import base64
import hashlib
import os
import string
def sha1_password(password):
'''
Create a SHA1 salted hash
'''
salt = os.urandom(4)
h = hashlib.sha1(password)
h.update(salt)
return "{SSHA}" + base64.encodestring(h.digest() ... | agpl-3.0 | Python |
6a6c5d9c12308cc6638aa5139bf6e7eeb84256df | Bump version after release | OpenSCAP/openscap-daemon,OpenSCAP/openscap-daemon | openscap_daemon/version.py | openscap_daemon/version.py | # Copyright 2015 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# openscap-daemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2.1 of the License, or
# (at your option)... | # Copyright 2015 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# openscap-daemon is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2.1 of the License, or
# (at your option)... | lgpl-2.1 | Python |
f38d930b0bcc7ca27bc06e9818d68f88089ac33f | Update suffix | davidgasquez/kaggle-airbnb | scripts/generate_submission.py | scripts/generate_submission.py | #!/usr/bin/env python
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from xgboost.sklearn import XGBClassifier
from utils.io import generate_submission
def main():
path = '../data/processed/'
prefix = 'processed_'
suffix = '4'
train_users = pd.read_csv(path + prefix + 'train_users... | #!/usr/bin/env python
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from xgboost.sklearn import XGBClassifier
from utils.io import generate_submission
def main():
path = '../data/processed/'
prefix = 'processed_'
suffix = '1'
train_users = pd.read_csv(path + prefix + 'train_users... | mit | Python |
8336b7090dcefe19116a63f22e9799d7f5b926e9 | Disable building the 2.0 profile in mono-basic. | BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild | packages/mono-basic.py | packages/mono-basic.py | GitHubTarballPackage ('mono', 'mono-basic', '3.0', 'bd316e914e1a230c29b5d637239334df41a79c7f',
configure = './configure --prefix="%{prefix}" --with-profile2=no',
override_properties = { 'make': 'make' }
)
| GitHubTarballPackage ('mono', 'mono-basic', '3.0', 'a74642af7f72d1012c87d82d7a12ac04a17858d5',
configure = './configure --prefix="%{prefix}"',
override_properties = { 'make': 'make' }
)
| mit | Python |
74ae937ba4d13acf49f9df0fa33579f2b5d07177 | Bump version | Phylliade/ikpy | src/ikpy/_version.py | src/ikpy/_version.py | __version__ = '3.1dev'
| __version__ = '3.0.1'
| apache-2.0 | Python |
3910675ef42fb7978c2bcbaa8943eebbfaf4e1af | add test for MemoryRequestIdStore | evernym/plenum,evernym/zeno | plenum/test/client/test_request_id_store.py | plenum/test/client/test_request_id_store.py | import pytest
from plenum.client.request_id_store import *
import os
from plenum.test.conftest import tdir
import random
def check_request_id_store(store: RequestIdStore):
for signerIndex in range(3):
signerId = "signer-id-{}".format(signerIndex)
assert store.currentId(signerId) is None
for... | import pytest
from plenum.client.request_id_store import FileRequestIdStore
import os
from plenum.test.conftest import tdir
import random
def test_file_request_id_store(tdir):
# creating tem file
os.mkdir(tdir)
storeFileName = "test_file_request_id_store_{}".format(random.random())
storeFilePath = os.p... | apache-2.0 | Python |
f8afe612d39b8c39c031a2aa0ccafe38bb85ef83 | Update test cases. | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | test/core/services/test_service_meta.py | test/core/services/test_service_meta.py | from threading import Event, Thread
import pytest
from app.core.messaging import Receiver, Sender, SchemaValidationFailed
from app.core.services import EventDrivenService, BaseService
from app.services.messaging import MessageService
CONFIG = {
"redis_config": {
"USE_FAKE_REDIS": True
},
"queues... | from threading import Event, Thread
from app.core.messaging import Receiver, Sender
from app.core.services import EventDrivenService, Capability
from app.core.services import BaseService, BackgroundThreadServiceStart
from app.services.messaging import MessageService
CONFIG = {
"redis_config": {
"USE_FAKE... | mit | Python |
5758912f86f73a019e7df309aea5bc1bcd7516e5 | Make some broadcast admin fields editable. | bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv | avalonstar/components/broadcasts/admin.py | avalonstar/components/broadcasts/admin.py | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Broadcast, Series
class BroadcastAdmin(admin.ModelAdmin):
list_display = ['number', 'airdate', 'status', 'series']
list_editable = ['airdate', 'status', 'series']
list_display_links = ['number', 'airdate']
raw_id_fields = [... | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Broadcast, Series
class BroadcastAdmin(admin.ModelAdmin):
list_display = ['number', 'airdate', 'status', 'series']
list_display_links = ['number', 'airdate']
raw_id_fields = ['games', 'series']
autocomplete_lookup_fields = ... | apache-2.0 | Python |
39b8cb70ffd6be60c6d757ecd4703a3a0ca2a415 | Improve logs and change delete pos | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/workflow/steps/build_database.py | dbaas/workflow/steps/build_database.py | # -*- coding: utf-8 -*-
import logging
from base import BaseStep
from logical.models import Database
import datetime
LOG = logging.getLogger(__name__)
class BuildDatabase(BaseStep):
def __unicode__(self):
return "Creating logical database..."
def do(self, workflow_dict):
try:
... | # -*- coding: utf-8 -*-
import logging
from base import BaseStep
from logical.models import Database
LOG = logging.getLogger(__name__)
class BuildDatabase(BaseStep):
def __unicode__(self):
return "Creating logical database..."
def do(self, workflow_dict):
try:
if not workflow_... | bsd-3-clause | Python |
0de277c18b1f0a99f515430f45031071af8e7ea3 | improve test | zlorb/mitmproxy,mhils/mitmproxy,Kriechi/mitmproxy,StevenVanAcker/mitmproxy,mosajjal/mitmproxy,MatthewShao/mitmproxy,mhils/mitmproxy,mosajjal/mitmproxy,laurmurclar/mitmproxy,zlorb/mitmproxy,mitmproxy/mitmproxy,ujjwal96/mitmproxy,mhils/mitmproxy,xaxa89/mitmproxy,StevenVanAcker/mitmproxy,xaxa89/mitmproxy,mhils/mitmproxy,m... | test/mitmproxy/console/test_flowlist.py | test/mitmproxy/console/test_flowlist.py | from unittest import mock
import mitmproxy.tools.console.flowlist as flowlist
from mitmproxy.tools import console
from mitmproxy import proxy
from mitmproxy import options
class TestFlowlist:
def mkmaster(self, **opts):
if "verbosity" not in opts:
opts["verbosity"] = 1
o = options.Opt... | import mitmproxy.tools.console.flowlist as flowlist
from mitmproxy.tools import console
from mitmproxy import proxy
from mitmproxy import options
from .. import tservers
from unittest import mock
class TestFlowlist(tservers.MasterTest):
def mkmaster(self, **opts):
if "verbosity" not in opts:
o... | mit | Python |
47a3f587b2530f9c46b5b7db5df52fb3999b8f2d | Change Model | Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja | taOonja/game/models.py | taOonja/game/models.py | import os
from django.db import models
class Location(models.Model):
name = models.CharField(max_length=250)
local_name = models.CharField(max_length=250)
visited = models.BooleanField(default=False)
coordinates = models.CharField(max_length=250)
detail = models.CharField(max_length=500)
img =... | import os
from django.db import models
#def get_image_path(filename):
# return os.path.join('media')
class Location(models.Model):
name = models.CharField(max_length=250)
local_name = models.CharField(max_length=250)
visited = models.BooleanField(default=False)
def __str__(self):
return s... | mit | Python |
c7aaee482440608453ba9f6472f9600ff7b55653 | Add module documentation and extra functions | markshroyer/pointfree,markshroyer/pointfree | fpkit.py | fpkit.py | """
Functional programming toolkit for Python
Implements easy function composition and currying via operator overloads
and some trickery using decorators. This makes it possible to do things
like:
@curryable
def add(a, b):
return a + b
@curryable
def mult(a, b):
return a * b
# F... | """
fpkit
Functional programming toolkit for Python.
"""
__author__ = "Mark Shroyer"
__email__ = "code@markshroyer.com"
__version__ = 0.1
import inspect
class Comp:
"""@composable function decorator
Converts a regular Python function into one which can be composed with
other Python functions using ... | apache-2.0 | Python |
5e5f3a27c8a9a4e657f1b4ab4fbeae87ff201c8b | allow edit ids for individuals in mme | macarthur-lab/seqr,ssadedin/seqr,ssadedin/seqr,macarthur-lab/xbrowse,ssadedin/seqr,macarthur-lab/seqr,ssadedin/seqr,macarthur-lab/xbrowse,macarthur-lab/xbrowse,macarthur-lab/seqr,macarthur-lab/xbrowse,macarthur-lab/seqr,macarthur-lab/seqr,macarthur-lab/xbrowse,macarthur-lab/xbrowse,ssadedin/seqr | seqr/utils/model_sync_utils.py | seqr/utils/model_sync_utils.py | from bs4 import BeautifulSoup
from seqr.models import Individual
from seqr.model_utils import find_matching_xbrowse_model
def convert_html_to_plain_text(html_string, remove_line_breaks=False):
"""Returns string after removing all HTML markup.
Args:
html_string (str): string with HTML markup
... | from bs4 import BeautifulSoup
from seqr.models import Individual
from seqr.model_utils import find_matching_xbrowse_model
def convert_html_to_plain_text(html_string, remove_line_breaks=False):
"""Returns string after removing all HTML markup.
Args:
html_string (str): string with HTML markup
... | agpl-3.0 | Python |
1cbe86ed9aa8123cf91fb06b0199a9ac797c6419 | fix building manual | rr-/dotfiles,rr-/dotfiles,rr-/dotfiles | cfg/mutt/install.py | cfg/mutt/install.py | from dotinstall import packages
from dotinstall import util
def run():
packages.try_install('neomutt')
packages.try_install('w3m')
packages.try_install('lynx')
packages.try_install('docbook-xsl')
util.create_file('~/.mutt/certificates')
util.create_dir('~/.mutt/cache/bodies')
util.create_d... | from dotinstall import packages
from dotinstall import util
def run():
packages.try_install('neomutt')
packages.try_install('w3m')
util.create_file('~/.mutt/certificates')
util.create_dir('~/.mutt/cache/bodies')
util.create_dir('~/.mutt/cache/headers')
util.create_symlink('./file_email', '~/.m... | mit | Python |
b6a60b0c62547b5b6f3f1d6e89d0f5bfb798fbb9 | make atlassian errors ignorable | uhjish/link | link/wrappers/__init__.py | link/wrappers/__init__.py | """
I don't exactly love that you have to do this. I will look for a new design
"""
from apiwrappers import *
from dbwrappers import *
from nosqlwrappers import *
from consolewrappers import *
from alexawrappers import *
from hivewrappers import *
from elasticsearchwrappers import *
from liverailwrappers import *
impo... | """
I don't exactly love that you have to do this. I will look for a new design
"""
from apiwrappers import *
from dbwrappers import *
from nosqlwrappers import *
from consolewrappers import *
from atlassianwrappers import *
from alexawrappers import *
from hivewrappers import *
from elasticsearchwrappers import *
fro... | apache-2.0 | Python |
802d03af3f1fe1719ff0843690b51b3200c20044 | Remove unused import. | markstory/lint-review,markstory/lint-review,markstory/lint-review | lintreview/tools/black.py | lintreview/tools/black.py | from __future__ import absolute_import
import os
import logging
import lintreview.docker as docker
from lintreview.review import IssueComment
from lintreview.tools import Tool
log = logging.getLogger(__name__)
class Black(Tool):
name = 'black'
def check_dependencies(self):
"""See if the python3 ima... | from __future__ import absolute_import
import os
import logging
import lintreview.docker as docker
from lintreview.review import IssueComment
from lintreview.tools import Tool, python_image
log = logging.getLogger(__name__)
class Black(Tool):
name = 'black'
def check_dependencies(self):
"""See if t... | mit | Python |
5a0114506d71f5c73f2e8eab572dd3922d7233e4 | Add a presubmit check so that no new unit tests in content/ are added to the unit_tests target | Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,ondra-novak/chromium.src,jaruba/chromium.src,jaruba/chromium.src,dednal/chromium.src,keishi/chromium,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps... | chrome/PRESUBMIT.py | chrome/PRESUBMIT.py | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting chrome/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that the chrome/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Objective C confuses ever... | bsd-3-clause | Python |
3b6a0a7c97d164b4270b8f247fa68b8b5d6ce1dd | fix reply | gonicus/gosa,gonicus/gosa,gonicus/gosa,gonicus/gosa | backend/src/gosa/backend/routes/system.py | backend/src/gosa/backend/routes/system.py | from gosa.common.hsts_request_handler import HSTSRequestHandler
class State:
system_state = "initializing"
class SystemStateReporter(HSTSRequestHandler):
"""
Return the current system state
"""
_xsrf = None
# disable xsrf feature
def check_xsrf_cookie(self):
pass
def get(se... | from gosa.common.hsts_request_handler import HSTSRequestHandler
class State:
system_state = "initializing"
class SystemStateReporter(HSTSRequestHandler):
"""
Return the current system state
"""
_xsrf = None
# disable xsrf feature
def check_xsrf_cookie(self):
pass
def get(se... | lgpl-2.1 | Python |
664ed1cf663010d36b979892d8d37e94a9a3ca98 | Add a title to the graph with the date in it. | peterbmarks/froniusLogger,peterbmarks/froniusLogger | graph.py | graph.py | """
Simple code to draw a graph of a day of power.
Requires matplotlib
On Fedora Linux: sudo dnf install python3-matplotlib
Usage: python3 graph.py [csv file name]
If you don't give the file name it will use today's
"""
import csv
import time
import datetime
import sys
import os
import matplotlib
matplotlib.use('Ag... | """
Simple code to draw a graph of a day of power.
Requires matplotlib
On Fedora Linux: sudo dnf install python3-matplotlib
Usage: python3 graph.py [csv file name]
If you don't give the file name it will use today's
"""
import csv
import time
import datetime
import sys
import os
import matplotlib
matplotlib.use('Ag... | apache-2.0 | Python |
17c5585dcc4dae8fcec96cced8a765804bf1cf13 | update google.py | ceaniket/lyricsar | lyricsar/plugin/google.py | lyricsar/plugin/google.py |
searchpage=urllib2.urlopen(request)
print searchpage
lyrcweb=gogle.get_link(searchpage)
print lyrcweb
|
import string
import sys
import urllib2
import simplejson
import httplib
from bs4 import BeautifulSoup
from setting import GOOGLE_API_URL
from lyricsar.errorlist import errorlist
class google:
response=""
""" this plugin provide link by traverse results of google.com with extra keyword"""
def __init__(self... | mit | Python |
0ea683383edefc79fbeb54e97ff42c7acd391561 | add users model | ez4u/ijust_backend,ez4u/ijust_backend | project/models/user.py | project/models/user.py | # -*- coding: utf-8 -*-
# python imports
from passlib.apps import custom_app_context as pwd_context
# project imports
from project.extensions import db
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(32), unique=True)
email = db.Column(db... | # -*- coding: utf-8 -*-
| apache-2.0 | Python |
bccb40657174e2b02da96712b053ca81f143ba12 | Update version to 9.2.27.dev0 [ci skip] | angr/claripy | claripy/__init__.py | claripy/__init__.py | #!/usr/bin/env python
# pylint: disable=F0401,W0401,W0603,
__version__ = "9.2.27.dev0"
if bytes is str:
raise Exception("This module is designed for python 3 only. Please install an older version to use python 2.")
import os
import sys
import socket
import logging
l = logging.getLogger("claripy")
l.addHandler(lo... | #!/usr/bin/env python
# pylint: disable=F0401,W0401,W0603,
__version__ = "9.2.26.dev0"
if bytes is str:
raise Exception("This module is designed for python 3 only. Please install an older version to use python 2.")
import os
import sys
import socket
import logging
l = logging.getLogger("claripy")
l.addHandler(lo... | bsd-2-clause | Python |
ce86e48c2d996af9d747927d6f1206569d604500 | use view to provide active confs | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/userreports/data_source_providers.py | corehq/apps/userreports/data_source_providers.py | from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration
import six
class DataSourceProvider(six.with_metaclass(ABCMeta, object)):
@abstractmethod
def get_data_sources(self):
pass
... | from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration
import six
class DataSourceProvider(six.with_metaclass(ABCMeta, object)):
@abstractmethod
def get_data_sources(self):
pass
... | bsd-3-clause | Python |
720f0926249f8f9e1d255a6d206e3f5a42bd17a4 | Connect straight to the IP | remedi/pixel-knights,remedi/pixel-knights,remedi/pixel-knights | match_making/mm_server.py | match_making/mm_server.py | #!/usr/bin/env python
import socket
#Create which contains all the servers and maps they are running. This string is then send to clients.
def createServerList(serverList):
ser_string = ""
for server in serverList:
ser_string = ser_string + server[0] + " " + server[1] + "\200"
return ser_string
def getOwnA... | #!/usr/bin/env python
import socket
#Create which contains all the servers and maps they are running. This string is then send to clients.
def createServerList(serverList):
ser_string = ""
for server in serverList:
ser_string = ser_string + server[0] + " " + server[1] + "\200"
return ser_string
def getOwnA... | mit | Python |
2695690b345f9835f990a631ccf0797956653904 | Bump version to 6.1.4a1 | platformio/platformio-core,platformio/platformio-core | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 | Python |
96957203434f5e27f0f1bf0895371d380c3cf12a | Bump version to 5.0.1a1 | platformio/platformio,platformio/platformio-core,platformio/platformio-core | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 | Python |
d38aed748d6fa68ae5f3418f4dcfdb6ea6f3930d | Update uniprot_proteome_table.py | malvikasharan/APRICOT,malvikasharan/APRICOT | apricotlib/uniprot_proteome_table.py | apricotlib/uniprot_proteome_table.py | #!/usr/bin/env python
import sys
try:
import urllib.request
from urllib.request import urlopen
except ImportError:
print('Python package urllib is missing. Please install/update.\n')
sys.exit(0)
__description__ = "Downloads the complete proteome data from UniProt."
__author__ = "Malvika Sharan <malvi... | #!/usr/bin/env python
import sys
try:
import urllib.request
from urllib.request import urlopen
except ImportError:
print('Python package urllib is missing. Please install/update.'
'Please ignore if you are only testing the example provided by APRICOT')
sys.exit(0)
__description__ = "Downloads the... | isc | Python |
6ea3662df84c3c204fd6c023d413883f59bb3109 | tag 1.0.2 | tony/tmuxp | tmuxp/__about__.py | tmuxp/__about__.py | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.0.2'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2016 Tony Narlock'
| __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.0.1'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013-2016 Tony Narlock'
| bsd-3-clause | Python |
29ad11103d922ca1866bd0f1ef66b321c366718a | delete node if exists test works | miracode/data-structures | simple_graph.py | simple_graph.py |
class Node(object):
def __init__(self, value=None):
self.value = value
class Edge(object):
def __init__(self, n1=None, n2=None):
self.n1 = n1
self.n2 = n2
class Graph(object):
def __init__(self):
self.nodes_list = []
self.edges_list = []
def nodes(self):
... |
class Node(object):
def __init__(self, value=None):
self.value = value
class Edge(object):
def __init__(self, n1=None, n2=None):
self.n1 = n1
self.n2 = n2
class Graph(object):
def __init__(self):
self.nodes_list = []
self.edges_list = []
def nodes(self):
... | mit | Python |
9dd8f98e736dc70ae4f1a78f13ee643a63aa2e47 | Update unit test for static metaobjet to work with new optimizations | gbaty/pyside2,M4rtinK/pyside-android,enthought/pyside,M4rtinK/pyside-android,pankajp/pyside,PySide/PySide,RobinD42/pyside,qtproject/pyside-pyside,M4rtinK/pyside-bb10,pankajp/pyside,IronManMark20/pyside2,PySide/PySide,pankajp/pyside,BadSingleton/pyside2,enthought/pyside,enthought/pyside,pankajp/pyside,IronManMark20/pysi... | tests/signals/static_metaobject_test.py | tests/signals/static_metaobject_test.py | #!/usr/bin/env python
"""Tests covering signal emission and receiving to python slots"""
import unittest
from PySide.QtCore import QObject, SIGNAL
from helper import UsesQCoreApplication
class MyObject(QObject):
def __init__(self, parent=None):
QObject.__init__(self, parent)
self._slotCalledCoun... | #!/usr/bin/env python
"""Tests covering signal emission and receiving to python slots"""
import sys
import unittest
import functools
from PySide.QtCore import *
from helper import BasicPySlotCase, UsesQCoreApplication
class MyObject(QObject):
def __init__(self, parent=None):
QObject.__init__(self, paren... | lgpl-2.1 | Python |
38fd8ad23dcd125c872e332cdf51d3e465924c42 | update to fix standalone testing | davisd50/sparc.common | sparc/common/tests/test_cli.py | sparc/common/tests/test_cli.py | import os
import zope.testrunner
from sparc.testing.fixture import test_suite_mixin
class test_suite(test_suite_mixin):
package = 'sparc.common'
module = 'cli'
if __name__ == '__main__':
zope.testrunner.run([
'--path', os.path.dirname(__file__),
'--tests... | import unittest
from sparc.testing.fixture import test_suite_mixin
class test_suite(test_suite_mixin):
package = 'sparc.common'
module = 'cli'
if __name__ == '__main__':
unittest.main(defaultTest='test_suite') | mit | Python |
cdd4a34559a7f1281399288d943f1158857f2829 | Add vpc_network to create_routers | yunify/qingcloud-cli | qingcloud/cli/iaas_client/actions/router/create_routers.py | qingcloud/cli/iaas_client/actions/router/create_routers.py | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | apache-2.0 | Python |
0e45ad2d7f459ecf6a7068b9309b27a9aa4208e3 | remove invalid homepage (#28269) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/r-illuminahumanmethylationepicmanifest/package.py | var/spack/repos/builtin/packages/r-illuminahumanmethylationepicmanifest/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RIlluminahumanmethylationepicmanifest(RPackage):
"""Manifest for Illumina's EPIC methylati... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RIlluminahumanmethylationepicmanifest(RPackage):
"""Manifest for Illumina's EPIC methylati... | lgpl-2.1 | Python |
4324c02773aa4bcfc916552ab35dd99a3187b154 | Add tokens parsing. | thewizardplusplus/micro,thewizardplusplus/micro,thewizardplusplus/micro | micro.py | micro.py | #!/usr/bin/env python
from sys import argv
def get_code():
return argv[1]
def get_tokens(code):
return code.split(' ')
if __name__ == '__main__':
code = get_code()
tokens = get_tokens(code)
print(tokens)
| #!/usr/bin/env python
from sys import argv
def get_code():
return argv[1]
if __name__ == '__main__':
code = get_code()
print(code)
| mit | Python |
d2150bbf65c190d0c92c99b1206222df867c6cb1 | bump version to 0.1.8 | Maplecroft/django-cms-saq,Maplecroft/django-cms-saq,Maplecroft/django-cms-saq | cms_saq/__init__.py | cms_saq/__init__.py | __version__ = "0.1.8"
| __version__ = "0.1.7"
| mit | Python |
d3c941ad4a955043fa41bfb800f6310e6f91a7bc | Modify return tag search data with tag name | NA5G/coco-server-was,NA5G/coco-server-was,NA5G/coco-server-was | coco/users/views.py | coco/users/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.shortcuts import redirect
# from django.contrib.auth.decorators import login_required
from forms import L... | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import logout as auth_logout
from django.shortcuts import redirect
# from django.contrib.auth.decorators import login_required
from forms import Lo... | mit | Python |
146ffb3afa24a7dddc9d19a26f6b52b0260f3f2c | Remove unused function | DirkHoffmann/indico,DirkHoffmann/indico,OmeGak/indico,indico/indico,DirkHoffmann/indico,ThiefMaster/indico,OmeGak/indico,pferreir/indico,mvidalgarcia/indico,mic4ael/indico,ThiefMaster/indico,mvidalgarcia/indico,pferreir/indico,pferreir/indico,OmeGak/indico,mvidalgarcia/indico,mic4ael/indico,OmeGak/indico,indico/indico,... | indico/modules/rb/models/utils.py | indico/modules/rb/models/utils.py | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN).
##
## Indico is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; eith... | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN).
##
## Indico is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; eith... | mit | Python |
86f3647531c65dbc2c940aa617625b2adc195273 | Make temporary test account respect new password rules | jsharkey13/isaac-selenium-testing,jsharkey13/isaac-selenium-testing | isaactest/utils/initialisation.py | isaactest/utils/initialisation.py | import selenium.webdriver
import time
from .log import log, INFO
from .i_selenium import new_tab, NoWebDriverException
from .isaac import TestUsers, User
from ..emails.guerrillamail import GuerrillaInbox, set_guerrilla_mail_address
def define_users():
"""Set up the TestUser object and add the temporary email addr... | import selenium.webdriver
import time
from .log import log, INFO
from .i_selenium import new_tab, NoWebDriverException
from .isaac import TestUsers, User
from ..emails.guerrillamail import GuerrillaInbox, set_guerrilla_mail_address
def define_users():
"""Set up the TestUser object and add the temporary email addr... | mit | Python |
30103ef19635343b91ed590811639312d6f69795 | Add license text to a report test file | fastmonkeys/kuulemma,fastmonkeys/kuulemma,fastmonkeys/kuulemma,City-of-Helsinki/kuulemma,City-of-Helsinki/kuulemma,City-of-Helsinki/kuulemma | tests/views/hearing/text_xlsx_report.py | tests/views/hearing/text_xlsx_report.py | # -*- coding: utf-8 -*-
# Kuulemma
# Copyright (C) 2014, Fast Monkeys Oy
#
# 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... | import pytest
from flask import url_for
from tests.factories import HearingFactory
@pytest.mark.usefixtures('request_ctx')
def test_xlsx_report_url():
assert (
url_for('hearing.report_as_xlsx', slug='some-slug') ==
'/some-slug/raportti.xlsx'
)
@pytest.mark.usefixtures('database', 'request_c... | agpl-3.0 | Python |
32c8f4e21d27d2c1aa470c16bd97d4e7f9efc135 | Add --dc and --open options | sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker | source/check.py | source/check.py | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
#
# This might check style & grammar one day. I'm hopeful. Kinda.
import sys, os, subprocess, shutil
from lxml import etree
openfile = False
dcfile = False
resultpath = "/tmp/"
arguments = sys.argv
def showusage():
sys.exit( """No arguments provided.
Usage: %s [OPTIONS] F... | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
#
# This might check style & grammar one day. I'm hopeful. Kinda.
import sys, os, subprocess, shutil
from lxml import etree
import webbrowser
if len( sys.argv ) < 2:
sys.exit( "No file provided.\nUsage: %s FILE" % sys.argv[0] )
if sys.argv[1] == "--help" or sys.argv[1] == ... | lgpl-2.1 | Python |
44a5d71858cbe3f1dd399af6991e9438a520a197 | refactor location permission resource | unicef/rhizome,unicef/rhizome,unicef/rhizome,unicef/rhizome | rhizome/api/resources/location_permission.py | rhizome/api/resources/location_permission.py | from rhizome.api.resources.base_model import BaseModelResource
from rhizome.models import LocationPermission
class LocationPermissionResource(BaseModelResource):
'''
**GET Request** This endpoint tells which locations a user is responsible for.
- *Required Parameters:*
'user_id'
- ... | from rhizome.api.resources.base_model import BaseModelResource
from rhizome.models import LocationPermission
class LocationPermissionResource(BaseModelResource):
'''
**GET Request** This endpoint tells which locations a user is responsible for.
- *Required Parameters:*
'user_id'
- ... | agpl-3.0 | Python |
fe3430fdaddf6d715fca2fe6ae6d3b45e0445cc6 | make sure dtype matches what labview sends | tomwphillips/polarimeter | polarimeter/labview.py | polarimeter/labview.py | """
labview.py is a module to interface with a Windows PC running a LabVIEW
VI that acquires data with an NI-DAQ.
Using TCP/IP the VI listens for incoming connections. The requesting
computer sends a message requesting a capture time. The Windows PC
acquires the data, writes it to file, then uses the WinSCP utility to... | """
labview.py is a module to interface with a Windows PC running a LabVIEW
VI that acquires data with an NI-DAQ.
Using TCP/IP the VI listens for incoming connections. The requesting
computer sends a message requesting a capture time. The Windows PC
acquires the data, writes it to file, then uses the WinSCP utility to... | mit | Python |
70b490fe3a04f9e50734abab4e22153533ae9096 | Update analogInOut.py | KrempelEv/krempelair,KrempelEv/krempelair,bittracker/krempelair,bittracker/krempelair,bittracker/krempelair,KrempelEv/krempelair | krempelair/lib/bus/analogInOut.py | krempelair/lib/bus/analogInOut.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import smbus
import logging as log
class analogInOut():
def __init__(self):
self._bus = smbus.SMBus(1)
LOG_FILENAME = 'krempelair.log'
log.basicConfig(filename=LOG_FILENAME,level=log.DEBUG)
def getValue(self, address, chanel):
va... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import smbus
import logging as log
class analogInOut():
def __init__(self):
self._bus = smbus.SMBus(1)
LOG_FILENAME = 'krempelair.log'
log.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
def getValue(self, address, chanel):
... | agpl-3.0 | Python |
db2a796e73a9963c58f601a0aa08b2aa4954a3c3 | Revise first/last to left/right | bowen0701/algorithms_data_structures | lc0034_find_first_and_last_position_of_element_in_sorted_array.py | lc0034_find_first_and_last_position_of_element_in_sorted_array.py | """Leetcode 34. Find left and right Position of Element in Sorted Array
Medium
URL: https://leetcode.com/problems/find-left-and-right-position-of-element-in-sorted-array
Given an array of integers nums sorted in ascending order,
find the starting and ending position of a given target value.
Your algorithm's runtime... | """Leetcode 34. Find First and Last Position of Element in Sorted Array
Medium
URL: https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
Given an array of integers nums sorted in ascending order,
find the starting and ending position of a given target value.
Your algorithm's runtime... | bsd-2-clause | Python |
b25b35e4396638388ad4b05b61b54c64e5e60008 | Update PedidoListar.py | AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb,AEDA-Solutions/matweb | backend/Models/Curso/PedidoListar.py | backend/Models/Curso/PedidoListar.py | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoEditar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoEditar, self).__init__(variaveis_do_ambiente)
try:
self.nome = self.corpo['nome']
self.codigo = self.corpo['codigo']
self.id... | from Framework.Pedido import Pedido
from Framework.ErroNoHTTP import ErroNoHTTP
class PedidoEditar(Pedido):
def __init__(self,variaveis_do_ambiente):
super(PedidoEditar, self).__init__(variaveis_do_ambiente)
try:
self.nome = self.corpo['nome']
self.codigo = self.corpo['codigo']
self.id... | mit | Python |
f51b77717ea9d75fa1c5c47bc6361f1a63e95c5c | Fix lint | svenstaro/python-web-boilerplate,svenstaro/python-web-boilerplate | boilerplateapp/helpers/decorators.py | boilerplateapp/helpers/decorators.py | """Contains a bunch of helpful decorators."""
import functools
def login_exempt(f):
"""All routes decorated with this will be exempt from authorization.
This means that using this decorator a function can be marked for anonymous access.
Example:
@api.route('/login', methods=['POST'])
@lo... | """Contains a bunch of helpful decorators."""
import functools
def login_exempt(f):
"""All routes decorated with this will be exempt from authorization.
This means that using this decorator a function can be marked for anonymous access.
Example:
@api.route('/login', methods=['POST'])
@l... | mit | Python |
d977f9747e4309bc98e5f3d3c175293fa54544d8 | clear urls | danrg/RGT-tool,danrg/RGT-tool,danrg/RGT-tool | src/RGT/urls.py | src/RGT/urls.py | from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from authentication.views import *
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'RGT.views.home'),
#url(r'^$', 'RGT.applicationForm.views.showAppForm'),
... | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from authentication.views import *
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'RGT.views.home', name='home'),
# url(r'^RGT/', inc... | mit | Python |
8a8cac343fb36cf3c99a1455c208b1b4667e3e99 | Rename a function | thombashi/pathvalidate | pathvalidate/_common.py | pathvalidate/_common.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
from .error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if is_not_null_string(text):
return
if is_null_string(text):
... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
from .error import NullNameError
def _validate_null_string(text, error_msg="null name"):
if is_not_null_string(text):
return
if is_null_string(text):
... | mit | Python |
c4a8af10c2b6b8d7367cb4a22609ac29de4fb5f1 | Allow listing multiple subjects by ID | zooniverse/panoptes-cli | panoptes_cli/commands/subject.py | panoptes_cli/commands/subject.py | import click
from panoptes_cli.scripts.panoptes import cli
from panoptes_client import Subject
@cli.group()
def subject():
pass
@subject.command()
@click.option('--subject-set-id', type=int, required=False)
@click.option(
'--quiet',
'-q',
is_flag=True,
help='Only print subject IDs',
)
@click.argu... | import click
from panoptes_cli.scripts.panoptes import cli
from panoptes_client import Subject
@cli.group()
def subject():
pass
@subject.command()
@click.option('--subject-set-id', type=int, required=False)
@click.option(
'--quiet',
'-q',
is_flag=True,
help='Only print subject IDs',
)
@click.argu... | apache-2.0 | Python |
099ae768056a4ab160179be89c8750a2bfc06b2c | Implement expr2bdd function and unique table | GtTmy/pyeda,sschnug/pyeda,sschnug/pyeda,karissa/pyeda,sschnug/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,pombredanne/pyeda,GtTmy/pyeda,cjdrake/pyeda,pombredanne/pyeda,cjdrake/pyeda,karissa/pyeda,cjdrake/pyeda | pyeda/test/test_bdd.py | pyeda/test/test_bdd.py | """
Test binary decision diagrams
"""
from pyeda.bdd import expr2bdd
from pyeda.expr import var
a, b, c = map(var, 'abc')
def test_expr2bdd():
f = a * b + a * c + b * c
bdd_f = expr2bdd(f)
assert bdd_f.root == a.var
assert bdd_f.low.root == b.var
assert bdd_f.high.root == b.var
assert bdd_f.l... | """
Test binary decision diagrams
"""
| bsd-2-clause | Python |
a7f8a2812c5e3728caf98a79451dccc40a97f8ab | change module name | bartscheers/tkp,transientskp/tkp,transientskp/tkp,mkuiack/tkp,mkuiack/tkp,bartscheers/tkp | tkp/classification/features/catalogs.py | tkp/classification/features/catalogs.py | """
Module that checks the database for source associations
If the database is not available or the database module cannot be
imported, functions will silently return None.
"""
from tkp.database.database import DataBase
from tkp.database.general import match_nearests_in_catalogs
def match_catalogs(transient):
... | """
Module that checks the database for source associations
If the database is not available or the database module cannot be
imported, functions will silently return None.
"""
from tkp.database.database import DataBase
from tkp.database.utils import match_nearests_in_catalogs
def match_catalogs(transient):
"... | bsd-2-clause | Python |
44a39603d8af2e8574d8ce4b667ed7d6931bf56a | Add DEBIAN_FRONTEND=noninteractive env var to apt | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/modules/apt.py | pyinfra/modules/apt.py | # pyinfra
# File: pyinfra/modules/apt.py
# Desc: manage apt packages & repositories
from pyinfra.api import operation, operation_env, server
@operation
def repo(name, present=True):
pass
@operation
@operation_env(DEBIAN_FRONTEND='noninteractive') # surpresses interactive prompts
def packages(packages, present=... | # pyinfra
# File: pyinfra/modules/apt.py
# Desc: manage apt packages & repositories
from pyinfra.api import operation, server
@operation
def repo(name, present=True):
return []
@operation
def packages(packages, present=True, update=False, upgrade=False):
commands = []
if update:
commands.appen... | mit | Python |
fe52f04aa2b15d656909c139dce6abc5acfedd01 | Remove sort function in Switch Server List Panel #5 | KunihikoKido/sublime-elasticsearch-client,KunihikoKido/sublime-elasticsearch-client | panel/switch_server_list_panel.py | panel/switch_server_list_panel.py |
class SwitchServerListPanel(object):
def __init__(self, window, servers):
self.window = window
self.servers = servers
self.choices = []
def on_done(self, index):
if index == -1:
return
self.callback(index)
def show(self, callback):
self.callba... |
class SwitchServerListPanel(object):
def __init__(self, window, servers):
self.window = window
self.servers = servers
self.choices = []
def on_done(self, index):
if index == -1:
return
self.callback(index)
def show(self, callback):
self.callba... | mit | Python |
9b513c620b2c079c12370969929599f2a77a3b98 | Bump version number to 3.3 | zonca/petsc4py,zonca/petsc4py,zonca/petsc4py,zonca/petsc4py | src/__init__.py | src/__init__.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# --------------------------------------------------------------------
"""
PETSc for Python
================
This package is an interface to PETSc libraries.
PETSc_ (the Portable, Extensible Toolkit for Scientific Computation)
is a suite of data structures and... | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# --------------------------------------------------------------------
"""
PETSc for Python
================
This package is an interface to PETSc libraries.
PETSc_ (the Portable, Extensible Toolkit for Scientific Computation)
is a suite of data structures and... | bsd-2-clause | Python |
861055a8391734c76083f31cba6eb912c5b58337 | Update fetch-dependees.py to work with opam 2 | ocsigen/lwt,c-cube/lwt,ocsigen/lwt,ocsigen/lwt,c-cube/lwt,c-cube/lwt | src/util/fetch-dependees.py | src/util/fetch-dependees.py | #! /usr/bin/env python
# Retrieves source code of OPAM packages recursively depending on Lwt into a
# subdirectory ./dependees/, so you can grep through the code.
import os.path
import subprocess
DEPENDEES = "dependees"
def main():
packages = subprocess.check_output([
"opam", "list", "--all", "--depends... | #! /usr/bin/env python
# Retrieves source code of OPAM packages recursively depending on Lwt into a
# subdirectory ./dependees/, so you can grep through the code.
import os.path
import subprocess
DEPENDEES = "dependees"
def main():
packages = subprocess.check_output([
"opam", "list", "--unavailable", "-... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.