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 |
|---|---|---|---|---|---|---|---|---|
59d43763468d56c99ddc0fda805d2c653b7433ab | Add comments to new tests and remove unused return vars | sot/mica,sot/mica | mica/vv/tests/test_vv.py | mica/vv/tests/test_vv.py | import os
import numpy as np
from .. import vv
from .. import process
from ... import common
def test_get_vv_dir():
obsdir = vv.get_vv_dir(16504)
assert obsdir == os.path.abspath(os.path.join(common.MICA_ARCHIVE, 'vv/16/16504_v01'))
def test_get_vv_files():
obsfiles = vv.get_vv_files(16504)
assert s... | import os
import numpy as np
from .. import vv
from .. import process
from ... import common
def test_get_vv_dir():
obsdir = vv.get_vv_dir(16504)
assert obsdir == os.path.abspath(os.path.join(common.MICA_ARCHIVE, 'vv/16/16504_v01'))
def test_get_vv_files():
obsfiles = vv.get_vv_files(16504)
assert s... | bsd-3-clause | Python |
437d73e027fdaf220423f69712a5f348a3675826 | Clean up utils.randomDraft() | Ragowit/fireplace,amw2104/fireplace,liujimj/fireplace,jleclanche/fireplace,oftc-ftw/fireplace,beheh/fireplace,liujimj/fireplace,NightKev/fireplace,Meerkov/fireplace,oftc-ftw/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,Ragowit/fireplace,butozerca/fireplace,Meerkov/fireplace,butozerca/fireplace,amw2104/fi... | fireplace/utils.py | fireplace/utils.py | class CardList(list):
def __contains__(self, x):
for item in self:
if x is item:
return True
return False
def contains(self, x):
"True if list contains any instance of x"
for item in self:
if x == item:
return True
return False
def index(self, x):
for i, item in enumerate(self):
if x i... | class CardList(list):
def __contains__(self, x):
for item in self:
if x is item:
return True
return False
def contains(self, x):
"True if list contains any instance of x"
for item in self:
if x == item:
return True
return False
def index(self, x):
for i, item in enumerate(self):
if x i... | agpl-3.0 | Python |
a3bc213352738013b5eeaeb5ef6102e0ef0f3fcf | Return a CardList in CardList.filter() | jleclanche/fireplace,oftc-ftw/fireplace,NightKev/fireplace,Meerkov/fireplace,liujimj/fireplace,amw2104/fireplace,butozerca/fireplace,amw2104/fireplace,butozerca/fireplace,Ragowit/fireplace,liujimj/fireplace,Meerkov/fireplace,smallnamespace/fireplace,oftc-ftw/fireplace,beheh/fireplace,smallnamespace/fireplace,Ragowit/fi... | fireplace/utils.py | fireplace/utils.py | class CardList(list):
def __contains__(self, x):
for item in self:
if x is item:
return True
return False
def contains(self, x):
"True if list contains any instance of x"
for item in self:
if x == item:
return True
return False
def index(self, x):
for i, item in enumerate(self):
if x i... | class CardList(list):
def __contains__(self, x):
for item in self:
if x is item:
return True
return False
def contains(self, x):
"True if list contains any instance of x"
for item in self:
if x == item:
return True
return False
def index(self, x):
for i, item in enumerate(self):
if x i... | agpl-3.0 | Python |
ba2fe04dec3d1a6937e9b4343458e9495d7c1f48 | add copyright header | Jigsaw-Code/censoredplanet-analysis,Jigsaw-Code/censoredplanet-analysis | firehook_resources.py | firehook_resources.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | """Various cross-file constants and project-specific initializers."""
PROJECT_NAME = 'firehook-censoredplanet'
# Buckets that store scanfiles
U_MICH_BUCKET = 'censoredplanetscanspublic'
TARRED_BUCKET = 'firehook-censoredplanetscanspublic'
UNTARRED_BUCKET = 'firehook-scans'
INPUT_BUCKET = f'gs://{UNTARRED_BUCKET}/'
#... | apache-2.0 | Python |
dacb547d7cc35496de22fe0791cc1fa8a1696f09 | remove obsolete comments | openplans/fixcity,openplans/fixcity | fixcity/exif_utils.py | fixcity/exif_utils.py | from PIL import Image
from PIL.ExifTags import TAGS
def get_exif_info(img):
"""
Get EXIF information from a PIL.Image instance.
Found this code at:
http://wolfram.kriesing.de/blog/index.php/2006/reading-out-exif-data-via-python
"""
result = {}
try:
info = img._getexif() or {}
ex... | from PIL import Image
from PIL.ExifTags import TAGS
def get_exif_info(img):
"""
Get EXIF information from a PIL.Image instance.
Found this code at:
http://wolfram.kriesing.de/blog/index.php/2006/reading-out-exif-data-via-python
"""
result = {}
try:
info = img._getexif() or {}
ex... | agpl-3.0 | Python |
66ffdbce49bdc78d00c5e258d225d496eb5dbc02 | Use May 5th as default election date | DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website | democracy_club/apps/everyelection/models.py | democracy_club/apps/everyelection/models.py | from django.db import models
from django.contrib.auth.models import User
from django_extensions.db.models import TimeStampedModel
from authorities.models import Authority, MapitArea
class AuthorityElection(models.Model):
election_id = models.CharField(primary_key=True, max_length=255)
authority = models.For... | from django.db import models
from django.contrib.auth.models import User
from django_extensions.db.models import TimeStampedModel
from authorities.models import Authority, MapitArea
class AuthorityElection(models.Model):
election_id = models.CharField(primary_key=True, max_length=255)
authority = models.For... | bsd-3-clause | Python |
fc7125d4e9ca7d25d6010d163d8fa19ce9a65e4f | prueba python | agmardones/basesapp,agmardones/basesapp,agmardones/basesapp | flaskr/__init__.py | flaskr/__init__.py | #!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... | #!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... | mit | Python |
97e3b202bbe6726a4056facb8b4690b0710029a9 | Use a real path when testing sites. | handroll/handroll | handroll/tests/test_site.py | handroll/tests/test_site.py | # Copyright (c) 2015, Matt Layman
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
valid_site = os.path.realpath(tempfile.mkdtemp())
open(os.... | # Copyright (c) 2015, Matt Layman
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
valid_site = tempfile.mkdtemp()
open(os.path.join(valid_si... | bsd-2-clause | Python |
8b963311e1e1449fd34c1a68bbe859fe51cb9fdb | Update scanner test | adamcik/mopidy,pacificIT/mopidy,dbrgn/mopidy,diandiankan/mopidy,liamw9534/mopidy,dbrgn/mopidy,SuperStarPL/mopidy,SuperStarPL/mopidy,mokieyue/mopidy,abarisain/mopidy,SuperStarPL/mopidy,glogiotatidis/mopidy,vrs01/mopidy,rawdlite/mopidy,vrs01/mopidy,swak/mopidy,jmarsik/mopidy,hkariti/mopidy,diandiankan/mopidy,jcass77/mopi... | tests/scanner.py | tests/scanner.py | import unittest
from mopidy.scanner import Scanner
from tests import data_folder
class ScannerTest(unittest.TestCase):
def setUp(self):
self.errors = {}
self.data = {}
def scan(self, path):
scanner = Scanner(data_folder(path),
self.data_callback, self.error_callback)
... | import unittest
from mopidy.scanner import Scanner
from tests import data_folder
class ScannerTest(unittest.TestCase):
def setUp(self):
self.errors = {}
self.data = {}
def scan(self, path):
scanner = Scanner(data_folder(path),
self.data_callback, self.error_callback)
... | apache-2.0 | Python |
c2d0def793668e204c83c723f4765705369fd3e0 | Update trimfile.py | suzannerohrback/somaticCNVpipeline,suzannerohrback/somaticCNVpipeline | bin/preprocess/trimfile.py | bin/preprocess/trimfile.py | #!/usr/bin/python
import os
import gzip
#open input and output files#
def openFiles(file):
if file[-5:] == 'fastq':
IN = open(file, 'r')
outfilename = file[:-5] + 'k' + str(length) + '.fastq'
elif file[-8:] == 'fastq.gz':
IN = gzip.open(file, 'rb')
outfilename = file[:-8] + 'k' + str(length) + ... | #!/usr/bin/python
def trimOne():
return 0
| mit | Python |
bc9e57127cb53af85517dab12f23c26304b5f572 | Bump version to 0.13.0+dev | python-hyper/h11 | h11/_version.py | h11/_version.py | # This file must be kept very simple, because it is consumed from several
# places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc.
# We use a simple scheme:
# 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev
# where the +dev versions are never released into the wild, they're just what
# we stick into the ... | # This file must be kept very simple, because it is consumed from several
# places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc.
# We use a simple scheme:
# 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev
# where the +dev versions are never released into the wild, they're just what
# we stick into the ... | mit | Python |
7e44a8bd38105144111624710819a1ee54891222 | Fix order for menu ref | sl2017/campos | campos_checkin/__openerp__.py | campos_checkin/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2017 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
... | # -*- coding: utf-8 -*-
# Copyright 2017 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
... | agpl-3.0 | Python |
e0e45ee2da44cd5040ee399aca6d17a953efc214 | update bundle and bundle line relation from Many2many to One2many | anas-taji/sale-workflow,kittiu/sale-workflow,xpansa/sale-workflow,numerigraphe/sale-workflow,Rona111/sale-workflow,diagramsoftware/sale-workflow,ddico/sale-workflow,Endika/sale-workflow,BT-fgarbely/sale-workflow,akretion/sale-workflow,acsone/sale-workflow,numerigraphe/sale-workflow,factorlibre/sale-workflow,BT-jmichaud... | models/product_bundle.py | models/product_bundle.py | # -*- encoding: utf-8 -*-
from openerp import fields, models, _
class ProductBundle(models.Model):
_name = 'product.bundle'
_description = 'Product bundle'
name = fields.Char(_('Name'), help=_('Product bundle name'), required=True)
bundle_line_ids = fields.One2many(
'product.bundle.line', 'pr... | # -*- encoding: utf-8 -*-
from openerp import fields, models, _
class ProductBundle(models.Model):
_name = 'product.bundle'
_description = 'Product bundle'
name = fields.Char(_('Name'), help=_('Product bundle name'), required=True)
bundle_line_ids = fields.Many2many(
'product.bundle.line', 'p... | agpl-3.0 | Python |
318078740a6dfc6a68238384a2323b809c14c497 | correct error encode json collected | HugoMeziani/CaepaInvestigatio,HugoMeziani/CaepaInvestigatio,HugoMeziani/CaepaInvestigatio,HugoMeziani/CaepaInvestigatio | caepainvestigatio/linkJSONtoDB.py | caepainvestigatio/linkJSONtoDB.py | import json
import mongoengine
from caepainvestigatio import connect
from caepainvestigatio.ORM import collect
from caepainvestigatio.logging_conf import initLogging
log = initLogging()
def JSONtoDB(files_list):
""" browse and insert into mongoDB all json files """
for json_file in files_list:
with o... | import glob
import json
import os
import mongoengine
from caepainvestigatio import connect
from caepainvestigatio.ORM import collect
from caepainvestigatio.logging_conf import initLogging
log = initLogging()
def JSONtoDB(files_list):
""" browse and insert into mongoDB all json files """
for json_file in file... | mit | Python |
4711c169d6ad3744f2adaeec56fc7d2775c8cf2e | Bump package version to 1.29.1 | instana/python-sensor,instana/python-sensor | instana/version.py | instana/version.py | # Module version file. Used by setup.py and snapshot reporting.
VERSION = '1.29.1'
| # Module version file. Used by setup.py and snapshot reporting.
VERSION = '1.29.0'
| mit | Python |
c41595717216e5c00dfb6cd4cc0e74d2c730e204 | Add BCRYPT_LOG_ROUNDS | Elbertbiggs360/buckelist-api | instance/config.py | instance/config.py | import os
class Config(object):
"""Parent configuration class"""
DEBUG = False
CSRF_ENABLED = True
# ALT: <variable> = os.getenv('<env_var_name>')
SECRET = 'HeathLEDGERwasTHEBESTidc'
# database with host configuration removed. Defaults to machine localhost
SQLALCHEMY_DATABASE_URI = "postgr... | import os
class Config(object):
"""Parent configuration class"""
DEBUG = False
CSRF_ENABLED = True
# ALT: <variable> = os.getenv('<env_var_name>')
SECRET = 'HeathLEDGERwasTHEBESTidc'
# database with host configuration removed. Defaults to machine localhost
SQLALCHEMY_DATABASE_URI = "postgr... | mit | Python |
75cb0f98663e93454f90aa120fbe51922c1f51ac | Stop skipping two round-trip tests for Julian day numbers. | jwg4/calexicon,jwg4/qual | calexicon/fn/tests/test_julian.py | calexicon/fn/tests/test_julian.py | import sys
if sys.hexversion < 0x02070000:
import unittest2 as unittest
else:
import unittest
from hypothesis import given
from hypothesis.extra.datetime import datetimes
from datetime import date as vanilla_date
from calexicon.calendars.tests.test_calendar import JulianGregorianConversion
from calexicon.fn... | import sys
if sys.hexversion < 0x02070000:
import unittest2 as unittest
else:
import unittest
from hypothesis import given
from hypothesis.extra.datetime import datetimes
from datetime import date as vanilla_date
from calexicon.calendars.tests.test_calendar import JulianGregorianConversion
from calexicon.fn... | apache-2.0 | Python |
8728d524f3f9390fffe965959efbfa27961d2e67 | Update models.py #41 | 7pairs/twingo,7pairs/twingo | twingo/models.py | twingo/models.py | # -*- coding: utf-8 -*-
#
# Copyright 2015-2019 Jun-ya HASEBA
#
# 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 applic... | # -*- coding: utf-8 -*-
#
# Copyright 2015 Jun-ya HASEBA
#
# 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 |
7ecc17c40589d31770e9890be88b03660b0d9155 | add %matplotlib inline to the profile | bgruening/docker-jupyter-notebook,bgruening/docker-jupyter-notebook,bgruening/docker-ipython-notebook,bgruening/docker-ipython-notebook,bgruening/docker-ipython-notebook,bgruening/docker-jupyter-notebook | ipython-profile.py | ipython-profile.py | %matplotlib inline
from galaxy import get, put, get_galaxy_connection, _get_history_id
HISTORY_ID = _get_history_id()
| from galaxy import get, put, get_galaxy_connection, _get_history_id
HISTORY_ID = _get_history_id()
| mit | Python |
f81dd12b1562bacd9d3270aeaf1ac0e9d2870ead | Remove encode | Motoko11/MotoBot | plugins/modifiers/sed.py | plugins/modifiers/sed.py | from motobot import command
from re import compile, IGNORECASE
sed_pattern = compile(r'^(?:.+)sed(?: ?)(?:s?)\/(.*?)\/(.*?)\/(?:.*?) (.+)$', IGNORECASE)
@command('sed')
def sed_command(bot, context, message, args):
match = sed_pattern.match(message)
if match is not None:
pattern, replace, arg = matc... | from motobot import command
from codecs import encode
from re import compile, IGNORECASE
sed_pattern = compile(r'^(?:.+)sed(?: ?)(?:s?)\/(.*?)\/(.*?)\/(?:.*?) (.+)$', IGNORECASE)
@command('sed')
def sed_command(bot, context, message, args):
match = sed_pattern.match(message)
if match is not None:
pa... | mit | Python |
b7cf4651aac02b8a1e6179c7504993911c9417b6 | bump version | hopshadoop/hops-util-py,hopshadoop/hops-util-py | hops/version.py | hops/version.py | __version__ = '2.0.3'
| __version__ = '2.0.2'
| apache-2.0 | Python |
bcee7fcca784bbc55fc7d10f9dbfeaaf3603c42a | Revert changes message in init help | apiaryio/black-belt | blackbelt/commands/init.py | blackbelt/commands/init.py | import os
import click
from blackbelt.configure import configure_blackbelt
@click.group(invoke_without_command=True, help="""Initialize application for usage. Invoke this command first.""")
def cli():
configure_blackbelt()
| import os
import click
from blackbelt.configure import configure_blackbelt
@click.group(invoke_without_command=True, help="""Deploy to staging""")
def cli():
configure_blackbelt()
| mit | Python |
745b7f1f2fa1230a961856be41f5b6f4422226c1 | Use total_seconds() to get duration | mpolden/jarvis2,martinp/jarvis2,martinp/jarvis2,martinp/jarvis2,mpolden/jarvis2,mpolden/jarvis2 | jarvis/jobs/nsb.py | jarvis/jobs/nsb.py | # -*- coding: utf-8 -*-
import requests
from datetime import datetime
from jobs import AbstractJob
class Nsb(AbstractJob):
def __init__(self, conf):
self.from_location = conf['from']
self.to_location = conf['to']
self.interval = conf['interval']
self.timeout = conf.get('timeout')... | # -*- coding: utf-8 -*-
import requests
from datetime import datetime
from jobs import AbstractJob
class Nsb(AbstractJob):
def __init__(self, conf):
self.from_location = conf['from']
self.to_location = conf['to']
self.interval = conf['interval']
self.timeout = conf.get('timeout')... | mit | Python |
32ab388906bfe2e68b1eb0d30393f472cf29d365 | Refactor curry.py | chrfrasco/curry.py,PaiAkshay998/curry.py | curry.py | curry.py | """Utility for currying functions."""
from functools import update_wrapper
from inspect import signature, isclass
class _CurriedFactory:
"""Return a curried version of the supplied function."""
def __init__(self, fun, args=None, kwargs=None):
self.fun = fun
self.args = args if args is not N... | """Utility for currying functions."""
from functools import update_wrapper
from inspect import signature, isclass
def get_arg_count(fun):
"""Return the number of parameters a function takes.
Builtins, by default, refer to their class rather than their function call.
Referring to their __call__ instance ... | mit | Python |
7c6bd9ab24dbbd59e906696455a22f008bcc2227 | add nrf51's UICR to its memory map | pyocd/pyOCD,0xc0170/pyOCD,mesheven/pyOCD,0xc0170/pyOCD,flit/pyOCD,mbedmicro/pyOCD,mesheven/pyOCD,mesheven/pyOCD,flit/pyOCD,0xc0170/pyOCD,wjzhang/pyOCD,mbedmicro/pyOCD,wjzhang/pyOCD,pyocd/pyOCD,mbedmicro/pyOCD,matthewelse/pyOCD,matthewelse/pyOCD,wjzhang/pyOCD,matthewelse/pyOCD | pyOCD/target/target_nrf51.py | pyOCD/target/target_nrf51.py | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 |
bfe98d55b56fedd8ca2e2659eed53a6390e53adf | Simplify email rendering | django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,edoburu/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments | fluent_comments/email.py | fluent_comments/email.py | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from fluent_comments import appsettings
def send_comment_posted(comment, request):
""... | from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.encoding import force_text
from fluent_comments import appsettings
def send_comment_posted(comment, request):
""... | apache-2.0 | Python |
051e7dca6294ee84f924685c8e8f8ada70842ace | Update CoL icon | NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm,NaturalHistoryMuseum/ckanext-nhm | ckanext/nhm/lib/external_links.py | ckanext/nhm/lib/external_links.py | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from collections import namedtuple
Site = namedtuple('Site', ['name', 'icon', 'link'])
BHL = Site(name='Biodiversity Heritage Library',
icon='https://www.biodiversitylibrary.... | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of ckanext-nhm
# Created by the Natural History Museum in London, UK
from collections import namedtuple
Site = namedtuple('Site', ['name', 'icon', 'link'])
BHL = Site(name='Biodiversity Heritage Library',
icon='https://www.biodiversitylibrary.... | mit | Python |
2532f906db94620cf19fdccd644a38b2a295492f | Update serializers.py | DavidJFelix/hatchit,DavidJFelix/hatchit,DavidJFelix/hatchit | src/core/serializers.py | src/core/serializers.py | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Event, Invite, Suggestion
class EventSerializer(serializers.HyperLinkedModelSerializer):
class Meta:
model = Event
class InviteSerializer(serializers.HyperLinkedModelSerializer):
class Meta:
model = Invite
... | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Event, Invite, Suggestion
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
| agpl-3.0 | Python |
691177c20c02b14c52729df5f2cd03f57ac0de29 | Fix Python 2.5 failure | mfussenegger/jedi,dwillmer/jedi,jonashaag/jedi,dwillmer/jedi,WoLpH/jedi,flurischt/jedi,jonashaag/jedi,WoLpH/jedi,flurischt/jedi,tjwei/jedi,mfussenegger/jedi,tjwei/jedi | jedi/docstrings.py | jedi/docstrings.py | """ Processing of docstrings, which means parsing for types. """
import re
import evaluate
import parsing
DOCSTRING_PARAM_PATTERNS = [
r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx
r'\s*@type\s+%s:\s*([^\n]+)', # Epidoc
]
DOCSTRING_RETURN_PATTERNS = [
re.compile(r'\s*:rtype:\s*([^\n]+)', re.M), # Sphinx
... | """ Processing of docstrings, which means parsing for types. """
import re
import evaluate
import parsing
DOCSTRING_PARAM_PATTERNS = [
r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx
r'\s*@type\s+%s:\s*([^\n]+)', # Epidoc
]
DOCSTRING_RETURN_PATTERNS = [
re.compile(r'\s*:rtype:\s*([^\n]+)', re.M), # Sphinx
... | mit | Python |
3cd99c23099a625da711e3ac458a46a7b364d83c | Change Pool to use ProcessPoolExecutor | wiliamsouza/hystrix-py,wiliamsouza/hystrix-py | hystrix/pool.py | hystrix/pool.py | from __future__ import absolute_import
from concurrent.futures import ProcessPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'PoolMetaclass')
def __new__(cls, name, bases, attrs):
if name in cl... | from __future__ import absolute_import
from concurrent.futures import ThreadPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'PoolMetaclass')
def __new__(cls, name, bases, attrs):
if name in cls... | apache-2.0 | Python |
9b6ae8c19c01bdeaaaade68b9d633917acbbb965 | Remove Flask-SocketIO leftover | labsome/labsome,warehaus/warehaus,labsome/labsome,warehaus/warehaus,warehaus/warehaus,labsome/labsome | backend/api-server/setup.py | backend/api-server/setup.py | #!/usr/bin/python
import os
from setuptools import setup
from setuptools import find_packages
setup(
name = 'warehaus_api',
version = '0.1.0',
url = 'http://warehaus.io/',
license = 'AGPL-3.0',
zip_safe = True,
packages = find_packages(),
include_package_data = True,
package_data = {
... | #!/usr/bin/python
import os
from setuptools import setup
from setuptools import find_packages
setup(
name = 'warehaus_api',
version = '0.1.0',
url = 'http://warehaus.io/',
license = 'AGPL-3.0',
zip_safe = True,
packages = find_packages(),
include_package_data = True,
package_data = {
... | agpl-3.0 | Python |
4d561a21764ad6d1b109c712b0a2a6c3a715b56e | update to pandas code | NiJeLorg/paratransit_api | paratransit/api/management/commands/import_paratransit_data_pandas.py | paratransit/api/management/commands/import_paratransit_data_pandas.py | import sys,os
from django.core.management.base import BaseCommand, CommandError
from api.models import *
import csv
from django.db import connection
from django.conf import settings
import pandas as pd
from sqlalchemy import create_engine
import datetime as dt
#db connection
user = settings.DATABASES['default']['USER... | import sys,os
from django.core.management.base import BaseCommand, CommandError
from api.models import *
import csv
from django.db import connection
from django.conf import settings
import pandas as pd
from sqlalchemy import create_engine
import datetime as dt
#db connection
user = settings.DATABASES['default']['USER... | mit | Python |
24d9b4b97eaf167ce646ef662c721d75228f95e3 | Update the BUILD number to 4563. | google/mozc,fcitx/mozc,fcitx/mozc,fcitx/mozc,google/mozc,google/mozc,fcitx/mozc,google/mozc,fcitx/mozc,google/mozc | src/data/version/mozc_version_template.bzl | src/data/version/mozc_version_template.bzl | # Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | # Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | bsd-3-clause | Python |
2fae8425efa90b0e67b84648a55064be1e554bc4 | Rename current_job to async for clarity. | Workiva/furious,rosshendrickson-wf/furious,mattsanders-wf/furious,Workiva/furious,mattsanders-wf/furious,andreleblanc-wf/furious,beaulyddon-wf/furious,rosshendrickson-wf/furious,robertkluin/furious,andreleblanc-wf/furious,beaulyddon-wf/furious | furious/processors.py | furious/processors.py | #
# Copyright 2012 WebFilings, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | #
# Copyright 2012 WebFilings, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 | Python |
ea86e9a0ebe1b862e49c15ead6fb220564bd271a | Fix errors | ajcarpente42/HudsonDuinoLED,ajcarpente42/HudsonDuinoLED,ajcarpente42/HudsonDuinoLED | Python/Combined.py | Python/Combined.py | from HudsonChecker import HudsonChecker
from IndicoChecker import IndicoChecker
import serial #pySerial library
import time
import sys
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("Usage: python Combined.py <port> (<url>)")
else:
if len(sys.argv) == 3:
url = sys.argv[2]
else:
url = "htt... | from HudsonChecker import HudsonChecker
from IndicoChecker import IndicoChecker
import serial #pySerial library
import time
import sys
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("Usage: python Combined.py <port> (<url>)")
else:
if len(sys.argv) == 3:
url = sys.argv[2]
else:
url = "htt... | epl-1.0 | Python |
7a14992de098fd617d10fb49ffb898ef73dd2aca | make consistent with old implementation | brunosmmm/hdltools,brunosmmm/hdltools | hdltools/abshdl/codegen.py | hdltools/abshdl/codegen.py | """HDL Code generation."""
from scoff.codegen import CodeGenerator
from .stmt import HDLStatement
class HDLCodeGenerator(CodeGenerator):
"""HDL Code generator."""
def _check_validity(self, element):
if isinstance(element, HDLStatement):
if element.is_legal() is False:
ret... | """HDL Code generation."""
from scoff.codegen import CodeGenerator
from .stmt import HDLStatement
class HDLCodeGenerator(CodeGenerator):
"""HDL Code generator."""
def _check_validity(self, element):
if isinstance(element, HDLStatement):
if element.is_legal() is False:
ret... | mit | Python |
dfe3469c64ff3ef6d52fdafdf47fd9f31995001a | Update th_fr.py | PyThaiNLP/pythainlp | pythainlp/translate/th_fr.py | pythainlp/translate/th_fr.py | # -*- coding: utf-8 -*-
"""
Thai-French Machine Translation
Trained by OPUS Corpus
Model from Language Technology Research Group at the University of Helsinki
BLEU 20.4
- Huggingface https://huggingface.co/Helsinki-NLP/opus-mt-th-fr
"""
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
class ThFrTrans... | # -*- coding: utf-8 -*-
"""
Thai-French Machine Translation
Trained by OPUS Corpus
Model from Language Technology Research Group at the University of Helsinki
BLEU 20.4
- GitHub: https://github.com/Helsinki-NLP/OPUS-MT-train/tree/master/models/th-fr
- Huggingface https://huggingface.co/Helsinki-NLP/opus-mt-th-fr
""... | apache-2.0 | Python |
355523c67fb6d14a1a3f0087228abbe39cd69322 | fix output name issue where it truncates files with periods in the name | cmap/cmapPy | cmapPy/pandasGEXpress/gctx2gct.py | cmapPy/pandasGEXpress/gctx2gct.py | """
Command-line script to convert a .gctx file to .gct.
Main method takes in a .gctx file path (and, optionally, an
out path and/or name to which to save the equivalent .gctx)
and saves the enclosed content to a .gct file.
Note: Only supports v1.0 .gctx files.
"""
import logging
from cmapPy.pandasGEXpress imp... | """
Command-line script to convert a .gctx file to .gct.
Main method takes in a .gctx file path (and, optionally, an
out path and/or name to which to save the equivalent .gctx)
and saves the enclosed content to a .gct file.
Note: Only supports v1.0 .gctx files.
"""
import logging
from cmapPy.pandasGEXpress imp... | bsd-3-clause | Python |
8869a7fe392c90b299610478d2822a222fb67c2f | remove commented out code | smartfile/client-python | test/test_smartfile.py | test/test_smartfile.py | import os
import unittest
from StringIO import StringIO
from smartfile import BasicClient
from smartfile.errors import ResponseError
API_KEY = os.environ.get("API_KEY")
API_PASSWORD = os.environ.get("API_PASSWORD")
TESTFN = "testfn"
if API_KEY is None:
raise RuntimeError("API_KEY is required")
if API_PASSWORD i... | import os
import unittest
from StringIO import StringIO
from smartfile import BasicClient
from smartfile.errors import ResponseError
API_KEY = os.environ.get("API_KEY")
API_PASSWORD = os.environ.get("API_PASSWORD")
TESTFN = "testfn"
if API_KEY is None:
raise RuntimeError("API_KEY is required")
if API_PASSWORD i... | mit | Python |
6ab6430796eaf92d2701c631ce08a5f75fbe1466 | Update lazycseq.py | dbeyer/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec | benchexec/tools/lazycseq.py | benchexec/tools/lazycseq.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.util as util
from . import cseq
class Tool(cseq.CSeqTool):
"""
... | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.util as util
from . import cseq
class Tool(cseq.CSeqTool):
"""
... | apache-2.0 | Python |
383e6a2a511bc39e5127f15637d9705505189b73 | add more doc in base | Kotaimen/georest | georest/model/base.py | georest/model/base.py | __author__ = 'pp'
class ModelError(Exception):
HTTP_STATUS_CODE = 500
class ModelNotFound(ModelError):
HTTP_STATUS_CODE = 404
class ModelKeyExists(ModelError):
HTTP_STATUS_CODE = 412
class ModelInvalidData(ModelError):
HTTP_STATUS_CODE = 400
class Model(object):
"""The way to persist, (de)... | __author__ = 'pp'
class ModelError(Exception):
HTTP_STATUS_CODE = 500
class ModelNotFound(ModelError):
HTTP_STATUS_CODE = 404
class ModelKeyExists(ModelError):
HTTP_STATUS_CODE = 412
class ModelInvalidData(ModelError):
HTTP_STATUS_CODE = 400
class Model(object):
"""The way to persist, (de)... | bsd-2-clause | Python |
394d9a234a8dfbd4355640ea1105b7df4fd271cf | Remove drill | barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django | project/settings/prod.py | project/settings/prod.py | from .base import *
from urlparse import urlparse
es = urlparse(get_env_variable("SEARCHBOX_URL"))
# AWS S3 Settings
# This was hellaciously confusing to set up.
# `Static` means public-read, static resources like CSS, Images, etc.
# `Media` means private, user or admin-uploaded resources that have ACL
# Honor the... | from .base import *
from urlparse import urlparse
es = urlparse(get_env_variable("SEARCHBOX_URL"))
# AWS S3 Settings
# This was hellaciously confusing to set up.
# `Static` means public-read, static resources like CSS, Images, etc.
# `Media` means private, user or admin-uploaded resources that have ACL
# Honor the... | bsd-2-clause | Python |
c52edc120f38acb079fa364cdb684fc2052d4727 | Annotate trumpia url to say it allows XML in the querystring | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/messaging/smsbackends/trumpia/urls.py | corehq/messaging/smsbackends/trumpia/urls.py | from django.conf.urls import url
from corehq.apps.hqwebapp.decorators import waf_allow
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
url(r'^sms/(?P<api_key>[\w-]+)/?$', waf_allow('XSS_QUERYSTRING')(TrumpiaIncomingView.as_view()),
name=TrumpiaIncomingView.urlna... | from django.conf.urls import url
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
url(r'^sms/(?P<api_key>[\w-]+)/?$', TrumpiaIncomingView.as_view(),
name=TrumpiaIncomingView.urlname),
]
| bsd-3-clause | Python |
f7e107c1d7b3c44fe2eaf21ef0d12852c6a3c075 | fix isort | pwndbg/pwndbg,pwndbg/pwndbg,pwndbg/pwndbg,pwndbg/pwndbg | pwndbg/commands/flags.py | pwndbg/commands/flags.py | import argparse
from argparse import RawTextHelpFormatter
import pwndbg.commands
description="Modify the flags register"
epilog = """Examples:
On X86/X64:
setflag ZF 1 -- set zero flag
setflag CF 0 -- unset carry flag
On ARM:
setflag Z 0 -- unset the Z cpsr/xpsr flag
To see f... | import argparse
from argparse import RawTextHelpFormatter
import gdb
import pwndbg.commands
description="Modify the flags register"
epilog = """Examples:
On X86/X64:
setflag ZF 1 -- set zero flag
setflag CF 0 -- unset carry flag
On ARM:
setflag Z 0 -- unset the Z cpsr/xpsr fla... | mit | Python |
a10f7a66d15fdcf892735fb9c3bc9ee271f9f883 | Remove reindexuser from user login | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | src/ggrc/login/common.py | src/ggrc/login/common.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handle the interface to GGRC models for all login methods.
"""
from ggrc import db, settings
from ggrc.models.context import Context
from ggrc.models.person import Person
from ggrc.services.common import... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Handle the interface to GGRC models for all login methods.
"""
from ggrc import db, settings
from ggrc.models.context import Context
from ggrc.models.person import Person
from ggrc.fulltext import get_in... | apache-2.0 | Python |
b5b2619e27d2444affed1b887f4f689579bf4c72 | Add Audit relationship to issue model | AleksNeStu/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,plamut/ggrc-core | src/ggrc/models/issue.py | src/ggrc/models/issue.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc import db
from ggrc.models.mixins.audit_relationship import AuditRelationship
from ggrc.models.mixins import (
BusinessObject, Timeboxed, CustomAttributable, TestPlanned
)
from ggrc.models.obje... | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc import db
from ggrc.models.mixins import (
BusinessObject, Timeboxed, CustomAttributable, TestPlanned
)
from ggrc.models.object_document import EvidenceURL
from ggrc.models.object_owner import ... | apache-2.0 | Python |
9488be6005978195e4dc2aac020bf3c6d61d3d75 | write to several files | tlevine/map-vectorizer,NYPL/map-vectorizer,nypl-spacetime/map-vectorizer,tlevine/map-vectorizer,NYPL/map-vectorizer,nypl-spacetime/map-vectorizer | bin/compare-thresholding.py | bin/compare-thresholding.py | #!/usr/bin/env python3
import os, logging, string, subprocess, re
from itertools import product
def gimp(inputfile:'file', thresholdfile:'file',
brightness, contrast, thresholdblack, thresholdwhite,
gimp_path = '/Users/t/Applications/GIMP.app/Contents/MacOS/GIMP'):
contraststring = '(gimp-bright... | #!/usr/bin/env python3
import os, logging, string, subprocess, re
def gimp(inputfile:'file', thresholdfile:'file',
brightness, contrast, thresholdblack, thresholdwhite,
gimp_path = '/Users/t/Applications/GIMP.app/Contents/MacOS/GIMP'):
contraststring = '(gimp-brightness-contrast drawable ' + str... | mit | Python |
3fed06e611910e675adb29e2f582df73e7c2db99 | load barcode library into dictionary | dmaticzka/bctools,tzk/bctools,tzk/bctools,dmaticzka/bctools | bin/merge_pcr_duplicates.py | bin/merge_pcr_duplicates.py | #!/usr/bin/env python
tool_description = """
Merge PCR duplicates identified by random barcode. By default output is written to stdout.
Input:
* bed6 file containing alignments with fastq read-id in name field
* fasta library with fastq read-id as sequence ids
Output:
bed6 file with random barcode in name field and ... | #!/usr/bin/env python
tool_description = """
Merge PCR duplicates identified by random barcode. By default output is written to stdout.
Input:
* bed6 file containing alignments with fastq read-id in name field
* fasta library with fastq read-id as sequence ids
Output:
bed6 file with random barcode in name field and ... | apache-2.0 | Python |
d97774b575a7add8803f165fab589345729cbc4b | Add __init__, get(), and set() | internetarchive/bookserver,internetarchive/bookserver,internetarchive/bookserver | bookserver/catalog/Entry.py | bookserver/catalog/Entry.py | #!/usr/bin/env python
"""
Copyright(c)2008 Internet Archive. Software license AGPL version 3.
This file is part of bookserver.
bookserver 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, eithe... | #!/usr/bin/env python
"""
Copyright(c)2008 Internet Archive. Software license AGPL version 3.
This file is part of bookserver.
bookserver 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, eithe... | agpl-3.0 | Python |
6bcf26f2a9bb0f6ab86f2cf5f84504ce6ab8a2d1 | Disable device_lib_test due to swig-python3 incompatibility. | Moriadry/tensorflow,raymondxyang/tensorflow,tongwang01/tensorflow,zasdfgbnm/tensorflow,adamtiger/tensorflow,yanchen036/tensorflow,thjashin/tensorflow,brchiu/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,dhalleine/tensorflow,llhe/tensorflow,markslwong/tensorflow,awni/tensorflow,codrut3/tensorflow,RapidApplicati... | tensorflow/python/client/device_lib_test.py | tensorflow/python/client/device_lib_test.py | # Copyright 2016 Google Inc. 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2016 Google Inc. 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
419515701d258c5075b897537d35cf3f932830fc | Fix container_restart() integration test | esben/xd-docker,esben/xd-docker,XD-embedded/xd-docker,XD-embedded/xd-docker | tests/integration/container_restart_test.py | tests/integration/container_restart_test.py | import pytest
import os
from xd.docker.client import *
def test_restart(docker, stdout):
os.system("docker run -d --name xd-docker-test busybox:latest sleep 5")
docker.container_restart('xd-docker-test')
def test_already_stopped(docker, stdout):
os.system("docker run --name xd-docker-test busybox:lates... | import pytest
import os
from xd.docker.client import *
def test_restart(docker, stdout):
os.system("docker run -d --name xd-docker-test busybox:latest sleep 5")
docker.container_restart('xd-docker-test')
def test_already_stopped(docker, stdout):
os.system("docker run --name xd-docker-test busybox:lates... | mit | Python |
516b8323bdeb31cd3c8c4568c2a243b331ce62fa | Add project templatetag tileimage tests | liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4 | tests/projects/test_project_templatetags.py | tests/projects/test_project_templatetags.py | from datetime import timedelta
import pytest
from freezegun import freeze_time
from adhocracy4.test.helpers import render_template
def test_get_days_tag():
template = '{% load project_tags %}{% get_days days as x %}{{x}}'
assert 'a few hours left' == render_template(template, {'days': 0})
assert '1 day... | from datetime import timedelta
import pytest
from freezegun import freeze_time
from adhocracy4.test.helpers import render_template
def test_get_days_tag():
template = '{% load project_tags %}{% get_days days as x %}{{x}}'
assert 'a few hours left' == render_template(template, {'days': 0})
assert '1 day... | agpl-3.0 | Python |
9fc5deaa505a2c486c5d64bf8570d186d0536221 | Add another StoreOut test. | lucasb-eyer/DeepFried2,yobibyte/DeepFried2 | DeepFried2/tests/containers/test_StoreOut.py | DeepFried2/tests/containers/test_StoreOut.py | #!/usr/bin/env python3
import DeepFried2 as df
import unittest
import numpy as np
class TestStoreOut(unittest.TestCase):
def test(self):
net = df.StoreOut(df.Linear(2,3))
net.training()
X = np.array([[1,2],[3,4]], dtype=df.floatX)
Y = net.forward(X)
np.testing.assert_arr... | #!/usr/bin/env python3
import DeepFried2 as df
import unittest
import numpy as np
class TestStoreOut(unittest.TestCase):
def test(self):
net = df.StoreOut(df.Linear(2,3))
net.training()
X = np.array([[1,2],[3,4]], dtype=df.floatX)
Y = net.forward(X)
np.testing.assert_arr... | mit | Python |
81ef623e8edd7c3163ea580d049fefb51bf2a1cd | make rut1.py executable, add shebang, add comment about seasons | daturkel/ayto-calculator | rut1.py | rut1.py | #!/usr/bin/env python
from __future__ import division # (python 2 compatibility)
import pandas as pd
from itertools import permutations
import json
# REPLACE s1 WITH s4 TO SWITCH TO SEASON 4
from s1 import guys, girls, truth_booth, mc
pd.set_option('display.expand_frame_repr', False)
# vocab
# pairing: a guy-girl p... | from __future__ import division # (python 2 compatibility)
import pandas as pd
from itertools import permutations
import json
from s1 import guys, girls, truth_booth, mc
pd.set_option('display.expand_frame_repr', False)
# vocab
# pairing: a guy-girl pair, regardless of whether it's correct
# perfect match: a correct ... | mit | Python |
071f3bffc5a8b67ce217f5b7b1ed0f5848ec3a79 | Update documentation for row[x] | alexmilesyounger/ds_basics | s2v3.py | s2v3.py | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | mit | Python |
ecb6f388ba3c0f17fcfd22a8cafcda974e7e0fc8 | Return project ordered by date | claudiopastorini/claudiopastorini.github.io,claudiopastorini/claudiopastorini.github.io,claudiopastorini/claudiopastorini.github.io | site.py | site.py | import sys
from flask import Flask, render_template
from flask_flatpages import FlatPages, flatpages
from flask_frozen import Freezer
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md'
FREEZER_DESTINATION = 'dist'
app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
freez... | import sys
from flask import Flask, render_template
from flask_flatpages import FlatPages
from flask_frozen import Freezer
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md'
FREEZER_DESTINATION = 'dist'
app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
freezer = Freeze... | mit | Python |
3858d058c32ffcbdd99656b05ce6e4d8cd7be176 | bump version | vmalloc/gossip | gossip/__version__.py | gossip/__version__.py | __version__ = "0.3.0"
| __version__ = "0.2.0"
| bsd-3-clause | Python |
285d7a5c667d6ca847c7268c14b29e5bedbaa8e1 | test - factory #660 | pkimber/cms,pkimber/compose,pkimber/cms,pkimber/compose,pkimber/cms,pkimber/compose,pkimber/compose | holding/tests/test_view.py | holding/tests/test_view.py | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.test import TestCase
from login.tests.factories import (
TEST_PASSWORD,
UserFactory,
)
from holding.tests.factories import (
HoldingFactory,
TitleFactory,
)
class TestView(Test... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.test import TestCase
from block.tests.scenario import default_scenario_block
from login.tests.factories import TEST_PASSWORD
from login.tests.scenario import (
default_scenario_login,
get... | apache-2.0 | Python |
0659598ba0ba58243ece544de59e371482864aa9 | Fix a local rule reference | witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp,witwall/gyp | test/mac/archs/test-archs-multiarch.gyp | test/mac/archs/test-archs-multiarch.gyp | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'static_32_64',
'type': 'static_library',
'sources': [ 'my_file.cc' ],
'xcode_settings': {
'A... | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'static_32_64',
'type': 'static_library',
'sources': [ 'my_file.cc' ],
'xcode_settings': {
'A... | bsd-3-clause | Python |
d3c7405650bb7a4c7d1a7e3fa5066cf91da031c2 | Fix DB connection | pwalsh/openbudgets,pwalsh/openbudgets,moshe742/openbudgets,pwalsh/openbudgets,moshe742/openbudgets,openbudgets/openbudgets,openbudgets/openbudgets,openbudgets/openbudgets | fabfile/templates.py | fabfile/templates.py | staging_settings = """### Generated via Fabric on ${timestamp}
from ${project_name}.settings import *
ALLOWED_HOSTS = ${project_allowed_hosts}
SESSION_COOKIE_DOMAIN = '${project_cookie_domain}'
SENTRY_DSN = '${sentry_dsn}'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... | staging_settings = """### Generated via Fabric on ${timestamp}
from ${project_name}.settings import *
ALLOWED_HOSTS = ${project_allowed_hosts}
SESSION_COOKIE_DOMAIN = '${project_cookie_domain}'
SENTRY_DSN = '${sentry_dsn}'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
... | bsd-3-clause | Python |
d1ff9f4a2b4659a88c50fbaebffc92e9c91d6b98 | bump version number | bashu/django-fancybox,bashu/django-fancybox | fancybox/__init__.py | fancybox/__init__.py | __version__ = "0.1.5"
| __version__ = "0.1.4"
| bsd-3-clause | Python |
14546b0ba1dd7f5a9ea623fde85737fa95bd2843 | Add teardown of integration test | thiderman/network-kitten | test/integration/test_node_propagation.py | test/integration/test_node_propagation.py | from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = Kitten... | from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = Kitten... | mit | Python |
5df3cacc256e8fca891bb3b061402fc32e9e5e2c | Add TODO. | ohsu-qin/qipipe | qipipe/qiprofile/modeling.py | qipipe/qiprofile/modeling.py | """
This module updates the qiprofile database modeling information
from a XNAT experiment.
"""
class ModelingError(Exception):
pass
def update(session, resource):
"""
Updates the modeling content for the given qiprofile session
database object from the given XNAT modeling resource object.
:para... | """
This module updates the qiprofile database modeling information
from a XNAT experiment.
"""
class ModelingError(Exception):
pass
def update(session, resource):
"""
Updates the modeling content for the given qiprofile session
database object from the given XNAT modeling resource object.
:para... | bsd-2-clause | Python |
b6ddd64d6b3fbcaae7a6368045b9b0df5e2f4ead | Fix test_tiling | niboshi/chainer,ktnyt/chainer,hvy/chainer,benob/chainer,cupy/cupy,aonotas/chainer,keisuke-umezawa/chainer,truongdq/chainer,benob/chainer,AlpacaDB/chainer,cupy/cupy,wkentaro/chainer,wkentaro/chainer,kikusu/chainer,chainer/chainer,kiyukuta/chainer,sinhrks/chainer,okuta/chainer,chainer/chainer,hvy/chainer,keisuke-umezawa/... | tests/cupy_tests/manipulation_tests/test_tiling.py | tests/cupy_tests/manipulation_tests/test_tiling.py | import unittest
from cupy import testing
@testing.parameterize(
{'repeats': 0, 'axis': None},
{'repeats': 2, 'axis': None},
{'repeats': 2, 'axis': 1},
{'repeats': 2, 'axis': -1},
{'repeats': [0, 0, 0], 'axis': 1},
{'repeats': [1, 2, 3], 'axis': 1},
{'repeats': [1, 2, 3], 'axis': -2},
)
@t... | import unittest
import cupy
from cupy import testing
@testing.parameterize(
{'repeats': 0, 'axis': None},
{'repeats': 2, 'axis': None},
{'repeats': 2, 'axis': 1},
{'repeats': 2, 'axis': -1},
{'repeats': [0, 0, 0], 'axis': 1},
{'repeats': [1, 2, 3], 'axis': 1},
{'repeats': [1, 2, 3], 'axis... | mit | Python |
3faf15705705c4868fcf6db981aef4d5edc80bbf | Update with sorting/filtering. | roryk/junkdrawer,roryk/junkdrawer | radar-convert-annotations.py | radar-convert-annotations.py | import pandas as pd
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("original")
parser.add_argument("converted")
args = parser.parse_args()
original = pd.read_csv(args.original, delimiter="\t", dtype=str)
original.columns = ['chromos... | import pandas as pd
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("original")
parser.add_argument("converted")
args = parser.parse_args()
original = pd.read_csv(args.original, delimiter="\t")
original.columns = ['chromosome', 'star... | mit | Python |
3c5904d7bb5069cf5e756e92c2aca832c16a81e6 | Make sure cache is initialized | joequery/joequery.me,joequery/joequery.me,joequery/joequery.me,joequery/joequery.me | joequery/screenx/screenx.py | joequery/screenx/screenx.py | # Screenx functions and variables
from joequery.settings import UWSGI_ENV
import time
import requests
import json
if UWSGI_ENV:
import uwsgi
else:
SCREENX_CACHE = {}
SCREENX_API_CHECK_INTERVAL = 90
# Use ghetto caching if working locally with werkzeug, use UWSGI caching
# if this app is running under UWSGI
... | # Screenx functions and variables
from joequery.settings import UWSGI_ENV
import time
import requests
import json
if UWSGI_ENV:
import uwsgi
else:
SCREENX_CACHE = {}
SCREENX_API_CHECK_INTERVAL = 90
# Use ghetto caching if working locally with werkzeug, use UWSGI caching
# if this app is running under UWSGI
... | mit | Python |
58976f0e63376d056c482b3cd0e103c0a0cccb9e | Change single quotes to double | kefir500/ghstats | test.py | test.py | #!/usr/bin/env python
import unittest
import ghstats
class TestStats(unittest.TestCase):
def test_cli(self):
"""
Test command line arguments.
"""
count = ghstats.main_cli(["kefir500/apk-icon-editor", "-q", "-d"])
self.assertTrue(count > 0)
def test_releases(self):
... | #!/usr/bin/env python
import unittest
import ghstats
class TestStats(unittest.TestCase):
def test_cli(self):
"""
Test command line arguments.
"""
count = ghstats.main_cli(["kefir500/apk-icon-editor", "-q", "-d"])
self.assertTrue(count > 0)
def test_releases(self):
... | mit | Python |
e23fb8f1aedfb35ed0834a2aea32881145cc9225 | exit if REANA_SERVER_URL is not set | reanahub/reana-client,reanahub/reana-client | reana_client/cli/__init__.py | reana_client/cli/__init__.py | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later... | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later... | mit | Python |
3e24e56e0612dab58aaadeaeb3a6bee8447a2402 | add syspath | rraid/navi-v2,rraid/navi-v2,rraid/navi-v2,rraid/navi-v2 | examples/testSensors.py | examples/testSensors.py | import sys
sys.path.append("../perception")
import perception
def displayDistribution(name, grid):
import matplotlib.pyplot as plt
from matplotlib import cm
plt.imshow(name, np.flipud(grid) * 255.0, cmap=cm.gray)
plt.show()
values = [50,50,50,50,50,50,50,50,50]
grid = perception.getSonarDistribution(values... | import perception
def displayDistribution(grid):
import matplotlib.pyplot as plt
from matplotlib import cm
plt.imshow(grid, cmap=cm.gray)
plt.show()
values = [50,50,50,50,50,50,50,50,50]
grid = perception.getSonarDistribution(values)
#grid = perception.getLidarDistribution(values)
#grid = perception.getZED... | mit | Python |
4218411961eb7aff00e68db83270d1c02ce74b44 | test updates | c4fcm/MediaCloud-API-Client | test.py | test.py | #! /usr/bin/env python
import unittest
import logging
import sys
import mediacloud.test.apitest as api
import mediacloud.test.apitopictest as topic
import mediacloud.test.storagetest as storage
test_classes = [
api.ApiBigQueryTest,
api.ApiStoriesWordMatrixTest,
api.ApiMediaHealthTest, api.AdminApiMediaTes... | #! /usr/bin/env python
import unittest
import logging
import sys
import mediacloud.test.apitest as api
import mediacloud.test.apitopictest as topic
import mediacloud.test.storagetest as storage
test_classes = [
api.ApiBigQueryTest,
api.ApiStoriesWordMatrixTest,
api.ApiMediaHealthTest, api.AdminApiMediaTes... | mit | Python |
2701811f9e7d1c723e02de5d63457b0c68dfef5b | Remove debugging statements | initios/flake8-junit-report | junit_conversor/__init__.py | junit_conversor/__init__.py | import os
import xml.etree.cElementTree as ET
def _parse(file_name):
lines = tuple(open(file_name, 'r'))
parsed = []
for line in lines:
splitted = line.split(":")
parsed.append({
'file': splitted[0].strip(),
'line': splitted[1].strip(),
'col': splitted[... | import os
import xml.etree.cElementTree as ET
def _parse(file_name):
lines = tuple(open(file_name, 'r'))
parsed = []
for line in lines:
print("antes")
print(file_name)
print(line)
splitted = line.split(":")
parsed.append({
'file': splitted[0].strip(),
... | bsd-3-clause | Python |
a38f3af688b438b7266747243e07a344d9afad5b | Bump to version 2.0.7 | jrief/djangocms-cascade,jrief/djangocms-cascade,jrief/djangocms-cascade | cmsplugin_cascade/__init__.py | cmsplugin_cascade/__init__.py | """
See PEP 386 (https://www.python.org/dev/peps/pep-0386/)
Release logic:
1. Remove ".devX" from __version__ (below)
2. Remove ".devX" latest version in docs/source/changelog.rst
3. git add cmsplugin_cascade/__init__.py docs/source/changelog.rst
4. git commit -m 'Bump to <version>'
5. git tag <version>
6. git p... | """
See PEP 386 (https://www.python.org/dev/peps/pep-0386/)
Release logic:
1. Remove ".devX" from __version__ (below)
2. Remove ".devX" latest version in docs/source/changelog.rst
3. git add cmsplugin_cascade/__init__.py docs/source/changelog.rst
4. git commit -m 'Bump to <version>'
5. git tag <version>
6. git p... | mit | Python |
d159f8201b9d9aeafd24f07a9e39855fc537182d | Add match_distance flag to load_data_frame() | JungeAlexander/cocoscore | cocoscore/tools/data_tools.py | cocoscore/tools/data_tools.py | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True, match_distance=False):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data... | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data frame will be sorted ... | mit | Python |
13fdf06b0a1587f8562be3e62a8a4dbba5a14c0e | Change test directory to tests | czchen/license-checker | test.py | test.py | #!/usr/bin/env python3
import unittest
if __name__ == '__main__':
testsuite = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=1).run(testsuite)
| #!/usr/bin/env python3
import unittest
if __name__ == '__main__':
testsuite = unittest.TestLoader().discover('test')
unittest.TextTestRunner(verbosity=1).run(testsuite)
| mit | Python |
c358276471cb0e3b39840b1838285628361482b7 | Update the test to match changes to README.md | avinoamr/argcommand | test.py | test.py | import argcommand
import argparse
##
class Say( argcommand.Command ):
""" Prints a message to the screen """
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how ma... | import argcommand
import argparse
##
class Say( argcommand.Command ):
what = argcommand.Argument( "WORD", default = "Something", help = "the text you want to print" )
times = argcommand.Argument( "--times", "-t", type = int, default = 1, metavar = "T", help = "how many times you want to repeat the text" )
... | mit | Python |
93514a28c005ce92ea730323ca1beef78bb4864b | Make modules uninstallable | OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil | l10n_br_sale/__openerp__.py | l10n_br_sale/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Sale',
'category': 'Localisation',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'http://... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization Sale',
'category': 'Localisation',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'website': 'http://... | agpl-3.0 | Python |
26b62cb50c613675a7a9ff6f4689328f327594a3 | fix port casting | sevaivanov/various,sevaivanov/various,sevaivanov/various,sevaivanov/various,sevaivanov/various,sevaivanov/various | python/multicast_recv.py | python/multicast_recv.py | #!/usr/bin/python
import sys, socket, struct, msgpack
if __name__ == "__main__":
group = sys.argv[1] if sys.argv[1] else '239.192.0.1' # organization wide
port = sys.argv[2] if sys.argv[2] else 2222
source = '' # all
if (len(sys.argv) > 3):
source = sys.argv[3]
print('capturing with grou... | #!/usr/bin/python
import sys, socket, struct, msgpack
if __name__ == "__main__":
group = sys.argv[1] if sys.argv[1] else '239.192.0.1' # organization wide
port = sys.argv[2] if sys.argv[2] else 2222
source = '' # all
if (len(sys.argv) > 3):
source = sys.argv[3]
print('capturing with grou... | mit | Python |
d6dcd5ede1004b4f3dfbaba09e46a6728e8287a7 | Use the REST client get_or_create helper function. | ohsu-qin/qipipe | qipipe/qiprofile/sync.py | qipipe/qiprofile/sync.py | from qiprofile_rest_client.helpers import database
from qiprofile_rest_client.model.subject import Subject
from qiprofile_rest_client.model.imaging import Session
from . import (clinical, imaging)
def sync_session(project, collection, subject, session, filename):
"""
Updates the qiprofile database from the XN... | from qiprofile_rest_client.helpers import database
from qiprofile_rest_client.model.subject import Subject
from . import (clinical, imaging)
def sync_session(project, collection, subject, session, filename):
"""
Updates the qiprofile database from the XNAT database content for
the given session.
:par... | bsd-2-clause | Python |
51a11d008ab55188b61d8bbe7db13bf39c343f05 | add accessor for grid | amaxwell/datatank_py | DTTriangularMesh2D.py | DTTriangularMesh2D.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
from DTRegion2D import DTRegion2D
from DTMask import DTMask
import numpy as np
class DTTriangularMesh2D(object):
"""2D triangular mesh object."""
def __init__(self, grid, values):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
from DTRegion2D import DTRegion2D
from DTMask import DTMask
import numpy as np
class DTTriangularMesh2D(object):
"""2D triangular mesh object."""
def __init__(self, grid, values):
... | bsd-3-clause | Python |
7da08fb264c968f795a2d1208c6d5c392d8dfa29 | Split playthrough test into multiple tests. | deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel | open_spiel/integration_tests/playthrough_test.py | open_spiel/integration_tests/playthrough_test.py | # Copyright 2019 DeepMind Technologies Ltd. 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2019 DeepMind Technologies Ltd. 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 | Python |
24c83c6a7a1981184545a72b3691a29121d81050 | Fix load of compiled lz4 module | sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs,sergey-dryabzhinsky/dedupsqlfs | lib-dynload/lz4/__init__.py | lib-dynload/lz4/__init__.py | import sys
import os
p1, p2 = sys.version_info[:2]
curpath = os.path.abspath( sys.argv[0] )
if os.path.islink(curpath):
curpath = os.readlink(curpath)
currentdir = os.path.dirname( curpath )
build_dir = os.path.abspath( os.path.join(currentdir, "lib-dynload", "lz4", "build") )
if not os.path.isdir(build_dir):
... | import sys
import os
p1, p2 = sys.version_info[:2]
curpath = os.path.abspath( sys.argv[0] )
if os.path.islink(curpath):
curpath = os.readlink(curpath)
currentdir = os.path.dirname( curpath )
build_dir = os.path.abspath( os.path.join(currentdir, "lib-dynload", "lz4", "build") )
if not os.path.isdir(build_dir):
... | mit | Python |
21791ced7c0730b31530b07d07fb43a8beb1d6de | make it auto_install. This way users installing the ecommerce will always have a default payment method. | apocalypsebg/odoo,jpshort/odoo,tinkerthaler/odoo,fuselock/odoo,lgscofield/odoo,Noviat/odoo,synconics/odoo,windedge/odoo,cysnake4713/odoo,shivam1111/odoo,fdvarela/odoo8,Nick-OpusVL/odoo,lightcn/odoo,ChanduERP/odoo,ramitalat/odoo,andreparames/odoo,Kilhog/odoo,oihane/odoo,sergio-incaser/odoo,x111ong/odoo,chiragjogi/odoo,t... | addons/payment_acquirer_transfer/__openerp__.py | addons/payment_acquirer_transfer/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Transfer Payment Acquirer',
'category': 'Hidden',
'summary': 'Payment Acquirer: Transfer Implementation',
'version': '1.0',
'description': """Transfer Payment Acquirer""",
'author': 'OpenERP SA',
'depends': ['payment_acquirer'],
'data': [
'view... | # -*- coding: utf-8 -*-
{
'name': 'Transfer Payment Acquirer',
'category': 'Hidden',
'summary': 'Payment Acquirer: Transfer Implementation',
'version': '1.0',
'description': """Transfer Payment Acquirer""",
'author': 'OpenERP SA',
'depends': ['payment_acquirer'],
'data': [
'view... | agpl-3.0 | Python |
7dc745972bafbd4e24b8cd948f719ce0acb30256 | Fix for when rate limit headers are empty | housecanary/hc-api-python | housecanary/utilities.py | housecanary/utilities.py | """Utility functions for hc-api-python"""
from datetime import datetime
def get_readable_time_string(seconds):
"""Returns human readable string from number of seconds"""
seconds = int(seconds)
minutes = seconds / 60
seconds = seconds % 60
hours = minutes / 60
minutes = minutes % 60
days = ... | """Utility functions for hc-api-python"""
from datetime import datetime
def get_readable_time_string(seconds):
"""Returns human readable string from number of seconds"""
seconds = int(seconds)
minutes = seconds / 60
seconds = seconds % 60
hours = minutes / 60
minutes = minutes % 60
days = ... | mit | Python |
795503506ec985080c1f923038a04529df5ab868 | upgrade reveal to 3.3.0 | humrochagf/flask-reveal,humrochagf/flask-reveal | flask_reveal/tools/commands/installreveal.py | flask_reveal/tools/commands/installreveal.py | # -*- coding: utf-8 -*-
import argparse
import os
from urllib import request
import flask_reveal
from flask_reveal.tools.helpers import extract_file, move_and_replace
class InstallReveal(argparse.ArgumentParser):
info = ({
'prog': 'installreveal',
'description': 'installs Reveal.js',
})
... | # -*- coding: utf-8 -*-
import argparse
import os
from urllib import request
import flask_reveal
from flask_reveal.tools.helpers import extract_file, move_and_replace
class InstallReveal(argparse.ArgumentParser):
info = ({
'prog': 'installreveal',
'description': 'installs Reveal.js',
})
... | mit | Python |
73ea4fc620fb1888774553388e4b03369dc62d5f | Revert "bump travis" | michelesr/coding-events,joseihf/coding-events,joseihf/coding-events,joseihf/coding-events,ioana-chiorean/coding-events,ioana-chiorean/coding-events,codeeu/coding-events,joseihf/coding-events,codeeu/coding-events,joseihf/coding-events,codeeu/coding-events,ioana-chiorean/coding-events,michelesr/coding-events,ercchy/codin... | codeweekeu/settings_travis.py | codeweekeu/settings_travis.py | from settings import *
USE_TZ = False
| from settings import *
USE_TZ = False
SOUTH_TESTS_MIGRATE = True | mit | Python |
f3b0c930d3e1f81efe79fee65014517c9cea8a05 | Add imports to __init__.py | lann/python-oauth-client | oauth_client/__init__.py | oauth_client/__init__.py | import adapter
import request
import signing
import util
| mit | Python | |
e952aa890ee477ceff4d29416af8812971d586f2 | add versions up to 1.24.1 (#23365) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/chapel/package.py | var/spack/repos/builtin/packages/chapel/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Chapel(AutotoolsPackage):
"""Chapel is a modern programming language that is parallel, pro... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Chapel(AutotoolsPackage):
"""Chapel is a modern programming language that is parallel, pro... | lgpl-2.1 | Python |
74bb15285baa765077ecc3b6fc57fd6bf0f74971 | Update to 0.13.1 (#7419) | mfherbst/spack,EmreAtes/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,tmerrick1/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,EmreAtes/spack,LLNL/spack,mfherbst/spack,matthiasdiener/spack,EmreAtes/spack,EmreAtes/spack,krafczyk/spack,LLNL/spack,mfherbst/spack,matthiasdiener/spack,krafczyk/spack,iulia... | var/spack/repos/builtin/packages/json-c/package.py | var/spack/repos/builtin/packages/json-c/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
920e2fbb7e99c17dbe8d5b71e9c9b26a718ca444 | Make (pre|post)_migrate scripts for the index table only if working on 'transient'. | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ideascube/search/apps.py | ideascube/search/apps.py | from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
if (kwargs['using'] == 'transient' and isinstance(sender, SearchConfig)):
create_index_table(force=True)
def reinde... | from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
if isinstance(sender, SearchConfig):
create_index_table(force=True)
def reindex(sender, **kwargs):
if isinstanc... | agpl-3.0 | Python |
538e915bf7c436c344295c11673e8ac0f4747a49 | allow ordering | Fresnoy/kart,Fresnoy/kart | school/api.py | school/api.py | from tastypie import fields
from tastypie.resources import ModelResource
from tastypie.resources import ALL, ALL_WITH_RELATIONS
from people.api import ArtistResource
from .models import Promotion, Student
class PromotionResource(ModelResource):
class Meta:
queryset = Promotion.objects.all()
resour... | from tastypie import fields
from tastypie.resources import ModelResource
from tastypie.resources import ALL, ALL_WITH_RELATIONS
from people.api import ArtistResource
from .models import Promotion, Student
class PromotionResource(ModelResource):
class Meta:
queryset = Promotion.objects.all()
resour... | agpl-3.0 | Python |
5d192ed46c0ca76d2dd3aa25f7fac5ad7b61ad3e | Make the archive dir a positional argument | t-miyamae/teuthology,dreamhost/teuthology,ktdreyer/teuthology,SUSE/teuthology,tchaikov/teuthology,ivotron/teuthology,ktdreyer/teuthology,t-miyamae/teuthology,SUSE/teuthology,dmick/teuthology,yghannam/teuthology,SUSE/teuthology,robbat2/teuthology,yghannam/teuthology,michaelsevilla/teuthology,dmick/teuthology,ceph/teutho... | scripts/ls.py | scripts/ls.py | import argparse
import teuthology.ls
def main():
teuthology.ls.main(parse_args())
def parse_args():
parser = argparse.ArgumentParser(description='List teuthology job results')
parser.add_argument(
'archive_dir',
metavar='DIR',
default='.',
help='path under which to archiv... | import argparse
import teuthology.ls
def main():
teuthology.ls.main(parse_args())
def parse_args():
parser = argparse.ArgumentParser(description='List teuthology job results')
parser.add_argument(
'--archive-dir',
metavar='DIR',
default='.',
help='path under which to arch... | mit | Python |
8545423373dee1f4b801375922b67bc2417cb426 | Simplify the code for downloading resources. | 0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurra... | ooni/resources/update.py | ooni/resources/update.py | import os
from twisted.internet import defer
from twisted.web.client import downloadPage
from ooni.settings import config
from ooni.resources import inputs, geoip
@defer.inlineCallbacks
def download_resource(resources):
for filename, resource in resources.items():
print "Downloading %s" % filename
... | import os
from twisted.internet import reactor, defer, protocol
from twisted.web.client import RedirectAgent, Agent
from ooni.settings import config
from ooni.resources import inputs, geoip
agent = RedirectAgent(Agent(reactor))
class SaveToFile(protocol.Protocol):
def __init__(self, finished, filesize, filenam... | bsd-2-clause | Python |
5b83923aa8ff858b4fe4995ef34a5e03b5bdfbdb | add multiline to migration (#2815) | all-of-us/raw-data-repository,all-of-us/raw-data-repository,all-of-us/raw-data-repository | rdr_service/alembic/versions/8ce9eccbe313_adding_origin_set_member.py | rdr_service/alembic/versions/8ce9eccbe313_adding_origin_set_member.py | """adding_origin_set_member
Revision ID: 8ce9eccbe313
Revises: 978d12edb6c5, afb0333cb471
Create Date: 2022-01-19 09:49:43.148943
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus
f... | """adding_origin_set_member
Revision ID: 8ce9eccbe313
Revises: 978d12edb6c5, afb0333cb471
Create Date: 2022-01-19 09:49:43.148943
"""
from alembic import op
import sqlalchemy as sa
import rdr_service.model.utils
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus
f... | bsd-3-clause | Python |
c3ca0819789186b883f25bf9145da5b13f33e685 | bump version to include new static files in dist | flasgger/flasgger,flasgger/flasgger,lorehov/flasgger,rochacbruno/flasgger,talitarossari/flasgger,Navisite/flasgger,rochacbruno/flasgger,talitarossari/flasgger,Navisite/flasgger,rochacbruno/flasgger,Navisite/flasgger,lorehov/flasgger,lorehov/flasgger,lorehov/flasgger,talitarossari/flasgger,Navisite/flasgger,flasgger/fla... | flasgger/__init__.py | flasgger/__init__.py |
__version__ = '0.3.3'
__author__ = 'Bruno Rocha'
__email__ = 'rochacbruno@gmail.com'
from .base import Swagger # noqa
|
__version__ = '0.3.2'
__author__ = 'Bruno Rocha'
__email__ = 'rochacbruno@gmail.com'
from .base import Swagger # noqa
| mit | Python |
360efe51bc45f189c235bed6b2b7bfdd4fd1bfbd | Reimplement using bottle and add 3 endpoints | sorgerlab/indra,sorgerlab/indra,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,johnbachman/indra,johnbachman/indra,pvtodorov/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/indra | flask-restful/api.py | flask-restful/api.py | import json
from bottle import route, run, request, post, default_app
from indra import trips, reach, bel, biopax
from indra.statements import *
@route('/trips/process_text', method='POST')
def trips_process_text():
body = json.load(request.body)
text = body.get('text')
tp = trips.process_text(text)
i... | from flask import Flask, request
from flask_restful import Resource, Api, reqparse
from indra import reach
from indra.statements import *
import json
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('txt')
parser.add_argument('json')
class InputText(Resource):
def post(se... | bsd-2-clause | Python |
382cde577fe0908f253d4ccbffc67e537afade7a | fix paths issue | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | falmer/frontend/urls.py | falmer/frontend/urls.py | from django.urls import path, re_path
from .views import application_serve, FrontendAPI
urlpatterns = [
path('frontend/', FrontendAPI.as_view()),
re_path(r'^.*/$', application_serve),
]
| from django.urls import path
from .views import application_serve, FrontendAPI
urlpatterns = [
path('frontend/', FrontendAPI.as_view()),
path('<path:path>', application_serve),
]
| mit | Python |
075c06488a6ddb73a0888394bf1468d67cd3756a | test commit heroku | codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator | farmsList/public/api.py | farmsList/public/api.py | import jsonpickle
from flask import Blueprint
from farmsList.public.models import Parcel
blueprint = Blueprint('api', __name__, url_prefix='/api',
static_folder="../static")
@blueprint.route("/parcel/", methods=["GET", "POST"])
def api_parcel():
print "HELLO"
parcelData = Parcel.query.filter(Parcel.listedToP... | import jsonpickle
from flask import Blueprint
from farmsList.public.models import Parcel
blueprint = Blueprint('api', __name__, url_prefix='/api',
static_folder="../static")
@blueprint.route("/parcel/", methods=["GET", "POST"])
def api_parcel():
parcelData = Parcel.query.filter(Parcel.listedToPublic == True).... | bsd-3-clause | Python |
d38e1d2904ab19b9773b9f861317a9156bf8b333 | test function should now return a tuple with status, output and results. | 3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox | testing/test_sct_straighten_spinalcord.py | testing/test_sct_straighten_spinalcord.py | #!/usr/bin/env python
#########################################################################################
#
# Test function for sct_sctraighten_spinalcord script
#
# replace the shell test script in sct 1.0
#
# ---------------------------------------------------------------------------------------
# Copyright (... | #!/usr/bin/env python
#########################################################################################
#
# Test function for sct_sctraighten_spinalcord script
#
# replace the shell test script in sct 1.0
#
# ---------------------------------------------------------------------------------------
# Copyright (... | mit | Python |
888b52fd4bd60b9c0215689f151ae250ed96de8a | Fix for micropython | CalebBell/fluids | fluids/vectorized.py | fluids/vectorized.py | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2017, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2017, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | mit | Python |
f157305b1032651a8a35df7f2b3fdd4d45343988 | Use less confusing function names (test_open_readonly may be taken for a test which checks for an exception which is raised when we write to a readonly file or filesystem). | tv42/fs,nailor/filesystem | fs/test/test_open.py | fs/test/test_open.py | from __future__ import with_statement
from nose.tools import (
eq_ as eq,
)
from fs.test.util import (
assert_raises,
maketemp,
)
import errno
import os
import fs
def test_open_nonexisting():
p = fs.path(u'/does-not-exist')
e = assert_raises(IOError, p.open)
eq(e.errno, errno.ENOENT... | from __future__ import with_statement
from nose.tools import (
eq_ as eq,
)
from fs.test.util import (
assert_raises,
maketemp,
)
import errno
import os
import fs
def test_open_nonexisting():
p = fs.path(u'/does-not-exist')
e = assert_raises(IOError, p.open)
eq(e.errno, errno.ENOENT... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.