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 |
|---|---|---|---|---|---|---|---|---|
79474bde83eee4fffad56cf6ff3720bc2539f14a | Set output names for Workload. | fhirschmann/penchy,fhirschmann/penchy | penchy/jobs/elements.py | penchy/jobs/elements.py | """
This module provides the foundation of job elements.
"""
class PipelineElement(object):
pass
class NotRunnable(object):
"""
This represents a pipeline element that can't be run.
"""
def run(self):
# TODO: Add logging?
raise ValueError("{0} can't be run!".format(self.__class__.... | """
This module provides the foundation of job elements.
"""
class PipelineElement(object):
pass
class NotRunnable(object):
"""
This represents a pipeline element that can't be run.
"""
def run(self):
# TODO: Add logging?
raise ValueError("{0} can't be run!".format(self.__class__.... | mit | Python |
278215c2ad3c50e697e4e1590085251c24736009 | add graphy.__version__ | blueprintmrk/graphy | graphy/__init__.py | graphy/__init__.py | __version__='1.0'
| apache-2.0 | Python | |
243d6a14d4fbdc6733b0b3c28f158ab7688c826e | increase default fees | ofek/bit,ofek/bit | bit/network/fees.py | bit/network/fees.py | from functools import wraps
from time import time
import requests
from requests.exceptions import ConnectionError, Timeout
DEFAULT_FEE_FAST = 220
DEFAULT_FEE_HOUR = 160
DEFAULT_CACHE_TIME = 60 * 10
URL = 'https://bitcoinfees.21.co/api/v1/fees/recommended'
def set_fee_cache_time(seconds):
global DEFAULT_CACHE_TI... | from functools import wraps
from time import time
import requests
from requests.exceptions import ConnectionError, Timeout
DEFAULT_FEE_FAST = 160
DEFAULT_FEE_HOUR = 120
DEFAULT_CACHE_TIME = 60 * 10
URL = 'https://bitcoinfees.21.co/api/v1/fees/recommended'
def set_fee_cache_time(seconds):
global DEFAULT_CACHE_TI... | mit | Python |
29738fdad10c9215d5aac3a25f8cff0067aad28e | Tweak output processer script | hsnlab/mapping,hsnlab/mapping,5GExchange/mapping,5GExchange/mapping | calc_mapping_times.py | calc_mapping_times.py | """
Calculates how much time (averaged on the seeds) does it take for all the
batchings (increasing in size) to map by either MILP or Alg1. Considers only the
successful mappings.
"""
map_times = {}
cnts = {}
mins = {}
maxs = {}
for b in xrange(4, 300, 4):
map_times[b] = 0.0
cnts[b] = 0
mins[b] = float('inf')
... | """
Calculates how much time (averaged on the seeds) does it take for all the
batchings (increasing in size) to map by either MILP or Alg1. Considers only the
successful mappings.
"""
map_times = {}
cnts = {}
mins = {}
maxs = {}
for b in xrange(4, 300, 4):
map_times[b] = 0.0
cnts[b] = 0
mins[b] = float('inf')
... | apache-2.0 | Python |
a006470f455faf785a6e51daf4062bc5e0807932 | refactor get_team_members to take in a list of roles | dimagi/commcare-hq,SEL-Columbia/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,di... | bihar/utils.py | bihar/utils.py | from operator import attrgetter
from django.utils.translation import ugettext_noop
from corehq.apps.groups.models import Group
ASHA_ROLE = ugettext_noop('ASHA')
AWW_ROLE = ugettext_noop('AWW')
ANM_ROLE = ugettext_noop('ANM')
LS_ROLE = ugettext_noop('LS')
FLW_ROLES = (ASHA_ROLE, AWW_ROLE)
SUPERVISOR_ROLES = (ANM_ROLE,... | from operator import attrgetter
from django.utils.translation import ugettext_noop
from corehq.apps.groups.models import Group
ASHA_ROLE = ugettext_noop('ASHA')
AWW_ROLE = ugettext_noop('AWW')
def get_team_members(group):
"""
Get any commcare users that are either "asha" or "aww".
"""
users = group.g... | bsd-3-clause | Python |
918960129105264dfd1c8194870052d62dc03d11 | Write encoded data to cmdfile. | Jarn/jarn.mkrelease | jarn/mkrelease/scp.py | jarn/mkrelease/scp.py | import sys
import tempfile
import time
import random
from os.path import basename
from process import Process
from exit import err_exit
from utils import encode
class SCP(object):
"""Secure copy and FTP abstraction."""
def __init__(self, process=None):
self.process = process or Process()
def d... | import tempfile
import time
import random
from os.path import basename
from process import Process
from exit import err_exit
class SCP(object):
"""Secure copy and FTP abstraction."""
def __init__(self, process=None):
self.process = process or Process()
def delay(self):
# Reduce output ... | bsd-2-clause | Python |
8883f1a45595219ae843b3400df1f56ab07aa4fe | Add document store for locations | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/userreports/document_stores.py | corehq/apps/userreports/document_stores.py | from corehq.apps.locations.models import SQLLocation
from corehq.form_processor.document_stores import ReadonlyFormDocumentStore, ReadonlyCaseDocumentStore
from corehq.form_processor.utils import should_use_sql_backend
from corehq.util.couch import get_db_by_doc_type
from pillowtop.dao.couch import CouchDocumentStore
f... | from corehq.form_processor.document_stores import ReadonlyFormDocumentStore, ReadonlyCaseDocumentStore
from corehq.form_processor.utils import should_use_sql_backend
from corehq.util.couch import get_db_by_doc_type
from pillowtop.dao.couch import CouchDocumentStore
def get_document_store(domain, doc_type):
use_sq... | bsd-3-clause | Python |
38159ac6e2da1630190ed65e3fbec8625a9be53e | Enhance admin integration fro web models. | fladi/django-campus02,fladi/django-campus02 | campus02/web/admin.py | campus02/web/admin.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.contrib import admin
from reversion.admin import VersionAdmin
from guardian.admin import GuardedModelAdmin
from . import models
@admin.register(models.Order)
class OrderAdmin(VersionAdmin):
list_display = ('student',)
@admin.register(models.Movie)
class M... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.contrib import admin
from reversion.admin import VersionAdmin
from guardian.admin import GuardedModelAdmin
from . import models
@admin.register(models.Order)
class OrderAdmin(VersionAdmin):
list_display = ('student',)
@admin.register(models.Movie)
class M... | mit | Python |
3e03a9ceb9bfad3eec21fcdb0a86e7fe6a826791 | Make prompt module accessible | nathancahill/clint,thusoy/clint,kennethreitz/clint,wkentaro/clint,nathancahill/clint,glorizen/clint,1gitGrey/clint,1gitGrey/clint,tz70s/clint,Lh4cKg/clint,wkentaro/clint | clint/textui/__init__.py | clint/textui/__init__.py | # -*- coding: utf-8 -*-
"""
clint.textui
~~~~~~~~~~~~
This module provides the text output helper system.
"""
from . import colored
from . import progress
from . import prompt
from .core import *
| # -*- coding: utf-8 -*-
"""
clint.textui
~~~~~~~~~~~~
This module provides the text output helper system.
"""
from . import colored
from . import progress
from .core import *
| isc | Python |
7fd3e82c449ebf46e369d2a8c2bf534cb6b17607 | Change return to allow for original tuples to come out since we'll need them for chunking | mjcollin/2016spr,mjcollin/2016spr,mjcollin/2016spr | notebook/lib/pos_tags.py | notebook/lib/pos_tags.py | import nltk
class PosTags:
def tag(self, t, as_dicts=True):
'''
With a list of tokens, mark their part of speech and return
a list dicts (no native tuple type in dataframes it seems).
'''
pos = nltk.pos_tag(t)
if as_dicts:
return self.to_dicts(pos)
... | import nltk
class PosTags:
def tag(self, t):
'''
With a list of tokens, mark their part of speech and return
a list dicts (no native tuple type in dataframes it seems).
'''
pos = nltk.pos_tag(t)
retval = []
for p in pos:
retval.append({"word": p[... | mit | Python |
d1ef4ddec7d3cdd6f9cf38f623427b3ed63ecfc9 | Fix incorrect INSTALLED_APPS line for testing. | nikdoof/vapemap,nikdoof/vapemap | app/vapemap/conf/test.py | app/vapemap/conf/test.py | from .base import *
INSTALLED_APPS += [
'django_jenkins',
]
PROJECT_APPS = [
'stores',
]
JENKINS_TASKS = (
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.with_coverage',
'django_jenkins.tasks.django_tests',
'django_jenkins.tasks.run_pep8',
'django_jenkins.tasks.run_pyflakes',
) | from .base import *
INSTALLED_APPS += [
'django-jenkins',
]
PROJECT_APPS = [
'stores',
]
JENKINS_TASKS = (
'django_jenkins.tasks.run_pylint',
'django_jenkins.tasks.with_coverage',
'django_jenkins.tasks.django_tests',
'django_jenkins.tasks.run_pep8',
'django_jenkins.tasks.run_pyflakes',
) | bsd-3-clause | Python |
49e4cf9a277c6e905834077abad0889f82f8fae6 | Add some parser tests | ScottWales/ftools | test/parser/test_parser.py | test/parser/test_parser.py | #!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science
author: Scott Wales <scott.wales@unimelb.edu.au>
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
h... | #!/usr/bin/env python
"""
Copyright 2015 ARC Centre of Excellence for Climate Systems Science
author: Scott Wales <scott.wales@unimelb.edu.au>
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
h... | apache-2.0 | Python |
dbc86dcb7f88bfa013d32080746f6663ba4295f5 | fix bug in last commit | ClemsonSoCUnix/django-sshkey,ClemsonSoCUnix/django-sshkey,opennode/django-sshkey,ClemsonSoCUnix/django-sshkey,opennode/django-sshkey | sshkey/models.py | sshkey/models.py | from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from sshkey.util import sshkey_fingerprint
class UserKey(models.Model):
user = models.ForeignKey(User, db_index=True)
name = models.CharField(max_length=50)
key = models.TextField(max_lengt... | from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from sshkey.util import sshkey_fingerprint
class UserKey(models.Model):
user = models.ForeignKey(User, db_index=True)
name = models.CharField(max_length=50)
key = models.TextField(max_lengt... | bsd-3-clause | Python |
ea91786b9f27df440000b6d46e534831fb780b80 | Add delta(1e-7) for cross_entropy_error | oreilly-japan/deep-learning-from-scratch | common/functions.py | common/functions.py | # coding: utf-8
import numpy as np
def identity_function(x):
return x
def step_function(x):
return np.array(x > 0, dtype=np.int)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_grad(x):
return (1.0 - sigmoid(x)) * sigmoid(x)
def relu(x):
return np.maximum(0, x)
def relu_g... | # coding: utf-8
import numpy as np
def identity_function(x):
return x
def step_function(x):
return np.array(x > 0, dtype=np.int)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_grad(x):
return (1.0 - sigmoid(x)) * sigmoid(x)
def relu(x):
return np.maximum(0, x)
def relu_g... | mit | Python |
1f8c9700f203c6c0b1ab4a520b53038080c4f761 | Fix --system/--no-system flag | borntyping/supermann | supermann/cli.py | supermann/cli.py | """Command line entry points to supermann using click"""
from __future__ import absolute_import, unicode_literals
import click
import supermann.core
import supermann.utils
@click.command()
@click.version_option(version=supermann.__version__)
@click.option(
'-l', '--log-level', default='INFO',
type=click.Ch... | """Command line entry points to supermann using click"""
from __future__ import absolute_import, unicode_literals
import click
import supermann.core
import supermann.utils
@click.command()
@click.version_option(version=supermann.__version__)
@click.option(
'-l', '--log-level', default='INFO',
type=click.Ch... | mit | Python |
2b708fea7c9340bc72145506773e5f049786f8d2 | bump version v2.0.16 | cdr-stats/cdr-stats,Star2Billing/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,cdr-stats/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,areski/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,cdr-stats/cdr-stats,cdr-stats/cdr-stats | cdr_stats/__init__.py | cdr_stats/__init__.py | # -*- coding: utf-8 -*-
#
# CDR-Stats License
# http://www.cdr-stats.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2012 Star2Billing S.L.... | # -*- coding: utf-8 -*-
#
# CDR-Stats License
# http://www.cdr-stats.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2012 Star2Billing S.L.... | mpl-2.0 | Python |
aa711dbb07de1db134f4567eba929ada01d70e1a | Make keywords immutable. | csdms/pymt,csdms/coupling,csdms/coupling | cmt/printers/nc/write.py | cmt/printers/nc/write.py | #! /usr/bin/env python
from ...grids.assertions import (is_rectilinear, is_structured)
from .ugrid import (NetcdfRectilinearField, NetcdfStructuredField,
NetcdfUnstructuredField)
def field_tofile(field, path, append=False, attrs=None, time=None,
time_units='days', time_reference=... | #! /usr/bin/env python
from ...grids.assertions import (is_rectilinear, is_structured,
is_unstructured)
from .ugrid import (NetcdfRectilinearField, NetcdfStructuredField,
NetcdfUnstructuredField)
def field_tofile(field, path, append=False, attrs={}, time=None,
... | mit | Python |
f5e5755c69ceb81f3b6cbef315473ecb848b83f5 | return 404 if book slug does not exist | openstax/openstax-cms,openstax/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms | books/views.py | books/views.py | from django.shortcuts import redirect
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
from .models import BookIndex, Book
@csrf_exempt
def book_index(request):
page = BookIndex.objects.all()[0]
return redirect('/api/v2/pages/{}'.format(page.pk))
@csrf_exempt
def book_det... | from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
from .models import BookIndex, Book
@csrf_exempt
def book_index(request):
page = BookIndex.objects.all()[0]
return redirect('/api/v2/pages/{}'.format(page.pk))
@csrf_exempt
def book_detail(request, slug):
try:
... | agpl-3.0 | Python |
c6fca1a950269d23549c957391321fc7454c9173 | fix usage | velkyel/darcs-report | darcs-report.py | darcs-report.py | import os, sys
import xml.etree.ElementTree as etree
import smtplib
if len(sys.argv[1:]) < 1:
print('no respondents?')
quit(1)
respondents = ', '.join(sys.argv[1:])
def load_latest_hash():
try:
return open('_darcs/prefs/latest.hash', 'r').read().strip()
except:
return None
def save_l... | import os, sys
import xml.etree.ElementTree as etree
import smtplib
if len(sys.argv[1:]) < 1:
print('no respondents?')
respondents = ', '.join(sys.argv[1:])
def load_latest_hash():
try:
return open('_darcs/prefs/latest.hash', 'r').read().strip()
except:
return None
def save_latest_hash(h... | mit | Python |
8a9dc2e54c2698e51c9048993b5f487549cdc0c8 | update spark script | Charleo85/SIS-Rebuild,Charleo85/SIS-Rebuild,Charleo85/SIS-Rebuild,Charleo85/SIS-Rebuild | data/co_view.py | data/co_view.py | from pyspark import SparkContext
sc = SparkContext("spark://spark-master:7077", "PopularCoview")
# each worker loads a piece of the data file
data = sc.textFile("/tmp/data/inputs/<filename>", 2)
# step 1: read in the data file and generate a map
# key = user_id, value = course_id that they are viewing
line_list = da... | from pyspark import SparkContext
sc = SparkContext("spark://spark-master:7077", "PopularCoview")
# each worker loads a piece of the data file
data = sc.textFile("/tmp/data/inputs/<filename>", 2)
# step 1: read in the data file and generate a map
# key = user_id, value = course_id that they are viewing
pairs = data.m... | bsd-3-clause | Python |
c697a933ea94778a24273756a73838edc099c18b | Add boot_switch.py a script for selecing the USB mode at boot time. | dhylands/upy-examples,dhylands/upy-examples | boot_switch.py | boot_switch.py | import pyb
# This script is intended to be installed as boot.py. It will flash the
# Red LED for 2 seconds. If you press the USR switch during those 2
# seconds then it will cycle between the blue, yellow, and green LEDs to
# allow the USB mode to b eslected.
#
# Blue - CDC+MSC
# Yellow - CDC+HID
# Green - CDC only... | import pyb
sw = pyb.Switch()
# 1 - Red
# 2 - Green
# 3 - Yellow
# 4 - Blue
pyb.LED(2).off() # Turn Greem LED off since normal boot turns it on
led = pyb.LED(1)
leds = (pyb.LED(4), pyb.LED(3), pyb.LED(2))
try:
import boot_mode
persisted_mode = boot_mode.mode
mode = boot_mode.mode
except:
persisted_mode... | mit | Python |
f0d10057b21ef36ec4772a93366fd2a669ba23d9 | remove unneeded try/except block for configparser (leftover from Python 2 compatibility) | gbouvignies/chemex | chemex/util.py | chemex/util.py | """The util module cotains a variety of utility code."""
import configparser
import os
import sys
def make_dir(path=None):
"""Ensure existence of the directory."""
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
def read_cfg_file(filename):
"""Re... | """The util module cotains a variety of utility code."""
import configparser
import os
import sys
def make_dir(path=None):
"""Ensure existence of the directory."""
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
def read_cfg_file(filename):
"""Re... | bsd-3-clause | Python |
461e4e0b372e6904e1b14f3df70eb3d5615b49db | use bot as account always | Compjeff/PokemonGo-Bot,Compjeff/PokemonGo-Bot | pokemongo_bot/event_handlers/socketio_handler.py | pokemongo_bot/event_handlers/socketio_handler.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from socketIO_client import SocketIO
from pokemongo_bot.event_manager import EventHandler
class SocketIoHandler(EventHandler):
def __init__(self, bot, url):
self.bot = bot
self.host, port_str = url.split(':')
self.port = ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from socketIO_client import SocketIO
from pokemongo_bot.event_manager import EventHandler
class SocketIoHandler(EventHandler):
def __init__(self, bot, url):
self.bot = bot
self.host, port_str = url.split(':')
self.port = ... | mit | Python |
f0d12e27c358ad30a30d91f34af5815c8118f538 | make the docID actually just a textfield to allow for more flexibility | erinspace/scrapi,mehanig/scrapi,fabianvf/scrapi,fabianvf/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,mehanig/scrapi,felliott/scrapi,felliott/scrapi | api/webview/models.py | api/webview/models.py | from django.db import models
from django_pgjson.fields import JsonField
class Document(models.Model):
source = models.CharField(max_length=255)
docID = models.TextField()
providerUpdatedDateTime = models.DateTimeField(null=True)
raw = JsonField()
normalized = JsonField()
| from django.db import models
from django_pgjson.fields import JsonField
class Document(models.Model):
source = models.CharField(max_length=255)
docID = models.CharField(max_length=255)
providerUpdatedDateTime = models.DateTimeField(null=True)
raw = JsonField()
normalized = JsonField()
| apache-2.0 | Python |
19f239260e6d637ab7b31bb0539089d938874abf | Improve implementation | Vauxoo/stoqdrivers,stoq/stoqdrivers,stoq/stoqdrivers,vauxoo-dev/stoqdrivers | tests/check_ifaces_impl.py | tests/check_ifaces_impl.py | #!/usr/bin/env python
# -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Stoqdrivers
## Copyright (C) 2006 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Publ... | #!/usr/bin/env python
# -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Stoqdrivers
## Copyright (C) 2006 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Publ... | lgpl-2.1 | Python |
1b85e76543556a78f5b4634898574591fe7e7cb7 | Reduce number of test passwords | agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft | tests/helpers/test_user.py | tests/helpers/test_user.py | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import unittest
from passlib.hash import (
ldap_des_crypt, ldap_sha512_crypt, ldap_md5, ldap_salted_sha1)
fr... | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import unittest
from passlib.hash import (
ldap_des_crypt, ldap_sha512_crypt, ldap_md5, ldap_salted_sha1)
fr... | apache-2.0 | Python |
373a1deef0dcaff26476b888d54197db99e2e572 | test if human has only legal choices | IanDCarroll/xox | tests/player_chair_test.py | tests/player_chair_test.py | import nose.tools
from source.player_chair import *
def test_that_player_can_make_a_move():
philip = Player()
mock_board = [1,10,1,10,0,0,1,0,10]
test = philip.move(mock_board)
assert test == [1,10,1,10,"spam",0,1,0,10]
def test_that_player_can_only_make_legal_moves():
philip = Player()
mock_b... | import nose.tools
from source.player_chair import *
def test_that_player_can_make_a_move():
philip = Player()
mock_board = [1,10,1,10,0,0,1,0,10]
test = philip.move(mock_board)
assert test == [1,10,1,10,"spam",0,1,0,10]
def test_that_player_can_only_make_legal_moves():
philip = Player()
mock_b... | mit | Python |
0e72ec9d24b297d7f6e130eb068920e5e763c251 | Update AtoD_MultiChannelSample.py | MarcoForte/PyDAQmx_Helper | pydaqmx_helper/examples/AtoD_MultiChannelSample.py | pydaqmx_helper/examples/AtoD_MultiChannelSample.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# Marco Forte, 18/06/2014
# Example program to show how to read multiple
# samples from multiple AtoD channels at a given sample rate
from pydaqmx_helper.atod import AtoD
myAtoD = AtoD()
myAtoD.addChannels([0, 1, 2])
sample = myAtoD.samp... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# Marco Forte, 18/06/2014
# Example program to show how to read multiple
# samples from multiple AtoD channels at a given sample rate
from pydaqmx_helper.atod import AtoD
myAtoD = AtoD()
myAtoD.addChannels([0, 1, 2])
sample = myAtoD.samp... | mit | Python |
22e85bab505a8e2a38a505583167a60c9fef4aa4 | Fix print error for linux bridge bindings bug 1001941 | gkotton/vmware-nsx,gkotton/vmware-nsx | quantum/plugins/linuxbridge/db/l2network_models.py | quantum/plugins/linuxbridge/db/l2network_models.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | apache-2.0 | Python |
5a84265b3137fc181fafbf31b96153e3abb8052b | rename except_list into exclude in s3.Folder.clean | fabiansinz/datajoint-python,dimitri-yatsenko/datajoint-python,eywalker/datajoint-python,datajoint/datajoint-python | datajoint/s3.py | datajoint/s3.py | """
AWS S3 operations
"""
from io import BytesIO
import minio # https://docs.minio.io/docs/python-client-api-reference
import warnings
import itertools
class Folder:
"""
A Folder instance manipulates a flat folder of objects within an S3-compatible object store
"""
def __init__(self, endpoint, bucke... | """
AWS S3 operations
"""
from io import BytesIO
import minio # https://docs.minio.io/docs/python-client-api-reference
import warnings
import itertools
class Folder:
"""
A Folder instance manipulates a flat folder of objects within an S3-compatible object store
"""
def __init__(self, endpoint, bucke... | lgpl-2.1 | Python |
8344ddb3d3929218bba4dff3e4ba5e476cf505e4 | Update __openerp__.py | Aivenho/Odoo,Aivenho/Odoo,Aivenho/Odoo | poseidon/__openerp__.py | poseidon/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Interlux, SIA (http://www.interlux.lv)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Interlux, SIA (http://www.interlux.lv)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 | Python |
a2bcab40f0b4ce2c7f8ebab272ba422de8704e76 | Fix dates_times tests | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | tests/test_garner_dates.py | tests/test_garner_dates.py | """Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.dates_times import dates
class TestCheck(Check):
"""Test class for garner.dates."""
__test__ = True
def test_50s_hyphenation(self):
"""Find uneede... | """Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.misc import dates
class TestCheck(Check):
"""Test class for garner.dates."""
__test__ = True
def test_50s_hyphenation(self):
"""Find uneeded hyphe... | bsd-3-clause | Python |
5b1ef52324a82f5511689a23cacf8eb2c779fee4 | Fix gradient computation. | astropy/photutils,larrybradley/photutils | photutils/isophote/tests/test_model.py | photutils/isophote/tests/test_model.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the model module.
"""
from astropy.io import fits
import numpy as np
import pytest
from .make_test_data import make_test_image
from ..ellipse import Ellipse
from ..geometry import EllipseGeometry
from ..model import build_ellipse_model
from... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the model module.
"""
from astropy.io import fits
import numpy as np
import pytest
from .make_test_data import make_test_image
from ..ellipse import Ellipse
from ..geometry import EllipseGeometry
from ..model import build_ellipse_model
from... | bsd-3-clause | Python |
eb3022e190168ab9b1f21c58bdeb570d2120b4d0 | Add encoding | cristen/sqlalchemy-searchable | tests/test_query_parser.py | tests/test_query_parser.py | # -*- coding: utf-8 -*-
from pyparsing import ParseException
from pytest import raises
from sqlalchemy_searchable.parser import SearchQueryParser
class TestSearchQueryParser(object):
def setup_method(self, method):
self.parser = SearchQueryParser()
def test_unicode(self):
assert self.parser.... | from pyparsing import ParseException
from pytest import raises
from sqlalchemy_searchable.parser import SearchQueryParser
class TestSearchQueryParser(object):
def setup_method(self, method):
self.parser = SearchQueryParser()
def test_unicode(self):
assert self.parser.parse(u'안녕') == u'안녕:*'
... | bsd-3-clause | Python |
6b515e671c33458d736c6639a8b3391f94dfee73 | Set 10.11.0 as minimum macOS version in the .app bundle | Syncplay/syncplay,Syncplay/syncplay,NeverDecaf/syncplay,alby128/syncplay,alby128/syncplay,NeverDecaf/syncplay | buildPy2app.py | buildPy2app.py | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
from glob import glob
import syncplay
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'icon... | apache-2.0 | Python |
8868ad8e4ae48fe861c14efafa88b180b011b43e | Patch version 0.15.4 | spendb/spendb,spendb/spendb,openspending/spendb,CivicVision/datahub,CivicVision/datahub,USStateDept/FPA_Core,nathanhilbert/FPA_Core,pudo/spendb,nathanhilbert/FPA_Core,johnjohndoe/spendb,nathanhilbert/FPA_Core,pudo/spendb,pudo/spendb,spendb/spendb,USStateDept/FPA_Core,CivicVision/datahub,openspending/spendb,johnjohndoe/... | openspending/_version.py | openspending/_version.py | __version__ = '0.15.4'
| __version__ = '0.15.3'
| agpl-3.0 | Python |
2a82d6917c74cf2ef01e9b5b55870c3bd8d6c8d5 | Update soma_quadrados.py | andrevictor17/aulasRenzoEd,andrevictor17/aulasRenzoEd | aula13/soma_quadrados.py | aula13/soma_quadrados.py | from collections import Counter
def soma_quadrados(n):
if n == 0:
return [0]
quadrado = []
max = 1
while (max * max <= n):
quadrado.append(max * max)
max = max + 1
historico = {0: 0}
while len(quadrado)> 0:
numero = n
quadrado1 = quadrado.copy()
... | from collections import Counter
def soma_quadrados(n):
pass
import unittest
class SomaQuadradosPerfeitosTestes(unittest.TestCase):
def teste_0(self):
self.assert_possui_mesmo_elementos([0], soma_quadrados(0))
def teste_1(self):
self.assert_possui_mesmo_elementos([1], soma_quadrados(1)... | mit | Python |
456e13891bcac6929ae55bb5343438d60a81f748 | Fix python formatting issues. | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/mcapi/machine.py | backend/mcapi/machine.py | from mcapp import app
from decorators import crossdomain, apikey, jsonp
from flask import request, g
import rethinkdb as r
import dmutil
import args
import access
@app.route('/machines', methods=['GET'])
@jsonp
def get_all_machines():
rr = r.table('machines').order_by(r.desc('birthtime'))
selection = list(rr.... | from mcapp import app
from decorators import crossdomain, apikey, jsonp
from flask import request, g
import error
import rethinkdb as r
import dmutil
import json
import args
import access
@app.route('/machines', methods=['GET'])
@jsonp
def get_all_machines():
rr = r.table('machines').order_by(r.desc('birthtime'))... | mit | Python |
be7948357abc23b18529268c20bd1b15b1851937 | bump version | slash-testing/backslash-python,vmalloc/backslash-python | backslash/__version__.py | backslash/__version__.py | __version__ = "2.3.0"
| __version__ = "2.2.0"
| bsd-3-clause | Python |
5ac75f5cf37b86a2b512c4fb9d64c122ccbfe557 | Fix `language_choose_control` migration default value. | fabiocaccamo/django-admin-interface,fabiocaccamo/django-admin-interface,fabiocaccamo/django-admin-interface | admin_interface/migrations/0025_theme_language_chooser_control.py | admin_interface/migrations/0025_theme_language_chooser_control.py | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("admin_interface", "0024_remove_theme_css"),
]
operations = [
migrations.AddField(
model_name="theme",
name="language_chooser_control",
field=models.CharF... | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("admin_interface", "0024_remove_theme_css"),
]
operations = [
migrations.AddField(
model_name="theme",
name="language_chooser_control",
field=models.CharF... | mit | Python |
09d03ddfa3f254dfba70f0ee495afe5ce25fb02b | Update views.py | FilloretaSyla/Techstitution,FilloretaSyla/Techstitution,FilloretaSyla/Techstitution | app/mod_main/views.py | app/mod_main/views.py | from flask import Blueprint, render_template,request, url_for
from bson import json_util
from app import mongo
mod_main = Blueprint('main', __name__)
@mod_main.route('/', methods=['GET'])
def index():
if request.method == ['GET']:
return render_template('indexi.html')
elif request.method == ['POST']:
data ... | from flask import Blueprint, render_template,request, url_for
from bson import json_util
from app import mongo
mod_main = Blueprint('main', __name__)
@mod_main.route('/', methods=['GET'])
def index():
if request.method == ['GET']:
return render_template('indexii.html')
elif request.method == ['POST']:
data... | cc0-1.0 | Python |
758346f6912adb97a3a9e952eb4c8d5cd8a74a73 | replace inline with just one field | HonzaKral/custom_admin_form,HonzaKral/custom_admin_form | adhack/adapp/admin.py | adhack/adapp/admin.py | from django.contrib import admin
from django.db import models
from django import forms
from adhack.adapp.models import PollOption, Poll
class MyWhackyForm(forms.Form):
subject = forms.CharField(max_length=30)
adverb = forms.CharField(max_length=30)
adjective = forms.CharField(max_length=30)
options ... | from django.contrib import admin
from django.db import models
from django import forms
from adhack.adapp.models import PollOption, Poll
class PollOptionInlineAdmin(admin.TabularInline):
model = PollOption
class MyWhackyForm(forms.Form):
subject = forms.CharField(max_length=30)
adverb = forms.CharField(ma... | bsd-3-clause | Python |
87e9682a3dbc7b1ebfb2ab445fe160b88a190519 | Make chained combinators a bit easier to subclass. | joshbohde/functional_python | combinators.py | combinators.py | from functools import wraps
from itertools import takewhile
class Combinators(object):
def __init__(self, value):
self._value = value
def K(self, f, *args, **kwargs):
"""The Kestrel combinator, invokes a method, and returns the original value"""
if callable(f):
f(self._va... | from functools import wraps
from itertools import takewhile
class Combinators(object):
def __init__(self, value):
self._value = value
def K(self, f, *args, **kwargs):
"""The Kestrel combinator, invokes a method, and returns the original value"""
if callable(f):
f(self._va... | bsd-3-clause | Python |
8b59cd011b9ff00113ed7724a6e9c61cfcb6d4e8 | Replace ADMIN_MEDIA_ROOT with staticfiles media hosting | datagutten/comics,klette/comics,datagutten/comics,jodal/comics,jodal/comics,jodal/comics,klette/comics,jodal/comics,datagutten/comics,klette/comics,datagutten/comics | comics/urls.py | comics/urls.py | from __future__ import absolute_import
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.autodiscover()
from comics.core.feeds import ComicFeed
from comics.core.urls import COMIC
from com... | from __future__ import absolute_import
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
from comics.core.feeds import ComicFeed
from comics.core.urls import COMIC
from comics.sets.feeds import SetFeed
from comics.sets.urls import SET
urlpa... | agpl-3.0 | Python |
8c79d65e333388e2bde9346899b7cdf812aab2c6 | use non-4d blobs in test_python_layer | gnina/gnina,CZCV/s-dilation-caffe,longjon/caffe,wangg12/caffe,gnina/gnina,longjon/caffe,wangg12/caffe,tackgeun/caffe,tackgeun/caffe,tackgeun/caffe,CZCV/s-dilation-caffe,gnina/gnina,CZCV/s-dilation-caffe,gogartom/caffe-textmaps,gnina/gnina,wangg12/caffe,wangg12/caffe,gogartom/caffe-textmaps,gogartom/caffe-textmaps,longj... | python/caffe/test/test_python_layer.py | python/caffe/test/test_python_layer.py | import unittest
import tempfile
import os
import caffe
class SimpleLayer(caffe.Layer):
"""A layer that just multiplies by ten"""
def setup(self, bottom, top):
pass
def reshape(self, bottom, top):
top[0].reshape(*bottom[0].data.shape)
def forward(self, bottom, top):
top[0].da... | import unittest
import tempfile
import os
import caffe
class SimpleLayer(caffe.Layer):
"""A layer that just multiplies by ten"""
def setup(self, bottom, top):
pass
def reshape(self, bottom, top):
top[0].reshape(bottom[0].num, bottom[0].channels, bottom[0].height,
bottom[0... | apache-2.0 | Python |
11d484e8797587bc604a74c422540206eddbca7a | Replace gettext w/ugettext_lazy for 1.7 compat | Inter-Actief/django-json-rpc,estin/django-json-rpc,Inter-Actief/django-json-rpc,J3173/django-json-rpc,J3173/django-json-rpc,samuraisam/django-json-rpc,estin/django-json-rpc,samuraisam/django-json-rpc,alendit/django-json-rpc,alendit/django-json-rpc | jsonrpc/exceptions.py | jsonrpc/exceptions.py | try:
from django.utils.translation import ugettext_lazy as _
_("You're lazy...") # this function lazy-loads settings
except (ImportError, NameError):
_ = lambda t, *a, **k: t
class Error(Exception):
""" Error class based on the JSON-RPC 2.0 specs
http://groups.google.com/group/json-rpc/web/json-rpc-1-2-... | try:
from django.utils.translation import gettext as _
_("You're lazy...") # this function lazy-loads settings
except (ImportError, NameError):
_ = lambda t, *a, **k: t
class Error(Exception):
""" Error class based on the JSON-RPC 2.0 specs
http://groups.google.com/group/json-rpc/web/json-rpc-1-2-propos... | mit | Python |
79fa6a48dfeacb2dbded60ff393c7c6dd2348ef6 | Add ellipsis to ignored chars | mrphlip/lrrbot,andreasots/lrrbot,andreasots/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,mrphlip/lrrbot | common/card.py | common/card.py | import re
from common.postgres import escape_like
CARD_GAME_MTG = 1
CARD_GAME_KEYFORGE = 2
re_specialchars = re.compile(r"[ \-'\",:!?.()\u00ae&/\u2019\u201c\u201d\[\]~\u2026]")
LETTERS_MAP = {
'\u00e0': 'a',
'\u00e1': 'a',
'\u00e2': 'a',
'\u00e3': 'a',
'\u00e4': 'a',
'\u00e5': 'a',
'\u00e6': 'ae',
'\u00e7': ... | import re
from common.postgres import escape_like
CARD_GAME_MTG = 1
CARD_GAME_KEYFORGE = 2
re_specialchars = re.compile(r"[ \-'\",:!?.()\u00ae&/\u2019\u201c\u201d\[\]~]")
LETTERS_MAP = {
'\u00e0': 'a',
'\u00e1': 'a',
'\u00e2': 'a',
'\u00e3': 'a',
'\u00e4': 'a',
'\u00e5': 'a',
'\u00e6': 'ae',
'\u00e7': 'c',
... | apache-2.0 | Python |
6829fed5958d6aac26fe2499fafb915fdab75121 | Fix failing unit test. | andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons | test/EnsurePythonVersion.py | test/EnsurePythonVersion.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | mit | Python |
1f3047e3ccbfd8305cfc23962e15b1acbaeeef11 | Bump to 0.8.5a0 (#154) | barrachri/aiodocker,barrachri/aiodocker,gaopeiliang/aiodocker,gaopeiliang/aiodocker,barrachri/aiodocker,paultag/aiodocker,gaopeiliang/aiodocker | aiodocker/__init__.py | aiodocker/__init__.py | from .docker import Docker
__version__ = '0.8.5a0'
__all__ = ("Docker", )
| from .docker import Docker
__version__ = '0.8.5'
__all__ = ("Docker", )
| mit | Python |
3e219c7ae563886a3adf4aad6d06141954d79f59 | Bump to 0.10.0 | tenforce/sparql-aiohttp | aiosparql/__init__.py | aiosparql/__init__.py | __version__ = '0.10.0'
| __version__ = '0.10.0a3'
| apache-2.0 | Python |
8fb8a77dcad4aa657b7ddb637459a6279a21755e | Copy reference object example. This commit is just implemented to validate the medhod. But this is not conveniant, because reference models must not be changed. So next step is to make them private attributes. | sl4shme/alexandria,sl4shme/alexandria,sl4shme/alexandria,uggla/alexandria | alexandria/drivers.py | alexandria/drivers.py | # coding=utf-8
import types
import pprint
import config
class Driver(object):
def __init__(self):
self.driver_type = self.__class__.__name__
# Get credentials from conf files for CMDB
pass
def get_driver_type(self):
return self.driver_type
def get_ci(self,ci):
... | # coding=utf-8
import types
import config
class Driver(object):
def __init__(self):
self.driver_type = self.__class__.__name__
# Get credentials from conf files for CMDB
pass
def get_driver_type(self):
return self.driver_type
def get_ci(self,ci):
pass
d... | apache-2.0 | Python |
a288d5c532ca1fa3a9c715db0fb40771af32b2fc | Improve keystone.conf [role] documentation | cernops/keystone,openstack/keystone,rajalokan/keystone,openstack/keystone,ilay09/keystone,ilay09/keystone,ilay09/keystone,cernops/keystone,mahak/keystone,openstack/keystone,rajalokan/keystone,rajalokan/keystone,mahak/keystone,mahak/keystone | keystone/conf/role.py | keystone/conf/role.py | # 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
# distributed under t... | # 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
# distributed under t... | apache-2.0 | Python |
1c6dfe542de4716f1ecd7bca913a3225d415c03a | Add time/space complexity | bowen0701/algorithms_data_structures | alg_tower_of_hanoi.py | alg_tower_of_hanoi.py | """The tower of Hanoi."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def tower_of_hanoi(height, from_pole, to_pole, with_pole, counter):
"""Tower of Hanoi.
Time complexity: T(1) = 1, T(n) = 2T(n - 1) + 1 => O(2^n).
Space complexity: O(1).
... | """The tower of Hanoi."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def tower_of_hanoi(height, from_pole, to_pole, with_pole, counter):
if height == 1:
counter[0] += 1
print('{0} -> {1}'.format(from_pole, to_pole))
else:
... | bsd-2-clause | Python |
30e542a850b955415cd742e69bc6557ce044ed59 | test fixed | davidsanfal/python_test_tutorial | test/figures/square_test.py | test/figures/square_test.py | import unittest
from hacklab.figures.square import Square
test_sides = ((1, 1),
(1, 2),
(4, 4),
(12, 22))
class SquareTest(unittest.TestCase):
def testSquare(self):
my_square = Square(1, 2)
my_square.calculate_area()
self.assertEqual(my_square.a... | import unittest
from hacklab.figures.square import Square
test_sides = ((1, 1),
(1, 2),
(4, 4),
(12, 22))
class SquareTest(unittest.TestCase):
def testSquare(self):
my_square = Square(1, 2)
my_square.calculate_area()
self.assertEqual(my_square.a... | mit | Python |
18895ea6119396f109634690df550460104457e1 | Remove deprecated filter. | symbooglix/boogie-runner,symbooglix/boogie-runner | analysis/filter-by.py | analysis/filter-by.py | #!/usr/bin/env python
"""
Filer a results file (as YAML) and
output a filtered YAML file.
are outputted. If -n is used then this is inverted.
"""
import argparse
import os
import logging
import pprint
import sys
import yaml
from br_util import FinalResultType, classifyResult
try:
# Try to use libyaml which is faste... | #!/usr/bin/env python
"""
Filer a results file (as YAML) and
output a filtered YAML file.
are outputted. If -n is used then this is inverted.
"""
import argparse
import os
import logging
import pprint
import sys
import yaml
from br_util import FinalResultType, classifyResult
try:
# Try to use libyaml which is faste... | bsd-3-clause | Python |
e90a24739c207d18af5c43476b04e2f39bc9e154 | Fix gdrive model registration | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | src/ggrc_gdrive_integration/models/__init__.py | src/ggrc_gdrive_integration/models/__init__.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Gdrive Models"""
from ggrc.models.all_models import register_model
from ggrc_gdrive_integration.models.object_event import ObjectEvent
from ggrc_gdrive_integration.models.object_file import ObjectFile
fr... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import ggrc.models.all_models #import all_models, __all__
from .object_folder import ObjectFolder
from .object_file import ObjectFile
from .object_event import ObjectEvent
ggrc.models.all_models.ObjectFol... | apache-2.0 | Python |
1d7f635a0733222f52b80d2f0555285349a72971 | handle types and not types.string | Transkribus/TranskribusDU,Transkribus/TranskribusDU,Transkribus/TranskribusDU | src/util/unitConversion.py | src/util/unitConversion.py | # -*- coding: utf-8 -*-
"""
conversion pixel<>point
"""
import types
def convertDot2Pixel(dpi,value):
assert type(value) in [types.IntType,types.FloatType], type(value)
assert dpi != 0.0, 'DPI value can not be Zero'
return int(round(1.0*value*(dpi/72.0),0))
def convertPixel2Dot(dpi,value)... | # -*- coding: utf-8 -*-
"""
conversion pixel<>point
"""
def convertDot2Pixel(dpi,value):
assert type(value) in ['int','float']
return int(round(1.0*value*(dpi/72.0),0))
def convertPixel2Dot(dpi,value):
assert type(value) in ['int','float']
assert dpi != 0.0
return round(1.0*value... | bsd-3-clause | Python |
b499200bd1321b9f00108663e4fb6324d4bb4a1f | add unknown tag 0x15 | mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf | src/ezdxf/_acis/const.py | src/ezdxf/_acis/const.py | # Copyright (c) 2022, Manfred Moitzi
# License: MIT License
import enum
ACIS_VERSION = {
400: "ACIS 4.00 NT",
700: "ACIS 32.0 NT",
20800: "ACIS 208.00 NT",
}
DATE_FMT = "%a %b %d %H:%M:%S %Y"
END_OF_ACIS_DATA = "End-of-ACIS-data"
BEGIN_OF_ACIS_HISTORY_DATA = "Begin-of-ACIS-History-Data"
END_OF_ACIS_HIST... | # Copyright (c) 2022, Manfred Moitzi
# License: MIT License
import enum
ACIS_VERSION = {
400: "ACIS 4.00 NT",
700: "ACIS 32.0 NT",
20800: "ACIS 208.00 NT",
}
DATE_FMT = "%a %b %d %H:%M:%S %Y"
END_OF_ACIS_DATA = "End-of-ACIS-data"
BEGIN_OF_ACIS_HISTORY_DATA = "Begin-of-ACIS-History-Data"
END_OF_ACIS_HIST... | mit | Python |
50eb1f5e203d0427b8e165a1dc7c5d1317e31b6b | Make admin more user friendly | fusionbox/django-darkknight,fusionbox/django-darkknight | darkknight/admin.py | darkknight/admin.py | from django.contrib import admin
from django.http import Http404
from django.shortcuts import redirect
from darkknight.models import CertificateSigningRequest
class CertificateSigningRequestAdmin(admin.ModelAdmin):
list_display = ['__unicode__', 'domain']
list_filter = ['domain']
search_fields = ['domain'... | from django.contrib import admin
from django.http import Http404
from django.shortcuts import redirect
from darkknight.models import CertificateSigningRequest
class CertificateSigningRequestAdmin(admin.ModelAdmin):
def has_add_permission(self, request):
return False
def change_view(self, request, ob... | bsd-2-clause | Python |
138aa351b3dbe95f3cdebf01dbd3c75f1ce3fac2 | Fix test broken due to delete_record change | kr41/ggrc-core,uskudnik/ggrc-core,vladan-m/ggrc-core,AleksNeStu/ggrc-core,prasannav7/ggrc-core,josthkko/ggrc-core,vladan-m/ggrc-core,hyperNURb/ggrc-core,vladan-m/ggrc-core,uskudnik/ggrc-core,jmakov/ggrc-core,NejcZupec/ggrc-core,hyperNURb/ggrc-core,andrei-karalionak/ggrc-core,hasanalom/ggrc-core,selahssea/ggrc-core,Alek... | src/ggrc/fulltext/sql.py | src/ggrc/fulltext/sql.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from ggrc import db
from . import Indexer
class SqlIndexer(Indexer):
def cr... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: david@reciprocitylabs.com
# Maintained By: david@reciprocitylabs.com
from ggrc import db
from . import Indexer
class SqlIndexer(Indexer):
def cr... | apache-2.0 | Python |
19b7a743480b72d008235364d58e61cf2f364111 | Update ffmpeg2pa.py | zhujisheng/HAComponent | pulseaudio/ffmpeg2pa.py | pulseaudio/ffmpeg2pa.py | import shlex
from subprocess import PIPE, Popen
class AudioPlay(object):
"""
Wraps a binary ffmpeg and pacat executable
"""
def __init__(self, ffmpeg_exe_file, device_option, volume=65536):
self._FfmpegProc = self._PacatProc = None
self._FfmpegCmd = "%s -hide_banner -loglevel panic -i ... | import shlex
from subprocess import PIPE, Popen
class AudioPlay(object):
"""
Wraps a binary ffmpeg and pacat executable
"""
def __init__(self, ffmpeg_exe_file, device_option, volume=65536):
self._FfmpegProc = self._PacatProc = None
self._FfmpegCmd = "%s -i %s -acodec pcm_s16le -f s16le ... | apache-2.0 | Python |
a86219be1235bd1ad4199c8d1edcdc7cd1860c3a | bump version to 0.6.0 | swistakm/graceful | src/graceful/__init__.py | src/graceful/__init__.py | """Minimalist framework for self-descriptive REST APIs build on top of falcon.
It is inspired by Django REST Framework package. Mostly by how object
serialization is done but more emphasis is put on API to be self-descriptive.
"""
VERSION = (0, 6, 0) # PEP 386 # noqa
__version__ = ".".join([str(x) for x in VERSION])... | """Minimalist framework for self-descriptive REST APIs build on top of falcon.
It is inspired by Django REST Framework package. Mostly by how object
serialization is done but more emphasis is put on API to be self-descriptive.
"""
VERSION = (0, 5, 0) # PEP 386 # noqa
__version__ = ".".join([str(x) for x in VERSION])... | bsd-3-clause | Python |
e176ac09841609d7c8c9c51cbe3da00dc67b8d61 | convert to using counter | jtauber/greek-inflection | test_morphgnt_generation.py | test_morphgnt_generation.py | #!/usr/bin/env python3
from pysblgnt import morphgnt_rows
from characters import strip_length
from utils import Counter
from verbs import Lexicon
lexicon = Lexicon("lexicons/morphgnt.yaml")
counter = Counter()
for book_num in range(1, 28):
for row in morphgnt_rows(book_num):
ccat_pos = row["ccat-pos... | #!/usr/bin/env python3
from pysblgnt import morphgnt_rows
from characters import strip_length
from verbs import Lexicon
lexicon = Lexicon("lexicons/morphgnt.yaml")
for book_num in range(1, 28):
for row in morphgnt_rows(book_num):
ccat_pos = row["ccat-pos"]
ccat_parse = row["ccat-parse"]
... | mit | Python |
919b6f6c508bcd1d39d8b0dad0ba344bb7ae3932 | Add reserved keys to category api | PyBossa/pybossa,Scifabric/pybossa,PyBossa/pybossa,Scifabric/pybossa | pybossa/api/category.py | pybossa/api/category.py | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# 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 your op... | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# 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 your op... | agpl-3.0 | Python |
bb28c7227c8d88ae9ac5cbc383cfa5dd0c527c2a | Fix task | agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft,agdsn/pycroft | pycroft/helpers/task.py | pycroft/helpers/task.py | import logging
import sys
from celery import Task
from sqlalchemy.orm import scoped_session, sessionmaker
from pycroft.model.session import set_scoped_session, session
from scripts.connection import get_connection_string, try_create_connection
class DBTask(Task):
"""
Base class for tasks which use the datab... | import logging
from celery import Task
from sqlalchemy.orm import scoped_session, sessionmaker
from pycroft.model.session import set_scoped_session, session
from scripts.connection import get_connection_string, try_create_connection
class DBTask(Task):
"""
Base class for tasks which use the database.
""... | apache-2.0 | Python |
4286a50979588d66d4b4eb3297308a1ec1720279 | Use latest recommended settings file | praekelt/jmbo-post,praekelt/jmbo-post | test_settings.py | test_settings.py | # We're still on Django 1.4 and use django-setuptest. Use this as a starting
# point for your test settings. Typically copy this file as test_settings.py
# and replace myapp with your app name.
from os.path import expanduser
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql... | from os.path import expanduser
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'jmbo_post',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
INSTALLED_APPS = (
'post',
'django.contrib.au... | bsd-3-clause | Python |
5b94a6679bf16926a0302b395f7b7951e3b96bf0 | Increase version for release | MGHComputationalPathology/highdicom | src/highdicom/version.py | src/highdicom/version.py | __version__ = '0.13.0'
| __version__ = '0.12.1'
| mit | Python |
aedd8c6344197ca5b8f4e649e6acff2d9f226d81 | Fix up moar tests | mattrobenolt/invoke,sophacles/invoke,pfmoore/invoke,pyinvoke/invoke,mkusz/invoke,frol/invoke,pfmoore/invoke,mkusz/invoke,tyewang/invoke,frol/invoke,kejbaly2/invoke,kejbaly2/invoke,pyinvoke/invoke,singingwolfboy/invoke,mattrobenolt/invoke | tests/context.py | tests/context.py | from spec import Spec, skip, eq_
from mock import patch
from invoke.context import Context
from invoke.config import Config
class Context_(Spec):
class init:
"__init__"
def takes_optional_config_arg(self):
# Meh-tastic doesn't-barf tests. MEH.
Context()
Context... | from spec import Spec, skip, eq_
from mock import patch
from invoke.context import Context
from invoke.config import Config
class Context_(Spec):
class init:
"__init__"
def takes_optional_config_arg(self):
# Meh-tastic doesn't-barf tests. MEH.
Context()
Context... | bsd-2-clause | Python |
3a6e95120dbae7653d21e45145b6ba09aca05048 | Move method get_128_barcode to stock.quant.package | guewen/carrier-delivery-colipostefr,akretion/carrier-delivery-colipostefr | delivery_carrier_label_colissimo/stock.py | delivery_carrier_label_colissimo/stock.py | # -*- coding: utf-8 -*-
##############################################################################
#
# licence AGPL version 3 or later
# see licence in __openerp__.py or http://www.gnu.org/licenses/agpl-3.0.txt
# Copyright (C) 2014 Akretion (http://www.akretion.com).
# @author David BEAL <david.beal@akretion.co... | # -*- coding: utf-8 -*-
##############################################################################
#
# licence AGPL version 3 or later
# see licence in __openerp__.py or http://www.gnu.org/licenses/agpl-3.0.txt
# Copyright (C) 2014 Akretion (http://www.akretion.com).
# @author David BEAL <david.beal@akretion.co... | agpl-3.0 | Python |
ea86500ae5186f77b0ca14286b6c3407d7f402b4 | add more log | Micronaet/micronaet-mx8 | delivery_todo_report/agent/readability.py | delivery_todo_report/agent/readability.py | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... | agpl-3.0 | Python |
4b941a9ec4808387e87c668d2532ec850c4aa7a4 | Fix tests to include block_mode fixture | python-lz4/python-lz4,python-lz4/python-lz4 | tests/frame/test_frame_1.py | tests/frame/test_frame_1.py | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add store_source fixture
de... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add store_source fixture
de... | bsd-3-clause | Python |
9af8a6bb23467424cae244591efc9117032fb5c3 | Bump version to 2.10 dev | pyQode/pyqode.core,pyQode/pyqode.core | pyqode/core/__init__.py | pyqode/core/__init__.py | # -*- coding: utf-8 -*-
"""
The core package contains the core components needed for writing a pyqode based
application. It is the "de facto" requirement for any pyqode extension.
It contains the base classes for both the backend and the frontend and provides
a series of modes and panels that might be useful for any k... | # -*- coding: utf-8 -*-
"""
The core package contains the core components needed for writing a pyqode based
application. It is the "de facto" requirement for any pyqode extension.
It contains the base classes for both the backend and the frontend and provides
a series of modes and panels that might be useful for any k... | mit | Python |
111fae559f4d37833bca8d83ff5059611b7152d5 | Remove shebang | rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates,rcook/ptool-templates | python-tool/__main__.py | python-tool/__main__.py | {{py_copyright}}
from __future__ import print_function
import argparse
import os
import sys
from {{project_name}} import __description__, __project_name__, __version__
from {{project_name}}.config import Config
def _do_info(config, args):
print("The \"info\" command")
print("args={}".format(args))
def _main(... | #!/usr/bin/env python
{{py_copyright}}
from __future__ import print_function
import argparse
import os
import sys
from {{project_name}} import __description__, __project_name__, __version__
from {{project_name}}.config import Config
def _do_info(config, args):
print("The \"info\" command")
print("args={}".for... | mit | Python |
756c9ae9487ac5c35f069b79e792043bca0af27e | Fix passing sets to batchable methods | zooniverse/panoptes-python-client | panoptes_client/utils.py | panoptes_client/utils.py | import functools
ITERABLE_TYPES = (
list,
set,
tuple,
)
try:
from numpy import ndarray
ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,)
except ImportError:
pass
def isiterable(v):
return isinstance(v, ITERABLE_TYPES)
def batchable(func=None, batch_size=100):
def do_batch(*args, **kwar... | import functools
ITERABLE_TYPES = (
list,
set,
tuple,
)
try:
from numpy import ndarray
ITERABLE_TYPES = ITERABLE_TYPES + (ndarray,)
except ImportError:
pass
def isiterable(v):
return isinstance(v, ITERABLE_TYPES)
def batchable(func=None, batch_size=100):
def do_batch(*args, **kwar... | apache-2.0 | Python |
eab2571de69c9e80d5011c67e032d664cfbfa35e | remove init of mpl backend in tests | trichter/qopen | qopen/tests/__init__.py | qopen/tests/__init__.py | """
Tests for the qopen package.
qopen-runtests [-h] [-v] [-a] [-p] [-d] [-f] [-n num]
-h short help
-v be verbose
-a run all tests
-p use a permanent tempdir
-d empty permanent tempdir at start
-f fail fast
-n num maximal number of cores to use (default: all)
"""
from pkg_resources import resour... | """
Tests for the qopen package.
qopen-runtests [-h] [-v] [-a] [-p] [-d] [-f] [-n num]
-h short help
-v be verbose
-a run all tests
-p use a permanent tempdir
-d empty permanent tempdir at start
-f fail fast
-n num maximal number of cores to use (default: all)
"""
from pkg_resources import resour... | mit | Python |
a8904432a53aa82f8c1f0efbdd88114663120802 | Add some sort of simple image discovery | kragniz/containers | containers/containers.py | containers/containers.py | try:
from urllib import urlretrieve
except ImportError:
from urllib.request import urlretrieve
def simple_discovery(path, secure=True):
if secure:
protocol = 'https'
else:
protocol = 'http'
urlretrieve('{protocol}://{path}.aci'.format(path=path,
... | mit | Python | |
1b1771d164a3f3cea09ba2c482d6f6e3478fd6dc | Rename CommonAccess to better name | jazzband/django-axes,django-pci/django-axes | axes/models.py | axes/models.py | from django.db import models
from django.utils.translation import gettext_lazy as _
class AccessBase(models.Model):
user_agent = models.CharField(
_('User Agent'),
max_length=255,
db_index=True,
)
ip_address = models.GenericIPAddressField(
_('IP Address'),
null=Tru... | from django.db import models
from django.utils.translation import gettext_lazy as _
class CommonAccess(models.Model):
user_agent = models.CharField(
_('User Agent'),
max_length=255,
db_index=True,
)
ip_address = models.GenericIPAddressField(
_('IP Address'),
null=T... | mit | Python |
6a8c5e1a41d67678ddcc72aa63ccebd66c64891b | make model unique | Dev-Engine/PDFMiner,Dev-Engine/PDFMiner | pdfminer/model/models.py | pdfminer/model/models.py | """."""
# -*- coding: utf-8 -*-
import datetime
from flask.ext.mongoengine import MongoEngine
db = MongoEngine()
class User(db.Document):
"""."""
name = db.StringField(max_length=50, required=True, unique=True)
password = db.StringField()
email = db.StringField()
created_at = db.DateTimeField(de... | """."""
# -*- coding: utf-8 -*-
import datetime
from flask.ext.mongoengine import MongoEngine
db = MongoEngine()
class User(db.Document):
"""."""
name = db.StringField(max_length=50, required=True)
password = db.StringField()
email = db.StringField()
created_at = db.DateTimeField(default=datetim... | mit | Python |
e4e08c5e00470f687e213d06bcf97932baab234a | Fix django <1.9 capability | txerpa/dj-txmoney | txmoney/rates/management/commands/update_rates.py | txmoney/rates/management/commands/update_rates.py | # coding=utf-8
from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand, CommandError
from txmoney.settings import import_from_string, txmoney_settings as settings
class Command(BaseCommand):
help = "Gets the day's exchange rates"
def add_arguments(self, ... | # coding=utf-8
from __future__ import absolute_import, unicode_literals
from django.core.management.base import BaseCommand, CommandError
from txmoney.settings import import_from_string, txmoney_settings as settings
class Command(BaseCommand):
help = "Gets the day's exchange rates"
def add_arguments(self, ... | mit | Python |
e605dd28fe5bcf2c1986edb879a8765c3b86e05c | bump version | CanopyTax/asyncpgsa | asyncpgsa/__init__.py | asyncpgsa/__init__.py | from .pool import create_pool
from .pgsingleton import PG
from .connection import compile_query
__version__ = '0.10.0'
pg = PG()
| from .pool import create_pool
from .pgsingleton import PG
from .connection import compile_query
__version__ = '0.9.0'
pg = PG()
| apache-2.0 | Python |
4f52be26d7126574da23728dbe8cee722b5ec39a | Update test_hot_emissions.py | romainsacchi/carculator | tests/test_hot_emissions.py | tests/test_hot_emissions.py | from carculator.driving_cycles import get_standard_driving_cycle
from carculator.hot_emissions import HotEmissionsModel
import numpy as np
import pytest
dc = get_standard_driving_cycle()
dc_name = "WLTC"
def test_wrong_powertrain():
hem = HotEmissionsModel(dc, dc_name)
with pytest.raises(TypeError) as wrappe... | from carculator.driving_cycles import get_standard_driving_cycle
from carculator.hot_emissions import HotEmissionsModel
import numpy as np
import pytest
dc = get_standard_driving_cycle()
dc_name = "WLTC"
def test_wrong_powertrain():
hem = HotEmissionsModel(dc, dc_name)
with pytest.raises(TypeError) as wrappe... | bsd-3-clause | Python |
5b0f2cb49ea7452a13a69133ad526a94e7c1868e | add config to demostrate workaround | kapadia/rasterio,kapadia/rasterio,brendan-ward/rasterio,brendan-ward/rasterio,kapadia/rasterio,brendan-ward/rasterio | tests/test_read_resample.py | tests/test_read_resample.py | import numpy
import rasterio
# Rasterio exposes GDAL's resampling/decimation on I/O. These are the tests
# that it does this correctly.
#
# Rasterio's test dataset is 718 rows by 791 columns.
def test_read_out_shape_resample_down():
with rasterio.open('tests/data/RGB.byte.tif') as s:
out = numpy.zeros((... | import numpy
import rasterio
# Rasterio exposes GDAL's resampling/decimation on I/O. These are the tests
# that it does this correctly.
#
# Rasterio's test dataset is 718 rows by 791 columns.
def test_read_out_shape_resample_down():
with rasterio.open('tests/data/RGB.byte.tif') as s:
out = numpy.zeros((... | bsd-3-clause | Python |
83d4cdc0909e94f5b0a5cfaf472a9d8abc698bf7 | Update Bliss | EmreAtes/spack,LLNL/spack,LLNL/spack,mfherbst/spack,tmerrick1/spack,lgarren/spack,skosukhin/spack,mfherbst/spack,matthiasdiener/spack,iulian787/spack,TheTimmy/spack,TheTimmy/spack,matthiasdiener/spack,EmreAtes/spack,lgarren/spack,skosukhin/spack,TheTimmy/spack,mfherbst/spack,krafczyk/spack,LLNL/spack,iulian787/spack,kr... | var/spack/repos/builtin/packages/bliss/package.py | var/spack/repos/builtin/packages/bliss/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
e383479d5a3589cdea4d982650ab4dbd90a34fbc | Prepare version number for next development cycle. | IljaZakharov/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,martin-neuhaeusser/benchexec,ultimate-pa/benchexec,IljaZakharov/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,martin-neuhaeusser/benchexec,dbeyer/benchexec,martin-neuhaeusser/benchexec,ultimate... | benchexec/__init__.py | benchexec/__init__.py | # BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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.
# You may obtain a copy of the Lic... | # BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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.
# You may obtain a copy of the Lic... | apache-2.0 | Python |
401b929739a5158206c24eeda6616580f5686fb5 | Update available record types enum. | wrigri/libcloud,mbrukman/libcloud,atsaki/libcloud,sfriesel/libcloud,kater169/libcloud,NexusIS/libcloud,MrBasset/libcloud,StackPointCloud/libcloud,Verizon/libcloud,jimbobhickville/libcloud,Verizon/libcloud,curoverse/libcloud,ClusterHQ/libcloud,iPlantCollaborativeOpenSource/libcloud,aleGpereira/libcloud,mathspace/libclou... | libcloud/dns/types.py | libcloud/dns/types.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | Python |
e170666cbbc1f2a61c0ffa077c66da4556a6c5bb | Add my packages to featured list | NikhilKalige/atom-website,NikhilKalige/atom-website,NikhilKalige/atom-website | app/packages/views.py | app/packages/views.py | import requests
from . import packages
from models import Package, Downloads
from flask import jsonify
from datetime import timedelta
from app import cache
from utils import cache_timeout
@packages.route('/stats', methods=['GET'])
@cache_timeout
@cache.cached()
def stats():
resp = dict()
resp["count"] = Packa... | import requests
from . import packages
from models import Package, Downloads
from flask import jsonify
from datetime import timedelta
from app import cache
from utils import cache_timeout
@packages.route('/stats', methods=['GET'])
@cache_timeout
@cache.cached()
def stats():
resp = dict()
resp["count"] = Packa... | bsd-2-clause | Python |
3bb49e885cb08eaf3b4dd0a64d8681ed6933897c | Set the last_modified_on date to last change | MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging,MatthewWilkes/mw4068-packaging | app/soc/models/job.py | app/soc/models/job.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
cd14588c7121c2fc9e71a5eadc2f354d701e3760 | Set the last_modified_on date to last change | SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange | app/soc/models/job.py | app/soc/models/job.py | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | Python |
34db98c491fcf6c95eee5ef57c8d0b134e809117 | Swap method and language in LLTK query | lltk/lltk-restful | lltk-restful/views.py | lltk-restful/views.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from hashlib import md5
from flask import jsonify, request
from base import app, cache, config
from failure import *
if config['debug']:
lltk.config['debug'] = True
if config['caching']:
lltk.cachi... | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from hashlib import md5
from flask import jsonify, request
from base import app, cache, config
from failure import *
if config['debug']:
lltk.config['debug'] = True
if config['caching']:
lltk.cachi... | agpl-3.0 | Python |
21157c1f5558f941593568f6336b40f29481aae4 | Comment out to avoid confusions | KleinYuan/cnn | apps/inference_app.py | apps/inference_app.py | import cv2
import numpy as np
from models import inference, video
# TODO: Before you run this, make sure you understand what is going on below and customzie it!
# TODO: Don't just run it.
# Predict one img
graph_fp = ''
img_fp = ''
img = cv2.imread(img_fp)
predict_net = inference.Net(graph_fp=graph_fp)
predict_net.p... | import cv2
import numpy as np
from models import inference, video
# TODO: Before you run this, make sure you understand what is going on below and customzie it!
# TODO: Don't just run it.
# Predict one img
graph_fp = ''
img_fp = ''
img = cv2.imread(img_fp)
predict_net = inference.Net(graph_fp=graph_fp)
predict_net.p... | mit | Python |
72f01c28a6776ffdaab3213b3bbcb8ca3e8ca87d | Update __init__.py | rishubhjain/monitoring-integration,Tendrl/monitoring-integration | tendrl/monitoring_integration/sync/__init__.py | tendrl/monitoring_integration/sync/__init__.py | import gevent
import etcd
from tendrl.commons import sds_sync
from tendrl.monitoring_integration.graphite import GraphitePlugin
from tendrl.monitoring_integration.graphite import graphite_utils
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
class MonitoringIntegrati... | import gevent
import etcd
from tendrl.commons import sds_sync
from tendrl.monitoring_integration.graphite import GraphitePlugin
from tendrl.monitoring_integration.graphite import graphite_utils
from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import log_utils as logger
class MonitoringIntegrati... | lgpl-2.1 | Python |
33f2636e1de536a633cec9332362252b0b614817 | Remove kwargs["input_controller"] from the Game plugin template | SerpentAI/SerpentAI | serpent/templates/SerpentGamePlugin/files/serpent_game.py | serpent/templates/SerpentGamePlugin/files/serpent_game.py | from serpent.game import Game
from .api.api import MyGameAPI
from serpent.utilities import Singleton
from serpent.game_launchers.web_browser_game_launcher import WebBrowser
class SerpentGame(Game, metaclass=Singleton):
def __init__(self, **kwargs):
kwargs["platform"] = "PLATFORM"
kwargs["wind... | from serpent.game import Game
from .api.api import MyGameAPI
from serpent.utilities import Singleton
from serpent.input_controller import InputControllers
from serpent.game_launchers.web_browser_game_launcher import WebBrowser
class SerpentGame(Game, metaclass=Singleton):
def __init__(self, **kwargs):
... | mit | Python |
9b6f47feceeb95c99d7c66407f59aed4104df7fa | Remove distinct from the coaches queryset to allow deletion. [#739] | DjangoGirls/djangogirls,DjangoGirls/djangogirls,DjangoGirls/djangogirls | coach/admin.py | coach/admin.py | from django.contrib import admin
from coach.models import Coach
from core.models import EventPageContent
class CoachInline(admin.TabularInline):
model = EventPageContent.coaches.through
extra = 1
verbose_name_plural = 'Coaches'
class CoachAdmin(admin.ModelAdmin):
list_display = ('name', 'photo_disp... | from django.contrib import admin
from coach.models import Coach
from core.models import EventPageContent
class CoachInline(admin.TabularInline):
model = EventPageContent.coaches.through
extra = 1
verbose_name_plural = 'Coaches'
class CoachAdmin(admin.ModelAdmin):
list_display = ('name', 'photo_disp... | bsd-3-clause | Python |
bda10b24183fd4030e0cea42f7fdc3fb713dc08b | Fix get_app_list | peterkuma/tjrapid,peterkuma/tjrapid,peterkuma/tjrapid | tjrapid/admin.py | tjrapid/admin.py | from django.contrib import admin
from tjrapid import settings
class CustomAdminSite(admin.AdminSite):
def get_app_list(self, request):
app_list = super().get_app_list(request)
apps = {x['app_label']: x for x in app_list}
app_list = []
for label, model_list in settings.APP_LIST:
... | from django.contrib import admin
from tjrapid import settings
class CustomAdminSite(admin.AdminSite):
def get_app_list(self, request):
app_list = super().get_app_list(request)
apps = {x['app_label']: x for x in app_list}
app_list = []
for label, model_list in settings.APP_LIST:
... | mit | Python |
3eb2039d46906a336cf81b7e3387689ce21bd6fd | Apply button causes action. | certain/certain,certain/certain | certain/gui.py | certain/gui.py | from PyQt4 import QtCore
from PyQt4 import QtGui
from . import pending_csrs
from . import CertainForm
from . import DEFAULT_CONFIG_FILE
import sys
class MainWindow(QtGui.QMainWindow):
class ActionList(QtGui.QComboBox):
def __init__(self, *args, **kwargs):
super(ActionList, self).__init__(*arg... | from PyQt4 import QtCore
from PyQt4 import QtGui
from . import pending_csrs
from . import CertainForm
from . import DEFAULT_CONFIG_FILE
import sys
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.ui = CertainForm.Ui_MainWindow()
self.ui.set... | agpl-3.0 | Python |
028002e370c552950b201fe5bbb8b0478b16cb96 | fix RIO_SETTINGS import | soasme/rio,soasme/rio,soasme/rio | rio/app.py | rio/app.py | # -*- coding: utf-8 -*-
"""
rio.app
~~~~~~~~~
Implement of rio app factory based on Flask.
"""
from os import environ
from flask import Flask
from .core import db
from .core import celery
def configure_app(app):
"""Configure Flask/Celery application.
* Rio will find environment variable `RIO_SETTINGS` firs... | # -*- coding: utf-8 -*-
"""
rio.app
~~~~~~~~~
Implement of rio app factory based on Flask.
"""
from os import environ
from flask import Flask
from .core import db
from .core import celery
def configure_app(app):
"""Configure Flask/Celery application.
* Rio will find environment variable `RIO_SETTINGS` firs... | mit | Python |
de347132107e22ef6dd01c4f8f1dd1a07d57e1b8 | make `apply-fixit-edits` python3 friendly | allevato/swift,hooman/swift,parkera/swift,xwu/swift,tkremenek/swift,atrick/swift,glessard/swift,ahoppen/swift,apple/swift,benlangmuir/swift,jckarter/swift,jckarter/swift,hooman/swift,nathawes/swift,JGiola/swift,gregomni/swift,hooman/swift,allevato/swift,jmgc/swift,roambotics/swift,atrick/swift,benlangmuir/swift,gregomn... | utils/apply-fixit-edits.py | utils/apply-fixit-edits.py | #!/usr/bin/env python
# utils/apply-fixit-edits.py - Apply edits from .remap files -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://s... | #!/usr/bin/env python
# utils/apply-fixit-edits.py - Apply edits from .remap files -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://s... | apache-2.0 | Python |
7b8e5d4d49b55158a9c45a15f32c4d7726f0861d | Update bazel rules hdl repo | google/xls,google/xls,google/xls,google/xls,google/xls,google/xls | dependency_support/rules_hdl/workspace.bzl | dependency_support/rules_hdl/workspace.bzl | # Copyright 2021 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # Copyright 2021 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 | Python |
3f110981f31ef201b1556df2b51566410216954d | Update plugin to latest site changes | anlar/prismriver-lyrics,anlar/prismriver-lyrics,anlar/prismriver,anlar/prismriver | prismriver/plugin/jlyric.py | prismriver/plugin/jlyric.py | from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class JLyricPlugin(Plugin):
ID = 'jlyric'
RANK = 9
def __init__(self, config):
super(JLyricPlugin, self).__init__('J-Lyric', config)
def search_song(self, artist, title):
link = "http://search.j-lyric.net/... | from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class JLyricPlugin(Plugin):
ID = 'jlyric'
RANK = 9
def __init__(self, config):
super(JLyricPlugin, self).__init__('J-Lyric', config)
def search_song(self, artist, title):
link = "http://search.j-lyric.net/... | mit | Python |
e3ff3bf1db986832e02ea5f91c0aaf4b0ff52964 | Bump version 1.2.6 | redhat-openstack/infrared,okolisny/InfraRed,redhat-openstack/infrared,okolisny/InfraRed,redhat-openstack/infrared,okolisny/InfraRed | cli/__init__.py | cli/__init__.py | __VERSION__ = '1.2.6'
| __VERSION__ = '1.2.5'
| apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.