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 |
|---|---|---|---|---|---|---|---|---|
d1aed83b46719422c3676a32e7bcfaa5829508b2 | add additional test stubs | TeamRemote/remote-sublime,TeamRemote/remote-sublime | tests/test.py | tests/test.py | import sublime
from unittest import TestCase
version = sublime.version()
class TestDiffListener(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command("clo... | import sublime
from unittest import TestCase
version = sublime.version()
class TestDiffListener(TestCase):
def setUp(self):
self.view = sublime.active_window().new_file()
def tearDown(self):
if self.view:
self.view.set_scratch(True)
self.view.window().run_command("clo... | mit | Python |
8a47a729a9805032a94b7ce5171609ef3b5cb90d | remove test_missevan | xyuanmu/you-get,xyuanmu/you-get | tests/test.py | tests/test.py | #!/usr/bin/env python
import unittest
from you_get.extractors import (
imgur,
magisto,
youtube,
missevan,
acfun
)
class YouGetTests(unittest.TestCase):
def test_imgur(self):
imgur.download('http://imgur.com/WVLk5nD', info_only=True)
def test_magisto(self):
magisto.downlo... | #!/usr/bin/env python
import unittest
from you_get.extractors import (
imgur,
magisto,
youtube,
missevan,
acfun
)
class YouGetTests(unittest.TestCase):
def test_imgur(self):
imgur.download('http://imgur.com/WVLk5nD', info_only=True)
def test_magisto(self):
magisto.downlo... | mit | Python |
3e2fb3e91acbe5c0db4e6166364c9580715cd6dd | Fix logging | pybel/pybel,pybel/pybel,pybel/pybel | src/pybel/parser/modifiers/truncation.py | src/pybel/parser/modifiers/truncation.py | # -*- coding: utf-8 -*-
"""
Truncations
~~~~~~~~~~~
Truncations in the legacy BEL 1.0 specification are automatically translated to BEL 2.0 with HGVS nomenclature.
:code:`p(HGNC:AKT1, trunc(40))` becomes :code:`p(HGNC:AKT1, var(p.40*))` and is represented with the following
dictionary:
.. code::
{
FUNCT... | # -*- coding: utf-8 -*-
"""
Truncations
~~~~~~~~~~~
Truncations in the legacy BEL 1.0 specification are automatically translated to BEL 2.0 with HGVS nomenclature.
:code:`p(HGNC:AKT1, trunc(40))` becomes :code:`p(HGNC:AKT1, var(p.40*))` and is represented with the following
dictionary:
.. code::
{
FUNCT... | mit | Python |
fb213097e838ddfa40d9f71f1705d7af661cfbdf | Allow tests to be run with Python <2.6. | ask/python-github2 | tests/unit.py | tests/unit.py | # -*- coding: latin-1 -*-
import unittest
from github2.issues import Issue
from github2.client import Github
class ReprTests(unittest.TestCase):
"""__repr__ must return strings, not unicode objects."""
def test_issue(self):
"""Issues can have non-ASCII characters in the title."""
i = Issue(t... | # -*- coding: latin-1 -*-
import unittest
from github2.issues import Issue
from github2.client import Github
class ReprTests(unittest.TestCase):
"""__repr__ must return strings, not unicode objects."""
def test_issue(self):
"""Issues can have non-ASCII characters in the title."""
i = Issue(t... | bsd-3-clause | Python |
1064c11ec4e8e24564408ca598e16e30e0eb6b7a | Support for django 1.x vs 2.x | aschn/drf-tracking | tests/urls.py | tests/urls.py | # coding=utf-8
from __future__ import absolute_import
from django.conf.urls import url
import django
if django.VERSION[0] == 1:
from django.conf.urls import include
else:
from django.urls import include
from . import views as test_views
from rest_framework.routers import DefaultRouter
router = DefaultRouter(... | # coding=utf-8
from __future__ import absolute_import
from django.conf.urls import url
from django.urls import include, path
from . import views as test_views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'user', test_views.MockUserViewSet)
urlpatterns = [
url(r'^no-... | isc | Python |
218c2f90b8b8475ca2cebdeb5e083c620abc25c0 | Implement rudimentary support for width and height options. | ijks/textinator | textinator.py | textinator.py | import click
from PIL import Image
def scale(val, src, dst):
"""
Scale the given value from the scale of src to the scale of dst.
"""
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
def value_to_char(value, palette, value_range=(0, 256)):
palette_range = (0, len(palette))
... | import click
from PIL import Image
def scale(val, src, dst):
"""
Scale the given value from the scale of src to the scale of dst.
"""
return ((val - src[0]) / (src[1]-src[0])) * (dst[1]-dst[0]) + dst[0]
def value_to_char(value, palette, value_range=(0, 256)):
palette_range = (0, len(palette))
... | mit | Python |
843ce4bf4b0264cdaca3f054bddc3218938dbc60 | Create /var/log in tmproot | vityagi/azure-linux-extensions,soumyanishan/azure-linux-extensions,krkhan/azure-linux-extensions,bpramod/azure-linux-extensions,soumyanishan/azure-linux-extensions,Azure/azure-linux-extensions,andyliuliming/azure-linux-extensions,vityagi/azure-linux-extensions,krkhan/azure-linux-extensions,varunkumta/azure-linux-extens... | VMEncryption/main/oscrypto/encryptstates/StripdownState.py | VMEncryption/main/oscrypto/encryptstates/StripdownState.py | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... | apache-2.0 | Python |
d19fa3b085d691780bbdc7b8e5edf9e8b53906e6 | Revert "Adding request context for proper url generation." | Faerbit/todo-backend-flask | todo/views.py | todo/views.py | from todo import app
from flask import jsonify, request, url_for
from flask import json
from todo.database import db_session
from todo.models import Entry
@app.route("/", methods=["GET", "POST", "DELETE"])
def index():
if request.method == "POST":
request_json = request.get_json()
entry = Entry(r... | from todo import app
from flask import jsonify, request, url_for
from flask import json
from todo.database import db_session
from todo.models import Entry
@app.route("/", methods=["GET", "POST", "DELETE"])
def index():
if request.method == "POST":
request_json = request.get_json()
entry = Entry(r... | mit | Python |
d5b20ed2ffd69a3383c854bced310b391319601e | Fix auth bug | Vassius/ttrss-python | ttrss/auth.py | ttrss/auth.py | from requests.auth import AuthBase
import requests
import json
from exceptions import raise_on_error
class TTRAuth(AuthBase):
def __init__(self, user, password):
self.user = user
self.password = password
self.sid = None
def response_hook(self, r, **kwargs):
j = json.loads(r.co... | from requests.auth import AuthBase
import requests
import json
from exceptions import raise_on_error
class TTRAuth(AuthBase):
def __init__(self, user, password):
self.user = user
self.password = password
self.sid = None
def response_hook(self, r, **kwargs):
j = json.loads(r.co... | mit | Python |
88686c420f403b59a32bad637dd67e4f84dec46d | Fix issue | wikkiewikkie/elizabeth,lk-geimfari/elizabeth,lk-geimfari/church,lk-geimfari/mimesis,lk-geimfari/mimesis | elizabeth/__init__.py | elizabeth/__init__.py | # -*- coding: utf-8 -*-
"""
:copyright: (c) 2016 by Likid Geimfari <likid.geimfari@gmail.com>.
:software_license: MIT, see LICENSES for more details.
:repository: https://github.com/lk-geimfari/elizabeth
:contributors: see CONTRIBUTING.md for more details.
"""
from elizabeth.core import *
__version__ = '0.3.4'
__aut... | # -*- coding: utf-8 -*-
"""
:copyright: (c) 2016 by Likid Geimfari <likid.geimfari@gmail.com>.
:software_license: MIT, see LICENSES for more details.
:repository: https://github.com/lk-geimfari/elizabeth
:contributors: https://github.com/lk-geimfari/elizabeth/blob/master/CONTRIBUTORS.md
"""
from elizabeth.core import... | mit | Python |
457550824bece74f1dd1a07eb7e6c484a4e53348 | remove pyc | jacegem/lotto-store,jacegem/lotto-store,jacegem/lotto-store,jacegem/lotto-store | util/store.py | util/store.py | # -*- coding: utf-8 -*-
'''
Created on 2016. 6. 28.
@author: nw
'''
from google.appengine.ext import ndb
class Store(ndb.Model):
'''
classdocs 클래스 설명
'''
key = ndb.StringProperty()
RTLRID = ndb.StringProperty()
RECORDNO = ndb.IntegerProperty()
... | # -*- coding: utf-8 -*-
'''
Created on 2016. 6. 28.
@author: nw
'''
from google.appengine.ext import ndb
class Store(ndb.Model):
'''
classdocs 클래스 설명
'''
key = ndb.StringProperty()
RTLRID = ndb.StringProperty()
RECORDNO = ndb.IntegerProperty()
... | apache-2.0 | Python |
67254d140ec1b98bd60fa59a676ad11ebf276112 | Fix up the test utility | Miceuz/rs485-moist-sensor,Miceuz/rs485-moist-sensor | utils/test.py | utils/test.py | #!/usr/bin/python
"""Waits for the sensor to appear on /dev/ttyUSB5, then reads moisture and temperature from it continuously"""
import chirp_modbus
from time import sleep
import minimalmodbus
ADDRESS = 1
minimalmodbus.TIMEOUT=0.5
# for baudrate in chirp_modbus.SoilMoistureSensor.baudrates:
# print("Checking baudr... | #!/usr/bin/python
"""Waits for the sensor to appear on /dev/ttyUSB5, then reads moisture and temperature from it continuously"""
import chirp_modbus
from time import sleep
import minimalmodbus
ADDRESS = 1
minimalmodbus.TIMEOUT=0.5
# for baudrate in chirp_modbus.SoilMoistureSensor.baudrates:
# print("Checking baudr... | apache-2.0 | Python |
7ae8cd06fd299656858416b79d0b96ca380de84b | add os | 20c/vaping,20c/vaping | vaping/cli.py | vaping/cli.py |
from __future__ import absolute_import
from __future__ import print_function
import click
import munge
import munge.click
import os
# test direct imports
import vaping
import vaping.daemon
class Context(munge.click.Context):
app_name = 'vaping'
config_class = vaping.Config
def update_context(ctx, kwargs)... |
from __future__ import absolute_import
from __future__ import print_function
import click
import munge
import munge.click
# test direct imports
import vaping
import vaping.daemon
class Context(munge.click.Context):
app_name = 'vaping'
config_class = vaping.Config
def update_context(ctx, kwargs):
ctx.... | apache-2.0 | Python |
ee77150df7db9d22e00f1ff0c34a88eb310fb26c | add experimental debug function | doctorzeb8/django-era,doctorzeb8/django-era,doctorzeb8/django-era | era/utils/__init__.py | era/utils/__init__.py | from .functools import unidec
@unidec
def o_O(fn, *args, **kw):
import ipdb
locals().update(fn.__globals__)
closure = [x.cell_contents for x in fn.__closure__ or []]
ipdb.set_trace()
return fn(*args, **kw)
__builtins__['o_O'] = o_O
| mit | Python | |
4c6c0c14f05b2946e8ecafd8e3031fbf68ee222f | use Form instead of FlaskForm with flask_wtf | vug/personalwebapp,vug/personalwebapp | views/blog.py | views/blog.py | """
This Blueprint implements Blog related views.
"""
from flask import Blueprint, render_template, abort, request
from flask_misaka import markdown
from flask_login import login_required
from flask_wtf import Form
import wtforms
from models import Post, Tag
blog = Blueprint('blog', __name__)
@blog.route('/')
def ... | """
This Blueprint implements Blog related views.
"""
from flask import Blueprint, render_template, abort, request
from flask_misaka import markdown
from flask_login import login_required
from flask_wtf import FlaskForm
import wtforms
from models import Post, Tag
blog = Blueprint('blog', __name__)
@blog.route('/')... | mit | Python |
b9bae46996308c49554148ff547ae5efca72d90e | Switch to stable | Vauxoo/account-financial-tools,Vauxoo/account-financial-tools,Vauxoo/account-financial-tools | account_asset_management/__manifest__.py | account_asset_management/__manifest__.py | # Copyright 2009-2019 Noviat
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Assets Management",
"version": "13.0.3.7.1",
"license": "AGPL-3",
"depends": ["account", "report_xlsx_helper"],
"excludes": ["account_asset"],
"dev... | # Copyright 2009-2019 Noviat
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Assets Management",
"version": "13.0.3.7.1",
"license": "AGPL-3",
"depends": ["account", "report_xlsx_helper"],
"excludes": ["account_asset"],
"ext... | agpl-3.0 | Python |
f0b2fa27656473b4c397f59074e96712ed9613eb | Bump version (#115) | VirusTotal/vt-py | vt/version.py | vt/version.py | """Defines VT release version."""
__version__ = '0.16.0'
| """Defines VT release version."""
__version__ = '0.15.0'
| apache-2.0 | Python |
c6cc632b015f7d4621c5d2dbb3fb70c6fe00c5e7 | Add conference registration to urls | CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | wafer/urls.py | wafer/urls.py | from django.conf.urls import include, patterns, url
from django.views.generic import RedirectView, TemplateView
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$',
TemplateView.as_view(template_name='wafer/index.html'),
... | from django.conf.urls import include, patterns, url
from django.views.generic import RedirectView, TemplateView
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$',
TemplateView.as_view(template_name='wafer/index.html'),
... | isc | Python |
d205fcdd27048a166111d7c0077174ed73052310 | Fix intervals unit test. | tskisner/pytoast,tskisner/pytoast | src/python/tests/intervals.py | src/python/tests/intervals.py | # Copyright (c) 2015-2017 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import numpy as np
import numpy.testing as nt
from... | # Copyright (c) 2015-2017 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import numpy as np
import numpy.testing as nt
from... | bsd-2-clause | Python |
7624b72d5d7bb08e38ffa40e8606d581de124d1d | Update lookupAndStoreTweets.py docs: Update lookupAndStoreTweets.py | MichaelCurrin/twitterverse,MichaelCurrin/twitterverse | app/utils/insert/lookupAndStoreTweets.py | app/utils/insert/lookupAndStoreTweets.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Lookup and Store Tweets utility.
"""
import argparse
import os
import sys
# Allow imports to be done when executing this file directly.
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir)
))
from lib import ... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Lookup and Store Tweets utility.
"""
import argparse
import os
import sys
# Allow imports to be done when executing this file directly.
appDir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.path.pardir, os.path.pardi... | mit | Python |
5c5119febc2a1f2ab4157895f5fe336adedc5807 | correct path for selftest | jswoboda/GeoDataPython,jswoboda/GeoDataPython | Test/test.py | Test/test.py | #!/usr/bin/env python3
"""
self-test for GeoDataPython
"""
from os.path import dirname,join
from numpy.testing import assert_allclose,run_module_suite
#
from load_isropt import load_risromti
path=dirname(__file__)
def test_risr():
isrfn = join(path,'data','ran120219.004.hdf5')
omtifn = join(path,'data','OMTId... | #!/usr/bin/env python3
"""
self-test for GeoDataPython
"""
from numpy.testing import assert_allclose,run_module_suite
#
from load_isropt import load_risromti
def test_risr():
isrfn = 'data/ran120219.004.hdf5'
omtifn = 'data/OMTIdata.h5'
risr,omti = load_risromti(isrfn,omtifn)
assert_allclose(risr.data[... | mit | Python |
8918a4296ce3d7100578c4adce3cf39a37719173 | update help button to use font awesome and be disabled if no help | xgds/xgds_core,xgds/xgds_core,xgds/xgds_core | xgds_core/templatetags/help_button.py | xgds_core/templatetags/help_button.py | #__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... | #__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance ... | apache-2.0 | Python |
a2f9ecc391a4e77b22f857d26e8ffc7741e92b4a | fix default for provider_service | jermowery/xos,jermowery/xos,cboling/xos,jermowery/xos,xmaruto/mcord,xmaruto/mcord,jermowery/xos,xmaruto/mcord,cboling/xos,cboling/xos,xmaruto/mcord,cboling/xos,cboling/xos | xos/core/xoslib/methods/volttenant.py | xos/core/xoslib/methods/volttenant.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | apache-2.0 | Python |
8d29e6bfbf3b85bb4471b5cd41be180bf9fcda4f | support REST query by service_specific_id and vlan_id | jermowery/xos,xmaruto/mcord,cboling/xos,jermowery/xos,cboling/xos,jermowery/xos,xmaruto/mcord,cboling/xos,xmaruto/mcord,cboling/xos,jermowery/xos,cboling/xos,xmaruto/mcord | xos/core/xoslib/methods/volttenant.py | xos/core/xoslib/methods/volttenant.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | apache-2.0 | Python |
ebbe67666e113345a6f96edcd514ff8a1854485d | Bump version to 1.1 | duointeractive/django-fabtastic | fabtastic/__init__.py | fabtastic/__init__.py | VERSION = '1.1'
| VERSION = '1.0' | bsd-3-clause | Python |
4be7f694220ee969683f07b982f8fcbe61971a04 | Add comment to explain the length of the scripts taken into account in DuplicateScripts | ucsb-cs-education/hairball,jemole/hairball,thsunmy/hairball,jemole/hairball,ucsb-cs-education/hairball,thsunmy/hairball | hairball/plugins/duplicate.py | hairball/plugins/duplicate.py | """This module provides plugins for basic duplicate code detection."""
from hairball.plugins import HairballPlugin
class DuplicateScripts(HairballPlugin):
"""Plugin that keeps track of which scripts have been
used more than once whithin a project."""
def __init__(self):
super(DuplicateScripts, ... | """This module provides plugins for basic duplicate code detection."""
from hairball.plugins import HairballPlugin
class DuplicateScripts(HairballPlugin):
"""Plugin that keeps track of which scripts have been
used more than once whithin a project."""
def __init__(self):
super(DuplicateScripts, ... | bsd-2-clause | Python |
091445f20eca624112ab0660791b5858e268080d | add missing Ap_rst | Nic30/HWToolkit | hdl_toolkit/interfaces/all.py | hdl_toolkit/interfaces/all.py | from hdl_toolkit.interfaces.std import BramPort, \
BramPort_withoutClk, Ap_hs, Ap_clk, Ap_rst_n, Ap_none, Ap_vld,\
Ap_rst
from hdl_toolkit.interfaces.amba import Axi4, Axi4_xil, \
AxiLite, AxiLite_xil, AxiStream, AxiStream_withoutSTRB, AxiStream_withUserAndStrb, AxiStream_withUserAndNoStrb
a... | from hdl_toolkit.interfaces.std import BramPort, \
BramPort_withoutClk, Ap_hs, Ap_clk, Ap_rst_n, Ap_none, Ap_vld
from hdl_toolkit.interfaces.amba import Axi4, Axi4_xil, \
AxiLite, AxiLite_xil, AxiStream, AxiStream_withoutSTRB, AxiStream_withUserAndStrb, AxiStream_withUserAndNoStrb
allInterfaces ... | mit | Python |
15996286496d913c25290362ba2dba2d349bd5f6 | Fix bug of invoking /bin/sh on several OSs | snippits/qemu_image,snippits/qemu_image,snippits/qemu_image | imageManagerUtils/settings.py | imageManagerUtils/settings.py | # Copyright (c) 2017, MIT Licensed, Medicine Yeh
# This file helps to read settings from bash script into os.environ
import os
import sys
import subprocess
# This path is the location of the caller script
MAIN_SCRIPT_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))
# Set up the path to settings.sh
settings_path ... | # Copyright (c) 2017, MIT Licensed, Medicine Yeh
# This file helps to read settings from bash script into os.environ
import os
import sys
import subprocess
# This path is the location of the caller script
MAIN_SCRIPT_PATH = os.path.dirname(os.path.abspath(sys.argv[0]))
# Set up the path to settings.sh
settings_path ... | mit | Python |
44514aa5d70af10a14fd90a77fe57d7af01d538e | add automated email workflow improvements: 1) don't use extra_models, now renamed to queries 2) use new date_filter construct where appropriate | magfest/attendee_tournaments,magfest/attendee_tournaments | attendee_tournaments/automated_emails.py | attendee_tournaments/automated_emails.py | from attendee_tournaments import *
AutomatedEmail.queries[AttendeeTournament] = lambda session: session.query(AttendeeTournament).all()
AutomatedEmail(AttendeeTournament, 'Your tournament application has been received', 'tournament_app_received.txt',
lambda app: app.status == c.NEW)
AutomatedEmail(Att... | from attendee_tournaments import *
AutomatedEmail.extra_models[AttendeeTournament] = lambda session: session.query(AttendeeTournament).all()
AutomatedEmail(AttendeeTournament, 'Your tournament application has been received', 'tournament_app_received.txt',
lambda app: app.status == c.NEW)
AutomatedEmai... | agpl-3.0 | Python |
fead22592dfe644cb1684888ed8d8b422b1fb101 | Update views.py | ebridge2/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website,02agarwalt/FNGS_website,02agarwalt/FNGS_website,02agarwalt/FNGS_website | fngs/analyze/views.py | fngs/analyze/views.py | from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionFor... | from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionFor... | apache-2.0 | Python |
5a46276585aaaae76f00095b7166a4ddf52ad335 | fix log formatting (#2427) | Azure/WALinuxAgent,Azure/WALinuxAgent | azurelinuxagent/common/osutil/systemd.py | azurelinuxagent/common/osutil/systemd.py | #
# Copyright 2018 Microsoft Corporation
#
# 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 ... | #
# Copyright 2018 Microsoft Corporation
#
# 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 ... | apache-2.0 | Python |
bcd1e5124efda816ff60b79112a99e19f6846960 | clean the test-build | simbuerg/benchbuild,simbuerg/benchbuild | benchbuild/projects/benchbuild/python.py | benchbuild/projects/benchbuild/python.py | from benchbuild.project import wrap
from benchbuild.projects.benchbuild.group import BenchBuildGroup
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from plumbum import local
from benchbuild.utils.cmd import make, tar
from ... | from benchbuild.project import wrap
from benchbuild.projects.benchbuild.group import BenchBuildGroup
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Wget
from benchbuild.utils.run import run
from plumbum import local
from benchbuild.utils.cmd import make, tar
from ... | mit | Python |
0f673f5c3bb4fbeda582ad6b42933a36b1279186 | Remove wildcard import from test_dynd | cpcloud/blaze,LiaoPan/blaze,ContinuumIO/blaze,maxalbert/blaze,jdmcbr/blaze,jcrist/blaze,cowlicks/blaze,xlhtc007/blaze,maxalbert/blaze,jdmcbr/blaze,cpcloud/blaze,cowlicks/blaze,nkhuyu/blaze,LiaoPan/blaze,alexmojaki/blaze,nkhuyu/blaze,ChinaQuants/blaze,xlhtc007/blaze,scls19fr/blaze,caseyclements/blaze,dwillmer/blaze,Cont... | blaze/compute/tests/test_dynd_compute.py | blaze/compute/tests/test_dynd_compute.py | from __future__ import absolute_import, division, print_function
import pytest
dynd = pytest.importorskip('dynd')
from dynd import nd
from blaze.compute.core import compute
from blaze import symbol
def eq(a, b):
return nd.as_py(a) == nd.as_py(b)
n = symbol('n', '3 * 5 * int')
nx = nd.array([[ 1, 2, 3, 4, ... | from __future__ import absolute_import, division, print_function
import pytest
dynd = pytest.importorskip('dynd')
from dynd import nd
from blaze.compute.core import compute
from blaze.expr import *
from blaze.compute.dynd import *
def eq(a, b):
return nd.as_py(a) == nd.as_py(b)
n = symbol('n', '3 * 5 * int')
... | bsd-3-clause | Python |
8cf8e7c968232fe999e4dfc20541be4ff96fcee1 | Add user-supplied arguments in log_handler | watonyweng/neutron,Metaswitch/calico-neutron,takeshineshiro/neutron,virtualopensystems/neutron,adelina-t/neutron,vivekanand1101/neutron,watonyweng/neutron,JioCloud/neutron,waltBB/neutron_read,CiscoSystems/neutron,javaos74/neutron,aristanetworks/neutron,JianyuWang/neutron,swdream/neutron,dhanunjaya/neutron,openstack/neu... | neutron/openstack/common/log_handler.py | neutron/openstack/common/log_handler.py | # Copyright 2013 IBM Corp.
#
# 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 t... | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 | Python |
29f5e0a9b3d441f4fbc31055e319da4f37d9f40b | add import_regulomedb.py | perGENIE/pergenie,perGENIE/pergenie,perGENIE/pergenie-web,perGENIE/pergenie,perGENIE/pergenie-web,perGENIE/pergenie-web,perGENIE/pergenie-web,knmkr/perGENIE,knmkr/perGENIE,perGENIE/pergenie,perGENIE/pergenie-web,knmkr/perGENIE,knmkr/perGENIE,knmkr/perGENIE,perGENIE/pergenie-web,perGENIE/pergenie,knmkr/perGENIE | pergenie/lib/mongo/import_regulomedb.py | pergenie/lib/mongo/import_regulomedb.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pymongo
path_to_regulomedb = '/Users/numa/Dropbox/py/perGENIE/pergenie/data/large_dbs/regulomedb/RegulomeDB.dbSNP132.Category1.txt'
def import_regulomedb():
print >>sys.stderr, 'Importing ...'
with pymongo.MongoClient() as c:
db = c['p... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import pymongo
path_to_23adnme_snps = '/Users/numa/Dropbox/py/perGENIE/pergenie/data/large_dbs/23andme-api/snps.data' # FIX to path of yours.
def import_23andme_snps():
print >>sys.stderr, 'Importing 23andMe SNPs...'
with pymongo.MongoClient() as c:... | agpl-3.0 | Python |
38da9b42558d59b5858d18e5b2c9a26d5d8fd23b | Update email.py | delitamakanda/socialite,delitamakanda/socialite,delitamakanda/socialite | app/email.py | app/email.py | from threading import Thread
from flask.ext.mail import Message
from flask import render_template, current_app
from . import mail
from .decorators import async
@async
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_... | from threading import Thread
from flask.ext.mail import Message
from flask import render_template, current_app
from . import mail
from .decorators import async
@async
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_... | mit | Python |
ac92075762ea9fecb9732a1328524f18d321f4a6 | Add basic chat functions | tuxxy/SMIRCH | app/views.py | app/views.py | from app import app, db
from flask import request, json
from api import Teli
from models import User, DID
import re
teli = Teli(app.config['TELI_TOKEN'], app.config['TELI_DID'])
@app.route('/', methods=['POST'])
def main():
# subscribe <nick>
message = request.form.get('message').split(' ')
sender = User... | from app import app, db
from flask import request, json
from api import Teli
from models import User, DID
import re
teli = Teli(app.config['TELI_TOKEN'], app.config['TELI_DID'])
@app.route('/', methods=['POST'])
def main():
# subscribe <nick>
message = request.form.get('message').split(' ')
if message[0]... | agpl-3.0 | Python |
22ae4b9e0ce5c9d1ac37a2dc2d225c2855b7f9f1 | Save votes to redis | Arcana/pubstomp.hu,Arcana/pubstomp.hu,Arcana/pubstomp.hu | app/views.py | app/views.py | from uuid import uuid4
from flask import render_template, request, make_response
from app import app, babel, redis
@babel.localeselector
def get_locale():
if hasattr(request, 'locale'):
if request.locale in app.config['LOCALES'] and request.locale:
return request.locale
else:
... | from flask import render_template, request
from app import app, babel
@babel.localeselector
def get_locale():
if hasattr(request, 'locale'):
if request.locale in app.config['LOCALES'] and request.locale:
return request.locale
else:
return request.accept_languages.best_match... | mit | Python |
7a22663a66749ef7f86a78575fb915b66ed02f73 | Update views to frontend | chrisfrederickson/firepi,chrisfrederickson/firepi,chrisfrederickson/firepi,chrisfrederickson/firepi | app/views.py | app/views.py | from app import app, chamber
from app.auth import google, whitelist_required, admin_required
from flask import request, url_for, redirect, flash, session, jsonify, render_template
@app.route('/')
def home():
return render_template('index.html')
@app.route('/read')
@whitelist_required
def read_temp():
try:
... | from app import app, tempchamber
from app.auth import google, whitelist_required, admin_required
from flask import request, url_for, redirect, flash, session, jsonify
chamber = tempchamber.TempChamber()
@app.route('/')
def home():
if 'google_token' in session:
me = google.get('userinfo')
return js... | mit | Python |
a31428a7bd18a1c9f551276b08b1334352fb552b | debug = false | copelco/Durham-Open-Data-Catalog,copelco/Durham-Open-Data-Catalog,copelco/Durham-Open-Data-Catalog | OpenDataCatalog/settings_production.py | OpenDataCatalog/settings_production.py | from settings import *
DEBUG = False
SITE_ROOT = ''
LOGIN_URL = SITE_ROOT + "/accounts/login/"
# Theme info
# LOCAL_STATICFILE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
# '../../ODC-overlay/static'))
# LOCAL_TEMPLATE_DIR = os.path.abspath(os.path.join(os.path.dirna... | import os
from settings import *
SITE_ROOT = ''
LOGIN_URL = SITE_ROOT + "/accounts/login/"
# Theme info
# LOCAL_STATICFILE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
# '../../ODC-overlay/static'))
# LOCAL_TEMPLATE_DIR = os.path.abspath(os.path.join(os.path.dirname(_... | mit | Python |
f55a7bffd1cd6a75aa7e5151d4cd564826ab08b2 | Remove unused code | rollbar/pyrollbar | rollbar/contrib/starlette/middleware.py | rollbar/contrib/starlette/middleware.py | import sys
from starlette.requests import Request
from starlette.types import Receive, Scope, Send
import rollbar
from .requests import store_current_request
from rollbar.contrib.asgi import ASGIMiddleware
from rollbar.lib._async import RollbarAsyncError, try_report
class StarletteMiddleware(ASGIMiddleware):
as... | import logging
import sys
from starlette.requests import Request
from starlette.types import Receive, Scope, Send
import rollbar
from .requests import store_current_request
from rollbar.contrib.asgi import ASGIMiddleware
from rollbar.lib._async import RollbarAsyncError, try_report
log = logging.getLogger(__name__)
... | mit | Python |
e93a87f451b1e2a11b0393fa8ed048f19203eafc | bump to 0.19.0 | dmpetrov/dataversioncontrol,efiop/dvc,efiop/dvc,dataversioncontrol/dvc,dataversioncontrol/dvc,dmpetrov/dataversioncontrol | dvc/__init__.py | dvc/__init__.py | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.19.0'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path.... | """
DVC
----
Make your data science projects reproducible and shareable.
"""
import os
import warnings
VERSION_BASE = '0.18.15'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
HOMEPATH = os.path.dirname(PACKAGEPATH)
VERSIONPATH = os.path.join(PACKAGEPATH, 'version.py')
if os.path... | apache-2.0 | Python |
4ee58acb7e9a35be0514d1a4189fbc6c4a53baa5 | update http example | ubolonton/twisted-csp | example/http.py | example/http.py | import csp
from twisted.web.client import getPage
def request(url):
channel = csp.Channel(1)
def ok(value):
csp.put_then_callback(channel, (value, None), csp.no_op)
def error(failure):
csp.put_then_callback(channel, (None, failure), csp.no_op)
getPage(url).addCallback(ok).addErrback(e... | import csp
from twisted.web.client import getPage
def request(url):
return csp.channelify(getPage(url))
def main():
def timeout_channel(seconds):
c = csp.Channel()
def _t():
yield csp.wait(seconds)
yield c.put(None)
csp.go(_t())
return c
c = requ... | epl-1.0 | Python |
32c35a39fa14aecf91747727ee8b54bb60027b48 | add function to parse fixer_io | anshulc95/exch | exch/helpers.py | exch/helpers.py | """ helper functions to gather the currency rates """
from urllib.parse import urlencode
import requests
from decimal import Decimal, getcontext
getcontext().prec = 2
def fixer(base, target, value=1, date='latest'):
"""get currency exchange rate from fixer.io in JSON"""
main_api = 'http://api.fixer.io/{... | mit | Python | |
6f421c97a0b5d08c5d8d76330ddda89a4bb78a73 | Update seo_meta.py | eghuro/crawlcheck | src/checker/plugin/checkers/seo_meta.py | src/checker/plugin/checkers/seo_meta.py | from common import PluginType, getSoup
from yapsy.IPlugin import IPlugin
import logging
class MetaTagValidator(IPlugin):
category = PluginType.CHECKER
id = "seometa"
contentTypes = ["text/html"]
__defects = {"seo:multidsc": "Multiple description meta tags found",
"seo:nodsc": "No de... | from common import PluginType, getSoup
from yapsy.IPlugin import IPlugin
import logging
class MetaTagValidator(IPlugin):
category = PluginType.CHECKER
id = "seometa"
contentTypes = ["text/html"]
__defects = {"seo:multidsc": "Multiple description meta tags found",
"seo:nodsc": "No de... | mit | Python |
48e4b347dcbef03efc889c227895c4f2b66e0838 | Improve test names. | raphaeldore/analyzr,raphaeldore/analyzr | analyzr/test/test_networkdiscoverer.py | analyzr/test/test_networkdiscoverer.py | import unittest
from analyzr.constants import topports
from analyzr.core import NetworkToolFacade, Fingerprinter
from analyzr.networkdiscoverer import NetworkDiscoverer
class NetworkToolMock(NetworkToolFacade):
pass
class FingerprinterMock(Fingerprinter):
pass
class InitConfig(unittest.TestCase):
def... | import unittest
from analyzr.constants import topports
from analyzr.core import NetworkToolFacade, Fingerprinter
from analyzr.networkdiscoverer import NetworkDiscoverer
class NetworkToolMock(NetworkToolFacade):
pass
class FingerprinterMock(Fingerprinter):
pass
class InitConfig(unittest.TestCase):
def... | mit | Python |
1bae18a57bbda31ff14b8689d0dfaa205596456b | Move setting of CALACCESS_WEBSITE_ENV before initial django db migration | california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website | fabfile/chef.py | fabfile/chef.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import collections
from app import migrate, collectstatic
from configure import ConfigTask, copyconfig
from fabric.api import sudo, task, env
from fabric.contrib.project import rsync_project
from fabric.colors import green
@task(task_class=ConfigTask)
def boot... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import collections
from app import migrate, collectstatic
from configure import ConfigTask, copyconfig
from fabric.api import sudo, task, env
from fabric.contrib.project import rsync_project
from fabric.colors import green
@task(task_class=ConfigTask)
def boot... | mit | Python |
ebf9c923388b8ea013785791b4c5031760987d4b | fix generate_process_flowchart | vicalloy/django-lb-workflow,vicalloy/django-lb-workflow,vicalloy/django-lb-workflow | lbworkflow/views/flowchart.py | lbworkflow/views/flowchart.py | from django.http import HttpResponse
from django.template import Context
from django.template import Template
from lbworkflow.models import Process
try:
import pygraphviz as pgv
except ImportError:
pass
def generate_process_flowchart(process):
file_template = """
strict digraph {
... | from django.http import HttpResponse
from django.template import Context
from django.template import Template
from lbworkflow.models import Process
try:
import pygraphviz as pgv
except ImportError:
pass
def generate_process_flowchart(process):
file_template = """
strict digraph {
... | mit | Python |
30e7567ae6d8fe407b8360425ebcd46b4633a852 | Update fetchWeather.py | siskulous/PiAwake,siskulous/PiAwake | fetchWeather.py | fetchWeather.py | #!/usr/bin/python
import json, requests, commands
url='http://forecast.weather.gov/MapClick.php'
params = dict(
lat = 37.9752,
lon = -100.8642,
FcstType = 'json'
)
resp = requests.get(url=url, params=params)
data = json.loads(resp.text)
#weather=data['location']['areaDescription']+' Weather.... | #!/usr/bin/python
import json, requests, commands
url='http://forecast.weather.gov/MapClick.php'
params = dict(
lat = 37.9752,
lon = -100.8642,
FcstType = 'json'
)
resp = requests.get(url=url, params=params)
data = json.loads(resp.text)
#weather=data['location']['areaDescription']+' Weather.... | mit | Python |
7efbb0c4edbe572b03495c8403d56d2230dc97db | Tag new release: 3.1.14 | Floobits/floobits-sublime,Floobits/floobits-sublime | floo/version.py | floo/version.py | PLUGIN_VERSION = '3.1.14'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| PLUGIN_VERSION = '3.1.13'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| apache-2.0 | Python |
8fd6d943c73a5d9772b598923893d6501a4ed343 | Bump minor build | gogetdata/ggd-cli,gogetdata/ggd-cli | ggd/__init__.py | ggd/__init__.py | __version__ = "0.0.9"
| __version__ = "0.0.8"
| mit | Python |
c027e671d1a47d485755b748f2dffc202c704ff8 | Update goodreads API to `show original_publication_year` | avinassh/Reddit-GoodReads-Bot | goodreadsapi.py | goodreadsapi.py | #!/usr/bin/env python
import re
from xml.parsers.expat import ExpatError
import requests
import xmltodict
from settings import goodreads_api_key
def get_goodreads_ids(comment_msg):
# receives goodreads url
# returns the id using regex
regex = r'goodreads.com/book/show/(\d+)'
return set(re.findall(r... | #!/usr/bin/env python
import re
from xml.parsers.expat import ExpatError
import requests
import xmltodict
from settings import goodreads_api_key
def get_goodreads_ids(comment_msg):
# receives goodreads url
# returns the id using regex
regex = r'goodreads.com/book/show/(\d+)'
return set(re.findall(r... | mit | Python |
59b015bb3e45497b7ec86bf1799e8442a30b65da | Exit method. - (New) Added exit method. | dacuevas/PMAnalyzer,dacuevas/PMAnalyzer,dacuevas/PMAnalyzer,dacuevas/PMAnalyzer | py/PMUtil.py | py/PMUtil.py | # PMUtil.py
# Phenotype microarray utility functions
#
# Author: Daniel A Cuevas
# Created on 27 Jan 2015
# Updated on 20 Aug 2015
from __future__ import absolute_import, division, print_function
import sys
import time
import datetime
def timeStamp():
'''Return time stamp'''
t = time.time()
fmt = '[%Y-%m... | # PMUtil.py
# Phenotype microarray utility functions
#
# Author: Daniel A Cuevas
# Created on 27 Jan. 2015
# Updated on 27 Jan. 2015
from __future__ import absolute_import, division, print_function
import sys
import time
import datetime
def timeStamp():
'''Return time stamp'''
t = time.time()
fmt = '[%Y-... | mit | Python |
a8976ff1c3bdc177ca72becf48c4278f963d2627 | Add Publications class to initialisation | nestauk/gtr | gtr/__init__.py | gtr/__init__.py | __all__ = [
"gtr.services.funds.Funds",
"gtr.services.organisations.Organisations",
"gtr.services.persons.Persons",
"gtr.services.projects.Projects",
"gtr.services.publications.Publications"
]
__version__ = "0.1.0"
from gtr.services.base import _Service
from gtr.services.funds import Funds
from gtr... | __all__ = [
"gtr.services.funds.Funds",
"gtr.services.organisations.Organisations",
"gtr.services.persons.Persons",
"gtr.services.projects.Projects"
]
__version__ = "0.1.0"
from gtr.services.base import _Service
from gtr.services.funds import Funds
from gtr.services.organisations import Organisations
f... | apache-2.0 | Python |
036ec4468bf6431bd137417f51fb182dd990cb80 | read json file as OrderedDicts | phaustin/nws_parse,phaustin/nws_parse | read_json.py | read_json.py | """
example read for json file
"""
import json
from collections import OrderedDict
filename = 'testdata/bondurant.json'
with open(filename,'r') as f:
week_list = json.load(f,object_pairs_hook=OrderedDict)
#
# print valid forecast periods for each week
#
for week in week_list:
print(week['valid'])
#
# print t... | """
example read for json file
"""
import json
filename = 'testdata/bondurant.json'
with open(filename,'r') as f:
week_list = json.load(f)
#
# print valid forecast periods for each week
#
for week in week_list:
print(week['valid'])
#
# print temperatures for week3 (index starts at 0)
#
temps = week_list[2]['t... | cc0-1.0 | Python |
05d4427f3998180a9e9caa192ddadd7bb5e8ccdd | remove extra spaces | sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper | src/pyquickhelper/pycode/code_helper.py | src/pyquickhelper/pycode/code_helper.py | """
@file
@brief Various function to clean the code.
"""
import os
from ..sync.synchelper import explore_folder
def remove_extra_spaces(filename):
"""
removes extra spaces in a filename, replace the file in place
@param filename file name
@return number of removed extr... | """
@file
@brief Various function to clean the code.
"""
import os
from ..sync.synchelper import explore_folder
def remove_extra_spaces(filename):
"""
removes extra spaces in a filename, replace the file in place
@param filename file name
@return number of removed extr... | mit | Python |
da7e82efccb8ace8d3473a553da896a51bdd3b24 | Bump version to 0.2.6 | amplify-education/python-hcl2 | hcl2/version.py | hcl2/version.py | """Place of record for the package version"""
__version__ = "0.2.6"
__git_hash__ = "GIT_HASH"
| """Place of record for the package version"""
__version__ = "0.2.5"
__git_hash__ = "GIT_HASH"
| mit | Python |
c8049c01d2900a2cb1662edec390d35fe6fc706c | Remove unneeded SourcecodeCompiler object | SOM-st/PySOM,SOM-st/PySOM,smarr/PySOM,smarr/PySOM | src/som/compiler/sourcecode_compiler.py | src/som/compiler/sourcecode_compiler.py | import os
from rlib.streamio import open_file_as_stream
from rlib.string_stream import StringStream
from som.compiler.class_generation_context import ClassGenerationContext
from som.interp_type import is_ast_interpreter
if is_ast_interpreter():
from som.compiler.ast.parser import Parser
else:
from som.comp... | import os
from rlib.streamio import open_file_as_stream
from rlib.string_stream import StringStream
from som.compiler.class_generation_context import ClassGenerationContext
from som.interp_type import is_ast_interpreter
if is_ast_interpreter():
from som.compiler.ast.parser import Parser
else:
from som.comp... | mit | Python |
1e4276ea4311284835803e081566fc9ffc57191a | add time in UTC to generated manifest | rs-makino/buildpack-test,createmultimedia/heroku-buildpack-php,dzuelke/heroku-buildpack-php,emeth-/heroku-buildpack-php,jayelkaake/heroku-buildpack-magento,flant/heroku-buildpack-php,dzuelke/heroku-buildpack-php,thecsea/heroku-buildpack-php-with-ioncube,createmultimedia/heroku-buildpack-php,rikur/heroku-buildpack-php,a... | support/build/_util/include/manifest.py | support/build/_util/include/manifest.py | import os, sys, json, re, datetime
require = {
"heroku-sys/"+os.getenv("STACK"): "^1.0.0",
"heroku/installer-plugin": "^1.0.0",
}
engine=re.match('heroku-sys-(\w+)-extension', sys.argv[1])
if engine:
require["heroku-sys/"+engine.group(1)] = sys.argv.pop(5)
manifest = {
"type": sys.argv[1],
"name":... | import os, sys, json, re
require = {
"heroku-sys/"+os.getenv("STACK"): "^1.0.0",
"heroku/installer-plugin": "^1.0.0",
}
engine=re.match('heroku-sys-(\w+)-extension', sys.argv[1])
if engine:
require["heroku-sys/"+engine.group(1)] = sys.argv.pop(5)
manifest = {
"type": sys.argv[1],
"name": sys.argv[... | mit | Python |
63a26cbf76a3d0135f5b67dd10cc7f383ffa7ebf | Change authenticate_credentials method to raise an exception if the account is disabled | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/jwt.py | helusers/jwt.py | from django.conf import settings
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_settings
from .user_utils import get_or_create_user
def patch_jwt_settings():
"""Patch rest_framework_jwt authentication sett... | from django.conf import settings
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework_jwt.settings import api_settings
from .user_utils import get_or_create_user
def patch_jwt_settings():
"""Patch rest_framework_jwt authentication settings from allauth"""
defaults = ap... | bsd-2-clause | Python |
9ccd957dfde79db677c7ae19e0a271d69921f0b4 | bump version | hopshadoop/hops-util-py,hopshadoop/hops-util-py | hops/version.py | hops/version.py | __version__ = '1.6.5'
| __version__ = '1.6.4'
| apache-2.0 | Python |
754e08288be17db63747592fd5ce1d70a6fb154e | bump version | hopshadoop/hops-util-py,hopshadoop/hops-util-py | hops/version.py | hops/version.py | __version__ = '2.7.7'
| __version__ = '2.7.6'
| apache-2.0 | Python |
ae21b9796abb1511d3af2cdd0c87f8d90386093c | Update inftp.py | ldmoray/dotfiles,ldmoray/dotfiles | bin/inftp.py | bin/inftp.py | __author__ = 'Lenny Morayniss'
'''
This project is licensed under the terms of the MIT license.
Copyright Lenny Morayniss 2015
'''
import argparse
from ftplib import FTP_TLS
import os
import time
def upload(ftp, filename):
ext = os.path.splitext(filename)[1]
if ext in (".txt", ".htm", ".html"):
ftp.sto... | __author__ = 'Lenny Morayniss'
'''
This project is licensed under the terms of the MIT license.
Copyright Lenny Morayiss 2015
'''
import argparse
from ftplib import FTP_TLS
import os
import time
def upload(ftp, filename):
ext = os.path.splitext(filename)[1]
if ext in (".txt", ".htm", ".html"):
ftp.stor... | mit | Python |
764f8d9d7818076555cde5fcad29f3052b523771 | Add more search fields to autocomplete | KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend,KlubJagiellonski/pola-backend | company/autocomplete_light_registry.py | company/autocomplete_light_registry.py | import autocomplete_light
from .models import Company
class CompanyAutocomplete(autocomplete_light.AutocompleteModelBase):
search_fields = ['name', 'official_name', 'common_name']
model = Company
autocomplete_light.register(CompanyAutocomplete)
| import autocomplete_light
from .models import Company
class CompanyAutocomplete(autocomplete_light.AutocompleteModelBase):
search_fields = ['^name']
model = Company
autocomplete_light.register(CompanyAutocomplete)
| bsd-3-clause | Python |
e0b8866d3b1b6a9fc896d511227523391a1501f4 | Update binstar-push.py | rmcgibbo/python-appveyor-conda-example,rmcgibbo/python-appveyor-conda-example | continuous-integration/binstar-push.py | continuous-integration/binstar-push.py | import os
import glob
import subprocess
import traceback
token = os.environ['BINSTAR_TOKEN']
cmd = ['binstar', '-t', token, 'upload', '--force']
cmd.extend(glob.glob('*.tar.bz2'))
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
traceback.print_exc()
| import os
import glob
import subprocess
import traceback
token = os.environ['BINSTAR_TOKEN']
cmd = ['anaconda_server', '-t', token, 'upload', '--force']
cmd.extend(glob.glob('*.tar.bz2'))
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
traceback.print_exc()
| cc0-1.0 | Python |
805e6be1687622cd70e6475708d0e5d8b53f8132 | Update docs | eeue56/PyChat.js,eeue56/PyChat.js | pychatjs/server/user_server.py | pychatjs/server/user_server.py | class UsernameInUseException(Exception):
pass
class User(object):
""" Class used to hold a user and the user server """
def __init__(self, server, name=None):
if name is None:
name = server.temp_name
self.name = name
self.server = server
def __str__(sel... |
class UsernameInUseException(Exception):
pass
class User(object):
def __init__(self, server, name=None):
if name is None:
name = server.temp_name
self.name = name
self.server = server
def __str__(self):
return str(self.name)
def _to_json(se... | bsd-3-clause | Python |
0b1499e87e5a2bdaadc13811378e869e13c9c3db | Update chat.py | CodeGuild-co/wtc,CodeGuild-co/wtc,CodeGuild-co/wtc | blog/chat.py | blog/chat.py | # A simple chat server using websockets
# Uses a slight modification to the protocol I'm using to write a different
# application
# Modifications:
# No rooms
# Uses Facebook to authenticate
from flask import Flask, session, escape, request, redirect
from flask_socketio import SocketIO, emit
from blog.util import rend... | # A simple chat server using websockets
# Uses a slight modification to the protocol I'm using to write a different
# application
# Modifications:
# No rooms
# Uses Facebook to authenticate
from flask import Flask, session, escape, request, redirect
from flask_socketio import SocketIO, emit
from blog.util import rend... | mit | Python |
a06010fcb2f4424d085da1487a6666867a8cbf5b | Remove add_view and add form for the hole admin | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/maintenance/admin/maintenance.py | dbaas/maintenance/admin/maintenance.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
from ..forms import MaintenanceForm
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = Maintenanc... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django_services import admin
from ..models import Maintenance
from ..service.maintenance import MaintenanceService
class MaintenanceAdmin(admin.DjangoServicesAdmin):
service_class = MaintenanceService
search_fields = ("sche... | bsd-3-clause | Python |
67643dd792967523fa7c12fb380274237e30c34d | Update trainLSTM-noATTN.py | svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser | runScripts/trainLSTM-noATTN.py | runScripts/trainLSTM-noATTN.py | # Original script developed by Harshal Priyadarshi https://github.com/harpribot
# Edited for purpose of this project.
# Script to initiate training process of the LSTM network with attention disabled.
# Import required libraries; Point system directory back to parent folder to allow import files below:
import os
impor... | # Original script developed by Harshal Priyadarshi https://github.com/harpribot
# Edited for purpose of this project.
# Script to initiate training process of the LSTM network with attention disabled.
# Import required libraries; Point system directory back to parent folder to allow import files below:
import os
impor... | mit | Python |
81b4344d3f1882ff65308273b87395cae2d6cc6c | Disable OpenBSD service module on 5.0, it won't work reliably there. | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/openbsdservice.py | salt/modules/openbsdservice.py | '''
The service module for OpenBSD
'''
import os
# XXX enable/disable support would be nice
def __virtual__():
'''
Only work on OpenBSD
'''
if __grains__['os'] == 'OpenBSD' and os.path.exists('/etc/rc.d/rc.subr'):
v = map(int, __grains__['kernelrelease'].split('.'))
# The -f flag, u... | '''
The service module for OpenBSD
'''
import os
# XXX enable/disable support would be nice
def __virtual__():
'''
Only work on OpenBSD
'''
if __grains__['os'] == 'OpenBSD' and os.path.exists('/etc/rc.d/rc.subr'):
return 'service'
return False
def start(name):
'''
Start the sp... | apache-2.0 | Python |
6f822cf46957d038588e7a71eb91f8ca9f9c95f1 | Use get_minion_path to get default dir. | goliatone/minions | scaffolder/commands/install.py | scaffolder/commands/install.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder import get_minion_path
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand
class InstallCommand(BaseCommand):
option_list = BaseCommand... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.template import TemplateManager
from scaffolder.core.commands import BaseCommand
class InstallCommand(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
... | mit | Python |
c0682d5d53d3f136485f952dfa82e0dc44df89ae | change release_url | cf-platform-eng/bosh-azure-template,cf-platform-eng/bosh-azure-template | bootstrap.py | bootstrap.py | #!/usr/bin/env python
import urllib2
import json
import apt
import tarfile
import sys
from distutils import dir_util
from os import chdir
from os import symlink
from subprocess import call
# install packages
package_list = [
"python-pip",
"build-essential",
"tmux",
"ruby2.0",
"ruby2.0-dev",
"l... | #!/usr/bin/env python
import urllib2
import json
import apt
import tarfile
import sys
from distutils import dir_util
from os import chdir
from os import symlink
from subprocess import call
# install packages
package_list = [
"python-pip",
"build-essential",
"tmux",
"ruby2.0",
"ruby2.0-dev",
"l... | apache-2.0 | Python |
6a111c64c50ffe6daa387034ef8fc3ad3e90fc75 | Move import to the top of the page. | genenetwork/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,zsloan/genenetwork2,zsloa... | test/requests/main_web_functionality.py | test/requests/main_web_functionality.py | from __future__ import print_function
import re
import requests
from lxml.html import parse
from link_checker import check_page
from requests.exceptions import ConnectionError
def check_home(url):
doc = parse(url).getroot()
search_button = doc.cssselect("#btsearch")
assert(search_button[0].value == "Search... | from __future__ import print_function
import re
import requests
from lxml.html import parse
from requests.exceptions import ConnectionError
def check_home(url):
doc = parse(url).getroot()
search_button = doc.cssselect("#btsearch")
assert(search_button[0].value == "Search")
print("OK")
def check_search... | agpl-3.0 | Python |
ae47decb69b71f227ccb6caa0047c7a471161bc4 | Allow running jacquard/cli.py directly | prophile/jacquard,prophile/jacquard | jacquard/cli.py | jacquard/cli.py | import sys
import pathlib
import argparse
import configparser
import pkg_resources
from jacquard.storage import open_engine
from jacquard.users import get_settings
def argument_parser():
parser = argparse.ArgumentParser(description="Split testing server")
parser.add_argument(
'-v',
'--verbose... | import sys
import pathlib
import argparse
import configparser
import pkg_resources
from jacquard.storage import open_engine
from jacquard.users import get_settings
def argument_parser():
parser = argparse.ArgumentParser(description="Split testing server")
parser.add_argument(
'-v',
'--verbose... | mit | Python |
6bf998fa9ae7f0edaddfbeca1ef7e5f9e764ee66 | print bug | snurkabill/pydeeplearn,Warvito/pydeeplearn,Warvito/pydeeplearn,mihaelacr/pydeeplearn,snurkabill/pydeeplearn | code/test.py | code/test.py | # this file is made to see how theano works and the speedup
# it gives you on GPU versus a normal implementation on CPU (ran on my computer)
import theano
import theano.tensor as T
from theano import function, shared
import numpy as np
import time
x = T.matrix('x', dtype=theano.config.floatX)
y = T.matrix('y', dtype... | # this file is made to see how theano works and the speedup
# it gives you on GPU versus a normal implementation on CPU (ran on my computer)
import theano
import theano.tensor as T
from theano import function, shared
import numpy as np
import time
x = T.matrix('x', dtype=theano.config.floatX)
y = T.matrix('y', dtype... | bsd-3-clause | Python |
9853ae44908156e29115f5c9859bbd2c7a756bd9 | fix typo in init | griffy/sikwidgets,griffy/sikwidgets | sikwidgets/widgets/__init__.py | sikwidgets/widgets/__init__.py | instantiable_widget_class_names = [
"Button",
"CheckBox",
"Image",
"Label",
"List",
"MenuButton",
"RadioButton",
"Tab",
"Table",
"TextField",
"Tooltip",
"Tree"
]
from widget import Widget
from page import Page
from button import Button
from check_box import CheckBox
from image import Image
from label impor... | instantiable_widget_class_names = [
"Button",
"Checkbox",
"Image",
"Label",
"List",
"MenuButton",
"RadioButton",
"Tab",
"Table",
"TextField",
"Tooltip",
"Tree"
]
from widget import Widget
from page import Page
from button import Button
from checkbox import Checkbox
from image import Image
from label import... | mit | Python |
5e42bde844eb6c7260a4415e512646d061137640 | bump version | mikepatrick/robotframework-requests,bulkan/robotframework-requests,bulkan/robotframework-requests,oleduc/robotframework-requests | src/RequestsLibrary/version.py | src/RequestsLibrary/version.py | VERSION = '0.4.5'
| VERSION = '0.4.4'
| mit | Python |
95d9bb3a9500d80b5064c5fb4d5bd7b30406d1ae | Fix update remote to ConanCenter and grpc to highest buildable/supported version | jinq0123/grpc_cb_core,jinq0123/grpc_cb_core,jinq0123/grpc_cb_core | conanfile.py | conanfile.py | from conans import ConanFile, CMake
class GrpccbConan(ConanFile):
name = "grpc_cb_core"
version = "0.2"
license = "Apache-2.0"
url = "https://github.com/jinq0123/grpc_cb_core"
description = "C++ gRPC core library with callback interface."
settings = "os", "compiler", "build_type", "arch"
op... | from conans import ConanFile, CMake
class GrpccbConan(ConanFile):
name = "grpc_cb_core"
version = "0.2"
license = "Apache-2.0"
url = "https://github.com/jinq0123/grpc_cb_core"
description = "C++ gRPC core library with callback interface."
settings = "os", "compiler", "build_type", "arch"
op... | apache-2.0 | Python |
c13a12e6355423d6756b8b514942596c31b0e3a9 | Make cmake-unit, cmake-linter-cmake and style-linter-cmake normal deps | polysquare/cmake-module-common | conanfile.py | conanfile.py | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class CMakeModuleCommonConan(ConanFile):
name = "cmake-module-common"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
url = "http://github.com/polysquare/cmake-module-com... | from conans import ConanFile
from conans.tools import download, unzip
import os
VERSION = "0.0.7"
class CMakeModuleCommonConan(ConanFile):
name = "cmake-module-common"
version = os.environ.get("CONAN_VERSION_OVERRIDE", VERSION)
generators = "cmake"
url = "http://github.com/polysquare/cmake-module-com... | mit | Python |
f39fc5c07421ddf27b3b921806fafcdb2c2ee3ed | Use WCSSUB_CELESTIAL | Alex-Ian-Hamilton/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy | sunpy/coordinates/wcs_utils.py | sunpy/coordinates/wcs_utils.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import astropy.wcs.utils
from astropy.wcs import WCSSUB_CELESTIAL
from .frames import *
__all__ = ['solar_wcs_frame_mapping']
def solar_wcs_frame_mapping(wcs):
"""
This function registers the coordinates frames to their FITS-WCS coordi... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import astropy.wcs.utils
from .frames import *
__all__ = ['solar_wcs_frame_mapping']
def solar_wcs_frame_mapping(wcs):
"""
This function registers the coordinates frames to their FITS-WCS coordinate
type values in the `astropy.wcs.u... | bsd-2-clause | Python |
b315778e1717dce8c6d5e493c0c7851f65aee25f | Add blank line above @classmethod joke2k/faker#552 | joke2k/faker,danhuss/faker,joke2k/faker | faker/providers/automotive/__init__.py | faker/providers/automotive/__init__.py | # coding=utf-8
localized = True
from .. import BaseProvider
from string import ascii_uppercase
import re
class Provider(BaseProvider):
license_formats = ()
@classmethod
def license_plate(cls):
temp = re.sub(r'\?',
lambda x: cls.random_element(ascii_uppercase),
cls.ran... | # coding=utf-8
localized = True
from .. import BaseProvider
from string import ascii_uppercase
import re
class Provider(BaseProvider):
license_formats = ()
@classmethod
def license_plate(cls):
temp = re.sub(r'\?',
lambda x: cls.random_element(ascii_uppercase),
cls.random_e... | mit | Python |
32dcc7384613870b95dc8b55c42381050b12d6a5 | update test block ordering | praekelt/molo-freebasics,praekelt/molo-freebasics,praekelt/molo-freebasics,praekelt/molo-freebasics | freebasics/tests/test_env_variables.py | freebasics/tests/test_env_variables.py | from django.test import TestCase, RequestFactory
from molo.core.tests.base import MoloTestCaseMixin
from freebasics.views import HomeView
from freebasics.templatetags import freebasics_tags
class EnvTestCase(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
def test_block_ordering(self):... | from django.test import TestCase, RequestFactory
from molo.core.tests.base import MoloTestCaseMixin
from freebasics.views import HomeView
from freebasics.templatetags import freebasics_tags
class EnvTestCase(TestCase, MoloTestCaseMixin):
def setUp(self):
self.mk_main()
def test_block_ordering(self):... | bsd-2-clause | Python |
f94580bad7e0d6df6bb92b34d153ade658d59c01 | Print output in test_debug__library_versions | pfmoore/pip,pradyunsg/pip,sbidoul/pip,pradyunsg/pip,pfmoore/pip,pypa/pip,sbidoul/pip,pypa/pip | tests/functional/test_debug.py | tests/functional/test_debug.py | import pytest
from pip._internal.commands.debug import create_vendor_txt_map
from pip._internal.utils import compatibility_tags
@pytest.mark.parametrize('expected_text', [
'sys.executable: ',
'sys.getdefaultencoding: ',
'sys.getfilesystemencoding: ',
'locale.getpreferredencoding: ',
'sys.platform... | import pytest
from pip._internal.commands.debug import create_vendor_txt_map
from pip._internal.utils import compatibility_tags
@pytest.mark.parametrize('expected_text', [
'sys.executable: ',
'sys.getdefaultencoding: ',
'sys.getfilesystemencoding: ',
'locale.getpreferredencoding: ',
'sys.platform... | mit | Python |
306e6939c5b369f4a4ef4bb4d16948dc1f027f53 | Update for PYTHON 985: MongoClient properties now block until connected. | ajdavis/pymongo-mockup-tests | tests/test_initial_ismaster.py | tests/test_initial_ismaster.py | # Copyright 2015 MongoDB, 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 agreed to in writing, so... | # Copyright 2015 MongoDB, 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 agreed to in writing, so... | apache-2.0 | Python |
f0b26198bc3c0e3937db334af3c99643481a3d91 | change from file | tongpa/tgext.pylogservice | tgext/pylogservice/__init__.py | tgext/pylogservice/__init__.py | from tg import config
from tg import hooks
from tg.configuration import milestones
import logging
log = logging.getLogger('tgext.pylogservice')
# This is the entry point of your extension, will be called
# both when the user plugs the extension manually or through tgext.pluggable
# What you write here has the same e... | from tg import config
from tg import hooks
from tg.configuration import milestones
import logging
log = logging.getLogger('tgext.pylogservice')
# This is the entry point of your extension, will be called
# both when the user plugs the extension manually or through tgext.pluggable
# What you write here has the same e... | mit | Python |
ace177c6d83209eac6038fb4b3cc4b0c392e1cf4 | Integrate LLVM at llvm/llvm-project@4e5c44964a7f | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "4e5c44964a7f3ecbe93cd69bdbcbbcf2a5f52c28"
LLVM_SHA256 = "13cd6f2bbd749d5386f133dc44b0707e7f780149a91cf56e05b8a730103122d8"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "be199527205dc8a8c7febc057ad6be90fac15547"
LLVM_SHA256 = "b43318ef35679dd1b6cb6c4cf1cd5888ac4530fb4149128e345cade0b6628e88"
tfrt_http_archive(
... | apache-2.0 | Python |
df73a47311c8527ee6a5bd7b461d9ffd44d2ff17 | Switch repo tests query to be a (somewhat) faster join (#391) | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | zeus/api/resources/repository_tests.py | zeus/api/resources/repository_tests.py | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | from datetime import timedelta
from sqlalchemy.sql import func
from zeus.config import db
from zeus.constants import Result, Status
from zeus.models import Repository, TestCase, Job
from zeus.utils import timezone
from .base_repository import BaseRepositoryResource
from ..schemas import TestCaseStatisticsSchema
test... | apache-2.0 | Python |
af7d139391fc797e1fa5a6540f0589e5b0c2a1c0 | Bump version to 4.1.0.13.dev2 | MAECProject/python-maec | maec/version.py | maec/version.py | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
__version__ = "4.1.0.13.dev2"
| # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
__version__ = "4.1.0.13.dev1"
| bsd-3-clause | Python |
af5e90cb544e2e37819302f5750084fc17f7ee12 | Remove sdbus++ template search workaround | openbmc/phosphor-inventory-manager,openbmc/phosphor-inventory-manager | make_example.py | make_example.py | #!/usr/bin/env python
import os
import sys
import yaml
import subprocess
if __name__ == '__main__':
genfiles = {
'server-cpp': lambda x: '%s.cpp' % x,
'server-header': lambda x: os.path.join(
os.path.join(*x.split('.')), 'server.hpp')
}
with open(os.path.join('example', 'inter... | #!/usr/bin/env python
import os
import sys
import yaml
import subprocess
class SDBUSPlus(object):
def __init__(self, path):
self.path = path
def __call__(self, *a, **kw):
args = [
os.path.join(self.path, 'sdbus++'),
'-t',
os.path.join(self.path, 'template... | apache-2.0 | Python |
1e07e9424a1ac69e1e660e6a6f1e58bba15472c1 | Implement saving and loading the observer tau | sbird/vw_spectra | make_spectra.py | make_spectra.py | # -*- coding: utf-8 -*-
import halospectra as hs
import randspectra as rs
import sys
snapnum=sys.argv[1]
sim=sys.argv[2]
#base="/n/hernquistfs1/mvogelsberger/projects/GFM/Production/Cosmo/Cosmo"+str(sim)+"_V6/L25n512/output/"
#savedir="/n/home11/spb/scratch/Cosmo/Cosmo"+str(sim)+"_V6_512/snapdir_"+str(snapnum).rjust(3... | # -*- coding: utf-8 -*-
import halospectra as hs
import randspectra as rs
import sys
snapnum=sys.argv[1]
sim=sys.argv[2]
#base="/n/hernquistfs1/mvogelsberger/projects/GFM/Production/Cosmo/Cosmo"+str(sim)+"_V6/L25n512/output/"
#savedir="/n/home11/spb/scratch/Cosmo/Cosmo"+str(sim)+"_V6_512/snapdir_"+str(snapnum).rjust(3... | mit | Python |
d4905477b812213da2333103c9fdd789151ae2d8 | Allow core config updated (#26398) | balloob/home-assistant,GenericStudent/home-assistant,qedi-r/home-assistant,sander76/home-assistant,qedi-r/home-assistant,balloob/home-assistant,lukas-hetzenecker/home-assistant,mezz64/home-assistant,pschmitt/home-assistant,leppa/home-assistant,w1ll1am23/home-assistant,sdague/home-assistant,postlund/home-assistant,arons... | homeassistant/components/websocket_api/permissions.py | homeassistant/components/websocket_api/permissions.py | """Permission constants for the websocket API.
Separate file to avoid circular imports.
"""
from homeassistant.const import (
EVENT_COMPONENT_LOADED,
EVENT_SERVICE_REGISTERED,
EVENT_SERVICE_REMOVED,
EVENT_STATE_CHANGED,
EVENT_THEMES_UPDATED,
EVENT_CORE_CONFIG_UPDATE,
)
from homeassistant.compon... | """Permission constants for the websocket API.
Separate file to avoid circular imports.
"""
from homeassistant.const import (
EVENT_COMPONENT_LOADED,
EVENT_SERVICE_REGISTERED,
EVENT_SERVICE_REMOVED,
EVENT_STATE_CHANGED,
EVENT_THEMES_UPDATED,
)
from homeassistant.components.persistent_notification i... | apache-2.0 | Python |
1b224e868011c7fb9e20cabaed26fb029355d04d | Add the member name to the description in tracking. | MJB47/Jokusoramame,MJB47/Jokusoramame,MJB47/Jokusoramame | joku/cogs/tracking.py | joku/cogs/tracking.py | """
NSA-tier presence tracking.
"""
import datetime
import time
import discord
from discord import Status
from discord.ext import commands
from joku.bot import Context
from joku.cogs._common import Cog
class Tracking(Cog):
async def on_message(self, message: discord.Message):
author = message.author # ... | """
NSA-tier presence tracking.
"""
import datetime
import time
import discord
from discord import Status
from discord.ext import commands
from joku.bot import Context
from joku.cogs._common import Cog
class Tracking(Cog):
async def on_message(self, message: discord.Message):
author = message.author # ... | mit | Python |
0e6cf0f032ca8b8c48282eb16d8e1751c869494b | update error message validation | clach04/json-rpc,lorehov/json-rpc | jsonrpc/exceptions.py | jsonrpc/exceptions.py | import six
class JSONRPCError(object):
""" Error for JSON-RPC communication.
When a rpc call encounters an error, the Response Object MUST contain the
error member with a value that is a Object with the following members:
code: A Number that indicates the error type that occurred.
This MUST... | import six
class JSONRPCError(object):
""" Error for JSON-RPC communication.
When a rpc call encounters an error, the Response Object MUST contain the
error member with a value that is a Object with the following members:
code: A Number that indicates the error type that occurred.
This MUST... | mit | Python |
d8405b54d7fd2634582585bd420be0636d804eee | Bump version to 7.0.0a3 | genialis/resolwe,jberci/resolwe,genialis/resolwe,jberci/resolwe | resolwe/__about__.py | resolwe/__about__.py | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | apache-2.0 | Python |
0511ad666a22375afe14b89e94828d1bf3c746b7 | Add a way to handle multiple regex expression. (Used to exclude file, directory or path | funilrys/A-John-Shots | a_john_shots/regex.py | a_john_shots/regex.py | #!/usr/bin/env python
# python-regex - A simple implementation ot the python.re package
# Copyright (C) 2017 Funilrys - Nissar Chababy <contact at funilrys dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | !/usr/bin/env python
# python-regex - A simple implementation ot the python.re package
# Copyright (C) 2017 Funilrys - Nissar Chababy <contact at funilrys dot com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | mit | Python |
43bcd715a6008151a8856ecc25a3382a8df54532 | fix type in id__in refrences | lampwins/stackstorm-netbox | actions/lib/action.py | actions/lib/action.py |
from st2actions.runners.pythonrunner import Action
import requests
__all__ = [
'NetboxBaseAction'
]
class NetboxBaseAction(Action):
"""Base Action for all Netbox API based actions
"""
def __init__(self, config):
super(NetboxBaseAction, self).__init__(config)
def get(self, endpoint_uri... |
from st2actions.runners.pythonrunner import Action
import requests
__all__ = [
'NetboxBaseAction'
]
class NetboxBaseAction(Action):
"""Base Action for all Netbox API based actions
"""
def __init__(self, config):
super(NetboxBaseAction, self).__init__(config)
def get(self, endpoint_uri... | mit | Python |
b2b1cbebd26e82d7570e21f275fd279143125de7 | Fix version in docs conf. | SectorLabs/pytest-benchmark,ionelmc/pytest-benchmark,aldanor/pytest-benchmark,thedrow/pytest-benchmark | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinxcontrib.napoleon'
]
if os.getenv('SPELLCHECK'):
exten... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinxcontrib.napoleon'
]
if os.getenv('SPELLCHECK'):
exten... | bsd-2-clause | Python |
a2d49d61718ac9c772ae620d26fdb2af13284f0b | update copyright year | desec-io/desec-stack,desec-io/desec-stack,desec-io/desec-stack,desec-io/desec-stack | docs/conf.py | docs/conf.py | try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = None
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- ... | try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = None
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- ... | mit | Python |
3cd945aba394f1b094fa2e219a6f3db1704a770f | Change how we filter merges a bit. | Fifty-Nine/github_ebooks | Scraper.py | Scraper.py |
from github import Github, GithubException
import re
tag_mutex = re.compile(r'^([\w\- ]+):(.*)$', re.UNICODE)
class Scraper:
def __init__(self, db):
self.db = db
api_key = db.getConfigValue('api_key')
self.gh = Github(api_key)
self.gh.per_page = 10
def _filterCommit(self, message):
message ... |
from github import Github, GithubException
from random import randint
class Scraper:
def __init__(self, db):
self.db = db
api_key = db.getConfigValue('api_key')
self.gh = Github(api_key)
self.gh.per_page = 10
def _filterCommit(self, message):
message = message.strip()
return \
len... | mit | Python |
fe651b4ef790d9e2c3d180347aaf7be103325102 | update to 0.6.20 | wjo1212/aliyun-log-python-sdk | aliyun/log/version.py | aliyun/log/version.py | __version__ = '0.6.20'
USER_AGENT = 'log-python-sdk-v-' + __version__
API_VERSION = '0.6.0'
| __version__ = '0.6.19'
USER_AGENT = 'log-python-sdk-v-' + __version__
API_VERSION = '0.6.0'
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.