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 |
|---|---|---|---|---|---|---|---|---|
7043adc0f9f82015e96b20c00bb3802639058689 | move between computers | fabiansinz/pipecontrol,fabiansinz/pipecontrol,fabiansinz/pipecontrol | app/stereotax/forms.py | app/stereotax/forms.py | import wtforms as wtf
#from fabee import inj
import numpy as np
from commons import virus, inj
from itertools import chain
class StereoTacticCoordinate(wtf.Form):
caudal = wtf.FloatField('caudal', validators=[wtf.validators.required()])
lateral = wtf.FloatField('lateral', validators=[wtf.validators.required(... | import wtforms as wtf
from fabee import inj
import numpy as np
from commons import virus
from itertools import chain
areas = np.unique(inj.AtlasStereotacticTargets().fetch['area'])
subv, constr, lot = (inj.Substance() * inj.Substance.Virus() * virus.Virus()).fetch[
'substance_id', 'construct_id', 'virus_lot']
sub... | mit | Python |
5ad8403d82af73fa22f5cb3f978c3187362bd3df | Bump version number | jrief/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,sandow-digital/easy-thumbnails-cropman,SmileyChris/easy-thumbnails,siovene/easy-thumbnails,Mactory/easy-thumbnails,emschorsch/easy-thumbnails,jrief/easy-thumbnails,jaddison/easy-thumbnails,emschorsch/easy-thumbnails | easy_thumbnails/__init__.py | easy_thumbnails/__init__.py | VERSION = (1, 0, 'alpha', 16)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | VERSION = (1, 0, 'alpha', 15)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | bsd-3-clause | Python |
6cf20c0fba013d39960af0f4d2c9a3b399955eb3 | Bump version to 1.6b3 | 5monkeys/django-enumfield | django_enumfield/__init__.py | django_enumfield/__init__.py | VERSION = (1, 6, 0, 'beta', 3)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:... | VERSION = (1, 6, 0, 'beta', 2)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:... | mit | Python |
30c45ccb069ee32f764b2290a8b8665ac12743d1 | Bump to version 0.5.2 dev. | clones/django-evolution | django_evolution/__init__.py | django_evolution/__init__.py | # The version of Django Evolution
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (0, 5, 2, 'alpha', 0, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
... | # The version of Django Evolution
#
# This is in the format of:
#
# (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
#
VERSION = (0, 5, 1, 'final', 0, True)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version += ".%s" % VERSION[2]
i... | bsd-3-clause | Python |
2d8674f57ffe49f62255608deb1140b4f6b9a332 | Add update_bar method to LemonbarServer | sandlerb/lemonpy | lemonpy/server.py | lemonpy/server.py | from .exceptions import LemonpyError
import uuid
class DuplicateBarId(LemonpyError):
"""
The requested bar ID (name, PID, etc) already exists
"""
pass
class AlreadyManaged(LemonpyError):
"""
The lemonbar instance is already managed by a LemonbarServer
"""
pass
class LemonbarServer... | from .exceptions import LemonpyError
import uuid
class DuplicateBarId(LemonpyError):
"""
The requested bar ID (name, PID, etc) already exists
"""
pass
class AlreadyManaged(LemonpyError):
"""
The lemonbar instance is already managed by a LemonbarServer
"""
pass
class LemonbarServer... | mit | Python |
ab0b0fe08e9deeb77e44d9fe138ccfea41619520 | Add global error for > 2,000 char message attempts | corpnewt/CorpBot.py,corpnewt/CorpBot.py | Cogs/Errors.py | Cogs/Errors.py | import asyncio
import discord
import sys
import traceback
from discord.ext import commands
from discord import errors
from Cogs import Message
def setup(bot):
bot.add_cog(Errors())
class Errors(commands.Cog):
def __init__(self):
pass
@commands.Cog.listener()
async def on_command_error(s... | import asyncio
import discord
import sys
import traceback
from discord.ext import commands
from discord import errors
from Cogs import Message
def setup(bot):
bot.add_cog(Errors())
class Errors(commands.Cog):
def __init__(self):
pass
@commands.Cog.listener()
async def on_command_error(s... | mit | Python |
6782ad40a405f79f07fa1527131634f96944ffd6 | Add status codes to the 404/500 error handlers. | mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/mozilla-ignite | apps/innovate/views.py | apps/innovate/views.py | import random
import jingo
from users.models import Profile
from projects.models import Project
from events.models import Event
from feeds.models import Entry
def splash(request):
"""Display splash page. With featured project, event, person, blog post."""
def get_random(cls, **kwargs):
choices = cls... | import random
import jingo
from users.models import Profile
from projects.models import Project
from events.models import Event
from feeds.models import Entry
def splash(request):
"""Display splash page. With featured project, event, person, blog post."""
def get_random(cls, **kwargs):
choices = cls... | bsd-3-clause | Python |
80bb7f91b1439f6fea0341cd864855bbac1b01fc | Use numkey entries | simeonf/claire | levels/thegame.py | levels/thegame.py | import pyglet
from pyglet.window.key import ENTER
from .levels import Level
from .game_piece import Problem
from .drawing import rectangle
class TheGame(Level):
def __init__(self, window):
self.user_answer = pyglet.text.Label('', x=10, y=window.height-30, font_size=20)
self.score_text = pyglet.text.Label('0... | import pyglet
from pyglet.window.key import ENTER
from .levels import Level
from .game_piece import Problem
from .drawing import rectangle
class TheGame(Level):
def __init__(self, window):
self.user_answer = pyglet.text.Label('', x=10, y=window.height-30, font_size=20)
self.score_text = pyglet.text.Label('0... | mit | Python |
21db3fd9052d61f9352194d3d5668ea78890c016 | return not found instead of blowing up | LandRegistry/search-api-alpha,LandRegistry/search-api-alpha | searchapi/resources.py | searchapi/resources.py | from flask.ext.restful import Resource, fields, marshal_with, reqparse, abort
from flask import make_response
from elasticsearch.exceptions import NotFoundError
from searchapi.server import app, es
import json
def get_hits(raw_result):
hits = raw_result.get('hits')
return hits.get('hits')
def get_item(raw_re... | from flask.ext.restful import Resource, fields, marshal_with, reqparse, abort
from searchapi.server import app, es
def get_hits(raw_result):
hits = raw_result.get('hits')
return hits.get('hits')
def get_item(raw_result):
return raw_result.get("_source")
class PublicTitleResource(Resource):
# no mar... | mit | Python |
bf5ce33df4a451abe355a08a734eec78af38a51c | Bump version to v2.1.0 | springload/draftjs_exporter,springload/draftjs_exporter,springload/draftjs_exporter | draftjs_exporter/__init__.py | draftjs_exporter/__init__.py | __title__ = 'draftjs_exporter'
__version__ = '2.1.0'
__author__ = 'Springload'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016-present Springload'
|
__title__ = 'draftjs_exporter'
__version__ = '2.0.0'
__author__ = 'Springload'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016-present Springload'
| mit | Python |
a7fc33e8b37a767bdaa260f3a7061144876d67a8 | add filter by year | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | apps/projects/views.py | apps/projects/views.py | from datetime import datetime
import django_filters
from django.apps import apps
from django.conf import settings
from django.utils.translation import ugettext as _
from adhocracy4.contrib.views import FilteredListView
from adhocracy4.projects import models as project_models
from apps.contrib.widgets import DropdownL... | import django_filters
from django.apps import apps
from django.conf import settings
from django.utils.translation import ugettext as _
from adhocracy4.contrib.views import FilteredListView
from adhocracy4.projects import models as project_models
from apps.contrib.widgets import DropdownLinkWidget
class OrderingWidg... | agpl-3.0 | Python |
66ae34067069466d39a4553914df7c9a622d76a9 | update version | ronin-gw/PyMaSC,ronin-gw/PyMaSC | PyMaSC/__init__.py | PyMaSC/__init__.py | VERSION = "0.2.1"
| VERSION = "0.2.0"
| mit | Python |
ea51b7f808df6340978da3176fd9bf9c3646891a | Fix unclear parameter name | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/path.py | dusty/path.py | import os
from . import constants
from .config import get_config_value
def parent_dir(path):
"""Return the parent directory of a file or directory.
This is commonly useful for creating parent directories
prior to creating a file."""
return os.path.split(path)[0]
def vm_cp_path(app_or_service_name):
... | import os
from . import constants
from .config import get_config_value
def parent_dir(path):
"""Return the parent directory of a file or directory.
This is commonly useful for creating parent directories
prior to creating a file."""
return os.path.split(path)[0]
def vm_cp_path(repo_name):
return o... | mit | Python |
13b080a6bf0198dc93da5432baf5a603bd2eed97 | Bump version. | Floobits/flootty | flootty/version.py | flootty/version.py | FLOOTTY_VERSION = '3.0.0'
| FLOOTTY_VERSION = '2.1.4'
| apache-2.0 | Python |
89cbf0adc7af51cb768a874f894e209ce1009b87 | Set release version | lucius-feng/flower,allengaller/flower,pj/flower,asmodehn/flower,raphaelmerx/flower,ChinaQuants/flower,raphaelmerx/flower,ChinaQuants/flower,Lingling7/flower,alexmojaki/flower,barseghyanartur/flower,pj/flower,tellapart/flower,Lingling7/flower,Lingling7/flower,getupcloud/flower,asmodehn/flower,marrybird/flower,allengalle... | flower/__init__.py | flower/__init__.py | from __future__ import absolute_import
VERSION = (0, 7, 0)
__version__ = '.'.join(map(str, VERSION))
from .app import Flower # noqa
| from __future__ import absolute_import
VERSION = (0, 7, 0)
__version__ = '.'.join(map(str, VERSION)) + '-dev'
from .app import Flower # noqa
| bsd-3-clause | Python |
a5db9578ee57e57cce7388464f1aab12f4fedd72 | Fix signature change on _setup_fields | OCA/geospatial,OCA/geospatial,OCA/geospatial | base_geoengine/geo_view/ir_view.py | base_geoengine/geo_view/ir_view.py | # Copyright 2011-2012 Nicolas Bessi (Camptocamp SA)
# Copyright 2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import api
GEO_VIEW = ('geoengine', 'GeoEngine')
class IrUIView(models.Model):
_inherit = 'ir.ui.view'
... | # Copyright 2011-2012 Nicolas Bessi (Camptocamp SA)
# Copyright 2016 Yannick Vaucher (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
from odoo import api
GEO_VIEW = ('geoengine', 'GeoEngine')
class IrUIView(models.Model):
_inherit = 'ir.ui.view'
... | agpl-3.0 | Python |
d44f696bc391af7ca306bd896796c251562262b1 | Send request arguments | argoroots/Entu,argoroots/Entu,argoroots/Entu | app/api/metno.py | app/api/metno.py | import urllib
from tornado import gen
from tornado import httpclient
from main.helper import *
class API2MetNo(myRequestHandler):
@web.removeslash
@gen.coroutine
def get(self, metno_request):
arguments = {}
if self.request.arguments:
for x, y in self.request.arguments.iteri... | from tornado import gen
from tornado import httpclient
from main.helper import *
class API2MetNo(myRequestHandler):
@web.removeslash
@gen.coroutine
def get(self, metno_request):
metno_url = 'https://api.met.no/weatherapi/' + metno_request
http_client = httpclient.AsyncHTTPClient()
... | mit | Python |
7ca468b4f0a845775f6beb9329d4861ec4227427 | add color bar | wangwei7175878/tutorials | kerasTUT/9-Autoencoder_example.py | kerasTUT/9-Autoencoder_example.py | """
To know more or get code samples, please visit my website:
https://morvanzhou.github.io/tutorials/
Or search: 莫烦Python
Thank you for supporting!
"""
# please note, all tutorial code are running under python3.5.
# If you use the version like python2.7, please modify the code accordingly
# 9 - Autoencoder example
... | """
To know more or get code samples, please visit my website:
https://morvanzhou.github.io/tutorials/
Or search: 莫烦Python
Thank you for supporting!
"""
# please note, all tutorial code are running under python3.5.
# If you use the version like python2.7, please modify the code accordingly
# 9 - Autoencoder example
... | mit | Python |
e84ca65440bb6b38bf0630373766789d6915a20d | Add text selection inside 'li' element | MaxLikelihood/CODE | dataset/dataset/spiders/dataset_spider.py | dataset/dataset/spiders/dataset_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 |
7844c9ecc2cbf1dd837bad96ee8d899d48694608 | Add utils.mkdir_p. | nicolasdespres/hunittest | hunittest/utils.py | hunittest/utils.py | # -*- encoding: utf-8 -*-
"""Utility routines
"""
import os
import re
from enum import Enum
def pyname_join(seq):
return ".".join(seq)
def is_pkgdir(dirpath):
return os.path.isdir(dirpath) \
and os.path.isfile(os.path.join(dirpath, "__init__.py"))
def mod_split(modname):
mo = re.match(r"^(.+)\... | # -*- encoding: utf-8 -*-
"""Utility routines
"""
import os
import re
from enum import Enum
def pyname_join(seq):
return ".".join(seq)
def is_pkgdir(dirpath):
return os.path.isdir(dirpath) \
and os.path.isfile(os.path.join(dirpath, "__init__.py"))
def mod_split(modname):
mo = re.match(r"^(.+)\... | bsd-2-clause | Python |
2533efcab19c73d75005c6cbaa9985dfef3a3ba5 | add hubot HTTP endpoint | StackStorm/st2incubator,pinterb/st2incubator,StackStorm/st2incubator,pinterb/st2incubator,pinterb/st2incubator | packs/hubot/actions/post_message.py | packs/hubot/actions/post_message.py | import json
import httplib
import requests
from st2actions.runners.pythonrunner import Action
__all__ = [
'PostMessageAction'
]
class PostMessageAction(Action):
def run(self, message, channel, user=None, whisper=False):
endpoint = self.config['endpoint']
url = endpoint + "/hubot/st2"
... | import json
import httplib
import requests
from st2actions.runners.pythonrunner import Action
__all__ = [
'PostMessageAction'
]
class PostMessageAction(Action):
def run(self, message, channel, user=None, whisper=False):
endpoint = self.config['endpoint']
headers = {}
headers['Content... | apache-2.0 | Python |
eb5d5ebda18ee05a0c42ad52f5a2fbe0a4d8e3d1 | Add a require_authentication helper | gratipay/aspen.py,gratipay/aspen.py | aspen/auth/__init__.py | aspen/auth/__init__.py | """
Aspen's Auth modules.
Currently:
* cookie - Cookie Auth
* httpbasic - HTTP BASIC Auth
* httpdigest - HTTP DIGEST Auth
"""
from aspen import Response
from aspen.utils import typecheck
class BaseUser(object):
def __init__(self, token):
typecheck(token, (unicode, None))
self.token = tok... | """
Aspen's Auth modules.
Currently:
* cookie - Cookie Auth
* httpbasic - HTTP BASIC Auth
* httpdigest - HTTP DIGEST Auth
"""
from aspen.utils import typecheck
class BaseUser(object):
def __init__(self, token):
typecheck(token, (unicode, None))
self.token = token
@property
def A... | mit | Python |
df46403d8cc893995aca135eb04d22a37ac8983c | Remove unnecessary validation in update environment form the client | StackStorm/python-mistralclient,openstack/python-mistralclient,openstack/python-mistralclient,StackStorm/python-mistralclient | mistralclient/api/v2/environments.py | mistralclient/api/v2/environments.py | # Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 | Python |
34a3cb2075a031cb36130e3b76bec15c6fc1b8d0 | Bump version | thombashi/tcconfig,thombashi/tcconfig | tcconfig/__init__.py | tcconfig/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
VERSION = "0.6.6"
| # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
VERSION = "0.6.5"
| mit | Python |
135741a1f687e431a34e0c56bf2ef34e74bfceeb | return computeNodeName in vOLT object | cboling/xos,zdw/xos,cboling/xos,open-cloud/xos,zdw/xos,cboling/xos,cboling/xos,open-cloud/xos,opencord/xos,zdw/xos,opencord/xos,cboling/xos,zdw/xos,opencord/xos,open-cloud/xos | xos/core/xoslib/methods/volttenant.py | xos/core/xoslib/methods/volttenant.py | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from core.models import *
from django.forms import widgets
from cord.models import VOLTTenant, VOLTService
fro... | apache-2.0 | Python |
e556a6e5b74571b8286d7e59c34e55bc1df5bb8c | Add login methods | rtfoley/scorepy,rtfoley/scorepy,rtfoley/scorepy | app/test_base.py | app/test_base.py | from flask.ext.testing import TestCase
import unittest
from app import app, db
class BaseTestCase(TestCase):
def create_app(self):
app.config.from_object('config.TestingConfiguration')
return app
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
... | from flask.ext.testing import TestCase
import unittest
from app import app, db
class BaseTestCase(TestCase):
def create_app(self):
app.config.from_object('config.TestingConfiguration')
return app
def setUp(self):
db.create_all()
def tearDown(self):
db.session.remove()
... | mit | Python |
8da1993ebaa2ee891e7f002d7fb5cab89d52a0a9 | remove some dead code (#8223) | stonebig/bokeh,stonebig/bokeh,dennisobrien/bokeh,dennisobrien/bokeh,dennisobrien/bokeh,mindriot101/bokeh,ericmjl/bokeh,timsnyder/bokeh,dennisobrien/bokeh,ericmjl/bokeh,bokeh/bokeh,bokeh/bokeh,timsnyder/bokeh,mindriot101/bokeh,stonebig/bokeh,jakirkham/bokeh,mindriot101/bokeh,ericmjl/bokeh,ericmjl/bokeh,bokeh/bokeh,mindr... | bokeh/_testing/plugins/log_file.py | bokeh/_testing/plugins/log_file.py | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause | Python |
8d651ed493d2787da478f0c7c120917d3335b4d5 | Use Django's memoize over a custom one. | playfire/django-email-from-template,lamby/django-email-from-template | email_from_template/utils.py | email_from_template/utils.py | from django.utils.functional import memoize
from . import app_settings
def get_render_method():
return from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
get_render_method = memoize(get_render_method, {}, 0)
def get_context_processors():
return [from_dotted_path(x) for x in app_settings.EMAIL_CONTEXT_PROCESS... | from . import app_settings
_render_method = None
def get_render_method():
global _render_method
if _render_method is None:
_render_method = from_dotted_path(app_settings.EMAIL_RENDER_METHOD)
return _render_method
_context_processors = None
def get_context_processors():
global _context_proces... | bsd-3-clause | Python |
c44ea12bd8822cf6f607d2f18b70e0c927bb65ac | Make the MokshaMenuController a regular Controller, instead of a Base. | mokshaproject/moksha,pombredanne/moksha,lmacken/moksha,pombredanne/moksha,mokshaproject/moksha,pombredanne/moksha,lmacken/moksha,ralphbean/moksha,ralphbean/moksha,ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,lmacken/moksha | moksha/api/menus/controllers/menu.py | moksha/api/menus/controllers/menu.py | # This file is part of Moksha.
#
# Moksha 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 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that it... | # This file is part of Moksha.
#
# Moksha 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 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that it... | apache-2.0 | Python |
603dfcadcd37cf0d0af24bf1c5eeea7e7f8a628c | Add more custom maps | harrischristiansen/generals-bot | base/client/catalog.py | base/client/catalog.py | GENERALS_MAPS = [
"who will win the best",
"1v1 Ultimate",
"King of the Hill (FFA)",
"KILL A KING",
"The War of Classes",
"Plots",
"City",
"Speed",
"Experiment G",
"WIN or LOSE",
"Russian Roulette ",
] | GENERALS_MAPS = [
"who will win the best",
"1v1 Ultimate",
"King of the Hill (FFA)",
] | mit | Python |
baf254ab788d2ca02331c418c6ff2eb0aae687ed | Fix user so we can mount volumes as RW | pre-commit/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit,Lucas-C/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,pre-commit/pre-commit,philipgian/pre-commit,phili... | pre_commit/languages/docker.py | pre_commit/languages/docker.py | from __future__ import absolute_import
from __future__ import unicode_literals
import hashlib
import os
from pre_commit import five
from pre_commit.languages import helpers
from pre_commit.util import clean_path_on_failure
from pre_commit.util import mkdirp
from pre_commit.xargs import xargs
ENVIRONMENT_DIR = 'dock... | from __future__ import absolute_import
from __future__ import unicode_literals
import hashlib
import os
from pre_commit import five
from pre_commit.languages import helpers
from pre_commit.util import clean_path_on_failure
from pre_commit.util import mkdirp
from pre_commit.xargs import xargs
ENVIRONMENT_DIR = 'dock... | mit | Python |
3fd3838865969baa0d4bbb3d9c098b7044227877 | Support spaces in Micro logs | rticommunity/rticonnextdds-logparser,rticommunity/rticonnextdds-logparser | logparser/logs/micro/logs.py | logparser/logs/micro/logs.py | # Log Parser for RTI Connext.
#
# Copyright 2016 Real-Time Innovations, 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
#
# ... | # Log Parser for RTI Connext.
#
# Copyright 2016 Real-Time Innovations, 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
#
# ... | apache-2.0 | Python |
6dc27a650e9004fca6efbde6df1af2c4608a28fc | fix flake8 error | praekelt/malaria24-django,praekelt/malaria24-django,praekelt/malaria24-django,praekelt/malaria24-django | malaria24/settings/docker.py | malaria24/settings/docker.py | """Django settings for use within the docker container."""
from os import environ
from os.path import abspath, dirname, join
import dj_database_url
from .production import * # noqa: F401, F403
SECRET_KEY = environ.get('DOCKER_SECRET_KEY') or DEFAULT_SECRET_KEY
# Disable debug mode
DEBUG = False
PROJECT_ROOT = (... | """Django settings for use within the docker container."""
from django.core.exceptions import ImproperlyConfigured
from os import environ
from os.path import abspath, dirname, join
import dj_database_url
from .production import * # noqa: F401, F403
SECRET_KEY = environ.get('DOCKER_SECRET_KEY') or DEFAULT_SECRET_... | bsd-2-clause | Python |
0ddfbd68a0f2ca7baa333a9245134bd59949e000 | update rolling example | IntelLabs/hpat,IntelLabs/hpat,IntelLabs/hpat,IntelLabs/hpat | examples/hiframes_rolling.py | examples/hiframes_rolling.py | import pandas as pd
import numpy as np
import hpat
@hpat.jit
def rolling_df1(n):
df = pd.DataFrame({'A': np.ones(n), 'B': np.random.ranf(n)})
Ac = df.A.rolling(5).sum()
return Ac.sum()
@hpat.jit
def rolling_df2(n):
df = pd.DataFrame({'A': np.ones(n), 'B': np.random.ranf(n)})
Ac = df.A.rolling(5, c... | import pandas as pd
import numpy as np
import hpat
@hpat.jit
def rolling_df1(n):
df = pd.DataFrame({'A': np.ones(n), 'B': np.random.ranf(n)})
Ac = df.A.rolling(3).sum()
return Ac.sum()
@hpat.jit
def rolling_df2(n):
df = pd.DataFrame({'A': np.ones(n), 'B': np.random.ranf(n)})
Ac = df.A.rolling(3, c... | bsd-2-clause | Python |
07d7eddac89d5ac54af62e185801cdbe71720b7c | Read the intput file specified on the command line. | usc-isi-i2/hybrid-jaccard | hybridJaccardTest.py | hybridJaccardTest.py | import argparse
import sys
import hybridJaccard as hj
def main():
"Command line testinterface."
parser = argparse.ArgumentParser()
parser.add_argument('-c','--configFile', help="Configuration file (JSON).", required=False)
parser.add_argument('-i','--input', help="Input file of phrases to test.", requ... | import argparse
import sys
import hybridJaccard as hj
def main():
"Command line testinterface."
parser = argparse.ArgumentParser()
parser.add_argument('-c','--configFile', help="Configuration file (JSON).", required=False)
parser.add_argument('-i','--input', help="Input file of phrases to test.", requ... | apache-2.0 | Python |
61ce4b0818587a9011b9e2a229f7f183238b2b41 | Update django_conch/management/commands/conch.py | zacharyvoase/django-conch | django_conch/management/commands/conch.py | django_conch/management/commands/conch.py | # -*- coding: utf-8 -*-
from optparse import make_option
import json
import os
from django.core.management.base import BaseCommand
from django.db.models.loading import get_models, get_apps
from twisted.application import internet, service
from twisted.conch.insults import insults
from twisted.conch.manhole import Colo... | from optparse import make_option
import json
import os
from django.core.management.base import BaseCommand
from django.db.models.loading import get_models, get_apps
from twisted.application import internet, service
from twisted.conch.insults import insults
from twisted.conch.manhole import ColoredManhole
from twisted.... | unlicense | Python |
f94ec3aaffb25dbd47f53d9e524bf71e5311b16e | update call apis | biothings/biothings_explorer,biothings/biothings_explorer | biothings_explorer/call_apis/api_response_transform/transformers/utils.py | biothings_explorer/call_apis/api_response_transform/transformers/utils.py | from os.path import commonprefix
def generateCurie(idType, _id):
if isinstance(_id, list):
_id = _id[0]
elif isinstance(_id, int):
_id = str(_id)
if ":" in _id:
_id = _id.split(":")[-1]
return idType + ":" + _id
def find_longest_common_path(paths) -> str:
"""Find longest ... | from os.path import commonprefix
def generateCurie(idType, _id):
if isinstance(_id, list):
_id = _id[0]
elif isinstance(_id, int):
_id = str(_id)
if ":" in _id:
_id = _id.split(":")[-1]
return idType + ":" + _id
def find_longest_common_path(paths) -> str:
"""Find longest ... | apache-2.0 | Python |
8a8a06e4af831f3ea9db1dbc341cca545fb007bd | Add admin view for saved models | neutrons/web_reflectivity,neutrons/web_reflectivity | web_reflectivity/fitting/admin.py | web_reflectivity/fitting/admin.py | #pylint: disable=missing-docstring
"""
Admin views for models
"""
from django.contrib import admin
from fitting.models import ReflectivityModel, FitProblem, ReflectivityLayer, FitterOptions, Constraint, SavedModelInfo
class FitProblemAdmin(admin.ModelAdmin):
list_display = ('id', 'user', 'reflectivity_model', ... | #pylint: disable=missing-docstring
"""
Admin views for models
"""
from django.contrib import admin
from fitting.models import ReflectivityModel, FitProblem, ReflectivityLayer, FitterOptions, Constraint
class FitProblemAdmin(admin.ModelAdmin):
list_display = ('id', 'user', 'reflectivity_model', 'show_layers', '... | apache-2.0 | Python |
d87a0625b04ca48143715806da3801fa10932f05 | Remove `print` statement | ergl/pysellus,Pysellus/pysellus,angelsanz/pysellus | pysellus/integration_config.py | pysellus/integration_config.py | import os
import yaml
from pysellus.stock_integrations import integration_classes
CONFIGURATION_FILE_NAME = '.ps_integrations.yml'
# {integration_alias: integration_instance}
loaded_integrations = {}
def load_integrations(path):
"""
load_integrations :: String -> IO
Given a path, find the config fil... | import os
import yaml
from pysellus.stock_integrations import integration_classes
CONFIGURATION_FILE_NAME = '.ps_integrations.yml'
# {integration_alias: integration_instance}
loaded_integrations = {}
def load_integrations(path):
"""
load_integrations :: String -> IO
Given a path, find the config fil... | mit | Python |
f03cf52d7361ecb9d4806105704c4f92c364fb41 | Update quality_score_filter.py | amojarro/carrierseq,amojarro/carrierseq | python/quality_score_filter.py | python/quality_score_filter.py | from Bio import SeqIO
import math
from Tkinter import Tk
import sys
print("Applying quality filter")
name = sys.argv[1]
qs = float(sys.argv[3])
output = sys.argv[2]
count = 0
for rec in SeqIO.parse(name, "fastq"):
count += 1
print("%i reads in fastq file" % count)
qual_sequences = [] # Setup an empty list
cnt ... | from Bio import SeqIO
import math
from Tkinter import Tk
import sys
print("Applying quality filter")
name = sys.argv[1]
qs = float(sys.argv[3])
output = sys.argv[2]
count = 0
for rec in SeqIO.parse(name, "fastq"):
count += 1
print("%i reads in fastq file" % count)
qual_sequences = [] # Setup an empty list
cnt ... | mit | Python |
fd979e992da78967f7a99f1e81553a9d96fa28b4 | Fix error when Site model table does not exist | osantana/quickstartup,georgeyk/quickstartup,georgeyk/quickstartup,georgeyk/quickstartup,osantana/quickstartup,osantana/quickstartup | quickstartup/settings_utils.py | quickstartup/settings_utils.py | # coding: utf-8
#
# Extract heavy logic from settings.py, manage.py and wsgi.py
#
import logging
from django.core.exceptions import ImproperlyConfigured
from django.db import OperationalError
class CustomAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
messages = []
data = kwargs.... | # coding: utf-8
#
# Extract heavy logic from settings.py, manage.py and wsgi.py
#
import logging
class CustomAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
messages = []
data = kwargs.get('extra', {})
for key, value in sorted(data.items()):
if "pass" in key:
... | mit | Python |
5f50b0c02f421268efa86f36033ceabe3e9cfcd8 | Add external dependencies | odoo-brazil/odoo-brazil-hr,kmee/odoo-brazil-hr | l10n_br_hr_payroll/__openerp__.py | l10n_br_hr_payroll/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016 KMEE (http://www.kmee.com.br)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization HR Payroll',
'category': 'Localization',
'license': 'AGPL-3',
'author': 'KMEE, Odoo Community Association (OCA)',
'maintainer... | # -*- coding: utf-8 -*-
# Copyright (C) 2016 KMEE (http://www.kmee.com.br)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localization HR Payroll',
'category': 'Localization',
'license': 'AGPL-3',
'author': 'KMEE, Odoo Community Association (OCA)',
'maintainer... | agpl-3.0 | Python |
fcbb2ec6ebceebea0012971a831f2941d1943708 | Use select related for link_type | habeanf/Open-Knesset,jspan/Open-Knesset,noamelf/Open-Knesset,navotsil/Open-Knesset,OriHoch/Open-Knesset,noamelf/Open-Knesset,habeanf/Open-Knesset,noamelf/Open-Knesset,daonb/Open-Knesset,Shrulik/Open-Knesset,ofri/Open-Knesset,OriHoch/Open-Knesset,ofri/Open-Knesset,noamelf/Open-Knesset,MeirKriheli/Open-Knesset,DanaOshri/... | src/knesset/links/managers.py | src/knesset/links/managers.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
class LinksManager(models.Manager):
def for_model(self, model):
"""
QuerySet for all links for a particular model (either an instance or
a class).
... | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
class LinksManager(models.Manager):
def for_model(self, model):
"""
QuerySet for all links for a particular model (either an instance or
a class).
... | bsd-3-clause | Python |
b9b352c22aafbea28cffeb9315b825d04166c6f1 | Use up to date Django wsgi file. | linovia/fab-bundle,linovia/fab-bundle | fab_bundle/templates/wsgi.py | fab_bundle/templates/wsgi.py |
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| import os
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
| bsd-3-clause | Python |
ebfad02042b4653511dc808e5de50e056ff5142d | add elev | UoA-eResearch/earthquake-viz,UoA-eResearch/earthquake-viz | ascii_to_flat.py | ascii_to_flat.py | #!/usr/bin/env python
import sys
import time
inputs = sys.argv[1:]
matrix = {}
s = time.time()
for filename in inputs:
with open(filename) as f:
stats = {}
while True:
bits = f.readline().split()
if len(bits) == 2:
v = float(bits[1]) if '.' in bits[1] else int(bits[1])
stats[bi... | #!/usr/bin/env python
import sys
import time
inputs = sys.argv[1:]
matrix = {}
s = time.time()
for filename in inputs:
with open(filename) as f:
stats = {}
while True:
bits = f.readline().split()
if len(bits) == 2:
v = float(bits[1]) if '.' in bits[1] else int(bits[1])
stats[bi... | mit | Python |
5e7339ceb1439f5b2f95dd96cfd39e60a2356777 | Fix extradmin tests | trilan/lemon,trilan/lemon,trilan/lemon | lemon/extradmin/tests/__init__.py | lemon/extradmin/tests/__init__.py | from django import forms
from django.test import TestCase
from lemon import extradmin
from lemon.extradmin import settings
from lemon.extradmin.tests.admin import ArticleAdmin, CustomTextarea
from lemon.extradmin.tests.models import Article
class DefaultMarkupWidgetTestCase(TestCase):
def setUp(self):
s... | from django import forms
from django.test import TestCase
from lemon import extradmin
from lemon.extradmin import settings
from lemon.extradmin.tests.admin import ArticleAdmin, CustomTextarea
from lemon.extradmin.tests.models import Article
class DefaultMarkupWidgetTestCase(TestCase):
def setUp(self):
s... | bsd-3-clause | Python |
8604a39e28a12b9445391e0b9ac4071fa7414136 | add a profile to monitor the performance of program | ShujiaHuang/AsmVar2,ShujiaHuang/AsmVar2,ShujiaHuang/AsmVar2,ShujiaHuang/AsmVar2 | asmvar/AsmVar.py | asmvar/AsmVar.py | """
This is the main program of AsmVar. It's the most top interface of all the
AsmVar's tool sets.
"""
import sys
import profile
#### My Own Module
import check
import commandline_options as cmdopts
import executor as exe
def checking():
pass
return
def genotype():
gnt_opt = cmdopts.genotype()
gnt... | """
This is the main program of AsmVar. It's the most top interface of all the
AsmVar's tool sets.
"""
import sys
import profile
#### My Own Module
import check
import commandline_options as cmdopts
import executor as exe
def checking():
pass
return
def genotype():
gnt_opt = cmdopts.genotype()
gnt... | mit | Python |
fffccc683984d1c2d706d9fda2fd102f6f72e544 | fix keras2ckpt default out prefix | tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo | lingvo/tools/keras2ckpt.py | lingvo/tools/keras2ckpt.py | # Copyright 2018 The TensorFlow Authors. 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 applica... | # Copyright 2018 The TensorFlow Authors. 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 applica... | apache-2.0 | Python |
6b24bc001c81a989982221c431bc9288e406ac7f | Update headers for IPython 2.2 | bgruening/docker-ipython-notebook,bgruening/docker-ipython-notebook,bgruening/docker-jupyter-notebook,bgruening/docker-ipython-notebook,bgruening/docker-jupyter-notebook,bgruening/docker-jupyter-notebook | ipython_notebook_config.py | ipython_notebook_config.py | # See http://ipython.org/ipython-doc/1/interactive/public_server.html for more information.
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 6789
c.NotebookApp.open_browser = False
c.NotebookApp.profile = u'default'
c.IPKernelApp.matplotlib = 'inline'
import... | # See http://ipython.org/ipython-doc/1/interactive/public_server.html for more information.
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 6789
c.NotebookApp.open_browser = False
c.NotebookApp.profile = u'default'
c.IPKernelApp.matplotlib = 'inline'
import... | mit | Python |
a614e6dbaa08226952835afe69083b2e1c46a4e7 | Remove pip2 install clang from migration file (#2408) | RCOS-Grading-Server/HWserver,Submitty/Submitty,Submitty/Submitty,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserve... | migration/migrations/system/20180619110916_lichen_package_installation.py | migration/migrations/system/20180619110916_lichen_package_installation.py | import os
import subprocess
def up(config):
# c/c++ tokenizer
p1 = subprocess.Popen(['clang', '--version'], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['grep', '-o', '[0-9]\.[0-9]\{1,\}'], stdin=p1.stdout, stdout=subprocess.PIPE)
p3 = subprocess.Popen(['head', '-1'], stdin=p2.stdout, stdout=subproc... | import os
import subprocess
def up(config):
# c/c++ tokenizer
p1 = subprocess.Popen(['clang', '--version'], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['grep', '-o', '[0-9]\.[0-9]\{1,\}'], stdin=p1.stdout, stdout=subprocess.PIPE)
p3 = subprocess.Popen(['head', '-1'], stdin=p2.stdout, stdout=subproc... | bsd-3-clause | Python |
3dc8574a0cd8e9d55257b4cf5e1b17dfaf78f2c2 | fix url order | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/urls.py | molo/core/cookiecutter/scaffold/{{cookiecutter.directory}}/{{cookiecutter.app_name}}/urls.py | import os
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailsearch import urls as wagtailsearch_urls
from wagtail.wagtaildocs im... | import os
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtailsearch import urls as wagtailsearch_urls
from wagtail.wagtaildocs im... | bsd-2-clause | Python |
88aaf89a083eafc971722668b178498ab396c7bc | Add filter action to Template Versions tables | BiznetGIO/horizon,NeCTAR-RC/horizon,bac/horizon,yeming233/horizon,sandvine/horizon,yeming233/horizon,yeming233/horizon,yeming233/horizon,openstack/horizon,BiznetGIO/horizon,bac/horizon,coreycb/horizon,coreycb/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,sandvine/horizon,bac/horizon,BiznetGIO/horizon,openstack/horiz... | openstack_dashboard/dashboards/project/stacks/template_versions/tables.py | openstack_dashboard/dashboards/project/stacks/template_versions/tables.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 | Python |
c41a3b5f42fa5c91ef9cd6149766e75c1420b82c | use app_context when creating db | bnotified/api,bnotified/api | server/app_factory/create_app.py | server/app_factory/create_app.py | import wtforms_json
from flask import Flask
from server.routes.routes import define_routes
from server.login_manager import login_manager
from server.models import db
def create_app() -> Flask:
"""Creates and returns the Flask WSGI application
and initializes helping components"""
# Initialize json suppo... | import wtforms_json
from flask import Flask
from server.routes.routes import define_routes
from server.login_manager import login_manager
from server.models import db
def create_app() -> Flask:
"""Creates and returns the Flask WSGI application
and initializes helping components"""
# Initialize json suppo... | mit | Python |
20a1fcfce802ab67992f1d197882c74af7737f31 | Bump version to 2.1.0 | heroku/salesforce-bulk | salesforce_bulk/__version__.py | salesforce_bulk/__version__.py | __version__ = '2.1.0'
| __version__ = '2.0.0'
| mit | Python |
008ac2f7d70d2d1746bc853cfc664d35203d825c | fix service operation signatures - for now to defaults | ooici/marine-integrations | coi/exchange_management_service.py | coi/exchange_management_service.py | #!/usr/bin/env python
__author__ = 'Michael Meisinger'
from pyon.public import CFG, IonObject, log, RT, AT
from interface.services.coi.iexchange_management_service import BaseExchangeManagementService
class ExchangeManagementService(BaseExchangeManagementService):
def create_exchange_space(self, xs={}, org_id=... | #!/usr/bin/env python
__author__ = 'Michael Meisinger'
from pyon.public import CFG, IonObject, log, RT, AT
from interface.services.coi.iexchange_management_service import BaseExchangeManagementService
class ExchangeManagementService(BaseExchangeManagementService):
def create_exchange_space(self, xs=None, org_i... | bsd-2-clause | Python |
b0c8f3a82f5134fae578d2fb5967233a75ffb98a | Fix import script | dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api | project/apps/api/management/commands/import_join.py | project/apps/api/management/commands/import_join.py | import os
import csv
from unidecode import unidecode
from optparse import make_option
from django.core.management.base import (
BaseCommand,
CommandError,
)
from apps.api.models import (
GroupMember,
Contest,
Singer,
Quartet,
)
class Command(BaseCommand):
help = "Command to import conte... | import os
import csv
from unidecode import unidecode
from optparse import make_option
from django.core.management.base import (
BaseCommand,
CommandError,
)
from apps.api.models import (
GroupMember,
Contest,
Singer,
Quartet,
)
class Command(BaseCommand):
help = "Command to import conte... | bsd-2-clause | Python |
91f8e450917b07ebb5f7586572c076001b221868 | Add TF-specific tests for ReLU layer. | keras-team/keras,keras-team/keras | tests/keras/layers/advanced_activations_test.py | tests/keras/layers/advanced_activations_test.py | import pytest
from keras.utils.test_utils import layer_test
from keras import layers
from keras import backend as K
def test_leaky_relu():
for alpha in [0., .5, -1.]:
layer_test(layers.LeakyReLU, kwargs={'alpha': alpha},
input_shape=(2, 3, 4))
def test_prelu():
layer_test(layers.P... | import pytest
from keras.utils.test_utils import layer_test
from keras import layers
def test_leaky_relu():
for alpha in [0., .5, -1.]:
layer_test(layers.LeakyReLU, kwargs={'alpha': alpha},
input_shape=(2, 3, 4))
def test_prelu():
layer_test(layers.PReLU, kwargs={},
... | apache-2.0 | Python |
79dd629be9b858fd7bc73e7d16aecbb25de0d5db | Implement Bladed Cultist, Southsea Squidface, and Shadow Strike | NightKev/fireplace,jleclanche/fireplace,beheh/fireplace | fireplace/cards/wog/rogue.py | fireplace/cards/wog/rogue.py | from ..utils import *
##
# Minions
class OG_070:
"Bladed Cultist"
combo = Buff(SELF, "OG_070e")
OG_070e = buff(+1, +1)
class OG_267:
"Southsea Squidface"
deathrattle = Buff(FRIENDLY_WEAPON, "OG_267e")
OG_267e = buff(atk=2)
##
# Spells
class OG_073:
"Thistle Tea"
play = Draw(CONTROLLER).then(Give(CONTROL... | from ..utils import *
##
# Minions
##
# Spells
class OG_073:
"Thistle Tea"
play = Draw(CONTROLLER).then(Give(CONTROLLER, Copy(Draw.CARD)) * 2)
| agpl-3.0 | Python |
ce765c3a16bf960e6bbd71ef0b1bf2f513503fe1 | print syntax error in except handler | obleft/LAP,obleft/LAP | newsdata.py | newsdata.py | #!/usr/bin/env python
#
# newsdata.py -- helper module for newsstats.py reporting tool
#
import psycopg2
import sys
def connect():
"""Connect to the PostgreSQL database. Returns a database connection."""
try:
return psycopg2.connect(database="news")
except:
print ("You could not connect t... | #!/usr/bin/env python
#
# newsdata.py -- helper module for newsstats.py reporting tool
#
import psycopg2
import sys
def connect():
"""Connect to the PostgreSQL database. Returns a database connection."""
try:
return psycopg2.connect(database="news")
except:
print "You could not connect to... | mit | Python |
b8ad378a796ee867acfa3198e04d47a500dd90d3 | Add Leaky ReLU activation. Differentiation with autograd package confirmed to work correctly. | rushter/MLAlgorithms | mla/neuralnet/activations.py | mla/neuralnet/activations.py | import autograd.numpy as np
"""
References:
https://en.wikipedia.org/wiki/Activation_function
"""
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
def softmax(z):
# Avoid numerical overflow by removing max
e = np.exp(z - np.amax(z, axis=1, keepdims=True))
return e / np.sum(e, axis=1, keepdims=True)
... | import autograd.numpy as np
"""
References:
https://en.wikipedia.org/wiki/Activation_function
"""
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
def softmax(z):
# Avoid numerical overflow by removing max
e = np.exp(z - np.amax(z, axis=1, keepdims=True))
return e / np.sum(e, axis=1, keepdims=True)
... | mit | Python |
7899085ba6583e28333aa387efeb5be73fe5ad8e | Make runAnalysis accept a data folder on the command line | Nateowami/flex-languagedepot-metadata,Nateowami/flex-languagedepot-metadata | src/runAnalysis.py | src/runAnalysis.py | #!/usr/bin/python3
import os,sys
from LanguageDepotAnalyze import Runner
# config file is specified, then used for the program!
cfgName = 'config.json'
dataPath = '../data'
if len(sys.argv) == 2:
dataPath = sys.argv[1]
print("Analyzing directory %s\n" % dataPath)
runner = Runner(cfgName, dataPath)
runner.run()
| #!/usr/bin/python3
import os
from LanguageDepotAnalyze import Runner
# config file is specified, then used for the program!
cfgName = 'config.json'
dataPath = '../data'
runner = Runner(cfgName, dataPath)
runner.run()
| mit | Python |
23e1a4a5443636d1f73b1af345435917a1b27bd1 | use new db table name | eirki/kamera | kamera/database_manager.py | kamera/database_manager.py | #! python3.6
# coding: utf-8
from kamera.logger import log
import MySQLdb
from MySQLdb.cursors import DictCursor
import sshtunnel
from kamera import config
from kamera.mediatypes import KameraEntry
from typing import Set
class Cursor(DictCursor):
def execute(self, query, args=None):
log.debug(query % a... | #! python3.6
# coding: utf-8
from kamera.logger import log
import MySQLdb
from MySQLdb.cursors import DictCursor
import sshtunnel
from kamera import config
from kamera.mediatypes import KameraEntry
from typing import Set
class Cursor(DictCursor):
def execute(self, query, args=None):
log.debug(query % a... | mit | Python |
42fe686cc851a008348f3512df5bd2cfa95df71b | Fix typo. | lugovskoy/dts,AlexGerasimov/dts | formatter.py | formatter.py | import re
dictionary = {
'10_0': '10.0',
'10_1': '10.1',
'trunk': '<span class = tag>trunk</span>',
'EngineTests': 'Run Engine Tests',
'TaV': 'Run T&V',
'defects': 'Diff for defects',
'buildspec': 'Re-create buildspec',
'android-5.0.2_r1': 'Android <span class = tag>5.0.2 R1</span>... | import re
dictionary = {
'10_0': '10.0',
'10_1': '10.1',
'trunk': '<span class = tag>trunk</span>',
'EngineTests': 'Run Engine Tests',
'TaV': 'Run T&V',
'defects': 'Diff for defects',
'buildspec': 'Re-create buildspec'
'android-5.0.2_r1': 'Android <span class = tag>5.0.2 R1</span>'... | apache-2.0 | Python |
f6cad3a2bfeb4238da359c882fe7cbbaedb5d8b7 | Fix import that was breaking py3k | pypa/setuptools,pypa/setuptools,pypa/setuptools | setuptools/extension.py | setuptools/extension.py | from distutils.core import Extension as _Extension
from setuptools.dist import _get_unpatched
_Extension = _get_unpatched(_Extension)
try:
from Pyrex.Distutils.build_ext import build_ext
except ImportError:
have_pyrex = False
else:
have_pyrex = True
class Extension(_Extension):
"""Extension that uses... | from distutils.core import Extension as _Extension
from dist import _get_unpatched
_Extension = _get_unpatched(_Extension)
try:
from Pyrex.Distutils.build_ext import build_ext
except ImportError:
have_pyrex = False
else:
have_pyrex = True
class Extension(_Extension):
"""Extension that uses '.c' files... | mit | Python |
bd78b8c1bab94b5f048f8bc4895657f1fd36ddfc | Clean - tool is not required, as tool_supported are there | 0xc0170/project_generator,sarahmarshy/project_generator,hwfwgrp/project_generator,molejar/project_generator,project-generator/project_generator,ohagendorf/project_generator | project_generator/commands/clean.py | project_generator/commands/clean.py | # Copyright 2014-2015 0xc0170
#
# 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 2014-2015 0xc0170
#
# 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 |
f9ca1e5906ff971edc5d64925b830f7305d354a0 | use del instead of drop in yield.py | alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl | examples/dataframe/yield.py | examples/dataframe/yield.py | #!/usr/bin/env python
# Tai Sakuma <sakuma@cern.ch>
import pandas as pd
##__________________________________________________________________||
d1 = pd.read_table('tbl_process.txt', delim_whitespace = True)
d2 = pd.read_table('tbl_component_met.txt', delim_whitespace = True)
d3 = pd.read_table('tbl_nevt.txt', delim_whi... | #!/usr/bin/env python
# Tai Sakuma <sakuma@cern.ch>
import pandas as pd
##__________________________________________________________________||
d1 = pd.read_table('tbl_process.txt', delim_whitespace = True)
d2 = pd.read_table('tbl_component_met.txt', delim_whitespace = True)
d3 = pd.read_table('tbl_nevt.txt', delim_whi... | bsd-3-clause | Python |
864073bba0354bdd3b3dc348eaef3c49ee63c4be | Add additional explanation to dup | muddyfish/PYKE,muddyfish/PYKE | node/dup.py | node/dup.py | #!/usr/bin/env python
from nodes import Node
import copy
class Duplicate(Node):
char = "D"
args = 1
results = 0
default_arg = 2
def __init__(self, amount: Node.NumericLiteral):
self.results = amount
@Node.test_func(["test"], ["test", "test"])
@Node.test_func([1], [1... | #!/usr/bin/env python
from nodes import Node
import copy
class Duplicate(Node):
char = "D"
args = 1
results = 0
default_arg = 2
def __init__(self, amount: Node.NumericLiteral):
self.results = amount
@Node.test_func(["test"], ["test", "test"])
@Node.test_func([1], [1... | mit | Python |
2bf883741ce763bde729f2930af913c44a807cb5 | Add keyring to example config | mrts/ask-jira | jiraconfig-sample.py | jiraconfig-sample.py | import keyring
JIRA = {
"server": "https://example.com/jira/",
"user": "user",
"password": keyring.get_password("system", "user")
}
| JIRA = {
"server": "https://example.com/jira/",
"user": "user",
"password": "password"
}
| mit | Python |
a6a90c09c48233f5a0a3b931ba8fa532a7fcdfb2 | Bump version: 0.4.0 | what-studio/gauge | gauge/__about__.py | gauge/__about__.py | # -*- coding: utf-8 -*-
"""
gauge.__about__
~~~~~~~~~~~~~~~
"""
__version__ = '0.4.0'
__license__ = 'BSD'
__author__ = 'What! Studio'
__maintainer__ = 'Heungsub Lee'
__maintainer_email__ = 'sub@nexon.co.kr'
| # -*- coding: utf-8 -*-
"""
gauge.__about__
~~~~~~~~~~~~~~~
"""
__version__ = '0.3.6'
__license__ = 'BSD'
__author__ = 'What! Studio'
__maintainer__ = 'Heungsub Lee'
__maintainer_email__ = 'sub@nexon.co.kr'
| bsd-3-clause | Python |
8d78472bc78ac907080d33cf234e3b90a3376e10 | update example_related | ecoron/SerpScrap,ecoron/SerpScrap | examples/example_related.py | examples/example_related.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pprint
import serpscrap
def scrape(config, keywords):
scrap = serpscrap.SerpScrap()
scrap.init(config=config.get(), keywords=keywords)
return scrap.run()
def scrape_to_csv(config, keywords):
scrap = serpscrap.SerpScrap()
scrap.init(config=config.... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import pprint
import serpscrap
def scrape(config, keywords):
scrap = serpscrap.SerpScrap()
scrap.init(config=config.get(), keywords=keywords)
return scrap.run()
def scrape_to_csv(config, keywords):
scrap = serpscrap.SerpScrap()
scrap.init(config=config.... | mit | Python |
546f952f91fab90fbb705c07d117285687bdbc5c | Fix logging.config import | ging/keystone,promptworks/keystone,openstack/keystone,rushiagr/keystone,UTSA-ICS/keystone-kerberos,dims/keystone,rushiagr/keystone,jonnary/keystone,MaheshIBM/keystone,JioCloud/keystone,cbrucks/keystone_ldap,kwss/keystone,cernops/keystone,reeshupatel/demo,ajayaa/keystone,rajalokan/keystone,dsiddharth/access-keys,UTSA-IC... | keystone/common/logging.py | keystone/common/logging.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
"""Wrapper for built-in logging module."""
from __future__ import absolute_import
import functools
import logging
import logging.config
import pprint
from logging.handlers import SysLogHandler
from logging.handlers import WatchedFileHandler
# A list of things we want to ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
"""Wrapper for built-in logging module."""
from __future__ import absolute_import
import functools
import logging
import pprint
from logging.handlers import SysLogHandler
from logging.handlers import WatchedFileHandler
# A list of things we want to replicate from logging... | apache-2.0 | Python |
26527dca517dfb75d724bc7955d16ba6da497a5a | update ev trace generation | dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy | proto/pylearn2/create_ev_dataset.py | proto/pylearn2/create_ev_dataset.py | import sys
import os.path
sys.path.append(os.path.join(os.pardir,os.pardir))
import disaggregator as da
import disaggregator.PecanStreetDatasetAdapter as psda
import pickle
db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"
psda.set_url(db_url)
schema = 'shared'
tables = [u'validated_01_2014',... | import sys
import os.path
sys.path.append(os.path.join(os.pardir,os.pardir))
import disaggregator as da
import disaggregator.PecanStreetDatasetAdapter as psda
db_url = "postgresql://USERNAME:PASSWORD@db.wiki-energy.org:5432/postgres"
psda.set_url(db_url)
schema = 'shared'
tables = [u'validated_01_2014',
u'v... | mit | Python |
520d1a417466f37735c0f4539a57ae9ce352f201 | Add cube_viz.py to original repository | tonyyli/imapper2,tonyyli/imapper2 | cube_viz.py | cube_viz.py | """
Script for quickly visualizing 3D brightness temperature cubes. Requires PyQt4(?).
Author: Dongwoo Chung
"""
import argparse
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
parser = argparse.ArgumentParser()
parser.add_argument('cubefiles',nargs='+')
parser.ad... | import argparse
import numpy as np
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
parser = argparse.ArgumentParser()
parser.add_argument('cubefiles',nargs='+')
parser.add_argument('--tmax',nargs='?',type=float,default=10.)
args = parser.parse_args()
app = QtGui.QApplication([])
w = gl.GLViewWid... | mit | Python |
8d17ed7ccf829579c12df969f895e90566658d2e | Fix to py2 | Xarthisius/curldrop | curldrop.py | curldrop.py | import sqlite3
from flask import Flask, g, request, send_file, abort
from werkzeug import secure_filename
from uuid import uuid4
import datetime
from os import remove
from os.path import isfile
from contextlib import closing
app = Flask(__name__)
app.config.from_pyfile('config.py')
def get_now():
#return int(dat... | import sqlite3
from flask import Flask, g, request, send_file, abort
from werkzeug import secure_filename
from uuid import uuid4
import datetime
from os import remove
from os.path import isfile
from contextlib import closing
app = Flask(__name__)
app.config.from_pyfile('config.py')
def get_now():
return int(date... | mit | Python |
7e516bf39907f538c81f66e3ca1fd32266120fc1 | Use boto3 | opencivicdata/scrapers-ca,opencivicdata/scrapers-ca | pupa_settings.py | pupa_settings.py | import os
# Use the same directories as scrapers_ca_app.
CACHE_DIR = os.path.join(os.getcwd(), '..', '_cache')
SCRAPED_DATA_DIR = os.path.join(os.getcwd(), '..', '_data')
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgis://localhost/pupa')
os.environ['OCD_DIVISION_CSV'] = os.environ.get('OCD_DIVISION_CSV', os.pat... | import os
# Use the same directories as scrapers_ca_app.
CACHE_DIR = os.path.join(os.getcwd(), '..', '_cache')
SCRAPED_DATA_DIR = os.path.join(os.getcwd(), '..', '_data')
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgis://localhost/pupa')
os.environ['OCD_DIVISION_CSV'] = os.environ.get('OCD_DIVISION_CSV', os.pat... | mit | Python |
e0bc84ed7588b7ada3a4b20a7e3e92dde22394d2 | Comment on stock.picking | OCA/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil | l10n_br_stock_account/models/stock_picking.py | l10n_br_stock_account/models/stock_picking.py | # Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
class StockPicking(models.Model):
_name = 'stock.picking'
_inherit = [_name, 'l10n_br_fiscal.document.mixin']
@api.model
def _default_fiscal_operation(se... | # Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
class StockPicking(models.Model):
_name = 'stock.picking'
_inherit = [_name, 'l10n_br_fiscal.document.mixin']
@api.model
def _default_fiscal_operation(se... | agpl-3.0 | Python |
f9969c8c9869c1a6bd34598defc2c20a24d2127f | fix citation style | chainer/chainercv,yuyu2172/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv | chainercv/transforms/image/pca_lighting.py | chainercv/transforms/image/pca_lighting.py | import numpy
def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None):
"""Alter the intensities of input image using PCA.
This is used in training of AlexNet [1].
.. [1] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. \
ImageNet Classification with Deep Convolutional Neural Networks. \... | import numpy
def pca_lighting(img, sigma, eigen_value=None, eigen_vector=None):
"""Alter the intensities of input image using PCA.
This is used in training of AlexNet [Krizhevsky]_.
.. [Krizhevsky] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. \
ImageNet Classification with Deep Convolutional... | mit | Python |
cd7f28e424a5002fe380c289b0305e8f91e86a63 | Add comments to main gateway file | scel-hawaii/data-gateway,scel-hawaii/data-gateway | gateway.py | gateway.py | #!/usr/bin/env python
from xbee import ZigBee
import serial
import datetime
import logging
import sys
import os
import pickle
import time
class XBeeGateway:
def __init__(self):
print "Setup"
self.callbacks = []
"""
Set up an XBee Device
"""
def setup_xbee(self, serial_port, b... | #!/usr/bin/env python
from xbee import ZigBee
import serial
import datetime
import logging
import sys
import os
import pickle
import time
class XBeeGateway:
def __init__(self):
print "Setup"
self.callbacks = []
def register_callback(self, callback):
self.callbacks.append(callback)
... | mit | Python |
275f4783b59d181ce2651016e8901768463a968e | remove debug statement | VestalNetSciHigh/store,VestalNetSciHigh/store,VestalNetSciHigh/store | code/write_graph.py | code/write_graph.py | __author__ = 'VestalNetSciHigh'
# Output a .graphml file from data
from numpy import loadtxt
import networkx as nx
import settings
import time
import csv
DATATYPE = "clipped" # May use: "clipped" | "real", referring to whether or not a threshold was used
start_time = time.time()
output_string = ""
# load output f... | __author__ = 'VestalNetSciHigh'
# Output a .graphml file from data
from numpy import loadtxt
import networkx as nx
import settings
import time
import csv
DATATYPE = "clipped" # May use: "clipped" | "real", referring to whether or not a threshold was used
start_time = time.time()
output_string = ""
# load output f... | mit | Python |
3e0f42475623e29043fe40019f22333645940012 | increment dev version number | StanczakDominik/PlasmaPy | plasmapy/_metadata.py | plasmapy/_metadata.py | ##
# Package metadata
##
# Name
name = 'plasmapy'
# The version scheme is being discussed at:
# https://github.com/PlasmaPy/PlasmaPy/issues/25
version = '0.1.dev2'
# Long description / docstring
description = """
PlasmaPy is a community-developed and community-driven core Python
package for plasma physics.
"""
#... | ##
# Package metadata
##
# Name
name = 'plasmapy'
# The version scheme is being discussed at:
# https://github.com/PlasmaPy/PlasmaPy/issues/25
version = '0.1.dev1'
# Long description / docstring
description = """
PlasmaPy is a community-developed and community-driven core Python
package for plasma physics.
"""
#... | bsd-3-clause | Python |
dcea1f2c3bed3a79be0a55218df6698cc29d3bf5 | switch to Bazel for client generation (#44) | googleapis/python-bigquery-reservation,googleapis/python-bigquery-reservation | synth.py | synth.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, s... | # 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, s... | apache-2.0 | Python |
f683d93b0511b7d35a84b9ecd008243d1852741d | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/f53f67c9faee8e197afb335d28f32913b0ba2a47. | yongtang/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,yongtang/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,f... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "f53f67c9faee8e197afb335d28f32913b0ba2a47"
TFRT_SHA256 = "5bf38f856f1fa83bf6be9847d2f61e72f5ebfedff94354... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "37d129ec0c0ced25d2daea1fbd04350ca65db13b"
TFRT_SHA256 = "77ab692cac26d8e6e067e00e56e80f97154ab80c7ac1b2... | apache-2.0 | Python |
a226520ca8dec7ebae1d469358e300212af2d481 | Add comments | tic-ull/portal-del-investigador-cvn,tic-ull/portal-del-investigador-cvn | helpers.py | helpers.py | # -*- encoding: UTF-8 -*-
import hashlib
import os
# Do not touch. Uses self so it can be called in a django upload_to field
# https://stackoverflow.com/questions/17539720/django-model-with-filefield-dynamic-upload-to-argument
def get_md5_path(self):
md5 = hashlib.md5(self.user_profile.documento).hexdigest()[0:2... | # -*- encoding: UTF-8 -*-
import hashlib
import os
def get_md5_path(self):
md5 = hashlib.md5(self.user_profile.documento).hexdigest()[0:2]
return "cvn/%s/" % md5
def get_cvn_path(self, filename):
return os.path.join(
get_md5_path(self), self.user_profile.documento, filename)
| agpl-3.0 | Python |
acfe4b0370d5193dd558c7cebbb16abc2c91715e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/3c654806a782e31a597890bd9a661b1984fb973c. | google/tsl,google/tsl,google/tsl | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "3c654806a782e31a597890bd9a661b1984fb973c"
TFRT_SHA256 = "873724414811b6acdade930fadbf... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a65f38b7d767f4714134a0528feb5e7793354495"
TFRT_SHA256 = "f6a5c52aeb80c6a2725416bf3422... | apache-2.0 | Python |
73ccc543a946b6b676b6f52a9940be698ebad055 | Fix name. | PyBossa/pbs,PyBossa/pbs,PyBossa/pbs | helpers.py | helpers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of PyBOSSA.
#
# PyBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of PyBOSSA.
#
# PyBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | agpl-3.0 | Python |
8a03301d401a6fd2d8dc18d02454d146f4d3c226 | Update print function for course | donnell74/CSC-450-Scheduler | genetic/structures/course.py | genetic/structures/course.py | class Course:
def __init__(self, code, credit, instructor):
self.code = code
self.credit = credit
self.instructor = instructor
def __eq__(self, other):
if other == None:
return False
return self.code == other.code and \
self.credit == other.cr... | class Course:
def __init__(self, code, credit, instructor):
self.code = code
self.credit = credit
self.instructor = instructor
def __eq__(self, other):
if other == None:
return False
return self.code == other.code and \
self.credit == other.cr... | mit | Python |
cf441b6cbc196282e2bb5b075b56de170610d34d | Fix api poking example. | ohmygourd/dewbrick,ohmygourd/dewbrick,ohmygourd/dewbrick | dewbrick/majesticapi.py | dewbrick/majesticapi.py | import os
import requests
import json
BASE_URL = "https://api.majestic.com/api/json"
BASE_PARAMS = {'app_api_key': os.environ.get('THEAPIKEY')}
def get(cmd, params):
querydict = {'cmd': cmd}
querydict.update(BASE_PARAMS)
querydict.update(params)
response = requests.get(BASE_URL, params=querydict)
... | import requests
import json
BASE_URL = "https://api.majestic.com/api/json"
def get(cmd, params):
querydict = {'cmd': cmd}
querydict.update(BASE_PARAMS)
querydict.update(params)
response = requests.get(BASE_URL, params=querydict)
return json.loads(response.text)
if __name__ == '__main__':
res... | apache-2.0 | Python |
3d424eb87f585541706bd21cc7864f1468e475e3 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c1d04fa53a4b30f22906397d2371595bf38f790c. | Intel-tensorflow/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,tenso... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c1d04fa53a4b30f22906397d2371595bf38f790c"
TFRT_SHA256 = "f3dc8371ba4a6bee65f3ffe6137a... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "b4e0ba497200f080f95173470361e3f239ad3827"
TFRT_SHA256 = "6e8017011f5990acfb718fff47e6... | apache-2.0 | Python |
bd9ec09c5e84994e5cd3f3c2f9c61bd17681c582 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c1a4ad29f963d02512e1f6cb30ac50fb66f0c0fe. | Intel-tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,karllessard/tensorflow,frreiss/tensorflow-fred,Intel-tensorflow/tensor... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c1a4ad29f963d02512e1f6cb30ac50fb66f0c0fe"
TFRT_SHA256 = "98bff5a1e7a8991b3b4529364af2090c16a62444c5b9cd... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0a8c6996bd6a58eb0e7e2fe049ac67bf663e1950"
TFRT_SHA256 = "43ca6ad7e11b1736cd77ac24c3eff9006f347e86789452... | apache-2.0 | Python |
1c02689ecda1a68bf7a0bed6a6478f2d882fd0aa | Add server reconnecting | umbc-hackafe/htcpcp,umbc-hackafe/htcpcp,umbc-hackafe/htcpcp,umbc-hackafe/htcpcp | coffeeraspi/coffeeraspi.py | coffeeraspi/coffeeraspi.py | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import datetime
import teensy
import messages
def log(message):
print('{}: {}'.format(
datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
message))
async def contact_server(server, name, coffee_queue... | #!env/bin/python3
import argparse
import asyncio
import json
import socket
import websockets
import teensy
import messages
async def contact_server(server, name, coffee_queue):
async with websockets.connect(server) as sock:
await sock.send(json.dumps(dict(
message='Hello',
name=na... | apache-2.0 | Python |
219c474860ca7674070ef19fa95f0282b7c92399 | Order parents in Admin select field | ahernp/DMCM,ahernp/DMCM,ahernp/DMCM | mpages/admin.py | mpages/admin.py | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | from django.contrib import admin
from .models import Page, PageRead, Tag
class PageAdmin(admin.ModelAdmin):
search_fields = ["title"]
list_display = ["title", "parent", "updated"]
prepopulated_fields = {"slug": ("title",)}
readonly_fields = ["updated"]
ordering = ["parent", "title"]
filter_ho... | bsd-3-clause | Python |
32e9e09cda3525f4dbd4090e1eefef5172b5226a | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/947df7dc7396429c7870653ef305a840266805c6. | yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-p... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "947df7dc7396429c7870653ef305a840266805c6"
TFRT_SHA256 = "8b1e39d89c5c823c2a7a68ccc87a... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "846f99971387113acc4f790681f67b0c61253d20"
TFRT_SHA256 = "b3f88cfa664978b5c87ab923c0fa... | apache-2.0 | Python |
d2282a9dec3c7a7186db46f92828dfa689da5906 | test verbose option | rafaeldelucena/waterbutler,cosenal/waterbutler,TomBaxter/waterbutler,icereval/waterbutler,Johnetordoff/waterbutler,rdhyee/waterbutler,felliott/waterbutler,hmoco/waterbutler,CenterForOpenScience/waterbutler,chrisseto/waterbutler,RCOSDP/waterbutler,Ghalko/waterbutler,kwierman/waterbutler | tasks.py | tasks.py | import sys
from invoke import task, run
@task
def install(upgrade=False, pip_cache=None, wheel_repo=None):
cmd = 'pip install -r dev-requirements.txt'
if upgrade:
cmd += ' --upgrade'
if pip_cache:
cmd += ' --download-cache={}'.format(pip_cache)
if wheel_repo:
run('pip instal... | import sys
from invoke import task, run
@task
def install(upgrade=False, pip_cache=None, wheel_repo=None):
cmd = 'pip install -r dev-requirements.txt'
if upgrade:
cmd += ' --upgrade'
if pip_cache:
cmd += ' --download-cache={}'.format(pip_cache)
if wheel_repo:
run('pip instal... | apache-2.0 | Python |
4665e57774439f56037dd74437df1d0ec21666fc | Update c4.py | mindm/2017Challenges,popcornanachronism/2017Challenges,popcornanachronism/2017Challenges,erocs/2017Challenges,DakRomo/2017Challenges,mindm/2017Challenges,erocs/2017Challenges,popcornanachronism/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,erocs/2017Challenges,erocs/2017Challenges,DakRomo/2017Ch... | challenge_4/python/Atakyn/c4.py | challenge_4/python/Atakyn/c4.py | # invert a binary tree
class Node:
def __init__(self, value, left=None, right=None):
self.left = left
self.right = right
self.value = value
def print_tree(root):
if root is not None:
print_tree(root.left)
print(root.value)
print_tree(root.right)
def reverse(... | # invert a binary tree
class Node:
def __init__(self, value, left=None, right=None):
self.left = left
self.right = right
self.value = value
def print_tree(root):
if root is not None:
print_tree(root.left)
print(root.value)
print_tree(root.right)
def reverse(... | mit | Python |
92f7dfdf43448c6a857675138ab0e965801a709a | Fix for Android app description | aquatix/paragoo,aquatix/paragoo | plugins/androidapp.py | plugins/androidapp.py | """
paragoo plugin for retrieving card on an Android app
"""
import os
import requests
from bs4 import BeautifulSoup
class AppNotFoundException(Exception):
pass
def get_app_details(app_key):
url_full = 'https://play.google.com/store/apps/details?id=' + app_key
url = 'https://play.google.com/store/apps/d... | """
paragoo plugin for retrieving card on an Android app
"""
import os
import requests
from bs4 import BeautifulSoup
class AppNotFoundException(Exception):
pass
def get_app_details(app_key):
url_full = 'https://play.google.com/store/apps/details?id=' + app_key
url = 'https://play.google.com/store/apps/d... | apache-2.0 | Python |
a1fca57881531d8218a819a9d0fceb48eb8cb001 | Fix issue where groups will disappear in sidebar if emptied | noct/sublime-groupie | groupie.py | groupie.py | import sublime, sublime_plugin
from operator import methodcaller
from os.path import basename
from fnmatch import fnmatch
def move_to_end(view, group):
win = view.window()
win.set_view_index(view, group, len(win.views_in_group(group)))
class GroupieCommand(sublime_plugin.WindowCommand):
def sort_group(self, grou... | import sublime, sublime_plugin
from operator import methodcaller
from os.path import basename
from fnmatch import fnmatch
def move_to_end(view, group):
win = view.window()
win.set_view_index(view, group, len(win.views_in_group(group)))
class GroupieCommand(sublime_plugin.WindowCommand):
def sort_group(self, grou... | mit | Python |
5ea9f17f238a79043020713158915ac23db84fe7 | Use strftime to format the date and time of the commit. | bussiere/gitfs,rowhit/gitfs,ksmaheshkumar/gitfs,PressLabs/gitfs,PressLabs/gitfs | gitfs/views/history_index.py | gitfs/views/history_index.py |
from datetime import datetime
from errno import ENOENT
from stat import S_IFDIR
from pygit2 import GIT_SORT_TIME
from .view import View
from gitfs import FuseMethodNotImplemented, FuseOSError
from log import log
class HistoryIndexView(View):
def getattr(self, path, fh=None):
'''
Returns a dict... |
from datetime import datetime
from errno import ENOENT
from stat import S_IFDIR
from pygit2 import GIT_SORT_TIME
from .view import View
from gitfs import FuseMethodNotImplemented, FuseOSError
from log import log
class HistoryIndexView(View):
def getattr(self, path, fh=None):
'''
Returns a dict... | apache-2.0 | Python |
a76da8ddfad20b16ad54cbeb9269101b9d7ab887 | Update command of installing grunt | ioGrow/iogrowCRM,ioGrow/iogrowCRM,ioGrow/iogrowCRM | tasks.py | tasks.py | from invoke import task
from invoke import run
@task
def clean():
if raw_input("Are you sure to run clean, you will lose any file not added to git? y/[n]") == "y":
run("git clean -xfd")
@task
def install_libs():
run("pip install -r requirements.txt --upgrade --target ./libx") #python
run("bower install") #js... | from invoke import task
from invoke import run
@task
def clean():
if raw_input("Are you sure to run clean, you will lose any file not added to git? y/[n]") == "y":
run("git clean -xfd")
@task
def install_libs():
run("pip install -r requirements.txt --upgrade --target ./libx") #python
run("bower install") #js... | agpl-3.0 | Python |
d7be2f6853bbcb215db17e3dade53b4610313e0f | Enable `local.shell` when there is no state. | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/local.py | pyinfra/local.py | # pyinfra
# File: pyinfra/local.py
# Desc: run stuff locally, within the context of operations - utility for the CLI
from __future__ import print_function, unicode_literals
from os import path
from subprocess import PIPE, Popen, STDOUT
import six
from . import pseudo_state
from .api.exceptions import PyinfraError
f... | # pyinfra
# File: pyinfra/local.py
# Desc: run stuff locally, within the context of operations - utility for the CLI
from __future__ import print_function, unicode_literals
from os import path
from subprocess import PIPE, Popen, STDOUT
import six
from . import pseudo_state
from .api.exceptions import PyinfraError
f... | mit | Python |
62266cb3338282a1cd9fbc4a82fe52a4bc4598f7 | Fix wrong definition of 'EMR'. | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | python/example_code/emr/emrfs_step.py | python/example_code/emr/emrfs_step.py | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to run an elastic map reduce file system (EMRFS) command as a job step on
an Amazon EMR cluster. This can be used to automate EMRFS commands and is an
alternative to connecting through SSH ... | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to run an electronic medical record file system (EMRFS) command as a job step on an Amazon EMR cluster. This
can be used to automate EMRFS commands and is an alternative to connecting throu... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.