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
a530d5c27d86483c8fdc668b00da4f194807d3d2
check is authenticated on my groups view
lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django
agir/groups/views/api_views.py
agir/groups/views/api_views.py
from django.contrib.gis.db.models.functions import Distance from django.db.models import F from django_filters.rest_framework import DjangoFilterBackend from rest_framework.generics import ListAPIView from rest_framework.permissions import IsAuthenticated from agir.groups.filters import GroupAPIFilterSet from agir.gro...
from django.contrib.gis.db.models.functions import Distance from django.db.models import F from django_filters.rest_framework import DjangoFilterBackend from rest_framework.generics import ListAPIView from rest_framework.permissions import IsAuthenticated from agir.groups.filters import GroupAPIFilterSet from agir.gro...
agpl-3.0
Python
7c72acbbe66b17768a714c98aa532b798819a6f3
Fix for correct hashing of unicode chars.
janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system
src/database/model.py
src/database/model.py
import hashlib import datetime from sqlalchemy import Column, String, Integer, Float, ForeignKey, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref, validates Base = declarative_base() class Team(Base): __tablename__ = 'teams' id = Column(Integer...
import hashlib import datetime from sqlalchemy import Column, String, Integer, Float, ForeignKey, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref, validates Base = declarative_base() class Team(Base): __tablename__ = 'teams' id = Column(Integer...
bsd-3-clause
Python
66f781b8e76280d38d61c794d4fa5de7aff07421
fix filepath for test.m
kaczmarj/neurodocker,kaczmarj/neurodocker
neurodocker/interfaces/tests/test_spm.py
neurodocker/interfaces/tests/test_spm.py
"""Tests for neurodocker.interfaces.SPM""" # Author: Jakub Kaczmarzyk <jakubk@mit.edu> from __future__ import absolute_import, division, print_function from neurodocker.interfaces import SPM from neurodocker.interfaces.tests import utils class TestSPM(object): """Tests for SPM class.""" def test_build_image_...
"""Tests for neurodocker.interfaces.SPM""" # Author: Jakub Kaczmarzyk <jakubk@mit.edu> from __future__ import absolute_import, division, print_function from neurodocker.interfaces import SPM from neurodocker.interfaces.tests import utils class TestSPM(object): """Tests for SPM class.""" def test_build_image_...
apache-2.0
Python
810eb675e44034685a21942869f70c1c79599ec7
Update mirex_dataset init file
amrittb/orchestrate-ai,amrittb/orchestrate-ai,amrittb/orchestrate-ai,amrittb/orchestrate-ai
orchestrate_ai/mirex_dataset/__init__.py
orchestrate_ai/mirex_dataset/__init__.py
all = ['midi_manipulation', 'dataset_manipulation', 'computation_graph']
all = ['midi_manipulation', 'dataset_manipulation']
mit
Python
d33f72f6b1d307cb2039a258d314a5833b485e1e
Add telemetry component
squarewave/background-hang-reporter-job,squarewave/background-hang-reporter-job
background_hang_reporter_job/tracked.py
background_hang_reporter_job/tracked.py
class DevtoolsHangs(object): title = "Devtools Hangs" @staticmethod def matches_hang(hang): #pylint: disable=unused-variable stack, duration, thread, runnable, process, annotations, build_date, platform = hang return stack is not None and any(isinstance(frame, basestring) and "devto...
class DevtoolsHangs(object): title = "Devtools Hangs" @staticmethod def matches_hang(hang): #pylint: disable=unused-variable stack, duration, thread, runnable, process, annotations, build_date, platform = hang return stack is not None and any(isinstance(frame, basestring) and "devto...
mit
Python
8d80424e351e29e705ba0eefa6d4c459af89cb07
add check config before starting
vanzhiganov/backup
backup.py
backup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import getopt from optparse import OptionParser import logging import backup import configparser logging.basicConfig(format=u'[%(asctime)s] %(levelname)-8s %(message)s', level=logging.DEBUG, filename="/var/log/backup.log") parser = OptionParser() pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import getopt from optparse import OptionParser import logging import backup import configparser logging.basicConfig(format=u'[%(asctime)s] %(levelname)-8s %(message)s', level=logging.DEBUG, filename="/var/log/backup.log") parser = OptionParser() pa...
unlicense
Python
e42019c5648dddc2f705836401e422dd4077b55e
Update import syntax to fit python3
zeekay/bottle-websocket
bottle_websocket/__init__.py
bottle_websocket/__init__.py
from .plugin import websocket from .server import GeventWebSocketServer __all__ = ['websocket', 'GeventWebSocketServer'] __version__ = '0.2.8'
from plugin import websocket from server import GeventWebSocketServer __all__ = ['websocket', 'GeventWebSocketServer'] __version__ = '0.2.8'
mit
Python
40d1645f4ad2aca18203ee5ebef1cbbecffa3c51
Add check for fixture loading
dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api
project/apps/api/signals.py
project/apps/api/signals.py
from django.db.models.signals import ( post_save, ) from django.dispatch import receiver from rest_framework.authtoken.models import Token from django.conf import settings from .models import ( Contest, ) @receiver(post_save, sender=settings.AUTH_USER_MODEL) def user_post_save(sender, instance=None, creat...
from django.db.models.signals import ( post_save, ) from django.dispatch import receiver from rest_framework.authtoken.models import Token from django.conf import settings from .models import ( Contest, ) @receiver(post_save, sender=settings.AUTH_USER_MODEL) def user_post_save(sender, instance=None, creat...
bsd-2-clause
Python
6d34edb17e709771a34688cf47c8298529d977d8
Fix for TCP payload truncation
chokepoint/DET,nerbix/Invoke-Exfiltration,chokepoint/DET
plugins/tcp.py
plugins/tcp.py
import socket import sys config = None app_exfiltrate = None def send(data): target = config['target'] port = config['port'] data = app_exfiltrate.xor(data) app_exfiltrate.log_message( 'info', "[tcp] Sending {0} bytes to {1}".format(len(data), target)) client_socket = socket.socket(socket...
import socket import sys config = None app_exfiltrate = None def send(data): target = config['target'] port = config['port'] data = app_exfiltrate.xor(data) app_exfiltrate.log_message( 'info', "[tcp] Sending {0} bytes to {1}".format(len(data), target)) client_socket = socket.socket(socket...
mit
Python
a0a3c2b76c47e80c188c9f7c8dc7c657f71b32b3
add loader to import
dresl/django_choice_and_question,dresl/django_choice_and_question
polls/views.py
polls/views.py
from django.shortcuts import render from django.http import HttpResponse, loader from polls.models import Question def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') context = RequestContext(request, { 'latest_qu...
from django.shortcuts import render from django.http import HttpResponse from polls.models import Question def index(request): latest_question_list = Question.objects.order_by('-pub_date')[:5] template = loader.get_template('polls/index.html') context = RequestContext(request, { 'latest_question_l...
apache-2.0
Python
d48ae791364a0d29d60636adfde1f143858794cd
Remove rogue debugger how embarassing
rdhyee/osf.io,alexschiller/osf.io,Johnetordoff/osf.io,caneruguz/osf.io,acshi/osf.io,abought/osf.io,amyshi188/osf.io,erinspace/osf.io,DanielSBrown/osf.io,chrisseto/osf.io,leb2dg/osf.io,mattclark/osf.io,samchrisinger/osf.io,alexschiller/osf.io,mluke93/osf.io,monikagrabowska/osf.io,mfraezz/osf.io,DanielSBrown/osf.io,crcre...
api/identifiers/serializers.py
api/identifiers/serializers.py
from rest_framework import serializers as ser from api.base.utils import absolute_reverse from api.base.serializers import JSONAPISerializer, RelationshipField, IDField, LinksField class IdentifierSerializer(JSONAPISerializer): category = ser.CharField(read_only=True) filterable_fields = frozenset(['categor...
from rest_framework import serializers as ser from api.base.utils import absolute_reverse from api.base.serializers import JSONAPISerializer, RelationshipField, IDField, LinksField class IdentifierSerializer(JSONAPISerializer): category = ser.CharField(read_only=True) filterable_fields = frozenset(['categor...
apache-2.0
Python
dfc7279879449a683d1f5a2b46f15795e8c95639
Fix #7
KostasMp/PortScanner
portscanner.py
portscanner.py
#!/usr/bin/python import socket import sys import argparse def main(): parser = argparse.ArgumentParser(description = "Test a specified IP for open ports.") mutex = parser.add_mutually_exclusive_group() parser.add_argument('ip', metavar='IP', help='The ip to be scanned for open ports') parser.add_argument('-v', '...
#!/usr/bin/python import socket import sys import argparse def main(): parser = argparse.ArgumentParser(description = "Test a specified IP for open ports.") mutex = parser.add_mutually_exclusive_group() parser.add_argument('ip', metavar='IP', help='The ip to be scanned for open ports') parser.add_argument('-v', '...
mit
Python
b375210cf7c6d6d327af61206b6ab36aaaeec6e0
Add ability to filter posts by site
rtrembecky/roots,tbabej/roots,rtrembecky/roots,tbabej/roots,rtrembecky/roots,matus-stehlik/roots,matus-stehlik/roots,tbabej/roots,matus-stehlik/roots
posts/admin.py
posts/admin.py
from django.contrib import admin from reversion import VersionAdmin from base.admin import PrettyFilterMixin, RestrictedCompetitionAdminMixin from base.util import admin_commentable, editonly_fieldsets from .models import Post # Reversion-enabled Admin for problems @admin_commentable @editonly_fieldsets class PostA...
from django.contrib import admin from reversion import VersionAdmin from base.admin import PrettyFilterMixin, RestrictedCompetitionAdminMixin from base.util import admin_commentable, editonly_fieldsets from .models import Post # Reversion-enabled Admin for problems @admin_commentable @editonly_fieldsets class PostA...
mit
Python
077b45ace376a1baecfcb7617c2663f591a0f868
fix parameter
smrmkt/project_euler
problem_006.py
problem_006.py
#!/usr/bin/env python #-*-coding:utf-8-*- ''' The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the sq...
#!/usr/bin/env python #-*-coding:utf-8-*- ''' The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the sq...
mit
Python
cd201b193ae71c82f006d9532f926bbc49b6fce9
Fix relative import that does not work with py 3.
datacommonsorg/api-python,datacommonsorg/api-python
datacommons/__init__.py
datacommons/__init__.py
# Copyright 2017 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 2017 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
0e652b375f995b69dd8e78a326bb30dbbd08c4c9
Move tracer type to global in util.check
google/objax,google/objax
objax/util/check.py
objax/util/check.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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
942dae99954d73f064d9cbf4d8b40999a260fc21
Remove the title from the generated HTML
glasnt/octohat,LABHR/octohatrack
octohat/__init__.py
octohat/__init__.py
#!/usr/bin/env python import argparse import sys from .helpers import * def main(): parser = argparse.ArgumentParser() parser.add_argument("repo_name", help="githubuser/repo") parser.add_argument("-g", "--generate-html", action='store_true', help="Generate output as HTML") parser.add_argument("-l", "--limi...
#!/usr/bin/env python import argparse import sys from .helpers import * def main(): parser = argparse.ArgumentParser() parser.add_argument("repo_name", help="githubuser/repo") parser.add_argument("-g", "--generate-html", action='store_true', help="Generate output as HTML") parser.add_argument("-l", "--limi...
bsd-3-clause
Python
6586a829c296063d3f479ba26da3695e3f497264
Validate using S3 URL if template size is greater than 51200
geronimo-iia/brume,flou/brume
brume/template.py
brume/template.py
import os import boto3 import sys from colors import green, red from botocore.exceptions import ClientError s3_client = boto3.client('s3') CFN_TEMPLATE_SIZE_LIMIT = 51200 class InvalidTemplateError(BaseException): def __init__(self, m): self.m = m def __str__(self): return self.m class Te...
import os import boto3 import sys from colors import green, red from botocore.exceptions import ClientError s3_client = boto3.client('s3') class InvalidTemplateError(BaseException): def __init__(self, m): self.m = m def __str__(self): return self.m class Template(): key = None de...
mit
Python
168ab20888927c9150e54eecfd4a06803f40f980
fix tests
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/test/factory_models/utils.py
bluebottle/test/factory_models/utils.py
from builtins import object import factory from factory.fuzzy import FuzzyChoice from django.conf import settings from bluebottle.utils.models import Language class LanguageFactory(factory.DjangoModelFactory): class Meta(object): model = Language django_get_or_create = ('language_name',) l...
from builtins import object import factory from factory.fuzzy import FuzzyText from bluebottle.utils.models import Language class LanguageFactory(factory.DjangoModelFactory): class Meta(object): model = Language django_get_or_create = ('language_name',) language_name = factory.Sequence(lamb...
bsd-3-clause
Python
4267dfe4617270447f84865f5a63d68a40409e1f
test also the case with missing email on registration
geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend
tests/profile/test_profile_view.py
tests/profile/test_profile_view.py
import pytest from unittest.mock import patch from django.core.urlresolvers import reverse def test_profile_page_redirects_when_called_without_user(client): response = client.get(reverse('profile:edit_view')) assert response.status_code == 302 assert response.url == '/accounts/login/?next=/profile/edit/'...
import pytest from unittest.mock import patch from django.core.urlresolvers import reverse def test_profile_page_redirects_when_called_without_user(client): response = client.get(reverse('profile:edit_view')) assert response.status_code == 302 assert response.url == '/accounts/login/?next=/profile/edit/'...
mit
Python
881183db60c82c01a5e66823350002d1a8d5b0b2
check in accounts
NephyProject/PyChroner,NephyProject/PyChroner
TBFW/configparser.py
TBFW/configparser.py
# coding=utf-8 import json from TBFW.constant import * from TBFW.exceptions import * class ConfigParser: def __init__(self): if not os.path.isfile(pathConfig): json.dump({}, open(pathConfig, "w")) try: config = json.load(open(pathConfig)) except: raise InvalidConfigSyntax if "accounts" not in con...
# coding=utf-8 import json from TBFW.constant import * from TBFW.exceptions import * class ConfigParser: def __init__(self): if not os.path.isfile(pathConfig): json.dump({}, open(pathConfig, "w")) try: config = json.load(open(pathConfig)) except: raise InvalidConfigSyntax if not "accounts" in con...
mit
Python
4fde2d2c5ccd82373dab802f731d83cc2d3345df
Fix line endings in file
Juanlu001/poliastro,Juanlu001/poliastro,Juanlu001/poliastro,poliastro/poliastro
tests/tests_core/test_core_util.py
tests/tests_core/test_core_util.py
import numpy as np from poliastro.core import util def test_rotation_matrix_x(): result = util.rotation_matrix(0.218, 0) expected = np.array( [[1.0, 0.0, 0.0], [0.0, 0.97633196, -0.21627739], [0.0, 0.21627739, 0.97633196]] ) assert np.allclose(expected, result) def test_rotation_matrix_y():...
import numpy as np from poliastro.core import util def test_rotation_matrix_x(): result = util.rotation_matrix(0.218, 0) expected = np.array( [[1.0, 0.0, 0.0], [0.0, 0.97633196, -0.21627739], [0.0, 0.21627739, 0.97633196]] ) assert np.allclose(expected, result) def test_rotatio...
mit
Python
b5a990cc1422f4db9a89d91317535d6c933bba68
Make pep8 happy
rswarts/puppetdb-stencil,daenney/puppetdb-stencil,ckonstanski/puppetdb-stencil
puppetdb_stencil.py
puppetdb_stencil.py
#!/usr/bin/env python from __future__ import print_function from __future__ import unicode_literals import argparse import logging import pypuppetdb import jinja2 log = logging.getLogger('puppetdb_stencil') METAPARAMS = ('require', 'before', 'subscribe', 'notify', 'audit', 'loglevel', 'noop', 'schedule', 'st...
#!/usr/bin/env python from __future__ import print_function from __future__ import unicode_literals import argparse import codecs import logging import pypuppetdb import jinja2 log = logging.getLogger('puppetdb_stencil') METAPARAMS = ('require', 'before', 'subscribe', 'notify', 'audit', 'loglevel', 'noop', '...
apache-2.0
Python
5c5ddbcb40384ad6f304957b3272fe1870d6bb63
Make fake_instance handle security groups
vmturbo/nova,Francis-Liu/animated-broccoli,alaski/nova,yosshy/nova,rrader/nova-docker-plugin,jeffrey4l/nova,alvarolopez/nova,spring-week-topos/nova-week,noironetworks/nova,hanlind/nova,cyx1231st/nova,barnsnake351/nova,ruslanloman/nova,dims/nova,mahak/nova,rajalokan/nova,ruslanloman/nova,Yusuke1987/openstack_template,cl...
nova/tests/fake_instance.py
nova/tests/fake_instance.py
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
Python
fc016e9731a57b98eba8da7a613d1bc7636f9a1f
Make sure Authors check also works for pending merges (otherwise stuff can get merged that will make the next merge fail this check).
n0ano/ganttclient
nova/tests/misc_unittest.py
nova/tests/misc_unittest.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack 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 ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack 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 ...
apache-2.0
Python
85846072e92738da3596a27223bc3ce82997b3c2
improve cancel
Stunkymonkey/passworts,Stunkymonkey/passworts,Stunkymonkey/passworts
online/app/views.py
online/app/views.py
#!/usr/bin/env python3 from flask import render_template, flash, redirect, request from app import app from app.forms import Input from app import generator @app.route('/', methods = ['GET', 'POST']) def home(): form = Input() return render_template('index.html', title = 'Home', form = form) @app.route('/result', ...
#!/usr/bin/env python3 from flask import render_template, flash, redirect, request from app import app from app.forms import Input from app import generator @app.route('/', methods = ['GET', 'POST']) def home(): form = Input() return render_template('index.html', title = 'Home', form = form) @app.route('/result', ...
mit
Python
3b189ca80ca91dc38b7a0e71aa2e4002f79c1c98
Upgrade to v1.14.0
biolink/ontobio,biolink/ontobio
ontobio/__init__.py
ontobio/__init__.py
from __future__ import absolute_import __version__ = '1.14.0' from .ontol_factory import OntologyFactory from .ontol import Ontology, Synonym, TextDefinition from .assoc_factory import AssociationSetFactory from .io.ontol_renderers import GraphRenderer
from __future__ import absolute_import __version__ = '1.13.2' from .ontol_factory import OntologyFactory from .ontol import Ontology, Synonym, TextDefinition from .assoc_factory import AssociationSetFactory from .io.ontol_renderers import GraphRenderer
bsd-3-clause
Python
d14cd6e169a1bc7b986cc32a911ddededbb38b72
bump version post release for next version
openaps/openaps,openaps/openaps
openaps/__init__.py
openaps/__init__.py
__version__ = '0.0.4'
__version__ = '0.0.3'
mit
Python
ccdfafcf58fdf3dc1d95acc090445e56267bd4ab
Fix relative import in top numpy.distutils.
stefanv/numpy,madphysicist/numpy,matthew-brett/numpy,githubmlai/numpy,Dapid/numpy,ahaldane/numpy,bringingheavendown/numpy,GrimDerp/numpy,matthew-brett/numpy,KaelChen/numpy,dwf/numpy,ewmoore/numpy,shoyer/numpy,GaZ3ll3/numpy,stefanv/numpy,gfyoung/numpy,mhvk/numpy,numpy/numpy,SunghanKim/numpy,Anwesh43/numpy,rgommers/numpy...
numpy/distutils/__init__.py
numpy/distutils/__init__.py
import sys if sys.version_info[0] < 3: from __version__ import version as __version__ # Must import local ccompiler ASAP in order to get # customized CCompiler.spawn effective. import ccompiler import unixccompiler from info import __doc__ from npy_pkg_config import * try: imp...
from __version__ import version as __version__ # Must import local ccompiler ASAP in order to get # customized CCompiler.spawn effective. import ccompiler import unixccompiler from info import __doc__ from npy_pkg_config import * try: import __config__ _INSTALLED = True except ImportError: _INSTALLED = ...
bsd-3-clause
Python
fa0821f49e26f508971c2f3c97b8696c98901e49
Save the generated noise image.
lmas/opensimplex,antiface/opensimplex
opensimplex_test.py
opensimplex_test.py
from PIL import Image # Depends on the Pillow lib from opensimplex import OpenSimplexNoise WIDTH = 512 HEIGHT = 512 FEATURE_SIZE = 24 def main(): simplex = OpenSimplexNoise() im = Image.new('L', (WIDTH, HEIGHT)) for y in range(0, HEIGHT): for x in range(0, WIDTH): #value = simplex.n...
from PIL import Image # Depends on the Pillow lib from opensimplex import OpenSimplexNoise WIDTH = 512 HEIGHT = 512 FEATURE_SIZE = 24 def main(): simplex = OpenSimplexNoise() im = Image.new('L', (WIDTH, HEIGHT)) for y in range(0, HEIGHT): for x in range(0, WIDTH): #value = simplex.n...
mit
Python
c90ac0b082167097b05e0d6bd463f042f9b62618
Remove hardcodded connection parameters
justas-/pyledbat
pyledbat/testapp.py
pyledbat/testapp.py
"""Test LEDBAT implementation in iperf-ish way""" import logging import argparse from testledbat import test_ledbat logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(asctime)s %(message)s') def main(): """Main entrance point, mainly to stop PyLint from nagging""" # Setup the command line par...
"""Test LEDBAT implementation in iperf-ish way""" import logging import argparse from testledbat import test_ledbat logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(asctime)s %(message)s') def main(): """Main entrance point, mainly to stop PyLint from nagging""" # Setup the command line par...
apache-2.0
Python
95eb5065f0713b7e0865b63dacbdaa1b7184b14c
Make script 2-vs-3-agnostic.
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Objects/typeslots.py
Objects/typeslots.py
#!/usr/bin/python # Usage: typeslots.py < Include/typeslots.h > typeslots.inc import sys, re res = {} for line in sys.stdin: m = re.match("#define Py_([a-z_]+) ([0-9]+)", line) member = m.group(1) if member.startswith("tp_"): member = "ht_type."+member elif member.startswith("nb_"): me...
#!/usr/bin/python # Usage: typeslots.py < Include/typeslots.h > typeslots.inc import sys, re res = {} for line in sys.stdin: m = re.match("#define Py_([a-z_]+) ([0-9]+)", line) member = m.group(1) if member.startswith("tp_"): member = "ht_type."+member elif member.startswith("nb_"): me...
mit
Python
1e543ea4877b2680e2bf1062ef088b34a7c1463a
Add no-asm to OpenSSL config to fix win32 buids
nabla-c0d3/nassl,nabla-c0d3/nassl,nabla-c0d3/nassl
buildAll_win32.py
buildAll_win32.py
#!/usr/bin/python from os import mkdir, getcwd from os.path import join from sys import platform, version_info from buildAll_config import OPENSSL_CONF_CMD, BUILD_DIR, PY_VERSION, OPENSSL_DIR, ZLIB_DIR, TEST_DIR, perform_build_task, create_folder NASSL_INSTALL_DIR = join(BUILD_DIR, 'lib.win32-' + PY_VERSION) OPENSS...
#!/usr/bin/python from os import mkdir, getcwd from os.path import join from sys import platform, version_info from buildAll_config import OPENSSL_CONF_CMD, BUILD_DIR, PY_VERSION, OPENSSL_DIR, ZLIB_DIR, TEST_DIR, perform_build_task, create_folder NASSL_INSTALL_DIR = join(BUILD_DIR, 'lib.win32-' + PY_VERSION) OPENSS...
agpl-3.0
Python
17a0495b508897af32e45147b938d69e56d3a060
Bump version to 1.1.1
fatelei/pyqqwry
pyqqwry/__init__.py
pyqqwry/__init__.py
# -*- coding: utf8 -*- """ pyqqwry ~~~~~~~ Python Parse QQwry. """ __version__ = "1.1.1"
# -*- coding: utf8 -*- """ pyqqwry ~~~~~~~ Python Parse QQwry. """ __version__ = "1.1.0"
isc
Python
d6e2ca9fc8a653c5a4f11b7db1763f2a318b2d79
Bump Version: 0.21.2 → 0.21.3
akaszynski/vtkInterface
pyvista/_version.py
pyvista/_version.py
""" version info for pyvista """ # major, minor, patch version_info = 0, 21, 3 # Nice string for the version __version__ = '.'.join(map(str, version_info))
""" version info for pyvista """ # major, minor, patch version_info = 0, 21, 2 # Nice string for the version __version__ = '.'.join(map(str, version_info))
mit
Python
d3f5106a93720021fe9a1f9c229f2080b2d282d2
Add a few things to ignore coverage checking for
gmr/queries,gmr/queries
queries/__init__.py
queries/__init__.py
""" Queries: PostgreSQL database access simplified Queries is an opinionated wrapper for interfacing with PostgreSQL that offers caching of connections and support for PyPy via psycopg2ct. The core `queries.Queries` class will automatically register support for UUIDs, Unicode and Unicode arrays. """ __version__ = '1...
""" Queries: PostgreSQL database access simplified Queries is an opinionated wrapper for interfacing with PostgreSQL that offers caching of connections and support for PyPy via psycopg2ct. The core `queries.Queries` class will automatically register support for UUIDs, Unicode and Unicode arrays. """ __version__ = '1...
bsd-3-clause
Python
b0074c31bb9c0fc3fcaa6f5ab8d8d6b446386c35
Remove namedtuple import
brendan-ward/rasterio,brendan-ward/rasterio,brendan-ward/rasterio
rasterio/control.py
rasterio/control.py
"""Ground control points""" class GroundControlPoint(object): """A mapping of row, col image coordinates to x, y, z in a CRS""" def __init__(self, row=None, col=None, x=None, y=None, z=None): self.row = row self.col = col self.x = x self.y = y self.z = z
"""Ground control points""" from collections import namedtuple class GroundControlPoint(object): """A mapping of row, col image coordinates to x, y, z in a CRS""" def __init__(self, row=None, col=None, x=None, y=None, z=None): self.row = row self.col = col self.x = x self.y =...
bsd-3-clause
Python
cf463ebbee73655412a8759cafb293b230a7f728
Add code docs for router
OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft
packages/grid/backend/grid/api/router.py
packages/grid/backend/grid/api/router.py
""" Add each api routes to the application main router. Accesing a specific URL the user would be redirected to the correct router and the specific request handler. """ # third party from fastapi import APIRouter # grid absolute from grid.api.association_requests import association_requests from grid.api.auth import...
# third party from fastapi import APIRouter # grid absolute from grid.api.association_requests import association_requests from grid.api.auth import login from grid.api.auth import register from grid.api.datasets import datasets from grid.api.meta import exam from grid.api.meta import ping from grid.api.meta import st...
apache-2.0
Python
4969a207751f671fe63e182c6dc2153e6ff9efa3
Fix the mocking issue
romses/LXC-Web-Panel,romses/LXC-Web-Panel,claudyus/LXC-Web-Panel,claudyus/LXC-Web-Panel,claudyus/LXC-Web-Panel,claudyus/LXC-Web-Panel,romses/LXC-Web-Panel,romses/LXC-Web-Panel
lwp/authenticators/__init__.py
lwp/authenticators/__init__.py
# -*- coding: utf-8 -*- def get_authenticator(auth): n = "{}.{}".format(__name__, auth) module = __import__(n, fromlist=[__name__]) class_ = getattr(module, auth) return class_()
# -*- coding: utf-8 -*- def get_authenticator(auth): module = __import__("authenticators.{}".format(auth)) module2 = getattr(module, auth) class_ = getattr(module2, auth) return class_()
mit
Python
629dad5967c14dbbb791e079027a5146d08a0a17
Add url's patterns to fbBot app
BrasilLivre/bot
api/fbBot/urls.py
api/fbBot/urls.py
from django.conf.urls import include, url from .views import BotView urlpatterns = [ url(r'^bot/?$', BotView.as_view()) ]
agpl-3.0
Python
5e18515d938073cc7b25385f097c55e87775609e
Set filtering on new blips
scottferg/Profanity-Modifier
ProfanityModifier.py
ProfanityModifier.py
from waveapi import events from waveapi import model from waveapi import robot def OnRobotAdded( properties, context ): """Invoked when the robot has been added""" root_wavelet = context.GetRootWavelet( ) root_wavelet.CreateBlip( ).GetDocument( ).SetText( "Sup prudes?" ) def OnBlipSubmitted( properties, context ):...
from waveapi import events from waveapi import model from waveapi import robot def OnRobotAdded( properties, context ): """Invoked when the robot has been added""" root_wavelet = context.GetRootWavelet( ) root_wavelet.CreateBlip( ).GetDocument( ).SetText( "Sup prudes?" ) def OnBlipSubmitted( properties, context ):...
bsd-3-clause
Python
21303aed9db82fca0ef00c8d3e94a724dafc93a9
remove debug stuff from clean_json.py
DaMSL/K3,DaMSL/K3,yliu120/K3
tools/scripts/mosaic/clean_json.py
tools/scripts/mosaic/clean_json.py
#!/usr/bin/env python3 # # Change json output to be human-readable import argparse import csv import json def convert_dict(d): # for addresses, options, records, etc, just dereference if "type" in d and d["type"] in ["address", "option_or_ind", "record", "Collection", "Map", "Seq"]: return convert_any(...
#!/usr/bin/env python3 # # Change json output to be human-readable import argparse import csv import json def convert_dict(d): # for addresses, options, records, etc, just dereference if "type" in d and d["type"] in ["address", "option_or_ind", "record", "Collection", "Map", "Seq"]: return convert_any(...
apache-2.0
Python
75e1b0d78772ad19bb1b09cabd4cac47f3ee00a9
update docstrings, fixes #23
arteria/django-ar-organizations,arteria/django-ar-organizations
organizations/decorators.py
organizations/decorators.py
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import user_passes_test, REDIRECT_FIELD_NAME from organizations.models import OrganizationUser def organizations_member_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the us...
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import user_passes_test, REDIRECT_FIELD_NAME from organizations.models import OrganizationUser def organizations_member_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the us...
bsd-2-clause
Python
a53994b8d686ad7820125d628ccf3c5bd054a632
use correct objectClasses for AddAction
agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft
pycroft/ldap_sync/action.py
pycroft/ldap_sync/action.py
from abc import ABCMeta, abstractmethod LDAP_OBJECTCLASSES = ['top', 'inetOrgPerson', 'posixAccount', 'shadowAccount'] class Action(object): __metaclass__ = ABCMeta def __init__(self, record): self.record = record @abstractmethod def execute(self, *a, **kw): pass class AddAction(Ac...
from abc import ABCMeta, abstractmethod class Action(object): __metaclass__ = ABCMeta def __init__(self, record): self.record = record @abstractmethod def execute(self, *a, **kw): pass class AddAction(Action): def execute(self, connection): #TODO: Correct ldap objectclas...
apache-2.0
Python
df1291150a274ceb2a034791c0f31d8856a964d7
Add documentation for decorators.
Bismarrck/pymatgen,tallakahath/pymatgen,blondegeek/pymatgen,montoyjh/pymatgen,nisse3000/pymatgen,vorwerkc/pymatgen,setten/pymatgen,ndardenne/pymatgen,gpetretto/pymatgen,matk86/pymatgen,xhqu1981/pymatgen,gVallverdu/pymatgen,ndardenne/pymatgen,mbkumar/pymatgen,ndardenne/pymatgen,montoyjh/pymatgen,tallakahath/pymatgen,tsc...
pymatgen/util/decorators.py
pymatgen/util/decorators.py
#!/usr/bin/env python ''' This module contains useful decorators for a variety of functions. ''' from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyue@mit.edu" __date__ = "Dec 31, ...
#!/usr/bin/env python ''' This module contains useful decorators for a variety of functions. ''' from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyue@mit.edu" __date__ = "Dec 31, ...
mit
Python
031d8e3b0b9b168b9cc656a2de44961dfcb115fc
add headers
ratchetio/pyramid_ratchet
pyramid_ratchet/__init__.py
pyramid_ratchet/__init__.py
""" Plugin for pyramid apps to submit errors to ratchet """ import json import logging import socket import sys import time import traceback from pyramid.httpexceptions import WSGIHTTPException from pyramid.tweens import EXCVIEW import requests log = logging.getLogger(__name__) def handle_error(settings, request)...
""" Plugin for pyramid apps to submit errors to ratchet """ import json import logging import socket import sys import time import traceback from pyramid.httpexceptions import WSGIHTTPException from pyramid.tweens import EXCVIEW import requests log = logging.getLogger(__name__) def handle_error(settings, request)...
mit
Python
747a8f576fd5b17e1f9f09de5e9e5e6f9d0375c2
fix typo
legis-graph/legis-graph,legis-graph/legis-graph
parse_committees.py
parse_committees.py
import csv import yaml OUTPUT_COLUMNS = [ 'type', 'name', 'url', 'thomasID', 'jurisdiction', ] def load_committees(kind): if kind not in ['current', 'historical']: raise Exception('Committee type must be either current or historical') inpath = 'data/congress-legislators/committe...
import csv import yaml OUTPUT_COLUMNS = [ 'type', 'name', 'url', 'thomasID', 'jurisdiction', ] def load_committees(kind): if kind not in ['current', 'historical']: raise Exception('Committe type must be either current or historical') inpath = 'data/congress-legislators/committee...
mit
Python
2df420d3aa225d214ecabd03107e9764665108b1
Add assert on SEPARATOR in text, some type specs, minor repr fix
hatbot-team/hatbot_resources
hb_res/explanations/Explanation.py
hb_res/explanations/Explanation.py
from hb_res.explanations import ExplanationKey __author__ = 'moskupols' SEPARATOR = '\t' class Explanation: """ This class is representation of explanation in resource modules. Explanation is defined as tuple of (title, text, key, prior_rating). It's essential for both title and text not to contain ...
from hb_res.explanations import ExplanationKey __author__ = 'moskupols' SEPARATOR = '\t' class Explanation: """ This class is representation of explanation in resource modules Explanation is defined at tuple of (title, text, key, prior_rating) It's essential for explanation not to contain substring ...
mit
Python
6721547bbb7121a0510c2134bbc49adcc2482c13
Convert world coordinates to RAS
NifTK/NiftyNet,NifTK/NiftyNet,NifTK/NiftyNet,NifTK/NiftyNet
utilities/simple_itk_as_nibabel.py
utilities/simple_itk_as_nibabel.py
import SimpleITK as sitk import nibabel import numpy as np class SimpleITKAsNibabel(nibabel.spatialimages.SpatialImage): ''' Minimal interface to use a SimpleITK image as if it were a nibabel object. Currently only supports the subset of the interface used by NiftyNet and is read only ''' def __i...
import SimpleITK as sitk import nibabel import numpy as np class SimpleITKAsNibabel(nibabel.spatialimages.SpatialImage): ''' Minimal interface to use a SimpleITK image as if it were a nibabel object. Currently only supports the subset of the interface used by NiftyNet and is read only ''' def __i...
apache-2.0
Python
ff864e127a65ac5a5db76a173b84a78d33a8fd35
fix the header format (#7098)
GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples
iam/api-client/workload_identity_federation.py
iam/api-client/workload_identity_federation.py
# Copyright 2021 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 wri...
# Copyright 2021 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 wri...
apache-2.0
Python
467731e95ceccb79ab4020a6b2e843ae94de988c
Add some docstrings
Vnet-as/cisco-olt-http-client,beezz/cisco-olt-http-client
cisco_olt_http/operations.py
cisco_olt_http/operations.py
import xmltodict class OperationResult: def __init__(self, response): self.response = response self.data = xmltodict.parse(response.content) @property def error(self): return int(self.error_code) != 0 @property def error_code(self): return self.data['response'][...
import xmltodict class OperationResult: def __init__(self, response): self.response = response self.data = xmltodict.parse(response.content) @property def error(self): return int(self.error_code) != 0 @property def error_code(self): return self.data['response'][...
mit
Python
b838b52b03e90d195924170a942c6548117d8d0d
Update import in transforms.__init__
yuxiang-zhou/menpofit,grigorisg9gr/menpofit,grigorisg9gr/menpofit,yuxiang-zhou/menpofit
menpofit/transform/__init__.py
menpofit/transform/__init__.py
from .modeldriven import OrthoMDTransform, LinearOrthoMDTransform from .homogeneous import (DifferentiableAffine, DifferentiableSimilarity, DifferentiableAlignmentSimilarity, DifferentiableAlignmentAffine) from .piecewiseaffine import DifferentiablePiecewiseAffine fro...
from .modeldriven import ModelDrivenTransform, OrthoMDTransform from .homogeneous import (DifferentiableAffine, DifferentiableSimilarity, DifferentiableAlignmentSimilarity, DifferentiableAlignmentAffine) from .piecewiseaffine import DifferentiablePiecewiseAffine from ...
bsd-3-clause
Python
271130aeb93ecf2dda5c215d8bc0bcaf3e6f1ec8
tweak speed.
tartley/cbeams,tartley/cbeams
cbeams/animate.py
cbeams/animate.py
import math import random import sys import time from blessings import Terminal from . import shape, terminal class Firework(): ''' A firework looks like an expanding annulus. (i.e. a ring, a colored circle with a black hole in the middle). ''' def __init__(self): # Center point s...
import math import random import sys import time from blessings import Terminal from . import shape, terminal class Firework(): ''' A firework looks like an expanding annulus. (i.e. a ring, a colored circle with a black hole in the middle). ''' def __init__(self): # Center point s...
bsd-3-clause
Python
aff95ee587cf94937fe0d95cc78f7372830e3223
Update mpc to 1.0.3
EmreAtes/spack,krafczyk/spack,lgarren/spack,lgarren/spack,krafczyk/spack,LLNL/spack,EmreAtes/spack,LLNL/spack,iulian787/spack,tmerrick1/spack,krafczyk/spack,LLNL/spack,skosukhin/spack,tmerrick1/spack,mfherbst/spack,lgarren/spack,tmerrick1/spack,TheTimmy/spack,skosukhin/spack,skosukhin/spack,EmreAtes/spack,matthiasdiene...
var/spack/packages/mpc/package.py
var/spack/packages/mpc/package.py
############################################################################## # Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 ...
############################################################################## # Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 ...
lgpl-2.1
Python
4d2345b4f1e6b1dd06937aa06ed6ea3af43d1c00
add each port topic selector
hirolovesbeer/sekiwake,hirolovesbeer/sekiwake
capture.py
capture.py
#! /usr/bin/env python import sys from scapy.all import sniff import zmq from zmq.utils.strtypes import asbytes context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://127.0.0.1:4999") # capture src addr(host) host = '192.168.0.1' syslog_port = '514' netflow_port = '2055' sflow_port = '63...
#! /usr/bin/env python import sys from scapy.all import sniff import zmq from zmq.utils.strtypes import asbytes context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://127.0.0.1:4999") port='514' host='192.168.0.1' filter_rule = "udp and host {0} and port {1}".format(host, port) #print(filter_r...
mit
Python
3cfb3bdbd4bb36d093b16b4f3009e5e8632cfa63
Use new standard api url
cloudControl/cctrl,cloudControl/cctrl
cctrl/settings.py
cctrl/settings.py
# -*- coding: utf-8 -*- """ Copyright 2014 cloudControl GmbH 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 a...
# -*- coding: utf-8 -*- """ Copyright 2014 cloudControl GmbH 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 a...
apache-2.0
Python
5085012d1892212fd8e41865cf952054f3d7546e
allow use of classmethods so long secret_key is imported
andela-sjames/paystack-python
paystackapi/base.py
paystackapi/base.py
"""Base script used across defined.""" import requests from constants import API_URL, PAYSTACK_SECRET_KEY, HEADERS class Borg: """Borg class making class attributes global""" _shared_state = {} def __init__(self): self.__dict__ = self._shared_state class PayStackBase(Borg): """Base Class u...
"""Base script used across defined.""" import requests from constants import API_URL class Borg: """Borg class making class attributes global""" _shared_state = {} def __init__(self): self.__dict__ = self._shared_state class PayStackBase(Borg): """Base Class used across defined.""" de...
mit
Python
16c59ce623ffffb400889b5223dbaead3e621a8b
set up image and album relationship
ellezv/django_imager,ellezv/django_imager,ellezv/django_imager,ellezv/django_imager
imagersite/imager_images/models.py
imagersite/imager_images/models.py
"""Models for the Imager Images.""" from django.db import models from django.utils import timezone from imager_profile.models import ImagerProfile # Create your models here. class Image(models.Model): """Image model for the Imager App.""" title = models.CharField(max_length=255) description = models.Ch...
"""Models for the Imager Images.""" from django.db import models from django.utils import timezone from imager_profile.models import ImagerProfile # Create your models here. class Image(models.Model): """Image model for the Imager App.""" title = models.CharField(max_length=255) description = models.Ch...
mit
Python
1c9059f6f48b50268a3ec43e1ef42be7b3d201ef
Fix module docstring for inventory example.
katharosada/botchallenge,Rafiot/botchallenge,katharosada/botchallenge,katharosada/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge,Rafiot/botchallenge,katharosada/botchallenge
client/examples/inventory.py
client/examples/inventory.py
""" Displays the contents of the bot's inventory. """ from botchallenge import * USERNAME = "" # Put your minecraft username here SERVER = "" # Put the address of the minecraft server here robot = Robot(USERNAME, SERVER) inventory = robot.get_inventory() print("My inventory contains:") for block_type, count in in...
""" Builds a simple dirt hut to shelter you from the enemies at night. """ from botchallenge import * USERNAME = "" # Put your minecraft username here SERVER = "" # Put the address of the minecraft server here robot = Robot(USERNAME, SERVER) inventory = robot.get_inventory() print("My inventory contains:") for bl...
mit
Python
7fb3b926d051e0bbb76568783a8b0fa3c5d0f3be
Add in db value
reticulatingspline/Scores,cottongin/Scores
config.py
config.py
### # Copyright (c) 2012, spline # All rights reserved. # # ### import os import supybot.conf as conf import supybot.registry as registry from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('Scores') def configure(advanced): # This will be called by supyb...
### # Copyright (c) 2012, spline # All rights reserved. # # ### import supybot.conf as conf import supybot.registry as registry from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('Scores') def configure(advanced): # This will be called by supybot to conf...
mit
Python
fad62ac1371e9680bd5ad147ab21cc6e974f55ab
Use the default bucket by default
GoogleCloudPlatform/appengine-opencv-sudoku-python,tmatsuo/appengine-opencv-sudoku-python,gdgjodhpur/appengine-opencv-sudoku-python,GoogleCloudPlatform/appengine-opencv-sudoku-python,tmatsuo/appengine-opencv-sudoku-python
config.py
config.py
from google.appengine.api import app_identity BUCKET_NAME = '' or app_identity.get_default_gcs_bucket_name()
BUCKET_NAME = 'your-bucket-name'
apache-2.0
Python
0862d69c9f60c63155c7f6b336c1e7991e3c38d2
Fix typo
vadmium/python-quilt,bjoernricks/python-quilt
quilt/patch.py
quilt/patch.py
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80: # python-quilt - A Python implementation of the quilt patch system # # Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as ...
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80: # python-quilt - A Python implementation of the quilt patch system # # Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as ...
mit
Python
973bee321f3a66f1949166b80a2447a1a29aa2d0
print the warning information when missing pbr
xgfone/pycom,xgfone/xutils
xutils/version.py
xutils/version.py
# -*- coding: utf-8 -*- try: from pbr.version import VersionInfo except ImportError: VersionInfo = None import logging LOG = logging.getLogger(__name__) def get_app_version(name, default='Unknown'): '''Return the version of the application by its name.''' if VersionInfo: try: ret...
# -*- coding: utf-8 -*- try: from pbr.version import VersionInfo except ImportError: VersionInfo = None def get_app_version(name, default='Unknown'): '''Return the version of the application by its name.''' if VersionInfo: try: return VersionInfo(name).version_string() exc...
mit
Python
fc991fc0bdee973c43c0da0c69cabfdcd503b95c
Update urls.py
stephenmcd/django-socketio,stephenmcd/django-socketio,stephenmcd/django-socketio
django_socketio/urls.py
django_socketio/urls.py
from django.conf.urls import url from . import views from django.conf import settings try: # Django < 1.9 from django.utils.importlib import import_module except: # Django >= 1.9 from importlib import import_module # Try and import an ``events`` module in each installed app, # to ensure all event hand...
from django.conf.urls import patterns, url from django.conf import settings try: # Django < 1.9 from django.utils.importlib import import_module except: # Django >= 1.9 from importlib import import_module # Try and import an ``events`` module in each installed app, # to ensure all event handlers are ...
bsd-2-clause
Python
6b1fbd0d7ca2bde1ccca5a077ec5abd3e3c7dc8e
clean up config; move to py3
lazka/quodlibet-continuous,lazka/quodlibet-continuous,lazka/quodlibet-continuous
config.py
config.py
#!/usr/bin/env python3 import configparser import sys import os def main(argv): config = configparser.RawConfigParser() current = os.path.dirname(os.path.realpath(__file__)) config_path = os.path.join(current, "main.cfg") assert os.path.exists(config_path) config.read(config_path) values = {...
#!/usr/bin/python """ Returns a config value for a config key or if the first argument is a valid file replaces all %KEY% with the right value and prints the replaced file content to stdout. """ import ConfigParser import sys import os def main(argv): config = ConfigParser.RawConfigParser() current = os.pat...
mit
Python
1d5b0f142ae369da086b2272b133a2dbf903885d
Make pre-install script Python 3 compatible
urschrei/convertbng,urschrei/convertbng
ci/pre_install.py
ci/pre_install.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import io import requests import zipfile import tarfile # We need to build the module using a Rust binary # This logic tries to grab it from GitHub, based on the platform platform = sys.platform print(platform) # If we sign our requests, GH doesn't a...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import io import requests import cStringIO import zipfile import tarfile # We need to build the module using a Rust binary # This logic tries to grab it from GitHub, based on the platform platform = sys.platform print(platform) # If we sign our reque...
mit
Python
6da81cd09aa39d92e39b06bb2a65e1d1b1306b35
Use sqlite if no DEV_DATABASE specified in development env
boltzj/movies-in-sf
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_COMMIT_ON_TEARDOWN = True @staticmethod def init_app(app): pass class DevelopmentConfig(Config): DEBUG = True if os.environ.get('DEV_DATABASE_URL'): ...
import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_COMMIT_ON_TEARDOWN = True @staticmethod def init_app(app): pass class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') class TestingConfig(Config): ...
mit
Python
6001c86cb24513f4e874fa25fbf967a358d680a6
add config parsing code
bmintz/techmeme
config.py
config.py
#!/usr/bin/env python3 # encoding: utf-8 # # © 2017 Benjamin Mintz # https://bmintz.mit-license.org/@2017 # """ config.py: Config objects store video """ class Config: def __init__(self, video_filename, filename): self.video_filename = video_filename self.filename = filename self.parse_config() def pa...
#!/usr/bin/env python3 # encoding: utf-8 # # © 2017 Benjamin Mintz # https://bmintz.mit-license.org/@2017 # """ config.py: Config objects store video """ class Config: def __init__(self, video_filename, filename): self.video_filename = video_filename self.filename = filename
mit
Python
147798f4c71bdaa58652d9442563c07dc3620128
Use sys.exc_info()
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Tools/faqwiz/faqw.py
Tools/faqwiz/faqw.py
#! /usr/local/bin/python """FAQ wizard bootstrap.""" # This is a longer version of the bootstrap script given at the end of # faqwin.py; it prints timing statistics at the end of the regular CGI # script's output (so you can monitor how it is doing). # This script should be placed in your cgi-bin directory and made ...
#! /usr/local/bin/python """FAQ wizard bootstrap.""" # This is a longer version of the bootstrap script given at the end of # faqwin.py; it prints timing statistics at the end of the regular CGI # script's output (so you can monitor how it is doing). # This script should be placed in your cgi-bin directory and made ...
mit
Python
dd6281ccf26eee2b8921f253a611ed2716eea138
Update PyMemcacheCache backend to be thread-safe
jsocol/django-pymemcache
djpymemcache/backend.py
djpymemcache/backend.py
try: import cPickle as pickle except ImportError: import pickle from threading import local from django.core.cache.backends.memcached import BaseMemcachedCache def serialize_pickle(key, value): if isinstance(value, basestring): return value, 1 return pickle.dumps(value), 2 def deserialize_pi...
try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.memcached import BaseMemcachedCache def serialize_pickle(key, value): if isinstance(value, basestring): return value, 1 return pickle.dumps(value), 2 def deserialize_pickle(key, value, flags): ...
apache-2.0
Python
2a052fd0871949e5c7d2c7bcf5b9a06cdb774653
Fix redis config
DataViva/dataviva-api
config.py
config.py
from os import getenv class Config(object): DEBUG = False TESTING = False HIDE_DATA = True SQLALCHEMY_TRACK_MODIFICATIONS = False CACHE_TYPE = getenv('CACHE_TYPE', 'redis') CACHE_KEY_PREFIX = getenv('CACHE_KEY_PREFIX', 'api') CACHE_DEFAULT_TIMEOUT = getenv('CACHE_DEFAULT_TIMEOUT', 6000000...
from os import getenv class Config(object): DEBUG = False TESTING = False HIDE_DATA = True SQLALCHEMY_TRACK_MODIFICATIONS = False CACHE_TYPE: getenv('CACHE_TYPE', 'redis') CACHE_KEY_PREFIX: getenv('CACHE_KEY_PREFIX', 'api') CACHE_DEFAULT_TIMEOUT: getenv('CACHE_DEFAULT_TIMEOUT', 60000000) ...
mit
Python
d1bdfe93d2cb4013ea5ba6c3af05429fbbcf1594
Fix bug
pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla,pmatos/maxsatzilla
run-instance-set.py
run-instance-set.py
#!/usr/bin/env python import sys, os, getopt, glob, os.path, signal, tempfile opts, args = getopt.getopt( sys.argv[1:], 'p:' ) solver = args[0] set_list = args[1] execution_list = args[2:] if len( opts ) == 1: print '# Percentatge = ' + opts[0][1] percentatge = int( opts[0][1] ) else: percentatge = 100 t...
#!/usr/bin/env python import sys, os, getopt, glob, os.path, signal, tempfile opts, args = getopt.getopt( sys.argv[1:], 'p:' ) solver = args[0] set_list = args[1] execution_list = args[2:] if len( opts ) == 1: print '# Percentatge = ' + opts[0][1] percentatge = int( opts[0][1] ) else: percentatge = 100 t...
mit
Python
827acbdc8fef4c4df7c7c6eae9e7db96e03d0a97
revert pyspark home to local settings
evancasey/spark-knn-recommender,evancasey/spark-knn-recommender,evancasey/spark-knn-recommender
config.py
config.py
CLUSTER_CONFIG = "local" # relative path PYSPARK_HOME = "../build/spark-0.7.0/pyspark" PYSPARK_MODULE_HOME = "../build/spark-0.7.0/python/pyspark" SPARKLER_HOME = "../build/spark-0.7.0/python/sparkler"
CLUSTER_CONFIG = "spark://172.31.24.105:7077" # relative path PYSPARK_HOME = "../spark-0.8.1-emr/pyspark" PYSPARK_MODULE_HOME = "../spark-0.8.1-emr/python/pyspark" SPARKLER_HOME = "../spark-0.8.1-emr/python/sparkler"
mit
Python
ae41de1898546ef49eaf15b4582facc605e953bb
Create output dir if necessary
CraigKelly/ted-youtube-data
ytscrape/YTCrawl/ytcrawl/logger.py
ytscrape/YTCrawl/ytcrawl/logger.py
"""The logger class supporting the crawler.""" # pylama:ignore=D212,D213,E501 # Author: Honglin Yu <yuhonglin1986@gmail.com> # License: BSD 3 clause import time import os from os.path import join class Logger(object): """record the crawling status, error and warnings.""" def __init__(self, outputDir=""):...
"""The logger class supporting the crawler.""" # pylama:ignore=D212,D213,E501 # Author: Honglin Yu <yuhonglin1986@gmail.com> # License: BSD 3 clause import time from os.path import join class Logger(object): """record the crawling status, error and warnings.""" def __init__(self, outputDir=""): ...
mit
Python
43571f03474681353830ce6d7faad3bf4d9e65db
update to avoid special names
pcd1193182/hauler-tool,pcd1193182/hauler-tool,pcd1193182/hauler-tool
config.py
config.py
# -*- encoding: utf-8 -*- import datetime import os # ----------------------------------------------------- # Application configurations # ------------------------------------------------------ DEBUG = True SECRET_KEY = os.environ['SECRET_KEY'] PORT = int(os.environ['APP_PORT']) HOST = os.environ['APP_HOST'] # ------...
# -*- encoding: utf-8 -*- import datetime import os # ----------------------------------------------------- # Application configurations # ------------------------------------------------------ DEBUG = True SECRET_KEY = os.environ['SECRET_KEY'] PORT = int(os.environ['PORT']) HOST = os.environ['HOST'] # --------------...
mit
Python
ec154362b2be9faadbe3a15b777e773feab1cb77
Enable release notes translation
openstack/bifrost,openstack/bifrost
releasenotes/source/conf.py
releasenotes/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
2ec8c8c601101e0bc9977715dd82dd681464a513
Add some logging
wyldphyre/YouTubeDownloader
YouTubeDownloader.py
YouTubeDownloader.py
#! /usr/bin/env python from __future__ import unicode_literals import os import youtube_dl # Use of youtube-dl is based on the example provided at # https://github.com/rg3/youtube-dl#embedding-youtube-dl class Logger(object): def __init__(self, log_file): self.log_file = log_file def debug(self, ...
#! /usr/bin/env python from __future__ import unicode_literals import os import youtube_dl # Use of youtube-dl is based on the example provided at # https://github.com/rg3/youtube-dl#embedding-youtube-dl class Logger(object): def debug(self, msg): pass def warning(self, msg): pass def...
mit
Python
e8ab72d069633aca71ae60d62ece3c0146289b18
Correct function name and put report_timing_summary at end of script.
SymbiFlow/symbiflow-arch-defs,SymbiFlow/symbiflow-arch-defs
xc7/utils/vivado_output_timing.py
xc7/utils/vivado_output_timing.py
""" Utility for generating TCL script to output timing information from a design checkpoint. """ import argparse def create_output_timing(f_out, args): print( """ source {util_tcl} write_timing_info timing_{name}.json5 report_timing_summary """.format(name=args.name, util_tcl=args.util_tcl), file...
""" Utility for generating TCL script to output timing information from a design checkpoint. """ import argparse def create_runme(f_out, args): print( """ report_timing_summary source {util_tcl} write_timing_info timing_{name}.json5 """.format(name=args.name, util_tcl=args.util_tcl), file=f_out ...
isc
Python
ba2ee80c53c46b5dbb87d63a378932c0dcbbaf14
fix su nome variabili
matteoluzzi/ParkingFinder,matteoluzzi/ParkingFinder,matteoluzzi/ParkingFinder
backend_server/SearchQuadrant.py
backend_server/SearchQuadrant.py
#this simple class implements the quadrant research import Quadrant as quadrant import QuadrantTextFileLoader as loader class SearchQuadrant: inputFile = 0 quadrantsList = 0 def __init__(self,aList): #list of quadrants self.quadrantsList = aList #returns a quadrant for a geographic coordinate def searchQuadra...
#this simple class implements the quadrant research import Quadrant as quadrant import QuadrantTextFileLoader as loader class SearchQuadrant: inputFile = 0 quadrantsList = 0 def __init__(self,aList): #list of quadrants self.quadrantsList = aList #returns a quadrant for a geographic coordinate def searchQuadra...
apache-2.0
Python
981db9a7aacea2a523f55b80e9d7a0a4e0321f8d
set log level from config
tsadm/webapp,tsadm/webapp
src/tsadm/log.py
src/tsadm/log.py
import sys import time from .config import TSAdmCfg _LEVELS = { 'OFF': 0, 'DEBUG': 1, 'WARNING': 2, 'ERROR': 3, } class _Log: cfg = None ftime = None level = None initDone = False class TSAdmLogger: _caller = __name__ def __init__(self, caller): if not _Log.initDone:...
import sys import time from .config import TSAdmCfg class _Log: cfg = None ftime = None initDone = False class TSAdmLogger: _caller = __name__ def __init__(self, caller): if not _Log.initDone: _Log.cfg = TSAdmCfg() _Log.ftime = _Log.cfg.get('LOG_FTIME') ...
bsd-3-clause
Python
0411a6fdb9eacd9bb760353a1bcf86b364f9d7fc
Update service identifier to use new 'Slug' field
alphagov/backdrop-transactions-explorer-collector,alphagov/backdrop-transactions-explorer-collector
collector/classes/service.py
collector/classes/service.py
# -*- coding: utf-8 -*- import string def sanitise_string(messy_str): """Whitelist characters in a string""" valid_chars = ' {0}{1}'.format(string.ascii_letters, string.digits) return u''.join(char for char in messy_str if char in valid_chars).strip() class Service(object): def __init__(self, numeri...
# -*- coding: utf-8 -*- import string def sanitise_string(messy_str): """Whitelist characters in a string""" valid_chars = ' {0}{1}'.format(string.ascii_letters, string.digits) return u''.join(char for char in messy_str if char in valid_chars).strip() class Service(object): def __init__(self, numeri...
mit
Python
2305fbc0fec57cce3ce3b978385cdbf3eb5502aa
Implement .get_serializer() accessor
KetsuN/django-rest-framework-jwt,abdulhaq-e/django-rest-framework-jwt,ayarshabeer/django-rest-framework-jwt,diegueus9/django-rest-framework-jwt,kbussell/django-rest-framework-jwt,liyocee/django-rest-framework-jwt,ajostergaard/django-rest-framework-jwt,ArabellaTech/django-rest-framework-jwt,orf/django-rest-framework-jwt...
rest_framework_jwt/views.py
rest_framework_jwt/views.py
from rest_framework.views import APIView from rest_framework import status from rest_framework import parsers from rest_framework import renderers from rest_framework.response import Response from rest_framework_jwt.settings import api_settings from .serializers import ( JSONWebTokenSerializer, RefreshJSONWebToke...
from rest_framework.views import APIView from rest_framework import status from rest_framework import parsers from rest_framework import renderers from rest_framework.response import Response from rest_framework_jwt.settings import api_settings from .serializers import ( JSONWebTokenSerializer, RefreshJSONWebToke...
mit
Python
95ebba409bed746f0b4309b5a4272b16a22f22c2
add combine_dicts()
funilrys/A-John-Shots
a-john-shots/helpers.py
a-john-shots/helpers.py
#!/bin/env python def unset_empty(list_to_format): """Delete all empty element(s) from a given lis :param list_to_format: A list, List to format """ return ' '.join(list_to_format).split() def combine_dicts(dict1, dict2): """Combine two dictionnaries into one :param dict1: A dict, First d...
#!/bin/env python def unset_empty(list_to_format): """Delete all empty element(s) from a given lis :param list_to_format: A list, List to format """ return ' '.join(list_to_format).split()
mit
Python
50af910c0069b8729f5cea41e1443711a40ec8e6
Fix capitalization of environment variables on Windows when using ST2
codexns/shellenv
all/shellenv/_win.py
all/shellenv/_win.py
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os import locale import sys import ctypes from ._types import str_cls _sys_encoding = locale.getpreferredencoding() kernel32 = ctypes.windll.kernel32 kernel32.GetEnvironmentStringsW.argtypes = [] kernel32.Get...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os import locale import sys import ctypes from ._types import str_cls _sys_encoding = locale.getpreferredencoding() kernel32 = ctypes.windll.kernel32 kernel32.GetEnvironmentStringsW.argtypes = [] kernel32.Get...
mit
Python
b9a6fea54d2b8d2fa66c4fccf21c37183136195c
update release to 2.1.52-dev
bmoyles/aminator,coryb/aminator,kvick/aminator,Netflix/aminator
aminator/__init__.py
aminator/__init__.py
# -*- coding: utf-8 -*- # # # Copyright 2013 Netflix, 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 ...
# -*- coding: utf-8 -*- # # # Copyright 2013 Netflix, 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 ...
apache-2.0
Python
bf43696a45c668d584b64581d5bc3ea587a1648e
Bump version; 0.1.11.dev0
treasure-data/td-client-python
tdclient/version.py
tdclient/version.py
__version__ = "0.1.11.dev0"
__version__ = "0.1.10"
apache-2.0
Python
3f207b5ada4bfb5e1f33cc9095eb79f8ad032f41
Update version to 5.7.0
abusesa/abusehelper
abusehelper/__init__.py
abusehelper/__init__.py
__version__ = "5.7.0"
__version__ = "5.6.0"
mit
Python
c487340f8ecc4f47c36bfcf36ef2b2eb10325e78
Bump to v1.13.0
LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon,LonamiWebs/Telethon
telethon/version.py
telethon/version.py
# Versions should comply with PEP440. # This line is parsed in setup.py: __version__ = '1.13.0'
# Versions should comply with PEP440. # This line is parsed in setup.py: __version__ = '1.12.0'
mit
Python
c728d36b0b0c985c58e1aa032d74d24b189e9ef5
Add mean and list to reg
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/thorium/reg.py
salt/thorium/reg.py
''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. ''' # import python libs from __future__ import division import fnmatch __func_alias__ = { 'set_': 'set', } def set_(name, add, match): ''' Add a value to the named set ...
''' Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. ''' # import python libs import fnmatch __func_alias__ = { 'set_': 'set', } def set_(name, add, match): ''' Add a value to the named set ''' ret = {'name': name, ...
apache-2.0
Python
7464dbfaaf8148289faa9deba1e7a363b2a87deb
update mc_config_player to match relocated mode player registration
missionpinball/mpf-mc,missionpinball/mpf-mc,missionpinball/mpf-mc
mpfmc/core/mc_config_player.py
mpfmc/core/mc_config_player.py
from mpf.core.config_player import ConfigPlayer class McConfigPlayer(ConfigPlayer): config_file_section = None show_section = None machine_collection_name = None show_players = dict() config_file_players = dict() def __init__(self, machine): from kivy.logger import Logger sup...
from mpf.core.config_player import ConfigPlayer class McConfigPlayer(ConfigPlayer): config_file_section = None show_section = None machine_collection_name = None show_players = dict() config_file_players = dict() def __init__(self, machine): from kivy.logger import Logger sup...
mit
Python
31b08477120a746eca0b96af8ad00018047d4d92
fix for make errors
gerva/staging-release
staging_setup.py
staging_setup.py
#!/usr/bin/env python #https://wiki.mozilla.org/ReleaseEngineering/How_To/Setup_Personal_Development_Master#Create_a_build_master import os import sys import tempfile import shutil from lib.config import Config from sh import hg from sh import make from sh import ls import lib.logger import logging if __name__ == '_...
#!/usr/bin/env python #https://wiki.mozilla.org/ReleaseEngineering/How_To/Setup_Personal_Development_Master#Create_a_build_master import os import tempfile import shutil from lib.config import Config from sh import hg from sh import make import lib.logger import logging if __name__ == '__main__': log = logging....
apache-2.0
Python
da991afda660d9b52eb695219bf0598889870520
increase timeout 400 -> 800
h2oai/h2o-2,vbelakov/h2o,vbelakov/h2o,rowhit/h2o-2,calvingit21/h2o-2,rowhit/h2o-2,h2oai/h2o,111t8e/h2o-2,rowhit/h2o-2,100star/h2o,h2oai/h2o,eg-zhang/h2o-2,vbelakov/h2o,calvingit21/h2o-2,calvingit21/h2o-2,111t8e/h2o-2,calvingit21/h2o-2,100star/h2o,rowhit/h2o-2,100star/h2o,vbelakov/h2o,eg-zhang/h2o-2,eg-zhang/h2o-2,111t8...
py/testdir_multi_jvm/test_poker_1m_rf.py
py/testdir_multi_jvm/test_poker_1m_rf.py
import unittest, time, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import2 as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() if (localhost): ...
import unittest, time, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import2 as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() if (localhost): ...
apache-2.0
Python
ebf4fd9375df4cd15bd390ae1c4a684281bd6c0e
Add couple assertions and short-cut
aio-libs/aiohttp_security
aiohttp_security/api.py
aiohttp_security/api.py
import asyncio from aiohttp import web from aiohttp_security.abc import (AbstractIdentityPolicy, AbstractAuthorizationPolicy) IDENTITY_KEY = 'aiohttp_security_identity_policy' AUTZ_KEY = 'aiohttp_security_autz_policy' @asyncio.coroutine def remember(request, response, identity, **kw...
import asyncio from aiohttp import web from aiohttp_security.abc import (AbstractIdentityPolicy, AbstractAuthorizationPolicy) IDENTITY_KEY = 'aiohttp_security_identity_policy' AUTZ_KEY = 'aiohttp_security_autz_policy' @asyncio.coroutine def remember(request, response, identity, **kw...
apache-2.0
Python
f897e91c48cce684abba5119cb33068c5c259122
Complete alg_find_first_match.py
bowen0701/algorithms_data_structures
alg_find_first_match.py
alg_find_first_match.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function def find_first_match(search, source): """Find first match. Find the position in source string with the search string. Time complexity: O(nk), where n and k is the length of source and...
from __future__ import absolute_import from __future__ import division from __future__ import print_function def find_first_match(): pass def main(): pass if __name__ == '__main__': main()
bsd-2-clause
Python
2c0c69ffde2c8aacc68cf066736d32e51f3e068f
Complete geometric_series_memo(); refactor scripts
bowen0701/algorithms_data_structures
alg_geometric_series.py
alg_geometric_series.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function """Geometric series: 1 + r + r^2 + ... + r^(n+1).""" def geometric_series_recur(n, r): """Geometric series by recursion. Time complexity: O(n). Space complexity: O(n) """ if n == 0: ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function """Geometric series: 1 + r + r^2 + ... + r^(n+1).""" def geometric_series_recur(n, r): """Geometric series by recursion. Time complexity: O(n). Space complexity: O(n) """ # a_list = [pow(2...
bsd-2-clause
Python
0abfdf8f49b86d63166ffe82fe902839270e2a79
Add encoding to file
CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,fabianvf/scrapi,fabianvf/scrapi,erinspace/scrapi
scrapi/harvesters/erudit.py
scrapi/harvesters/erudit.py
# coding=utf-8 ''' Harvester for the Erudit for the SHARE project Example API call: http://oai.erudit.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc ''' from __future__ import unicode_literals from scrapi.base import OAIHarvester class EruditHarvester(OAIHarvester): short_name = 'erudit' long_name =...
''' Harvester for the Erudit for the SHARE project Example API call: http://oai.erudit.org/oai/request?verb=ListRecords&metadataPrefix=oai_dc ''' from __future__ import unicode_literals from scrapi.base import OAIHarvester class EruditHarvester(OAIHarvester): short_name = 'erudit' long_name = 'Érudit' u...
apache-2.0
Python
e6cfc4749a1f0ae3d9546894071b5c36034af629
fix models import
tassolom/twq-app,tassolom/twq-app,teamworkquality/twq-app,tassolom/twq-app,teamworkquality/twq-app,tassolom/twq-app,teamworkquality/twq-app,teamworkquality/twq-app
api/companies/models.py
api/companies/models.py
from django.db import models from ..users.models import User class Company(models.Model): name = models.CharField(max_length=250, unique=True) owner = models.ForeignKey(User) class Team(models.Model): name = models.CharField(max_length=250, unique=True)
from django.db import models from users.models import User class Company(models.Model): name = models.CharField(max_length=250, unique=True) owner = models.ForeignKey(User) class Team(models.Model): name = models.CharField(max_length=250, unique=True)
mit
Python
62cd92e1cbea9b8876634799afc14bb15995703c
Rework factory tests
nemunaire/nemubot,nbr23/nemubot
nemubot/server/factory_test.py
nemubot/server/factory_test.py
# Nemubot is a smart and modulable IM bot. # Copyright (C) 2012-2015 Mercier Pierre-Olivier # # 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 yo...
# Nemubot is a smart and modulable IM bot. # Copyright (C) 2012-2015 Mercier Pierre-Olivier # # 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 yo...
agpl-3.0
Python
23ef00f3acb60a84bfe6aa5e6f7da639b21cdd7b
remove reference to purify
jwkvam/conex,jwkvam/bowtie,jwkvam/conex,jwkvam/conex,jwkvam/bowtie,jwkvam/bowtie
conex/__init__.py
conex/__init__.py
""" Conex """ __version__ = '0.0.1-dev' from flask_socketio import emit from conex.layout import Layout
""" Conex """ __version__ = '0.0.1-dev' from flask_socketio import emit from conex.layout import Layout from conex.purify import purify
mit
Python
3bd8354db0931e8721e397a32bf696b023e692b7
Put weblink on separate line
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
test/664-raceway.py
test/664-raceway.py
# https://www.openstreetmap.org/way/28825404 assert_has_feature( 16, 10476, 25242, 'roads', { 'id': 28825404, 'kind': 'minor_road', 'highway': 'raceway' }) # https://www.openstreetmap.org/way/59440900 # Thunderoad Speedway Go-carts assert_has_feature( 16, 10516, 25247, 'roads', { 'id': 59440900, 'kind'...
# https://www.openstreetmap.org/way/28825404 assert_has_feature( 16, 10476, 25242, 'roads', { 'id': 28825404, 'kind': 'minor_road', 'highway': 'raceway' }) # Thunderoad Speedway Go-carts https://www.openstreetmap.org/way/59440900 assert_has_feature( 16, 10516, 25247, 'roads', { 'id': 59440900, 'kind': ...
mit
Python