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 |
|---|---|---|---|---|---|---|---|---|
9f2ff3d5fb361525fbac623925039cd53970b6ab | Update release script. | yx91490/pgcli,thedrow/pgcli,bitmonk/pgcli,dbcli/vcli,nosun/pgcli,j-bennet/pgcli,suzukaze/pgcli,TamasNo1/pgcli,bitemyapp/pgcli,lk1ngaa7/pgcli,suzukaze/pgcli,thedrow/pgcli,joewalnes/pgcli,d33tah/pgcli,MattOates/pgcli,j-bennet/pgcli,darikg/pgcli,koljonen/pgcli,MattOates/pgcli,bitmonk/pgcli,n-someya/pgcli,dbcli/pgcli,johsh... | release.py | release.py | #!/usr/bin/env python
import re
import ast
import subprocess
DEBUG = False
def version(version_file):
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open(version_file, 'rb') as f:
ver = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
return ver... | #!/usr/bin/env python
import re
import ast
import subprocess
def version():
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pgcli/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
return version
def create... | bsd-3-clause | Python |
68b3528e91692e447b06097f7142b5429abd760a | Fix language filtering | Guhogu/owl2csv | owl2csv.py | owl2csv.py | import sys
import click
import json
import csv
from rdflib import Graph, Namespace, URIRef, Literal
def observe_dataset(datasets, query, prefixes, lang):
g = Graph()
if prefixes:
prefixes = json.load(prefixes)
for name, url in prefixes.items():
g.bind(name, Namespace(url.strip('<>'... | import sys
import click
import json
import csv
from rdflib import Graph, Namespace, URIRef
def observe_dataset(datasets, query, prefixes, lang):
g = Graph()
if prefixes:
prefixes = json.load(prefixes)
for name, url in prefixes.items():
g.bind(name, Namespace(url.strip('<>')))
f... | mit | Python |
428474f0f3233a64198f47c066fd0d56617a3793 | Refactor ErrorView | jarhart/SublimeSBT | errorview.py | errorview.py | import sublime
import sublime_plugin
try:
from .sbtsettings import SBTSettings
from .util import OnePerWindow
except(ValueError):
from sbtsettings import SBTSettings
from util import OnePerWindow
class ErrorView(OnePerWindow):
error_type_display = {
'error': 'Error',
'warning': '... | import sublime
import sublime_plugin
try:
from .sbtsettings import SBTSettings
from .util import OnePerWindow
except(ValueError):
from sbtsettings import SBTSettings
from util import OnePerWindow
class ErrorView(OnePerWindow):
def __init__(self, window):
self.window = window
self... | mit | Python |
8e6b6fdc939aa2a82bbf432eb6339b5b5a84cb9c | make get_domain more flexible | st4lk/django-relish | relish/helpers/site.py | relish/helpers/site.py | from django.contrib.sites.models import get_current_site
from django.conf import settings
def get_domain(request=None, protocol=None):
protocol = protocol or getattr(settings, "SITE_PROTOCOL", None) or 'http'
return "{0}://{1}".format(protocol, get_current_site(request))
| from django.contrib.sites.models import get_current_site
def get_domain(request=None):
return "http://" + str(get_current_site(request))
| bsd-3-clause | Python |
b32ea3906993ef5bc28235ba06d98c420f36960e | Update version. | KmolYuan/pyslvs,KmolYuan/pyslvs,KmolYuan/pyslvs,KmolYuan/pyslvs | __init__.py | __init__.py | # -*- coding: utf-8 -*-
"""Kernel of Pyslvs.
This kernel can work without GUI.
Modules:
+ Solver:
+ parser
+ tinycadlib
+ Sketch Solve solver
+ triangulation
+ Number synthesis:
+ number
+ Structure Synthesis:
+ atlas
+ Dimensional synthesis:
+ planarlinkage
+ rga
+ firefly
... | # -*- coding: utf-8 -*-
"""Kernel of Pyslvs.
This kernel can work without GUI.
Modules:
+ Solver:
+ parser
+ tinycadlib
+ Sketch Solve solver
+ triangulation
+ Number synthesis:
+ number
+ Structure Synthesis:
+ atlas
+ Dimensional synthesis:
+ planarlinkage
+ rga
+ firefly
... | agpl-3.0 | Python |
1e6721ca45da49df064748cdd8161fc717140487 | bump to 3.1.2rc1 | pypa/setuptools,pypa/setuptools,pypa/setuptools | __init__.py | __init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id$"
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.1.2rc1"... | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
__revision__ = "$Id$"
# Distutils version
#
# Updated automatically by the Python release process.
#
#--start constants--
__version__ = "3.1.1"
#-... | mit | Python |
1bdf5ab5a4d56d1b7ca0cb0b8e383bbec073ce17 | update __init_py | pravsripad/jumeg,fboers/jumegX,jdammers/jumeg,fboers/jumegX,fboers/jumeg | __init__.py | __init__.py | # Authors (alphabetical order):
# Frank Boers <f.boers@fz-juelich.de>
# Lukas Breuer <l.breuer@fz-juelich.de>
# Juergen Dammers <j.dammers@fz-juelich.de>
# Denis Engemann <d.engemann@fz-juelich.de>
# Praveen Sripad <praveen.sripad@rwth-aachen.de>
#
# License: Simpli... | # Authors (alphabetical order):
# Frank Boers <f.boers@fz-juelich.de>
# Lukas Breuer <l.breuer@fz-juelich.de>
# Juergen Dammers <j.dammers@fz-juelich.de>
# Denis Engemann <d.engemann@fz-juelich.de>
# Praveen Sripad <praveen.sripad@rwth-aachen.de>
#
# License: Simpli... | bsd-3-clause | Python |
ce5345e5cf1ef39c836f447872116124fc4493f8 | Implement linear time solution | andreimaximov/quora,andreimaximov/quora,andreimaximov/quora | __main__.py | __main__.py | #!/usr/bin/env python
import sys
def read(fn):
return [fn(x) for x in sys.stdin.readline().split()]
def matrix(n, m):
"""
Creates an n x m matrix.
"""
return [[None for i in range(0, m)] for j in range(0, n)]
def range_lengths(upvotes, comparator):
n = len(upvotes)
start = 0
lengt... | #!/usr/bin/env python
import sys
def read(fn):
return [fn(x) for x in sys.stdin.readline().split()]
def count_sub_ranges(n):
assert n > 1
return int((n ** 2 - n) / 2)
def count_ranges(upvotes, lo, hi, comparator):
count = 0
start = lo
for i in range(lo, hi + 1):
if i < hi and comp... | mit | Python |
afa856f6ec010e1a71e854791192b2c7d8b566a0 | add connect, read, write to top level import | blaze/distributed,dask/distributed,amosonn/distributed,broxtronix/distributed,dask/distributed,mrocklin/distributed,amosonn/distributed,dask/distributed,amosonn/distributed,broxtronix/distributed,mrocklin/distributed,blaze/distributed,broxtronix/distributed,dask/distributed,mrocklin/distributed | distributed/__init__.py | distributed/__init__.py | from .center import Center
from .core import connect, read, write
from .worker import Worker
from .client import scatter, gather, delete, clear, rpc
from .diagnostics import progress
from .utils import sync
from .nanny import Nanny
from .executor import Executor, wait, as_completed
from .scheduler import Scheduler
__v... | from .center import Center
from .worker import Worker
from .client import scatter, gather, delete, clear, rpc
from .diagnostics import progress
from .utils import sync
from .nanny import Nanny
from .executor import Executor, wait, as_completed
from .scheduler import Scheduler
__version__ = '1.6.1'
| bsd-3-clause | Python |
0821e31867bac4704248a63d846c9e5fc0377ac3 | Add populate es function to test driver | MITRECND/multiscanner,awest1339/multiscanner,mitre/multiscanner,awest1339/multiscanner,awest1339/multiscanner,jmlong1027/multiscanner,jmlong1027/multiscanner,jmlong1027/multiscanner,mitre/multiscanner,awest1339/multiscanner,MITRECND/multiscanner,mitre/multiscanner,jmlong1027/multiscanner | storage/test_driver.py | storage/test_driver.py | #!/usr/bin/env python
from storage import Storage
NEW_REPORT = {'foo': 'bar', 'boo': 'baz'}
REPORTS = [
{'report_id': 1, 'report': {"/tmp/example": {"MD5": "53f43f9591749b8cae536ff13e48d6de", "SHA256": "815d310bdbc8684c1163b62f583dbaffb2df74b9104e2aadabf8f8491bafab66", "libmagic": "ASCII text"}}},
{'report_id... | #!/usr/bin/env python
from storage import Storage
NEW_REPORT = {'foo': 'bar', 'boo': 'baz'}
def main():
db_store = Storage.get_storage()
for key, value in db_store.__dict__.iteritems():
print '%s: %s' % (key, value)
print '\n'
# report_id = db_store.store(NEW_REPORT)
report_id = 'AVM0dGO... | mpl-2.0 | Python |
c70451a72e71189058c14b69aace63af3c2bcee8 | add headers | mosquito/m3uhttp,mosquito/m3uhttp | m3uhttp.py | m3uhttp.py | #!/usr/bin/env python2
# encoding: utf-8
from gevent import monkey
monkey.patch_all()
import os
import urllib2
import json
from bottle import route, run, response, template, request
playlist = os.getenv('PLAYLIST', 'http://127.0.0.1/torrent-telik')
@route('/')
def index():
index_template = open(
os.path.... | #!/usr/bin/env python2
# encoding: utf-8
from gevent import monkey
monkey.patch_all()
import os
import urllib2
import json
from bottle import route, run, response, template, request
playlist = os.getenv('PLAYLIST', 'http://127.0.0.1/torrent-telik')
@route('/')
def index():
index_template = open(
os.path.... | mit | Python |
a42bbd56029e52cef8c017cba193bc4360a22675 | Tweak loop to start at 1 instead of 0 | Duke-GCB/TrackHubGenerator,Duke-GCB/TrackHubGenerator | python/bedgraph_utils/filter_overlap_max.py | python/bedgraph_utils/filter_overlap_max.py | #!/usr/bin/env python
import sys
import fileinput
import csv
from bedgraph_utils import *
def convert_row(row):
return row[COL_CHROM], int(row[COL_START]), int(row[COL_END]), float(row[COL_VALUE])
def find_gap(queue):
if len(queue) < 2:
return None
index = None
chrom = queue[0][COL_CHROM]
... | #!/usr/bin/env python
import sys
import fileinput
import csv
from bedgraph_utils import *
def convert_row(row):
return row[COL_CHROM], int(row[COL_START]), int(row[COL_END]), float(row[COL_VALUE])
def find_gap(queue):
if len(queue) < 2:
return None
index = None
chrom = queue[0][COL_CHROM]
... | mit | Python |
ad049633fa0e5aa735245601223ef7b8df8d1def | return a permissions error if query fails | c4fcm/MediaMeter-Mentions,c4fcm/MediaMeter-Mentions | app/mentions/views.py | app/mentions/views.py | import datetime
import flask, flask_login
import mediacloud.api as mcapi
import app.core
from app.core import flapp
import app.core.util
@flapp.route('/api/stories/docs/<keywords>/<media>/<start>/<end>.csv')
@flask_login.login_required
def story_docs_csv(keywords, media, start, end):
user_mc = mcapi.MediaCloud(f... | import datetime
import flask, flask_login
import mediacloud.api as mcapi
import app.core
from app.core import flapp
import app.core.util
@flapp.route('/api/stories/docs/<keywords>/<media>/<start>/<end>.csv')
@flask_login.login_required
def story_docs_csv(keywords, media, start, end):
user_mc = mcapi.MediaCloud(f... | apache-2.0 | Python |
f0f52a8ecac14a4a944c71868afb012c3f9c2a85 | remove celery import | ioannisstenos/e-science,ioannisstenos/e-science,VFoteinos/e-science,grnet/e-science,grnet/e-science,ibyron/e-science,ibyron/e-science,grnet/e-science,KPetsas/e-science,KPetsas/e-science,ioannisstenos/e-science,VFoteinos/e-science,grnet/e-science,grnet/e-science,ioannisstenos/e-science,VFoteinos/e-science,ioannisstenos/... | ember_django/backend/__init__.py | ember_django/backend/__init__.py | # This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
#from celery import app as celery_app | # This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from celery import app as celery_app | agpl-3.0 | Python |
3f6faf99169bee8e70213a41b3a6e5485a248d26 | Revise run.py. | blab/nextflu,blab/nextflu,blab/stability,blab/stability,blab/stability,blab/stability,blab/stability,blab/nextflu,blab/nextflu,blab/nextflu,blab/stability | augur/src/run.py | augur/src/run.py | #!/usr/bin/env python
import os, re, time, datetime, csv, sys, argparse, subprocess
import rethinkdb as r
from vdb_download import vdb_download
from Bio import SeqIO, AlignIO
def local_count(params):
count = 0
fname = params.path + params.fstem + "." + params.ftype
if os.path.isfile(fname):
handle = open(fname, "... | #!/usr/bin/env python
import os, re, time, datetime, csv, sys, argparse, subprocess
import rethinkdb as r
from vdb_download import vdb_download
from Bio import SeqIO, AlignIO
def local_count(params):
handle = open(params.path + params.fstem + "." + params.ftype, "rU")
records = list(SeqIO.parse(handle, "fasta"))
re... | agpl-3.0 | Python |
f2a88e4849876970c29b568b897dff88ffe09306 | Use path instead of soon to be deprecated url | jaap3/django-richtextfield,jaap3/django-richtextfield | djrichtextfield/urls.py | djrichtextfield/urls.py | from django.urls import path
from djrichtextfield.views import InitView
urlpatterns = [
path('init.js', InitView.as_view(), name='djrichtextfield_init')
]
| from django.conf.urls import url
from djrichtextfield.views import InitView
urlpatterns = [
url('^init.js$', InitView.as_view(), name='djrichtextfield_init')
]
| mit | Python |
76c1bf0e867bfcc71d1a27f0fe5dbf272c59c2f2 | Fix terminology | lojban/python-camxes | camxes/tests.py | camxes/tests.py | from attest import Tests, assert_hook
import camxes
parse = Tests()
@parse.context
def parse_tree():
yield camxes.parse("coi rodo mi cipra loka na cfila la camxes")
@parse.test
def ast(pt):
assert pt.free[0].CMAVO[0].COI[0][0] == "coi"
assert pt.sentence[0].bridiTail3[0].BRIVLA[0].gismu[0][0] == "cipra"... | from attest import Tests, assert_hook
import camxes
parse = Tests()
@parse.context
def parse_tree():
yield camxes.parse("coi rodo mi cipra loka na cfila la camxes")
@parse.test
def ast(pt):
assert pt.free[0].CMAVO[0].COI[0][0] == "coi"
assert pt.sentence[0].bridiTail3[0].BRIVLA[0].gismu[0][0] == "cipra"... | bsd-2-clause | Python |
3196465dd0ecb6ca379265c6a42967bdfc2b62c8 | Make sponsor relation admin page more useful | CasualGaming/studlan,dotKom/studlan,dotKom/studlan,CasualGaming/studlan,dotKom/studlan,CasualGaming/studlan,dotKom/studlan,CasualGaming/studlan | apps/sponsor/admin.py | apps/sponsor/admin.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from apps.sponsor.models import Sponsor, SponsorRelation, SponsorTranslation
class SponsorTranslationInlineAdmin(admin.StackedInline):
verbose_name = _(u'Translation'... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from apps.sponsor.models import Sponsor, SponsorRelation, SponsorTranslation
class SponsorTranslationInlineAdmin(admin.StackedInline):
verbose_name = _(u'Translation'... | mit | Python |
a99c3fbc8cd4d3cdb5bc1d2313f09a75d16040be | Update to new NetworkX API. | musec/py-cdg | cdg/__init__.py | cdg/__init__.py | # Copyright 2017 Jonathan Anderson
#
# 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 2017 Jonathan Anderson
#
# 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 |
58981e5613043211c4da39eae24f08dec47d75f5 | add wait and as_completed to top level api | mrocklin/distributed,dask/distributed,dask/distributed,mrocklin/distributed,broxtronix/distributed,amosonn/distributed,broxtronix/distributed,mrocklin/distributed,blaze/distributed,amosonn/distributed,amosonn/distributed,dask/distributed,dask/distributed,blaze/distributed,broxtronix/distributed | distributed/__init__.py | distributed/__init__.py | from .center import Center
from .worker import Worker
from .client import scatter, gather, delete, clear
from .dask import get
from .executor import Executor, wait, as_completed
__version__ = '1.1.0'
| from .center import Center
from .worker import Worker
from .client import scatter, gather, delete, clear
from .dask import get
from .executor import Executor
__version__ = '1.1.0'
| bsd-3-clause | Python |
20dd25d10d11440002e80116ee423941d8d5be0f | update version | areski/django-nvd3,areski/django-nvd3,chiu/django-nvd3,lgp171188/django-nvd3,lgp171188/django-nvd3,areski/django-nvd3,chiu/django-nvd3,chiu/django-nvd3,lgp171188/django-nvd3,marcogiusti/django-nvd3 | django_nvd3/__init__.py | django_nvd3/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 1, 0, "")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Arezqui Belaid"
__contact__ = "areski@gmail.com"
__homepage__ = "http://www.areski.net"
__docformat__ = "restructuredtext"
| # -*- coding: utf-8 -*-
VERSION = (0, 0, 4, "")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Arezqui Belaid"
__contact__ = "areski@gmail.com"
__homepage__ = "http://www.areski.net"
__docformat__ = "restructuredtext"
| mit | Python |
50155c66b1bf76d5c59a9441f33633b2f56c6eed | Add autocomplete to user profile admin form | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firecares_core/admin.py | firecares/firecares_core/admin.py | import autocomplete_light
from .models import Address, ContactRequest, AccountRequest, RegistrationWhitelist
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.gis import admin
from firecares.firecares_core... | from .models import Address, ContactRequest, AccountRequest, RegistrationWhitelist
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.gis import admin
from firecares.firecares_core.models import UserProfile... | mit | Python |
d7a87c2d22e8ab8f39177e5b1fd6a3ee3a3e7d88 | Fix comment | joachimmetz/artifacts,Onager/artifacts,joachimmetz/artifacts,ForensicArtifacts/artifacts,ForensicArtifacts/artifacts,pstirparo/artifacts,Onager/artifacts,pstirparo/artifacts | artifacts/registry.py | artifacts/registry.py | # -*- coding: utf-8 -*-
"""The artifact definitions registry."""
class ArtifactDefinitionsRegistry(object):
"""Class that implements the artifact definitions registry."""
def __init__(self):
"""Initializes the artifact definitions registry object."""
super(ArtifactDefinitionsRegistry, self).__init__()
... | # -*- coding: utf-8 -*-
"""The artifact definitions registry."""
class ArtifactDefinitionsRegistry(object):
"""Class that implements the artifact definitions registry."""
def __init__(self):
"""Initializes the artifact definitions registry object."""
super(ArtifactDefinitionsRegistry, self).__init__()
... | apache-2.0 | Python |
c080865fdb36da2718774ddff436325d947be323 | Add test for index to cells | ntruessel/qcgc,ntruessel/qcgc,ntruessel/qcgc | test/test_fit_allocator.py | test/test_fit_allocator.py | from support import lib,ffi
from qcgc_test import QCGCTest
class FitAllocatorTest(QCGCTest):
def test_macro_consistency(self):
self.assertEqual(2**lib.QCGC_LARGE_FREE_LIST_FIRST_EXP, lib.qcgc_small_free_lists + 1)
last_exp = lib.QCGC_LARGE_FREE_LIST_FIRST_EXP + lib.qcgc_large_free_lists - 1
... | from support import lib,ffi
from qcgc_test import QCGCTest
class FitAllocatorTest(QCGCTest):
def test_macro_consistency(self):
self.assertEqual(2**lib.QCGC_LARGE_FREE_LIST_FIRST_EXP, lib.qcgc_small_free_lists + 1)
last_exp = lib.QCGC_LARGE_FREE_LIST_FIRST_EXP + lib.qcgc_large_free_lists - 1
... | mit | Python |
b0a6652a11236409ec3e2606e04621f714a3ab63 | Test generic creator of jobs. | jean/pybossa,Scifabric/pybossa,geotagx/pybossa,OpenNewsLabs/pybossa,jean/pybossa,inteligencia-coletiva-lsd/pybossa,geotagx/pybossa,stefanhahmann/pybossa,stefanhahmann/pybossa,PyBossa/pybossa,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa,OpenNewsLabs/pybossa,PyBossa/pybossa | test/test_jobs/__init__.py | test/test_jobs/__init__.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 | Python |
188b35f1e5dfa0699d9e3273474b0f60ab479905 | Update version | cloudboss/bossimage,cloudboss/bossimage | bossimage/__init__.py | bossimage/__init__.py | __version__ = '0.4.3'
| __version__ = '0.4.2'
| mit | Python |
cc1815890b70389424f683e43bf2144bd34d7e75 | Bump version number to 2.0.2 | dan-gamble/cms,dan-gamble/cms,dan-gamble/cms | cms/__init__.py | cms/__init__.py | """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
# Always use 3 parts, not 1, 2, or 4.
VERSION = (2, 0, 2)
| """
A collection of Django extensions that add content-management facilities to Django projects.
Developed by Dave Hall.
<http://etianen.com/>
"""
# Always use 3 parts, not 1, 2, or 4.
VERSION = (2, 0, 1)
| bsd-3-clause | Python |
c975832a931651843bffb106af4af2f5c455badc | bump version as instructed by bamboo | pbs/django-cms,pbs/django-cms,pbs/django-cms,pbs/django-cms | cms/__init__.py | cms/__init__.py | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.14'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | # -*- coding: utf-8 -*-
__version__ = '2.3.5pbs.13'
# patch settings
try:
from django.conf import settings
if 'cms' in settings.INSTALLED_APPS:
from conf import patch_settings
patch_settings()
except ImportError: # pragma: no cover
"""
This exception means that either the application is... | bsd-3-clause | Python |
0ce43d30ef5273b1799f21980ae9602177a2bcb5 | delete non referenced file | h3/django-webcore,h3/django-webcore | webcore/management/commands/unreferenced_files.py | webcore/management/commands/unreferenced_files.py | from collections import defaultdict
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import models
from django.db.models.loading import cache
from optparse import make_option
def walk(top_dir, ignore):
for dirpath, dirnames, filenames in os.walk(top_dir)... | from collections import defaultdict
import os
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.db import models
from django.db.models.loading import cache
def walk(top_dir, ignore):
for dirpath, dirnames, filenames in os.walk(top_dir):
dirnames[:] = [dn for... | bsd-3-clause | Python |
478e92fd34ad67438a4aef00f8529b9642fa44dd | Remove futile import | JackWink/sqlalchemy-utils,joshfriend/sqlalchemy-utils,tonyseek/sqlalchemy-utils,marrybird/sqlalchemy-utils,joshfriend/sqlalchemy-utils,cheungpat/sqlalchemy-utils,konstantinoskostis/sqlalchemy-utils,tonyseek/sqlalchemy-utils,spoqa/sqlalchemy-utils,rmoorman/sqlalchemy-utils | sqlalchemy_utils/operators.py | sqlalchemy_utils/operators.py | import sqlalchemy as sa
class CaseInsensitiveComparator(sa.Unicode.Comparator):
@classmethod
def lowercase_arg(cls, func):
def operation(self, other, **kwargs):
if other is None:
return getattr(sa.Unicode.Comparator, func)(
self, other, **kwargs
... | import six
import sqlalchemy as sa
class CaseInsensitiveComparator(sa.Unicode.Comparator):
@classmethod
def lowercase_arg(cls, func):
def operation(self, other, **kwargs):
if other is None:
return getattr(sa.Unicode.Comparator, func)(
self, other, **kwar... | bsd-3-clause | Python |
e0b39f79d769602b26117ffa5161dc7f127ae15f | Change the local settings import. | testvidya11/ejrf,eJRF/ejrf,eJRF/ejrf,testvidya11/ejrf,eJRF/ejrf,testvidya11/ejrf,eJRF/ejrf | eJRF/settings.py | eJRF/settings.py | """
Django settings for eJRF project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | """
Django settings for eJRF project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | bsd-3-clause | Python |
4883989c5cd36a4aa66dcaa647626a551b2b510d | add more test data | tetherless-world/satoru,tetherless-world/graphene,tetherless-world/satoru,tetherless-world/graphene,tetherless-world/graphene,tetherless-world/satoru,tetherless-world/satoru,tetherless-world/graphene | tests/api/api_test_data.py | tests/api/api_test_data.py | HOME_INSTANCE_URI = "http://localhost:5000/Home"
HOME_PAGE_CLASS_URI = "http://vocab.rpi.edu/whyis/HomePage"
ONTOLOGY_INSTANCE_URI = "http://example.com/janetology"
ONTOLOGY_INSTANCE_TURTLE = """\
<%(ONTOLOGY_INSTANCE_URI)s> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .... | HOME_INSTANCE_URI = "http://localhost:5000/Home"
ONTOLOGY_INSTANCE_URI = "http://example.com/janetology"
ONTOLOGY_INSTANCE_TURTLE = """\
<%(ONTOLOGY_INSTANCE_URI)s> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .""" % globals()
PERSON_INSTANCE_URI = "http://example.com/ja... | apache-2.0 | Python |
d960ba543e8582b6fd2246371297ef47d1203833 | remove unecessary param | uc-cdis/cdis-python-utils | cdispyutils/oauth2/__init__.py | cdispyutils/oauth2/__init__.py | from oauth2 import OAuth2Client
import requests
class OAuth2Error:
def __init__(self, message='', json=None):
self.message = message
self.code = 400
def authorize(user_api, get_code):
code = get_code()
if not code:
raise OAuth2Error("No authorization code provided")
token_re... | from oauth2 import OAuth2Client
import requests
class OAuth2Error:
def __init__(self, message='', json=None):
self.message = message
self.code = 400
def authorize(self, user_api, get_code):
code = get_code()
if not code:
raise OAuth2Error("No authorization code provided")
to... | apache-2.0 | Python |
08c732af3f5c961040a42994266108c5cee5328c | tweak result summary text | ahelsing/geni-tools,GENI-NSF/gram,plantigrade/geni-tools,ahelsing/geni-tools,tcmitchell/geni-tools,GENI-NSF/gram,GENI-NSF/gram,plantigrade/geni-tools,tcmitchell/geni-tools | examples/expirationofmyslices.py | examples/expirationofmyslices.py | #!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restricti... | #!/usr/bin/python
#----------------------------------------------------------------------
# Copyright (c) 2011 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restricti... | mit | Python |
e6bb92a38ef0d956e70cacced654a705544924d6 | Use sell value | Bluelytics/bluelytics,Bluelytics/bluelytics,Bluelytics/bluelytics,Bluelytics/bluelytics | bluelytics/dolar_blue/management/commands/export_graph.py | bluelytics/dolar_blue/management/commands/export_graph.py | from django.core.management.base import BaseCommand, CommandError
from dolar_blue.models import DolarBlue, Source
from django.utils import timezone
from decimal import Decimal
import sys, datetime, json
from dolar_blue.utils import DecimalEncoder, arg
def last_prices_each_day():
return DolarBlue.objects.raw('\
... | from django.core.management.base import BaseCommand, CommandError
from dolar_blue.models import DolarBlue, Source
from django.utils import timezone
from decimal import Decimal
import sys, datetime, json
from dolar_blue.utils import DecimalEncoder, arg
def last_prices_each_day():
return DolarBlue.objects.raw('\
... | agpl-3.0 | Python |
0265f065391a938ec6ee21260c7798aca90791e6 | Copy swarm_hashes factory property during AnnotatorFactory's triggers. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/master/factory/annotator_factory.py | scripts/master/factory/annotator_factory.py | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility class to generate and manage a factory to be passed to a
builder dictionary as the 'factory' member, for each builder in c['builders'].
Speci... | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility class to generate and manage a factory to be passed to a
builder dictionary as the 'factory' member, for each builder in c['builders'].
Speci... | bsd-3-clause | Python |
fb231147312f982a4c0edb23cb278c425a71ac45 | add anotesion | umyuu/Sample,umyuu/Sample,umyuu/Sample,umyuu/Sample | src/Python3/Game/hitandblow.py | src/Python3/Game/hitandblow.py | # -*- coding: UTF-8 -*
import random
class HitAndBlow(object):
def __init__(self, n: int=3):
assert 10 >= n
self.N = n
self.answer = self.generate()
def generate(self) -> list:
"""
答えの数字を生成。
:return:
"""
digits = list(range(10))
random.s... | # -*- coding: UTF-8 -*
import random
class HitAndBlow(object):
def __init__(self, n=3):
self.N = n
self.answer = self.generate()
def generate(self):
"""
答えの数字を生成。
:return:
"""
digits = [i for i in range(10)]
random.shuffle(digits)
return... | mit | Python |
10a601a1232cfc8e26b77830cb79d97bca01ac1a | add an unused thought in aux/create_secrets.py | idupree/idupree-websitepy,idupree/idupree-websitepy,idupree/idupree-websitepy | aux/create_secrets.py | aux/create_secrets.py | #!/usr/bin/env python
import random
easy_to_read_and_type = '23456789abcdefghijkmnpqrstuvwxyz'
alnum = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
def alnum_secret(length = 22):
"""
The default length of 22 gives at least 128 bits of entropy
(entropy = log2(62**length))
"""
rng = random.... | #!/usr/bin/env python
import random
alnum = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
def alnum_secret(length = 22):
"""
The default length of 22 gives at least 128 bits of entropy
(entropy = log2(62**length))
"""
rng = random.SystemRandom()
return ''.join(rng.choice(alnum) for _ in ... | mit | Python |
1e5f8299dfa0e724933bb565359650a5dc579bb6 | Use pyramid.paster instad of paste.deploy | asidev/aybu-core | aybu/core/dispatch.py | aybu/core/dispatch.py | import os
import logging
import pyramid.paster
from paste.script.util.logging_config import fileConfig
log = logging.getLogger(__name__)
def get_pylons_app(global_conf):
pyramid_config = os.path.realpath(global_conf['__file__'])
dir_, conf = os.path.split(pyramid_config)
config_file = os.path.join(dir_, ... | import os
import logging
from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig
log = logging.getLogger(__name__)
def get_pylons_app(global_conf):
pyramid_config = os.path.realpath(global_conf['__file__'])
dir_, conf = os.path.split(pyramid_config)
config_file = os.path.... | apache-2.0 | Python |
c50ec43bd4e0b99ac04966215bbfd01be47eeda3 | Correct wrong usage of list instead of tuple | PatrikValkovic/grammpy | grammpy/IsMethodsRuleExtension.py | grammpy/IsMethodsRuleExtension.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
from .exceptions import RuleException, UselessEpsilonException, RuleSyntaxException, TerminalDoesNotExistsException, \
NonterminalDoesNotExistsException
from .Constants import EPS
... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
from .exceptions import RuleException, UselessEpsilonException, RuleSyntaxException, TerminalDoesNotExistsException, \
NonterminalDoesNotExistsException
from .Constants import EPS
... | mit | Python |
8494e4e04d432caaf6293f7e2954f3a4891d8e9a | bump ver | penkin/python-dockercloud,docker/python-dockercloud,docker/python-dockercloud,penkin/python-dockercloud | dockercloud/__init__.py | dockercloud/__init__.py | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | import base64
import logging
import os
import requests
from future.standard_library import install_aliases
install_aliases()
from dockercloud.api import auth
from dockercloud.api.service import Service
from dockercloud.api.container import Container
from dockercloud.api.repository import Repository
from dockercloud.... | apache-2.0 | Python |
a8ffed59c634121b603168512b54e2ad1c27819a | change path of h2o py module | YzPaul3/h2o-3,h2oai/h2o-dev,h2oai/h2o-dev,mathemage/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,mathemage/h2o-3,jangorecki/h2o-3,h2oai/h2o-3,jangorecki/h2o-3,spennihana/h2o-3,spennihana/h2o-3,spennihana/h2o-3,mathemage/h2o-3,h2oai/h2o-3,mathemage/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,YzPaul3/h2o-3,h2oai/h2o-dev,michalkurka/h... | h2o-py/test_hadoop/test_hadoop.py | h2o-py/test_hadoop/test_hadoop.py | import sys
sys.path.insert(1,"../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
import os
def test_hadoop():
'''
Test H2O read and write to hdfs
'''
hdfs_name_node = os.getenv("NAME_NODE")
h2o_data = h2o.import_file("hdfs://" + hdfs_name_n... | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
import os
def test_hadoop():
'''
Test H2O read and write to hdfs
'''
hdfs_name_node = os.getenv("NAME_NODE")
h2o_data = h2o.import_file("hdfs://" + hdfs_... | apache-2.0 | Python |
69f4ec4cbc3bb934b81efa8a324d348e5489483b | fix data migration | DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug | apps/options/migrations/0003_data_migration.py | apps/options/migrations/0003_data_migration.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-25 09:33
from __future__ import unicode_literals
from django.db import migrations
def migrate_options(apps, schema_editor):
Option = apps.get_model('options', 'Option')
OptionSet = apps.get_model('options', 'OptionSet')
OldOption = apps.get_mo... | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-25 09:33
from __future__ import unicode_literals
from django.db import migrations
def migrate_options(apps, schema_editor):
Option = apps.get_model('options', 'Option')
OptionSet = apps.get_model('options', 'OptionSet')
OldOption = apps.get_mo... | apache-2.0 | Python |
f753c9ceabb49ca3f77b6fc7984fd465bbae142a | Add People, Idol, Group and Membership models from H!R. | hello-base/web,hello-base/web,hello-base/web,hello-base/web | base/people/models.py | base/people/models.py | from django.db import models
from model_utils.managers import PassThroughManager
from model_utils.models import TimeStampedModel
from .constants import (BLOOD_TYPE, CLASSIFICATIONS, SCOPE, STATUS)
class Person(TimeStampedModel):
name = models.CharField(editable=False)
romanized_name = models.CharField(edita... | from django.db import models
# Create your models here.
| apache-2.0 | Python |
c23522c779a804d85548b53f6f446f43c5aa4ae4 | add version number to __init__ | fmfn/BayesianOptimization | bayes_opt/__init__.py | bayes_opt/__init__.py | from .bayesian_optimization import BayesianOptimization, Events
from .domain_reduction import SequentialDomainReductionTransformer
from .util import UtilityFunction
from .logger import ScreenLogger, JSONLogger
from .constraint import ConstraintModel
__version__ = 1.3.0
__all__ = [
"BayesianOptimization",
"Con... | from .bayesian_optimization import BayesianOptimization, Events
from .domain_reduction import SequentialDomainReductionTransformer
from .util import UtilityFunction
from .logger import ScreenLogger, JSONLogger
from .constraint import ConstraintModel
__all__ = [
"BayesianOptimization",
"ConstraintModel"
"Ut... | mit | Python |
27ae322497cb05b0ca75355f4099a5da97fa4dac | Change upload view permission to is_staff | lutris/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website | common/views.py | common/views.py | from django.shortcuts import render
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.contrib.syndication.views import Feed
from django.conf import settings
from django.views.generic import DetailView, TemplateView
from common.forms import UploadForm
from common.models import News
def h... | from django.shortcuts import render
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.contrib.syndication.views import Feed
from django.conf import settings
from django.views.generic import DetailView, TemplateView
from common.forms import UploadForm
from common.models import News
def h... | agpl-3.0 | Python |
28732f6e5c43b298d618592dd4683239740f2016 | remove print statment | mainakibui/kobocat,qlands/onadata,ehealthafrica-ci/onadata,ultimateprogramer/formhub,sounay/flaminggo-test,wesley1001/formhub,SEL-Columbia/formhub,mainakibui/kobocat,eHealthAfrica/formhub,smn/onadata,eHealthAfrica/formhub,GeoODK/formhub,ehealthafrica-ci/formhub,wesley1001/formhub,kobotoolbox/kobocat,awemulya/fieldsight... | restservice/utils.py | restservice/utils.py | from odk_logger.models.instance import Instance
from restservice.models import RestService
def call_service(instance):
# lookup service
if isinstance(instance, Instance):
# registered services
services = RestService.objects.filter(xform=instance.xform)
# call service send with url and d... | from odk_logger.models.instance import Instance
from restservice.models import RestService
def call_service(instance):
print "call_service has been called!"
# lookup service
if isinstance(instance, Instance):
# registered services
services = RestService.objects.filter(xform=instance.xform)
... | bsd-2-clause | Python |
b14ca021e93c40b02c5fef4972795796bddeb5ba | Disable groups.json loading until it's fixed. | fragaria/BorIS,fragaria/BorIS,fragaria/BorIS | boris/utils/management/load_static_fixtures.py | boris/utils/management/load_static_fixtures.py | from django.conf import settings
from django.core.management import call_command
from south.signals import post_migrate
__author__ = 'xaralis'
APPS_TO_WAIT_FOR = ['clients', 'services']
def load_static_data(app, **kwargs):
global APPS_TO_WAIT_FOR
APPS_TO_WAIT_FOR.remove(app)
if len(APPS_TO_WAIT_FOR) ... | from django.conf import settings
from django.core.management import call_command
from south.signals import post_migrate
__author__ = 'xaralis'
APPS_TO_WAIT_FOR = ['clients', 'services']
def load_static_data(app, **kwargs):
global APPS_TO_WAIT_FOR
APPS_TO_WAIT_FOR.remove(app)
if len(APPS_TO_WAIT_FOR) ... | mit | Python |
c4ac86eec896d3d2311affd380e5399ad8f4a855 | clean up | cellcraft/cellcraft | mcpipy/test/connectors/test_connectors.py | mcpipy/test/connectors/test_connectors.py | from mcpipy.mcpi.vpython_minecraft import Minecraft
from unittest.mock import Mock, patch
import json
def test_minecraft_connector():
mc = Minecraft() | from mcpipy.mcpi.vpython_minecraft import Minecraft
from unittest.mock import Mock, patch
import json
def test_minecraft_connector():
# with patch('mcpipy.mcpi.vpython_minecraft.Minecraft') as ws_return_mock, \
# open(PATH_FIXTURES + 'response_gmaps_reverse_geocode.json', 'r') as mock_file:
# min... | mit | Python |
7a17661b8d3e6e2d71b7390e1bbd1522c7a4a540 | Add NOP macro | redfast00/RCPU | RCPU/assembler/expanders/utilexpander.py | RCPU/assembler/expanders/utilexpander.py | from RCPU.assembler.expanders.baseexpander import BaseExpander
from RCPU.architecture import MAX_VALUE_LDV
from RCPU.assembler.expanders.helpers import get_free_register, fill_instructions
class UtilExpander(BaseExpander):
@BaseExpander.instruction
def LDV16(arg):
destination = arg[0]
try:
... | from RCPU.assembler.expanders.baseexpander import BaseExpander
from RCPU.architecture import MAX_VALUE_LDV
from RCPU.assembler.expanders.helpers import get_free_register, fill_instructions
class UtilExpander(BaseExpander):
@BaseExpander.instruction
def LDV16(arg):
destination = arg[0]
try:
... | mit | Python |
f5ac0bfff2953ea420f7ca12fae5d9bd058bbc55 | clean up validator, add successful logs | michaelimfeld/adapo | validate_config.py | validate_config.py | #!/usr/bin/python
import yaml
import urllib2
import re
from logger import Logger
class ConfigValidator(object):
def __init__(self, cfg_file="csgo.conf"):
# load config file
config_file = open(cfg_file, "r")
self._config_yaml = yaml.load(config_file)
config_file.close()
sel... | #!/usr/bin/python
import yaml
import urllib2
import re
from logger import Logger
def validate_maps(maps, fastdl_url):
"""
check if all listed maps are
available on the fastdl server
"""
maps_url = "%s/maps/" % fastdl_url
pattern = r'href=[\'"]?([^\'" >]+)'
response = urllib2.urlope... | mit | Python |
0ab98ff17b4566b4866fd0aae570e8770f67f2ed | Update io.py (#784) | modin-project/modin,modin-project/modin | modin/experimental/engines/pyarrow_on_ray/io.py | modin/experimental/engines/pyarrow_on_ray/io.py | from io import BytesIO
import pandas
import pyarrow as pa
import pyarrow.csv as csv
from modin.backends.pyarrow.query_compiler import PyarrowQueryCompiler
from modin.data_management.utils import get_default_chunksize
from modin.engines.ray.generic.io import RayIO
from modin.experimental.engines.pyarrow_on_ray.frame.d... | from io import BytesIO
import ray
import pandas
import pyarrow as pa
import pyarrow.csv as csv
from modin.backends.pyarrow.query_compiler import PyarrowQueryCompiler
from modin.data_management.utils import get_default_chunksize
from modin.engines.ray.generic.io import RayIO
from modin.experimental.engines.pyarrow_on_... | apache-2.0 | Python |
ac68d2b410af84ef33b2f688ea53b3f2c10c5c4f | Implement developer_utilities/validate_patches.py | Eloston/ungoogled-chromium,Eloston/ungoogled-chromium | developer_utilities/validate_patches.py | developer_utilities/validate_patches.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Simple sanity check of patches and base config bundle patch order files for
a given config ... | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Simple sanity check of patches and base config bundle patch order files.
Features:
* ... | bsd-3-clause | Python |
3d5fc47c119999641bec28be6827e6588230a68d | Raise exception if adding CM admin fails | cc1-cloud/cc1,cc1-cloud/cc1,cc1-cloud/cc1,cc1-cloud/cc1 | src/clm/views/admin_cm/admin.py | src/clm/views/admin_cm/admin.py | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | apache-2.0 | Python |
bdc728604031ac20ff7751a07e9f9ad8a281e82e | Fix test_settings | 5monkeys/django-enumfield | django_enumfield/tests/test_settings.py | django_enumfield/tests/test_settings.py | import os
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}}
INSTALLED_APPS = ["django_enumfield", "django_enumfield.tests"]
SECRET_KEY = "iuf... | import os
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}}
INSTALLED_APPS = ["django_enumfield", "tests.models"]
SECRET_KEY = "iufoj=mibkpdz... | mit | Python |
bc91a023b0c1c9ff013fd59038ef8c811300e2cb | Modifie webdevtproject/urls.py | zobeltran/webdevtproject,zobeltran/webdevtproject | webdevtproject/urls.py | webdevtproject/urls.py | """webdevtproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | """webdevtproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | apache-2.0 | Python |
64b24e77fe4feca099a865b7f715f5d3eee83f2c | Fix tests | aaronn/django-rest-framework-passwordless,aaronn/django-rest-framework-passwordless | drfpasswordless/urls.py | drfpasswordless/urls.py | from django.conf.urls import url
from .views import (ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTokenFromCallbackToken,
VerifyAliasFromCallbackToken,
ObtainEmailVerificationCallbackToken,
ObtainMobile... | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import (ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTokenFromCallbackToken,
VerifyAliasFromCallbackToken,
ObtainEm... | mit | Python |
500b1b6b8feb3f0fde13ff8a85b417e642ef4d5a | Create DocDB fix | Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,lmazuel/azure-sdk-for-python,Azure/azure-sdk-for-python,rjschwei/azure-sdk-for-python,SUSE/azure-sdk-for-python,Azure/azure-sdk-for-python,AutorestCI/azure-sdk-for-python,v-iam/azure-sdk-for-python | azure-mgmt-documentdb/azure/mgmt/documentdb/models/database_account_create_update_parameters.py | azure-mgmt-documentdb/azure/mgmt/documentdb/models/database_account_create_update_parameters.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | Python |
85c98082ec8aa2b16b2bb8a1824a78126c6e9eed | Fix setup to include data files for tests. | cournape/audiolab,cournape/audiolab,cournape/audiolab | scikits/audiolab/setup.py | scikits/audiolab/setup.py | import os
from os.path import join
TEST_DATA_FILES = ['test.raw', 'test.flac', 'test.wav', 'test.au', 'test.sdif']
#BAD_FLAC_FILES = ['Makefile', 'badflac.flac', 'badflac.c']
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
confgr = Configuration('audiol... | import os
from os.path import join
TEST_DATA_FILES = ['test.raw', 'test.flac', 'test.wav', 'test.au', 'test.sdif']
#BAD_FLAC_FILES = ['Makefile', 'badflac.flac', 'badflac.c']
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
confgr = Configuration('audiol... | lgpl-2.1 | Python |
e8eb9faca47d567e655a58c9889645919d3dbe91 | fix scipy.interpolate module docstring | witcxc/scipy,perimosocordiae/scipy,raoulbq/scipy,nvoron23/scipy,Newman101/scipy,surhudm/scipy,jor-/scipy,kleskjr/scipy,chatcannon/scipy,mingwpy/scipy,ChanderG/scipy,vberaudi/scipy,lhilt/scipy,josephcslater/scipy,mikebenfield/scipy,aeklant/scipy,trankmichael/scipy,mgaitan/scipy,dch312/scipy,Shaswat27/scipy,Dapid/scipy,s... | scipy/interpolate/info.py | scipy/interpolate/info.py | """
Sub-package for objects used in interpolation.
As listed below, this sub-package contains spline functions and classes,
one-dimensional and multi-dimensional (univariate and multivariate)
interpolation classes, Lagrange and Taylor polynomial interpolators, and
wrappers for `FITPACK <http://www.cisl.ucar.edu/softli... | """
Sub-package for objects used in interpolation.
As listed below, this sub-package contains spline functions and classes,
one-dimensional and multi-dimensional (univariate and multivariate)
interpolation classes, Lagrange and Taylor polynomial interpolators, and
wrappers for `FITPACK <http://www.cisl.ucar.edu/softli... | bsd-3-clause | Python |
716759112c792cdf61b09872169a4dad0fae92de | add dir parameter for search | bbc2/porygon-ftp,bbc2/porygon-ftp,bbc2/porygon-ftp | indexer.py | indexer.py | #!/usr/bin/env python
import ftplib
import whoosh
import whoosh.fields
import whoosh.index
import whoosh.qparser
class Index(ftplib.FTP):
def __init__(self, address, user, passwd):
ftplib.FTP.__init__(self, address, timeout=5)
self.login(user=user, passwd=passwd)
schema = whoosh.fields.Sch... | #!/usr/bin/env python
import ftplib
import whoosh
import whoosh.fields
import whoosh.index
import whoosh.qparser
class Index(ftplib.FTP):
def __init__(self, address, user, passwd):
ftplib.FTP.__init__(self, address, timeout=5)
self.login(user=user, passwd=passwd)
schema = whoosh.fields.Sch... | mit | Python |
ebbcb7a3f4ff43c7770d8b6493e2e7d66ee82331 | fix comment | jrief/djangocms-cascade,jrief/djangocms-cascade,jrief/djangocms-cascade,haricot/djangocms-bs4forcascade,haricot/djangocms-bs4forcascade | cmsplugin_cascade/templatetags/cascade_tags.py | cmsplugin_cascade/templatetags/cascade_tags.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django import template
from django.core.cache import caches
from django.template.exceptions import TemplateSyntaxError
from django.contrib.staticfiles import finders
from classytags.arguments import Argument
from classytags.core import ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django import template
from django.core.cache import caches
from django.template.exceptions import TemplateSyntaxError
from django.contrib.staticfiles import finders
from classytags.arguments import Argument
from classytags.core import ... | mit | Python |
b5e2fd9ee5b60bef801fb7057976e1b1df037799 | Fix pep8 error | aio-libs/aiohttp_session | aiohttp_session/cookie_storage.py | aiohttp_session/cookie_storage.py | import asyncio
import json
import base64
from cryptography import fernet
from cryptography.fernet import InvalidToken
from . import AbstractStorage, Session
class EncryptedCookieStorage(AbstractStorage):
"""Encrypted JSON storage.
"""
def __init__(self, secret_key, *, cookie_name="AIOHTTP_SESSION",
... | import asyncio
import json
import base64
from cryptography import fernet
from cryptography.fernet import InvalidToken
from . import AbstractStorage, Session
class EncryptedCookieStorage(AbstractStorage):
"""Encrypted JSON storage.
"""
def __init__(self, secret_key, *, cookie_name="AIOHTTP_SESSION",
... | apache-2.0 | Python |
5b789dd6be9522f78a6f638ef5e77c0d863d848c | add drop_all() before creating mysql tables | bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base | initial.py | initial.py | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | mit | Python |
2088e80189addca99985de8bafb98dd534f38cc4 | update dependency build_bazel_rules_nodejs to v4.7.1 (#1200) | googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript | repositories.bzl | repositories.bzl | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def gapic_generator_typescript_repositories():
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
sha256 = "c911b5bd8aee8b0498cc387cacdb5f917098ce477fb4182db07b0ef8a9e0... | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def gapic_generator_typescript_repositories():
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e... | apache-2.0 | Python |
4ec1ca9854d5d0f34ec58a46c44f1a143d22bc66 | Change for django 2.0+ | theju/urlscript | core/models.py | core/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
LANGS = (
('py', _('Python')),
('js', _('Javascript')),
)
class URL(models.Model):
slug = models.CharField(max_length=10, unique=True, db_index=True)
language = models.CharField(max_length=20, choices=LANGS)
scr... | from django.db import models
from django.utils.translation import ugettext_lazy as _
LANGS = (
('py', _('Python')),
('js', _('Javascript')),
)
class URL(models.Model):
slug = models.CharField(max_length=10, unique=True, db_index=True)
language = models.CharField(max_length=20, choices=LANGS)
scr... | mit | Python |
ac97d383448e395dd3cb5bda3c93e7409c902ea3 | fix settings..iteritems() | bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base,bderstine/WebsiteMixer-App-Base | initial.py | initial.py | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | #!venv/bin/python
import getpass, sys, os, uuid
print("================================================================================")
#This will need to ask for values and then update and deploy template files with those values.
domain = raw_input('Enter the domain name that will be used (.com/.net/.org): ')
appna... | mit | Python |
26d955946a9100ec7d12d6fcc7de42ad512e10ff | Add categories, tags indexing | mkoistinen/aldryn-newsblog,czpython/aldryn-newsblog,czpython/aldryn-newsblog,mkoistinen/aldryn-newsblog,czpython/aldryn-newsblog,mkoistinen/aldryn-newsblog,czpython/aldryn-newsblog | aldryn_newsblog/search_indexes.py | aldryn_newsblog/search_indexes.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text
from aldryn_search.helpers import get_plugin_index_data
from aldryn_search.utils import get_index_base, strip_tags
from .models import Article
class ArticleIndex(get_index_b... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from aldryn_search.helpers import get_plugin_index_data
from aldryn_search.utils import get_index_base, strip_tags
from .models import Article
class ArticleIndex(get_index_base()):
haystack_use_for_indexing = getat... | bsd-3-clause | Python |
af31c71e49b7d63c24ab7d7c04a5e908451263e2 | Add more logging test stubs | IATI/iati.core,IATI/iati.core | iati/core/tests/test_utilities.py | iati/core/tests/test_utilities.py | """A module containing tests for the library implementation of accessing utilities."""
from lxml import etree
import iati.core.resources
import iati.core.utilities
class TestUtilities(object):
"""A container for tests relating to utilities"""
def test_convert_to_schema(self):
"""Check that an etree c... | """A module containing tests for the library implementation of accessing utilities."""
from lxml import etree
import iati.core.resources
import iati.core.utilities
class TestUtilities(object):
"""A container for tests relating to utilities"""
def test_convert_to_schema(self):
"""Check that an etree c... | mit | Python |
8a6e112d0c84903dacc72935a5bcb77bf8e4e072 | allow the menu to be used in standalone mode. | edoburu/django-fluent-dashboard,edoburu/django-fluent-dashboard | ecms_dashboard/items.py | ecms_dashboard/items.py | """
Custom menu items
"""
from admin_tools.menu import items
from django.core import urlresolvers
from django.template.defaultfilters import capfirst
from django.utils.translation import ugettext as _
from ecms_dashboard.utils import sort_cms_models
# For now, just allow this package to be used outside the main ECMS m... | """
Custom menu items
"""
from admin_tools.menu import items
from django.core import urlresolvers
from django.template.defaultfilters import capfirst
from django.utils.translation import ugettext as _
from ecms_dashboard.utils import sort_cms_models
from ecms.admin.utils import get_current_edited_page
class CmsModelL... | apache-2.0 | Python |
9d0d530acad030efa564843ef72ac545c3b5d49d | test #1 | tonyqiu1019/BulletAPI,tonyqiu1019/BulletAPI | wechat/wechat/views.py | wechat/wechat/views.py | from django.http import HttpResponse, HttpResponseBadRequest
from hashlib import sha1
from lxml import etree
def _check_token(request):
get_dict = request.GET.dict()
needed_token = ['signature', 'timestamp', 'nonce', 'echostr']
for token in needed_token:
if token not in get_dict:
retur... | from django.http import HttpResponse, HttpResponseBadRequest
from hashlib import sha1
from lxml import etree
def _check_token(request):
get_dict = request.GET.dict()
needed_token = ['signature', 'timestamp', 'nonce', 'echostr']
for token in needed_token:
if token not in get_dict:
retur... | mit | Python |
d2ca006957b45c9bd32c02c2182f1b8ec166c54b | Remove unnecessary wrapper | axsemantics/rohrpost,axsemantics/rohrpost | rohrpost/registry.py | rohrpost/registry.py | from typing import Callable, Dict, List, Union
HANDLERS: Dict[str, Callable] = dict()
def _rohrpost_handler(func: Callable, name: Union[str, List[str]]) -> Callable:
def update_registry(key: str, value: Callable):
if key in HANDLERS:
raise Exception('Handler for "{}" is already defined.'.form... | from typing import Callable, Dict, List, Union
HANDLERS: Dict[str, Callable] = dict()
def _rohrpost_handler(func: Callable, name: Union[str, List[str]]):
def ret_func(*args, **kwargs):
return func(*args, **kwargs)
def update_registry(key: str, value: Callable):
if key in HANDLERS:
... | mit | Python |
2a20e7fa983ec8f830b3d53ca3961d2d74ed2f37 | Fix checking path is folder | damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager | photonix/photos/management/commands/create_library.py | photonix/photos/management/commands/create_library.py | import os
import argparse
from pathlib import Path
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from photonix.photos.models import Library, LibraryPath, LibraryUser
from photonix.photos.utils.db import record_photo
from p... | import os
from pathlib import Path
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from photonix.photos.models import Library, LibraryPath, LibraryUser
from photonix.photos.utils.db import record_photo
from photonix.photos.u... | agpl-3.0 | Python |
b4eab6b74e087f0f2064f96e1231b2eb2ad9cfe6 | set video timeout to 10 min | Lodour/Weibo-Album-Crawler | weibo/spiders/video.py | weibo/spiders/video.py | import os.path
from urllib.parse import urlparse
import scrapy
from weibo import api, utils
from weibo import configs
from weibo.items import VideoItem
class VideoSpider(scrapy.Spider):
name = 'video'
allowed_domains = ['weibo.com']
media_cache_key = 'mid'
media_results_key = 'files'
download_wa... | import os.path
from urllib.parse import urlparse
import scrapy
from weibo import api, utils
from weibo import configs
from weibo.items import VideoItem
class VideoSpider(scrapy.Spider):
name = 'video'
allowed_domains = ['weibo.com']
media_cache_key = 'mid'
media_results_key = 'files'
download_wa... | mit | Python |
73eba0c013babdda92f104a1df7d9e805f4a1879 | update test.py using proper string formatting | lexruee/am2315,lexruee/am2315,lexruee/am2315 | examples/test.py | examples/test.py | import time
from tentacle_pi.AM2315 import AM2315
am = AM2315(0x5c,"/dev/i2c-1")
for x in range(0,100):
temperature, humidity, crc_check = am.sense()
print "temperature: %0.1f" % temperature
print "humidity: %0.1f" % humidity
print "crc_ok: %s" % (crc_check == 1)
time.sleep(2)
| import time
from tentacle_pi.AM2315 import AM2315
am = AM2315(0x5c,"/dev/i2c-1")
for x in range(0,10):
temperature, humidity, crc_check = am.sense()
print "temperature: %s" % temperature
print "humidity: %s" % humidity
print "crc: %s" % crc_check
time.sleep(2)
| mit | Python |
b62fce31a3f1399dddb4c1851120e410791038db | migrate data persistence | usc-isi-i2/mydig-webservice,usc-isi-i2/mydig-webservice,usc-isi-i2/mydig-webservice,usc-isi-i2/mydig-webservice | ws/data_persistence.py | ws/data_persistence.py | import json
import threading
import os
import codecs
import logging
from config import config
logger = logging.getLogger(config['logging']['name'])
# 1.acquire file write lock
# 2.write to file.new
# 4.rename file to file.old
# 5.rename file.new to file
# 6.remove file.old
# 7.release write lock
# *. lock should be ... | import json
import threading
import os
import codecs
# 1.acquire file write lock
# 2.write to file.new
# 4.rename file to file.old
# 5.rename file.new to file
# 6.remove file.old
# 7.release write lock
# *. lock should be acquire outside this method (convert data to binary should also be atomic)
def dump_data(data, f... | mit | Python |
4c2ab27ada84b39cadc0312bd92436a3a53ce563 | fix urls for user | adaptive-learning/geography,adaptive-learning/geography,adaptive-learning/geography,slaweet/autoskola,slaweet/autoskola,slaweet/autoskola,adaptive-learning/geography | wsgi/openshift/urls.py | wsgi/openshift/urls.py | from django.conf.urls.defaults import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'geography.views.home', name='home'),
url(r'^tpl/welco... | from django.conf.urls.defaults import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', 'geography.views.home', name='home'),
url(r'^tpl/welco... | mit | Python |
b35e26d89965380b1e4275953801bff0c9aecdbe | add free_xiaoice_from_work function | WEIZIBIN/PersonalWebsite,WEIZIBIN/PersonalWebsite,WEIZIBIN/PersonalWebsite | flask_website/xiaoice_storage.py | flask_website/xiaoice_storage.py | import uuid
from flask_website.config import xiaoice_timeout
work_xiaoice = {}
free_xiaoice = {}
class Xiaoice():
def __init__(self, weibo):
self._weibo = weibo
def get_weibo(self):
return self._weibo
def send_msg(self, msg):
self._weibo.post_msg_to_xiaoice(msg)
def get_msg... | import uuid
work_xiaoice = {}
free_xiaoice = {}
class Xiaoice():
def __init__(self, weibo):
self._weibo = weibo
def get_weibo(self):
return self._weibo
def send_msg(self, msg):
self._weibo.post_msg_to_xiaoice(msg)
def get_msg(self, timeout=70):
return self._weibo.ge... | mit | Python |
9538f4f4be050e6f86ede86fe0bcfe82a942c819 | change SSH to HTTPS URIs and remove private repo from another test | bethgelab/foolbox,bethgelab/foolbox | foolbox/tests/test_git_cloner.py | foolbox/tests/test_git_cloner.py | from foolbox.zoo import git_cloner
from pathlib import Path
import os
import hashlib
import pytest
from foolbox.zoo.git_cloner import GitCloneError
def test_git_clone():
# given
git_uri = "https://github.com/bethgelab/convex_adversarial.git"
expected_path = _expected_path(git_uri)
# when
path = g... | from foolbox.zoo import git_cloner
from pathlib import Path
import os
import hashlib
import pytest
from foolbox.zoo.git_cloner import GitCloneError
def test_git_clone():
# given
git_uri = "git@github.com:bethgelab/analysis-by-synthesis-model.git"
expected_path = _expected_path(git_uri)
# when
pat... | mit | Python |
6b34abde89a3b9f9e0cd3aa115400678a22bf307 | isolate file | meteran/isolate,meteran/isolate | isolate.py | isolate.py | #!/usr/bin/env python
# coding: utf-8
import argparse, os
from isolate import SUBSYSTEMS, NAMESPACES, Cgroup, run_in_namespaces
def enter_cgroup(target, name, subsystems):
c = Cgroup(name, subsystems)
c.enter()
target()
def parse_cgroups(string):
try:
subsystems, path = string.split(":")
... | #!/usr/bin/env python
# coding: utf-8
| bsd-3-clause | Python |
d99204b49909865fe37720c830067a80082a96ff | Fix a typo in the example inset_rectangle_region.py (#1066) | GenericMappingTools/gmt-python,GenericMappingTools/gmt-python | examples/gallery/embellishments/inset_rectangle_region.py | examples/gallery/embellishments/inset_rectangle_region.py | """
Inset map showing a rectangular region
--------------------------------------
The :meth:`pygmt.Figure.inset` method adds an inset figure inside a larger
figure. The function is called using a ``with`` statement, and its position,
box, offset, and margin can be customized. Plotting methods called within the
``with`... | """
Inset map showing a rectangular region
--------------------------------------
The :meth:`pygmt.Figure.inset` method adds an inset figure inside a larger
figure. The function is called using a ``with`` statement, and its position,
box, offset, and margin can be customized. Plotting methods called within the
``with`... | bsd-3-clause | Python |
ffd6d00e639ddfc68ce51d4fae13c0980525b98b | bump version | xflash96/gitolite-sshkey-form,yongjhih/gitlolite-sshkey,yongjhih/gitlolite-sshkey,xflash96/gitolite-sshkey-form,yongjhih/gitlolite-sshkey,xflash96/gitolite-sshkey-form,xflash96/gitolite-sshkey-form | websshkey/version.py | websshkey/version.py | #!/usr/bin/env python
# encoding: utf-8
'''
Version information constants and auxiliary functions.
'''
VERSION = (0, 1, 1)
import os
import subprocess as sub
__here__ = os.path.abspath(os.path.dirname(__file__))
def _check_output(*cmd):
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE, cwd=__here__)
... | #!/usr/bin/env python
# encoding: utf-8
'''
Version information constants and auxiliary functions.
'''
VERSION = (0, 1, 0)
import os
import subprocess as sub
__here__ = os.path.abspath(os.path.dirname(__file__))
def _check_output(*cmd):
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE, cwd=__here__)
... | bsd-3-clause | Python |
3681459bd7b657e851be7d88863374dbbc28c901 | add field nuvens to CatalogoLandsat | ibamacsr/indicar_process,ibamacsr/indicar_process,ibamacsr/indicar-process,ibamacsr/indicar_process,ibamacsr/indicar-process | indicarprocess/catalogo/models.py | indicarprocess/catalogo/models.py | from django.contrib.gis.db import models
class CatalogoLandsat(models.Model):
objectid = models.AutoField(primary_key=True)
image = models.CharField(max_length=255, unique=True)
path = models.CharField(max_length=500)
url_tms = models.CharField(max_length=500)
data = models.DateField()
nuvems... | from django.contrib.gis.db import models
class CatalogoLandsat(models.Model):
objectid = models.AutoField(primary_key=True)
image = models.CharField(max_length=255, unique=True)
path = models.CharField(max_length=500)
url_tms = models.CharField(max_length=500)
data = models.DateField()
shape ... | agpl-3.0 | Python |
8552e9e9528390a820712357f4b6f3a7a911c572 | Fix tests/rackhd20/test_rackhd20_api_templates.py for API 2.0 | changev/RackHD,DavidjohnBlodgett/RackHD,tldavies/RackHD,srinia6/RackHD,panpan0000/RackHD,johren/RackHD,johren/RackHD,tldavies/RackHD,geoff-reid/RackHD,RackHD-Mirror/RackHD,tldavies/RackHD,patelb10/RackHD,stuart-stanley/RackHD,stuart-stanley/RackHD,stuart-stanley/RackHD,patelb10/RackHD,tannoa2/RackHD,panpan0000/RackHD,t... | test/fit_tests/tests/rackhd20/test_rackhd20_api_templates.py | test/fit_tests/tests/rackhd20/test_rackhd20_api_templates.py | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import os
import sys
import subprocess
sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/fit_tests/common")
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
... | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import os
import sys
import subprocess
sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/fit_tests/common")
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
... | apache-2.0 | Python |
a6d8f4835021d25c8740581fa6a791cec35afc17 | Increment d3Vectors test case | dcjohnston/geojs,dcjohnston/geojs,essamjoubori/geojs,dcjohnston/geojs,OpenGeoscience/geojs,essamjoubori/geojs,OpenGeoscience/geojs,essamjoubori/geojs,Kitware/geojs,essamjoubori/geojs,OpenGeoscience/geojs,Kitware/geojs,dcjohnston/geojs,Kitware/geojs | testing/test-cases/selenium-tests/d3Vectors/testd3Vectors.py | testing/test-cases/selenium-tests/d3Vectors/testd3Vectors.py | #!/usr/bin/env python
from selenium_test import FirefoxTest, ChromeTest,\
setUpModule, tearDownModule
class d3VectorsBase(object):
testCase = ('d3Vectors',)
testRevision = 6
def loadPage(self):
self.resizeWindow(640, 480)
self.loadURL('d3Vectors/index.html')
self.wait()
... | #!/usr/bin/env python
from selenium_test import FirefoxTest, ChromeTest,\
setUpModule, tearDownModule
class d3VectorsBase(object):
testCase = ('d3Vectors',)
testRevision = 5
def loadPage(self):
self.resizeWindow(640, 480)
self.loadURL('d3Vectors/index.html')
self.wait()
... | apache-2.0 | Python |
0ecd5ee884e80f6087485e544d00333b89761fb1 | Fix version. | portfoliome/foil,portfoliome/foil | foil/_version.py | foil/_version.py | version_info = (0, 1, 0)
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 8, 0)
__version__ = '.'.join(map(str, version_info))
| mit | Python |
3a2e24c3536ff6e6d0061bf044a2b2a2fb35901f | Fix a bug in check_secret | ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo | web/problems/models.py | web/problems/models.py | import json
from django.core.exceptions import ValidationError
from django.db import models
def shorten(s, max_length=50):
if len(s) < max_length:
return s
else:
return u'{0}...'.format(s[:50])
def is_json_string_list(s):
try:
val = json.loads(s)
except ValueError:
ra... | import json
from django.core.exceptions import ValidationError
from django.db import models
def shorten(s, max_length=50):
if len(s) < max_length:
return s
else:
return u'{0}...'.format(s[:50])
def is_json_string_list(s):
try:
val = json.loads(s)
except ValueError:
ra... | agpl-3.0 | Python |
bace8c3457bab79b68c564cb894b5095c8f1a206 | Add completion message to generate_secret-key | rinfo/fst,kamidev/autobuild_fst,rinfo/fst,rinfo/fst,rinfo/fst,kamidev/autobuild_fst,kamidev/autobuild_fst,kamidev/autobuild_fst | fst_web/fs_doc/management/commands/generate_secret_key.py | fst_web/fs_doc/management/commands/generate_secret_key.py | from django.core.management.base import BaseCommand
import os
import string
class Command(BaseCommand):
"""
Generate a Django secret key in `secretkey.txt` if none exists
"""
args = 'secretkey.txt'
help = 'Generate a Django secret key'
can_import_settings = False
leave_locale_alone = True
... | from django.core.management.base import BaseCommand
import os
import string
class Command(BaseCommand):
"""
Generate a Django secret key in `secretkey.txt` if none exists
"""
args = 'secretkey.txt'
help = 'Generate a Django secret key'
can_import_settings = False
leave_locale_alone = True
... | bsd-3-clause | Python |
ec53430ee7578fc57eb285831f73d94ebd2a25f1 | Make it so simulation tests do not depend on TESTING_ environment variables | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/unittests/recipe_simulation_test.py | scripts/slave/unittests/recipe_simulation_test.py | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides simulator test coverage for individual recipes."""
import logging
import os
# Importing for side effects on sys.path? Yes... | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides simulator test coverage for individual recipes."""
import os
# Importing for side effects on sys.path? Yes... yes we are ... | bsd-3-clause | Python |
0deac2fe49d1240a1d5fee1b9c47313bde84d609 | Change how the base_url is turned into a domain | feffe/django-selenium-login,feffe/django-selenium-login | seleniumlogin/__init__.py | seleniumlogin/__init__.py | from importlib import import_module
from django.contrib.auth import SESSION_KEY, BACKEND_SESSION_KEY, HASH_SESSION_KEY
def force_login(user, driver, base_url):
from django.conf import settings
SessionStore = import_module(settings.SESSION_ENGINE).SessionStore
selenium_login_start_page = getattr(settings, ... | from importlib import import_module
from django.contrib.auth import SESSION_KEY, BACKEND_SESSION_KEY, HASH_SESSION_KEY
def force_login(user, driver, base_url):
from django.conf import settings
SessionStore = import_module(settings.SESSION_ENGINE).SessionStore
selenium_login_start_page = getattr(settings, ... | mit | Python |
6b50bb2e21a57059ee05ba50f4d3e4d2eec04e8b | Refactor seekable compat method | boto/s3transfer | s3transfer/compat.py | s3transfer/compat.py | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 | Python |
4384fe41bde1e429efaf7b678dcd962d1e4fce52 | Bump version: 1.8.1 → 1.9.0 | kura/blackhole,kura/blackhole | blackhole/__init__.py | blackhole/__init__.py | # (The MIT License)
#
# Copyright (c) 2013 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | # (The MIT License)
#
# Copyright (c) 2013 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | mit | Python |
1bc8d0ff8a114285e2d9084876e8257e269563d6 | Add an 'invalidate reading' action for readings in admin panel. | qubs/climate-data-api,qubs/data-centre,qubs/data-centre,qubs/climate-data-api | climate_data/admin.py | climate_data/admin.py | # Copyright 2016 the Queen's University Biological Station
# 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 la... | # Copyright 2016 the Queen's University Biological Station
# 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 la... | apache-2.0 | Python |
bd2ea8291fa576e872b495ab7945e2739002c25b | fix bug in cobbler tops module | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/tops/cobbler.py | salt/tops/cobbler.py | '''
Cobbler Tops
============
Cobbler Tops is a master tops subsystem used to look up mapping information
from Cobbler via its API.
.. code-block:: yaml
master_tops:
cobbler:
- host: https://example.com/ #default is http://localhost/
- user: username # default is no username
- passwo... | '''
Cobbler Tops
============
Cobbler Tops is a master tops subsystem used to look up mapping information
from Cobbler via its API.
.. code-block:: yaml
master_tops:
cobbler:
- host: https://example.com/ #default is http://localhost/
- user: username # default is no username
- passwo... | apache-2.0 | Python |
53b17a3b576a90e5d5bb773ca868a3dd160b3273 | Add trash loading. Refactor shared load method | abaldwin88/roamer | roamer/record.py | roamer/record.py | """
argh
"""
import os
import json
from roamer.entry import Entry
entries_path = os.path.expanduser('~/.roamer-data/entries.json')
trash_path = os.path.expanduser('~/.roamer-data/trash.json')
class Record(object):
def __init__(self):
self.entries = self._load(entries_path)
self.trash_entries = sel... | """
argh
"""
import os
import json
from roamer.entry import Entry
entries_path = os.path.expanduser('~/.roamer-data/entries.json')
class Record(object):
def __init__(self):
self.entries = {}
# TODO: Load saved directory json
if os.path.exists(entries_path):
with open(entries_pa... | mit | Python |
4e19b3624ab5334f6911d02563256a78de1a4b4c | Bump version | alphagov/gapy,alphagov/gapy | gapy/__init__.py | gapy/__init__.py | __title__ = "gapy"
__version__ = "1.3.1"
__author__ = "Rob Young"
| __title__ = "gapy"
__version__ = "1.3.0"
__author__ = "Rob Young"
| mit | Python |
025e0102c8302d3dcdcc95373de93cad9d0a5269 | Correct Figshare addresses | ajgeers/visc11 | code/download_data.py | code/download_data.py | import os
from utils import iolib
# find project root and specify url to FigShare
root = os.path.join(os.path.dirname(__file__), os.pardir)
figshare = 'https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/'
# create local folders to download data into
cfdpath = os.path.join(root, 'data', 'cfd')
pivpath = o... | import os
from utils import iolib
# find project root and specify url to FigShare
root = os.path.join(os.path.dirname(__file__), os.pardir)
figshare = 'http://files.figshare.com/'
# create local folders to download data into
cfdpath = os.path.join(root, 'data', 'cfd')
pivpath = os.path.join(root, 'data', '... | bsd-2-clause | Python |
c270b8409282384f5678a439def3354b605da8f5 | Add FigShare urls to download_data.py | ajgeers/visc11 | code/download_data.py | code/download_data.py | import os
from utils import iolib
# find project root and specify url where data is located
root = os.path.join(os.path.dirname(__file__), os.pardir)
figshare = 'http://files.figshare.com/'
# create local folders to download data into
cfdpath = os.path.join(root, 'data', 'cfd')
pivpath = os.path.join(root,... | import os
from utils import iolib
# find project root and specify url where data is located
root = os.path.join(os.path.dirname(__file__), os.pardir)
dropbox = 'https://dl.dropboxusercontent.com/u/3937470/'
# create local folders to download data into
cfdpath = os.path.join(root, 'data', 'cfd')
pivpath = o... | bsd-2-clause | Python |
6854e09c713aa98631086c8b50c6abecae3ce0a1 | define private function to import the OpenWeatherMap.org API key from a local file | mzurhorst/wassersteuerung,mzurhorst/wassersteuerung,mzurhorst/wassersteuerung | weather_data.py | weather_data.py | #!/usr/bin/python3
#
#File : weather_data.py
#Author : Marcus Zurhorst
#Email : marcuszurhorst@gmail.com
#License : MIT License
#Copyright : (c) 2017 Marcus Zurhorst
#
#Description : This module provides functions to fetch weather data from
# OpenWeatherM... | #!/usr/bin/python3
#
#File : weather_data.py
#Author : Marcus Zurhorst
#Email : marcuszurhorst@gmail.com
#License : MIT License
#Copyright : (c) 2017 Marcus Zurhorst
#
#Description : This module provides functions to fetch weather data from
# OpenWeatherM... | mit | Python |
e33c7b690667a064891ff2bfcf8760e7c5193fd6 | remove unneeded line | avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf,avlach/univbris-ocf | src/python/expedient_geni/urls.py | src/python/expedient_geni/urls.py | '''
@author: jnaous
'''
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('expedient_geni.views',
url(r'^certs/manage/(?P<user_id>\d+)/$', 'user_cert_manage', name='gcf_cert_manage'),
url(r'^certs/create/(?P<user_id>\d+)/$', 'user_cert_generate', name='gcf_cert_generate'),
url(r'^c... | '''
@author: jnaous
'''
from django.conf.urls.defaults import patterns, url
from expedient.common.rpc4django.utils import rpc_url
urlpatterns = patterns('expedient_geni.views',
url(r'^certs/manage/(?P<user_id>\d+)/$', 'user_cert_manage', name='gcf_cert_manage'),
url(r'^certs/create/(?P<user_id>\d+)/$', 'user_c... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.