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
3a8af1b319b2eb0daac30bbaa0b0a0c8402d0f4d
Bump data schema version :disappointed:
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/export/const.py
corehq/apps/export/const.py
""" Some of these constants correspond to constants set in corehq/apps/export/static/export/js/const.js so if changing a value, ensure that both places reflect the change """ from couchexport.deid import ( deid_ID, deid_date ) from corehq.apps.export.transforms import ( case_id_to_case_name, user_id_to_...
""" Some of these constants correspond to constants set in corehq/apps/export/static/export/js/const.js so if changing a value, ensure that both places reflect the change """ from couchexport.deid import ( deid_ID, deid_date ) from corehq.apps.export.transforms import ( case_id_to_case_name, user_id_to_...
bsd-3-clause
Python
b0cdfce4d512ec307561bd225935d064b68a3507
change initial text as unicode
longjie/chainer-char-rnn,longjie/chainer-char-rnn
sample.py
sample.py
#%% import time import math import sys import argparse import cPickle as pickle import numpy as np from chainer import cuda, Variable, FunctionSet import chainer.functions as F from CharRNN import CharRNN, make_initial_state #%% arguments parser = argparse.ArgumentParser() parser.add_argument('--model', type=st...
#%% import time import math import sys import argparse import cPickle as pickle import numpy as np from chainer import cuda, Variable, FunctionSet import chainer.functions as F from CharRNN import CharRNN, make_initial_state #%% arguments parser = argparse.ArgumentParser() parser.add_argument('--model', type=st...
mit
Python
e5d253bb8f739845823e5d37106488afea3dadeb
save to 'dyn' too, which is where my feeds exist now. publishing to both for now, but I'll put in a redirect eventually.
tedder/aws-release-notes-rss
scrape.py
scrape.py
#!/usr/bin/env python3 # coding: utf-8 # MIT license # (see: http://www.opensource.org/licenses/mit-license.php) # # Copyright (c) 2014 Ted Timmons, ted@timmons.me # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to d...
#!/usr/bin/env python3 # coding: utf-8 # MIT license # (see: http://www.opensource.org/licenses/mit-license.php) # # Copyright (c) 2014 Ted Timmons, ted@timmons.me # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to d...
mit
Python
9697509a745fd2b99d946c8a02334be827084ad2
Include actual item link.
tedder/meh-rss
scrape.py
scrape.py
#!/usr/bin/python import boto import requests from lxml import html import PyRSS2Gen import datetime import StringIO LINK = "https://meh.com/" # probably clicktrack this later. page = requests.get('https://meh.com/') tree = html.fromstring(page.text) feat = tree.xpath('//section[@class="features"]/h2/text()')[0] pr...
#!/usr/bin/python import boto import requests from lxml import html import PyRSS2Gen import datetime import StringIO LINK = "https://meh.com/" # probably clicktrack this later. page = requests.get('https://meh.com/') tree = html.fromstring(page.text) feat = tree.xpath('//section[@class="features"]/h2/text()')[0] pr...
mit
Python
c3d839263311f2406ae19b0d75c1b9062066b48c
add test route
NilsJPWerner/scgbot,NilsJPWerner/scgbot
server.py
server.py
import os import time from datetime import datetime import atexit from flask import Flask, request, Response from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.interval import IntervalTrigger import slack import sheets app = Flask(__name__) POST_UPDATE_MESSAGE = False UPDATE...
import os import time from datetime import datetime import atexit from flask import Flask, request, Response from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.interval import IntervalTrigger import slack import sheets app = Flask(__name__) UPDATE_MESSAGE_START_DATE = dateti...
mit
Python
7dfe172612073cef86ea6920d5a05406266ca147
Initialize the server.py with index()
devops-foxtrot-s17/inventory,devops-foxtrot-s17/inventory
server.py
server.py
from flask import Flask # Create Flask application app = Flask(__name__) @app.route('/') def index(): """ Intro page of the inventory API This method will only return some welcome words. Returns: response: welcome words in json format and status 200 Todo: * Finish the implementations. * Write t...
mit
Python
cab029b1f78be59df40c1011c01ba220f546d086
Rename MyServerProtocol -> ChatProtocol
ajdavis/asyncio-chat-example,ajdavis/asyncio-chat-example
server.py
server.py
import asyncio import logging from autobahn.asyncio.websocket import (WebSocketServerProtocol, WebSocketServerFactory) clients = set() logging.basicConfig(level=logging.INFO) class ChatProtocol(WebSocketServerProtocol): def onConnect(self, request): clients.add(se...
import asyncio import logging from autobahn.asyncio.websocket import (WebSocketServerProtocol, WebSocketServerFactory) clients = set() logging.basicConfig(level=logging.INFO) class MyServerProtocol(WebSocketServerProtocol): def onConnect(self, request): clients.ad...
unlicense
Python
1406a559f93b850eb2de624e34f7fe7b23863da8
remove test in smbool constructor, validated with 2000 jm.
theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver
smbool.py
smbool.py
# super metroid boolean class SMBool: __slots__ = ('bool', 'difficulty', 'knows', 'items') def __init__(self, boolean, difficulty=0, knows=[], items=[]): self.bool = boolean self.difficulty = difficulty self.knows = knows self.items = items def __repr__(self): # to d...
# super metroid boolean class SMBool: __slots__ = ('bool', 'difficulty', 'knows', 'items') def __init__(self, bool, difficulty=0, knows=[], items=[]): # to avoid storing an SMBool as the bool attribute of the SMBool self.bool = bool == True self.difficulty = difficulty self.knows...
mit
Python
dc2d79a22d474e9880cfbdbd785b50df18e4a2c5
change read to pdu
awangga/spy,awangga/spy
smspdu.py
smspdu.py
#!/usr/bin/env python """ sms.py - Used to send txt messages. """ import config import serial from messaging.sms import SmsSubmit class Smspdu(object): def __init__(self, recipient=config.recipient, message=config.message): self.open() self.recipient = recipient self.content = message ...
#!/usr/bin/env python """ sms.py - Used to send txt messages. """ import config import serial from messaging.sms import SmsSubmit class Smspdu(object): def __init__(self, recipient=config.recipient, message=config.message): self.open() self.recipient = recipient self.content = message ...
agpl-3.0
Python
09fe8731e733081fff2595b04db63b93d0f4b91b
Add url assignment to each crawled dataset item
MaxLikelihood/CODE
spider.py
spider.py
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import Selector from dataset import DatasetItem class DatasetSpider(CrawlSpider): name = 'dataset' allowed_domains = ['data.gc.ca/data/en'] start_urls = ['http://data....
from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import Selector from dataset import DatasetItem class DatasetSpider(CrawlSpider): name = 'dataset' allowed_domains = ['data.gc.ca/data/en'] start_urls = ['http://data....
mit
Python
a23c1606aa5258400fb70cfee7abc265982c98a1
Make documentation more numpy-like
unode/jug,luispedro/jug,luispedro/jug,unode/jug
jug/mapreduce.py
jug/mapreduce.py
# -*- coding: utf-8 -*- # Copyright (C) 2008-2010, Luis Pedro Coelho <lpc@cmu.edu> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # 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 withou...
# -*- coding: utf-8 -*- # Copyright (C) 2008-2010, Luis Pedro Coelho <lpc@cmu.edu> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # 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 withou...
mit
Python
94d66aaeb0e2f6b82cfbe5ccaf9621f3f2195999
Fix __author__ email.
BinetReseau/kaoz,BinetReseau/kaoz
kaoz/__init__.py
kaoz/__init__.py
# -*- coding: utf-8 -*- # Copyright © 2011-2012 Binet Réseau # See the LICENCE file for more informations __version__ = '0.1.0' __author__ = "Binet Réseau <br@eleves.polytechnique.fr>"
# -*- coding: utf-8 -*- # Copyright © 2011-2012 Binet Réseau # See the LICENCE file for more informations __version__ = '0.1.0' __author__ = "Binet Réseau <br@frankiz.net>"
mit
Python
e9b2676ec179397bea251e2af9f46babcf421334
Set version to 0.3.1
Alignak-monitoring-contrib/alignak-backend-client,Alignak-monitoring-contrib/alignak-backend-client,Alignak-monitoring-contrib/alignakbackend-api-client,Alignak-monitoring-contrib/alignakbackend-api-client
alignak_backend_client/__init__.py
alignak_backend_client/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 3, 1) __application__ = u"Alignak_Backend_client" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak REST backend """ # Application manifest VERSION = (0, 3, 0) __application__ = u"Alignak_Backend_client" __version__ = '.'.join((str(each) for each in VERSION[:4])) __author__ = u"Alignak team" __copyright__ = u"(c) 2015 - %s" % __author__ __license__ = u"GNU ...
agpl-3.0
Python
381aaf4ebc6c01e63133383e586bcc96f86e5a08
Update production.py
wemake-services/wemake-django-template,wemake-services/wemake-django-template
{{cookiecutter.project_name}}/server/settings/environments/production.py
{{cookiecutter.project_name}}/server/settings/environments/production.py
# -*- coding: utf-8 -*- """ This file contains all the settings used in production. This file is required and if development.py is present these values are overridden. """ from server.settings.components import config # Production flags: # https://docs.djangoproject.com/en/2.2/howto/deployment/ DEBUG = False ALLO...
# -*- coding: utf-8 -*- """ This file contains all the settings used in production. This file is required and if development.py is present these values are overridden. """ from server.settings.components import config # Production flags: # https://docs.djangoproject.com/en/2.2/howto/deployment/ DEBUG = False ALLO...
mit
Python
dc10309d8bf903dd85241cf5f7b77873c16c3426
Generalize BaseClient default building
leb2dg/osf.io,saradbowman/osf.io,baylee-d/osf.io,icereval/osf.io,Johnetordoff/osf.io,adlius/osf.io,Nesiehr/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,adlius/osf.io,chennan47/osf.io,laurenrevere/osf.io,brianjgeiger/osf.io,felliott/osf.io,binoculars/osf.io,adlius/osf.io,acshi/osf.io,Johnetordoff/osf.io,pattisdr/osf.io...
website/util/client.py
website/util/client.py
# -*- coding: utf-8 -*- import os import itertools import furl import requests from framework.exceptions import HTTPError class BaseClient(object): @property def _auth(self): return None @property def _default_headers(self): return {} @property def _default_params(self): ...
# -*- coding: utf-8 -*- import os import itertools import furl import requests from framework.exceptions import HTTPError class BaseClient(object): @property def _auth(self): return None @property def _default_headers(self): return {} def _make_request(self, method, url, para...
apache-2.0
Python
76ea6f83cef25dc78011020aa0b88a0e54d126f5
Save z-score statistics for recovering data.
lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment
analysis/02a-train-movement-pca.py
analysis/02a-train-movement-pca.py
#!/usr/bin/env python import climate import lmj.cubes import lmj.pca import numpy as np import os import pandas as pd logging = climate.get_logger('02a-train-move-pca') PROBES = [0.5, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999] @climate.annotate( root='load data files from this directory tree', output=...
#!/usr/bin/env python import climate import lmj.cubes import lmj.pca import os import pandas as pd logging = climate.get_logger('02a-train-move-pca') PROBES = [0.5, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999] @climate.annotate( root='load data files from this directory tree', output='save encoded data ...
mit
Python
a65c8a946f631f3b4f1785477e082445c428ad24
Update migrations
codertx/lightil
jwt_auth/migrations/0001_initial.py
jwt_auth/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-20 06:30 from __future__ import unicode_literals import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-09 12:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TokenB...
mit
Python
16943fd80825e6a857bf7f6bec416249f801bc88
bump to 0.1.9
pmorissette/ffn
ffn/__init__.py
ffn/__init__.py
from . import core from . import data from .data import get #from .core import year_frac, PerformanceStats, GroupStats, merge from .core import * core.extend_pandas() __version__ = (0, 1, 9)
from . import core from . import data from .data import get #from .core import year_frac, PerformanceStats, GroupStats, merge from .core import * core.extend_pandas() __version__ = (0, 1, 8)
mit
Python
fd4fdcce2a42614c1ad5ca72f5d0a889ec8d87ab
fix test script autoload
gwmoura/lirio-cms,iblv/lirio-cms,iblv/lirio-cms,gwmoura/lirio-cms
test_runner.py
test_runner.py
#!/usr/bin/python # Copyright 2015 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/python # Copyright 2015 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
Python
31b0660d99398563557d5ca8bcca310e9546ec6a
Add manual timezone calculation
aerupt/whenareyou
whenareyou/__init__.py
whenareyou/__init__.py
import os from functools import lru_cache from dateutil import tz import requests import csv from urllib.parse import quote_plus from pytz import timezone from tzwhere import tzwhere LONG_LAT_URL = ('https://maps.googleapis.com/maps/api/geocode/json?address={0}' '&sensor=false') airports_csv_path = ...
import os from functools import lru_cache import requests import csv from urllib.parse import quote_plus from pytz import timezone from tzwhere import tzwhere LONG_LAT_URL = ('https://maps.googleapis.com/maps/api/geocode/json?address={0}' '&sensor=false') airports_csv_path = os.path.join(os.path.dir...
mit
Python
94e6443a3eeb1bf76121ab2030a90c5631f32ff8
Allow data to be returned on the same request.
consbio/landscapesim,consbio/landscapesim,consbio/landscapesim
landscapesim/serializers/regions.py
landscapesim/serializers/regions.py
import json from rest_framework import serializers from django.core.urlresolvers import reverse from landscapesim.models import Region class ReportingUnitSerializer(serializers.Serializer): type = serializers.SerializerMethodField() properties = serializers.SerializerMethodField() geometry = serializers...
import json from rest_framework import serializers from django.core.urlresolvers import reverse from landscapesim.models import Region class ReportingUnitSerializer(serializers.Serializer): type = serializers.SerializerMethodField() properties = serializers.SerializerMethodField() geometry = serializers...
bsd-3-clause
Python
5882a1d6fe2849359b2ffaf44d6ffb608f7a8568
Order permissions
mociepka/saleor,UITools/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,mociepka/saleor,mociepka/saleor,UITools/saleor
saleor/core/permissions.py
saleor/core/permissions.py
from django.contrib.auth.models import Permission MODELS_PERMISSIONS = [ 'category.view_category', 'category.edit_category', 'order.view_order', 'order.edit_order', 'product.view_product', 'product.edit_product', 'sale.view_sale', 'sale.edit_sale', 'stock_location.view_stock_locati...
from django.contrib.auth.models import Permission MODELS_PERMISSIONS = [ 'product.view_product', 'product.edit_product', 'category.view_category', 'category.edit_category', 'stock_location.view_stock_location', 'stock_location.edit_stock_location', 'order.view_order', 'order.edit_order...
bsd-3-clause
Python
7993a728fcc92a3ebc7e041bbe954ea895f09bb0
Implement basic Ansible state call
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/states/ansiblegate.py
salt/states/ansiblegate.py
# -*- coding: utf-8 -*- r''' Author: Bo Maryniuk <bo@suse.de> Execution of Ansible modules from within states =============================================== With `ansible.call` these states allow individual Ansible module calls to be made via states. To call an Ansible module function use a :mod:`module.run <salt.st...
# -*- coding: utf-8 -*- r''' Author: Bo Maryniuk <bo@suse.de> Execution of Ansible modules from within states =============================================== With `ansible.call` these states allow individual Ansible module calls to be made via states. To call an Ansible module function use a :mod:`module.run <salt.st...
apache-2.0
Python
184db1920e2c4b5d79d7a7d49b8631e9e4a37f03
Add receipt upload
tomshen/checkmeout,tomshen/checkmeout
checkmeout.py
checkmeout.py
from flask import Flask, render_template, jsonify, request from flaskext.uploads import UploadSet, IMAGES, configure_uploads from tesseract import parse_receipt app = Flask(__name__) app.config.update( DEBUG = True, UPLOADED_RECEIPTS_DEST = 'uploads' ) receipts = UploadSet('receipts', IMAGES) co...
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') if __name__ == '__main__': app.run(debug=True)
mit
Python
edf2a4039e726ec47b55eb4305ff9ed116036418
Fix migration script
whtsky/Gather,whtsky/Gather
migrations/versions/26dfc02ce3ff_.py
migrations/versions/26dfc02ce3ff_.py
"""empty message Revision ID: 26dfc02ce3ff Revises: 10c48c7e7526 Create Date: 2014-02-15 16:43:56.552255 """ # revision identifiers, used by Alembic. revision = '26dfc02ce3ff' down_revision = '10c48c7e7526' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
"""empty message Revision ID: 26dfc02ce3ff Revises: 10c48c7e7526 Create Date: 2014-02-15 16:43:56.552255 """ # revision identifiers, used by Alembic. revision = '26dfc02ce3ff' down_revision = '10c48c7e7526' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
mit
Python
e2ca5f1527254661f00e484179a9c23162f6bc16
update tests
dongnizh/tika-python
tests/tests.py
tests/tests.py
#!/usr/bin/env python2.7 # encoding: utf-8 # 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, Vers...
import unittest #import tika from tika import parser #import tika.tika #sys.path.append('..') class CreateTest(unittest.TestCase): "Test for New Generator.py Methods" def test_local_pdf(self): 'Parse local PDF' self.assertTrue(tika.parser.from_file('201504160015.pdf')) def test_remot...
apache-2.0
Python
5c00123b944db734e61495e9a086aa7dd7fc8fc1
Document Post model.
xfix/NextBoard
forum/models.py
forum/models.py
from django.db import models import django.contrib.auth.models as auth class User(auth.User): """Model for representing users. It has few fields that aren't in the standard authentication user table, and are needed for the forum to work, like footers. """ display_name = models.CharField(max_length...
from django.db import models import django.contrib.auth.models as auth class User(auth.User): """Model for representing users. It has few fields that aren't in the standard authentication user table, and are needed for the forum to work, like footers. """ display_name = models.CharField(max_length...
mit
Python
120fce6efa66e7bfa8e725040c4e3b6b0de192b7
Update BUILD_OSS to 4695.
fcitx/mozc,fcitx/mozc,google/mozc,google/mozc,fcitx/mozc,fcitx/mozc,fcitx/mozc,google/mozc,google/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
570d5553f895499bf88850a052fe5e6fe160b975
fix quotes error
BatedUrGonnaDie/salty_bot
modules/commands/helpers/textutil.py
modules/commands/helpers/textutil.py
#! /usr/bin/env python2.7 def add(salty_inst, c_msg, text_type, **kwargs): try: text = c_msg["message"].split(" ", 1)[1].strip() except IndexError: return False, "Please do not leave the quote blank." data = { "reviewed" : 1 if c_msg["sender"] == salty_inst.channel else 0, ...
#! /usr/bin/env python2.7 def add(salty_inst, c_msg, text_type, **kwargs): try: text = c_msg["message"].split(" ", 1)[1].strip() except IndexError: return False, "Please do not leave the quote blank." data = { "reviewed" : 1 if c_msg["sender"] == salty_inst.channel else 0, ...
mit
Python
7c0a861894b1e34e6b3ae6601ac5054e3e435f29
Add torch_device to the VE pipeline
huggingface/diffusers
src/diffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py
src/diffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py
#!/usr/bin/env python3 import torch from diffusers import DiffusionPipeline from tqdm.auto import tqdm class ScoreSdeVePipeline(DiffusionPipeline): def __init__(self, model, scheduler): super().__init__() self.register_modules(model=model, scheduler=scheduler) @torch.no_grad() def __call...
#!/usr/bin/env python3 import torch from diffusers import DiffusionPipeline from tqdm.auto import tqdm class ScoreSdeVePipeline(DiffusionPipeline): def __init__(self, model, scheduler): super().__init__() self.register_modules(model=model, scheduler=scheduler) @torch.no_grad() def __call...
apache-2.0
Python
caa73075befb33f3b1c9b1e2fccf4c17d72ce3f1
fix version number
ITCase-django/django-unisender,ITCase-django/django-unisender
unisender/__init__.py
unisender/__init__.py
#! /usr/bin/env python # -*- coding: utf-8 -*- __version__ = "0.1.0"
#! /usr/bin/env python # -*- coding: utf-8 -*- __version__ = "0.2.0"
mit
Python
af5cef1c16320cb29b9dc0921548e07d308060ff
Rename class with Given
daaang/blister
unittests/test_xmp.py
unittests/test_xmp.py
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from .hamcrest import evaluates_to from blister.xmp import XMP class GivenEmptyXMP (unittest.TestCase...
# Copyright (c) 2017 The Regents of the University of Michigan. # All Rights Reserved. Licensed according to the terms of the Revised # BSD License. See LICENSE.txt for details. from hamcrest import * import unittest from .hamcrest import evaluates_to from blister.xmp import XMP class XMPTest (unittest.TestCase): ...
bsd-3-clause
Python
856f2328ccae97286b621c736716b37967027be8
Fix an imports ordering problem
tim-schilling/django-debug-toolbar,spookylukey/django-debug-toolbar,tim-schilling/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,tim-schilling/django-debug-toolbar,spookylukey/django-debug-toolbar,spookylukey/django-debug-toolbar,jazzband/django-debug-toolbar,django-debug-toolbar/django-debug-toolbar,dj...
tests/views.py
tests/views.py
# coding: utf-8 from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.template.response import TemplateResponse from django.views.decorators.cache import cache_page...
# coding: utf-8 from __future__ import absolute_import, unicode_literals from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.template.response import TemplateResponse from django.shortcuts import render from django.views.decorators.cache import cache_page...
bsd-3-clause
Python
259b119a13b1b30c0bb92c35c4ea6341c4b42721
Increment to v6.11.1.dev20
explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc
thinc/about.py
thinc/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = 'thinc' __version__ = '6.11.1.dev20' __summary__ = "Practical Machine Learning for NLP" __uri__ = 'https://github.com/explosion/thin...
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __name__ = 'thinc' __version__ = '6.11.1.dev19' __summary__ = "Practical Machine Learning for NLP" __uri__ = 'https://github.com/explosion/thin...
mit
Python
a6d06ff99e4cd11309efe9b98f66d969d9c2b482
print stdout&&stderrr
whitehats/distributed-cron
dcron.py
dcron.py
#!/usr/bin/env python import memcache import hashlib import datetime import calendar import sh # Timeout for action in seconds. TIMEOUT = 21600 # Address for memcache ADDRESS = '127.0.0.1:11211' # File with data FILE_NAME = "schedule.txt" def datetime_to_seconds(_datetime): timestamp = int(calendar.timegm(_date...
#!/usr/bin/env python import memcache import hashlib import datetime import calendar import sh # Timeout for action in seconds. TIMEOUT = 21600 # Address for memcache ADDRESS = '127.0.0.1:11211' # File with data FILE_NAME = "schedule.txt" def datetime_to_seconds(_datetime): timestamp = int(calendar.timegm(_date...
mit
Python
f9ae121e852b83d00a7138b853db52673b9f4100
Use batch_size variable
kevinhughes27/TensorKart,bzier/TensorKart
train.py
train.py
#!/usr/bin/env python from utils import Data import model import tensorflow as tf # Load Training Data data = Data() # Start session sess = tf.InteractiveSession() # Learning Functions L2NormConst = 0.001 train_vars = tf.trainable_variables() loss = tf.reduce_mean(tf.square(tf.subtract(model.y_, model.y))) + tf.add...
#!/usr/bin/env python from utils import Data import model import tensorflow as tf # Load Training Data data = Data() # Start session sess = tf.InteractiveSession() # Learning Functions L2NormConst = 0.001 train_vars = tf.trainable_variables() loss = tf.reduce_mean(tf.square(tf.subtract(model.y_, model.y))) + tf.add...
mit
Python
88be5325c3d006b822c8d8ee2db4512ea538c800
Use render, rather than render_to_response
lsgunth/rapidsms,lsgunth/rapidsms,lsgunth/rapidsms,lsgunth/rapidsms
rapidsms/views.py
rapidsms/views.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.contrib.auth.decorators import login_required from django.contrib.auth.views import login as django_login from django.contrib.auth.views import logout as django_logout from django.shortcuts import render from django.template import RequestContext from djan...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.contrib.auth.decorators import login_required from django.contrib.auth.views import login as django_login from django.contrib.auth.views import logout as django_logout from django.shortcuts import render_to_response from django.template import RequestConte...
bsd-3-clause
Python
f8fe16f4ba4c99bdc11f30dc860645eec5def508
Use built-in eval instead of RExec
prologic/kdb,prologic/kdb,prologic/kdb
kdb/plugins/eval.py
kdb/plugins/eval.py
# Filename: eval.py # Module: eval # Date: 30th June 2006 # Author: James Mills, prologic at shortcircuit dot net dot au """Expression Evaluation This plugin provides a command to evaluate python expressions and can be used as a simple way of performing calculations. """ __ver__ = "0.0.3" __author__ = "James Mills...
# Filename: eval.py # Module: eval # Date: 30th June 2006 # Author: James Mills, prologic at shortcircuit dot net dot au """Expression Evaluation This plugin provides a command to evaluate python expressions and can be used as a simple way of performing calculations. """ __ver__ = "0.0.2" __author__ = "James Mills...
mit
Python
d8c869ce816f29e8236762ee51952d454e8f782c
bump to 0.5.8
tsuru/tsuru-circus
tsuru/__init__.py
tsuru/__init__.py
# Copyright 2013 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.5.8"
# Copyright 2013 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.5.7"
bsd-3-clause
Python
7e47fa92563763c2fa0cfc698dd5d20acdb5a2bd
bump to 0.6.5
tsuru/tsuru-circus
tsuru/__init__.py
tsuru/__init__.py
# Copyright 2014 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.6.5"
# Copyright 2014 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.6.4"
bsd-3-clause
Python
ec9af1980b568566594fa0e2f5dded57ab16f053
Add iterFlags()
trevor/calendarserver,trevor/calendarserver,trevor/calendarserver
twext/who/util.py
twext/who/util.py
## # Copyright (c) 2013 Apple 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...
## # Copyright (c) 2013 Apple 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...
apache-2.0
Python
e98a6f5b0bc2fcf925c293ea2c66d5c4a49c4ab8
Fix misprint after adding push/pull sockets.
smira/txZMQ
txzmq/__init__.py
txzmq/__init__.py
""" ZeroMQ integration into Twisted reactor. """ from txzmq.connection import ZmqConnection, ZmqEndpoint, ZmqEndpointType from txzmq.factory import ZmqFactory from txzmq.pubsub import ZmqPubConnection, ZmqSubConnection from txzmq.pushpull import ZmqPushConnection, ZmqPullConnection from txzmq.xreq_xrep import ZmqXREQCo...
""" ZeroMQ integration into Twisted reactor. """ from txzmq.connection import ZmqConnection, ZmqEndpoint, ZmqEndpointType from txzmq.factory import ZmqFactory from txzmq.pubsub import ZmqPubConnection, ZmqSubConnection from txzmq.pushpull import ZmqPushConnection, ZmqPullConnection from txzmq.xreq_xrep import ZmqXREQCo...
mpl-2.0
Python
19d5ec78af4459983f068a05197295e1cb8d1365
FIX bug in code order
vene/comparison-pattern
scripts/pukwak_findall.py
scripts/pukwak_findall.py
#from __future__ import print_function import cPickle import sys from compattern.dependency import match from compattern.dependency.seed_patterns import patterns class PUkWaC(object): def __iter__(self): buf = [] sent = "" for f in self.files: print f for line in o...
#from __future__ import print_function import cPickle import sys from compattern.dependency import match from compattern.dependency.seed_patterns import patterns class PUkWaC(object): def __iter__(self): buf = [] sent = "" for f in self.files: print f for line in o...
bsd-3-clause
Python
e7421b3be72d03eed3c7f86b4d4a526ae746856a
Print packet info.
elielsardanons/dstar_sniffer,elielsardanons/dstar_sniffer
dstar.py
dstar.py
def parse(data): if data.startswith("DSTR", 0, 4): data_len = len(data) packet = list(bytearray(data)) if (data_len == 58 or data_len == 29 or data_len == 32) and packet[6] == 0x73 \ and packet[7] == 0x12 and packet[10] == 0x20 and packet[8] == 0x00 and \ (packet[9] == 0x30 or packet[9] == 0x13 or packet...
def parse(data): if data.startswith("DSTR", 0, 4): data_len = len(data) packet = list(bytearray(data)) if (data_len == 58 or data_len == 29 or data_len == 32) and packet[6] == 0x73 \ and packet[7] == 0x12 and packet[10] == 0x20 and packet[8] == 0x00 and \ (packet[9] == 0x30 or packet[9] == 0x13 or packet...
mit
Python
29d1930bfeace8a5bfbc29cb5450bd3e4e6000a2
Fix pyreq on Windows
conan-io/conan-package-tools
cpt/test/integration/update_python_reqs_test.py
cpt/test/integration/update_python_reqs_test.py
import unittest from conans.test.utils.tools import TestClient from cpt.test.test_client.tools import get_patched_multipackager class PythonRequiresTest(unittest.TestCase): def test_python_requires(self): base_conanfile = """from conans import ConanFile myvar = 123 def myfunct(): return 234 class ...
import unittest from conans.test.utils.tools import TestClient from cpt.test.test_client.tools import get_patched_multipackager class PythonRequiresTest(unittest.TestCase): def test_python_requires(self): base_conanfile = """from conans import ConanFile myvar = 123 def myfunct(): return 234 class ...
mit
Python
8075cb763c8721d6db4dee50c0e774992be5fd5c
Update update file
mbrucher/AudioTK,mbrucher/AudioTK,mbrucher/AudioTK,mbrucher/AudioTK
update_version.py
update_version.py
#!/usr/bin/env python import fileinput import sys def update_cmakelist(new_version): for line in fileinput.input(files=("CMakeLists.txt",), inplace=True): if line.startswith("set(ATK_VERSION"): sys.stdout.write("set(ATK_VERSION %s)\n" % new_version) else: sys.stdout.write(line) def update_appve...
#!/usr/bin/env python import fileinput import sys def update_cmakelist(new_version): for line in fileinput.input(files=("CMakeLists.txt",), inplace=True): if line.startswith("set(ATK_VERSION"): sys.stdout.write("set(ATK_VERSION %s)\n" % new_version) else: sys.stdout.write(line) def update_appve...
bsd-3-clause
Python
e0dfbbcf16b0482ab33b74f94c4375f8fc2c984d
Fix loop in netcreate_boot.py
jkilpatr/browbeat,jkilpatr/browbeat
rally/rally-plugins/netcreate-boot/netcreate_boot.py
rally/rally-plugins/netcreate-boot/netcreate_boot.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 ...
# 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 ...
apache-2.0
Python
3900542f877f40ab9018c7cfbce323619714ef4f
Fix get_query_set vs get_queryset for Django <1.6
mishbahr/django-users2,mishbahr/django-users2
users/managers.py
users/managers.py
from django.utils import timezone from django.contrib.auth.models import BaseUserManager from model_utils.managers import InheritanceQuerySet from .conf import settings class UserManager(BaseUserManager): def get_queryset(self): """ Fixes get_query_set vs get_queryset for Django <1.6 ""...
from django.utils import timezone from django.contrib.auth.models import BaseUserManager from model_utils.managers import InheritanceQuerySet from .conf import settings class UserManager(BaseUserManager): def _create_user(self, email, password, is_staff, is_superuser, **extra_fields): ...
bsd-3-clause
Python
deecfe0c12fa71dccc50e9fec6c185533f19856c
Remove remnants of non-global CSRF
wkoathp/dscsrf
dscsrf.py
dscsrf.py
import string from flask import request from random import SystemRandom from markupsafe import Markup csrf_charset = string.letters + string.digits _rng = SystemRandom() class Csrf(object): def __init__(self, app=None, paramName='dscsrf', cookieName='dscsrf'): self.app = None self.paramName = paramName self.c...
import string from flask import request from random import SystemRandom from markupsafe import Markup csrf_charset = string.letters + string.digits _rng = SystemRandom() class Csrf(object): def __init__(self, app=None, paramName='dscsrf', cookieName='dscsrf'): self.app = None self.paramName = paramName self.c...
mit
Python
71800dc0b7d051d390589744a24050a4ce7736e5
Update __init__.py
melangemark/exif-py,ianare/exif-py
exifread/tags/__init__.py
exifread/tags/__init__.py
from .exif import * from . import makernote """ Tag definitions """ DEFAULT_STOP_TAG = 'UNDEF' # field type descriptions as (length, abbreviation, full name) tuples FIELD_TYPES = ( (0, 'X', 'Proprietary'), # no such type (1, 'B', 'Byte'), (1, 'A', 'ASCII'), (2, 'S', 'Short'), (4, 'L', 'Long'), ...
from .exif import * import makernote """ Tag definitions """ DEFAULT_STOP_TAG = 'UNDEF' # field type descriptions as (length, abbreviation, full name) tuples FIELD_TYPES = ( (0, 'X', 'Proprietary'), # no such type (1, 'B', 'Byte'), (1, 'A', 'ASCII'), (2, 'S', 'Short'), (4, 'L', 'Long'), (8, ...
bsd-3-clause
Python
31bac870a3c42183110d1b55645075732cc82dce
disable cpan build
DeadSix27/python_cross_compile_script
packages/dependencies/tesseract.py
packages/dependencies/tesseract.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/tesseract-ocr/tesseract.git', 'conf_system' : 'cmake', 'source_subfolder' : '_build', 'configure_options' : '.. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DBUILD_SHARED_LIBS=0 -DBUILD_TRAINING_TOOLS=0 -DBUILD_TESTS=0 -DSTATIC=1 -DLIBRARY_TYPE=S...
{ 'repo_type' : 'git', 'url' : 'https://github.com/tesseract-ocr/tesseract.git', 'conf_system' : 'cmake', 'source_subfolder' : '_build', 'configure_options' : '.. {cmake_prefix_options} -DCMAKE_INSTALL_PREFIX={target_prefix} -DBUILD_SHARED_LIBS=0 -DBUILD_TRAINING_TOOLS=0 -DBUILD_TESTS=0 -DSTATIC=1 -DLIBRARY_TYPE=S...
mpl-2.0
Python
0cc3f6930e78776923bd099b9234e2da269c4dc8
fix PEP8
appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform
lms/djangoapps/instructor/sites.py
lms/djangoapps/instructor/sites.py
""" Heplers for site/org isolations functions. """ from openedx.core.djangoapps.theming.helpers import get_current_site from organizations.models import Organization, UserOrganizationMapping def user_exists_in_organization(user_email, organization): """ TODO """ return organization.userorganizationma...
""" """ from openedx.core.djangoapps.theming.helpers import get_current_site from organizations.models import Organization, UserOrganizationMapping def user_exists_in_organization(user_email, organization): """ TODO """ return organization.userorganizationmapping_set.filter(user__email=user_email).exi...
agpl-3.0
Python
5cdda9799256f9227ab3bbb60ff69e00e37c298f
Change to meet new syntax of the python-twitter module
twirrim/friendcheck
friends.py
friends.py
#!/usr/bin/env python import twitter import os.path import sys import ConfigParser import cPickle config = ConfigParser.RawConfigParser() config.read("/path/to/friends.cfg") conkey = config.get("twitter","consumer_key") consec = config.get("twitter","consumer_secret") accesstok = config.get("twitter","access_token") ...
#!/usr/bin/env python import twitter import os.path import sys import ConfigParser import cPickle config = ConfigParser.RawConfigParser() config.read("/path/to/friends.cfg") conkey = config.get("twitter","consumer_key") consec = config.get("twitter","consumer_secret") accesstok = config.get("twitter","access_token") ...
bsd-3-clause
Python
40c98e747295d1aa675e35a72f92ab81d86987a4
fix whitespace
chrisclark/retentionizer,chrisclark/retentionizer,chrisclark/retentionizer
utils.py
utils.py
import pandas as pd from sbgresults import SbgResults import bokeh.plotting as bk from bokeh.resources import CDN from bokeh.embed import components import numpy as np from scipy.stats import beta COLORS = ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17"] def parse(data_url): data_ur...
import pandas as pd from sbgresults import SbgResults import bokeh.plotting as bk from bokeh.resources import CDN from bokeh.embed import components import numpy as np from scipy.stats import beta COLORS = ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17"] def parse(data_url): data_ur...
apache-2.0
Python
41bdb951e61f5601c380fd81690d74d35136455f
Fix a field lookup to be compatible with all versions of Django.
beanbaginc/django-evolution
django_evolution/builtin_evolutions/__init__.py
django_evolution/builtin_evolutions/__init__.py
from django.contrib.sessions.models import Session BUILTIN_SEQUENCES = { 'django.contrib.auth': [], 'django.contrib.contenttypes': [], 'django.contrib.sessions': [], } # Starting in Django 1.3 alpha, Session.expire_date has a db_index set. # This needs to be reflected in the evolutions. Rather than hard...
from django.contrib.sessions.models import Session BUILTIN_SEQUENCES = { 'django.contrib.auth': [], 'django.contrib.contenttypes': [], 'django.contrib.sessions': [], } # Starting in Django 1.3 alpha, Session.expire_date has a db_index set. # This needs to be reflected in the evolutions. Rather than hard...
bsd-3-clause
Python
1fb3c8a399d7c5c682d6b6c3823f131ffd090cc6
Fix #25
cthit/CodeIT
views/MainMenu.py
views/MainMenu.py
from src.GameMethods import GameMethods from src.gui.elements.button.Button import Button from src.gui.elements.text.TextBlock import TextBlock def load_view(gui, game_methods: GameMethods): button_one = Button("Level One", 300, 50, lambda: game_methods.load_level_by_index(1)) button_one.resize_button_to_heig...
from src.GameMethods import GameMethods from src.gui.elements.button.Button import Button from src.gui.elements.text.TextBlock import TextBlock def load_view(gui, game_methods: GameMethods): gui.add_gui_element(TextBlock("This is a text block!", 100, 100)) gui.add_gui_element(Button("Start Game", 100, 150, la...
mit
Python
b2ef5038f6a2ba50a74260eabb0dc56e429cd69c
Remove unused import of os.
cmshobe/landlab,landlab/landlab,cmshobe/landlab,landlab/landlab,cmshobe/landlab,amandersillinois/landlab,amandersillinois/landlab,landlab/landlab
landlab/__init__.py
landlab/__init__.py
#! /usr/bin/env python """The Landlab :Package name: TheLandlab :Release date: 2018-09-18 :Authors: Greg Tucker, Nicole Gasparini, Erkan Istanbulluoglu, Daniel Hobley, Sai Nudurupati, Jordan Adams, Eric Hutton, Katherine Barnhart, Margaux Mouchene, Nathon Lyons :URL: http://csdms.colorado.edu/trac/landlab :Lic...
#! /usr/bin/env python """The Landlab :Package name: TheLandlab :Release date: 2018-09-18 :Authors: Greg Tucker, Nicole Gasparini, Erkan Istanbulluoglu, Daniel Hobley, Sai Nudurupati, Jordan Adams, Eric Hutton, Katherine Barnhart, Margaux Mouchene, Nathon Lyons :URL: http://csdms.colorado.edu/trac/landlab :Lic...
mit
Python
d560f7929ac39ca5c321aa13ae844158e0292fee
test /log/install endpoint failing.
Impactstory/unpaywall,Impactstory/unpaywall,Impactstory/unpaywall
views.py
views.py
from flask import make_response from flask import request from flask import redirect from flask import abort from flask import render_template from flask import jsonify from flask import g import json import os import sys from app import app #support CORS @app.after_request def add_crossdomain_header(resp): res...
from flask import make_response from flask import request from flask import redirect from flask import abort from flask import render_template from flask import jsonify from flask import g import json import os import sys from app import app #support CORS @app.after_request def add_crossdomain_header(resp): res...
mit
Python
e11c0162025a9dad71fe7c6ac29312a0a7781362
bump version to 0.5
njwilson23/landsat-util,RoboDonut/landsat-util,simonemurzilli/landsat-util,DougFirErickson/landsat-util,citterio/landsat-util,developmentseed/landsat-util,jalalomary/landsat-util,ircwaves/landsat-util,simonemurzilli/landsat-util,mileswwatkins/landsat-util,mileswwatkins/landsat-util,DougFirErickson/landsat-util
landsat/__init__.py
landsat/__init__.py
import settings import sys if not settings.DEBUG: sys.tracebacklimit = 0 __version__ = '0.5.0'
import settings import sys if not settings.DEBUG: sys.tracebacklimit = 0 __version__ = '0.4.0'
cc0-1.0
Python
6e22769f3d8c940a5f2cf7e9855a8370ad4c2772
bump to 0.77.3
dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc
dvc/version.py
dvc/version.py
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.77.3" def _generate_version(base_version): """Generate a versio...
# Used in setup.py, so don't pull any additional dependencies # # Based on: # - https://github.com/python/mypy/blob/master/mypy/version.py # - https://github.com/python/mypy/blob/master/mypy/git.py import os import subprocess _BASE_VERSION = "0.77.2" def _generate_version(base_version): """Generate a versio...
apache-2.0
Python
2af829cbc8f935c9cb5d1f37e784ef1041bcb2e6
Fix logic
pybel/pybel-tools,pybel/pybel-tools,pybel/pybel-tools
src/pybel_tools/grouping.py
src/pybel_tools/grouping.py
# -*- coding: utf-8 -*- import logging from collections import defaultdict from pybel import BELGraph from pybel.constants import ANNOTATIONS from . import pipeline from .selection.induce_subgraph import update_metadata from .utils import safe_add_edge log = logging.getLogger(__name__) __all__ = [ 'get_subgraph...
# -*- coding: utf-8 -*- import logging from collections import defaultdict from pybel import BELGraph from pybel.constants import ANNOTATIONS from . import pipeline from .selection.induce_subgraph import update_metadata from .utils import safe_add_edge log = logging.getLogger(__name__) __all__ = [ 'get_subgraph...
mit
Python
54683555997032cccf97f5fedf88b7a2402f0449
FIX only sponsorships can go through waiting_welcome state
eicher31/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,ecino/compassion-modules,maxime-beck/compassion-modules,eicher31/compassion-modules,maxime-beck/compassion-modules,maxime-beck/compassion-modules,CompassionCH/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,Comp...
sponsorship_tracking/migrations/10.0.2.0.0/post-migration.py
sponsorship_tracking/migrations/10.0.2.0.0/post-migration.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2017 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2017 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0
Python
5e373cc5c436447407b92a23e183ba27adf68e4b
Refactor PrivateLink.node_ids to use values_list
chrisseto/osf.io,chrisseto/osf.io,aaxelb/osf.io,crcresearch/osf.io,hmoco/osf.io,felliott/osf.io,Nesiehr/osf.io,pattisdr/osf.io,brianjgeiger/osf.io,alexschiller/osf.io,laurenrevere/osf.io,mluo613/osf.io,binoculars/osf.io,binoculars/osf.io,laurenrevere/osf.io,Johnetordoff/osf.io,monikagrabowska/osf.io,leb2dg/osf.io,cwise...
osf_models/models/private_link.py
osf_models/models/private_link.py
from django.utils import timezone from django.db import models from framework.utils import iso8601format from website.util import sanitize from osf_models.models.base import BaseModel, ObjectIDMixin class PrivateLink(ObjectIDMixin, BaseModel): date_created = models.DateTimeField(default=timezone.now) key = m...
from django.utils import timezone from django.db import models from framework.utils import iso8601format from website.util import sanitize from osf_models.models.base import BaseModel, ObjectIDMixin class PrivateLink(ObjectIDMixin, BaseModel): date_created = models.DateTimeField(default=timezone.now) key = m...
apache-2.0
Python
6d5dd2ee68a5cc3903a16af80bdcadc5caf52624
Add restore mysql database
sephii/fabliip,liip/fabliip,liip/fabliip,sephii/fabliip
fabliip/database/mysql.py
fabliip/database/mysql.py
from getpass import getpass from fabric import api def dump(backup_path, database_name, user='root', host=None, password=None): """ Backup MySQL database as a MySQL archive. If host is set to None, 127.0.0.1 will be used. If password is set to None, a prompt will ask a password. """ if host i...
from getpass import getpass from fabric import api def dump(backup_path, database_name, user='root', host=None, password=None): """ Backup MySQL database as a MySQL archive. If host is set to None, 127.0.0.1 will be used. If password is set to None, a prompt will ask a password. """ if host i...
mit
Python
6008d0886f278f340a4028e04803bbe40da3d8c1
Add a prod configuration.
brenns10/feeds
feeds.py
feeds.py
#!/usr/bin/env python3 """ Python web application that merges RSS feeds. """ from multiprocessing.pool import ThreadPool from time import mktime from functools import reduce import feedparser from flask import Flask, render_template app = Flask(__name__) # Stuff to go at the top of the feed. name = 'HacSoc Feeds' de...
#!/usr/bin/env python3 """ Python web application that merges RSS feeds. """ from multiprocessing.pool import ThreadPool from time import mktime from functools import reduce import feedparser from flask import Flask, render_template app = Flask(__name__) # Stuff to go at the top of the feed. name = 'HacSoc Feeds' de...
bsd-3-clause
Python
d8876b0b7394062e644f29f1903fb38fc1145143
modify __init__.py (#1587)
dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost,dmlc/xgboost
python-package/xgboost/__init__.py
python-package/xgboost/__init__.py
# coding: utf-8 """XGBoost: eXtreme Gradient Boosting library. Contributors: https://github.com/dmlc/xgboost/blob/master/CONTRIBUTORS.md """ from __future__ import absolute_import import os from .core import DMatrix, Booster from .training import train, cv from . import rabit # noqa try: from ...
# coding: utf-8 """XGBoost: eXtreme Gradient Boosting library. Contributors: https://github.com/dmlc/xgboost/blob/master/CONTRIBUTORS.md """ from __future__ import absolute_import import os from .core import DMatrix, Booster from .training import train, cv from . import rabit # noqa try: from ...
apache-2.0
Python
221cc1a80c215a4841c9555f4d75481c363497c5
Update for Pythomista v2.0
cclauss/Pythonista_ui
GetSomeTextView.py
GetSomeTextView.py
# See: http://omz-forums.appspot.com/pythonista/post/5282094997569536 import ui class GetSomeTextView(ui.View): def __init__(self): self.name = 'Enter some text:' tf1 = self.make_text_field('top_field', 'Change me') tf2 = self.make_text_field('bottom_field', 'Me too') tf1.action = ...
# See: http://omz-forums.appspot.com/pythonista/post/5282094997569536 class GetSomeTextView(ui.View): def __init__(self): self.name = 'Enter some text:' tf1 = self.make_text_field('top_field', 'Change me') tf2 = self.make_text_field('bottom_field', 'Me too') tf1.action = tf2.action ...
apache-2.0
Python
0aaab9bc8c361089c032c28f6a11b55fab06a020
Add latest version of expat (#4930)
skosukhin/spack,LLNL/spack,mfherbst/spack,tmerrick1/spack,iulian787/spack,EmreAtes/spack,matthiasdiener/spack,skosukhin/spack,iulian787/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,TheTimmy/spack,skosukhin/spack,mfherbst/spack,matthiasdiener/spack,matthiasdiener/spack,lgarren/spack,EmreAtes/spack,krafczyk/spack,TheT...
var/spack/repos/builtin/packages/expat/package.py
var/spack/repos/builtin/packages/expat/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
99f678035a279cf85a32a4fdbd98a117b9c1832f
Fix for older systems, move to GitHub (#8135)
krafczyk/spack,krafczyk/spack,LLNL/spack,LLNL/spack,iulian787/spack,matthiasdiener/spack,krafczyk/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,matthiasdiener/spack,tmerrick1/spack,LLNL/spack,matthiasdiener/spack,tmerrick1/spack,LLNL/spack,krafczyk/spack,mfherbst/spack,matthiasdiener/spack,tmerrick1/spack,krafc...
var/spack/repos/builtin/packages/expat/package.py
var/spack/repos/builtin/packages/expat/package.py
############################################################################## # Copyright (c) 2013-2018, 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-2018, 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
7efb18b5024a07d2e73779eb6550fffae29e80bb
Bump version for OpenSSL@3 and restrict @:1.21.2 to openssl@:1 (#26156)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/nginx/package.py
var/spack/repos/builtin/packages/nginx/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 Nginx(AutotoolsPackage): """nginx [engine x] is an HTTP and reverse proxy server, a mail p...
# 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 Nginx(AutotoolsPackage): """nginx [engine x] is an HTTP and reverse proxy server, a mail p...
lgpl-2.1
Python
e1c01941f4827138276a339ecb853efc057e9398
create an instance_template object
googleinterns/vm-network-migration
vm_network_migration/modules/instance_template.py
vm_network_migration/modules/instance_template.py
from vm_network_migration.modules.operations import Operations class InstanceTemplate: def __init__(self, compute, project, instance_template_name, instance_template_body = None): self.compute = compute self.project = project self.instance_template_name = instance_template_name self....
apache-2.0
Python
97a3d8ffa808a94f042dedb9411274784bd41923
add _version import
cornhundred/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,...
widgetsnbextension/widgetsnbextension/__init__.py
widgetsnbextension/widgetsnbextension/__init__.py
"""Interactive widgets for the Jupyter notebook. Provide simple interactive controls in the notebook. Each Widget corresponds to an object in Python and Javascript, with controls on the page. To put a Widget on the page, you can display it with IPython's display machinery:: from ipywidgets import IntSlider f...
"""Interactive widgets for the Jupyter notebook. Provide simple interactive controls in the notebook. Each Widget corresponds to an object in Python and Javascript, with controls on the page. To put a Widget on the page, you can display it with IPython's display machinery:: from ipywidgets import IntSlider f...
bsd-3-clause
Python
b75c39a6ebf2311369f2348694caadcb05f6f624
Bump the repetition from 1000 to 5000
yml/django-perfo-regression,yml/django-perfo-regression
template_perfo_regression/tests.py
template_perfo_regression/tests.py
import timeit from django.utils import unittest from django.template import RequestContext, loader class TemplatePerfoTestCase(unittest.TestCase): def setUp(self): self.params = {'foo': 'bar', 'range': range(10)} def rendered_template(self, template_name): tmpl = loader.get_template(template_n...
import timeit from django.utils import unittest from django.template import RequestContext, loader class TemplatePerfoTestCase(unittest.TestCase): def setUp(self): self.params = {'foo': 'bar', 'range': range(10)} def rendered_template(self, template_name): tmpl = loader.get_template(template_n...
bsd-3-clause
Python
1b7dba6c40566b49ac4ca286c1c6d20a5b95b45a
Remove invalid google import
imankulov/sentry,zenefits/sentry,songyi199111/sentry,argonemyth/sentry,wong2/sentry,TedaLIEz/sentry,BuildingLink/sentry,Natim/sentry,ewdurbin/sentry,kevinlondon/sentry,ngonzalvez/sentry,JackDanger/sentry,alexm92/sentry,looker/sentry,pauloschilling/sentry,jean/sentry,jean/sentry,gg7/sentry,gencer/sentry,daevaorn/sentry,...
src/sentry/auth/__init__.py
src/sentry/auth/__init__.py
from __future__ import absolute_import, print_function from .provider import * # NOQA from .manager import ProviderManager from .view import * # NOQA manager = ProviderManager() register = manager.register unregister = manager.unregister
from __future__ import absolute_import, print_function from .provider import * # NOQA from .manager import ProviderManager from .view import * # NOQA manager = ProviderManager() register = manager.register unregister = manager.unregister # TODO(dcramer): move this into external plugin from .providers.google_oauth2...
bsd-3-clause
Python
0efedb00d9fc0cbbbd1d516550d3e12863f6c42b
Make get_networks an internal function
dguo/churn
src/subcommands/networks.py
src/subcommands/networks.py
import sqlite3 import click from pick import pick def _get_networks(connection): command = 'SELECT name FROM card_networks ORDER BY name' return [row['name'] for row in connection.execute(command)] def list_networks(connection): click.echo_via_pager('\n'.join(_get_networks(connection))) def add_network(...
import sqlite3 import click from pick import pick def get_networks(connection): command = 'SELECT name FROM card_networks ORDER BY name' return [row['name'] for row in connection.execute(command)] def list_networks(connection): click.echo_via_pager('\n'.join(get_networks(connection))) def add_network(co...
mit
Python
b57885accf40ad80a01f451022a4444cc10c506d
Clean up networks implementation
dguo/churn
src/subcommands/networks.py
src/subcommands/networks.py
import sqlite3 import click from pick import pick from tabulate import tabulate from ..util import pick_with_cancel, successful_update_message def _get_networks(connection): command = 'SELECT id, name FROM card_networks ORDER BY name' return connection.execute(command).fetchall() def select_network_id(conne...
import sqlite3 import click from pick import pick from ..util import pick_with_cancel def _get_networks(connection): command = 'SELECT id, name FROM card_networks ORDER BY name' return connection.execute(command).fetchall() def select_network_id(connection): networks = _get_networks(connection) sele...
mit
Python
bd27d6d2786641e800d31c4450b6cb95aa0ed67e
quit screwing with the testing frameworks...
shashkin/sqlalchemy-migrate
migrate/tests/fixture/__init__.py
migrate/tests/fixture/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest2 def main(imports=None): if imports: global suite suite = suite(imports) defaultTest='fixture.suite' else: defaultTest=None return unittest2.TestProgram(defaultTest=defaultTest) from base import Base from migrat...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest2 import sys # Append test method name,etc. to descriptions automatically. # Yes, this is ugly, but it's the simplest way... def getDescription(self, test): ret = str(test) if self.descriptions: return test.shortDescription() or ret return ...
mit
Python
e784bf5d7080f718e8d855602d8ff4f2ab1c3ff0
add before/after run hooks to base cmd
ImageIntelligence/mimiron
mimiron/core/commands/__init__.py
mimiron/core/commands/__init__.py
# -*- coding: utf-8 -*- from ...config import config from ..environments import is_valid_env from ..environments import get_env_repo from ...domain.commands import InvalidEnvironment from ...domain.commands import EnvironmentNotLinked class Command(object): def __init__(self, conf=config, **kwargs): sel...
# -*- coding: utf-8 -*- from ...config import config from ..environments import is_valid_env from ..environments import get_env_repo from ...domain.commands import InvalidEnvironment from ...domain.commands import EnvironmentNotLinked class Command(object): def __init__(self, conf=config, **kwargs): sel...
mit
Python
50431a0afb89e35b7551c8076622fb1d85085363
clean up
GPflow/GPflow
testing/test_notebooks.py
testing/test_notebooks.py
import nbformat from nbconvert.preprocessors import ExecutePreprocessor from nbconvert.preprocessors.execute import CellExecutionError import glob import time import sys pythonkernel = 'python'+str(sys.version_info[0]) nbpath = '../doc/source/notebooks/' # see http://nbconvert.readthedocs.io/en/stable/execute_api.html...
import nbformat from nbconvert.preprocessors import ExecutePreprocessor from nbconvert.preprocessors.execute import CellExecutionError import glob import time import sys #TODO: how to do black list? pythonkernel = 'python'+str(sys.version_info[0]) nbpath = '../doc/source/notebooks/' # see http://nbconvert.readthedocs....
apache-2.0
Python
dbfdef49cb09d75e282342d219b80f3b1428ba86
fix test
aforren1/toon
tests/anim/test_player.py
tests/anim/test_player.py
import pytest from collections import namedtuple from toon.anim.player import Player from toon.anim.track import Track class Circ(object): def __init__(self): self.x = 0 self.y = 0 def test_player(): trk = Track([(0, 0), (0.5, 0.5), (1, 1)]) circ = Circ() circ2 = Circ() def chan...
import pytest from collections import namedtuple from toon.anim.player import Player from toon.anim.track import Track class Circ(object): def __init__(self): self.x = 0 self.y = 0 def test_player(): trk = Track([(0, 0), (0.5, 0.5), (1, 1)]) circ = Circ() circ2 = Circ() def chan...
mit
Python
e9cc8459e85c02be6609ada7a93f8b63f02938f7
refactor tests
cds-amal/addressparser,cds-amal/addressparser,cds-amal/addressparser,cds-amal/addressparser
tests/testExpectations.py
tests/testExpectations.py
import sys sys.path.append('..') from nose.plugins.skip import SkipTest import os.path import unittest import codecs import adyparser as parser class PublicHearing(unittest.TestCase): def checkExpectation(self, source, expectation): expected = open(expectation).readlines() expected = [e.strip()...
''' Test Case 1 Type: Public Hearing Department: Design and construction Date Published: April 2, 2015 ''' import sys sys.path.append('..') from nose.plugins.skip import SkipTest import os.path import unittest import codecs import adyparser as parser class PublicHearing(unittest.TestCase): # @SkipTest def ...
mit
Python
80f4c7404272b5cc00caa0e7cb041fb9811d988e
Disable README test (too long)
jakelever/kindred,jakelever/kindred
tests/test_checkREADME.py
tests/test_checkREADME.py
import os def _README(): thisDir = os.path.dirname(os.path.realpath(__file__)) parentDir = os.path.dirname(thisDir) readmePath = os.path.join(parentDir,'README.rst') readmeTestPath = os.path.join(thisDir,'README.py') with open(readmePath) as readmeF,open(readmeTestPath,'w') as testF: for line in readmeF: ...
import os def test_README(): thisDir = os.path.dirname(os.path.realpath(__file__)) parentDir = os.path.dirname(thisDir) readmePath = os.path.join(parentDir,'README.rst') readmeTestPath = os.path.join(thisDir,'README.py') with open(readmePath) as readmeF,open(readmeTestPath,'w') as testF: for line in readmeF:...
mit
Python
7e13e13f93dae940575b95f7bc4cf3ee16293602
Fix move window test
r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview
tests/test_move_window.py
tests/test_move_window.py
import webview from time import sleep from .util import run_test def test_xy(): window = webview.create_window('xy test', x=200, y=200, width=100, height=100) run_test(webview, window, xy) def test_move_window(): window = webview.create_window('Move window test', x=200, y=200, width=100, height=100) ...
import webview from .util import run_test def test_xy(): window = webview.create_window('xy test', x=200, y=200, width=100, height=100) run_test(webview, window, xy) def test_move_window(): window = webview.create_window('Move window test', x=200, y=200, width=100, height=100) run_test(webview, wind...
bsd-3-clause
Python
e15c0fc02eda933398b181c69316f1a5ffe6163d
Add another method to file2.py
vislab2013/test_package
file2.py
file2.py
def fun2(a=1): print('value = ', a) def fun3(a=1, b=2): return a + b
def fun2(a=1): print('value = ', a)
mit
Python
731f25d300d7238a829af853dafa940f5943b3cb
Revert key assignment back to original format
bradleyg/django-s3direct,bilabon/django-s3direct,bradleyg/django-s3direct,un33k/django-s3direct,bilabon/django-s3direct,Artory/django-s3direct,yunojuno/django-s3-upload,AlexRiina/django-s3direct,yunojuno/django-s3-upload,un33k/django-s3direct,Artory/django-s3direct,invalid-access/django-s3direct,un33k/django-s3direct,A...
s3direct/views.py
s3direct/views.py
import json from django.http import HttpResponse from django.views.decorators.http import require_POST from django.conf import settings from .utils import create_upload_data, get_at DESTINATIONS = getattr(settings, 'S3DIRECT_DESTINATIONS', None) @require_POST def get_upload_params(request): content_type = req...
import json from django.http import HttpResponse from django.views.decorators.http import require_POST from django.conf import settings from .utils import create_upload_data, get_at DESTINATIONS = getattr(settings, 'S3DIRECT_DESTINATIONS', None) @require_POST def get_upload_params(request): content_type = req...
mit
Python
9082eb56a73d8bf2715fa9a46841567f9ac8173c
Update version to circumvent pypi upload errors
lixxu/sanic,channelcat/sanic,lixxu/sanic,lixxu/sanic,yunstanford/sanic,yunstanford/sanic,channelcat/sanic,ashleysommer/sanic,yunstanford/sanic,ashleysommer/sanic,channelcat/sanic,channelcat/sanic,yunstanford/sanic,lixxu/sanic,ashleysommer/sanic
sanic/__init__.py
sanic/__init__.py
from sanic.app import Sanic from sanic.blueprints import Blueprint __version__ = '0.8.1' __all__ = ['Sanic', 'Blueprint']
from sanic.app import Sanic from sanic.blueprints import Blueprint __version__ = '0.8.0' __all__ = ['Sanic', 'Blueprint']
mit
Python
768be433d6e8c1bcb3dc9c45df9926cd0b91b80d
Increment to 0.5.3
yunstanford/sanic,yunstanford/sanic,jrocketfingers/sanic,ashleysommer/sanic,r0fls/sanic,yunstanford/sanic,r0fls/sanic,channelcat/sanic,channelcat/sanic,ashleysommer/sanic,lixxu/sanic,lixxu/sanic,lixxu/sanic,ashleysommer/sanic,jrocketfingers/sanic,lixxu/sanic,channelcat/sanic,Tim-Erwin/sanic,Tim-Erwin/sanic,channelcat/s...
sanic/__init__.py
sanic/__init__.py
from sanic.app import Sanic from sanic.blueprints import Blueprint __version__ = '0.5.3' __all__ = ['Sanic', 'Blueprint']
from sanic.app import Sanic from sanic.blueprints import Blueprint __version__ = '0.5.2' __all__ = ['Sanic', 'Blueprint']
mit
Python
fe9af3cfbc12cc0fe09fc517ae81087796986c5f
Make secret JSON field
matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo
web/attempts/rest.py
web/attempts/rest.py
import json from rest_framework.viewsets import ModelViewSet from rest_framework.serializers import ModelSerializer, Field from rest_framework.response import Response from rest_framework import fields, decorators, validators from rest_framework.status import HTTP_200_OK, HTTP_201_CREATED, HTTP_400_BAD_REQUEST from .mo...
import json from rest_framework.viewsets import ModelViewSet from rest_framework.serializers import ModelSerializer from rest_framework.response import Response from rest_framework import fields, decorators, validators from rest_framework.status import HTTP_200_OK, HTTP_201_CREATED, HTTP_400_BAD_REQUEST from .models im...
agpl-3.0
Python
c91895d9298d32d9302e759b40cff7f0f015bd93
Change argument order (default goes first).
hynek/first
first.py
first.py
## -*- coding: utf-8 -*- """ first ===== first is the function you always missed in Python. In the simplest case, it returns the first true element from an iterable: >>> from first import first >>> first([0, False, None, [], (), 42]) 42 Or None if there is none: >>> from first import first >>> first([]) is None T...
## -*- coding: utf-8 -*- """ first ===== first is the function you always missed in Python. In the simplest case, it returns the first true element from an iterable: >>> from first import first >>> first([0, False, None, [], (), 42]) 42 Or None if there is none: >>> from first import first >>> first([]) is None T...
mit
Python
e9c6b22ffaf498dc64f590689cc637a152444665
Change LoginForm parameter for BooleanField
jinjiaho/project57,jinjiaho/project57,jinjiaho/project57,jinjiaho/project57
forms.py
forms.py
from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[DataRequired("Please enter the name of the newco...
from flask_wtf import Form from wtforms import StringField, PasswordField, SubmitField, RadioField, validators, IntegerField, BooleanField from wtforms.validators import DataRequired, Email, Length class AddUserForm(Form): name = StringField('Name of User', validators=[DataRequired("Please enter the name of the newco...
mit
Python
05e9a3914f9574c1153e73afeb907a9f90a722d3
Add logipy to hello
louismerlin/keyboard-games,louismerlin/keyboard-games
hello.py
hello.py
from logishort import * from logipy import * import time init() time.sleep(1) # Give the SDK a second to initialize all(17, 28, 47) one(T, 0, 0, 0) one(Y, 0, 0, 0) one(U, 0, 0, 0) one(H, 0, 0, 0) one(J, 0, 0, 0) one(B, 0, 0, 0) one(N, 0, 0, 0) one(M, 0, 0, 0) input('Press enter to shutdown SDK...') shutdown()
from logishort import * import time init() time.sleep(1) # Give the SDK a second to initialize all(17, 28, 47) one(logi_led.T, 0, 0, 0) one(logi_led.Y, 0, 0, 0) one(logi_led.U, 0, 0, 0) one(logi_led.H, 0, 0, 0) one(logi_led.J, 0, 0, 0) one(logi_led.B, 0, 0, 0) one(logi_led.N, 0, 0, 0) one(logi_led.M, 0, 0, 0) input...
mit
Python
482d34bb09c044d5c6c63aa8f26b7a7d1a036742
fix BIG bug that breaks default completions for other languages
y0ssar1an/CSS3
css3_completions.py
css3_completions.py
from CSS3.completions import properties from CSS3.completions import values import re import sublime import sublime_plugin INHIBIT_DEFAULTS = sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS property_name_rx = re.compile(r"(?P<prop_name>[-a-z]+):") class CSS3Completions(sublime_plugin.EventLi...
from CSS3.completions import properties from CSS3.completions import values import re import sublime import sublime_plugin INHIBIT_DEFAULTS = sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS property_name_rx = re.compile(r"(?P<prop_name>[-a-z]+):") class CSS3Completions(sublime_plugin.EventLi...
mit
Python
4af8f60598e216adb04e4ed04394e8835beedcac
Improve ObjectWithoutField.__str__ to idenfify singleton values
smarr/PySOM,smarr/PySOM,SOM-st/PySOM,SOM-st/PySOM
src/som/vmobjects/object_without_fields.py
src/som/vmobjects/object_without_fields.py
from rlib.jit import promote from som.vmobjects.abstract_object import AbstractObject class ObjectWithoutFields(AbstractObject): _immutable_fields_ = ["_object_layout?"] def __init__(self, layout): # pylint: disable=W self._object_layout = layout def get_class(self, universe): assert ...
from rlib.jit import promote from som.vmobjects.abstract_object import AbstractObject class ObjectWithoutFields(AbstractObject): _immutable_fields_ = ["_object_layout?"] def __init__(self, layout): # pylint: disable=W self._object_layout = layout def get_class(self, universe): assert ...
mit
Python
87e03e2781afc1df13c1219cd85186e8a449696c
Add more documentation and clean things up
exec-all/numad
numad/cmd.py
numad/cmd.py
#!/usr/bin/env python """umad: pull results from umad""" from argparse import ArgumentParser from asyncio import coroutine, Task from aioes import Elasticsearch from blessed import Terminal from .render import render_search_results, render_query_field from .inputs import input_loop, search_loop from . import DEFAULT...
#!/usr/bin/env python """umad: pull results from umad""" from argparse import ArgumentParser from asyncio import coroutine, Task from aioes import Elasticsearch from blessed import Terminal from .render import render_search_results, render_query_field from .inputs import input_loop, search_loop from . import DEFAULT...
bsd-2-clause
Python
15adee6f317c64a1f5d67837dfdf4fb39369b7fc
Update to recent nengo
ctn-waterloo/nengo_pushbot,ctn-waterloo/nengo_pushbot
examples/robot_control.py
examples/robot_control.py
import nengo import nengo_pushbot import numpy as np model = nengo.Network(label='pushbot') with model: input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)], label='input') a = nengo.Ensemble(100, dimensions=2, label='a') bot = nengo_pushbot.PushBotNetwork('ctndroid.uwaterloo.ca', port=56044, mess...
import nengo import nengo_pushbot import numpy as np model = nengo.Network() with model: input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)]) a = nengo.Ensemble(nengo.LIF(100), dimensions=2) bot = nengo_pushbot.PushBotNetwork('10.162.177.45', message_delay=0.001) nengo.Connection(input, a, f...
mit
Python
8d3484de2dcf2a2f6b72e733586e79fae0d5b664
Bump to version 0.11.1
lesscpy/lesscpy
lesscpy/__init__.py
lesscpy/__init__.py
__version_info__ = ('0', '11', '1') __version__ = '.'.join(__version_info__) def compile(file, minify=False, xminify=False, tabs=False, spaces=True): from .lessc import parser from .lessc import formatter class Opt(object): def __init__(self): self.minify = minify self.xmi...
__version_info__ = ('0', '10', '2') __version__ = '.'.join(__version_info__) def compile(file, minify=False, xminify=False, tabs=False, spaces=True): from .lessc import parser from .lessc import formatter class Opt(object): def __init__(self): self.minify = minify self.xmi...
mit
Python
b614c1d324538aff37fcb816f4f3c61bb471a8dd
Use the normal instance method to delete an image
sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer
documents/admin.py
documents/admin.py
from daisyproducer.documents.models import Document, Version, Attachment, Image, Product, State from django.contrib import admin class VersionInline(admin.TabularInline): model = Version class AttachmentInline(admin.TabularInline): model = Attachment class ImageInline(admin.TabularInline): model = Image class P...
from daisyproducer.documents.models import Document, Version, Attachment, Image, Product, State from django.contrib import admin class VersionInline(admin.TabularInline): model = Version class AttachmentInline(admin.TabularInline): model = Attachment class ImageInline(admin.TabularInline): model = Image class P...
agpl-3.0
Python
eec47f7a6988d4472bc99789fcc7ba894b74c17b
Use .get methods when retrieving uuid keys
anmoljh/ansible-galaxy-tools,galaxyproject/ansible-galaxy-tools,galaxyproject/ansible-tools,nuwang/ansible-galaxy-tools
files/install_workflow.py
files/install_workflow.py
#!/usr/bin/env python import argparse from bioblend import galaxy import json def main(): """ This script uses bioblend to import .ga workflow files into a running instance of Galaxy """ parser = argparse.ArgumentParser() parser.add_argument("-w", "--workflow_path", help='Path to workflow file...
#!/usr/bin/env python import argparse from bioblend import galaxy import json def main(): """ This script uses bioblend to import .ga workflow files into a running instance of Galaxy """ parser = argparse.ArgumentParser() parser.add_argument("-w", "--workflow_path", help='Path to workflow file'...
mit
Python
3bbf8726b266a8c8c5403e0d3556232e14028cf8
Delete translation using _()
acsone/margin-analysis,Endika/margin-analysis,Antiun/margin-analysis,VitalPet/margin-analysis,bmya/margin-analysis
product_cost_incl_costs_without_bom/product.py
product_cost_incl_costs_without_bom/product.py
# -*- coding: utf-8 -*- from openerp.osv.orm import Model from openerp.osv import fields import decimal_precision as dp import logging class product_product(Model): _inherit = 'product.product' def _cost_price(self, cr, uid, ids, field_name, arg, context=None): if context is None: context ...
# -*- coding: utf-8 -*- from openerp.osv.orm import Model from openerp.osv import fields import decimal_precision as dp from openerp.tools.translate import _ import logging class product_product(Model): _inherit = 'product.product' def _cost_price(self, cr, uid, ids, field_name, arg, context=None): if...
agpl-3.0
Python
1f13d6f9394747d2dfe51c25b8cb336cc024dce9
remove monetdb typo
obeattie/sqlalchemy,obeattie/sqlalchemy,obeattie/sqlalchemy
lib/sqlalchemy/databases/__init__.py
lib/sqlalchemy/databases/__init__.py
# __init__.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php __all__ = [ 'sqlite', 'postgres', 'mysql', 'oracle', 'mssql', 'firebird', 'sybase', 'acc...
# __init__.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php __all__ = [ 'sqlite', 'postgres', 'mysql', 'oracle', 'mssql', 'firebird', 'sybase', 'acc...
mit
Python