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 |
|---|---|---|---|---|---|---|---|---|
633c40d365acd390190e3eef0089cc1e00925e46 | Revert to alpha test mode; fix grammar | Contextualist/Quip4AHA,Contextualist/Quip4AHA | NewDoc.py | NewDoc.py | import time
import datetime
import quip
class NewDoc(object):
def __init__(self):
NextWednesday = datetime.datetime.today() + datetime.timedelta(days = 5)
self.NextWednesdayN = NextWednesday.strftime("%m%d")
self.NextWednesdayS = NextWednesday.strftime("%B %d")
if self.NextWednesda... | import time
import datetime
import quip
class NewDoc(object):
def __init__(self):
NextWednesday = datetime.datetime.today() + datetime.timedelta(days = 5)
self.NextWednesdayN = NextWednesday.strftime("%m%d")
self.NextWednesdayS = NextWednesday.strftime("%B %d")
if self.NextWednesda... | apache-2.0 | Python |
6a88e390467326f1e53f7b7a10bab777186b3418 | replace post_syncdb with post_migrate | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | corehq/preindex/models.py | corehq/preindex/models.py | from couchdbkit.ext.django import syncdb
from django.db.models import signals
from corehq.preindex import get_preindex_plugin
def catch_signal(sender, using=None, **kwargs):
"""Function used by syncdb signal"""
if using != 'default':
# only sync for the default DB
return
app_name = sender... | from couchdbkit.ext.django import syncdb
from django.db.models import signals
from corehq.preindex import get_preindex_plugin
def catch_signal(sender, using=None, **kwargs):
"""Function used by syncdb signal"""
if using != 'default':
# only sync for the default DB
return
app_name = sender... | bsd-3-clause | Python |
4c2e81adfc21b7857d9c01ae70f8f022bfe430ba | print to check thread exit normally | cyh24/multicpu | test/test.py | test/test.py | import time
import requests
import numpy as np
import multiprocessing
from concurrent import futures
from multicpu import multi_cpu
def process_job(job):
#time.sleep(1)
count = 10000000
while count>0:
count -= 1
print "ok"
return job
jobs = [i for i in range(10)]
de... | import time
import requests
import numpy as np
import multiprocessing
from concurrent import futures
from multicpu import multi_cpu
def process_job(job):
#time.sleep(1)
count = 10000000
while count>0:
count -= 1
return job
jobs = [i for i in range(10)]
def test_multi_cpu... | mit | Python |
62641f9d0c3c9260217703f80066bbb434697d6e | Change variable name | SerSamgy/trapper-acg | test_dice.py | test_dice.py | import pytest
import dice
expected_dice_faces = [
(dice.d4, tuple(range(1, 5))),
(dice.d6, tuple(range(1, 7))),
(dice.d8, tuple(range(1, 9))),
(dice.d10, tuple(range(1, 11))),
(dice.d12, tuple(range(1, 13))),
]
@pytest.mark.parametrize('dice,expected', expected_dice_faces)
def test_dice_has_prop... | import pytest
import dice
expected_factory_method_data = [
(dice.d4, tuple(range(1, 5))),
(dice.d6, tuple(range(1, 7))),
(dice.d8, tuple(range(1, 9))),
(dice.d10, tuple(range(1, 11))),
(dice.d12, tuple(range(1, 13))),
]
@pytest.mark.parametrize('dice,expected', expected_factory_method_data)
def ... | mit | Python |
d75dc845a456782549d00364e2637c7c32b8507a | add additional gate tests | cjwfuller/quantum-circuits | test_gate.py | test_gate.py | import numpy as np
import unittest
import gate
class TestGate(unittest.TestCase):
def test_standard_gates_implemented(self):
gate.QuantumGate('paulix')
gate.QuantumGate('pauliy')
gate.QuantumGate('pauliz')
gate.QuantumGate('swap')
gate.QuantumGate('cnot')
gate.Quantu... | import numpy as np
import unittest
import gate
class TestGate(unittest.TestCase):
def test_standard_gates_implemented(self):
gate.QuantumGate('paulix')
gate.QuantumGate('pauliy')
gate.QuantumGate('pauliz')
gate.QuantumGate('swap')
gate.QuantumGate('cnot')
gate.Quantu... | mit | Python |
fb13b04e09a837faba2f3ac6310cc36073727637 | use nose for testing now (That was easy) | nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments,nex3/pygments | tests/run.py | tests/run.py | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: 2006-2007 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
import sys
try:
import nose
except ImportError:
print >> sys.stderr, "nose is requ... | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: 2006-2007 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
import sys, os, new
import unittest
from os.path import dirname, basename, join, abspath
... | bsd-2-clause | Python |
4b18b48e93186a5ea22b684e0392bf5cba387525 | fix sleep between photos | dvl/raspberry-pi_timelapse,dvl/raspberry-pi_timelapse | timelapse.py | timelapse.py | import os
import datetime
import time
import picamera
from PIL import Image, ImageStat, ImageFont, ImageDraw
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.rotation = 180
time.sleep(2) # camera warm-up time
for filename in camera.capture_continuous('images/img_{timesta... | import os
import datetime
import time
import picamera
from PIL import Image, ImageStat, ImageFont, ImageDraw
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.rotation = 180
time.sleep(2) # camera warm-up time
for filename in camera.capture_continuous('images/img_{timesta... | mit | Python |
af6394bca3ee6686ec018bdcb032b8a97ef3e831 | Use config-directive for channel | Thor77/TeamspeakIRC | tsversion.py | tsversion.py | import irc3
from irc3.plugins.command import command
from irc3.plugins.cron import cron
from teamspeak_web_utils import latest_version
@irc3.plugin
class TSVersion(object):
def __init__(self, bot):
self.bot = bot
self.client_version = None
self.server_version = None
config = bot.co... | import irc3
from irc3.plugins.command import command
from irc3.plugins.cron import cron
from teamspeak_web_utils import latest_version
@irc3.plugin
class TSVersion(object):
def __init__(self, bot):
self.bot = bot
self.client_version = None
self.server_version = None
self.target_cha... | mit | Python |
70181b3069649eddacac86dbcb49cb43733be0ec | Add code comments for begins example | aliles/cmdline_examples | tw_begins.py | tw_begins.py | #!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" %... | #!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentionin... | mit | Python |
3c4ba4bb89babdb2345dd01c5ddb79d30e7afa02 | bump version to 1.9.8.3 | vialectrum/vialectrum,pooler/electrum-ltc,pooler/electrum-ltc,vertcoin/electrum-vtc,vertcoin/electrum-vtc,vialectrum/vialectrum,pknight007/electrum-vtc,pooler/electrum-ltc,pooler/electrum-ltc,pknight007/electrum-vtc,vertcoin/electrum-vtc,pknight007/electrum-vtc,pknight007/electrum-vtc,vialectrum/vialectrum,vertcoin/ele... | lib/version.py | lib/version.py | ELECTRUM_VERSION = "1.9.8.3" # version of the client package
PROTOCOL_VERSION = '0.9' # protocol version requested
NEW_SEED_VERSION = 7 # bip32 wallets
OLD_SEED_VERSION = 4 # old electrum deterministic generation
SEED_PREFIX = '01' # the hash of the mnemonic seed must begin with this
| ELECTRUM_VERSION = "1.9.8.1" # version of the client package
PROTOCOL_VERSION = '0.9' # protocol version requested
NEW_SEED_VERSION = 7 # bip32 wallets
OLD_SEED_VERSION = 4 # old electrum deterministic generation
SEED_PREFIX = '01' # the hash of the mnemonic seed must begin with this
| mit | Python |
c95bff54d8ff6534c40d60f34484f864cc04754a | Add example for when there is no book cover url | DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat | lib/web/web.py | lib/web/web.py | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
... | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
... | mit | Python |
5698dd61695371b792ba65262ac503e25b1bbb19 | Exclude root and alias pages from search results. | ghostwords/localore,ghostwords/localore,ghostwords/localore | localore/search/views.py | localore/search/views.py | from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import JsonResponse
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from wagtail.wagtailcore.models import Page
from wagtail.wagt... | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import JsonResponse
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.models import Query
# override per-site cache f... | mpl-2.0 | Python |
84fa46196865295c68cf8bf6de225503ca0e2a37 | bump version | wesokes/django-manager-utils,ambitioninc/django-manager-utils | manager_utils/version.py | manager_utils/version.py | __version__ = '1.3.0'
| __version__ = '1.2.0'
| mit | Python |
ecc471f94dc2ca2931370e53948d9f674dd673d4 | Add parenthesis to print statement | mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-3,h2oai/h2o-3,mathemage/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,jangorecki/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,h2oai/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,michalkurka/h2o-3,h2o... | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | apache-2.0 | Python |
c027c5a5542adbe43792455a283df1b0a6f61f33 | Add developer tool versions. | hlin117/statsmodels,gef756/statsmodels,phobson/statsmodels,statsmodels/statsmodels,hlin117/statsmodels,YihaoLu/statsmodels,jseabold/statsmodels,wzbozon/statsmodels,bashtage/statsmodels,adammenges/statsmodels,detrout/debian-statsmodels,rgommers/statsmodels,musically-ut/statsmodels,wwf5067/statsmodels,musically-ut/statsm... | statsmodels/tools/print_version.py | statsmodels/tools/print_version.py | #!/usr/bin/env python
import sys
def show_versions():
print("\nINSTALLED VERSIONS")
print("------------------")
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])
try:
import os
(sysname, nodename, release, version, machine) = os.uname()
print("OS: %s %s %s %s" % (sysname, re... | #!/usr/bin/env python
import sys
def show_versions():
print("\nINSTALLED VERSIONS")
print("------------------")
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])
try:
import os
(sysname, nodename, release, version, machine) = os.uname()
print("OS: %s %s %s %s" % (sysname, re... | bsd-3-clause | Python |
76f1640b2ebb5c85e5989d798bf09277943ff6e2 | Bump suffix | orome/crypto-enigma-py | crypto_enigma/_version.py | crypto_enigma/_version.py | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | bsd-3-clause | Python |
4adb78fde502faed78350233896f3efd3f42816e | Define a default interpreter rather than using shutil.copyfile. | startling/cytoplasm | cytoplasm/interpreters.py | cytoplasm/interpreters.py | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, sim... | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, sim... | mit | Python |
34a5ac0d0581e45e79eb1ef5c1172e1bd3e4c9b0 | change id to lowercase d | d120/pyophase,d120/pyophase,d120/pyophase,d120/pyophase | d120_provider/provider.py | d120_provider/provider.py | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class D120Account(ProviderAccount):
pass
class D120Provider(OAuth2Provider):
id = 'd120'
name = 'D120 OAuth2 Provider'
... | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class D120Account(ProviderAccount):
pass
class D120Provider(OAuth2Provider):
id = 'D120'
name = 'D120 OAuth2 Provider'
... | agpl-3.0 | Python |
e58781d10d930addc911a2e9b86370ba997cddfc | Make STRtree work with empty input sequence. | abali96/Shapely,mouadino/Shapely,jdmcbr/Shapely,jdmcbr/Shapely,mouadino/Shapely,abali96/Shapely,mindw/shapely,mindw/shapely | shapely/strtree.py | shapely/strtree.py | from shapely.geos import lgeos
import ctypes
class STRtree:
"""
STRtree is an R-tree that is created using the Sort-Tile-Recursive
algorithm. STRtree takes a sequence of geometry objects as initialization
parameter. After initialization the query method can be used to make a
spatial query over thos... | from shapely.geos import lgeos
import ctypes
class STRtree:
"""
STRtree is an R-tree that is created using the Sort-Tile-Recursive
algorithm. STRtree takes a sequence of geometry objects as initialization
parameter. After initialization the query method can be used to make a
spatial query over thos... | bsd-3-clause | Python |
b4810235dd91e326b088f0ea4fc479ad6b9b7900 | Improve session backend compatibility with Django. | wtanaka/google-app-engine-helper-for-django,clones/google-app-engine-django | appengine_django/sessions/backends/db.py | appengine_django/sessions/backends/db.py | #!/usr/bin/python2.4
#
# Copyright 2008 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
#
# Unless required by applicable law or ag... | #!/usr/bin/python2.4
#
# Copyright 2008 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
#
# Unless required by applicable law or ag... | apache-2.0 | Python |
5e63e3b86623aed099383fa96c7ee079fdce8905 | Update to setup.py so that generated SWIG library is copied over to python installation appropriately. Somehow, I did not include this change in my previous commit. | opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core,opensim-org/opensim-core | OpenSim/Wrapping/Python/setup.py | OpenSim/Wrapping/Python/setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
if os.name == 'posix':
# Linux, etc.
lib_name = '_opensim.so'
elif os.name == 'nt':
# Windows.
lib_name = '_opensim.pyd'
setup(name='opensim',
version='3.1',
description='OpenSim Simulation Framewo... | #!/usr/bin/env python
from distutils.core import setup
setup(name='pyOpenSim',
version='3.1',
description='OpenSim Simulation Framework',
author='OpenSim Team',
author_email='ahabib@stanford.edu',
url='http://opensim.stanford.edu/'
)
| apache-2.0 | Python |
08f46549f7ce70416bb0f605fb9da7334b465e50 | Fix attributes. | PyBossa/pybossa,PyBossa/pybossa,stefanhahmann/pybossa,OpenNewsLabs/pybossa,OpenNewsLabs/pybossa,jean/pybossa,inteligencia-coletiva-lsd/pybossa,Scifabric/pybossa,jean/pybossa,geotagx/pybossa,geotagx/pybossa,inteligencia-coletiva-lsd/pybossa,Scifabric/pybossa,stefanhahmann/pybossa | test/factories/auditlog_factory.py | test/factories/auditlog_factory.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 | Python |
5934669c0edbd914d14612e16be7c88641b50bee | Fix test for eq and test eq with other classes | Pytwitcher/pytwitcherapi,Pytwitcher/pytwitcherapi | test/test_chat_chatserverstatus.py | test/test_chat_chatserverstatus.py | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers)... | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers)... | bsd-3-clause | Python |
a004abd76af602192704cf4d01d9daf3903d6477 | Remove unused code | ecino/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,ecino/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,ecino/compassion-switzerland | child_switzerland/models/child_compassion.py | child_switzerland/models/child_compassion.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <david@coninckx.com>
#
# The licence is in the file __manifest__.p... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <david@coninckx.com>
#
# The licence is in the file __manifest__.p... | agpl-3.0 | Python |
92f5cff9edfbeb2219fc2fb714364dc590bd912f | Fix too long line in soc.cache.logic module. | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/cache/logic.py | app/soc/cache/logic.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
bed9390490ad0c9d8d8319ea017f13d075284450 | Make sure SQL file gets closed | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | calaccess_processed_filings/managers.py | calaccess_processed_filings/managers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom manager for loading raw data in to "filings" models.
"""
from __future__ import unicode_literals
import itertools
# Django tricks
from django.db.models import Q
from django.db import connection
# Managers
from calaccess_processed.managers import BulkLoadSQLMana... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom manager for loading raw data in to "filings" models.
"""
from __future__ import unicode_literals
import itertools
# Django tricks
from django.db.models import Q
from django.db import connection
# Managers
from calaccess_processed.managers import BulkLoadSQLMana... | mit | Python |
a2398d77f550a5b73c5bbd76d30131c88c64caa4 | Make the example a bit more exciting. | amorilia/formast,amorilia/formast,amorilia/formast | swig/test.py | swig/test.py | import formast
e = formast.Expr()
formast.parse_xml("test.txt", e)
class Printer(formast.Visitor):
def expr_uint(self, v):
print v,
def expr_add(self, left, right):
print "(",
self.expr(left)
print "+",
self.expr(right)
print ")",
def expr_sub(self, left, ... | import formast
e = formast.Expr()
formast.parse_xml("test.txt", e)
class Visitor(formast.Visitor):
def expr_uint(self, v):
print(v)
def expr_add(self, left, right):
print "("
self.expr(left)
print "+"
self.expr(right)
print ")"
def expr_sub(self, left, rig... | bsd-3-clause | Python |
df9b8428d6575bf68699534c37425bd1bc1c6ae8 | decrease the cache time for the block | rezometz/django-paiji2-shoutbox,rezometz/django-paiji2-shoutbox | paiji2_shoutbox/modular.py | paiji2_shoutbox/modular.py | from django.conf.urls import url, include
from modular_blocks import ModuleApp, TemplateTagBlock, modules
from . import urls
class ShoutboxModule(ModuleApp):
app_name = 'bulletin_board'
name = 'bulletin-board'
urls = url(r'^shoutbox/', include(urls))
templatetag_blocks = [
TemplateTagBlock(
... | from django.conf.urls import url, include
from modular_blocks import ModuleApp, TemplateTagBlock, modules
from . import urls
class ShoutboxModule(ModuleApp):
app_name = 'bulletin_board'
name = 'bulletin-board'
urls = url(r'^shoutbox/', include(urls))
templatetag_blocks = [
TemplateTagBlock(
... | agpl-3.0 | Python |
c47d11fbe4e09dcec8d0c40d778c38b04b8ccc7b | Add List-Id and List-Unsubscribe headers | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | uchicagohvz/users/mailing_list.py | uchicagohvz/users/mailing_list.py | # Mailing list configuration
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from uchicagohvz import secrets
from .tasks import smtp_localhost_send
from .models import Profile
from rest_framework.response import Response
from rest_framework.views import APIVi... | # Mailing list configuration
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from uchicagohvz import secrets
from .tasks import smtp_localhost_send
from .models import Profile
from rest_framework.response import Response
from rest_framework.views import APIVi... | mit | Python |
0cc04e9a486fb7dcf312a5c336f8f529f8b1f32d | Update version 1.0.4 -> 1.0.5 | TamiaLab/PySkCode | skcode/__init__.py | skcode/__init__.py | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabie... | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabie... | agpl-3.0 | Python |
f343a8bc7592ab9befb5c03ccd09db61439e3f76 | remove extra buttons labelled Make Maintenance Visit | gangadharkadam/verveerp,mbauskar/phrerp,BhupeshGupta/erpnext,indictranstech/erpnext,gangadharkadam/saloon_erp_install,indictranstech/phrerp,saurabh6790/alert-med-app,suyashphadtare/vestasi-update-erp,gangadhar-kadam/verve_test_erp,saurabh6790/med_new_app,rohitwaghchaure/digitales_erpnext,rohitwaghchaure/erpnext_smart,T... | erpnext/patches/jan_mar_2012/allocated_to_profile.py | erpnext/patches/jan_mar_2012/allocated_to_profile.py | def execute():
"""
Changes allocated_to option to Profile in
DocType Customer Issue
"""
import webnotes
webnotes.conn.sql("""
UPDATE `tabDocField`
SET options='Profile'
WHERE fieldname='allocated_to'
""")
webnotes.conn.sql("""
DELETE from `tabDocField`
WHERE parent='Customer Issue'
AND label='Mak... | def execute():
"""
Changes allocated_to option to Profile in
DocType Customer Issue
"""
import webnotes
webnotes.conn.sql("""
UPDATE `tabDocField`
SET options='Profile'
WHERE fieldname='allocated_to'
""")
from webnotes.modules.module_manager import reload_doc
reload_doc('support', 'doctype', 'customer... | agpl-3.0 | Python |
96176bb223f9971311a0a42c6c9845ca1c0170cc | Add base class to throttling | incuna/django-user-management,incuna/django-user-management | user_management/api/throttling.py | user_management/api/throttling.py | from rest_framework.throttling import ScopedRateThrottle
class DefaultRateMixin(object):
def get_rate(self):
try:
return self.THROTTLE_RATES[self.scope]
except KeyError:
return self.default_rate
class PostRequestThrottleMixin(object):
def allow_request(self, request, ... | from rest_framework.throttling import ScopedRateThrottle
class DefaultRateMixin(object):
def get_rate(self):
try:
return self.THROTTLE_RATES[self.scope]
except KeyError:
return self.default_rate
class PostRequestThrottleMixin(object):
def allow_request(self, request, ... | bsd-2-clause | Python |
70fdc88e73e52a800dd86504bab7fbf9ad89e1d8 | Add partial_path property explicitly to the Work model. | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | app/soc/models/work.py | app/soc/models/work.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
226639f98dee43e21db70070108d0c3131d75729 | move to version 0.2.1b | bpow/gemini,bw2/gemini,bgruening/gemini,bpow/gemini,udp3f/gemini,bw2/gemini,udp3f/gemini,udp3f/gemini,xuzetan/gemini,bgruening/gemini,bw2/gemini,brentp/gemini,arq5x/gemini,heuermh/gemini,bgruening/gemini,heuermh/gemini,brentp/gemini,xuzetan/gemini,arq5x/gemini,brentp/gemini,arq5x/gemini,arq5x/gemini,bpow/gemini,bpow/ge... | gemini/version.py | gemini/version.py | __version__="0.2.1b"
| __version__="0.2.0b"
| mit | Python |
e01eccd8af27ad97a20b784b81ddde5cc8515e4b | fix incorrect codding utf8 to utf-8 (#903) | joke2k/faker,danhuss/faker,joke2k/faker | faker/providers/internet/hu_HU/__init__.py | faker/providers/internet/hu_HU/__init__.py | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
free_email_domains = (
'gmail.com',
'hotmail.com',
'yahoo.com',
)
tlds = (
'hu',
'com',
'com.hu',
'info',
'... | # coding=utf8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
free_email_domains = (
'gmail.com',
'hotmail.com',
'yahoo.com',
)
tlds = (
'hu',
'com',
'com.hu',
'info',
'o... | mit | Python |
0352f542341fe25be74c0130e7e50394c6f0bb6d | add interactive message colorization | balabit/git-magic,balabit/git-magic | gitmagic/fixup.py | gitmagic/fixup.py | import gitmagic
import git.cmd
import tempfile
def fixup(repo, destination_picker, change_finder, args={}):
repo.index.reset()
for change in change_finder(repo):
_apply_change(repo, change)
destination_commits = destination_picker.pick(change)
if not destination_commits:
rep... | import gitmagic
import git.cmd
import tempfile
def fixup(repo, destination_picker, change_finder, args={}):
repo.index.reset()
for change in change_finder(repo):
_apply_change(repo, change)
destination_commits = destination_picker.pick(change)
if not destination_commits:
rep... | mit | Python |
835b1ff03d517c4a621237d3cd1682df1322e0e8 | add missing build dependency to py-execnet (#6443) | tmerrick1/spack,matthiasdiener/spack,EmreAtes/spack,mfherbst/spack,EmreAtes/spack,krafczyk/spack,krafczyk/spack,iulian787/spack,LLNL/spack,tmerrick1/spack,iulian787/spack,krafczyk/spack,EmreAtes/spack,tmerrick1/spack,EmreAtes/spack,mfherbst/spack,LLNL/spack,krafczyk/spack,iulian787/spack,iulian787/spack,matthiasdiener/... | var/spack/repos/builtin/packages/py-execnet/package.py | var/spack/repos/builtin/packages/py-execnet/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
baed814d73ea645794d172614bb79f456730b42c | Fix auth providers to work around Python's broken import system. | wevoice/wesub,wevoice/wesub,ofer43211/unisubs,pculture/unisubs,norayr/unisubs,ujdhesa/unisubs,eloquence/unisubs,ujdhesa/unisubs,wevoice/wesub,norayr/unisubs,eloquence/unisubs,ReachingOut/unisubs,ofer43211/unisubs,wevoice/wesub,pculture/unisubs,ReachingOut/unisubs,ofer43211/unisubs,ReachingOut/unisubs,norayr/unisubs,nor... | apps/auth/providers.py | apps/auth/providers.py | # Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, ... | # Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, ... | agpl-3.0 | Python |
8f429a41f3541c5f32a9809a529dd800f7dafa0a | Fix log output for Docker daemonised | ps-jay/temp2dash | temp2dash.py | temp2dash.py | import json
import os
import requests
import sys
import time
import traceback
from temperusb import TemperHandler
URL = os.environ['DASHING_URL']
SCALE = float(os.environ['TEMP_SCALE'])
OFFSET = float(os.environ['TEMP_OFFSET'])
SENSOR = int(os.environ['TEMP_SENSOR'])
SLEEP = int(os.environ['SLEEP_TIME'])
th = TemperH... | import json
import os
import requests
import sys
import time
import traceback
from temperusb import TemperHandler
URL = os.environ['DASHING_URL']
SCALE = float(os.environ['TEMP_SCALE'])
OFFSET = float(os.environ['TEMP_OFFSET'])
SENSOR = int(os.environ['TEMP_SENSOR'])
SLEEP = int(os.environ['SLEEP_TIME'])
th = TemperH... | mit | Python |
6e9f329f5a770955370e93c926c25d511ba8b981 | Update the_ends_test/FunctionsUnitTest.py | Kevincavender/the-ends | the_ends_test/FunctionsUnitTest.py | the_ends_test/FunctionsUnitTest.py | import unittest
from the_ends.functions import function_finder
import sys
sys.path.insert(0, '/the_ends')
class TheEndsTestCases(unittest.TestCase):
def setUp(self):
pass
# before test cases
def tearDown(self):
pass
# after test cases
def test_isupper(self):
# example ... | import unittest
from the_ends.functions import function_finder
class TheEndsTestCases(unittest.TestCase):
def setUp(self):
pass
# before test cases
def tearDown(self):
pass
# after test cases
def test_isupper(self):
# example test
self.assertTrue('FOO'.isupper(... | bsd-3-clause | Python |
76829380376c31ea3f1e899770d1edffd1afc047 | Change gravatar url to use https | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | apps/profiles/utils.py | apps/profiles/utils.py | import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
| import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
| mit | Python |
c7f50eb666423ce3cc08d5e0714f4d18d672d326 | clean up test | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/hqadmin/tests/test_utils.py | corehq/apps/hqadmin/tests/test_utils.py | from django.test import TestCase, override_settings
from pillowtop.listener import BasicPillow
from corehq.apps.domain.models import Domain
from ..utils import pillow_seq_store, EPSILON
from ..models import PillowCheckpointSeqStore
class DummyPillow(BasicPillow):
document_class = Domain
def run(self):
... | from django.test import TestCase
from pillowtop.listener import BasicPillow
from corehq.apps.domain.models import Domain
from ..utils import pillow_seq_store, EPSILON
from ..models import PillowCheckpointSeqStore
def import_settings():
class MockSettings(object):
PILLOWTOPS = {'test': ['corehq.apps.hqadm... | bsd-3-clause | Python |
11ef828a8180ba17f522e03ac198440feab40aa0 | Update version | jblakeman/apt-select,jblakeman/apt-select | apt_select/__init__.py | apt_select/__init__.py | __version__ = '1.0.2'
| __version__ = '1.0.1'
| mit | Python |
a3a408b9345291ca9a1999a779879afe0296f0a3 | Update grayscale.py | userdw/RaspberryPi_3_Starter_Kit | 08_Image_Processing/Color_Spaces/grayscale/grayscale.py | 08_Image_Processing/Color_Spaces/grayscale/grayscale.py | import os, cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
_projectDirectory = os.path.dirname(__file__)
_imagesDirectory = os.path.join(_projectDirectory, "images")
_images = []
for _root, _dirs, _files in os.walk(_imagesDirectory):
for _file in _files:
i... | import os, cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
_projectDirectory = os.path.dirname(__file__)
_imagesDirectory = os.path.join(_projectDirectory, "images")
_images = []
for _root, _dirs, _files in os.walk(_imagesDirectory):
for _file in _files:
i... | mit | Python |
37167a9473a99931efbc60a8e46400ed017c8fa4 | set up initial condition arrays | KayaBaber/Computational-Physics | Assignment_5_partial_differentials/P440_Assign5_Exp2.py | Assignment_5_partial_differentials/P440_Assign5_Exp2.py | '''
Kaya Baber
Physics 440 - Computational Physics
Assignment 5 - PDEs
Exploration 2 - Parabolic PDEs: The Wave Equation
'''
import numpy as np
from numpy import linalg as LA
import matplotlib.pyplot as plt
import math
import cmath
L = 2.*math.pi #set the x range to (0->2pi)
N = 1000 #number of spatial inte... | '''
Kaya Baber
Physics 440 - Computational Physics
Assignment 5 - PDEs
Exploration 2 - Parabolic PDEs: The Wave Equation
'''
import numpy as np
from numpy import linalg as LA
import matplotlib.pyplot as plt
import math
#make initial velocity array in real space
#make initial density array in real space
#fft both to f... | mit | Python |
60b2c0db865fcf09636359888ead82ffc7666ae3 | Add test for failed login when user is not active | yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core | yunity/userauth/tests/test_api.py | yunity/userauth/tests/test_api.py | from django.contrib import auth
from rest_framework import status
from rest_framework.test import APITestCase
from yunity.users.factories import UserFactory
class TestUserAuthAPI(APITestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user = UserFactory()
cls.disabled_... | from django.contrib import auth
from rest_framework import status
from rest_framework.test import APITestCase
from yunity.users.factories import UserFactory
class TestUserAuthAPI(APITestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user = UserFactory()
cls.url = '/a... | agpl-3.0 | Python |
67773a4b848d14bf6e6b160eb918e036971b7f0e | Use Python 3 type syntax in zerver/webhooks/semaphore/view.py. | timabbott/zulip,jackrzhang/zulip,rishig/zulip,rishig/zulip,hackerkid/zulip,andersk/zulip,synicalsyntax/zulip,rht/zulip,mahim97/zulip,eeshangarg/zulip,jackrzhang/zulip,showell/zulip,tommyip/zulip,mahim97/zulip,synicalsyntax/zulip,kou/zulip,showell/zulip,dhcrzf/zulip,rishig/zulip,rishig/zulip,punchagan/zulip,kou/zulip,pu... | zerver/webhooks/semaphore/view.py | zerver/webhooks/semaphore/view.py | # Webhooks for external integrations.
from typing import Any, Dict
import ujson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.request ... | # Webhooks for external integrations.
from typing import Any, Dict
import ujson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_stream_message
from zerver.lib.request ... | apache-2.0 | Python |
8d8f470ad0788b1e6e91155f07b351de04051824 | add test for search by name and pagination | andela-brotich/CP2-bucket-list-api,brotich/CP2-bucket-list-api | app/mod_bucketlists/tests/test_bucketlist.py | app/mod_bucketlists/tests/test_bucketlist.py | from app.test_config import BaseTestCase
class BucketListTestCase(BaseTestCase):
def test_creates_new_bucketlist_with_token(self):
data = {
'bucket_name': 'Christmas'
}
response = self.client.post('/bucketlists/', data=data, headers=self.token, follow_redirects=True)
s... | from app.test_config import BaseTestCase
class BucketListTestCase(BaseTestCase):
def test_creates_new_bucketlist_with_token(self):
data = {
'bucket_name': 'Christmas'
}
response = self.client.post('/bucketlists/', data=data, headers=self.token, follow_redirects=True)
s... | mit | Python |
7855d8a4a4c3151f0b3f4da04696322cca92ee06 | fix tests | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | cla_frontend/apps/cla_auth/tests/urls.py | cla_frontend/apps/cla_auth/tests/urls.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import http
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from . import base
from django.core.urlresolvers import reverse_lazy
@login_required
def test_view(request):
retur... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import http
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from . import base
@login_required
def test_view(request):
return http.HttpResponse('logged in')
zone_url = patt... | mit | Python |
4bc0b7981f6eaa1744c90d0c080b9678af52d624 | fix bug in picture specs | ImaginationForPeople/imaginationforpeople,ImaginationForPeople/imaginationforpeople,ImaginationForPeople/imaginationforpeople,ImaginationForPeople/imaginationforpeople,ImaginationForPeople/imaginationforpeople,ImaginationForPeople/imaginationforpeople | apps/project_sheet/project_pictures_specs.py | apps/project_sheet/project_pictures_specs.py | """
Specification for image manipulation throw imagekit
"""
from imagekit.specs import ImageSpec
from imagekit import processors
from imagekit.processors import ImageProcessor
from imagekit.lib import ImageColor, Image
class Center(ImageProcessor):
"""
Generic image centering processor
"""
width = Non... | """
Specification for image manipulation throw imagekit
"""
from imagekit.specs import ImageSpec
from imagekit import processors
from imagekit.processors import ImageProcessor
from imagekit.lib import ImageColor
class Center(ImageProcessor):
"""
Generic image centering processor
"""
width = None
he... | agpl-3.0 | Python |
354eea19773b652e705f68648c68c235bfa27dd7 | Fix weird naming | nanonyme/nanoplay | twisted/plugins/nanoplay_plugin.py | twisted/plugins/nanoplay_plugin.py | from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.internet import reactor
from twisted.application import service, strports
from nanoplay import PayloadProtocol, ControlProtocol, CustomServer, Player
class Options(usage.Options):
optParameters = ... | from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.internet import reactor
from twisted.application import service, strports
from nanoplay import PayloadProtocol, ControlProtocol, CustomServer, Player
class Options(usage.Options):
optParameters = ... | mit | Python |
5eb11aa2a41e2d2448cf81d3ef4416a7aaf3a537 | change db location to match reinit.sh script | ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide | calebasse/settings/local_settings_example.py | calebasse/settings/local_settings_example.py |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'calebasse/calebasse.sqlite3',
}
}
|
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'calebasse.sqlite3',
}
}
| agpl-3.0 | Python |
26d104b5758d41954d0da4a3447cc22c089c1cf0 | fix migrations | misli/cmsplugin-iframe2,misli/cmsplugin-iframe2 | cmsplugin_iframe2/migrations/0001_initial.py | cmsplugin_iframe2/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-04-01 18:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from ..conf import settings
class Migration(migrations.Migration):
initial = True
dependencies = [
('cms', '0016... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-04-01 18:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('cms', '0016_auto_20160608_1535'),
]
... | bsd-3-clause | Python |
7ef6132194ccd207c554521209ba3472bf523940 | Make factories return unicode data | devs1991/test_edx_docmode,Shrhawk/edx-platform,LICEF/edx-platform,nanolearning/edx-platform,shubhdev/openedx,dsajkl/123,carsongee/edx-platform,nanolearningllc/edx-platform-cypress,beni55/edx-platform,mtlchun/edx,hkawasaki/kawasaki-aio8-0,MSOpenTech/edx-platform,andyzsf/edx,Lektorium-LLC/edx-platform,torchingloom/edx-pl... | common/djangoapps/student/tests/factories.py | common/djangoapps/student/tests/factories.py | from student.models import (User, UserProfile, Registration,
CourseEnrollmentAllowed, CourseEnrollment)
from django.contrib.auth.models import Group
from datetime import datetime
from factory import DjangoModelFactory, SubFactory, PostGenerationMethodCall, post_generation, Sequence
from uuid... | from student.models import (User, UserProfile, Registration,
CourseEnrollmentAllowed, CourseEnrollment)
from django.contrib.auth.models import Group
from datetime import datetime
from factory import DjangoModelFactory, SubFactory, PostGenerationMethodCall, post_generation, Sequence
from uuid... | agpl-3.0 | Python |
6a58541a0fe1a942c3a2c187eb0358bd8350a51f | Change default output folder of minimize-content-pack.py. | fle-internal/content-pack-maker | minimize-content-pack.py | minimize-content-pack.py | """
minimize-content-pack
Remove assessment items, subtitles and po files from a content pack.
Usage:
minimize-content-pack.py <old-content-pack-path> <out-path>
"""
import zipfile
from pathlib import Path
from docopt import docopt
ITEMS_TO_TRANSFER = [
"metadata.json",
"content.db",
"backend.mo",
... | """
minimize-content-pack
Remove assessment items, subtitles and po files from a content pack.
Usage:
minimize-content-pack.py <old-content-pack-path> <out-path>
"""
import zipfile
from pathlib import Path
from docopt import docopt
ITEMS_TO_TRANSFER = [
"metadata.json",
"content.db",
"backend.mo",
... | bsd-2-clause | Python |
35e6559bd13f46679333e72b6356a82a0657cce4 | fix thinko in kepler test | adrn/gala,adrn/gala,adrn/gala,adrn/gary,adrn/gary,adrn/gary | gala/potential/potential/tests/test_against_galpy.py | gala/potential/potential/tests/test_against_galpy.py | """Test some builtin potentials against galpy"""
# Third-party
import numpy as np
from astropy.constants import G
import astropy.units as u
import pytest
# This project
from ...._cconfig import GSL_ENABLED
from ....units import galactic
from ..builtin import (KeplerPotential, MiyamotoNagaiPotential,
... | """Test some builtin potentials against galpy"""
# Third-party
import numpy as np
from astropy.constants import G
import astropy.units as u
import pytest
# This project
from ...._cconfig import GSL_ENABLED
from ....units import galactic
from ..builtin import (KeplerPotential, MiyamotoNagaiPotential,
... | mit | Python |
20f7102daf411a07ec922fceb2fac6c00356a84b | Revert "Version in function" | django/asgi_redis | asgi_redis/__init__.py | asgi_redis/__init__.py | import pkg_resources
from .core import RedisChannelLayer
from .local import RedisLocalChannelLayer
__version__ = pkg_resources.require('asgi_redis')[0].version
| import pkg_resources
from .core import RedisChannelLayer
from .local import RedisLocalChannelLayer
def get_version():
return pkg_resources.require('asgi_redis')[0].version
| bsd-3-clause | Python |
ea0847a1c509b2eba1e652b597f2921b0c19da2d | Add field for name in mail dict | Nedgang/adt_project | mail_parser.py | mail_parser.py | #!/usr/bin/env python3
# -*- coding: utf8 -*-
import os, sys
from email.parser import Parser
import json
import re
def parse_mail(file_in):
"""
Extract Subject & Body of mail file
headers must be formatted as a block of RFC 2822 style
"""
# filename_out = os.path.splitext(os.path.basenam... | #!/usr/bin/env python3
# -*- coding: utf8 -*-
import os, sys
from email.parser import Parser
import json
import re
def parse_mail(file_in):
"""
Extract Subject & Body of mail file
headers must be formatted as a block of RFC 2822 style
"""
# filename_out = os.path.splitext(os.path.basenam... | mit | Python |
ae916c1ee52941bb5a1ccf87abe2a9758897bd08 | Add deprecation warnings and message to getlines function | ipython/ipython,ipython/ipython | IPython/utils/ulinecache.py | IPython/utils/ulinecache.py | """
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines ... | """
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wr... | bsd-3-clause | Python |
04065919be55d8e4371cc1e7fec1a0148298ccf7 | throw if obj is not serializable | Geotab/mygeotab-python | mygeotab/serializers.py | mygeotab/serializers.py | # -*- coding: utf-8 -*-
"""
mygeotab.serializers
~~~~~~~~~~~~~~~~~~~~
JSON serialization and deserialization helper objects for the MyGeotab API.
"""
import re
import arrow
import six
use_rapidjson = False
try:
import rapidjson
DATETIME_MODE = rapidjson.DM_SHIFT_TO_UTC | rapidjson.DM_ISO8601
use_rapi... | # -*- coding: utf-8 -*-
"""
mygeotab.serializers
~~~~~~~~~~~~~~~~~~~~
JSON serialization and deserialization helper objects for the MyGeotab API.
"""
import re
import arrow
import six
use_rapidjson = False
try:
import rapidjson
DATETIME_MODE = rapidjson.DM_SHIFT_TO_UTC | rapidjson.DM_ISO8601
use_rapi... | apache-2.0 | Python |
c2c4e47f5cdae6e683e87dcc8c7b536633755c5a | fix with black formatter | mbeacom/locust,locustio/locust,mbeacom/locust,locustio/locust,locustio/locust,locustio/locust,mbeacom/locust,mbeacom/locust | examples/distribuited_execution_terraform/aws/plan/basic.py | examples/distribuited_execution_terraform/aws/plan/basic.py | import time
from locust import HttpUser, task, between
class Quickstart(HttpUser):
wait_time = between(1, 5)
@task
def google(self):
self.client.request_name = "google"
self.client.get("https://google.com/")
@task
def microsoft(self):
self.client.request_name = "microsoft... | import time
from locust import HttpUser, task, between
class Quickstart(HttpUser):
wait_time = between(1, 5)
@task
def google(self):
self.client.request_name = "google"
self.client.get("https://google.com/")
@task
def microsoft(self):
self.client.request_name = "microsoft"... | mit | Python |
a967fbb3b38e0788ccbde0650076ab05e693806a | Bump version number. | GreatFruitOmsk/nativeconfig | nativeconfig/version.py | nativeconfig/version.py | VERSION = '3.0.0'
| VERSION = '2.9.1'
| mit | Python |
1bfab9dd43fc52bfdea0943703ee530e3b0f98de | remove SpecsParser | kaczmarj/neurodocker,kaczmarj/neurodocker | neurodocker/__init__.py | neurodocker/__init__.py | # Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import
import logging
import sys
LOG_FORMAT = '[NEURODOCKER %(asctime)s %(levelname)s]: %(message)s'
logging.basicConfig(stream=sys.stdout, datefmt='%H:%M:%S', level=logging.INFO,
format=LOG_FORMAT)
from neurodocker.dock... | # Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import
import logging
import sys
LOG_FORMAT = '[NEURODOCKER %(asctime)s %(levelname)s]: %(message)s'
logging.basicConfig(stream=sys.stdout, datefmt='%H:%M:%S', level=logging.INFO,
format=LOG_FORMAT)
from neurodocker imp... | apache-2.0 | Python |
44d74984bd4168eddb4cc5f9c0e77aad4e498a02 | fix broken plots | saketkc/moca,saketkc/moca,saketkc/moca | moca/plotter/__init__.py | moca/plotter/__init__.py | from .plotter import create_plot
| from .seqstats import perform_t_test
from .seqstats import get_pearson_corr
from .plotter import create_plot
| isc | Python |
d2f1595fbb9e8d29e2126aa9453f4159e9b85a0d | add event to receive panel on focus | SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview | guicomm/events.py | guicomm/events.py | import wx.lib.newevent
# plot data
(NewPlotEvent, EVT_NEW_PLOT) = wx.lib.newevent.NewEvent()
# print the messages on statusbar
(StatusEvent, EVT_STATUS) = wx.lib.newevent.NewEvent()
#create a panel slicer
(SlicerPanelEvent, EVT_SLICER_PANEL) = wx.lib.newevent.NewEvent()
#print update paramaters for panel s... | import wx.lib.newevent
# plot data
(NewPlotEvent, EVT_NEW_PLOT) = wx.lib.newevent.NewEvent()
# print the messages on statusbar
(StatusEvent, EVT_STATUS) = wx.lib.newevent.NewEvent()
#create a panel slicer
(SlicerPanelEvent, EVT_SLICER_PANEL) = wx.lib.newevent.NewEvent()
#print update paramaters for panel s... | bsd-3-clause | Python |
a0e07c3ecf84219b79889509e29da0b800e36a97 | fix angle normalization in get_draw_angles() | mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf | src/ezdxf/addons/drawing/utils.py | src/ezdxf/addons/drawing/utils.py | # Created: 06.2020
# Copyright (c) 2020, Matthew Broadway
# License: MIT License
import enum
import math
from math import tau
from typing import Union, List
from ezdxf.addons.drawing.type_hints import Radians
from ezdxf.entities import Face3d, Solid, Trace
from ezdxf.math import Vector, Z_AXIS, OCS
def normalize_ang... | # Created: 06.2020
# Copyright (c) 2020, Matthew Broadway
# License: MIT License
import enum
import math
from math import tau
from typing import Union, List
from ezdxf.addons.drawing.type_hints import Radians
from ezdxf.entities import Face3d, Solid, Trace
from ezdxf.math import Vector, Z_AXIS, OCS
def normalize_ang... | mit | Python |
ad42d5df34074bfb21229a962d4b2a548a796e9a | Update data_validation/jellyfish_distance.py | GoogleCloudPlatform/professional-services-data-validator,GoogleCloudPlatform/professional-services-data-validator | data_validation/jellyfish_distance.py | data_validation/jellyfish_distance.py | # 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
#
# http://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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
7c2f915b0ca89db2c44a73af8db3f803687f068b | reimplement load_library and backup_library | j39m/katowice,j39m/katowice,j39m/katowice | unskipper.py | unskipper.py | #! /usr/bin/env python3
# unskipper.py will prune all skipcounts from your Quod Libet library;
# the resulting lack of '~#skipcount' in your per-song entries will all
# be interpreted by QL as being skipcount 0.
import os
import sys
import shutil
import quodlibet.library
HOME = os.getenv("HOME")
QLDIR = ".quodlibet... | #! /usr/bin/env python3
# unskipper.py will prune all skipcounts from your Quod Libet library;
# the resulting lack of '~#skipcount' in your per-song entries will all
# be interpreted by QL as being skipcount 0.
import os
import sys
import shutil
import pickle
HOME = os.getenv("HOME")
QLDIR = ".quodlibet"
PATH_TO_S... | bsd-2-clause | Python |
a889d4726189d1a7c9a9fbd074ca2c1d6eca9d98 | delete unnecessary constraint | yuyu2172/chainercv,pfnet/chainercv,yuyu2172/chainercv,chainer/chainercv,chainer/chainercv | chainercv/links/model/extraction_chain.py | chainercv/links/model/extraction_chain.py | import chainer
import collections
class ExtractionChain(chainer.Chain):
def __init__(self, layers, layer_names=None):
super(ExtractionChain, self).__init__()
if not isinstance(layers, collections.OrderedDict):
layers = collections.OrderedDict(
[(str(i), function) for ... | import chainer
import collections
class ExtractionChain(chainer.Chain):
def __init__(self, layers, layer_names=None):
super(ExtractionChain, self).__init__()
if not isinstance(layers, collections.OrderedDict):
if layer_names is not None:
raise ValueError('`layer_names... | mit | Python |
ce143f40f3131bbd04e40cacec50cae3e725b598 | use new package module | sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary | updatecmd.py | updatecmd.py | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import package
import files
import shutil
import pwd
import grp
import files
def doUpdate(cfg, root, pkgName, binaries = 1, sources = 0):
if root == "/":
print "using srs to update to your actual system is dumb."
import sys
sys.exit(0)
if pkgNam... | #
# Copyright (c) 2004 Specifix, Inc.
# All rights reserved
#
import package
import files
import shutil
import pwd
import grp
import files
def doUpdate(cfg, root, pkgName, binaries = 1, sources = 0):
if root == "/":
print "using srs to update to your actual system is dumb."
import sys
sys.exit(0)
if pkgNam... | apache-2.0 | Python |
6ebf6e6f2e8c4e2be5e4778089a8d4a66432c88b | update ProgressHook | yuyu2172/chainercv,chainer/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv | chainercv/utils/iterator/progress_hook.py | chainercv/utils/iterator/progress_hook.py | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | mit | Python |
22f293ff16dd977c6a37b64566b37405d81cb767 | Make the KeyIdentifier.key_id field a property. | atlassian/asap-authentication-python | atlassian_jwt_auth/key.py | atlassian_jwt_auth/key.py | import os
import re
import requests
class KeyIdentifier(object):
""" This class represents a key identifier """
def __init__(self, identifier):
self.__key_id = validate_key_identifier(identifier)
@property
def key_id(self):
return self.__key_id
def validate_key_identifier(identif... | import os
import re
import requests
class KeyIdentifier(object):
""" This class represents a key identifier """
def __init__(self, identifier):
self.key_id = validate_key_identifier(identifier)
def validate_key_identifier(identifier):
""" returns a validated key identifier. """
regex = re... | mit | Python |
fab58f03eaf09b9f286a10f5a91a945f53a92a29 | Drop native specification | nanshe-org/splauncher,DudLab/splauncher,jakirkham/splauncher,DudLab/splauncher,jakirkham/splauncher,nanshe-org/splauncher | splauncher/core.py | splauncher/core.py | from __future__ import print_function
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$May 18, 2015 16:52:18 EDT$"
import datetime
import os
import logging
drmaa_logger = logging.getLogger(__name__)
try:
import drmaa
except ImportError:
# python-drmaa is not installed.
drmaa_logger... | from __future__ import print_function
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$May 18, 2015 16:52:18 EDT$"
import datetime
import os
import logging
drmaa_logger = logging.getLogger(__name__)
try:
import drmaa
except ImportError:
# python-drmaa is not installed.
drmaa_logger... | bsd-3-clause | Python |
e61247230b291bcf9f9dcc3050876b9f812c6541 | change url for methodcheck thanks steve steiner http://www.atxconsulting.com/blog/tjfontaine/2010/02/09/updated-linode-api#comment-195 | ryanshawty/linode-python,tjfontaine/linode-python | methodcheck.py | methodcheck.py | #!/usr/bin/python
"""
A quick script to verify that api.py is in sync with Linode's
published list of methods.
Copyright (c) 2009 Ryan Tucker <rtucker@gmail.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 i... | #!/usr/bin/python
"""
A quick script to verify that api.py is in sync with Linode's
published list of methods.
Copyright (c) 2009 Ryan Tucker <rtucker@gmail.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 i... | mit | Python |
cc413b49ce9dd63fcbe9396a5ac1c8c68872a6c1 | Update information in pkginfo, including the version information. | PyCQA/astroid | astroid/__pkginfo__.py | astroid/__pkginfo__.py | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... | # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... | lgpl-2.1 | Python |
a891594150a4456e0894f2b5b70f2bd4b650bd77 | use debug to log dqn_freeze model update to prevent log overflow | kengz/openai_lab,kengz/openai_gym,kengz/openai_gym,kengz/openai_lab,kengz/openai_lab,kengz/openai_gym | rl/agent/dqn_freeze.py | rl/agent/dqn_freeze.py | import os
import numpy as np
from rl.agent.double_dqn import DoubleDQN
from rl.agent.dqn import DQN
from keras.models import load_model
from rl.util import logger
class DQNFreeze(DoubleDQN):
'''
Extends DQN agent to freeze target Q network
and periodically update them to the weights of the
exploratio... | import os
import numpy as np
from rl.agent.double_dqn import DoubleDQN
from rl.agent.dqn import DQN
from keras.models import load_model
from rl.util import logger
class DQNFreeze(DoubleDQN):
'''
Extends DQN agent to freeze target Q network
and periodically update them to the weights of the
exploratio... | mit | Python |
38efa9aa11f949fc8bd0b6c4d1a673ca3416dd3c | Fix up iterator implementation in LISTALLOBJECTs | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | groundstation/transfer/request_handlers/listallobjects.py | groundstation/transfer/request_handlers/listallobjects.py | import groundstation.transfer.request
from groundstation import settings
from groundstation import logger
log = logger.getLogger(__name__)
def chunks(l, n):
""" Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i+n]
def handle_listallobjects(self):
if not ... | import groundstation.transfer.request
from groundstation import settings
from groundstation import logger
log = logger.getLogger(__name__)
def chunks(l, n):
""" Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i+n]
def handle_listallobjects(self):
if not ... | mit | Python |
1fc0026aa72f7fcf66c221de402971023361e6c3 | implement memo logger | arskom/spyne,arskom/spyne,arskom/spyne | spyne/util/memo.py | spyne/util/memo.py |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | lgpl-2.1 | Python |
ae044f507f3bcf508648b1a73a802b657009cd48 | fix nxos_reboot command format (#30549) | thaim/ansible,thaim/ansible | lib/ansible/modules/network/nxos/nxos_reboot.py | lib/ansible/modules/network/nxos/nxos_reboot.py | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | mit | Python |
b8ed081ac4cc5953aaf5b1a2091fefa59d375bf1 | Add logging for extension | JIghtuse/uno-image-manipulation-example | uno_image.py | uno_image.py | """
Example usage of UNO, graphic objects and networking in LO extension
"""
import logging
import uno
import unohelper
from com.sun.star.task import XJobExecutor
class ImageExample(unohelper.Base, XJobExecutor):
'''Class that implements the service registered in LibreOffice'''
def __init__(self, context):
... | """
Example usage of UNO, graphic objects and networking in LO extension
"""
import uno
import unohelper
from com.sun.star.task import XJobExecutor
class ImageExample(unohelper.Base, XJobExecutor):
'''Class that implements the service registered in LibreOffice'''
def __init__(self, context):
self.con... | mpl-2.0 | Python |
77e09f2f085bc894c1f45e94662e32a981e9b0db | Convert Chinese quotation | fan-jiang/Dujing | PythonScript/Helper/Helper.py | PythonScript/Helper/Helper.py | # This Python file uses the following encoding: utf-8
def main():
try:
fileName = "MengZi_Traditional.md"
filePath = "../../source/" + fileName
content = None
with open(filePath,'r') as file:
content = file.read().decode("utf-8")
content = content.replace(u"「",u'“... | def main():
try:
fileName = "MengZi_Traditional.md"
filePath = "../../source/" + fileName
with open(filePath, 'r') as file:
for line in file:
print line
except IOError:
print ("The file (" + filePath + ") does not exist.")
if __name__ == '__main__':
... | mit | Python |
35825bbf06d7eb98c9e06cbd98e610659627c3d4 | ajuste conta dv | thiagosm/pyboleto,thiagosm/pyboleto | pyboleto/bank/safra.py | pyboleto/bank/safra.py | # -*- coding: utf-8 -*-
from ..data import BoletoData, CustomProperty
class BoletoSafra(BoletoData):
"""
Boleto Safra
"""
agencia_cedente = CustomProperty('agencia_cedente', 5)
conta_cedente = CustomProperty('conta_cedente', 8)
conta_cedente_dv = CustomProperty('conta_cedente_dv',1)
noss... | # -*- coding: utf-8 -*-
from ..data import BoletoData, CustomProperty
class BoletoSafra(BoletoData):
"""
Boleto Safra
"""
agencia_cedente = CustomProperty('agencia_cedente', 5)
conta_cedente = CustomProperty('conta_cedente', 8)
conta_cedente_dv = CustomProperty('conta_cedente_dv',1)
noss... | bsd-3-clause | Python |
670bc221b7af6398c90dbbde64feb22003c97690 | Revert "Violate architecture (on purpose)" | terceiro/squad,terceiro/squad,terceiro/squad,terceiro/squad | squad/api/views.py | squad/api/views.py | from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden
from django.http import HttpResponse
import logging
from squad.http import read_file_upload
from squad.core.... | from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseForbidden
from django.http import HttpResponse
import logging
# an architecture violation
from squad.frontend import vie... | agpl-3.0 | Python |
d8241adb51dcb81b99013aa23744a7a4a45f7d84 | fix self importer | kronenthaler/mod-pbxproj,dayongxie/mod-pbxproj | mod_pbxproj.py | mod_pbxproj.py | # MIT License
#
# Copyright (c) 2016 Ignacio Calderon aka kronenthaler
#
# 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,... | # MIT License
#
# Copyright (c) 2016 Ignacio Calderon aka kronenthaler
#
# 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,... | mit | Python |
b221251b13882789c2ed95e4cd24b2327e068711 | Bump @graknlabs_client_java and @graknlabs_benchmark | lolski/grakn,lolski/grakn,graknlabs/grakn,graknlabs/grakn,graknlabs/grakn,lolski/grakn,lolski/grakn,graknlabs/grakn | dependencies/graknlabs/dependencies.bzl | dependencies/graknlabs/dependencies.bzl | #
# GRAKN.AI - THE KNOWLEDGE GRAPH
# Copyright (C) 2018 Grakn Labs Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later v... | #
# GRAKN.AI - THE KNOWLEDGE GRAPH
# Copyright (C) 2018 Grakn Labs Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later v... | agpl-3.0 | Python |
7b1d8bd1b2a8b1cb78ec9ab13b61acde977e5642 | remove ability to create/delete volumes on v2 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/views/volume.py | api/v2/views/volume.py | import django_filters
from rest_framework import viewsets
from core.models import Volume
from api.v2.serializers.details import VolumeSerializer
from core.query import only_current_source
class VolumeFilter(django_filters.FilterSet):
min_size = django_filters.NumberFilter(name="size", lookup_type='gte')
max_s... | import django_filters
from rest_framework import viewsets
from core.models import Volume
from api.v2.serializers.details import VolumeSerializer
from core.query import only_current_source
class VolumeFilter(django_filters.FilterSet):
min_size = django_filters.NumberFilter(name="size", lookup_type='gte')
max_s... | apache-2.0 | Python |
daee45e358f61d2e9cfef109efd9f474f7e91a4d | Add viz import to top level __init__ | pycroscopy/pycroscopy | pycroscopy/__init__.py | pycroscopy/__init__.py | """
The Pycroscopy package.
Submodules
----------
.. autosummary::
:toctree: _autosummary
core
"""
from . import core
from .core import *
from .io import translators
from . import analysis
from . import processing
from . import viz
from .__version__ import version as __version__
from .__version__ import t... | """
The Pycroscopy package.
Submodules
----------
.. autosummary::
:toctree: _autosummary
core
"""
from . import core
from .core import *
from .io import translators
from . import analysis
from . import processing
from .__version__ import version as __version__
from .__version__ import time as __time__
_... | mit | Python |
efa4aede4b9faa9f0fc8639e4495ca8e98127d15 | Bump @graknlabs_verification | lolski/grakn,lolski/grakn,graknlabs/grakn,graknlabs/grakn,graknlabs/grakn,lolski/grakn,graknlabs/grakn,lolski/grakn | dependencies/graknlabs/dependencies.bzl | dependencies/graknlabs/dependencies.bzl | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | agpl-3.0 | Python |
dd83da792fbe1c90da855fe7d298f446a839f8ca | change for localhost in door.py | cyplp/botanik,cyplp/botanik,cyplp/botanik,cyplp/botanik | paulla.ircbot/src/paulla/ircbot/plugins/door.py | paulla.ircbot/src/paulla/ircbot/plugins/door.py | import irc3
from irc3.plugins.cron import cron
import requests
from datetime import datetime
@irc3.plugin
class Door:
"""
Door state plugin
"""
def __init__(self, bot):
self.bot = bot
self.log = self.bot.log
@irc3.event(irc3.rfc.MY_PRIVMSG)
def question(self, mask, event, tar... | import irc3
from irc3.plugins.cron import cron
import requests
from datetime import datetime
@irc3.plugin
class Door:
"""
Door state plugin
"""
def __init__(self, bot):
self.bot = bot
self.log = self.bot.log
@irc3.event(irc3.rfc.MY_PRIVMSG)
def question(self, mask, event, tar... | bsd-3-clause | Python |
1916f45ed5d6a77a585153a4daacc8a6ab48b3a3 | fix conftest.py | dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,dit/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,Autoplectic/dit | dit/conftest.py | dit/conftest.py | """
Configuration for tests.
"""
from hypothesis import settings
settings.register_profile("dit", deadline=None)
settings.load_profile("dit")
| """
Configuration for tests.
"""
from hypothesis import settings
settings.default.deadline = None | bsd-3-clause | Python |
7d43e6fd794fa1ef942a39937a653d5b18e867de | reorganize automatic dashboard | probml/pyprobml,probml/pyprobml,probml/pyprobml,probml/pyprobml | .github/scripts/create_dashboard.py | .github/scripts/create_dashboard.py | import os
from glob import glob
statuses = glob("workflow_testing_indicator/notebooks/*/*/*.png")
user = "probml"
base_url = f"https://github.com/{user}/pyprobml/tree/"
get_url = lambda x: f'<img width="20" alt="image" src=https://raw.githubusercontent.com/{user}/pyprobml/{x}>'
get_nb_url = lambda x: os.path.join(base... | import os
from glob import glob
statuses = glob("workflow_testing_indicator/notebooks/*/*/*.png")
user = "probml"
base_url = f"https://github.com/{user}/pyprobml/tree/"
get_url = lambda x: f'<img width="20" alt="image" src=https://raw.githubusercontent.com/{user}/pyprobml/{x}>'
get_nb_url = lambda x: os.path.join(base... | mit | Python |
2bac8c8df7a6f99fdc8a4efbdf2a094d3c6a7bae | fix link type data | OCA/e-commerce,OCA/e-commerce,OCA/e-commerce | product_template_multi_link/__manifest__.py | product_template_multi_link/__manifest__.py | # Copyright 2017-Today GRAP (http://www.grap.coop).
# @author Sylvain LE GAL <https://twitter.com/legalsylvain>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Multi Links (Template)",
"version": "13.0.1.1.0",
"category": "Generic Modules",
"author": "GRAP, ACSONE SA/... | # Copyright 2017-Today GRAP (http://www.grap.coop).
# @author Sylvain LE GAL <https://twitter.com/legalsylvain>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Multi Links (Template)",
"version": "13.0.1.1.0",
"category": "Generic Modules",
"author": "GRAP, ACSONE SA/... | agpl-3.0 | Python |
e19a99a555cd39cd380b7ede12da2190eb164eec | Make CSV errors into warnings | alephdata/ingestors | ingestors/tabular/csv.py | ingestors/tabular/csv.py | import io
import csv
import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.encoding import EncodingSupport
from ingestors.support.table import TableSupport
from ingestors.exc import ProcessingException
log = logging.getLogger(__name__)
class CSVIngestor(Inges... | import io
import csv
import logging
from followthemoney import model
from ingestors.ingestor import Ingestor
from ingestors.support.encoding import EncodingSupport
from ingestors.support.table import TableSupport
from ingestors.exc import ProcessingException
log = logging.getLogger(__name__)
class CSVIngestor(Inges... | mit | Python |
3c0e18944c7ff712288ccb16e439e07d4db0b3c1 | Fix init migration dependency | kelvan/cmsplugin-date,kelvan/cmsplugin-date | cmsplugin_date/migrations/0001_initial.py | cmsplugin_date/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0003_auto_20140926_2347'),
]
operations = [
migrations.CreateModel(
name='Date',
fields=[
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Date',
fields=[
('cmsplugin_ptr', models.OneToO... | mit | Python |
43b992c09b092391e95b5a1893b6c19855482ff7 | fix autoconf header | authmillenon/RIOT,RIOT-OS/RIOT,kYc0o/RIOT,miri64/RIOT,kYc0o/RIOT,authmillenon/RIOT,jasonatran/RIOT,kaspar030/RIOT,ant9000/RIOT,RIOT-OS/RIOT,authmillenon/RIOT,kaspar030/RIOT,RIOT-OS/RIOT,OTAkeys/RIOT,ant9000/RIOT,jasonatran/RIOT,kYc0o/RIOT,ant9000/RIOT,kYc0o/RIOT,kYc0o/RIOT,jasonatran/RIOT,ant9000/RIOT,OTAkeys/RIOT,Oleg... | dist/tools/kconfiglib/riot_kconfig.py | dist/tools/kconfiglib/riot_kconfig.py | """ RIOT customization of Kconfig """
import argparse
import sys
from kconfiglib import Kconfig, KconfigError
class RiotKconfig(Kconfig):
""" RIOT adaption of Kconfig class """
def _parse_help(self, node):
""" Parses the help section of a node, removing Doxygen markers """
doxygen_markers = [... | """ RIOT customization of Kconfig """
import argparse
import sys
from kconfiglib import Kconfig, KconfigError
class RiotKconfig(Kconfig):
""" RIOT adaption of Kconfig class """
def _parse_help(self, node):
""" Parses the help section of a node, removing Doxygen markers """
doxygen_markers = [... | lgpl-2.1 | Python |
6d7c21979a741e60053faf6d4e444ad4bf01dcde | Fix unittests | thoas/django-backward | backward/backends/session.py | backward/backends/session.py | try:
import cPickle as pickle
except ImportError:
import pickle
from .base import Backend
from backward import settings
class SessionBackend(Backend):
def get_url_redirect(self, request):
return request.session.get(settings.URL_REDIRECT_NAME, None)
def save_url_redirect(self, request, respo... | try:
import cPickle as pickle
except ImportError:
import pickle
from .base import Backend
from backward import settings
class SessionBackend(Backend):
def get_url_redirect(self, request):
return request.session.get(settings.URL_REDIRECT_NAME, None)
def save_url_redirect(self, request, respo... | mit | Python |
5c87c2bba8a95db865c11545df6d0405abd8fbfd | Update demo for prediction. (#6789) | dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost | demo/guide-python/predict_first_ntree.py | demo/guide-python/predict_first_ntree.py | import os
import numpy as np
import xgboost as xgb
from sklearn.datasets import load_svmlight_file
CURRENT_DIR = os.path.dirname(__file__)
train = os.path.join(CURRENT_DIR, "../data/agaricus.txt.train")
test = os.path.join(CURRENT_DIR, "../data/agaricus.txt.test")
def native_interface():
# load data in do traini... | import os
import numpy as np
import xgboost as xgb
# load data in do training
CURRENT_DIR = os.path.dirname(__file__)
dtrain = xgb.DMatrix(os.path.join(CURRENT_DIR, '../data/agaricus.txt.train'))
dtest = xgb.DMatrix(os.path.join(CURRENT_DIR, '../data/agaricus.txt.test'))
param = {'max_depth': 2, 'eta': 1, 'objective':... | apache-2.0 | Python |
fdbaaa6c1f20a48d0891106455c91d600c8236f7 | Change client.skia.fyi ports | eunchong/build,eunchong/build,eunchong/build,eunchong/build | masters/master.client.skia.fyi/master_site_config.py | masters/master.client.skia.fyi/master_site_config.py | # Copyright 2014 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.
"""ActiveMaster definition."""
from config_bootstrap import Master
class SkiaFYI(Master.Master3):
project_name = 'SkiaFYI'
master_port = 8098
slave... | # Copyright 2014 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.
"""ActiveMaster definition."""
from config_bootstrap import Master
class SkiaFYI(Master.Master3):
project_name = 'SkiaFYI'
master_port = 8094
slave... | bsd-3-clause | Python |
9a688a0311cbf802bc541e267afac968bcf7ae2c | break down sample with a little bit extra info and show each step along the way | gilwo/ocv-dev-tests | ocv_image_artihmetic.py | ocv_image_artihmetic.py | import numpy as np
import cv2 as cv
def ims(img, key, windows_name='dummy'):
cv.destroyAllWindows()
cv.imshow(windows_name, img)
k = 0
while k != ord(key):
k = cv.waitKey(10)
cv.destroyAllWindows()
# blue = np.zeros((300,512,3), np.uint8)
# img = cv.imread('messi5.jpg')
# main image
img ... | import numpy as np
import cv2 as cv
blue = np.zeros((300,512,3), np.uint8)
img = cv.imread('messi5.jpg')
cv.imshow('b', blue)
k = 0
while k != ord('q'):
k = cv.waitKey(100)
cv.destroyAllWindows() | mit | Python |
4a12f00012b1a49d5a3b6876c563a58ab4583b26 | Add comments and MSVS settings | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp | lib/node_modules/@stdlib/math/base/blas/dasum/binding.gyp | {
'targets': [
{
# The target name should match the add-on export name:
'target_name': 'addon',
# Allow developer to choose whether to build a static or shared library:
'type': '<(library)',
# Settings that should be applied when a target's object files are used as linker input:
... | {
"targets": [
{
"target_name": "addon",
"link_settings": {
"libraries": [
"<(module_root_dir)/src/c_dasum.o",
"<(module_root_dir)/src/dasum.o",
"<(module_root_dir)/src/dasumsub.o"
]
},
"include_dirs": [
"<!(node -e \"require('nan')\")"... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.