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 |
|---|---|---|---|---|---|---|---|---|
efd425c49f9730f3d00a3e9fcc01f03fcd6a482f | implement company serializer | teamworkquality/twq-app,teamworkquality/twq-app,tassolom/twq-app,tassolom/twq-app,teamworkquality/twq-app,tassolom/twq-app,tassolom/twq-app,teamworkquality/twq-app | api/companies/serializers.py | api/companies/serializers.py | from rest_framework import serializers
from .models import Company
from .models import Team
class CompanySerializer(serializers.ModelSerializer):
class Meta:
model = Company
fields = '__all__'
class TeamSerializer(serializers.ModelSerializer):
class Meta:
model = Team
fields... | from rest_framework import serializers
from .models import Company
from .models import Team
class CompanySerializer(serializers.ModelSerializer):
pass
class TeamSerializer(serializers.ModelSerializer):
class Meta:
model = Team
fields = '__all__' | mit | Python |
6ec0807163404d034ca6978eb1c9bd12a9b5ecbf | Add failure if there are multiple jars with sources | googleinterns/dagger-query,googleinterns/dagger-query,googleinterns/dagger-query,googleinterns/dagger-query | project/src/com/google/daggerquery/dagger_query_textproto.bzl | project/src/com/google/daggerquery/dagger_query_textproto.bzl | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
8278da2e22bc1a10ada43585685aa4a0841d14c5 | Make sure generated usernames are unique. | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | apps/bluebottle_utils/tests.py | apps/bluebottle_utils/tests.py | import uuid
from django.contrib.auth.models import User
class UserTestsMixin(object):
""" Mixin base class for tests requiring users. """
def create_user(self, username=None, password=None):
""" Create, save and return a new user. """
# If no username is set, create a random unique username... | import uuid
from django.contrib.auth.models import User
class UserTestsMixin(object):
""" Mixin base class for tests requiring users. """
def create_user(self, username=None, password=None):
""" Create, save and return a new user. """
if not username:
# Generate a random usernam... | bsd-3-clause | Python |
fa427d340d8ddc9a9577563d999c975a926693a9 | correct grid for example | kingjr/ecoggui | examples/gui_mri_ecog.py | examples/gui_mri_ecog.py | from nilearn.image import crop_img
import numpy as np
from ecoggui import ElectrodeGUI
fname = 'T1_post_deface.nii.gz'
niimg = crop_img(fname) # to automatically zoom on useful voxels
# We know we have a 4x4 grid of ecog channels, separated by 10 mm.
xy = np.meshgrid(np.linspace(0, 30, 4), np.linspace(0, 40, 5))
xy ... | from nilearn.image import crop_img
import numpy as np
from ecoggui import ElectrodeGUI
fname = 'T1_post_deface.nii.gz'
niimg = crop_img(fname) # to automatically zoom on useful voxels
# We know we have a 4x4 grid of ecog channels, separated by 10 mm.
xy = np.meshgrid(np.linspace(0, 30, 4), np.linspace(0, 30, 4))
xy ... | bsd-2-clause | Python |
ea250cdd086059ea7976a38c8e94cb4a39709357 | Call the setup_request page method too in generic views replacements | mjl/feincms,matthiask/django-content-editor,pjdelport/feincms,hgrimelid/feincms,nickburlett/feincms,mjl/feincms,matthiask/feincms2-content,michaelkuty/feincms,joshuajonah/feincms,michaelkuty/feincms,matthiask/feincms2-content,feincms/feincms,hgrimelid/feincms,mjl/feincms,matthiask/django-content-editor,pjdelport/feincm... | feincms/views/decorators.py | feincms/views/decorators.py | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps
from feincms.models import Page
def add_page_to_extra_context(view_func):
def inner(request, *args, **kwargs):
kwargs.setdefault('extra_context', {})
kwargs['extra_context']['feincms_page'] = Pa... | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps
from feincms.models import Page
def add_page_to_extra_context(view_func):
def inner(request, *args, **kwargs):
kwargs.setdefault('extra_context', {})
kwargs['extra_context']['feincms_page'] = Pa... | bsd-3-clause | Python |
3b237b7bd6d0b0de96a150111fd2615ef7a307ee | create auth token on user registration | smn/onadata,sounay/flaminggo-test,ultimateprogramer/formhub,spatialdev/onadata,GeoODK/onadata,eHealthAfrica/formhub,mainakibui/kobocat,makinacorpus/formhub,piqoni/onadata,awemulya/fieldsight-kobocat,GeoODK/formhub,eHealthAfrica/formhub,ehealthafrica-ci/onadata,jomolinare/kobocat,kobotoolbox/kobocat,GeoODK/onadata,hnjam... | main/models/user_profile.py | main/models/user_profile.py | from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy
from utils.country_field import COUNTRIES
from utils.gravatar import get_gravatar_img_link, gravatar_exists
from django.db.models.signals import post_save
from rest_framework.authtoken.models impo... | from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy
from utils.country_field import COUNTRIES
from utils.gravatar import get_gravatar_img_link, gravatar_exists
from django.db.models.signals import post_save
class UserProfile(models.Model):
# ... | bsd-2-clause | Python |
d1a868ab1ac8163828479e61d1d3efcae127543b | Remove code which worked around a Django bug which is fixed in 1.8+ | mlavin/fileapi,mlavin/fileapi,mlavin/fileapi | fileapi/tests/test_qunit.py | fileapi/tests/test_qunit.py | import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import modify_settings
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver... | import os
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import modify_settings
from django.utils.functional import empty
from selenium import webdriver
from selenium.webdriver.comm... | bsd-2-clause | Python |
b6c44e90df31c42137a80a64f6069056b16e3239 | Make bcrypt work with Unicode passwords | UltrosBot/Ultros,UltrosBot/Ultros | plugins/auth/crypto/algo_bcrypt.py | plugins/auth/crypto/algo_bcrypt.py | # coding=utf-8
import bcrypt
from kitchen.text.converters import to_bytes
from plugins.auth.crypto.algo_base import BaseAlgorithm
__author__ = 'Gareth Coles'
class BcryptAlgo(BaseAlgorithm):
def check(self, hash, value, salt=None):
return hash == self.hash(value, hash)
def hash(self, value, salt):
... | # coding=utf-8
from plugins.auth.crypto.algo_base import BaseAlgorithm
import bcrypt
__author__ = 'Gareth Coles'
class BcryptAlgo(BaseAlgorithm):
def check(self, hash, value, salt=None):
return hash == self.hash(value, hash)
def hash(self, value, salt):
return bcrypt.hashpw(
va... | artistic-2.0 | Python |
f6b0bf03d3e3f76a45ff797902ef353d37cd924a | Update max_equality.py | timotheus/python-patterns | exercise/max_equality.py | exercise/max_equality.py | """
Maximum equality
================
Your colleague Beta Rabbit, top notch spy and saboteur, has been working tirelessly to discover a way to break into Professor Boolean's lab and rescue the rabbits being held inside. He has just excitedly informed you of a breakthrough - a secret bridge that leads over a moat (like... | """
Maximum equality
================
Your colleague Beta Rabbit, top notch spy and saboteur, has been working tirelessly to discover a way to break into Professor Boolean's lab and rescue the rabbits being held inside. He has just excitedly informed you of a breakthrough - a secret bridge that leads over a moat (like... | unlicense | Python |
5cd1ae92176c9b754578685db364c4ab2cc7086e | Simplify calling of unittests by using call_command in run_tests.py | uhuramedia/django-lean,MontmereLimited/django-lean,MontmereLimited/django-lean,uhuramedia/django-lean,e-loue/django-lean,uhuramedia/django-lean,MontmereLimited/django-lean,e-loue/django-lean | experiments/tests/run_tests.py | experiments/tests/run_tests.py | from django.conf import settings
class SimpleEngagementCalculator(object):
def calculate_user_engagement_score(self, user, start_date, end_date):
return 0
if __name__ == '__main__':
settings.configure(
ROOT_URLCONF=None,
LEAN_ENGAGEMENT_CALCULATOR=(
'experiments.tests.ru... | from django.conf import settings
class SimpleEngagementCalculator(object):
def calculate_user_engagement_score(self, user, start_date, end_date):
return 0
if __name__ == '__main__':
settings.configure(
ROOT_URLCONF=None,
LEAN_ENGAGEMENT_CALCULATOR=(
'experiments.tests.ru... | bsd-3-clause | Python |
c5a118d3ed7e88bf41cc73b8fac39db002ab73ed | add Approximate_solvers to make_pdf.py | maojrs/riemann_book,maojrs/riemann_book,maojrs/riemann_book | make_pdf.py | make_pdf.py | """
Convert notebooks listed in `chapters` into latex and then a PDF.
Note:
- The notebooks are first copied into the build_pdf directory (with a chapter
number prepended).
"""
import re
import subprocess
import os
chapters = ['Preface',
'Introduction',
'Traffic_flow',
'Shallo... | """
Convert notebooks listed in `chapters` into latex and then a PDF.
Note:
- The notebooks are first copied into the build_pdf directory (with a chapter
number prepended).
"""
import re
import subprocess
import os
chapters = ['Preface',
'Introduction',
'Traffic_flow',
'Shallo... | bsd-3-clause | Python |
fc9933934c3fdde49f501c3b819985ef86a0d114 | Remove unnecessary __class__ | di/flask-accept | flask_accept/__init__.py | flask_accept/__init__.py | import functools
from flask import request
from werkzeug.exceptions import NotAcceptable
class Acceptor(object):
mimetypes = []
use_fallback = False
def __init__(self, func):
"""Initialize a new Acceptor and create the accept handlers
:param func: the endpoint function to fall back upon... | import functools
from flask import request
from werkzeug.exceptions import NotAcceptable
class Acceptor(object):
mimetypes = []
use_fallback = False
def __init__(self, func):
"""Initialize a new Acceptor and create the accept handlers
:param func: the endpoint function to fall back upon... | mit | Python |
83f606e50b2a2ba2f283434d6449a46ad405e548 | Fix bad call to superclass method | elasticsales/flask-mongorest,DropD/flask-mongorest,elasticsales/flask-mongorest,DropD/flask-mongorest | flask_mongorest/utils.py | flask_mongorest/utils.py | import json
import decimal
import datetime
from bson.dbref import DBRef
from bson.objectid import ObjectId
from mongoengine.base import BaseDocument
isbound = lambda m: getattr(m, 'im_self', None) is not None
class MongoEncoder(json.JSONEncoder):
def default(self, value, **kwargs):
if isinstance(value, Ob... | import json
import decimal
import datetime
from bson.dbref import DBRef
from bson.objectid import ObjectId
from mongoengine.base import BaseDocument
isbound = lambda m: getattr(m, 'im_self', None) is not None
class MongoEncoder(json.JSONEncoder):
def default(self, value, **kwargs):
if isinstance(value, Ob... | bsd-3-clause | Python |
11947dfc52a38634885f8471ffd02699acbc0eb8 | create one password generator function | hobbes-the-tiger/YARPG | yarpg.py | yarpg.py | #!/usr/bin/python
#
# yarpg.py - Yet Another Random Password Generator
#
# Usage: yarpg.py -L <length> -n <numofpasswords> -t [complex|alphanumeric]
#
import getopt
import random
import string
import sys
# Set the default values
DEFAULT_PWLEN=15
DEFAULT_NUMPW=1
TYPE_ALPHA = 1
TYPE_COMPLEX = 2
TYPE_BOTH = 3
r = random... | #!/usr/bin/python
#
# yarpg.py - Yet Another Random Password Generator
#
# Usage: yarpg.py -L <length> -n <numofpasswords> -t [complex|alphanumeric]
#
import getopt
import random
import string
import sys
# Set the default values
DEFAULT_PWLEN=15
DEFAULT_NUMPW=1
TYPE_ALPHA = 1
TYPE_COMPLEX = 2
TYPE_BOTH = 3
r = random... | bsd-2-clause | Python |
c6e237ee9902922eb357ceff0bd8191778cc700e | comment for get_rendering_cache_key() | edoburu/django-fluent-contents,ixc/django-fluent-contents,ixc/django-fluent-contents,ixc/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,jpotterm/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,jpo... | fluent_contents/cache.py | fluent_contents/cache.py | """
Functions for caching.
"""
def get_rendering_cache_key(placeholder_name, contentitem):
"""
Return a cache key for the content item output.
.. seealso::
The :func:`ContentItem.clear_cache() <fluent_contents.models.ContentItem.clear_cache>` function
can be used to remove the cache keys ... | """
Functions for caching.
"""
def get_rendering_cache_key(placeholder_name, contentitem):
"""
Return a cache key for the content item output.
.. seealso::
The :func:`ContentItem.clear_cache() <fluent_contents.models.ContentItem.clear_cache>` function
can be used to remove the cache keys ... | apache-2.0 | Python |
9fb17d4612fa250ebce09334cd8141ac071532cc | Add utility for address change functionality testing | Miceuz/rs485-moist-sensor,Miceuz/rs485-moist-sensor | utils/addressTest.py | utils/addressTest.py | #!/usr/bin/python
"""Looks for sensor with ADDRESS1 and changes it's address to ADDRESS2 then changes it back to ADDRESS1"""
import minimalmodbus
import serial
from time import sleep
ADDRESS1 = 1
ADDRESS2 = 2
minimalmodbus.CLOSE_PORT_AFTER_EACH_CALL = True
minimalmodbus.PARITY=serial.PARITY_NONE
minimalmodbus.STOPB... | #!/usr/bin/python
import minimalmodbus
from time import sleep
ADDRESS1 = 1
ADDRESS2 = 2
minimalmodbus.CLOSE_PORT_AFTER_EACH_CALL = True
sensor = minimalmodbus.Instrument('/dev/ttyUSB5', slaveaddress=ADDRESS1)
print("writing new address: " + str(ADDRESS2))
sensor.write_register(0, value=ADDRESS2, functioncode=6)
sleep... | apache-2.0 | Python |
2d75d3c4dec3b4d56156e1a8c34e8a7f5cf3c09c | remove old boilerplate from markdown and rst stock code | tLDP/python-tldp,tLDP/python-tldp,tLDP/python-tldp | tldp/doctypes/example.py | tldp/doctypes/example.py | #! /usr/bin/python
# -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import logging
from tldp.doctypes.common import BaseDoctype
logger = logging.getLogger(__name__)
class Frobnitz(BaseDoctype):
formatname = 'Frobnitz'
extensions = ['.fb']
signatures = ['{{Frobnit... | #! /usr/bin/python
# -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
import logging
from tldp.doctypes.common import BaseDoctype
logger = logging.getLogger(__name__)
class Frobnitz(BaseDoctype):
formatname = 'Frobnitz'
extensions = ['.fb']
signatures = ['{{Frobnit... | mit | Python |
7729c1c3bd2a6a3afea5fcbd535f920da26c99fa | Bump version | icook/potter | potter/__init__.py | potter/__init__.py | __version__ = "0.2.1"
| __version__ = "0.2.0"
| isc | Python |
0e1dd74c70a2fa682b3cd3b0027162ad50ee9998 | Put in a raise for status for now | TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution | social/app/views/friend.py | social/app/views/friend.py | from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from social.app.models.author import Author
class FriendRequestsListView(generic.ListView):
context_object_name = "all_friend_requests"
template_name = "app/friend_requests_list.html"
def get_qu... | from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from social.app.models.author import Author
class FriendRequestsListView(generic.ListView):
context_object_name = "all_friend_requests"
template_name = "app/friend_requests_list.html"
def get_qu... | apache-2.0 | Python |
e5eecd76aa154033cf79b70a38a9d65c28e65c8c | Replace @script_args with @argument | etgalloway/powershellmagic | powershellmagic.py | powershellmagic.py | """IPython magics for Windows PowerShell.
"""
import atexit
import os
from subprocess import Popen, PIPE
import sys
import tempfile
from IPython.core.magic import (cell_magic, Magics, magics_class)
from IPython.core.magic_arguments import (
argument, magic_arguments, parse_argstring)
@magics_class
class PowerSh... | """IPython magics for Windows PowerShell.
"""
import atexit
import os
from subprocess import Popen, PIPE
import sys
import tempfile
from IPython.core.magic import (cell_magic, Magics, magics_class)
from IPython.core.magics.script import script_args
from IPython.core.magic_arguments import (magic_arguments, parse_args... | bsd-3-clause | Python |
c8096d8cf4bc806f4fe0a47de416a68fa82213bd | Sort API files response by descending timestamp | virtool/virtool,virtool/virtool,igboyes/virtool,igboyes/virtool | virtool/api/files.py | virtool/api/files.py | """
Provides request handlers for managing and viewing files.
"""
import os
import pymongo
import virtool.db.files
import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response, not_found, paginate
routes = virtool.http.routes.Routes()
@routes.get("/api/files")
async def find(req):
... | """
Provides request handlers for managing and viewing files.
"""
import os
import virtool.db.files
import virtool.http.routes
import virtool.utils
from virtool.api.utils import json_response, not_found, paginate
routes = virtool.http.routes.Routes()
@routes.get("/api/files")
async def find(req):
"""
Find ... | mit | Python |
0947dd555c5b52c28a0dfbf9bd11b2ee41977b22 | Fix compatibility with python 3.3 #169 | jazzband/sorl-thumbnail,gregplaysguitar/sorl-thumbnail,einvalentin/sorl-thumbnail,MatthewWilkes/sorl-thumbnail,mcenirm/sorl-thumbnail,lampslave/sorl-thumbnail,leture/sorl-thumbnail,JordanReiter/sorl-thumbnail,perdona/sorl-thumbnail,Resmin/sorl-thumbnail,Resmin/sorl-thumbnail,chriscauley/sorl-thumbnail,seedinvest/sorl-t... | sorl/thumbnail/compat.py | sorl/thumbnail/compat.py | import django
import sys
__all__ = ['json', 'BufferIO', 'urlopen', 'URLError']
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if django.VERSION <= (1, 5):
from django.utils import simplejson as json
else:
import json
try:
from io import BytesIO as BufferIO
except ImportError:
from cStr... | import django
import sys
__all__ = ['json', 'BufferIO', 'urlopen', 'URLError']
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if django.VERSION <= (1, 5):
from django.utils import simplejson as json
else:
import json
try:
from io import BytesIO as BufferIO
except ImportError:
from cStr... | bsd-3-clause | Python |
714a2cf162134afb108863acc7d1afedb3d639ae | Enable sass source comments | Pulsevoid/django-libsass,MidAtlanticPortal/django-libsass,apocquet/django-libsass | django_libsass.py | django_libsass.py | from django.conf import settings
from django.contrib.staticfiles.finders import get_finders
import sass
from compressor.filters.base import FilterBase
SOURCE_COMMENTS = getattr(settings, 'LIBSASS_SOURCE_COMMENTS', settings.DEBUG)
def get_include_paths():
"""
Generate a list of include paths that libsass sho... | from django.contrib.staticfiles.finders import get_finders
import sass
from compressor.filters.base import FilterBase
def get_include_paths():
"""
Generate a list of include paths that libsass should use to find files
mentioned in @import lines.
"""
include_paths = []
# Look for staticfile fi... | bsd-3-clause | Python |
c913f68a8664cb1bc49d67216c48ec12330bf8f8 | fix error in exception handler when response has no data | yunity/foodsaving-backend,yunity/yunity-core,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend | foodsaving/utils/misc.py | foodsaving/utils/misc.py | from json import dumps as dump_json
from rest_framework.views import exception_handler
def json_stringify(data):
"""
:type data: object
:rtype: str
"""
return dump_json(data, sort_keys=True, separators=(',', ':')).encode("utf-8") if data else None
def custom_exception_handler(exc, context):
... | from json import dumps as dump_json
from rest_framework.views import exception_handler
def json_stringify(data):
"""
:type data: object
:rtype: str
"""
return dump_json(data, sort_keys=True, separators=(',', ':')).encode("utf-8") if data else None
def custom_exception_handler(exc, context):
... | agpl-3.0 | Python |
fddbf7dc72f98aa184d5597fc0ab366058a5a357 | add default count tests | testingbot/testingbotclient | test_client.py | test_client.py | import os
import unittest
import uuid
import testingbotclient
class TestTestingBotClient(unittest.TestCase):
def setUp(self):
self.tb = testingbotclient.TestingBotClient()
def test_get_user_information(self):
self.assertTrue(self.tb.user.get_user_information()['first_name'])
def test_upl... | import os
import unittest
import uuid
import testingbotclient
class TestTestingBotClient(unittest.TestCase):
def setUp(self):
self.tb = testingbotclient.TestingBotClient()
def test_get_user_information(self):
self.assertTrue(self.tb.user.get_user_information()['first_name'])
def test_upl... | mit | Python |
ec13a77bf0f3601b096cd50e0f210b7a39290b75 | fix for python3 | Scony/python-junit | junit/__init__.py | junit/__init__.py | # -*- coding: utf-8 -*-
from . import testCase
from . import testSuite
from . import testReport
class TestCase(testCase.TestCase):
pass
class TestSuite(testSuite.TestSuite):
pass
class TestReport(testReport.TestReport):
pass
| # -*- coding: utf-8 -*-
import testCase
import testSuite
import testReport
class TestCase(testCase.TestCase):
pass
class TestSuite(testSuite.TestSuite):
pass
class TestReport(testReport.TestReport):
pass
| mit | Python |
340ee4894b83046ed8c4d2cb934fc702ee2d1902 | modify global | sancao2/openyoudao,justzx2011/openyoudao,irwinlove/openyoudao,irwinlove/openyoudao,sancao2/openyoudao,justzx2011/openyoudao | gl.py | gl.py | import os
import sys
import sqlite3
global keywordtext
global downloadwait
global baseurl
global lock
global prebaseurl
global homedir
global datadir
global historydir
global origindir
global resultdir
global url
global homeurl
global headyoudao
global bodystartyoudao
global bodystarticb
global bodyendicb
global headic... | import os
import sys
import sqlite3
global keywordtext
global downloadwait
global baseurl
global lock
global prebaseurl
global homedir
global datadir
global historydir
global origindir
global resultdir
global url
global homeurl
global headyoudao
global bodystartyoudao
global bodystarticb
global bodyendicb
global headic... | mit | Python |
319faf98284eeae93dcbd300abaddc22dce81f84 | Update help message | davesque/go.py | go.py | go.py | #!/usr/bin/env python
import argparse
import sys
from go import Board, BoardError, View, clear, getch
def main():
# Get arguments
parser = argparse.ArgumentParser(description='Starts a game of go in the terminal.')
parser.add_argument('-s', '--size', type=int, default=19, help='size of board')
args... | #!/usr/bin/env python
import argparse
import sys
from go import Board, BoardError, View, clear, getch
def main():
# Get arguments
parser = argparse.ArgumentParser(description='Starts a game of go in the terminal.')
parser.add_argument('-s', '--size', type=int, default=19, help='Size of board.')
arg... | mit | Python |
8e87689fd0edaf36349c3a6390fd8a6d18038f41 | Add auto-login feature for demo view | elegion/djangodash2012,elegion/djangodash2012 | fortuitus/fcore/views.py | fortuitus/fcore/views.py | from django.contrib import messages, auth
from django.contrib.auth.models import User
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.views.generic.base import TemplateView
from fortuitus.fcore import forms
class Home(TemplateView):
""" Home page. """
t... | from django.contrib import messages, auth
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.views.generic.base import TemplateView
from fortuitus.fcore import forms
class Home(TemplateView):
""" Home page. """
template_name = 'fortuitus/fcore/home.html'
... | mit | Python |
cbb11e996381197d551425585fca225d630fa383 | Remove version-specific exception text test | botify-labs/simpleflow,botify-labs/simpleflow | tests/test_simpleflow/utils/test_misc.py | tests/test_simpleflow/utils/test_misc.py | import unittest
from simpleflow.utils import format_exc
class MyTestCase(unittest.TestCase):
def test_format_final_exc_line(self):
line = None
try:
{}[1]
except Exception as e:
line = format_exc(e)
self.assertEqual("KeyError: 1", line)
if __name__ == '__m... | import unittest
from simpleflow.utils import format_exc
class MyTestCase(unittest.TestCase):
def test_format_final_exc_line(self):
line = None
try:
1/0
except Exception as e:
line = format_exc(e)
self.assertEqual("ZeroDivisionError: division by zero", line)... | mit | Python |
5a1ea9733262d11aabcb3558cf568b65f5767354 | Remove unneeded imports, make function general | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend,fedspendingtransparency/data-act-broker-backend,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend,fedspendingtransparency/data-act-broker-backend | tests/unit/dataactcore/test_job_queue.py | tests/unit/dataactcore/test_job_queue.py | from collections import OrderedDict
import csv
import os
from unittest.mock import Mock
from dataactcore.utils import jobQueue
def read_file_rows(file_path):
assert os.path.isfile(file_path)
with open(file_path) as f:
return [row for row in csv.reader(f)]
def test_generate_f_file(monkeypatch, mock... | from collections import OrderedDict
import csv
import os
from unittest.mock import Mock
import pytest
from pytest import raises
from dataactcore.utils import jobQueue
from dataactcore.config import CONFIG_BROKER
from dataactcore.utils.responseException import ResponseException
def read_f_file_rows(suffix, file_path... | cc0-1.0 | Python |
1971bac96737914ce0fabe003e2217d4cd9bb9da | Fix some definitions to play nicely with chaining. | joshbohde/functional_python | it.py | it.py | import itertools
from combinators import Combinators, ChainedCombinators
def apply(comb, func):
def inner(self, *args, **kwargs):
return getattr(self, comb)(func, *args, **kwargs)
return inner
class It(Combinators):
map = apply('R', itertools.imap)
filter = apply('R', itertools.ifilter)
r... | import itertools
from combinators import Combinators, ChainedCombinators
def apply(comb, func):
def inner(self, *args, **kwargs):
return getattr(self, comb)(func, *args, **kwargs)
return inner
class It(Combinators):
map = apply('R', itertools.imap)
filter = apply('R', itertools.ifilter)
r... | bsd-3-clause | Python |
6b3037b8a4373260cbcbe609b3335caa8cd86853 | Complete solution | CubicComet/exercism-python-solutions | atbash-cipher/atbash_cipher.py | atbash-cipher/atbash_cipher.py | import re
from string import ascii_lowercase, digits
ATBASH = {k: v for k, v in zip(ascii_lowercase + digits,
ascii_lowercase[::-1] + digits)}
def encode(s):
return " ".join(re.findall(r'.{1,5}', atbash(s)))
def decode(s):
return atbash(s)
def atbash(s):
return "".join... | from string import ascii_lowercase, digits
ATBASH = {k: v for k, v in zip(ascii_lowercase + digits,
ascii_lowercase[::-1] + digits)}
def encode(s):
encoded = atbash(s)
def decode(s):
return atbash(s)
def atbash(s):
return "".join(ATBASH.get(ch, "") for ch in s.lower())... | agpl-3.0 | Python |
9984279658f1e975e9184a0dfa2b70a7d6606934 | add and catch assertionerror exception for invalid inputs | enlighter/simple-crawler-in-python | baby-steps/daysBetweenDates.py | baby-steps/daysBetweenDates.py | # By Websten from forums
#
# Given your birthday and the current date, calculate your age in days.
# Account for leap days.
#
# Assume that the birthday and current date are correct dates (and no
# time travel).
#
def nextDay(year, month, day):
"""
Returns the year, month, day of the next day.
Simple v... | # By Websten from forums
#
# Given your birthday and the current date, calculate your age in days.
# Account for leap days.
#
# Assume that the birthday and current date are correct dates (and no
# time travel).
#
def nextDay(year, month, day):
"""
Returns the year, month, day of the next day.
Simple v... | mit | Python |
39314b70125d41fb57a468684209bdcfdfb8096f | Add still_running to build result serializer | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | frigg/builds/serializers.py | frigg/builds/serializers.py | from rest_framework import serializers
from frigg.projects.models import Project
from .models import Build, BuildResult
class ProjectInlineSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = (
'id',
'owner',
'name',
'priv... | from rest_framework import serializers
from frigg.projects.models import Project
from .models import Build, BuildResult
class ProjectInlineSerializer(serializers.ModelSerializer):
class Meta:
model = Project
fields = (
'id',
'owner',
'name',
'priv... | mit | Python |
a7bfd0fd5775c77be49b3764e154e42c6c64f2ee | Bump base check package (#8160) | DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core | zk/setup.py | zk/setup.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | bsd-3-clause | Python |
d367bcd6873c24c29c457845c0199f63b347bf32 | Fix conan packaging | taocpp/operators | conanfile.py | conanfile.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake
class OperatorsConan(ConanFile):
name = "operators"
description = "C++11 single-header library that provides highly efficient, move aware operators for arithmetic data types"
homepage = "https://github.com/taocpp/operators"
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake
class OperatorsConan(ConanFile):
name = "operators"
description = "C++11 single-header library that provides highly efficient, move aware operators for arithmetic data types"
homepage = "https://github.com/taocpp/operators"
... | mit | Python |
1440911fcd64318a23b5206917ba63741d5d148e | Fix incorrect version. | pjohalloran/conan-sol2 | conanfile.py | conanfile.py | from conans import ConanFile, CMake, tools
class SolTwoConan(ConanFile):
name = "sol2"
version = "2.15.6"
description = "Sol v2.0 - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Sol v2.0 - a C++ <-> Lua API wrapper with advanced features and top notch pe... | from conans import ConanFile, CMake, tools
class SolTwoConan(ConanFile):
name = "sol2"
version = "2.16.6"
description = "Sol v2.0 - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Sol v2.0 - a C++ <-> Lua API wrapper with advanced features and top notch pe... | mit | Python |
c5243d608508b867d137ffe45d4731df0afb09dd | Update Eigen to commit:0e187141679fdb91da33249d18cb79a011c0e2ea | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/eigen/workspace.bzl | third_party/eigen/workspace.bzl | """Provides the repository macro to import Eigen."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports Eigen."""
# Attention: tools parse and update these lines.
EIGEN_COMMIT = "0e187141679fdb91da33249d18cb79a011c0e2ea"
EIGEN_SHA256 = "52a7ef3ffe2b581973615b000657f456e2ea... | """Provides the repository macro to import Eigen."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports Eigen."""
# Attention: tools parse and update these lines.
EIGEN_COMMIT = "b02c384ef4e8eba7b8bdef16f9dc6f8f4d6a6b2b"
EIGEN_SHA256 = "515b3c266d798f3a112efe781dda0cf1aef7... | apache-2.0 | Python |
bd4bf3afce0cf3b90ee1353e03dec2946f777293 | install assertion builder in spec base class | tek/amino | tryp/test/spec.py | tryp/test/spec.py | import tek # type: ignore
import tryp
from tryp.logging import tryp_stdout_logging
from tryp.test.sure_ext import install_assertion_builder, AssBuilder
class Spec(tek.Spec):
def setup(self, *a, **kw):
tryp.development = True
tryp_stdout_logging()
install_assertion_builder(AssBuilder)
... | import tek # type: ignore
import tryp
from tryp.logging import tryp_stdout_logging
import tryp.test.sure_ext
class Spec(tek.Spec):
def setup(self, *a, **kw):
tryp.development = True
tryp_stdout_logging()
super(Spec, self).setup(*a, **kw)
__all__ = ('Spec')
| mit | Python |
88725503c4adfd6876a6b275f7f157fcb78effe9 | remove print statement | Harwood/pre-commit-hooks,jordant/pre-commit-hooks,chriskuehl/pre-commit-hooks,arahayrabedian/pre-commit-hooks,bgschiller/pre-commit-hooks,dupuy/pre-commit-hooks,Coverfox/pre-commit-hooks,jordant/pre-commit-hooks,pre-commit/pre-commit-hooks | pre_commit_hooks/detect_aws_credentials.py | pre_commit_hooks/detect_aws_credentials.py | from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os
from six.moves import configparser
def get_your_keys(credentials_file):
""" reads the secret keys in your credentials file in order to be able to look
for them in the submitted code.
"""
aws_creden... | from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os
from six.moves import configparser
def get_your_keys(credentials_file):
""" reads the secret keys in your credentials file in order to be able to look
for them in the submitted code.
"""
aws_creden... | mit | Python |
a811b9980c34f28ff55e940dbad7e0a4a8d5f374 | bump to 0.6.10. | tsuru/tsuru-circus | tsuru/__init__.py | tsuru/__init__.py | # Copyright 2014 tsuru-circus authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.6.10"
| # Copyright 2014 tsuru-circus authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.6.9"
| bsd-3-clause | Python |
6b8a02460e8838e6b4abe593cd77bb34069128cf | Bump version number | Wanderfalke/stellar,orf/stellar,fastmonkeys/stellar | stellar/__init__.py | stellar/__init__.py | import app
import command
import config
import models
import operations
import exceptions
__version__ = '0.1.1'
| import app
import command
import config
import models
import operations
import exceptions
__version__ = '0.1.0'
| mit | Python |
399c7922b79dfc91c6bb90a626797eac8de63b81 | fix tests | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | test/test_ghtorrent.py | test/test_ghtorrent.py | import os
import pytest
@pytest.fixture
def ghtorrent():
import augur
augurApp = augur.Application()
return augurApp.ghtorrent()
def test_repoid(ghtorrent):
assert ghtorrent.repoid('rails', 'rails') >= 1000
def test_userid(ghtorrent):
assert ghtorrent.userid('howderek') >= 1000
"""
Pandas testin... | import os
import pytest
@pytest.fixture
def ghtorrent():
import augur
augurApp = augur.Application()
return augurApp.ghtorrent()
def test_repoid(ghtorrent):
assert ghtorrent.repoid('rails', 'rails') >= 1000
def test_userid(ghtorrent):
assert ghtorrent.userid('howderek') >= 1000
"""
Pandas testin... | mit | Python |
56d221bd4da980e0504dae505e4e863faf4e319c | Use socket.recv to get data in the stream to prevent waiting for complete 1024b chunks. Patch by Daniel Jones (github:ideoforms). | hugovk/twitter,adonoho/twitter,miragshin/twitter,tytek2012/twitter,jessamynsmith/twitter,sixohsix/twitter,Adai0808/twitter | twitter/stream.py | twitter/stream.py | try:
import urllib.request as urllib_request
import urllib.error as urllib_error
import io
except ImportError:
import urllib2 as urllib_request
import urllib2 as urllib_error
import json
from .api import TwitterCall, wrap_response
class TwitterJSONIter(object):
def __init__(self, handle, uri,... | try:
import urllib.request as urllib_request
import urllib.error as urllib_error
import io
except ImportError:
import urllib2 as urllib_request
import urllib2 as urllib_error
import json
from .api import TwitterCall, wrap_response
class TwitterJSONIter(object):
def __init__(self, handle, uri,... | mit | Python |
8d56fa77b407ad4acfb6ee391676ed82281591f9 | add galactic usys | adrn/gary,adrn/gary,adrn/gala,adrn/gala,adrn/gala,adrn/gary | streamteam/units.py | streamteam/units.py | # coding: utf-8
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
# Third-party
import astropy.units as u
# Create logger
logger = logging.getLogger(__name__)
# default unit system
usys = dict()
usys['length'] = u.kpc
usy... | # coding: utf-8
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
# Third-party
import astropy.units as u
# Create logger
logger = logging.getLogger(__name__)
# default unit system
usys = dict()
usys['length'] = u.kpc
usy... | mit | Python |
dc25fa1244f42d22912727f8a45b09c87a5e06e5 | replace numbers with variables | alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | AlphaTwirl/EventReader/ProgressMonitor.py | AlphaTwirl/EventReader/ProgressMonitor.py | # Tai Sakuma <sakuma@fnal.gov>
import multiprocessing
import time
from ProgressReport import ProgressReport
##____________________________________________________________________________||
class ProgressReporter(object):
def __init__(self, queue, pernevents = 1000):
self.queue = queue
self.perneve... | # Tai Sakuma <sakuma@fnal.gov>
import multiprocessing
import time
from ProgressReport import ProgressReport
##____________________________________________________________________________||
class ProgressReporter(object):
def __init__(self, queue, pernevents = 1000):
self.queue = queue
self.perneve... | bsd-3-clause | Python |
d8cde079d6e8dd0dcd5a13a36a0bca9685ba7b1c | Add error handler for invalid token | patlub/BucketListAPI,patlub/BucketListAPI | api/BucketListAPI.py | api/BucketListAPI.py | from flask import Flask, jsonify
from modals.modals import User, Bucket, Item
from api.__init__ import create_app, db
app = create_app('DevelopmentEnv')
@app.errorhandler(404)
def page_not_found(e):
response = jsonify({'error': 'The request can not be completed'})
response.status_code = 404
return respon... | from flask import Flask, jsonify
from modals.modals import User, Bucket, Item
from api.__init__ import create_app, db
app = create_app('DevelopmentEnv')
@app.errorhandler(404)
def page_not_found(e):
response = jsonify({'error': 'The request can not be completed'})
response.status_code = 404
return respon... | mit | Python |
1e1831211b8b9a8a341b3c31d955cd6c6603405d | Fix a typo | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | proselint/checks/lexical_illusions/misc.py | proselint/checks/lexical_illusions/misc.py | """Lexical illusions.
---
layout: post
source: write-good
source_url: https://github.com/btford/write-good
title: Lexical illusion present
date: 2014-06-10 12:31:19
categories: writing
---
A lexical illusion is when a word word is unintentially repeated twice, and
and this happens most often betwee... | """Lexical illusions.
---
layout: post
source: write-good
source_url: https://github.com/btford/write-good
title: Lexical illusion present
date: 2014-06-10 12:31:19
categories: writing
---
A lexical illusion happens when a word word is unintentiall repeated twice, and
and this happens most often be... | bsd-3-clause | Python |
be70604b48d6161a993daf6a1d4640c7535b1111 | bump version | vmalloc/gossip | gossip/__version__.py | gossip/__version__.py | __version__ = "2.0.0"
| __version__ = "1.1.2"
| bsd-3-clause | Python |
ce61c2dd430d242164b731c0059894a296b9dac4 | Add reference to patch module | Microcore/KeyCounter,Microcore/KeyCounter,mynicolas/KeyCounter,mynicolas/KeyCounter,mynicolas/KeyCounter | patch.py | patch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import platform
def patch_pyhook_64bit():
# This patch comes from pyHook bug#1:
# https://sourceforge.net/p/pyhook/bugs/1/
import pyHook
from PyHook import KeyboardEvent
def KeyboardSwitch(
self, msg, vk_code, scan_code, ascii, flags, time, hw... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import platform
def patch_pyhook_64bit():
import pyHook
from PyHook import KeyboardEvent
def KeyboardSwitch(
self, msg, vk_code, scan_code, ascii, flags, time, hwnd, win_name
):
event = KeyboardEvent(
msg, vk_code, scan_code, a... | mit | Python |
ed453fe64d83b7ec26f0eea00208ba74b2fe1e65 | Modify error | admire93/alask | alask/db.py | alask/db.py | from flask import current_app, g
from alembic.config import Config
from alembic.script import ScriptDirectory
from werkzeug.local import LocalProxy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
__all__ = ('Base', 'ensure_shutdown_s... | from flask import current_app
from alembic.config import Config
from alembic.script import ScriptDirectory
from werkzeug.local import LocalProxy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
__all__ = ('Base', 'ensure_shutdown_sess... | mit | Python |
c058b0e50db94ca5e2fd3325555e97b1d38af946 | Update base.py | python-glasgow/pythonglasgow,python-glasgow/pythonglasgow,python-glasgow/pythonglasgow | ug/config/base.py | ug/config/base.py | import warnings
from os import environ
THREADS_PER_PAGE = 8
DATABASE_CONNECT_OPTIONS = {}
SQLALCHEMY_DATABASE_URI = environ.get('HEROKU_POSTGRESQL_OLIVE_URL')
SECRET_KEY = environ.get('SECRET_KEY')
CSRF_ENABLED = True
CSRF_SESSION_KEY = environ.get('CSRF_SESSION_KEY')
ADMINS = frozenset(['dougal85@gmail.com'])
DEBU... | import warnings
from os import environ
THREADS_PER_PAGE = 8
DATABASE_CONNECT_OPTIONS = {}
SQLALCHEMY_DATABASE_URI = environ.get('HEROKU_POSTGRESQL_OLIVE_URL')
SECRET_KEY = environ.get('SECRET_KEY')
CSRF_ENABLED = True
CSRF_SESSION_KEY = environ.get('CSRF_SESSION_KEY')
ADMINS = frozenset(['dougal85@gmail.com'])
DEBU... | bsd-3-clause | Python |
4fa8c9d4b458a29299e69cc9a2217fe31cc41ea2 | Update graphs/depth_first_search_2.py (#3799) | TheAlgorithms/Python | graphs/depth_first_search_2.py | graphs/depth_first_search_2.py | #!/usr/bin/python
""" Author: OMKAR PATHAK """
class Graph:
def __init__(self):
self.vertex = {}
# for printing the Graph vertices
def print_graph(self) -> None:
print(self.vertex)
for i in self.vertex:
print(i, " -> ", " -> ".join([str(j) for j in self.vertex[i]]))
... | #!/usr/bin/python
""" Author: OMKAR PATHAK """
class Graph:
def __init__(self):
self.vertex = {}
# for printing the Graph vertices
def printGraph(self):
print(self.vertex)
for i in self.vertex.keys():
print(i, " -> ", " -> ".join([str(j) for j in self.vertex[i]]))
... | mit | Python |
3d4adbecb0517a831dd861719d186e6c691093a7 | fix captialization | rlworkgroup/metaworld,rlworkgroup/metaworld,kschmeckpeper/multiworld | multiworld/envs/mujoco/__init__.py | multiworld/envs/mujoco/__init__.py | import gym
from gym.envs.registration import register
import logging
from multiworld.core.image_env import ImageEnv
from multiworld.envs.mujoco.cameras import sawyer_xyz_reacher_camera
LOGGER = logging.getLogger(__name__)
_REGISTERED = False
def register_custom_envs():
global _REGISTERED
if _REGISTERED:
... | import gym
from gym.envs.registration import register
import logging
from multiworld.core.image_env import ImageEnv
from multiworld.envs.mujoco.cameras import sawyer_xyz_reacher_camera
LOGGER = logging.getLogger(__name__)
_REGISTERED = False
def register_custom_envs():
global _REGISTERED
if _REGISTERED:
... | mit | Python |
f7ea43f56539beea670d6c5f36d5a734208e2401 | Remove unecessary imports | CenterForOpenScience/scrapi,felliott/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,mehanig/scrapi,fabianvf/scrapi,fabianvf/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi | api/webview/views.py | api/webview/views.py | from django.http import Http404
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.decorators import api_view
from django.views.decorators.clickjacking import xframe_options_exempt
from webview.models import Document
from webview.serializers import DocumentSerializer
... | import json
from xml.dom import minidom
from xml.parsers.expat import ExpatError
from django.http import Http404
from django.shortcuts import render
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.decorators import api_view
f... | apache-2.0 | Python |
ac1e3ac47afdb5f5bae3e1927cc2eefd270d6fb8 | Update Meh.py | kallerdaller/Cogs-Yorkfield | Meh/Meh.py | Meh/Meh.py | import discord
from discord.ext import commands
class Mycog:
"""Tells a user that you said meh"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def meh(self, ctx, user : discord.Member):
"""Tags a person and tells them meh"""
#Your code wi... | import discord
from discord.ext import commands
class Mycog:
"""Tells a user that you said meh"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, pass_message=True)
async def meh(self, ctx, user : discord.Member, message):
"""Tags a person and tells them m... | mit | Python |
07eb3a2ad46094a75a1adddd103fe0f58d51cf8a | Make RPython happy | babelsberg/babelsberg-r,kachick/topaz,topazproject/topaz,kachick/topaz,babelsberg/babelsberg-r,topazproject/topaz,babelsberg/babelsberg-r,topazproject/topaz,topazproject/topaz,babelsberg/babelsberg-r,babelsberg/babelsberg-r,kachick/topaz | topaz/objects/functionobject.py | topaz/objects/functionobject.py | import copy
from topaz.frame import BuiltinFrame
from topaz.objects.objectobject import W_BaseObject
class W_FunctionObject(W_BaseObject):
_immutable_fields_ = ["name", "w_class", "block", "bytecode"]
def __init__(self, name, w_class=None):
self.name = name
self.w_class = w_class
def __... | import copy
from topaz.frame import BuiltinFrame
from topaz.objects.objectobject import W_BaseObject
class W_FunctionObject(W_BaseObject):
_immutable_fields_ = ["name", "w_class"]
def __init__(self, name, w_class=None):
self.name = name
self.w_class = w_class
def __deepcopy__(self, memo... | bsd-3-clause | Python |
a9468b47b3eb3892043e88c1dc9da90d49213bed | Update version to 0.9.3 | yoeo/guesslang | guesslang/__init__.py | guesslang/__init__.py | """
Guesslang: a machine learning program that guesses the programming language
of a given source file.
"""
from guesslang.config import config_logging
from guesslang.guesser import Guess
from guesslang.utils import GuesslangError
__version__ = '0.9.3'
| """
Guesslang: a machine learning program that guesses the programming language
of a given source file.
"""
from guesslang.config import config_logging
from guesslang.guesser import Guess
from guesslang.utils import GuesslangError
__version__ = '0.9.3.dev3'
| mit | Python |
45254f3a7401b4b63d829f38c426c0635485f1e0 | Fix the license header regex. | enkripsi/gyp,mistydemeo/gyp,cysp/gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,LazyCodingCat/gyp,IllusionRom-deprecated/android_platform_external_chromium_org_tools_gyp,ttyangf/gyp,saghul/gyn,ttyangf/pdfium_gyp,lukeweber/gyp-override,carlTLR/gyp,amoikevin/gyp,erikge/watch_gyp,LazyCodingCat... | PRESUBMIT.py | PRESUBMIT.py | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit... | bsd-3-clause | Python |
14f42d9511ed1e681659b979d6c2df552505f6ae | add new changes to iso settings | skolekonov/start_fuel,skolekonov/start_fuel | etc/iso_settings.py | etc/iso_settings.py | #Services tests
SERVTEST_LOCAL_PATH = '~/images'
SERVTEST_USERNAME = 'admin'
SERVTEST_PASSWORD = SERVTEST_USERNAME
SERVTEST_TENANT = SERVTEST_USERNAME
images = [
{
"url": "http://sahara-files.mirantis.com",
"image": "savanna-0.3-vanilla-1.2.1-ubuntu-13.04.qcow2",
"name": "savanna",
... | #Services tests
SERVTEST_LOCAL_PATH = '~/images'
SERVTEST_USERNAME = 'admin'
SERVTEST_PASSWORD = SERVTEST_USERNAME
SERVTEST_TENANT = SERVTEST_USERNAME
images = [
{
"url": "http://sahara-files.mirantis.com/",
"image": "savanna-0.3-vanilla-1.2.1-ubuntu-13.04.qcow2",
"name": "savanna",
... | apache-2.0 | Python |
7b94c08826c6d8d699ca4b6087533f0579a80fca | Update to version v2.17.2 | romonzaman/newfies-dialer,newfies-dialer/newfies-dialer,newfies-dialer/newfies-dialer,saydulk/newfies-dialer,Star2Billing/newfies-dialer,Star2Billing/newfies-dialer,romonzaman/newfies-dialer,Star2Billing/newfies-dialer,saydulk/newfies-dialer,newfies-dialer/newfies-dialer,Star2Billing/newfies-dialer,saydulk/newfies-dial... | newfies/newfies_dialer/__init__.py | newfies/newfies_dialer/__init__.py | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Bi... | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Bi... | mpl-2.0 | Python |
bef33d6f96e492a68f3d4590d6c8c3d824773e6f | create profile with user staff | Fresnoy/kart,Fresnoy/kart | people/management/commands/create_staff.py | people/management/commands/create_staff.py | # -*- encoding: utf-8 -*-
import sys
from django.core.management.base import BaseCommand
from django.template.defaultfilters import slugify
from django.utils.crypto import get_random_string
from django.contrib.auth.models import User
from people.models import FresnoyProfile, Staff
def arg_to_unicode(bytestring):
... | # -*- encoding: utf-8 -*-
import sys
from django.core.management.base import BaseCommand
from django.template.defaultfilters import slugify
from django.utils.crypto import get_random_string
from django.contrib.auth.models import User
from people.models import Staff
def arg_to_unicode(bytestring):
unicode_string... | agpl-3.0 | Python |
8bdebf25cf5c15f65bd32bfe906e019aa572224c | Add optimize check (#1219) | vertexproject/synapse,vertexproject/synapse,vertexproject/synapse | synapse/__init__.py | synapse/__init__.py | '''
The synapse intelligence analysis framework.
'''
import sys
if (sys.version_info.major, sys.version_info.minor) < (3, 7): # pragma: no cover
raise Exception('synapse is not supported on Python versions < 3.7')
# checking maximum *signed* integer size to determine the interpreter arch
if sys.maxsize < 9223372... | '''
The synapse intelligence analysis framework.
'''
import sys
if (sys.version_info.major, sys.version_info.minor) < (3, 7): # pragma: no cover
raise Exception('synapse is not supported on Python versions < 3.7')
# checking maximum *signed* integer size to determine the interpreter arch
if sys.maxsize < 9223372... | apache-2.0 | Python |
f92b9a4aa8dff9200eee87f6d3280dcb542ee56c | Set immutable_input_digests on a docker RunRequest. (#16385) | benjyw/pants,benjyw/pants,pantsbuild/pants,pantsbuild/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,pantsbuild/pants,pantsbuild/pants,benjyw/pants,pantsbuild/pants,pantsbuild/pants,benjyw/pants,benjyw/pants | src/python/pants/backend/docker/goals/run_image.py | src/python/pants/backend/docker/goals/run_image.py | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from typing import cast
from pants.backend.docker.goals.package_image import BuiltDockerImage, DockerFieldSet
from pants.backend.docker.subsystems.dock... | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from typing import cast
from pants.backend.docker.goals.package_image import BuiltDockerImage, DockerFieldSet
from pants.backend.docker.subsystems.dock... | apache-2.0 | Python |
ceaeb5144e3ac8950ac67a4022199128d7d9c043 | Remove unused variable | stiphyMT/plantcv,stiphyMT/plantcv,stiphyMT/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,danforthcenter/plantcv | plantcv/plantcv/visualize/obj_size_ecdf.py | plantcv/plantcv/visualize/obj_size_ecdf.py | # Plot Empirical Cumulative Distribution Function for Object Size
import os
import cv2
import pandas as pd
from plantcv.plantcv import params
from plantcv.plantcv._debug import _debug
from statsmodels.distributions.empirical_distribution import ECDF
from plotnine import ggplot, aes, geom_point, labels, scale_x_log10
... | # Plot Empirical Cumulative Distribution Function for Object Size
import os
import cv2
import pandas as pd
from plantcv.plantcv import params
from plantcv.plantcv._debug import _debug
from statsmodels.distributions.empirical_distribution import ECDF
from plotnine import ggplot, aes, geom_point, labels, scale_x_log10
... | mit | Python |
6c9db3d576ba83543cb226943a9687a3ec5f5beb | add code to persist the list of repos to track | prashantvc/legos-cli | legos_command.py | legos_command.py | import click
import arrow
import os
from tempfile import gettempdir
from github import Github
@click.command()
@click.option("--list", is_flag=True, help='This will list all the open issue for a repo')
@click.option('--status', default='open', metavar='<text>', help='Indicates the state of the issues to return. Can be... | import click
import arrow
from github import Github
@click.command()
@click.option("--list", is_flag=True, help='This will list all the open issue for a repo')
@click.argument('repo')
def cli(list, repo):
'''This is a command line tool to list the github issues
USAGE:
legos <username/repo_nam... | mit | Python |
ea3f338d4ee5f5bf6b3a5ca9d7bb3e31fb0cd072 | make test_brancher.py more robust. | avain/angr,chubbymaggie/angr,f-prettyland/angr,mingderwang/angr,schieb/angr,angr/angr,zhuyue1314/angr,axt/angr,f-prettyland/angr,chubbymaggie/angr,lowks/angr,mingderwang/angr,schieb/angr,angr/angr,xurantju/angr,terry2012/angr,f-prettyland/angr,axt/angr,lowks/angr,GuardianRG/angr,haylesr/angr,zhuyue1314/angr,tyb0807/ang... | tests/test_brancher.py | tests/test_brancher.py | #!/usr/bin/env python
import nose
import logging
l = logging.getLogger("angr_tests")
try:
# pylint: disable=W0611,F0401
import standard_logging
import angr_debug
except ImportError:
pass
import angr
# load the tests
import os
test_location = str(os.path.dirname(os.path.realpath(__file__)))
brancher_... | #!/usr/bin/env python
import nose
import logging
l = logging.getLogger("angr_tests")
try:
# pylint: disable=W0611,F0401
import standard_logging
import angr_debug
except ImportError:
pass
import angr
# load the tests
import os
test_location = str(os.path.dirname(os.path.realpath(__file__)))
brancher_... | bsd-2-clause | Python |
12c36fff1f993c725cb4ddc465b2d9b8aa7f60b6 | bump version | hoedown/python-hoedown,hoedown/python-hoedown,hoedown/python-hoedown,hhatto/python-hoedown,hhatto/python-hoedown,hhatto/python-hoedown,hoedown/python-hoedown,hhatto/python-hoedown | hoedownpy/_version.py | hoedownpy/_version.py | __version__ = '0.2.1'
| __version__ = '0.3a'
| mit | Python |
27eb386faa8ea7ca0900fb8e5b06823e082b0c36 | Replace possible newlines | UltrosBot/Ultros,UltrosBot/Ultros | system/constants.py | system/constants.py | __author__ = 'Gareth Coles'
#: The current version. This gets replaced if you're using git.
__version__ = "1.0.0"
__version_info__ = "Not being run from a Git repo."
import datetime
try:
from git import repo
r = repo.Repo(".")
heads = r.heads
master = heads[0]
commit = master.commit
__versio... | __author__ = 'Gareth Coles'
#: The current version. This gets replaced if you're using git.
__version__ = "1.0.0"
__version_info__ = "Not being run from a Git repo."
import datetime
try:
from git import repo
r = repo.Repo(".")
heads = r.heads
master = heads[0]
commit = master.commit
__versio... | artistic-2.0 | Python |
08ea67b94b6de4b29dfa5e9e79e9ddf4530cb8d1 | Fix incorrect headers. | opesci/devito,opesci/devito | tests/test_constant.py | tests/test_constant.py | import numpy as np
from conftest import skipif
from devito import Grid, Constant, Function, TimeFunction, Eq, solve, Operator
pytestmark = skipif(['yask', 'ops'])
class TestConst(object):
"""
Class for testing Constant
"""
def test_const_change(self):
"""
Test that Constand.data can... | import numpy as np
from conftest import skipif
from devito import Grid, Constant, Function, TimeFunction, Eq, solve, Operator
pytestmark = skipif(['yask', 'ops'])
class TestConst(object):
"""
Class for testing symbolic coefficients functionality
"""
def test_const_change(self):
"""
... | mit | Python |
d1a80ff2f0b96c9e0944b252b2f6b5620319a01a | fix mentions tests to match changes to ronkyuu | bear/ronkyuu,bear/ronkyuu | tests/test_mentions.py | tests/test_mentions.py | #!/usr/bin/env python
import unittest
from httmock import urlmatch, HTTMock
from ronkyuu import findMentions, findEndpoint, discoverEndpoint
post_url = "https://bear.im/bearlog/2013/325/indiewebify-and-the-new-site.html"
tantek_url = "http://tantek.com/2013/322/b1/homebrew-computer-club-reunion-inspiration"
pos... | #!/usr/bin/env python
import unittest
from httmock import urlmatch, HTTMock
from ronkyuu import findMentions, findEndpoint, discoverEndpoint
post_url = "https://bear.im/bearlog/2013/325/indiewebify-and-the-new-site.html"
tantek_url = "http://tantek.com/2013/322/b1/homebrew-computer-club-reunion-inspiration"
pos... | mit | Python |
49ab803e0b8a086d21a29680dcfa66f6d607f04c | Fix test error introduced by changes in Zillow | CartoDB/bigmetadata,CartoDB/bigmetadata,CartoDB/bigmetadata,CartoDB/bigmetadata | tests/test_metadata.py | tests/test_metadata.py | import os
from tests.util import runtask, setup, teardown
from tasks.util import TableTask
# Monkeypatch TableTask
TableTask._test = True
import tasks.carto
from tasks.meta import current_session
from tasks.util import TagsTask, ColumnsTask, collect_meta_wrappers
from nose_parameterized import parameterized
from nose.... | from tests.util import runtask, setup, teardown
from tasks.util import TableTask
# Monkeypatch TableTask
TableTask._test = True
import tasks.carto
from tasks.meta import current_session
from tasks.util import TagsTask, ColumnsTask, collect_meta_wrappers
from nose_parameterized import parameterized
from nose.tools i... | bsd-3-clause | Python |
195642edef3d121122ee7764a9341aa5c715ad0c | Add coverage target to fab script | tshlabs/avalonms | fabfile/__init__.py | fabfile/__init__.py | # -*- coding: utf-8 -*-
#
# Avalon Music Server
#
# Copyright 2012-2014 TSH Labs <projects@tshlabs.org>
#
# Available under the MIT license. See LICENSE for details.
#
"""Fabric commands for Avalon development tasks and deploys."""
import os.path
from fabric.api import (
env,
hide,
lcd,
task,
lo... | # -*- coding: utf-8 -*-
#
# Avalon Music Server
#
# Copyright 2012-2014 TSH Labs <projects@tshlabs.org>
#
# Available under the MIT license. See LICENSE for details.
#
"""Fabric commands for Avalon development tasks and deploys."""
import os.path
from fabric.api import env, lcd, task, local, warn_only
from tunic.ap... | mit | Python |
80be1b6074367dca22209564d51145a32729ae41 | Add failing test re: linewise-when-parallel | itoed/fabric,kmonsoor/fabric,rodrigc/fabric,tekapo/fabric,bitmonk/fabric,fernandezcuesta/fabric,amaniak/fabric,SamuelMarks/fabric,hrubi/fabric,qinrong/fabric,kxxoling/fabric,getsentry/fabric,sdelements/fabric,mathiasertl/fabric,jaraco/fabric,likesxuqiang/fabric,opavader/fabric,TarasRudnyk/fabric,pashinin/fabric,pgrouda... | tests/test_parallel.py | tests/test_parallel.py | from __future__ import with_statement
from fabric.api import run, parallel, env, hide, execute, settings
from utils import FabricTest, eq_, aborts, mock_streams
from server import server, RESPONSES
# TODO: move this into test_tasks? meh.
class OhNoesException(Exception): pass
class TestParallel(FabricTest):
@... | from __future__ import with_statement
from fabric.api import run, parallel, env, hide, execute, settings
from utils import FabricTest, eq_, aborts, mock_streams
from server import server, RESPONSES
# TODO: move this into test_tasks? meh.
class OhNoesException(Exception): pass
class TestParallel(FabricTest):
@... | bsd-2-clause | Python |
4e58ea77c69d9f2ffbbf668c6bd9acb70a36c720 | update import_dir | it-projects-llc/misc-addons,it-projects-llc/misc-addons,it-projects-llc/misc-addons | import_custom/wizard/upload.py | import_custom/wizard/upload.py | from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp import tools
import logging
_logger = logging.getLogger(__name__)
import base64
import tempfile
import MySQLdb
import MySQLdb.cursors
from pandas import DataFrame
from ..import_custom import import_custom
import tarfile
import... | from openerp.osv import osv, fields
from openerp.tools.translate import _
from openerp import tools
import logging
_logger = logging.getLogger(__name__)
import base64
import tempfile
import MySQLdb
import MySQLdb.cursors
from pandas import DataFrame
from ..import_custom import import_custom
import tarfile
import... | mit | Python |
0fa6897c31acc00978745ccb1fc631e82ab9e713 | test get term index | kurin/py-raft | tests/unit/test_log.py | tests/unit/test_log.py | import pytest
from raft import log
def mle(index, term, committed=False, msgid='', msg={}):
return dict(index=index, term=term, committed=committed,
msgid=msgid, msg=msg)
def test_le():
# a's term is greater than b's
a = {1: mle(1, 2),
2: mle(2, 2),
3: mle(3, 4)}
b =... | import pytest
from raft import log
def mle(index, term, committed=False, msgid='', msg={}):
return dict(index=index, term=term, committed=committed,
msgid=msgid, msg=msg)
def test_le():
# a's term is greater than b's
a = {1: mle(1, 2),
2: mle(2, 2),
3: mle(3, 4)}
b =... | unlicense | Python |
ac3c855583a023fc76b8720aa7e38419b28a26d4 | Refactor empty tuple into empty object with len() | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/api/hathi.py | falcom/api/hathi.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
import json
class HathiItems:
def __init__ (self):
pass
def __len__ (self):
return 0
def get_counts_from_item_list... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
import json
def get_counts_from_item_list (items, htid):
a = len([x for x in items if x["htid"] == htid])
b = len(items) - a
ret... | bsd-3-clause | Python |
68660b47fb613b1403c24aa6677068afbfbf0efd | Fix main function | poxip/imgur-shot | imgurshot/__main__.py | imgurshot/__main__.py | #!/usr/bin/env python
"""
Main module of imgur-shot application.
"""
import sys
import argparse
from imgurshot import __description__
from imgurshot.guiclient import GuiClient
def main():
parser = argparse.ArgumentParser(description=__description__)
parser.add_argument(
'--select',
action='st... | #!/usr/bin/env python
"""
Main module of imgur-shot application.
"""
import sys
import argparse
import imgurshot
def main():
parser = argparse.ArgumentParser(description=imgurshot.__description__)
parser.add_argument(
'--select',
action='store_true',
help="interactively choose a window... | mit | Python |
c1db99e4f21ff27596023e51423c3e01444f2cb9 | Use try/except/else to disable demandimport | wdv4758h/flake8,lericson/flake8 | flake8/_pyflakes.py | flake8/_pyflakes.py | # -*- coding: utf-8 -*-
try:
# The 'demandimport' breaks pyflakes and flake8._pyflakes
from mercurial import demandimport
except ImportError:
pass
else:
demandimport.disable()
import pyflakes
import pyflakes.checker
def patch_pyflakes():
"""Add error codes to Pyflakes messages."""
codes = dict... | # -*- coding: utf-8 -*-
try:
# The 'demandimport' breaks pyflakes and flake8._pyflakes
from mercurial import demandimport
demandimport.disable()
except ImportError:
pass
import pyflakes
import pyflakes.checker
def patch_pyflakes():
"""Add error codes to Pyflakes messages."""
codes = dict([line... | mit | Python |
c27d6a928e403e674380e161a381d8f4f0d30251 | Remove package import | openego/dingo,openego/dingo | examples/example.py | examples/example.py | #!/usr/bin/env python3
"""This is a simple example file for DINGO.
__copyright__ = "Reiner Lemoine Institut, openego development group"
__license__ = "GNU GPLv3"
__author__ = "Jonathan Amme, Guido Pleßmann"
"""
import matplotlib.pyplot as plt
import oemof.db as db
import time
# import objgraph
from dingo.core impor... | #!/usr/bin/env python3
"""This is a simple example file for DINGO.
__copyright__ = "Reiner Lemoine Institut, openego development group"
__license__ = "GNU GPLv3"
__author__ = "Jonathan Amme, Guido Pleßmann"
"""
import matplotlib.pyplot as plt
import oemof.db as db
import time
import objgraph
from dingo.core import ... | agpl-3.0 | Python |
8ad5933a53cb443f02de7ce8c9457efb686b210c | Prepare v2.1.19.dev | Danfocus/Flexget,malkavi/Flexget,JorisDeRieck/Flexget,drwyrm/Flexget,crawln45/Flexget,jawilson/Flexget,Flexget/Flexget,tobinjt/Flexget,oxc/Flexget,malkavi/Flexget,sean797/Flexget,dsemi/Flexget,gazpachoking/Flexget,tarzasai/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,malkavi/Flexget,OmgOhnoes/Flexget,poulpito/Flexget,tobi... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
1ad81135586d42a6913cc24c69f5649be944f091 | Prepare v2.0.35.dev | drwyrm/Flexget,LynxyssCZ/Flexget,LynxyssCZ/Flexget,tobinjt/Flexget,crawln45/Flexget,Flexget/Flexget,jawilson/Flexget,Flexget/Flexget,Danfocus/Flexget,sean797/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,OmgOhnoes/Flexget,OmgOhnoes/Flexget,OmgOhnoes/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,ianstalk/Flexget,oxc/Fle... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
73bec46acc7d6940113c37720728dfc4ab51747f | Prepare v2.4.3.dev | gazpachoking/Flexget,malkavi/Flexget,jawilson/Flexget,Flexget/Flexget,tobinjt/Flexget,poulpito/Flexget,sean797/Flexget,crawln45/Flexget,poulpito/Flexget,JorisDeRieck/Flexget,gazpachoking/Flexget,OmgOhnoes/Flexget,crawln45/Flexget,malkavi/Flexget,drwyrm/Flexget,Danfocus/Flexget,tobinjt/Flexget,Danfocus/Flexget,LynxyssCZ... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
ae5ce1a072a903b3ee0c6108457046549ebd4d84 | Refactor git.py. | wkentaro/docopt,benthomasson/docopt,kenwilcox/docopt,devonjones/docopt,snowsnail/docopt,jagguli/docopt,crcsmnky/docopt,Zearin/docopt,docopt/docopt | examples/git/git.py | examples/git/git.py | #! /usr/bin/env python
"""
usage: git [--version] [--exec-path=<path>] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c name=value]
<command> [options] [<args>...]
git [--help]
The most commonly used ... | #! /usr/bin/env python
"""
usage: git [--version] [--exec-path=<path>] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c name=value]
<command> [options] [<args>...]
git [--help]
The most commonly used ... | mit | Python |
d72a23ef61939e0977783e73de99ba8b64037523 | Prepare v2.10.55.dev | malkavi/Flexget,Danfocus/Flexget,malkavi/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,Flexget/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget,gazpachoking/Flexget,jawilson/Flexget,LynxyssCZ/Flexget,JorisDeRieck/Flexget,LynxyssCZ/Flexget,qk4l/Flexget,JorisDeRieck/Flexget,qk4l/Flexget,OmgOhnoes/Flexget,JorisDeRie... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
ebd1d54e706c21fc1a92d5744d3db4f1747670cf | Prepare v3.1.68.dev | crawln45/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,Flexget/Flexget,crawln45/Flexget | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
0fe9c3552b6a16484d3b8f162444de61bd5c8558 | Prepare v1.2.499.dev | ianstalk/Flexget,jawilson/Flexget,dsemi/Flexget,qk4l/Flexget,qk4l/Flexget,poulpito/Flexget,oxc/Flexget,qk4l/Flexget,qvazzler/Flexget,tobinjt/Flexget,drwyrm/Flexget,antivirtel/Flexget,jawilson/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,JorisDeRieck/Flexget,Pretagonist/Flexget,jacobmetrick/Flexget,Pretagonist/Flexget,c... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
66e1033aaa63aba44f47354c692ddf68995a85a2 | Prepare v2.21.10.dev | Flexget/Flexget,gazpachoking/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,crawln45/Flexget,malkavi/Flexget,ianstalk/Flexget,gazpachoking/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,malkavi/Flexget,Flexget/Flexget,ianstalk/Flexget,Flexget/Flexget,malkavi/Flexget,malkavi/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,Jo... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
16ebcf4ca177f86f4256694b97ec9fbf00ec6a08 | Prepare v2.13.21.dev | jawilson/Flexget,tobinjt/Flexget,jawilson/Flexget,tobinjt/Flexget,ianstalk/Flexget,ianstalk/Flexget,tobinjt/Flexget,JorisDeRieck/Flexget,Flexget/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget,gazpachoking/Flexget,malkavi/Flexget,crawln45/Flexget,gazpachoking/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,jawilson... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
7872a2327f9dea7d4c1f5a3054b6be6bba25fdd4 | Remove TokuTransaction in migrate function | hmoco/osf.io,samchrisinger/osf.io,hmoco/osf.io,icereval/osf.io,caneruguz/osf.io,cwisecarver/osf.io,chrisseto/osf.io,erinspace/osf.io,SSJohns/osf.io,monikagrabowska/osf.io,crcresearch/osf.io,crcresearch/osf.io,laurenrevere/osf.io,leb2dg/osf.io,crcresearch/osf.io,baylee-d/osf.io,leb2dg/osf.io,saradbowman/osf.io,sloria/os... | scripts/migration/migrate_deleted_wikis.py | scripts/migration/migrate_deleted_wikis.py | import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq'... | import logging
import sys
from modularodm import Q
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import NodeLog
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def get_targets():
return NodeLog.find(Q('action', 'eq'... | apache-2.0 | Python |
a966833cf78d6afcdf67b14f4ac9a4d907ab443a | Remove registration of user with django rest framework | Voilier/obole,Voilier/obole | core/urls.py | core/urls.py | # -*- coding: utf-8 -*-
"""obole URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... | # -*- coding: utf-8 -*-
"""obole URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... | mpl-2.0 | Python |
cc81736c5338ba8cc98444b33ea9284a54295d7e | read from ascii file instead of pickle | guziy/basemap,matplotlib/basemap,matplotlib/basemap,guziy/basemap | examples/plotmap.py | examples/plotmap.py | # make plot of etopo bathymetry/topography data on
# lambert conformal conic map projection, drawing coastlines, state and
# country boundaries, and parallels/meridians.
# the data is interpolated to the native projection grid.
from matplotlib.toolkits.basemap import Basemap, shiftgrid
from pylab import *
import cPic... | # make plot of etopo bathymetry/topography data on
# lambert conformal conic map projection, drawing coastlines, state and
# country boundaries, and parallels/meridians.
# the data is interpolated to the native projection grid.
from matplotlib import rcParams, use
rcParams['numerix'] = 'Numeric' # make sure Numeric ... | mit | Python |
69f4ee4d97221da28b0ab69b775c73b03e122ad4 | Bump version. | foliant-docs/foliant | foliant/__init__.py | foliant/__init__.py | """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__name__ = "foliant"
__description__ = "Documentation generator that builds PDF, Docx, and TeX from a single Markdown source."
__author__... | """
**Foliant** is a documentation generator that builds PDF, Docx, and TeX output
from a single Markdown source. It also uploads Docx files to Google Drive
as Google Documents.
"""
__name__ = "foliant"
__description__ = "Documentation generator that builds PDF, Docx, and TeX from a single Markdown source."
__author__... | mit | Python |
43c295d244aac154a75e4dc07a2b7d3f0be5e60d | bump version | andreif/django-formapi,andreif/django-formapi,5monkeys/django-formapi,5monkeys/django-formapi | formapi/__init__.py | formapi/__init__.py | VERSION = (0, 0, 6, 'dev')
# Dynamically calculate the version based on VERSION tuple
if len(VERSION) > 2 and VERSION[2] is not None:
if isinstance(VERSION[2], int):
str_version = "%s.%s.%s" % VERSION[:3]
else:
str_version = "%s.%s_%s" % VERSION[:3]
else:
str_version = "%s.%s" % VERSION[:2]... | VERSION = (0, 0, 5, 'dev')
# Dynamically calculate the version based on VERSION tuple
if len(VERSION) > 2 and VERSION[2] is not None:
if isinstance(VERSION[2], int):
str_version = "%s.%s.%s" % VERSION[:3]
else:
str_version = "%s.%s_%s" % VERSION[:3]
else:
str_version = "%s.%s" % VERSION[:2]... | mit | Python |
384ac208ced1ce0c4f3a02da6e0e55d003855147 | Fix setup_pypy kills itself. | jaguililla/FrameworkBenchmarks,zdanek/FrameworkBenchmarks,nathana1/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,lcp0578/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,Rydgel/FrameworkBenchmarks,julienschmidt/FrameworkBenchmarks,yunspace/FrameworkBenchmarks,actframework/FrameworkBenchmarks,RockinRoel/FrameworkBe... | flask/setup_pypy.py | flask/setup_pypy.py | import subprocess
import sys
import setup_util
import os
proc = None
def start(args):
global proc
setup_util.replace_text("flask/app.py", "DBHOSTNAME", args.database_host)
proc = subprocess.Popen("~/FrameworkBenchmarks/installs/pypy-2.0/bin/pypy run_pypy.py --port=8080 --logging=error", shell=True, cwd="flask")... | import subprocess
import sys
import setup_util
import os
def start(args):
setup_util.replace_text("flask/app.py", "DBHOSTNAME", args.database_host)
subprocess.Popen("~/FrameworkBenchmarks/installs/pypy-2.0/bin/pypy run_pypy.py --port=8080 --logging=error", shell=True, cwd="flask")
return 0
def stop():
p = sub... | bsd-3-clause | Python |
19e7daec21e24b08c915bf8d44a0cb9840789327 | Bump version to 0.11.4 | racker/fleece,racker/fleece | fleece/__about__.py | fleece/__about__.py | """Fleece package attributes and metadata."""
__all__ = (
'__title__',
'__summary__',
'__author__',
'__email__',
'__license__',
'__version__',
'__copyright__',
'__url__',
)
__title__ = 'fleece'
__summary__ = 'Wrap the lamb...da'
__author__ = 'Rackers'
__email__ = 'bruce.stringer@racksp... | """Fleece package attributes and metadata."""
__all__ = (
'__title__',
'__summary__',
'__author__',
'__email__',
'__license__',
'__version__',
'__copyright__',
'__url__',
)
__title__ = 'fleece'
__summary__ = 'Wrap the lamb...da'
__author__ = 'Rackers'
__email__ = 'bruce.stringer@racksp... | apache-2.0 | Python |
f2a1e3b485566d70eb3c8b07d7da674701e7a9b2 | add a pep8 task to fabfile | armstrong/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,armstrong/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells,texastribune/armstrong.core.arm_wells,dmclain/armstrong.core.arm_wells | fabfile/__init__.py | fabfile/__init__.py | from ._utils import *
@task
def pep8():
local('find ./armstrong -name "*.py" | xargs pep8', capture=False)
@task
def test():
settings = {
'INSTALLED_APPS': (
'django.contrib.contenttypes',
'armstrong.core.arm_well',
'armstrong.core.arm_well.tests.arm_well_support',
... | from ._utils import *
@task
def test():
settings = {
'INSTALLED_APPS': (
'django.contrib.contenttypes',
'armstrong.core.arm_well',
'armstrong.core.arm_well.tests.arm_well_support',
),
'ROOT_URLCONF': 'armstrong.core.arm_well.tests.arm_well_support.urls',
... | apache-2.0 | Python |
627e504633811cd68705b5e5a46077ae9d2dbb8b | Prepare v3.0.6.dev | ianstalk/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
a8e0bc38c4b295dc686283d64c7ccad5d2d408b1 | Remove bad import. | casebeer/factual | factual/__init__.py | factual/__init__.py | '''
Factual Server API Wrapper
===========================
This package wraps the Factual "Server" API. Its query style is SQLAlchemy-inspired and designed
to make it easy to build "read" requests by chaining filter calls together.
API actions other than "read" are supported via the same syntax for consistency.
B... | '''
Factual Server API Wrapper
===========================
This package wraps the Factual "Server" API. Its query style is SQLAlchemy-inspired and designed
to make it easy to build "read" requests by chaining filter calls together.
API actions other than "read" are supported via the same syntax for consistency.
B... | bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.