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 |
|---|---|---|---|---|---|---|---|---|
8bfb5470d1b44ab2827ef1ae5d46db922aa65cf5 | print atr/id in hex | sighmon/Key-Master | keymaster.py | keymaster.py | #######################################################
## Key Master - Hackerspace Adelaide NFC Door reader ##
#######################################################
# scard documentation:
# http://pyscard.sourceforge.net/epydoc/smartcard.scard.scard-module.html
# TODO: Post successful card scan to hackadl.org
imp... | #######################################################
## Key Master - Hackerspace Adelaide NFC Door reader ##
#######################################################
# scard documentation:
# http://pyscard.sourceforge.net/epydoc/smartcard.scard.scard-module.html
# TODO: Post successful card scan to hackadl.org
imp... | mit | Python |
eeadb637162bc65d5d4c3efcd70feecdd3c262f2 | prepare for release | chfw/pyexcel-io,chfw/pyexcel-io,fuhrysteve/pyexcel-io,fuhrysteve/pyexcel-io | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary'
]
intersphinx_mapping = {
'pyexcel': ('http://pyexcel.readthedocs.org/en/latest/', None)
}
spelling_word_list_filename = 'spelling_wordlis... | # -*- coding: utf-8 -*-
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary'
]
intersphinx_mapping = {
'pyexcel': ('http://pyexcel.readthedocs.org/en/latest/', None)
}
spelling_word_list_filename = 'spelling_wordlis... | bsd-3-clause | Python |
d0928721f8368a7aa70887c5ce241340931c3063 | Fix SRID in migration | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | geotrek/tourism/migrations/0035_auto_20221003_0946.py | geotrek/tourism/migrations/0035_auto_20221003_0946.py | # Generated by Django 3.2.15 on 2022-10-03 09:46
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('tourism', '0034_touristicevent_participants'),
... | # Generated by Django 3.2.15 on 2022-10-03 09:46
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tourism', '0034_touristicevent_participants'),
]
operations = [
... | bsd-2-clause | Python |
c2280b409841816a55d37d22fdf5496b2bc2fd78 | Cover the case where the action.output is None | juju/python-libjuju,juju/python-libjuju | juju/action.py | juju/action.py | from . import model
class Action(model.ModelEntity):
def __init__(self, entity_id, model, history_index=-1, connected=True):
super().__init__(entity_id, model, history_index, connected)
self.results = {}
self._status = self.data['status']
@property
def status(self):
retur... | from . import model
class Action(model.ModelEntity):
def __init__(self, entity_id, model, history_index=-1, connected=True):
super().__init__(entity_id, model, history_index, connected)
self.results = {}
self._status = self.data['status']
@property
def status(self):
retur... | apache-2.0 | Python |
073b55113ac91b2f6fcfbebe9550f0740f8149d4 | Allow JXAAS_URL to be configured as an env var | jxaas/cli | jxaas/utils.py | jxaas/utils.py | import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password... | import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
| apache-2.0 | Python |
7276b5a54afe424070e373850756797cad93c434 | Remove module that breaks autodoc | lxc/pylxd,lxc/pylxd | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | apache-2.0 | Python |
3ed2a97c488274bf0c43b3b69582ddfb7b928918 | fix version typo | mprefer/findingaids,emory-libraries/findingaids,emory-libraries/findingaids,mprefer/findingaids | findingaids/__init__.py | findingaids/__init__.py | __version_info__ = (1, 0, 8, 'pre')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
#THIS IS DUPLICATE CODE FROM DWRANGLER AND SHOULD EVENTUALLY ... | __version_info__ = (1, 0, 8, 'pre'
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join(str(i) for i in __version_info__[:-1])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
#THIS IS DUPLICATE CODE FROM DWRANGLER AND SHOULD EVENTUALLY B... | apache-2.0 | Python |
c27d799ad81f1a11799c217eae9872880246a24e | Revert default webdriver to Firefox | ei-grad/docker-selenium-screenshot,ei-grad/docker-selenium-screenshot | selenium_screenshot.py | selenium_screenshot.py | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Firefox"))
class Retr... | from threading import RLock, local
from multiprocessing.pool import ThreadPool
from os import environ as ENV
import logging.config
from flask import Flask, request
from selenium import webdriver
logging.basicConfig()
app = Flask(__name__)
Driver = getattr(webdriver, ENV.get("WEBDRIVER", "Chrome"))
class Retry... | mit | Python |
b3c549cb618ef57ff46f7120a4c1e039a087b6db | fix DEBUG for __init__.py Conflicts: server/app/__init__.py | jackzhao-mj/ok,Cal-CS-61A-Staff/ok,jackzhao-mj/ok,Cal-CS-61A-Staff/ok,jackzhao-mj/ok,jordonwii/ok,jordonwii/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,Cal-CS-61A-Staff/ok,jordonwii/ok,jordonwii/ok,jackzhao-mj/ok | server/app/__init__.py | server/app/__init__.py | """
Initialize Flask app.
"""
from flask import Flask
import os
from werkzeug.debug import DebuggedApplication
app = Flask('app') #pylint: disable=invalid-name
from app.models import MODEL_BLUEPRINT
from app import constants
from app import exceptions
from app import utils
from app import api
from app import auth
f... | """
Initialize Flask app.
"""
from flask import Flask
import os
from werkzeug.debug import DebuggedApplication
app = Flask('app') #pylint: disable=invalid-name
from app.models import MODEL_BLUEPRINT
from app import constants
from app import exceptions
from app import utils
from app import api
from app import auth
f... | apache-2.0 | Python |
738dff04c9a65dba858d522dd743adaa9bafb998 | fix hackernews harvester | ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder,ScorpionResponse/freelancefinder | freelancefinder/remotes/sources/hackernews/harvest.py | freelancefinder/remotes/sources/hackernews/harvest.py | """Harvest process for the HackerNews Source."""
from collections import defaultdict
import logging
from hackernews import HackerNews
from jobs.models import Post
logger = logging.getLogger(__name__)
class Harvester(object):
"""Simple Harvester to gather hackernews posts."""
def __init__(self, source):
... | """Harvest process for the HackerNews Source."""
from collections import defaultdict
import logging
from hackernews import HackerNews
from jobs.models import Post
logger = logging.getLogger(__name__)
class Harvester(object):
"""Simple Harvester to gather hackernews posts."""
def __init__(self, source):
... | bsd-3-clause | Python |
0ff65f4ab9d18aea7091c97efc8436c2e7f67b02 | use the actual message from the exception | ceph/ceph-installer,ceph/ceph-installer,ceph/mariner-installer,ceph/ceph-installer | mariner/hooks.py | mariner/hooks.py | from celery.task.control import inspect
from errno import errorcode
from mariner import models
from mariner.util import which
from pecan import render
from pecan.hooks import PecanHook
from sqlalchemy.exc import OperationalError
from webob.exc import WSGIHTTPException
import logging
logger = logging.getLogger(__name_... | from celery.task.control import inspect
from errno import errorcode
from mariner import models
from mariner.util import which
from pecan import render
from pecan.hooks import PecanHook
from sqlalchemy.exc import OperationalError
from webob.exc import WSGIHTTPException
import logging
logger = logging.getLogger(__name_... | mit | Python |
8cfc4ee829fda9c3aa876d4ac5d4c97a9687bf12 | Update migration with new help text | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | geotrek/tourism/migrations/0035_auto_20221003_0946.py | geotrek/tourism/migrations/0035_auto_20221003_0946.py | # Generated by Django 3.2.15 on 2022-10-03 09:46
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('tourism', '0034_touristicevent_participants'),
... | # Generated by Django 3.2.15 on 2022-10-03 09:46
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('tourism', '0034_touristicevent_participants'),
... | bsd-2-clause | Python |
54b0c3260f882329fa5a199ab822832b8f7a914a | remove unused import | buxx/intelligine | intelligine/synergy/event/transport/TakeableAction.py | intelligine/synergy/event/transport/TakeableAction.py | from intelligine.synergy.event.move.MoveAction import MoveAction
from synergine.synergy.event.Action import Action
from intelligine.synergy.event.transport.TakeableEvent import TakeableEvent
from intelligine.cst import CANT_PUT_STILL, BRAIN_PART_TAKE
from synergine.synergy.event.exception.ActionAborted import ActionAbo... | from intelligine.synergy.event.move.MoveAction import MoveAction
from synergine.synergy.event.Action import Action
from intelligine.synergy.event.transport.TakeableEvent import TakeableEvent
from intelligine.cst import CANT_PUT_STILL, BRAIN_SCHEMA, BRAIN_PART_TAKE
from synergine.synergy.event.exception.ActionAborted im... | apache-2.0 | Python |
b2f1fd2112fe6a89e010c04ff7f9b05c598e9a26 | trim to just data | williamalu/mimo_usrp | scripts/received_trimmer.py | scripts/received_trimmer.py | import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
received1 = np.fromfile("../data/received_1.bin", dtype=np.complex64)
received2 = np.fromfile("../data/received_2.bin", dtype=np.complex64)
max_compare = np.max(received1)
beginning = 0
for i, val in enumerate(np.absol... | import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
received1 = np.fromfile("../data/received_1.bin", dtype=np.complex64)
received2 = np.fromfile("../data/received_2.bin", dtype=np.complex64)
max_compare = np.max(received1)
beginning = 0
for i, val in enumerate(np.absol... | mit | Python |
b825c8d0aec06d4295e22fa615a31e5182676273 | Update version to 3.18.1 | sot/chandra_aca,sot/chandra_aca | chandra_aca/__init__.py | chandra_aca/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .transform import *
__version__ = '3.18.1'
def test(*args, **kwargs):
"""
Run py.test unit tests.
"""
import testr
return testr.test(*args, **kwargs)
| # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .transform import *
__version__ = '3.18'
def test(*args, **kwargs):
"""
Run py.test unit tests.
"""
import testr
return testr.test(*args, **kwargs)
| bsd-2-clause | Python |
0f07aac4a2e3b26448982aae7776f8ea2324ed83 | Add a description to setup.py | erik/sketches,erik/sketches,erik/sketches,erik/sketches,erik/sketches,erik/sketches,erik/sketches,erik/sketches | projects/squabble/setup.py | projects/squabble/setup.py | from setuptools import setup
__version__ = '0.0.0'
setup(
name='squabble',
version=__version__,
description='An extensible linter for SQL',
author='Erik Price',
url='https://github.com/erik/squabble',
packages=['squabble'],
entry_points={
'console_scripts': [
'squabbl... | from setuptools import setup
__version__ = '0.0.0'
setup(
name='squabble',
version=__version__,
description='TODO',
author='Erik Price',
url='https://github.com/erik/squabble',
packages=['squabble'],
entry_points={
'console_scripts': [
'squabble = squabble:main',
... | agpl-3.0 | Python |
507a4f7f931c12c9883ff1644f5d0cc44270d5c2 | Reorder keys that were being declared in the wrong place | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/thorium/status.py | salt/thorium/status.py | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | # -*- coding: utf-8 -*-
'''
This thorium state is used to track the status beacon events and keep track of
the active status of minions
.. versionadded:: 2016.11.0
'''
# Import python libs
from __future__ import absolute_import
import time
import fnmatch
def reg(name):
'''
Activate this register to turn on a... | apache-2.0 | Python |
6bd5ec725b69d41e3548d1dee0e612faa7f3ab87 | bump to 0.1.22.b2 | jepegit/cellpy,jepegit/cellpy | cellpy/_version.py | cellpy/_version.py | version_info = (0, 1, 22, "b2")
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 1, 22, "b1")
__version__ = '.'.join(map(str, version_info))
| mit | Python |
64695c9d1353be9bc6dac0be74f4cc804ea18e89 | Fix browsertest | aknuds1/docker-dd-agent | checks.d/browsertest.py | checks.d/browsertest.py | #!/usr/bin/env python
from checks import AgentCheck
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
import sys
class BrowserTestCheck(AgentCheck):
def check(self, instance):
def get_projects_container_elem():
return driver.find_element_by_css_selector('... | #!/usr/bin/env python
# from checks import AgentCheck
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
import sys
class BrowserTestCheck(AgentCheck):
def check(self, instance):
def get_projects_container_elem():
return driver.find_element_by_css_selector... | mit | Python |
f79ee3a60f23b61ee2e4b9459397c8694370b61d | Fix bad URL kwarg in team service | stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,fin/froide | froide/team/services.py | froide/team/services.py | from __future__ import unicode_literals
import hashlib
import hmac
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.crypto import constant_time_compare
from django.urls import reverse
from django.utils.translation import uget... | from __future__ import unicode_literals
import hashlib
import hmac
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.crypto import constant_time_compare
from django.urls import reverse
from django.utils.translation import uget... | mit | Python |
dc24e8e42e6b6110ec9107c4156196cbef55ae76 | support ssl | EnTeQuAk/nobot,varunarya10/django-recaptcha,varunarya10/django-recaptcha,Elec/django-recaptcha,infoxchange/django-recaptcha,JioCloud/django-recaptcha,EnTeQuAk/nobot,praekelt/django-recaptcha,Elec/django-recaptcha,praekelt/django-recaptcha,infoxchange/django-recaptcha | captcha/fields.py | captcha/fields.py | import sys
from django import forms
from django.conf import settings
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from captcha import client
from captcha import utils
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_er... | import sys
from django import forms
from django.conf import settings
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from captcha import client
from captcha import utils
from captcha.widgets import ReCaptcha
class ReCaptchaField(forms.CharField):
default_er... | bsd-3-clause | Python |
0f5bf394920787cc7333a0ebb538f219eb70671c | Add label name filter for autocomplete purposes | City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi,stephawe/kerrokantasi,City-of-Helsinki/kerrokantasi,City-of-Helsinki/kerrokantasi,stephawe/kerrokantasi | democracy/views/label.py | democracy/views/label.py | from rest_framework import serializers, viewsets, filters
import django_filters
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelFilter(django_filters.FilterSet):
label = django_filters.CharFilter(lookup_type='icontains')
class Meta:
model = Label
... | from rest_framework import serializers, viewsets
from democracy.models import Label
from democracy.pagination import DefaultLimitPagination
class LabelSerializer(serializers.ModelSerializer):
class Meta:
model = Label
fields = ('id', 'label')
class LabelViewSet(viewsets.ReadOnlyModelViewSet):
... | mit | Python |
a263fa17731b401f7978f44efa8c48946b1fcdd4 | Make participants' ID and name optional in tourney match events | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/events/tourney.py | byceps/events/tourney.py | """
byceps.events.tourney
~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from typing import Optional
from .base import _BaseEvent
# tourney
@dataclass(frozen=True)
class _TourneyEvent(_BaseEvent):
tourney... | """
byceps.events.tourney
~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from .base import _BaseEvent
# tourney
@dataclass(frozen=True)
class _TourneyEvent(_BaseEvent):
tourney_id: str
tourney_title: ... | bsd-3-clause | Python |
191419c4bc27593a6e7d89e61bc9fc697576f3ab | Rename test.plugins to test_plugins | masayukig/tempest,tudorvio/tempest,hayderimran7/tempest,tonyli71/tempest,zsoltdudas/lis-tempest,dkalashnik/tempest,LIS/lis-tempest,Juraci/tempest,manasi24/tempest,vedujoshi/tempest,redhat-cip/tempest,cisco-openstack/tempest,nunogt/tempest,alinbalutoiu/tempest,nunogt/tempest,Juraci/tempest,Juniper/tempest,pczerkas/tempe... | tempest/test_discover/plugins.py | tempest/test_discover/plugins.py | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 | Python |
37d160825b458b466421d2946a3549e7b519976c | Increase key length for larger datasets. | BradNeuberg/personal-photos-model | src/siamese_network_bw/siamese_utils.py | src/siamese_network_bw/siamese_utils.py | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | import numpy as np
import constants
def mean_normalize(entry):
"""
Mean normalizes a pixel vector. Entry is a numpy array of unrolled pixel vectors with
two side by side facial images for each entry.
"""
entry -= np.mean(entry, axis=0)
return entry
def get_key(idx):
"""
Each image pai... | apache-2.0 | Python |
4442fdce75be7a7e86bd90ad52b32476f483a30b | support ss-panel V3 mu api | crazygold/shadowsocks-rm,crazygold/shadowsocks-rm | shadowsocks/servers.py | shadowsocks/servers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 mengskysama
#
# 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 requ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 mengskysama
#
# 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 requ... | apache-2.0 | Python |
d64d365d621cb9db538ad7fbc76077e7927ce968 | Fix SF #3288383: In Python 3.2, compiled Python files are no longer saved as .pyc files, but are instead saved in the __pycache__ folder. This breaks the clear_comtypes_cache script, which assumes only files are found in the cache. | denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes,denfromufa/comtypes | clear_comtypes_cache.py | clear_comtypes_cache.py | import os
import sys
import shutil
from ctypes import windll
def is_cache():
try:
import comtypes.gen
except ImportError:
return
return comtypes.gen.__path__[0]
install_text = """\
When installing a new comtypes version, it is recommended to remove
the comtypes\gen directory and the automa... | import os, sys
from ctypes import windll
def is_cache():
try:
import comtypes.gen
except ImportError:
return
return comtypes.gen.__path__[0]
install_text = """\
When installing a new comtypes version, it is recommended to remove
the comtypes\gen directory and the automatically generated mo... | mit | Python |
110cce417e9e8a313c0a81372dc503aeee30843d | Bump version for new release | Mariocj89/dothub | dothub/_version.py | dothub/_version.py | __version__ = "0.15.0"
| __version__ = "0.14.6"
| mit | Python |
d32bd939f9e056342483724e1a74aa067d6b66b8 | Add comment_limit explicitly | NosajGithub/game_comment_scraper | game_comment_scraper.py | game_comment_scraper.py | """Given a reddit submission id, shows the top 5 comments from the 200 newest comments.
Pressing return shows a new set of comments, without repeating any comments shown before.
"""
import praw, time, os, sys
sub_id = sys.argv[1]
user_agent = ("Game comment scraper 1.0 by /u/NosajReddit" "https://github.com/NosajGith... | """Given a reddit submission id, shows the top 5 comments from the 200 newest comments.
Pressing return shows a new set of comments, without repeating any comments shown before.
"""
import praw, time, os, sys
sub_id = sys.argv[1]
user_agent = ("Game comment scraper 1.0 by /u/NosajReddit" "https://github.com/NosajGith... | mit | Python |
7951934aeb7678ff867e53a9c01daa6e4e883002 | Bump to version 0.9.1 | StreetVoice/django-celery-ses | djcelery_ses/__init__.py | djcelery_ses/__init__.py | __version__ = '0.9.1'
| __version__ = '0.9'
| mit | Python |
e5a397033c5720cd7d0ab321c05a8f1d12f4dc99 | Use raw command method to run all commands in wrapper | ethanal/tm | tm/tmux_wrapper.py | tm/tmux_wrapper.py | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | # -*- coding: utf-8 -*-
import subprocess
class SessionExists(Exception):
description = "Session already exists."
pass
class ServerConnectionError(Exception):
description = "tmux server is not currently running."
pass
class SessionDoesNotExist(Exception):
description = "Session does not exist... | mit | Python |
fdb00be8f068d008fcd032ecbba3ce29a4c0fcb9 | fix bug > GPIO.output() | yasokada/python-151113-lineMonitor,yasokada/python-151113-lineMonitor | toLearn/151126b.py | toLearn/151126b.py | import time
#--- selection of import based on the package ---
''' 1. with RPi.GPIO'''
import RPi.GPIO as GPIO
''' 2. without RPi.GPIO'''
#from dummyGPIO import CDummyGPIO
#GPIO = CDummyGPIO()
#-----------------
# TODO: 0m > dummyGPIO
GPIO.setmode(GPIO.BOARD)
#-------------------
# Pin# of RPi2 (changes according to... | import time
#--- selection of import based on the package ---
''' 1. with RPi.GPIO'''
#import RPi.GPIO as GPIO
''' 2. without RPi.GPIO'''
from dummyGPIO import CDummyGPIO
GPIO = CDummyGPIO()
#-----------------
# TODO: 0m > dummyGPIO
GPIO.setmode(GPIO.BOARD)
#-------------------
# Pin# of RPi2 (changes according to ... | mit | Python |
660904dcc22009dc2efe53c448b8d869d123c0df | Remove unused import | mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools | server/views/topics/maps.py | server/views/topics/maps.py | import logging
import flask
from flask import jsonify, request
from server import app
import server.util.file as file_util
import server.views.topics.apicache as apicache
from server.util.request import arguments_required, filters_from_args, api_error_handler
logger = logging.getLogger(__name__)
@app.route('/api/to... | import logging
import flask
from flask import jsonify, request
import requests
from server import app
import server.util.file as file_util
import server.views.topics.apicache as apicache
from server.util.request import arguments_required, filters_from_args, api_error_handler
logger = logging.getLogger(__name__)
@ap... | apache-2.0 | Python |
9b4447e9aa5f172fb9fd35ba4213a925288c74ef | check for mixed-indentation | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | odoo/addons/test_pylint/tests/test_pylint.py | odoo/addons/test_pylint/tests/test_pylint.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
try:
import pylint
except ImportError:
pylint = None
import subprocess
from distutils.version import LooseVersion
from os import devnull
from os.path import join
from odoo.tests.common import Tran... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
try:
import pylint
except ImportError:
pylint = None
import subprocess
from distutils.version import LooseVersion
from os import devnull
from os.path import join
from odoo.tests.common import Tran... | agpl-3.0 | Python |
06f4dc075193ffb70297b215f041b4e5d7c62449 | Add depth to global position in getposition.py | waterlinked/examples | getposition.py | getposition.py | """
Get position from Water Linked Underwater GPS
"""
import argparse
import json
import requests
def get_data(url):
try:
r = requests.get(url)
except requests.exceptions.RequestException as exc:
print("Exception occured {}".format(exc))
return None
if r.status_code != requests.cod... | """
Get position from Water Linked Underwater GPS
"""
import requests
import argparse
import json
def get_data(url):
try:
r = requests.get(url)
except requests.exceptions.RequestException as exc:
print("Exception occured {}".format(exc))
return None
if r.status_code != requests.co... | mit | Python |
f685236aa1bfee0049d09a97e7e4f7e7d855388f | add a test for get_option_name() | MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server | openerp/addons/base/tests/test_res_config.py | openerp/addons/base/tests/test_res_config.py | import unittest2
import openerp.tests.common as common
class test_res_config(common.TransactionCase):
def setUp(self):
super(test_res_config, self).setUp()
self.res_config = self.registry('res.config.settings')
self.menu_xml_id = 'base.menu_action_res_users'
self.full_field_name =... | import unittest2
import openerp.tests.common as common
class test_res_config(common.TransactionCase):
def setUp(self):
super(test_res_config, self).setUp()
self.res_config = self.registry('res.config.settings')
self.menu_xml_id = 'base.menu_action_res_users'
def test_00_get_option_pa... | agpl-3.0 | Python |
cd22543319e4c21b693f91768adcc1cd42aa08a3 | Remove this line - it is redundant and missing code coverage. | jwg4/qual,jwg4/calexicon | calexicon/fn/overflow.py | calexicon/fn/overflow.py | class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
| class OverflowDate(object):
def __init__(self, **info):
self.info = info
def isocalendar(self):
if 'isocalendar' in self.info:
return self.info['isocalendar']
return None
| apache-2.0 | Python |
ce78fa215f51ed9ab50c664afa1854a0d08e6cbf | fix map | AndersenLab/CeNDR,AndersenLab/CeNDR,AndersenLab/cegwas-web,AndersenLab/cegwas-web,AndersenLab/CeNDR,AndersenLab/cegwas-web,AndersenLab/cegwas-web,AndersenLab/CeNDR | cendr/__init__.py | cendr/__init__.py | import csv
import logging
from flask import Flask
from flask_restful import Api
from flask_debugtoolbar import DebugToolbarExtension
from models import *
from datetime import date, datetime
from urlparse import urljoin
# Fetch credentials
from gcloud import datastore
ds = datastore.Client(project="andersen-lab")
def ... | import csv
import logging
from flask import Flask
from flask_restful import Api
from flask_debugtoolbar import DebugToolbarExtension
from models import *
from datetime import date, datetime
from urlparse import urljoin
# Fetch credentials
from gcloud import datastore
ds = datastore.Client(project="andersen-lab")
def ... | mit | Python |
058922af6ef4876ea0c2e907ffde1b3694e77f38 | bump tensorflow from 1.15.2 to 1.15.4 in /components/kubeflow/dnntrainer/src (#4547) | kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines | components/kubeflow/dnntrainer/src/setup.py | components/kubeflow/dnntrainer/src/setup.py | # Copyright 2018 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 2018 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 |
2654bbac8241ebc5a6bc343ec32c9ee3bb066dc8 | resolve symlinks when creating loop devices | djs55/ffs,xapi-project/ffs,robertbreker/ffs,franciozzy/ffs | lib/losetup.py | lib/losetup.py | #!/usr/bin/env python
import os.path
import xapi
import commands
from common import log, run
# Use Linux "losetup" to create block devices from files
class Loop:
"""An active loop device"""
def __init__(self, path, loop):
self.path = path
self.loop = loop
def destroy(self, dbg):
r... | #!/usr/bin/env python
import xapi
import commands
from common import log, run
# Use Linux "losetup" to create block devices from files
class Loop:
"""An active loop device"""
def __init__(self, path, loop):
self.path = path
self.loop = loop
def destroy(self, dbg):
run(dbg, "losetu... | lgpl-2.1 | Python |
194f9a2645b7526daa5f9fce96f3ec1518ba906f | Remove unnecessary comment. | masamitsu-murase/pausable_unittest,masamitsu-murase/pausable_unittest | suspendable_unittest/dummy_suspender.py | suspendable_unittest/dummy_suspender.py |
import unittest
class Suspender(object):
def __init__(self):
self.add_actions()
def add_actions(self):
def shutdown(self, wake_after_sec=None):
self.suspend(("shutdown", wake_after_sec))
unittest.TestCase.shutdown = shutdown
def do_suspend(self, info):
... |
import unittest
class Suspender(object):
def __init__(self):
self.add_actions()
def add_actions(self):
def shutdown(self, wake_after_sec=None):
self.suspend(("shutdown", wake_after_sec))
unittest.TestCase.shutdown = shutdown
def do_suspend(self, info):
... | mit | Python |
d6cc69ee9a215b32e681f88d2a02fd55ddfcbbfb | Use math mode if backslash in string | mph-/lcapy | lcapy/latex.py | lcapy/latex.py | import re
sub_super_pattern = re.compile(r"([_\^]){([a-zA-Z]+)([0-9]*)}")
class Latex(object):
words = ('in', 'out', 'ref', 'rms', 'load', 'source', 'avg',
'mean', 'peak', 'pp', 'min', 'max', 'src', 'bat',
'cc', 'ee', 'dd', 'ss', 'ih', 'il', 'oh', 'ol')
def __init__(self, string):... | import re
sub_super_pattern = re.compile(r"([_\^]){([a-zA-Z]+)([0-9]*)}")
class Latex(object):
words = ('in', 'out', 'ref', 'rms', 'load', 'source', 'avg',
'mean', 'peak', 'pp', 'min', 'max', 'src', 'bat',
'cc', 'ee', 'dd', 'ss', 'ih', 'il', 'oh', 'ol')
def __init__(self, string):... | lgpl-2.1 | Python |
4f7fdd6281f04d99ecbe86a2039b0ffa0f8b4318 | add AWW to WAR | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | cgi-bin/afos/retrieve.py | cgi-bin/afos/retrieve.py | #!/usr/bin/env python
import pg
import cgi
import string
import os
import sys
def Main():
print 'Content-type: text/plain; charset=""'
print
print
try:
mydb = pg.connect('afos', 'iemdb', user='nobody')
except:
print 'Error Connecting to Database, please try again!'
sys.exit(0)
myForm = cgi.For... | #!/usr/bin/env python
import pg
import cgi
import string
import os
import sys
def Main():
print 'Content-type: text/plain; charset=""'
print
print
try:
mydb = pg.connect('afos', 'iemdb', user='nobody')
except:
print 'Error Connecting to Database, please try again!'
sys.exit(0)
myForm = cgi.For... | mit | Python |
b8639e44c3a827a47765a4c0b6affd3f4f7ef5aa | Test timing fix | lhupfeldt/jenkinsflow,lechat/jenkinsflow,lhupfeldt/jenkinsflow,lhupfeldt/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lechat/jenkinsflow,lhupfeldt/jenkinsflow | test/no_running_jobs_test.py | test/no_running_jobs_test.py | # Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from pytest import raises
from jenkinsflow.flow import serial, JobNotIdleException, is_mocked
from .framework import mock_api
def test_no_running_jobs():
with mock_api.api(__f... | # Copyright (c) 2012 - 2014 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from pytest import raises
from jenkinsflow.flow import serial, JobNotIdleException, is_mocked
from .framework import mock_api
def test_no_running_jobs():
with mock_api.api(__f... | bsd-3-clause | Python |
a47a7f387c1b6add51386e87d1bd97a4004fcaa0 | Update MimicSpeech.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | service/MimicSpeech.py | service/MimicSpeech.py | #########################################
# MimicSpeech.py
# description: Speech synthesis based on Mimic from the MyCroft AI project.
# categories: speech, sound
# more info @: http://myrobotlab.org/service/MimicSpeech
#########################################
# start the service
mimicspeech = Runtime.start('mimicspe... | #########################################
# MimicSpeech.py
# description: Speech synthesis based on Mimic from the MyCroft AI project.
# categories: speech, sound
# more info @: http://myrobotlab.org/service/MimicSpeech
#########################################
# start the service
mimicspeech = Runtime.start('mimicspe... | apache-2.0 | Python |
2ae23a3a691abfdd28c62aa23afc6beb39f79946 | update the test case. | rainwoodman/MP-sort,rainwoodman/MP-sort,rainwoodman/MP-sort | mpsort/test.py | mpsort/test.py | from binding import *
from mpi4py import MPI
import numpy
data = numpy.empty(1000, dtype=[('data', 'f4'), ('radix', ('i4', 2))])
data['data'] = numpy.arange(1000)[::-1]
data['radix'][:, 1] = numpy.arange(1000)[::-1]
data['radix'][:, 0] = -MPI.COMM_WORLD.rank
sort(data, orderby='radix')
alldata = MPI.COMM_WORLD.allgat... | from binding import *
from mpi4py import MPI
import numpy
data = numpy.empty(1000, dtype=[('data', 'f4'), ('radix', ('u8', 2))])
data['data'] = numpy.arange(1000)[::-1]
data['radix'][:, 1] = numpy.arange(1000)[::-1]
data['radix'][:, 0] = -MPI.COMM_WORLD.rank
sort(data, orderby='radix')
alldata = MPI.COMM_WORLD.allgat... | bsd-2-clause | Python |
c65f7d3b9305fad3037f3086256927b2e1c1f43e | Bump up dev version to 4.4.4.dev0 | dmsurti/mayavi,dmsurti/mayavi | mayavi/__init__.py | mayavi/__init__.py | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.4.dev0'
__requires__ = [
'apptools',
'traits',
'trait... | # Author: Prabhu Ramachandran, Gael Varoquaux
# Copyright (c) 2004-2014, Enthought, Inc.
# License: BSD Style.
""" A tool for easy and interactive visualization of data.
Part of the Mayavi project of the Enthought Tool Suite.
"""
__version__ = '4.4.3'
__requires__ = [
'apptools',
'traits',
'traitsui',... | bsd-3-clause | Python |
983b941ddc9a44a6bf1d381a5946679a2f833001 | Bump version | zepheira/pybibframe | lib/version.py | lib/version.py | #http://legacy.python.org/dev/peps/pep-0440/
version_info = ('0', '9', '3')
| #http://legacy.python.org/dev/peps/pep-0440/
version_info = ('0', '9', '2')
| apache-2.0 | Python |
4c0e258b7c55ada3f726a3485f509b3bae843915 | Set data_dir | sortelli/book_pivot,sortelli/book_pivot | cxml.py | cxml.py | import lxml.etree as ET
import yaml
import sys
import os
class CXML:
def __init__(self, dzc_file, data_dir, config):
self.dzc_file = dzc_file
self.data_dir = data_dir
self.dzc_root = ET.parse(self.dzc_file).getroot()
self.name = config['name']
self.facets = config['facets']
self.items ... | import lxml.etree as ET
import yaml
import sys
import os
class CXML:
def __init__(self, dzc_file, config):
self.dzc_root = ET.parse(dzc_file).getroot()
self.name = config['name']
self.facets = config['facets']
self.items = map(lambda item: item.attrib, self.dzc_root[0])
def save(self, cxm... | mit | Python |
b858d41c5b60fa7900fd0042da0ef564c588263a | Create encoder bindings | FabianGeiselhart/Brickpi-motors,FabianGeiselhart/Brickpi-motors | library/BrickPiM/__init__.py | library/BrickPiM/__init__.py | #!/usr/bin/env python
# coding: utf8
import serial
from struct import pack
from time import sleep
import RPi.GPIO as GPIO
class BrickPi:
def __init__(self, timeout=.1):
self.ser = serial.Serial("/dev/ttyAMA0")
self.ser.baudrate = 9600
self.ser.timeout = timeout
def updateSpeed(self,... | #!/usr/bin/env python
# coding: utf8
import serial
from struct import pack
from time import sleep
import RPi.GPIO as GPIO
class BrickPi:
def __init__(self, timeout=.1):
self.ser = serial.Serial("/dev/ttyAMA0")
self.ser.baudrate = 9600
self.ser.timeout = timeout
def updateSpeed(self,... | mit | Python |
d77e5e449ca3ee8ea7e08081a70ceb89a580fab0 | simplify tests down to just one with django test client. | xueyaodeai/DjangoWebsite,xueyaodeai/DjangoWebsite | lists/tests.py | lists/tests.py | from django.test import TestCase
class HomePageTest(TestCase):
def test_uses_home_template(self):
response = self.client.get('/')
self.assertTemplateUsed(response, 'home.html')
| from django.core.urlresolvers import resolve
from django.test import TestCase
from .views import home_page
class HomePageTest(TestCase):
def test_root_url_resolves_to_home_page_view(self):
found = resolve('/')
self.assertEqual(found.func, home_page)
def test_home_page_returns_correct_html(s... | mit | Python |
345588b1c542e60991719ec0ec02bc1de16d69b7 | bump version to v8.0.0rc1 | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupy/_version.py | cupy/_version.py | __version__ = '8.0.0rc1'
| __version__ = '8.0.0b5'
| mit | Python |
036a3eeebc06160589776ad1f612752cf6953ee1 | Document `HSS_CONNECTION_STRING` | agdsn/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,agdsn/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa | sipa/config/example.py | sipa/config/example.py | # -*- coding: utf-8 -*-
"""config.example
This is an example configuration file for SIPA, suggesting
defaults for deployment.
Every value not commented with "Must be set" has been given the
default value which is assigned in the comment.
"""
# The Secret key. It should ALWAYS be set and kept secret!
... | # -*- coding: utf-8 -*-
"""config.example
This is an example configuration file for SIPA, suggesting
defaults for deployment.
Every value not commented with "Must be set" has been given the
default value which is assigned in the comment.
"""
# The Secret key. It should ALWAYS be set and kept secret!
... | mit | Python |
be9b15de016234afb7bc1e252dc9d644fbd24f57 | add values() function for enumerations | dgulotta/puzzle-tools,dgulotta/puzzle-tools,dgulotta/puzzle-tools | puzzletools/enumeration.py | puzzletools/enumeration.py | class EnumerationMeta(type):
def __new__(cls,name,bases,dct):
if 'display_key' in dct:
dk = dct['display_key']
def __str__(self):
return getattr(self,dk)
dct.setdefault('__str__',__str__)
def __repr__(self):
return '< %s %s >'%... | class EnumerationMeta(type):
def __new__(cls,name,bases,dct):
if 'display_key' in dct:
dk = dct['display_key']
if '__str__' not in dct:
def __str__(self):
return getattr(self,dk)
dct['__str__']=__str__
if '__repr__' not... | mit | Python |
4cea26597f7669f3f17b6abb4b276aaa2d548956 | Make the open/close button async | SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff | client/bonehead/spiff.py | client/bonehead/spiff.py | import spiff
from bonehead import Plugin
from bonehead.ui import Page
from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork
import threading
class OpenClosePlugin(Plugin):
def newPage(self, name, args, ui):
api = spiff.API(args['url'], verify=False)
return OpenClosePage(api.sensor(args['sensor-id'])... | import spiff
from bonehead import Plugin
from bonehead.ui import Page
from PyQt4 import QtCore, QtGui, QtWebKit, QtNetwork
class OpenClosePlugin(Plugin):
def newPage(self, name, args, ui):
api = spiff.API(args['url'], verify=False)
return OpenClosePage(api.sensor(args['sensor-id']), ui)
class Open... | agpl-3.0 | Python |
cba0d91cc6db30f42aa1ad5d1f4d0c9f03606184 | switch mime-type from text/plain to kml | underbluewaters/marinemap,underbluewaters/marinemap,underbluewaters/marinemap | lingcod/studyregion/views.py | lingcod/studyregion/views.py | from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseServerError, HttpResponseForbidden
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from lingcod.common import mimetypes
from lingcod.common.utils import KmlWr... | from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseServerError, HttpResponseForbidden
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from lingcod.common import mimetypes
from lingcod.common.utils import KmlWr... | bsd-3-clause | Python |
00f5688d67603c98769df20c9f341276a75eaa8f | change in app starter | madcore-ai/containers,madcore-ai/containers,madcore-ai/containers,madcore-ai/containers | chatterbot/app.py | chatterbot/app.py | from flask import Flask, render_template, request
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
app = Flask(__name__)
english_bot = ChatBot("English Bot")
english_bot.set_trainer(ChatterBotCorpusTrainer)
english_bot.train("chatterbot.corpus.english")
@app.route("/")
def home(... | from flask import Flask, render_template, request
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
app = Flask(__name__)
english_bot = ChatBot("English Bot")
english_bot.set_trainer(ChatterBotCorpusTrainer)
english_bot.train("chatterbot.corpus.english")
@app.route("/")
def home(... | mit | Python |
917083e08866001990e572ba52459aa58b57a979 | Fix volatile db permissions | exekias/droplet,exekias/droplet,exekias/droplet | nazs/common.py | nazs/common.py | from .util import import_module
import logging
import os
def init():
"""
Initialize nazs environment, setup logging, processes and all
needed stuff for running nazs
"""
from django.core import management
from django.conf import settings
from .sudo import set_euid
set_euid()
# Sy... | from .util import import_module
import logging
def init():
"""
Initialize nazs environment, setup logging, processes and all
needed stuff for running nazs
"""
from django.core import management
# Sync volatile db, TODO set correct permissions
management.call_command('syncdb',
... | agpl-3.0 | Python |
436b422bb9ff35e512ad9729619c4bf4623e7707 | Update docstring. | riannucci/rietveldv2,riannucci/rietveldv2 | codereview/exceptions.py | codereview/exceptions.py | # Copyright 2011 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 agreed to in writing, ... | # Copyright 2011 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 agreed to in writing, ... | apache-2.0 | Python |
150ba511181f7f4f0e3a4d0aa0305f484666176c | update coverage requirements to 65% | firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker,firecracker-microvm/firecracker | tests/build/test_coverage.py | tests/build/test_coverage.py | """
Tests pertaining to line/branch test coverage for the Firecracker code base.
# TODO
- Put the coverage in `s3://spec.firecracker` and update it automatically.
target should be put in `s3://spec.firecracker` and automatically updated.
"""
import os
import re
from subprocess import run
import pytest
from host... | """
Tests pertaining to line/branch test coverage for the Firecracker code base.
# TODO
- Put the coverage in `s3://spec.firecracker` and update it automatically.
target should be put in `s3://spec.firecracker` and automatically updated.
"""
import os
import re
from subprocess import run
import pytest
from host... | apache-2.0 | Python |
4ca2e4b96023f827a6c9b3ca235a5cc1543d1f4c | implement CPython output as input case | freakboy3742/voc,freakboy3742/voc | tests/builtins/test_tuple.py | tests/builtins/test_tuple.py | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class TupleTests(TranspileTestCase):
pass
class BuiltinTupleFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["tuple"]
substitutions = {
# output, keyed to all possible inputs
"{1.2, True, 3}": [
... | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class TupleTests(TranspileTestCase):
pass
class BuiltinTupleFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["tuple"]
substitutions = {
# output, keyed to all possible inputs
"{1.2, True, 3}": [
... | bsd-3-clause | Python |
2753575e98c5faa5ba171fa6359f53a977f3a2dc | add slug prefix when sending to elasticsearch | hoover/search,hoover/search,hoover/search | collector/index.py | collector/index.py | import logging
from django.db import transaction
import requests
from .models import Document
from . import es
from .utils import now
logger = logging.getLogger(__name__)
class TextMissing(RuntimeError):
pass
def index(doc):
logger.info('indexing %s', doc)
resp = requests.get(doc.text_url)
if resp... | import logging
from django.db import transaction
import requests
from .models import Document
from . import es
from .utils import now
logger = logging.getLogger(__name__)
class TextMissing(RuntimeError):
pass
def index(doc):
logger.info('indexing %s', doc)
resp = requests.get(doc.text_url)
if resp... | mit | Python |
a7c7e911b5de2ba4b35c4cb1d1af95ab3a94dcf6 | add another test for cli deployment | pipermerriam/populus,euri10/populus,euri10/populus,pipermerriam/populus,euri10/populus | tests/cli/test_deployment.py | tests/cli/test_deployment.py | import os
import re
import click
import pytest
from click.testing import CliRunner
from populus.cli import main
this_dir = os.path.dirname(__file__)
def test_deployment_command_with_no_specified_contracts(project_dir,
write_project_file,
... | import os
import re
import click
import pytest
from click.testing import CliRunner
from populus.cli import main
this_dir = os.path.dirname(__file__)
def test_deployment_command_with_no_specified_contracts(project_dir,
write_project_file,
... | mit | Python |
e201f3179388414d0ac6fc9d3a641dda3a5930be | Fix installation version info type | uranusjr/snafu,uranusjr/snafu | snafu/installations.py | snafu/installations.py | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | import contextlib
import itertools
import os
import pathlib
import re
import subprocess
import attr
@attr.s
class Installation:
path = attr.ib(convert=pathlib.Path)
@property
def python(self):
return self.path.joinpath('python.exe')
@property
def scripts_dir(self):
return self.... | isc | Python |
bd898a4526def5188f0fdcab663c4b8d594119db | Upgrade and downgrade now works. | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0032_update_permission_to_enum.py | migrations/versions/0032_update_permission_to_enum.py | """empty message
Revision ID: 0032_update_permission_to_enum
Revises: 0031_add_manage_team_permission
Create Date: 2016-03-01 17:08:12.184393
"""
# revision identifiers, used by Alembic.
revision = '0032_update_permission_to_enum'
down_revision = '0031_add_manage_team_permission'
from alembic import op
import sqlal... | """empty message
Revision ID: 49380ad07c88
Revises: 0031_add_manage_team_permission
Create Date: 2016-03-01 17:08:12.184393
"""
# revision identifiers, used by Alembic.
revision = '49380ad07c88'
down_revision = '0031_add_manage_team_permission'
from alembic import op
import sqlalchemy as sa
def upgrade():
###... | mit | Python |
99cc52cc9cf733f141087d0dc1ee63ba10b51289 | remove redundant urllib import | Lispython/pycurl,Lispython/pycurl,Lispython/pycurl | pycurl/tests/test_post2.py | pycurl/tests/test_post2.py | # $Id$
import pycurl
pf = ['field1=this is a test using httppost & stuff', 'field2=value2']
c = pycurl.init()
c.setopt(pycurl.URL, 'http://pycurl.sourceforge.net/tests/testpostvars.php')
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.HTTPPOST, pf)
c.perform()
c.cleanup()
| # $Id$
import urllib
import pycurl
pf = ['field1=this is a test using httppost & stuff', 'field2=value2']
c = pycurl.init()
c.setopt(pycurl.URL, 'http://pycurl.sourceforge.net/tests/testpostvars.php')
c.setopt(pycurl.POST, 1)
c.setopt(pycurl.HTTPPOST, pf)
c.perform()
c.cleanup()
| lgpl-2.1 | Python |
5702672ab40ef23089c7a2dfee22aaf539b19a54 | Use in-memory sqlite db for testing. | bartTC/dpaste,bartTC/dpaste,bartTC/dpaste | dpaste/settings/tests.py | dpaste/settings/tests.py | """
Settings for the test suite
"""
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
| """
Settings for the test suite
"""
from .base import *
| mit | Python |
252c333337eaee4dd6a48b52ef32c0763dd14d65 | Update version.py | Farama-Foundation/Gymnasium,Farama-Foundation/Gymnasium | gym/version.py | gym/version.py | VERSION = "0.23.1"
| VERSION = "0.23.0"
| mit | Python |
355c2db4532fc87a09286a54d763537f5b627824 | fix ngrams | PyThaiNLP/pythainlp | pythainlp/util/__init__.py | pythainlp/util/__init__.py | from nltk.util import ngrams as ngramsdata
def ngrams(token,num):
'''
ngrams สร้าง ngrams
ngrams(token,num)
- token คือ list
- num คือ จำนวน ngrams
'''
return ngramsdata(token,int(num))
def bigrams(sequence):
"""
bigrams ใน Python
bigrams(sequence)
"""
return ngrams(sequence,2)
def trigram(token):
'''
... | # -*- coding: utf-8 -*-
import nltk.util
def ngrams(token,num):
'''
ngrams สร้าง ngrams
ngrams(token,num)
- token คือ list
- num คือ จำนวน ngrams
'''
return nltk.util.ngrams(token,int(num))
def bigrams(sequence):
"""
bigrams ใน Python
bigrams(sequence)
"""
return nltk.util.bigrams(sequence)
def trigram(... | apache-2.0 | Python |
a1a8b5d4db503dc0688cda5953a801ee9200f2bc | fix typo | dmargala/blupe,dmargala/blupe,dmargala/blupe | python/plot_offset_dist.py | python/plot_offset_dist.py | #!/usr/bin/env python
import argparse
import numpy as np
import glob
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 10})
import matplotlib.pyplot as plt
def add_stat_legend(x):
textstr = '$\mathrm{N}=%d$\n$\mathrm{mean}=%.2f$\n$\mathrm{median}=%.2f$\n$\mathrm{std}=%.2f$' % (
l... | #!/usr/bin/env python
import argparse
import numpy as np
import glob
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 10})
import matplotlib.pyplot as plt
def add_stat_legend(x):
textstr = '$\mathrm{N}=%d$\n$\mathrm{mean}=%.2f$\n$\mathrm{median}=%.2f$\n$\mathrm{std}=%.2f$' % (
l... | mit | Python |
17153ae167fb7b90ccf0f69daaf05cca7364f11a | add an helper to list the diplomas | DUlSine/DUlSine,DUlSine/DUlSine | models/benevole.py | models/benevole.py | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.contrib.auth.models import User
from django.db import models
from structure import Structure
from dulsine_commons import DIPLOME_CONDUCTEURS_LIST, DIPLOME_FORMATEURS_LIST, DIPLOME_SECOURS_LIST
class Benevole(models.Model):
class Meta:
app_label = 'DUl... | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.contrib.auth.models import User
from django.db import models
from structure import Structure
class Benevole(models.Model):
class Meta:
app_label = 'DUlSine'
ordering = ('user__last_name', 'user__first_name')
def __unicode__(self):
... | agpl-3.0 | Python |
c2d48974bc49aa58719f878ae643cefe73f3dcf5 | Fix typos in Portuguese stop words | spacy-io/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,oroszgy/spaCy.hu,explosion/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,Gregory-Howard/spaCy,raphael0202/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,spacy-io/spaCy,honnibal/spaCy,Gregory-Howard/spaCy,explosion/s... | spacy/pt/stop_words.py | spacy/pt/stop_words.py | # coding: utf8
from __future__ import unicode_literals
STOP_WORDS = set("""
à às acerca adeus agora ainda algo algumas alguns ali além ambos ano
anos antes ao aos apenas apoio apontar após aquela aquelas aquele aqueles aqui
aquilo area área as assim através atrás até aí
baixo bastante bem bom breve
cada caminho cat... | # coding: utf8
from __future__ import unicode_literals
STOP_WORDS = set("""
à às acerca adeus agora ainda algmas algo algumas alguns ali além ambos ano
anos antes ao aos apenas apoio apontar após aquela aquelas aquele aqueles aqui
aquilo area área as assim através atrás até aí
baixo bastante bem bom breve
cada cami... | mit | Python |
6947063075dd59e6c32b71356d58eec6fa4cf2b5 | set pynput_backed to dummy | petrushy/staged-recipes,scopatz/staged-recipes,birdsarah/staged-recipes,goanpeca/staged-recipes,mariusvniekerk/staged-recipes,jakirkham/staged-recipes,igortg/staged-recipes,hadim/staged-recipes,SylvainCorlay/staged-recipes,ocefpaf/staged-recipes,stuertz/staged-recipes,patricksnape/staged-recipes,petrushy/staged-recipes... | recipes/pynput/run_test.py | recipes/pynput/run_test.py | # export DISPLAY=":0"
import os
os.environ["PYNPUT_BACKEND"] = "dummy"
import pynput | # export DISPLAY=":0"
import os
# os.environ["DISPLAY"] = ":0"
import pynput | bsd-3-clause | Python |
8d88c171ac2a247cfc75b326fc6cc136caf62388 | change test case | clicheio/cliche,item4/cliche,clicheio/cliche,item4/cliche,clicheio/cliche | tests/sparql_dbpedia_test.py | tests/sparql_dbpedia_test.py | from sparql import load_dbpedia as dbpedia
def test_load_dbpedia_is_save_db(
fx_sparql_dbpedia_table,
fx_sparql_dbpedia_cursor):
""" Test: Do sparql.load_dbpedia modules's methods
really save data into db? """
qry = 'SELECT COUNT({}) FROM {}'.format(
fx_sparql_dbpedia_t... | mit | Python | |
5a12371f5e157c39eaf576a7f5cfc819b86c7d1c | Fix Github integration | sirex/manopozicija.lt,sirex/manopozicija.lt,sirex/manopozicija.lt,sirex/nuomones,sirex/nuomones | manopozicija/settings/production.py | manopozicija/settings/production.py | # pylint: disable=wildcard-import,unused-wildcard-import
from manopozicija.settings.base import * # noqa
DEBUG = False
ALLOWED_HOSTS = ['manopozicija.lt', 'meras.lt', 'localhost']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'manopozicija',
'USE... | # pylint: disable=wildcard-import,unused-wildcard-import
from manopozicija.settings.base import * # noqa
DEBUG = False
ALLOWED_HOSTS = ['manopozicija.lt', 'meras.lt', 'localhost']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'manopozicija',
'USE... | agpl-3.0 | Python |
c3de22036c77ce39d07b1007f7f02e50f0c1f0c0 | Update admin.py | knagra/farnsworth,knagra/farnsworth,knagra/farnsworth,knagra/farnsworth | elections/admin.py | elections/admin.py | """
Project: Farnsworth
Authors: Karandeep Singh Nagra and Nader Morshed
"""
from django.contrib import admin
from elections.models import Petition, PetitionComment, \
Poll, PollSettings, PollQuestion, PollChoice, PollAnswer
for p in [Petition, PetitionComment, Poll, PollSettings,
PollQuestion, PollChoice, Pol... | from django.contrib import admin
# Register your models here.
| bsd-2-clause | Python |
ab2b6764bfa81640b6caef46417680827e9e7f97 | test fix | SergeyPirogov/testcontainers-python | tests/test_new_docker_api.py | tests/test_new_docker_api.py | import os
from testcontainers import mysql
from testcontainers.core.generic import GenericContainer
from importlib import reload
def setup_module(m):
os.environ["MYSQL_USER"] = "demo"
os.environ["MYSQL_DATABASE"] = "custom_db"
def test_docker_custom_image():
container = GenericContainer("mysql:5.7.17... | import os
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from testcontainers import mysql
from testcontainers.core.generic import GenericContainer
from importlib import reload
def setup_module(m):
os.environ["MYSQL_USER"] = "demo"
os.environ["MYSQL_DATABASE"] = "cu... | apache-2.0 | Python |
ab6293bbe039cb0c939493c3b921f114ad68645b | Fix test for connection made | thomwiggers/onebot | tests/test_plugin_execute.py | tests/test_plugin_execute.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
test_onebot_execute
----------------------------------
Tests for Execute plugin
"""
from irc3.testing import BotTestCase
class ExecutePluginTestCase(BotTestCase):
config = {
'includes': [
'onebot.plugins.execute'
],
'onebot... | bsd-3-clause | Python |
4cfc9d6a1496d2a1ebe85c49478a1668f072647c | Add Microsoft copyright header | DonJayamanne/pythonVSCode,DonJayamanne/pythonVSCode,DonJayamanne/pythonVSCode,DonJayamanne/pythonVSCode,DonJayamanne/pythonVSCode | news/__main__.py | news/__main__.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import runpy
runpy.run_module('announce', run_name='__main__', alter_sys=True)
| import runpy
runpy.run_module('announce', run_name='__main__', alter_sys=True)
| mit | Python |
e85987dd84ba38908343583e073e1101963b6b8f | add voc to filter list | zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA | OIPA/api/codelist/filters.py | OIPA/api/codelist/filters.py | from django_filters.rest_framework import DjangoFilterBackend
class AllDjangoFilterBackend(DjangoFilterBackend):
"""
A filter backend that uses django-filter.
"""
def get_filter_class(self, view, queryset=None):
"""
Return the django-filters `FilterSet` used to filter the queryset.
... | from django_filters.rest_framework import DjangoFilterBackend
class AllDjangoFilterBackend(DjangoFilterBackend):
"""
A filter backend that uses django-filter.
"""
def get_filter_class(self, view, queryset=None):
"""
Return the django-filters `FilterSet` used to filter the queryset.
... | agpl-3.0 | Python |
c52f95e95fcd350a6bfc6bd2cd3232a621e30c02 | Fix Base.parameters. Now they will refresh after making a requests | retailcrm/api-client-python | retailcrm/versions/base.py | retailcrm/versions/base.py | # coding=utf-8
"""
API Client base class
"""
import requests
from multidimensional_urlencode import urlencode as query_builder
from retailcrm.response import Response
class Base(object):
"""RetailCRM API client"""
def __init__(self, crm_url, api_key, version):
self.api_url = crm_url + '/api'
... | # coding=utf-8
"""
API Client base class
"""
import requests
from multidimensional_urlencode import urlencode as query_builder
from retailcrm.response import Response
class Base(object):
"""RetailCRM API client"""
def __init__(self, crm_url, api_key, version):
self.api_url = crm_url + '/api'
... | mit | Python |
84f845383b6717d166edbd224596571a46ae4b68 | Update lib/version.py | spesmilo/electrum,pooler/electrum-ltc,fireduck64/electrum,cryptapus/electrum-uno,pknight007/electrum-vtc,pknight007/electrum-vtc,fyookball/electrum,procrasti/electrum,kyuupichan/electrum,vertcoin/electrum-vtc,molecular/electrum,imrehg/electrum,molecular/electrum,vialectrum/vialectrum,argentumproject/electrum-arg,digita... | lib/version.py | lib/version.py | ELECTRUM_VERSION = "1.6.1" # version of the client package
PROTOCOL_VERSION = '0.6' # protocol version requested
SEED_VERSION = 4 # bump this everytime the seed generation is modified
TRANSLATION_ID = 34952 # version of the wiki page
| ELECTRUM_VERSION = "1.6.1" # version of the client package
PROTOCOL_VERSION = '0.6' # protocol version requested
SEED_VERSION = 4 # bump this everytime the seed generation is modified
TRANSLATION_ID = 34864 # version of the wiki page
| mit | Python |
172811b7e0123cc0c72b30878cf4b7dd6c5f8ae1 | Update version.py | Netscape007/sees,h4de5ing/sees,zhuyue1314/sees,zhuyue1314/sees,wangyj1/sees,GHubgenius/sees,zhuyue1314/sees,zhuyue1314/sees,zhuyue1314/sees,noikiy/sees | lib/version.py | lib/version.py | version = "1.0"
message = "\nSEES"
disclamer = "Using SEES for malicious purposes is illegal. USE AT YOUR OWN RISK, Agree (Y|n)"
wrong_option = "Wrong option, Please use \"Y|N\""
| version = "1.0"
message = "\nSEES"%
disclamer = "Using SEES for malicious purposes is illegal. USE AT YOUR OWN RISK, Agree (Y|n)"
wrong_option = "Wrong option, Please use \"Y|N\""
| mit | Python |
15a0e5a7c980ed913e61919060701b5ce2c89144 | use explicit Process arguments | pavel-paulau/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,dkao-cb/perfrunner,EricACooper/perfrunner,mikewied/perfrunner,hsharsha/perfrunner,thomas-couchbase/perfrunner,mikewied/perfrunner,dkao-cb/perfrunner,EricACooper/perfrunner,pavel-paulau/perfrunner,vmx/perfrunner,couchbase/perfrunner,hsharsha/perfrunner... | perfrunner/helpers/cbmonitor.py | perfrunner/helpers/cbmonitor.py | from multiprocessing import Process
from uuid import uuid4
from cbagent.collectors import NSServer
from perfrunner.settings import CbAgentSettings
class CbAgent(object):
def __init__(self, cluster_spec, target_iterator):
settings = CbAgentSettings()
settings.cluster = cluster_spec.name + uuid4(... | from multiprocessing import Process
from uuid import uuid4
from cbagent.collectors import NSServer
from perfrunner.settings import CbAgentSettings
class CbAgent(object):
def __init__(self, cluster_spec, target_iterator):
settings = CbAgentSettings()
settings.cluster = cluster_spec.name + uuid4(... | apache-2.0 | Python |
1d21786da2e6868d98ae34c82079e1e03ad1aa97 | fix highlighting test | django-extensions/django-extensions,django-extensions/django-extensions,django-extensions/django-extensions | tests/templatetags/test_highlighting.py | tests/templatetags/test_highlighting.py | # -*- coding: utf-8 -*-
import six
from django.template import Context, Template, TemplateSyntaxError
from django.test import TestCase
class HighlightTagExceptionTests(TestCase):
"""Tests for highlight tag exceptions."""
def setUp(self):
self.ctx = Context()
def test_should_raise_TemplateSyntaxE... | # -*- coding: utf-8 -*-
import six
from django.template import Context, Template, TemplateSyntaxError
from django.test import TestCase
class HighlightTagExceptionTests(TestCase):
"""Tests for highlight tag exceptions."""
def setUp(self):
self.ctx = Context()
def test_should_raise_TemplateSyntaxE... | mit | Python |
f34fd2a8dc1dae8e79bc8ae0c3dff5d8ca4f2626 | Add missing definitions to unimplemented print_eval_order test | csvoss/onelinerizer | tests/unimplemented/print_eval_order.py | tests/unimplemented/print_eval_order.py | import sys
def trace(msg, value):
print msg
return value
print trace('print arg 0', 0), trace('print arg 1', 1),
print trace('print arg 2', 2), trace('print arg 3', 3)
print >>trace('print file 0', sys.stdout), trace('print arg 4', 4), trace('print arg 5', 5),
print >>trace('print file 1', sys.stdout), trace(... | print trace('print arg 0', 0), trace('print arg 1', 1),
print trace('print arg 2', 2), trace('print arg 3', 3)
print >>trace('print file 0', sys.stdout), trace('print arg 4', 4), trace('print arg 5', 5),
print >>trace('print file 1', sys.stdout), trace('print arg 6', 6), trace('print arg 7', 7)
| mit | Python |
2fa3132fdad6b6601252ce28a511db09ae06735f | add MEDIA | PegasusWang/Physics_web,PegasusWang/Physics_web,PegasusWang/Physics_web | mysite/settings.py | mysite/settings.py | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | mit | Python |
32e8ff0497fb8d2d972baa6de29e8c7716c26139 | Disable flaky explain tests due to inconsistent per-host mem requirements | grundprinzip/Impala,kapilrastogi/Impala,bratatidas9/Impala-1,tempbottle/Impala,bowlofstew/Impala,caseyching/Impala,caseyching/Impala,mapr/impala,henryr/Impala,ImpalaToGo/ImpalaToGo,brightchen/Impala,bratatidas9/Impala-1,gerashegalov/Impala,rdblue/Impala,scalingdata/Impala,bratatidas9/Impala-1,lirui-intel/Impala,scaling... | tests/query_test/test_explain.py | tests/query_test/test_explain.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Functional tests running EXPLAIN statements.
#
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
# Tests the different explain levels [0-3] on a few queries.
# TODO: Clean up ... | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Functional tests running EXPLAIN statements.
#
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *
# Tests the different explain levels [0-3] on a few queries.
# TODO: Clean up ... | apache-2.0 | Python |
755f7bc9e14c7499a61a77e98de9bf6d8dbf2de6 | make that a float | Autoplectic/dit,dit/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,dit/dit,dit/dit,Autoplectic/dit,Autoplectic/dit | dit/multivariate/interaction_information.py | dit/multivariate/interaction_information.py | """
The interaction information is a form of multivariate information.
"""
from ..helpers import normalize_rvs
from .coinformation import coinformation
from ..math import close
def interaction_information(dist, rvs=None, crvs=None, rv_mode=None):
"""
Calculates the interaction information.
Parameters
... | """
The interaction information is a form of multivariate information.
"""
from ..helpers import normalize_rvs
from .coinformation import coinformation
from ..math import close
def interaction_information(dist, rvs=None, crvs=None, rv_mode=None):
"""
Calculates the interaction information.
Parameters
... | bsd-3-clause | Python |
0225be53a2e9f8f69536ff91241b30a8b1d313d7 | Remove dead SafeRepr.repr_unicode | The-Compiler/pytest,tomviner/pytest,nicoddemus/pytest,pytest-dev/pytest,The-Compiler/pytest,alfredodeza/pytest,markshao/pytest,Akasurde/pytest,tomviner/pytest,RonnyPfannschmidt/pytest,nicoddemus/pytest | src/_pytest/_io/saferepr.py | src/_pytest/_io/saferepr.py | import pprint
import reprlib
def _call_and_format_exception(call, x, *args):
try:
# Try the vanilla repr and make sure that the result is a string
return call(x, *args)
except Exception as exc:
exc_name = type(exc).__name__
try:
exc_info = str(exc)
except Ex... | import pprint
import reprlib
def _call_and_format_exception(call, x, *args):
try:
# Try the vanilla repr and make sure that the result is a string
return call(x, *args)
except Exception as exc:
exc_name = type(exc).__name__
try:
exc_info = str(exc)
except Ex... | mit | Python |
8696568afc6320cbe639f3b591a07e17c926cdec | Update test_pypi_helper.py | sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper | _unittests/ut_loghelper/test_pypi_helper.py | _unittests/ut_loghelper/test_pypi_helper.py | """
@brief test log(time=42s)
"""
import sys
import os
import unittest
import datetime
if "temp_" in os.path.abspath(__file__):
raise ImportError(
"this file should not be imported in that location: " +
os.path.abspath(__file__))
from pyquickhelper.pycode import ExtTestCase, skipif_circleci,... | """
@brief test log(time=42s)
"""
import sys
import os
import unittest
import datetime
if "temp_" in os.path.abspath(__file__):
raise ImportError(
"this file should not be imported in that location: " +
os.path.abspath(__file__))
from pyquickhelper.pycode import ExtTestCase, skipif_circleci
... | mit | Python |
bfc00336123920008a35cba20a166592a3a8cfb5 | Improve report logging | optiflows/nyuki,gdraynz/nyuki,gdraynz/nyuki,optiflows/nyuki | nyuki/reporting.py | nyuki/reporting.py | from datetime import datetime
from jsonschema import FormatChecker, validate, ValidationError
import logging
log = logging.getLogger(__name__)
REPORT_SCHEMA = {
'type': 'object',
'required': ['type', 'author', 'datetime', 'data'],
'properties': {
'type': {
'type': 'string',
... | from datetime import datetime
from jsonschema import FormatChecker, validate, ValidationError
import logging
log = logging.getLogger(__name__)
REPORT_SCHEMA = {
'type': 'object',
'required': ['type', 'author', 'datetime', 'data'],
'properties': {
'type': {
'type': 'string',
... | apache-2.0 | Python |
dbf1298d3adec2f2aab56bbbccec5de98cbaf15c | Fix a broken example script. | wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion | tools/examples/check-modified.py | tools/examples/check-modified.py | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
FORCE_COMPARISON = 0
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.... | #!/usr/bin/python
#
# USAGE: check-modified.py FILE_OR_DIR1 FILE_OR_DIR2 ...
#
# prints out the URL associated with each item
#
import sys
import os
import os.path
import svn.util
import svn.client
import svn.wc
def usage():
print "Usage: " + sys.argv[0] + " FILE_OR_DIR1 FILE_OR_DIR2\n"
sys.exit(0)
def run(files... | apache-2.0 | Python |
aee7d3d0bf19ab8771d408c20fb37b6416798ef5 | Return sorted queries | modm-io/modm-devices | tools/generator/dfg/input/xml.py | tools/generator/dfg/input/xml.py | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2016, Niklas Hauser
# Copyright (c) 2016, Fabian Greif
# All rights reserved.
import os
import re
import logging
from lxml import etree
LOGGER = logging.getLogger('dfg.input.xml')
class XMLReader:
""" DeviceReader
Base class for all readers for handling the ... | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2016, Niklas Hauser
# Copyright (c) 2016, Fabian Greif
# All rights reserved.
import os
import re
import logging
from lxml import etree
LOGGER = logging.getLogger('dfg.input.xml')
class XMLReader:
""" DeviceReader
Base class for all readers for handling the ... | mpl-2.0 | Python |
f9f3f83254fe82ba81b523970ff1d3a7d1650302 | use string for config_group | rctay/satchmo-payment-dumb | listeners.py | listeners.py | from django.conf.urls.defaults import url, include
from django.utils.translation import ugettext_lazy as _
from livesettings import config_get_group, config_value
from payment.signals import payment_choices
from satchmo_store import shop
from signals_ahoy.signals import collect_urls
config_group = 'PAYMENT_DUMB'
def ... | from django.conf.urls.defaults import url, include
from django.utils.translation import ugettext_lazy as _
from livesettings import config_get_group, config_value
from payment.signals import payment_choices
from satchmo_store import shop
from signals_ahoy.signals import collect_urls
config_group = config_get_group('PA... | bsd-3-clause | Python |
b0ac400b9ba254e96b99672e7e67a88d6c2faee7 | Fix "rebuild_index" call_command kwarg in init.py | yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core | memopol2/management/commands/init.py | memopol2/management/commands/init.py | from django.core.management import call_command
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Initialize memopol2'
def handle(self, *args, **options):
call_command("syncdb", interactive=False)
call_command("migrate", "reps", "0007")
call_comma... | from django.core.management import call_command
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Initialize memopol2'
def handle(self, *args, **options):
call_command("syncdb", interactive=False)
call_command("migrate", "reps", "0007")
call_comma... | agpl-3.0 | Python |
e3c5e2fe1f49e3010eed5db1af1175a245e0557c | Remove unneeded debugging | vuolter/pyload,vuolter/pyload,vuolter/pyload,pyblub/pyload,pyblub/pyload | module/plugins/hoster/CatShareNet.py | module/plugins/hoster/CatShareNet.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.ReCaptcha import ReCaptcha
class CatShareNet(SimpleHoster):
__name__ = "CatShareNet"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?catshare.net/\w{... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.ReCaptcha import ReCaptcha
class CatShareNet(SimpleHoster):
__name__ = "CatShareNet"
__type__ = "hoster"
__pattern__ = r"http://(www\.)?catshare.net/\w{... | agpl-3.0 | Python |
40aebba152a02dbacebf0d22fea5372320926e55 | raise frequency to see reall effects. | daStrauss/subsurface | src/incTest.py | src/incTest.py | '''
Created on Sep 28, 2012
@author: dstrauss
'''
import forward.flat
import numpy as np
import scipy.io as spio
import time
from superSolve import wrapCvxopt
def test(ica):
flavor = 'TE3D'
freq = 0.5e7
incAng = ica*np.pi/180.0
strt = time.time()
fwd = forward.flat.makeMeA(flavor, freq, incA... | '''
Created on Sep 28, 2012
@author: dstrauss
'''
import forward.flat
import numpy as np
import scipy.io as spio
import time
from superSolve import wrapCvxopt
def test(ica):
flavor = 'TE3D'
freq = 1e4
incAng = ica*np.pi/180.0
strt = time.time()
fwd = forward.flat.makeMeA(flavor, freq, incAng... | apache-2.0 | Python |
4db5f4ca4271274dcaf7135a0423a9b47cef2bab | allow for min and int as jinnja methods | ReckoningReckoner/conferenceX,ReckoningReckoner/conferenceX,ReckoningReckoner/conferenceX | conferenceX/flask_app.py | conferenceX/flask_app.py | from flask import Flask
from secrets import SECRET_KEY, DATABASE_URI
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SECRET_KEY"] = SECRET_KEY
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
app.config['SQLALCHEMY_POOL_RECYCLE'] = 299
... | from flask import Flask
from secrets import SECRET_KEY, DATABASE_URI
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SECRET_KEY"] = SECRET_KEY
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
app.config['SQLALCHEMY_POOL_RECYCLE'] = 299
... | apache-2.0 | Python |
5df8dcbe6baf696a081501456cc5ff2c9266b197 | add view to find venues in suburb | shaunokeefe/hoponit,shaunokeefe/hoponit | hoponit/venues/views.py | hoponit/venues/views.py | from django.shortcuts import render
from django.views.generic import ListView
from .models import Venue
class VenueBySuburbList(ListView):
model = Venue
context_object_name = 'venues'
def get_queryset(self):
suburb_name = self.request.GET.get('suburb_name', None)
return Venue.objects.fil... | from django.shortcuts import render
# Create your views here.
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.