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 |
|---|---|---|---|---|---|---|---|---|
1d749cda064dccf04cf4ce3026d3533029d55aa3 | Bump version | microsoft/dpu-utils,microsoft/dpu-utils | python/setup.py | python/setup.py | import setuptools, os
if os.path.exists('../README.md'):
with open('../README.md') as f:
long_description = f.read()
else:
long_description = ""
setuptools.setup(
name='dpu_utils',
version='0.6.0',
license='MIT',
description='Python utilities used by Deep Procedural... | import setuptools, os
if os.path.exists('../README.md'):
with open('../README.md') as f:
long_description = f.read()
else:
long_description = ""
setuptools.setup(
name='dpu_utils',
version='0.5.2',
license='MIT',
description='Python utilities used by Deep Procedural... | mit | Python |
c8c667c26baaf0b1251605451860fd5be7fdcea0 | bump python sdk version to 0.1.3 | looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen,looker-open-source/sdk-codegen | python/setup.py | python/setup.py | # -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages # noqa: H301
NAME = "looker_sdk"
VERSION = "0.1.3"
REQUIRES = ["requests >= 2.22", "attrs", "cattrs"]
setup(
author="Looker Data Sciences, Inc.",
author_email="support@looker.com",
description="Looker API 3.1",... | # -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages # noqa: H301
NAME = "looker_sdk"
VERSION = "0.1.2"
REQUIRES = ["requests >= 2.22", "attrs", "cattrs"]
setup(
author="Looker Data Sciences, Inc.",
author_email="support@looker.com",
description="Looker API 3.1",... | mit | Python |
3af7f362e99fcee67ad4566be6c71fae6ea8f9ac | Update package metadata to CM 5 | justinhayes/cm_api,justinhayes/cm_api,justinhayes/cm_api | python/setup.py | python/setup.py | #! /usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... | #! /usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... | apache-2.0 | Python |
2b11768e1b5a434843ee40c5a81af7016edca823 | use django/static in debug mode | nnrcschmdt/helsinki,radio-helsinki-graz/pv,nnrcschmdt/helsinki,nnrcschmdt/helsinki,radio-helsinki-graz/pv,radio-helsinki-graz/pv | program/urls.py | program/urls.py | from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule
hosts_dict = {
'queryset': Host.objects.... | from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule
hosts_dict = {
'queryset': Host.objects.all(),
'template_object_name'... | unknown | Python |
a9a91fee994307ff04aebcc6de12e8fc8fe68d38 | Move imports to be made locally in bootstrap | 5monkeys/refabric | refabric/api.py | refabric/api.py | from functools import partial
__all__ = ['bootstrap', 'run', 'info']
def bootstrap():
"""
Add state- and role-tasks, i.e. app@live
Import blueprint libraries
"""
import fabric.state
from fabric.decorators import task
from .state import load_blueprints, apply_role_definitions
from .t... | from functools import partial
import fabric.state
from fabric.decorators import task
from .state import load_blueprints, apply_role_definitions
from .tasks import dispatch
from .operations import run
from .utils import info
__all__ = ['bootstrap', 'run', 'info']
def bootstrap():
"""
Add state- and role-tas... | mit | Python |
4485b65722645d6c9617b5ff4aea6d62ee8a9adf | Use the existing util.cli module | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | bumblebee_status/modules/contrib/optman.py | bumblebee_status/modules/contrib/optman.py | """Displays currently active gpu by optimus-manager
Requires the following packages:
* optimus-manager
"""
import core.module
import core.widget
import util.cli
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
... | """Displays currently active gpu by optimus-manager
Requires the following packages:
* optimus-manager
"""
import subprocess
import core.module
import core.widget
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
... | mit | Python |
8ff710834eb9ad9e2988c3adad7dba6712666fbe | Bump version. | cordmata/mediaampy | mediaamp/__init__.py | mediaamp/__init__.py | __version__ = '0.1.1'
from . import services, http, exceptions # noqa
# configuration variables
username = None
password = None
user_directory = 'mpx'
region = 'US1'
token_duration = 43200000 # 12 hours
token_idle_timeout = 14400000 # 4 hours
current_token = None
| __version__ = '0.1'
from . import services, http, exceptions # noqa
# configuration variables
username = None
password = None
user_directory = 'mpx'
region = 'US1'
token_duration = 43200000 # 12 hours
token_idle_timeout = 14400000 # 4 hours
current_token = None
| apache-2.0 | Python |
cc11bd4c6678e6ba2f69f6b89e6c07c95bea7ce5 | revert accidental commit | sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary | conary/repository/shimclient.py | conary/repository/shimclient.py | #
# Copyright (c) 2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... | #
# Copyright (c) 2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licen... | apache-2.0 | Python |
f4d56a6cf82a8329aae0e09059c397ad838ef129 | Add settings conditional for local settings | Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner | lot/discovery/settings.py | lot/discovery/settings.py | try:
# Local settings should probably be collected to project folder instead.
from lot.local_settings import *
except ImportError:
pass
try:
from discovery.local_settings import *
except ImportError:
pass
# This seems to help with some backward compatibility
import django
django.setup()
| bsd-3-clause | Python | |
b47c2408ab3c69d56535bbea1d337e6315082373 | clean gpio.py | Koheron/lase | lase/core/gpio.py | lase/core/gpio.py | class Gpio():
""" GPIO driver
http://www.xilinx.com/support/documentation/ip_documentation/axi_gpio/v2_0/pg144-axi-gpio.pdf
http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c-c
"""
def __init__(self, dvm, addr=int('0x41200000', 0),
map_size=16... | class Gpio():
""" GPIO driver
http://www.xilinx.com/support/documentation/ip_documentation/axi_gpio/v2_0/pg144-axi-gpio.pdf
http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c-c
"""
def __init__(self, dvm, addr = int('0x41200000',0),
map_size ... | mit | Python |
31b5e45692b1fc9b10affefa28dd198c27ac9deb | Remove logic from security.userid | usingnamespace/usingnamespace | usingnamespace/api/security/__init__.py | usingnamespace/api/security/__init__.py | import random
import string
from pyramid import security
from pyramid.security import (
Authenticated,
Everyone,
)
from pyramid.interfaces import (
IAuthenticationPolicy,
)
from pyramid.authorization import ACLAuthorizationPolicy
from .authentication import AuthPolicy
def user(request)... | import random
import string
from pyramid import security
from pyramid.security import (
Authenticated,
Everyone,
)
from pyramid.interfaces import (
IAuthenticationPolicy,
)
from pyramid.authorization import ACLAuthorizationPolicy
from .authentication import AuthPolicy
def user(request)... | isc | Python |
8992b41b3faf713eca1ba02d64db656440f81567 | Validate shortlink | vtemian/git-to-trello,vtemian/git-to-trello | tracker/trello_tracker.py | tracker/trello_tracker.py | import json
import re
from trello import TrelloApi
from flask import Blueprint, render_template, request
import requests
import config
tracker = Blueprint('tracker', __name__, 'templates')
@tracker.route('/tracker/change_label', methods=['GET'])
def trello():
return render_template('change_label.html')
@tracker.... | import json
import re
from trello import TrelloApi
from flask import Blueprint, render_template, request
import requests
import config
tracker = Blueprint('tracker', __name__, 'templates')
@tracker.route('/tracker/change_label', methods=['GET'])
def trello():
return render_template('change_label.html')
@tracker.... | mit | Python |
cec4812d1ba742d7193042584afb963409a5c8db | debug lib improve | tsvstar/finspector | my/debug.py | my/debug.py | # coding=utf8
import time
class Measure():
name = ''
def __init__( self, name='' ):
self.t1 = time.time()
self.name = name
if name:
print "Start %s"%name
def tick( self, name ):
t2 = time.time()
if not name:
name = 'tick'
print "%s %... | # coding=utf8
import time
class Measure():
name = ''
def __init__( self, name='' ):
self.t1 = time.time()
self.name = name
if name:
print "Start %s"%name
def tick( self, name ):
t2 = time.time()
if not name:
name = 'tick'
print "%s %... | mit | Python |
1bcba3bf0cb893947aebbf787caec303d5342d16 | remove nbterm from installed aps | SandstoneHPC/sandstone-ide,SandstoneHPC/sandstone-ide,SandstoneHPC/OIDE,ResearchComputing/OIDE,ResearchComputing/OIDE,ResearchComputing/OIDE,SandstoneHPC/OIDE,SandstoneHPC/sandstone-ide,SandstoneHPC/OIDE,ResearchComputing/OIDE | oide/settings.py | oide/settings.py | import os
import sys
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
# sys.path.insert(0,PROJECT_DIR)
# If USE_SSL is set to True, then both the SSL_CERT and SSL_KEY
# options need to be configured.
USE_SSL = False
# SSL_CERT = '/path/to/.pem'
# SSL_KEY = '/path/to/.pem'
# OIDE Core settings
DEBUG = True
LO... | import os
import sys
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
# sys.path.insert(0,PROJECT_DIR)
# If USE_SSL is set to True, then both the SSL_CERT and SSL_KEY
# options need to be configured.
USE_SSL = False
# SSL_CERT = '/path/to/.pem'
# SSL_KEY = '/path/to/.pem'
# OIDE Core settings
DEBUG = True
LO... | mit | Python |
9aefd0b7c2ec1b9557086672a4db5a37939772e5 | Fix flake8 | ggravlingen/pytradfri,ggravlingen/pytradfri,r41d/pytradfri,rubenbe/pytradfri,r41d/pytradfri,rubenbe/pytradfri | tests/test_smart_task.py | tests/test_smart_task.py | from pytradfri.const import (
ROOT_SMART_TASKS
)
from pytradfri.smart_task import SmartTask
from pytradfri.gateway import Gateway
# from datetime import (datetime as dt)
import datetime
TASK = {
'5850': 1,
'9002': 1492349682,
'9003': 317094,
'9040': 4,
'9041': 48,
'9042': {
... | from pytradfri.const import (
ATTR_NAME,
ROOT_SMART_TASKS
)
from pytradfri.smart_task import SmartTask
from pytradfri.gateway import Gateway
# from datetime import (datetime as dt)
import datetime
TASK = {
'5850': 1,
'9002': 1492349682,
'9003': 317094,
'9040': 4,
'9041': 48,
... | mit | Python |
7ad0e624e4bccab39b56152e9d4c6d5fba8dc528 | Allow modules that use dudebot to just import dudebot... | sujaymansingh/dudebot | dudebot/__init__.py | dudebot/__init__.py | from core import BotAI
from core import Connector
from decorators import message_must_begin_with
from decorators import message_must_begin_with_attr
from decorators import message_must_begin_with_nickname
| bsd-2-clause | Python | |
1e20872c6c04bc8157952db006e1e0060a466dc3 | Revert "test long line in ci" | gboeing/osmnx,gboeing/osmnx | osmnx/bearing.py | osmnx/bearing.py | """Calculate graph edge bearings."""
import math
import numpy as np
def get_bearing(origin_point, destination_point):
"""
Calculate the bearing between two lat-lng points.
Each tuple should represent (lat, lng) as decimal degrees.
Parameters
----------
origin_point : tuple
(lat, lng... | """Calculate graph edge bearings."""
import math
import numpy as np
def get_bearing(origin_point, destination_point):
"""
Calculate the bearing between two lat-lng points.
Each tuple should represent (lat, lng) as decimal degrees.
Parameters
----------
origin_point : tuple
(lat, lng... | mit | Python |
fdbf3b178ed96758a5134a6b86e38ba45cbbbc5b | Revert "Use fixture data in tests_files test" | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | tests/unit/test_files.py | tests/unit/test_files.py | from tests import PMGTestCase
import datetime
import pytz
from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee
from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData
# TODO: might have to mock S3
class TestFiles(PMGTestCase):
def setUp(self):
... | from tests import PMGTestCase
import datetime
import pytz
from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee
from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData
# TODO: might have to mock S3
class TestFiles(PMGTestCase):
def setUp(self):
... | apache-2.0 | Python |
438410a97a12402daa5b417d151d5c7152063f96 | Fix import cycle breakage | caibo2014/teuthology,t-miyamae/teuthology,t-miyamae/teuthology,ktdreyer/teuthology,yghannam/teuthology,dmick/teuthology,dreamhost/teuthology,ivotron/teuthology,SUSE/teuthology,dmick/teuthology,dreamhost/teuthology,yghannam/teuthology,SUSE/teuthology,robbat2/teuthology,michaelsevilla/teuthology,michaelsevilla/teuthology... | teuthology/lockstatus.py | teuthology/lockstatus.py | import json
import httplib2
import logging
log = logging.getLogger(__name__)
def _lock_url(ctx):
return ctx.teuthology_config['lock_server']
def send_request(method, url, body=None, headers=None):
http = httplib2.Http()
resp, content = http.request(url, method=method, body=body, headers=headers)
if r... | import json
import httplib2
import logging
log = logging.getLogger(__name__)
def _lock_url(ctx):
return ctx.teuthology_config['lock_server']
def send_request(method, url, body=None, headers=None):
http = httplib2.Http()
resp, content = http.request(url, method=method, body=body, headers=headers)
if r... | mit | Python |
acff983b906efdd21efeb3f11bcbf8cc314b65da | add comment re: mutation for call_after_every | jagill/treeano,diogo149/treeano,diogo149/treeano,jagill/treeano,nsauder/treeano,diogo149/treeano,jagill/treeano,nsauder/treeano,nsauder/treeano | canopy/handlers/conditional.py | canopy/handlers/conditional.py | from . import base
class CallAfterEvery(base.NetworkHandlerImpl):
"""
handler that calls a callback with the result of a function every few
calls
"""
def __init__(self, iters, callback):
self.iters = iters
self.callback = callback
self.count = 0
def call(self, fn, *a... | from . import base
class CallAfterEvery(base.NetworkHandlerImpl):
"""
handler that calls a callback with the result of a function every few
calls
"""
def __init__(self, iters, callback):
self.iters = iters
self.callback = callback
self.count = 0
def call(self, fn, *a... | apache-2.0 | Python |
a727f66ef92f1d97ef4d8bb7fcf4527c0a6afda2 | Fix linter | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/carto_vl/source.py | cartoframes/carto_vl/source.py | from __future__ import absolute_import
from .utils import defaults
from ..dataset import Dataset
import re
import geopandas
class Source(object):
"""CARTO VL Source:
Args:
- data.
- bounds (dict): Viewport bounds.
"""
def __init__(self, data, context=None, bounds=None):
... | from __future__ import absolute_import
from .utils import defaults
from ..dataset import Dataset
import re
import geopandas
class Source(object):
"""CARTO VL Source:
Args:
- data.
- bounds (dict): Viewport bounds.
"""
def __init__(self, data, context=None, bounds=None):
... | bsd-3-clause | Python |
0f9b06c1b8d19bca7fadaf81062e7908573e11f0 | Fix error in scripts CLI help | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/cli/script.py | dusty/cli/script.py | """Execute scripts defined in an app's spec inside a running app container.
Usage:
scripts <app_name> [<script_name>] [<args>...]
Options:
<args> Arguments to pass to the script
Examples:
To get information on all scripts available for an app called `website`:
dusty scripts website
To run the `rebuild`... | """Execute scripts defined in an app's spec inside a running app container.
Usage:
scripts <app_name> [<script_name>] [<args>...]
Options:
<args> Arguments to pass to the script
Examples:
To get information on all scripts available for an app called `website`:
dusty script website
To run the `rebuild` ... | mit | Python |
710d94f0b08b3d51fbcfda13050dc21e3d53f2e7 | Fix testcase for better coverage | yunity/yunity-core,yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend | yunity/resources/tests/integration/test_chat__add_invalid_user_to_chat_fails/request.py | yunity/resources/tests/integration/test_chat__add_invalid_user_to_chat_fails/request.py | from .initial_data import request_user, chatid
request = {
"endpoint": "/api/chats/{}/participants".format(chatid),
"method": "post",
"user": request_user,
"body": {
"users": [666666, 22]
}
}
| from .initial_data import request_user, chatid
request = {
"endpoint": "/api/chats/{}/participants".format(chatid),
"method": "post",
"user": request_user,
"body": {
"users": [666666]
}
}
| agpl-3.0 | Python |
0bd197588471aadfb2c71d9b096a2d199c48968a | Fix minor GYP error in webrtc/tools/internal_tools.gyp | Alkalyne/webrtctrunk,jchavanton/webrtc,jchavanton/webrtc,Alkalyne/webrtctrunk,Alkalyne/webrtctrunk,jchavanton/webrtc,aleonliao/webrtc-trunk,Alkalyne/webrtctrunk,aleonliao/webrtc-trunk,jchavanton/webrtc,Alkalyne/webrtctrunk,aleonliao/webrtc-trunk,jchavanton/webrtc,aleonliao/webrtc-trunk,jchavanton/webrtc,Alkalyne/webrtc... | tools/internal_tools.gyp | tools/internal_tools.gyp | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project a... | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project a... | bsd-3-clause | Python |
504a5c509201eaa186575de4f2fc3983c2874164 | Update to actually work | jmgao/skybot,rmmh/skybot,parkrrr/skybot | plugins/tarot.py | plugins/tarot.py | """
🔮 Spooky fortunes and assistance for witches
"""
import urllib
from util import hook, http
from urllib.error import HTTPError
@hook.command
def tarot(inp):
".tarot <cardname> -- finds a card by name"
try:
card = http.get_json("https://tarot-api.com/find/{search}", search=inp)
except HTTPError... | """
🔮 Spooky fortunes and assistance for witches
"""
from util import hook, http
from urllib.error import HTTPError
@hook.command
def tarot(inp):
".tarot <cardname> -- finds a card by name"
try:
card = http.get_json(
"https://tarot-api.com/find/" + inp
)
except HTTPError:
... | unlicense | Python |
3307bfb7075a527dc7805da2ff735f461f5fc02f | Change categories field to non required. | neosergio/allstars | employees/models.py | employees/models.py | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Role(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
ret... | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Role(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
ret... | mit | Python |
abfc4df5d92bc530209f7b9b7a0e68fe0477c7df | add exception subtypes for places we've been throwing TypeError or KeyError | informatics-isi-edu/ermrest,ini-bdds/ermrest,informatics-isi-edu/ermrest,ini-bdds/ermrest | src/exception/__init__.py | src/exception/__init__.py |
#
# Copyright 2012-2013 University of Southern California
#
# 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 applica... |
#
# Copyright 2012-2013 University of Southern California
#
# 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 applica... | apache-2.0 | Python |
8d8df46883f43e6f3bc2fb45f3aa4062950ae48f | Test /configure/ hook | SEC-i/ecoControl,SEC-i/ecoControl,SEC-i/ecoControl | server/tests.py | server/tests.py | import json
from django.test import TestCase, Client
from django.contrib.auth.models import User
from models import DeviceConfiguration
class APITestCase(TestCase):
@classmethod
def setUpClass(cls):
# Create test user for all tests
User.objects.create_user(
username="test_user",... | import json
from django.test import TestCase, Client
from django.contrib.auth.models import User
class APITestCase(TestCase):
@classmethod
def setUpClass(cls):
# Create test user for all tests
User.objects.create_user(
username="test_user", password="demo123", first_name="test_fn... | mit | Python |
faf40ce21a0f1b249e8067d3d77e334edfaeef41 | package cacert.pem, include certifi package as it is. | codito/pomito | setup_freeze.py | setup_freeze.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Freeze script for pomito."""
import os
import sys
import setup
import cx_Freeze
from setuptools import find_packages
from pre_build import build_qt, get_pyqt_install_root
# Build qt related resources
build_qt()
# Setup cx_Freeze packaging
# pylint: disable=invalid-n... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Freeze script for pomito."""
import os
import sys
import setup
import cx_Freeze
from setuptools import find_packages
from pre_build import build_qt, get_pyqt_install_root
# Build qt related resources
build_qt()
# Setup cx_Freeze packaging
# pylint: disable=invalid-n... | mit | Python |
6d0068b01ae55b2ed9519d6eedbf3c0e2d740e0b | fix about append integer | kyunooh/JellyBlog,kyunooh/JellyBlog,kyunooh/JellyBlog | lifeblog/tests.py | lifeblog/tests.py | from django.test import LiveServerTestCase, Client
from .models import Document
class DocumentTest(LiveServerTestCase):
def setUp(self):
self.test_public_doc = Document.objects.create(
title="DocumentTest Title",
content="DocumentTest Content content",
meta_tag="metamet... | from django.test import LiveServerTestCase, Client
from .models import Document
class DocumentTest(LiveServerTestCase):
def setUp(self):
self.test_public_doc = Document.objects.create(
title="DocumentTest Title",
content="DocumentTest Content content",
meta_tag="metamet... | apache-2.0 | Python |
fc7bdc195c77e7b65eff440324d2132df549dd8d | Use cached_property decorator on CachedTranslation | ulule/django-linguist | linguist/cache.py | linguist/cache.py | # -*- coding: utf-8 -*-
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import memoize, cached_property
def _get_translation_field_names():
from .models import Translation
fields = Translation._meta.get_all_field_names()
fields.remove('id')
return fields
... | # -*- coding: utf-8 -*-
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import memoize
def _get_translation_field_names():
from .models import Translation
fields = Translation._meta.get_all_field_names()
fields.remove('id')
return fields
get_translation_f... | mit | Python |
3784fd3f1d1d612523aaf8a888502946a5f46f02 | remove debug message | windy1/mentionedbot-py,windy1/mentionedbot-py | mentionedbot/util.py | mentionedbot/util.py | import string
import praw
import time
BLACKLIST_FILE = 'blacklist.txt'
def is_ignored(redditor):
"""
Returns true if the specified redditor is on the blacklist.
"""
username = redditor.name.lower()
# Make sure the user isn't in the blacklist
blacklist = load_list(BLACKLIST_FILE, ',')
if u... | import string
import praw
import time
BLACKLIST_FILE = 'blacklist.txt'
def is_ignored(redditor):
"""
Returns true if the specified redditor is on the blacklist.
"""
username = redditor.name.lower()
# Make sure the user isn't in the blacklist
blacklist = load_list(BLACKLIST_FILE, ',')
if u... | mit | Python |
9ef764bc704fd0fd667318db04f4b2ab331561f5 | Add module-level docstring to CUDA recursion usecases | cpcloud/numba,numba/numba,cpcloud/numba,numba/numba,cpcloud/numba,numba/numba,cpcloud/numba,numba/numba,numba/numba,cpcloud/numba | numba/cuda/tests/cudapy/recursion_usecases.py | numba/cuda/tests/cudapy/recursion_usecases.py | """
Usecases of recursive functions in the CUDA target, many derived from
numba/tests/recursion_usecases.py.
Some functions are compiled at import time, hence a separate module.
"""
from numba import cuda
@cuda.jit("i8(i8)", device=True)
def fib1(n):
if n < 2:
return n
# Note the second call does no... | from numba import cuda
@cuda.jit("i8(i8)", device=True)
def fib1(n):
if n < 2:
return n
# Note the second call does not use a named argument, unlike the CPU target
# usecase
return fib1(n - 1) + fib1(n - 2)
def make_fib2():
@cuda.jit("i8(i8)", device=True)
def fib2(n):
if n <... | bsd-2-clause | Python |
811bcbcf4daf6a1118eb898e4e55320c68ec5159 | Add dash in high memory message | jmmease/pandas,kdebrab/pandas,TomAugspurger/pandas,pratapvardhan/pandas,rs2/pandas,kdebrab/pandas,MJuddBooth/pandas,rs2/pandas,gfyoung/pandas,jmmease/pandas,gfyoung/pandas,datapythonista/pandas,kdebrab/pandas,jorisvandenbossche/pandas,GuessWhoSamFoo/pandas,Winand/pandas,jorisvandenbossche/pandas,TomAugspurger/pandas,jm... | pandas/conftest.py | pandas/conftest.py | import pytest
import numpy
import pandas
import pandas.util.testing as tm
def pytest_addoption(parser):
parser.addoption("--skip-slow", action="store_true",
help="skip slow tests")
parser.addoption("--skip-network", action="store_true",
help="skip network tests")
... | import pytest
import numpy
import pandas
import pandas.util.testing as tm
def pytest_addoption(parser):
parser.addoption("--skip-slow", action="store_true",
help="skip slow tests")
parser.addoption("--skip-network", action="store_true",
help="skip network tests")
... | bsd-3-clause | Python |
1b6fbf1a8c162ed0821378b9ae18376ab5419b2b | make staticfiles_urlpatterns as default in main url | unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal | backend/unpp_api/urls.py | backend/unpp_api/urls.py | from __future__ import absolute_import
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^api/admin/', include(admin.site.... | from __future__ import absolute_import
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
url(r'^api/admin/', include(admin.site.... | apache-2.0 | Python |
ea363926b971f15f564f66a0e91d1e2bb63a571f | check condition | amalshehu/exercism-python | pangram/pangram.py | pangram/pangram.py | # File: pangram.py
# Purpose: # Determine if a sentence is a pangram.
'''
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
"every letter") is a sentence using every letter of the alphabet at least once.
The best known English pangram is "The quick brown fox jumps over the lazy... | # File: pangram.py
# Purpose: # Determine if a sentence is a pangram.
'''
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
"every letter") is a sentence using every letter of the alphabet at least once.
The best known English pangram is "The quick brown fox jumps over the lazy... | mit | Python |
21589bc4772b9a3d91ab7c2bde089386c0cd8152 | Update __init__.py | hobson/pug,hobson/pug,hobson/pug,hobson/pug | pug/__init__.py | pug/__init__.py | # Copyright (C) 2012-2014 Hobson Lane <hobson@totalgood.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | # Copyright (C) 2012-2014 Hobson Lane <hobson@totalgood.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | mit | Python |
d110116a3741daaac204df24f10ea3ae58d6abc7 | add raw_format to Exporter classes | cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,cornhundr... | IPython/nbconvert/exporters/python.py | IPython/nbconvert/exporters/python.py | """Python script Exporter class"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------... | """
Python exporter which exports Notebook code into a PY file.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed... | bsd-3-clause | Python |
aacefea28d653f22fb46499697765efbc201f69b | Fix error handling for actions | openstack/python-tripleoclient | tripleoclient/exceptions.py | tripleoclient/exceptions.py | # Copyright 2013 Nebula 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... | # Copyright 2013 Nebula 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... | apache-2.0 | Python |
9fb7981d32ee19a8e609533091c0a6f4dd1f8b03 | Add cert_utils to test mocks | coreycb/charms.openstack | charms_openstack/test_mocks.py | charms_openstack/test_mocks.py | import sys
import mock
charmhelpers = None
apt_pkg = None
def mock_charmhelpers():
# Mock out charmhelpers so that we can test without it.
# also stops sideeffects from occuring.
global charmhelpers
global apt_pkg
charmhelpers = mock.MagicMock()
apt_pkg = mock.MagicMock()
sys.modules['apt... | import sys
import mock
charmhelpers = None
apt_pkg = None
def mock_charmhelpers():
# Mock out charmhelpers so that we can test without it.
# also stops sideeffects from occuring.
global charmhelpers
global apt_pkg
charmhelpers = mock.MagicMock()
apt_pkg = mock.MagicMock()
sys.modules['apt... | apache-2.0 | Python |
7d47a0b4b720053076616ccd2264dab4eb1423f8 | adjust sudo write call in the centos installer | eucalyptus/se34euca,eucalyptus/se34euca | etc/installer_se34euca_centos.py | etc/installer_se34euca_centos.py | #!/usr/bin/env python
import time
import sys
import os
def run_cmd(command):
print "CMD: " + command
print
os.system(command)
print
time.sleep(1)
return
def main():
print
print "===== INSTALLER FOR SE34EUCA ON CENTOS 6 ======"
print
cmd = "sudo yum -y update"
run_cmd(cmd)
cmd = "sudo yum -y install g... | #!/usr/bin/env python
import time
import sys
import os
def run_cmd(command):
print "CMD: " + command
print
os.system(command)
print
time.sleep(1)
return
def main():
print
print "===== INSTALLER FOR SE34EUCA ON CENTOS 6 ======"
print
cmd = "sudo yum -y update"
run_cmd(cmd)
cmd = "sudo yum -y install g... | bsd-2-clause | Python |
7ed23a9ac0f7e7939c11d934750fc50e37931efb | Update permissions for UserList and UserDetail views. | rcutmore/vinotes-api,rcutmore/vinotes-api | vinotes/apps/api/views.py | vinotes/apps/api/views.py | from django.contrib.auth.models import User
from rest_framework import generics, permissions
from .models import Note, Trait, Wine, Winery
from .serializers import NoteSerializer, TraitSerializer, WineSerializer, WinerySerializer, UserSerializer
class NoteList(generics.ListCreateAPIView):
"""
List all tasting... | from django.contrib.auth.models import User
from rest_framework import generics, permissions
from .models import Note, Trait, Wine, Winery
from .serializers import NoteSerializer, TraitSerializer, WineSerializer, WinerySerializer, UserSerializer
class NoteList(generics.ListCreateAPIView):
"""
List all tasting... | unlicense | Python |
b8bc10e151f12e2bfe2c03765a410a04325a3233 | Change the is_producttype template tag to return a boolean rather than a string. | Ryati/satchmo,ringemup/satchmo,Ryati/satchmo,dokterbob/satchmo,twidi/satchmo,twidi/satchmo,dokterbob/satchmo,ringemup/satchmo | satchmo/product/templatetags/satchmo_product.py | satchmo/product/templatetags/satchmo_product.py | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | bsd-3-clause | Python |
a6b14b0dbfb792ad88d6b698a98aef7c3b040cd5 | make block_on resilient to exceptions raised by switch() | tempbottle/eventlet,lindenlab/eventlet,collinstocks/eventlet,collinstocks/eventlet,tempbottle/eventlet,lindenlab/eventlet,lindenlab/eventlet | eventlet/twistedutil/__init__.py | eventlet/twistedutil/__init__.py | from twisted.internet import defer
from twisted.python import failure
from eventlet.support.greenlet import greenlet
from eventlet import greenlib
from eventlet.api import get_hub, spawn
def block_on(deferred):
cur = [greenlet.getcurrent()]
def cb(value):
if cur:
greenlib.switch(cur[0], val... | from twisted.internet import defer
from twisted.python import failure
from eventlet.support.greenlet import greenlet
from eventlet import greenlib
from eventlet.api import get_hub, spawn
def block_on(deferred):
cur = greenlet.getcurrent()
def cb(value):
greenlib.switch(cur, value)
def eb(err):
... | mit | Python |
55cadccab5a830e102654ab63a6b4f4c1c04df9b | remove get_pg_conn | fr0der1c/EveryClass-server,fr0der1c/EveryClass-server,fr0der1c/EveryClass-server,fr0der1c/EveryClass-server | everyclass/server/db/postgres.py | everyclass/server/db/postgres.py | from contextlib import contextmanager
import psycopg2
import psycopg2.extensions
import psycopg2.pool
from flask import current_app, has_app_context
from everyclass.server.config import get_config
_config = get_config()
_options = f'-c search_path={_config.POSTGRES_SCHEMA}'
def init_pool(current_application) -> No... | from contextlib import contextmanager
import psycopg2
import psycopg2.extensions
import psycopg2.pool
from flask import current_app, has_app_context
from everyclass.server.config import get_config
_config = get_config()
_options = f'-c search_path={_config.POSTGRES_SCHEMA}'
def init_pool(current_application) -> No... | mpl-2.0 | Python |
e4a93a8ffefc1f60162f9ee50bb7ec90a09025a9 | Define new urls | n2o/guhema,n2o/guhema | products/urls.py | products/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^maschinensaegeblatt/$', views.sawblades, {'title': "Maschinensägeblätter"}, name='sawblades'),
url(r'^maschinensaegeblatt/(?P<clamping>[\w-]+)/(?P<slug>[\w-]+)/$', vie... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^maschinensaegeblatt/$', views.sawblades, name='sawblades'),
url(r'^maschinensaegeblatt/(?P<clamping>[\w-]+)/(?P<slug>[\w-]+)/$', views.sawblade, name='sawblade'),
] | mit | Python |
8a0749cc3025bec75c4bec4c829735207ee6cd59 | Bump version | ForeverWintr/metafunctions | metafunctions/__init__.py | metafunctions/__init__.py | __version__ = '1.1.0'
from metafunctions.api import (node, bind_call_state, star, store, recall, concurrent, mmap,
locate_error)
| __version__ = '1.0.1'
from metafunctions.api import (node, bind_call_state, star, store, recall, concurrent, mmap,
locate_error)
| mit | Python |
b4247769fcaa67d09e0f38d1283cf4f28ddc350e | Fix typo and improve grammar in doc string | michaeljoseph/cookiecutter,dajose/cookiecutter,audreyr/cookiecutter,hackebrot/cookiecutter,audreyr/cookiecutter,hackebrot/cookiecutter,luzfcb/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,pjbull/cookiecutter,luzfcb/cookiecutter,michaeljoseph/cookiecutter | cookiecutter/extensions.py | cookiecutter/extensions.py | # -*- coding: utf-8 -*-
"""Jinja2 extensions."""
import json
from jinja2.ext import Extension
class JsonifyExtension(Extension):
"""Jinja2 extension to convert a Python object to JSON."""
def __init__(self, environment):
"""Initialize the extension with the given environment."""
super(Json... | # -*- coding: utf-8 -*-
"""Jinja2 extensions."""
import json
from jinja2.ext import Extension
class JsonifyExtension(Extension):
"""Jinja2 extension to convert a python object to json."""
def __init__(self, environment):
"""Initilize extension with given environment."""
super(JsonifyExtens... | bsd-3-clause | Python |
7056ba9f7a1262d067116c423115721cf0045151 | Remove support for importing 'pre' module | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/re.py | Lib/re.py | """Minimal "re" compatibility wrapper"""
# To help us fix any remaining bugs in the new engine, please
# report what went wrong. You can either use the following web
# page:
#
# http://sourceforge.net/bugs/?group_id=5470
#
# or send a mail to SRE's author:
#
# Fredrik Lundh <effbot@telia.com>
#
# Make sure to i... | """Minimal "re" compatibility wrapper"""
# If your regexps don't work well under 2.0b1, you can switch
# to the old engine ("pre") down below.
#
# To help us fix any remaining bugs in the new engine, please
# report what went wrong. You can either use the following web
# page:
#
# http://sourceforge.net/bugs/?grou... | mit | Python |
fabe5992744c37f2383b0e67672b9269fbf6cace | Upgrade pymake version | jpanikulam/experiments,jpanikulam/experiments,jpanikulam/experiments,jpanikulam/experiments | pymake/setup.py | pymake/setup.py | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.7.2',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.7.1',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | mit | Python |
42ec5ed6d56fcc59c99d175e1c9280d00cd3bef1 | Add known offset for known bad calibration. | jason-neal/eniric,jason-neal/eniric | tests/test_published_results.py | tests/test_published_results.py |
""" To test if the new code produces the same precision values on the published results."""
from __future__ import division, print_function
import pytest
import numpy as np
import eniric.Qcalculator as Q
import eniric.IOmodule as IO
from bin.prec_1 import calc_prec1
# For python2.X compatibility
file_error_to_catch... |
""" To test if the new code produces the same precision values on the published results."""
from __future__ import division, print_function
import pytest
import numpy as np
import eniric.Qcalculator as Q
import eniric.IOmodule as IO
from bin.prec_1 import calc_prec1
# For python2.X compatibility
file_error_to_catch... | mit | Python |
7017a6d38dffd3145946a12b8c7c89da89740b9d | Fix broken tests, because of the models change | Hackfmi/Diaphanum,Hackfmi/Diaphanum | reports/tests.py | reports/tests.py | from django.test import client, TestCase
from members.models import User
from datetime import time
from .models import Report
from protocols.models import Topic, Institution, Protocol
client = client.Client()
class ReportTest(TestCase):
def setUp(self):
self.kril = User.objects.create(
user... | from django.test import client, TestCase
from members.models import User
from .models import Report
from protocols.models import Topic
client = client.Client()
class ReportTest(TestCase):
def setUp(self):
self.kril = User.objects.create(
username='Kril',
faculty_number='61277',
... | mit | Python |
543493bb926ac3e3dc14f976f2be026808eedf37 | Move unused fixture argument to module level mark | msurdi/cutepaste,msurdi/cutepaste,msurdi/cutepaste | cutepaste/tests/browser_test.py | cutepaste/tests/browser_test.py | import pytest
from django.urls import reverse
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from cutepaste.tests.marks import slow
pytestmark = pytest.mark.usefixtures("data_files")
@slow
def tes... | from django.urls import reverse
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from cutepaste.tests.marks import slow
@slow
def test_index(live_server, webdriver, data_files):
webdriver.get(liv... | apache-2.0 | Python |
59d94b30cf6f3b1641925686dfa567ac03900ccd | include py and image files for builtin models | SasView/sasmodels,SasView/sasmodels,SasView/sasmodels,SasView/sasmodels | sasmodels/__init__.py | sasmodels/__init__.py | """
sasmodels
=========
**sasmodels** is a package containing models for small angle neutron and xray
scattering. Models supported are the one dimensional circular average and
two dimensional oriented patterns. As well as the form factor calculations
for the individual shapes **sasmodels** also provides automatic sh... | """
sasmodels
=========
**sasmodels** is a package containing models for small angle neutron and xray
scattering. Models supported are the one dimensional circular average and
two dimensional oriented patterns. As well as the form factor calculations
for the individual shapes **sasmodels** also provides automatic sh... | bsd-3-clause | Python |
85c02344447f7fa434fe28ec3cbd747af21c846e | Make params optional | nerevu/riko,nerevu/riko | modules/pipeurlbuilder.py | modules/pipeurlbuilder.py | # pipeurlbuilder.py
#
import urllib
from pipe2py import util
def pipe_urlbuilder(_INPUT, conf, verbose=False, **kwargs):
"""This source builds a url and yields it forever.
Keyword arguments:
_INPUT -- not used
conf:
BASE -- base
PATH -- path elements
PARAM -- query paramet... | # pipeurlbuilder.py
#
import urllib
from pipe2py import util
def pipe_urlbuilder(_INPUT, conf, verbose=False, **kwargs):
"""This source builds a url and yields it forever.
Keyword arguments:
_INPUT -- not used
conf:
BASE -- base
PATH -- path elements
PARAM -- query paramet... | mit | Python |
df30c67d6c558a41e212f5b73800f5cd3603aaf4 | add aliases for basic types | mylokin/schematec | schematec/__init__.py | schematec/__init__.py | '''
Schematec
=========
Schematec is a set of tools that brings some static typing into Python and
makes input data validation easier. The purpose of this code is attempt to
bring simplicity to applications logics using separation of data validation
and actual data processing.
Concepts
--------
Schematec separates c... | '''
Schematec
=========
Schematec is a set of tools that brings some static typing into Python and
makes input data validation easier. The purpose of this code is attempt to
bring simplicity to applications logics using separation of data validation
and actual data processing.
Concepts
--------
Schematec separates c... | mit | Python |
f0fd709ba5a392e3e21978ed60182f161b2ed0ae | Add static file URL hash. | why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado,why2pac/dp-tornado | engine/plugin/static.py | engine/plugin/static.py | #
# dp for Tornado
# YoungYong Park (youngyongpark@gmail.com)
# 2014.10.28
#
import tornado.web
from engine.model import InValueModelConfig as dpInValueModelConfig
class StaticURL(tornado.web.UIModule):
compiled = {}
cache_config = dpInValueModelConfig(driver='sqlite', database='static_url_compiled', pur... | #
# dp for Tornado
# YoungYong Park (youngyongpark@gmail.com)
# 2014.10.28
#
import tornado.web
class StaticURL(tornado.web.UIModule):
def render(self, *static_urls, **options):
html = []
for path in static_urls:
extension = path.split('.')[-1]
if extension == 'css':
... | mit | Python |
43a6428b3aba5a92d3f8ea87b4ac5e38cd6e3f55 | fix access control for shared cases | Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout | scout/server/utils.py | scout/server/utils.py | # -*- coding: utf-8 -*-
from functools import wraps
from flask import render_template, request, abort, flash
from flask_login import current_user
def templated(template=None):
"""Template decorator.
Ref: http://flask.pocoo.org/docs/patterns/viewdecorators/
"""
def decorator(f):
@wraps(f)
... | # -*- coding: utf-8 -*-
from functools import wraps
from flask import render_template, request, abort, flash
from flask_login import current_user
def templated(template=None):
"""Template decorator.
Ref: http://flask.pocoo.org/docs/patterns/viewdecorators/
"""
def decorator(f):
@wraps(f)
... | bsd-3-clause | Python |
1a2bd12acd6877a7f894cf97c6fc778f7530dbad | add profile iface definition | Zex/juicemachine,Zex/juicemachine,Zex/juicemachine | python/basic.py | python/basic.py | #!/usr/bin/python
# basic.py
# Common definition
#
# Author: Zex <top_zlynch@yahoo.com>
#
JM_SERVICE_NAME = "org.juicemachine"
JM_PROFILE_IFACE = "jm.profile.iface"
JM_DEV_IFACE = "org.juicemachine.dev.iface"
JM_JSON_IFACE = "org.juicemachine.json.iface"
JM_CONFIG_PATH = "/org/juicemachine/conf... | #!/usr/bin/python
# basic.py
# Common definition
#
# Author: Zex <top_zlynch@yahoo.com>
#
JM_SERVICE_NAME = "org.juicemachine"
JM_DEV_IFACE = "org.juicemachine.dev.iface"
JM_JSON_IFACE = "org.juicemachine.json.iface"
JM_CONFIG_PATH = "/org/juicemachine/config"
JM_NAME_IFACE = "org.juicemach... | mit | Python |
4bdc80e90812f752c036386509880fe51fce6a64 | Fix pascal voc loader | keras-team/keras-cv,keras-team/keras-cv,keras-team/keras-cv | keras_cv/loaders/__init__.py | keras_cv/loaders/__init__.py | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | Python |
92bdae3582879a5507f5591f1310a9578d5fd8c5 | insert github URL into setup.py | shikigit/python-phonenumbers,dongguangming/python-phonenumbers,SergiuMir/python-phonenumbers,daviddrysdale/python-phonenumbers,titansgroup/python-phonenumbers,gencer/python-phonenumbers,agentr13/python-phonenumbers,daviddrysdale/python-phonenumbers,daodaoliang/python-phonenumbers,daviddrysdale/python-phonenumbers,roube... | python/setup.py | python/setup.py | #!/usr/bin/env python
# Original libphonenumber Java code:
# Copyright (C) 2009 Google 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
#... | #!/usr/bin/env python
# Original libphonenumber Java code:
# Copyright (C) 2009 Google 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
#... | apache-2.0 | Python |
c3d1ca821c72803532da1be3d4eb6a5d6e38a58b | Add post-mortem debugging option to cli | mirnylab/pairsamtools | pairsamtools/__init__.py | pairsamtools/__init__.py | # -*- coding: utf-8 -*-
"""
pairsamtools
~~~~~~~~~~~~
CLI tools to process mapped Hi-C data
:copyright: (c) 2017 Massachusetts Institute of Technology
:author: Mirny Lab
:license: MIT
"""
__version__ = '0.0.1-dev'
import click
import functools
import sys
CONTEXT_SETTINGS = {
'help_option_names': ['-h', '--he... | # -*- coding: utf-8 -*-
"""
pairsamtools
~~~~~~~~~~~~
CLI tools to process mapped Hi-C data
:copyright: (c) 2017 Massachusetts Institute of Technology
:author: Mirny Lab
:license: MIT
"""
__version__ = '0.0.1-dev'
import click
import functools
CONTEXT_SETTINGS = {
'help_option_names': ['-h', '--help'],
}
@c... | mit | Python |
a3d362127e5c3802188f000cc278cb57cf690c0e | Make sure atom-shell is build before creating distribution. | aliib/electron,ankitaggarwal011/electron,beni55/electron,leolujuyi/electron,nekuz0r/electron,LadyNaggaga/electron,destan/electron,thomsonreuters/electron,farmisen/electron,jacksondc/electron,aaron-goshine/electron,oiledCode/electron,MaxWhere/electron,bpasero/electron,Andrey-Pavlov/electron,yan-foto/electron,sshiting/el... | script/create-dist.py | script/create-dist.py | #!/usr/bin/env python
import errno
import glob
import os
import shutil
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
BUNDLE_NAME = 'Atom.app'
BUNDLE_DIR = os.path.join(SOURCE_ROOT, 'out', 'Re... | #!/usr/bin/env python
import errno
import glob
import os
import shutil
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
BUNDLE_NAME = 'Atom.app'
BUNDLE_DIR = os.path.join(SOURCE_ROOT, 'out', 'Re... | mit | Python |
3b33cdd29a357773948833588ea7acbe624de460 | Bump other version | openeventdata/mordecai | mordecai/__init__.py | mordecai/__init__.py | from .geoparse import Geoparser
__version__ = "2.0.1"
| from .geoparse import Geoparser
__version__ = "2.0.0a6"
| mit | Python |
ce87d659a7b94f35aaeed78f12176c06f34ef2e4 | Make examples work on Windows (#10206) | yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/find/_help.py | src/azure-cli/azure/cli/command_modules/find/_help.py | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | mit | Python |
70904e563da70a095c15e32b342a4ac18db07d53 | Update doc string | atmtools/typhon,atmtools/typhon | typhon/spareice/__init__.py | typhon/spareice/__init__.py | # -*- coding: utf-8 -*-
"""Implementation of SPARE-ICE
This is a reimplementation of the toolkit developed by Gerit Holl for atmlab.
TODO: Extend documentation and credits.
"""
__all__ = [s for s in dir() if not s.startswith('_')]
| # -*- coding: utf-8 -*-
"""All SPARE-ICE related modules."""
__all__ = [s for s in dir() if not s.startswith('_')]
| mit | Python |
ecd50a463642fe84474a70ec0da123305285e71d | Remove debug | danfairs/django-parting | testproject/testapp/models.py | testproject/testapp/models.py | from django.db import models
from django.utils import timezone
from parting import PartitionForeignKey, PartitionManager
from dateutil.relativedelta import relativedelta
def _key_from_dt(dt):
return dt.strftime('%Y_%m')
class CustomManager(models.Manager):
def my_custom_method(self):
return u'hi!'
... | from django.db import models
from django.utils import timezone
try:
from parting import PartitionForeignKey, PartitionManager
except ImportError:
print('Hoo!')
raise
from dateutil.relativedelta import relativedelta
def _key_from_dt(dt):
return dt.strftime('%Y_%m')
class CustomManager(models.Manager)... | bsd-3-clause | Python |
f3df3b2b8e1167e953457a85f2297d28b6a39729 | Include path_params in override constructor | andymitchhank/bessie | examples/Micro.Blog/microblog.py | examples/Micro.Blog/microblog.py | from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', path_params=None, token=''):
self.token = token
super(self.__class__, self).__init__(path... | from getpass import getpass
from bessie import BaseClient
import config
class MicroBlogApi(BaseClient):
endpoints = config.available_endpoints
separator = '/'
base_url='https://micro.blog'
def __init__(self, path='', token=''):
self.token = token
super(self.__class__, self).__init__(path, token=token)
#... | mit | Python |
19f50e1cdc3ec7f9617a6d4315ba3b0d9352e38e | Use oslo_config IPOpt support | ArchiFleKs/magnum,openstack/magnum,openstack/magnum,ArchiFleKs/magnum,dimtruck/magnum,dimtruck/magnum,jay-lau/magnum | magnum/api/app.py | magnum/api/app.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
# di... | # 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
# di... | apache-2.0 | Python |
387b07aceae837860210e52ecfb0a2b8ce376fa5 | Add global entity registry | clchiou/iga,clchiou/iga,clchiou/iga,clchiou/iga | iga/env.py | iga/env.py | __all__ = [
'current',
'enter_child_env',
'root',
# Global registry.
'register',
'find',
]
import contextlib
import logging
from collections import ChainMap
from iga.core import WriteOnceDict
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
_ROOT = ChainMap(WriteOnc... | __all__ = [
'current',
'root',
'enter_child_env',
]
import contextlib
from collections import ChainMap
from iga.core import WriteOnceDict
_ROOT = ChainMap(WriteOnceDict())
def current():
"""Return the current env object."""
return current.current
current.current = _ROOT
@contextlib.context... | mit | Python |
c9980756dcee82cc570208e73ec1a2112aea0155 | Add weakref assertion in test case | alexandreleroux/mayavi,dmsurti/mayavi,dmsurti/mayavi,alexandreleroux/mayavi,liulion/mayavi,liulion/mayavi | tvtk/tests/test_scene.py | tvtk/tests/test_scene.py | """ Tests for the garbage collection of Scene objects.
"""
# Authors: Deepak Surti, Ioannis Tziakos
# Copyright (c) 2015, Enthought, Inc.
# License: BSD Style.
import unittest
import weakref
import gc
from traits.etsconfig.api import ETSConfig
from tvtk.pyface.scene import Scene
from tvtk.tests.common import restore... | """ Tests for the garbage collection of Scene objects.
"""
# Authors: Deepak Surti, Ioannis Tziakos
# Copyright (c) 2015, Enthought, Inc.
# License: BSD Style.
import unittest
import weakref
import gc
from traits.etsconfig.api import ETSConfig
from tvtk.pyface.scene import Scene
from tvtk.tests.common import restore... | bsd-3-clause | Python |
55ecaca919172d834aecdf7c504ea78c21f2a5a6 | improve eval_imagenet | chainer/chainercv,chainer/chainercv,yuyu2172/chainercv,pfnet/chainercv,yuyu2172/chainercv | examples/classification/eval_imagenet.py | examples/classification/eval_imagenet.py | import argparse
import random
import numpy as np
import chainer
import chainer.links as L
import chainer.functions as F
from chainer import iterators
from chainer import training
from chainer.training import extensions
from chainercv.datasets import ImageFolderDataset
from chainercv.links import VGG16Layers
from ch... | import argparse
import random
import numpy as np
import chainer
import chainer.links as L
from chainer import iterators
from chainer import training
from chainer.training import extensions
from chainercv.datasets import ImageFolderDataset
from chainercv.links import VGG16Layers
def main():
parser = argparse.Ar... | mit | Python |
cb41c52625c7181db357cef6c0fdb30cec52cce2 | Remove unused variable alphas from the LARS example. (#9882) | amueller/scikit-learn,scikit-learn/scikit-learn,huzq/scikit-learn,clemkoa/scikit-learn,bnaul/scikit-learn,lesteve/scikit-learn,BiaDarkia/scikit-learn,zorroblue/scikit-learn,anntzer/scikit-learn,xuewei4d/scikit-learn,vortex-ape/scikit-learn,sergeyf/scikit-learn,huzq/scikit-learn,zorroblue/scikit-learn,clemkoa/scikit-lea... | examples/linear_model/plot_lasso_lars.py | examples/linear_model/plot_lasso_lars.py | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause | Python |
e884c3ffc23935561349648fcf4f742ae321d07e | fix typo | sassoftware/mirrorball,sassoftware/mirrorball | updatebot/cmdline/simple.py | updatebot/cmdline/simple.py | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | apache-2.0 | Python |
017b52e21e6dd1dbf3f95d6898748e66a4fff85e | fix user input | ImWalkinHere/Calculator | bin/calculator.py | bin/calculator.py | """calculator
Perform calculations on the command line
"""
import argparse
def main():
"""Main function"""
args = parse_args()
user_input = input('> ')
while user_input != 'q':
if args.rpn:
# Do RPN calculation
# rpn(user_input)
pass
else:
... | """calculator
Perform calculations on the command line
"""
import argparse
def main():
"""Main function"""
args = parse_args()
user_input = None
while user_input != 'q':
user_input = input('> ')
if args.rpn:
# Do RPN calculation
# rpn(user_input)
... | lgpl-2.1 | Python |
74b2883c3371304e8f5ea95b0454fb006d85ba3d | Remove leading and trailing slash of MEDIA_URL | Anaethelion/django-mapentity,Anaethelion/django-mapentity,makinacorpus/django-mapentity,makinacorpus/django-mapentity,Anaethelion/django-mapentity,makinacorpus/django-mapentity | mapentity/urls.py | mapentity/urls.py | from django.conf import settings
from django.conf.urls import patterns, url
from . import app_settings
from .views import (map_screenshot, convert, history_delete,
serve_secure_media, JSSettings)
_MEDIA_URL = settings.MEDIA_URL.replace(app_settings['ROOT_URL'], '')
if _MEDIA_URL.startswith('/'):
... | from django.conf import settings
from django.conf.urls import patterns, url
from . import app_settings
from .views import (map_screenshot, convert, history_delete,
serve_secure_media, JSSettings)
_MEDIA_URL = settings.MEDIA_URL.replace(app_settings['ROOT_URL'], '')[1:]
urlpatterns = patterns(
... | bsd-3-clause | Python |
3e9ca2d5251e74f786da62d507a77960f19d5c18 | Fix #763 | alephobjects/Cura,alephobjects/Cura,alephobjects/Cura | scripts/linux/cura.py | scripts/linux/cura.py | #!/usr/bin/python
import os, sys
sys.path.insert(1, os.path.dirname(__file__))
try:
import OpenGL
import wx
import serial
import numpy
import power
except ImportError as e:
if e.message[0:16] == 'No module named ':
module = e.message[16:]
if module == 'OpenGL':
module = 'PyOpenGL'
elif module == 'ser... | #!/usr/bin/python
import os, sys
sys.path.insert(1, os.path.dirname(__file__))
try:
import OpenGL
import wx
import serial
import numpy
import power
except ImportError as e:
if e.message[0:16] == 'No module named ':
module = e.message[16:]
if module == 'OpenGL':
module = 'PyOpenGL'
elif... | agpl-3.0 | Python |
47ee8ca7dfa33309d4d4afd25fc99b5ebf0d8559 | Change match model toString | leventebakos/football-ech,leventebakos/football-ech | matches/models.py | matches/models.py | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from leagues.models import League
class Match(models.Model):
COUNTRY_CHOICES = (
('AL', "Albania"),
('AT', "Austria"),
('BE', "Belgium"),
('HR', "Croatia"),
('CZ', "Czech"),
('EN', "England"),
... | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from leagues.models import League
class Match(models.Model):
COUNTRY_CHOICES = (
('AL', "Albania"),
('AT', "Austria"),
('BE', "Belgium"),
('HR', "Croatia"),
('CZ', "Czech"),
('EN', "England"),
... | mit | Python |
b9996cd9bff44417fca9d8dbd38fbae419dc7e28 | set up a root logger | Hitechverma/zamboni,tsl143/zamboni,spasovski/zamboni,Nolski/olympia,ingenioustechie/zamboni,mozilla/olympia,mozilla/addons-server,tsl143/addons-server,ddurst/zamboni,harry-7/addons-server,mstriemer/zamboni,mrrrgn/olympia,jasonthomas/zamboni,ngokevin/zamboni,mrrrgn/olympia,clouserw/zamboni,Joergen/olympia,shahbaz17/zamb... | log_settings.py | log_settings.py | import logging
import logging.handlers
from django.conf import settings
# Loggers created under the "z" namespace, e.g. "z.caching", will inherit the
# configuration from the base z logger.
log = logging.getLogger('z')
level = settings.LOG_LEVEL
base_fmt = ('%(name)s:%(levelname)s %(message)s '
':%(path... | import logging
import logging.handlers
from django.conf import settings
# Loggers created under the "z" namespace, e.g. "z.caching", will inherit the
# configuration from the base z logger.
log = logging.getLogger('z')
level = settings.LOG_LEVEL
base_fmt = ('[%(REMOTE_ADDR)s] %(name)s:%(levelname)s %(message)s '
... | bsd-3-clause | Python |
b785e6dbee4027a9d79825596cd3605ac999791f | fix models in initial.py | bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base | initial.py | initial.py | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | mit | Python |
4cde7c1c651647214d73bf6e42a9051960228af6 | Fix RenderPDFs on Android Review URL: https://codereview.appspot.com/7306057 | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,Tiger66639/skia-buildbo... | slave/skia_slave_scripts/android_render_pdfs.py | slave/skia_slave_scripts/android_render_pdfs.py | #!/usr/bin/env python
# Copyright (c) 2012 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.
""" Run the Skia render_pdfs executable. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from... | #!/usr/bin/env python
# Copyright (c) 2012 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.
""" Run the Skia render_pdfs executable. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from... | bsd-3-clause | Python |
ca8bf8ae3ff28c3e50e7e512e626e25c6cc86bc5 | Fix spelling mistake. | rosedu/robocheck,theostoican/robocheck,theostoican/robocheck,theostoican/robocheck,rosedu/robocheck,rosedu/robocheck | platforms/Linux.py | platforms/Linux.py | """ Linux.py
General description:
This module contains the Linux class, which implements Linux
platform specific functions.
(C) 2013, Andrei Tuicu <andrei.tuicu@gmail.com>
last review 20.11.2013
"""
import platform
import subprocess
import getpass
import os
import zipfile
class Li... | """ Linux.py
General description:
This module contains the Linux class, which implements Linux
platform specific functions.
(C) 2013, Andrei Tuicu <andrei.tuicu@gmail.com>
last review 20.11.2013
"""
import platform
import subprocess
import getpass
import os
import zipfile
class Li... | bsd-3-clause | Python |
063185f7ed8366cbc7b1455a0b5c00ea39ded92f | Convert gaphor/UML/usecases/tests/test_extend.py | amolenaar/gaphor,amolenaar/gaphor | gaphor/UML/usecases/tests/test_extend.py | gaphor/UML/usecases/tests/test_extend.py | """Test extend item connections."""
from gaphor import UML
from gaphor.UML.usecases.extend import ExtendItem
from gaphor.UML.usecases.usecase import UseCaseItem
class TestExtendItem:
def test_use_case_glue(self, case):
"""Test "extend" gluing to use cases."""
uc1 = case.create(UseCaseItem, UML.U... | """Test extend item connections."""
from gaphor import UML
from gaphor.tests import TestCase
from gaphor.UML.usecases.extend import ExtendItem
from gaphor.UML.usecases.usecase import UseCaseItem
class ExtendItemTestCase(TestCase):
def test_use_case_glue(self):
"""Test "extend" gluing to use cases."""
... | lgpl-2.1 | Python |
863c000963d7555082cc4f82b889e1eb6be0e3b6 | Add docstring comment to page_not_found in views | paulaylingdev/blogsite,paulaylingdev/blogsite | blogsite/views.py | blogsite/views.py | """The views of the blogsite application."""
from flask import Blueprint, render_template
from sqlalchemy import desc
from .models import Post, Tag
# Creating the views blueprint
views = Blueprint('views', __name__)
@views.route('/')
def index():
"""The index page route."""
posts = Post.query.order_by(desc(P... | """The views of the blogsite application."""
from flask import Blueprint, render_template
from sqlalchemy import desc
from .models import Post, Tag
# Creating the views blueprint
views = Blueprint('views', __name__)
@views.route('/')
def index():
"""The index page route."""
posts = Post.query.order_by(desc(P... | mit | Python |
737711a276f1a931c3efa75e07e2d4297d921ded | Fix slack webhook to report submission type | pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2016 | pyconcz_2016/proposals/slack.py | pyconcz_2016/proposals/slack.py | import json
import urllib.request
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.timezone import now
def notify_slack(sender, instance, created, *args, **kwargs):
if not created or settings.DEBUG or not settings.SLACK_WEBHOOK:
return
title = instance.... | import json
import urllib.request
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.timezone import now
def notify_slack(sender, instance, created, *args, **kwargs):
if not created or settings.DEBUG or not settings.SLACK_WEBHOOK:
return
title = instance.... | mit | Python |
6161a48b0852b2c4b0cc028718b397f36afea467 | fix work order | iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP | work_order/__openerp__.py | work_order/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... | agpl-3.0 | Python |
1c578367e864ebaec0b84286229b88fdf996aafe | Use plain formatter | incorrectusername/coala-bears,madhukar01/coala-bears,Shade5/coala-bears,ankit01ojha/coala-bears,incorrectusername/coala-bears,meetmangukiya/coala-bears,coala/coala-bears,Shade5/coala-bears,LWJensen/coala-bears,incorrectusername/coala-bears,madhukar01/coala-bears,Asnelchristian/coala-bears,Vamshi99/coala-bears,Shade5/co... | bears/lua/LuaLintBear.py | bears/lua/LuaLintBear.py | from coalib.bearlib.abstractions.Linter import linter
@linter(executable='luacheck',
use_stdin=True,
output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): (?P<message>.+)')
class LuaLintBear:
"""
Checks the code with ``luacheck``.
"""
@staticmethod
def cr... | from coalib.bearlib.abstractions.Linter import linter
@linter(executable='luacheck',
use_stdin=True,
output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): (?P<message>.+)')
class LuaLintBear:
"""
Checks the code with ``luacheck``.
"""
@staticmethod
def cr... | agpl-3.0 | Python |
a073067ece2af57cb6a52e924f8b3cedf78ce781 | fix extract to go to HPatches Dir | lenck/vlb,lenck/vlb,lenck/vlb | python/dset/hpatches_dataset.py | python/dset/hpatches_dataset.py | from dset.dataset import SequenceDataset
import urllib
import tarfile
import os
import sys
if sys.version_info[0] >= 3:
from urllib.request import urlretrieve
else:
from urllib import urlretrieve
class HPatches_Dataset(SequenceDataset):
def __init__(self,root_dir = './datasets/', download_flag = False):... | from dataset import SequenceDataset
import urllib
import tarfile
import os
import sys
if sys.version_info[0] >= 3:
from urllib.request import urlretrieve
else:
from urllib import urlretrieve
class HPatches_Dataset(SequenceDataset):
def __init__(self,root_dir = './datasets/', download_flag = False):
... | bsd-2-clause | Python |
4123ccfba5d3ffb7507c28363683af9e98fbcbf4 | fix flake8 | phovea/generator-phovea,phovea/generator-phovea,phovea/generator-phovea,phovea/generator-phovea,phovea/generator-phovea | generators/_init-python/templates/plain/build.py | generators/_init-python/templates/plain/build.py | import shutil
from codecs import open
import json
__author__ = 'Samuel Gratzl'
def _git_head(cwd):
import subprocess
try:
output = subprocess.check_output(['git', 'rev-parse', '--verify', 'HEAD'], cwd=cwd)
return output.strip()
except subprocess.CalledProcessError:
return 'error'
def _resolve_plu... | import shutil
from codecs import open
import json
__author__ = 'Samuel Gratzl'
def _git_head(cwd):
import subprocess
try:
output = subprocess.check_output(['git', 'rev-parse', '--verify', 'HEAD'], cwd=cwd)
return output.strip()
except subprocess.CalledProcessError:
return 'error'
def _resolve_plu... | bsd-3-clause | Python |
6953b831c3c48a3512a86ca9e7e92edbf7a62f08 | Add correct setUp/tearDown methods for integration sqs test | MA3STR0/AsyncAWS | tests/integration/test_sqs.py | tests/integration/test_sqs.py | import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
from random import randint
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
aws_test_account_id = "637085312181"
class TestSQS(AsyncTestCase):
... | import os
from asyncaws import SQS
from tornado.testing import AsyncTestCase, gen_test
aws_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_key_secret = os.environ['AWS_SECRET_ACCESS_KEY']
aws_region = os.environ['AWS_REGION']
class TestSQS(AsyncTestCase):
sqs = SQS(aws_key_id, aws_key_secret, aws_region, async=Fals... | mit | Python |
180e574471d449cfb3500c720741b36008917ec0 | Include admin in example project. | opencorato/sayit,opencorato/sayit,opencorato/sayit,opencorato/sayit | example_project/urls.py | example_project/urls.py | import re
import sys
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Admin section
from django.contrib import admin
admin.autodiscover()
urlpatterns = staticfiles_urlp... | import re
import sys
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Admin section
from django.contrib import admin
admin.autodiscover()
urlpatterns = staticfiles_urlp... | agpl-3.0 | Python |
9f411ec083317b28ca37d36417697a491f980cd0 | Add global LexicalID.SELF reference | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/lexer/symbols/base.py | thinglang/lexer/symbols/base.py | from thinglang.utils.type_descriptors import ValueType
from thinglang.lexer.symbols import LexicalSymbol
class LexicalQuote(LexicalSymbol): # "
EMITTABLE = False
@classmethod
def next_operator_set(cls, current, original):
if current is original:
return {'"': LexicalQuote}
ret... | from thinglang.utils.type_descriptors import ValueType
from thinglang.lexer.symbols import LexicalSymbol
class LexicalQuote(LexicalSymbol): # "
EMITTABLE = False
@classmethod
def next_operator_set(cls, current, original):
if current is original:
return {'"': LexicalQuote}
ret... | mit | Python |
b9280a8df36c81f0b6a21ab451828c629a26ae19 | Set version | eliostvs/django-kb-example,eliostvs/django-kb-example,eliostvs/django-kb-example | example/__init__.py | example/__init__.py | from __future__ import unicode_literals
__version__ = '0.1.0'
| bsd-3-clause | Python | |
93688bd2ef06fc8e56f06cb291b9e29d61dedc6f | Fix #10 | Geequlim/godot-themes | install.py | install.py | #!/usr/bin/env python
import os
import sys
import json
import fnmatch
import shutil
import platform
cwd = os.getcwd()
meta = json.load(open(os.path.join(cwd, "theme.json")))
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnma... | #!/usr/bin/env python
import os
import sys
import json
import fnmatch
import shutil
import platform
cwd = os.getcwd()
meta = json.load(open(os.path.join(cwd, "theme.json")))
def globPath(path, pattern):
result = []
for root, subdirs, files in os.walk(path):
for filename in files:
if fnma... | mit | Python |
0df353ce0ce7f854f7cfb492a97ec1b7596d16c8 | Move to py.test tests. | wlonk/django_url_bits | tests/test_django_url_bits.py | tests/test_django_url_bits.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django_url_bits
----------------------------------
Tests for `django_url_bits` module.
"""
# from django_url_bits import django_url_bits
def test_000_something():
pass
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django_url_bits
----------------------------------
Tests for `django_url_bits` module.
"""
import unittest
from django_url_bits import django_url_bits
class TestDjango_url_bits(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | isc | Python |
f0686744d9cab69a175ff48694a735256c4bebf8 | Update comments | Xaril/sentence-extractor,Xaril/sentence-extractor | sentence_extractor.py | sentence_extractor.py | import textract
import sys
import os
import re
import random
###################################
# Extracts text from one or more
# pdf file and selects one sentence
# from each, which the program then
# prints.
#
# Created by Fredrik Omstedt.
###################################
# Extracts texts from pdf files. If gi... | import textract
import sys
import os
import re
import random
###################################
# Extracts text from a pdf file and
# selects one sentence, which it
# then prints.
#
# Created by Fredrik Omstedt.
###################################
# Extracts texts from pdf files. If given a directory, the
# program ... | mit | Python |
e097bcc2f920edcd89952d737993539618b39e7b | Fix deprecation warning | pinax/pinax-comments,pinax/pinax-comments,eldarion/dialogos | pinax/comments/models.py | pinax/comments/models.py | from datetime import datetime
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
@python_2_unicode_compatible
class Com... | from datetime import datetime
from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
@python_2_unicode_compatible
class Com... | mit | Python |
8a7659ca9e76c6827a2acde0cd519ef6c7c0f1df | Test saw tooth time series | tleeuwenburg/wordgraph,tleeuwenburg/wordgraph | tests/test_simple_features.py | tests/test_simple_features.py | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_linear_values():... | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_linear_values():... | apache-2.0 | Python |
1c090892e91761f70fb695c609b5a8c497d023d8 | rename the decorated view to avoid an internal server error when decorating more than one view | datavisyn/tdp_core,datavisyn/tdp_core,datavisyn/tdp_core,datavisyn/tdp_core | tdp_core/security.py | tdp_core/security.py | from phovea_server.security import login_required
from .formatter import formatter
from .db import resolve_view
# custom login_required decorator to be able to disable the login for DBViews, i.e. to make them public
def tdp_login_required(func):
def decorated_view(*args, **kwargs):
if kwargs['view_name'] is not ... | from phovea_server.security import login_required
from .formatter import formatter
from .db import resolve_view
# custom login_required decorator to be able to disable the login for DBViews, i.e. to make them public
def tdp_login_required(func):
def decorated_view(*args, **kwargs):
if kwargs['view_name'] is not ... | bsd-3-clause | Python |
7f63a8c78fdd5e22b5cf8c81f76d7aeace3dd3e5 | allow spaces in user name in profile url | MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock,MuckRock/muckrock | muckrock/accounts/urls.py | muckrock/accounts/urls.py | """
URL mappings for the accounts application
"""
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.decorators import login_required
import django.contrib.auth.views as auth_views
import accounts.views
urlpatterns = patterns('',
url(r'^login/$', auth_views.login, name='acct... | """
URL mappings for the accounts application
"""
from django.conf.urls.defaults import patterns, url
from django.contrib.auth.decorators import login_required
import django.contrib.auth.views as auth_views
import accounts.views
urlpatterns = patterns('',
url(r'^login/$', auth_views.login, name='acct... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.