commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
15a37d1e86d9217eec218aadbe53d633335460ae | Fix block name. | xadmin/templatetags/xadmin_tags.py | xadmin/templatetags/xadmin_tags.py | from django import template
from django.template import Library
from django.utils import six
from django.utils.safestring import mark_safe
from xadmin.util import static, vendor as util_vendor
register = Library()
@register.simple_tag(takes_context=True)
def view_block(context, block_name, *args, **kwargs):
if '... | from django import template
from django.template import Library
from django.utils import six
from django.utils.safestring import mark_safe
from xadmin.util import static, vendor as util_vendor
register = Library()
@register.simple_tag(takes_context=True)
def view_block(context, block_name, *args, **kwargs):
if '... | Python | 0 |
1eb025811e5cc7df5b0185d34f053379d52b26ab | Remove create_admin command | manage.py | manage.py | from flask_script import Manager
from radar.app import create_app
from radar.lib.database import db
from radar.lib import fixtures
app = create_app('settings.py')
manager = Manager(app)
@manager.command
def create_tables():
db.drop_all()
db.create_all()
@manager.command
def drop_tables():
db.drop_all... | from flask_script import Manager
from radar.app import create_app
from radar.lib.database import db
from radar.models.users import User
from radar.lib import fixtures
app = create_app('settings.py')
manager = Manager(app)
@manager.command
def create_tables():
db.drop_all()
db.create_all()
@manager.comman... | Python | 0.000003 |
bc12ed9c9ecb108cd051feedd2dc74e9849b7e7c | Print all failures in pron rule eval test. | xh/evaluate_pronunciation_rules.py | xh/evaluate_pronunciation_rules.py | #! /usr/bin/python2 -u
# -*- coding: utf-8 -*-
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | #! /usr/bin/python2 -u
# -*- coding: utf-8 -*-
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | Python | 0.000001 |
74959fa6f12d5be7491f1fbf3d99b1678486c311 | bump version for release | slacksocket/version.py | slacksocket/version.py | version = '0.5.0'
| version = '0.4.4'
| Python | 0 |
cf4fd0c08049e42f724f0a00a7385ba32b3a51cd | Remove function show_hand | blackjack/blackjack.py | blackjack/blackjack.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from random import shuffle
class Blackjack(object):
def __init__(self):
self.money = 2000.00
def creat_deck(self, deck=1):
'''
Create card function, it is possible to create a deck with more cards.
Increases the difficulty for the p... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from random import shuffle
class Blackjack(object):
def __init__(self):
self.money = 2000.00
def creat_deck(self, deck=1):
'''
Create card function, it is possible to create a deck with more cards.
Increases the difficulty for the p... | Python | 0.000009 |
e3e3b59654133bd33c708343976825bb0c68d6f1 | use development config as default | manage.py | manage.py | #!/usr/bin/env python
import os
import errno
import logging
from flask import current_app
from flask.ext.script import Manager
from pypi_notifier import create_app, db, models, cache
logging.basicConfig(level=logging.DEBUG)
manager = Manager(create_app)
try:
# Must be a class name from config.py
config =... | #!/usr/bin/env python
import os
import errno
import logging
from flask import current_app
from flask.ext.script import Manager
from pypi_notifier import create_app, db, models, cache
logging.basicConfig(level=logging.DEBUG)
manager = Manager(create_app)
# Must be a class name from config.py
config = os.environ['P... | Python | 0.000001 |
f63c31349b3191ae46c7fd2f66e964a7b799f4ea | Remove --detach flag from "git checkout" | slave/skia_slave_scripts/utils/gclient_utils.py | slave/skia_slave_scripts/utils/gclient_utils.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module contains utilities for managing gclient checkouts."""
from common import find_depot_tools
import os
import shell_... | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module contains utilities for managing gclient checkouts."""
from common import find_depot_tools
import os
import shell_... | Python | 0.000003 |
b96877517bedc9934905ff6b79c4158e04d5f9b7 | initialize currentPoseName to None | software/ddapp/src/python/ddapp/jointcontrol.py | software/ddapp/src/python/ddapp/jointcontrol.py | import math
from ddapp.timercallback import TimerCallback
from ddapp.simpletimer import SimpleTimer
from ddapp import midi
class JointController(object):
def __init__(self, models, poseCollection=None):
#self.numberOfJoints = model.numberOfJoints()
self.numberOfJoints = 34
self.models = m... | import math
from ddapp.timercallback import TimerCallback
from ddapp.simpletimer import SimpleTimer
from ddapp import midi
class JointController(object):
def __init__(self, models, poseCollection=None):
#self.numberOfJoints = model.numberOfJoints()
self.numberOfJoints = 34
self.models = m... | Python | 0.999999 |
26fc40f3ca729147e838af4d98362484bed776df | Simplify main function in problem58.py | euler_python/problem58.py | euler_python/problem58.py | """
problem58.py
Starting with 1 and spiralling anticlockwise in the following way, a square
spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is intere... | """
problem58.py
Starting with 1 and spiralling anticlockwise in the following way, a square
spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is intere... | Python | 0.000004 |
b9e86baf8a7765a4a616ae5c4890263ea07cea14 | Add support for string filtering | zc_common/remote_resource/views.py | zc_common/remote_resource/views.py | from django.db.models import fields as model_fields
from django.db.models import Model
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
from rest_framework import viewsets
from rest_framework.exceptions import MethodNotAllowed
from rest_framework_json_api.views import Relationshi... | from django.db.models import Model
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
from rest_framework import viewsets
from rest_framework.exceptions import MethodNotAllowed
from rest_framework_json_api.views import RelationshipView as OldRelView
from zc_common.remote_resource.... | Python | 0.000001 |
a6ce64d251effaae77efd5e74d8121d0ff8280f4 | fix style and grammar | eventful/events/models.py | eventful/events/models.py | from collections import defaultdict
from django.contrib.auth.models import User
from django.db import models
from .managers import EventManager, EventInviteManager
class Event(models.Model):
PUBLIC = 'PB'
PRIVATE = 'PR'
FRIENDS = 'FR'
PRIVACY_CHOICES = (
(PUBLIC, 'Public'),
(PRIVATE... | from collections import defaultdict
from django.contrib.auth.models import User
from django.db import models
from .managers import EventManager, EventInviteManager
class Event(models.Model):
PUBLIC = 'PB'
PRIVATE = 'PR'
FRIENDS = 'FR'
PRIVACY_CHOICES = (
(PUBLIC, 'Public'),
(PRIVATE... | Python | 0.000005 |
68e32ab4c763461ffbbea6a3ed698f66fdb48d4d | Use only user_id and course_id during the kNN computation: speedup is 5x Previously most time was consumed in db queries and suprisingly in __hash__ methods (seem that hashing a django model takes longer that hashing a int) | catalog/predictions.py | catalog/predictions.py | from catalog.models import Course
import collections
from django.contrib.contenttypes.models import ContentType
from actstream.models import Follow
def distance(v1, v2):
absolute_difference = [abs(c1 - c2) for c1, c2 in zip(v1, v2)]
distance = sum(absolute_difference)
return distance
def get_users_follo... | from users.models import User
from catalog.models import Course
import collections
from django.contrib.contenttypes.models import ContentType
from actstream.models import Follow
def distance(v1, v2):
absolute_difference = [abs(c1 - c2) for c1, c2 in zip(v1, v2)]
distance = sum(absolute_difference)
return ... | Python | 0.000002 |
8d70c34e0a8c384ed42e3017ba744166ec439a50 | Use the ConsumerSet so all custom queues are purged as well. Thanks to Mat Clayton. | celery/task/control.py | celery/task/control.py | from celery import conf
from celery.messaging import BroadcastPublisher
from celery.messaging import with_connection, get_consumer_set
@with_connection
def discard_all(connection=None,
connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
"""Discard all waiting tasks.
This will ignore all tasks waiting fo... | from celery import conf
from celery.messaging import TaskConsumer, BroadcastPublisher, with_connection
@with_connection
def discard_all(connection=None,
connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
"""Discard all waiting tasks.
This will ignore all tasks waiting for execution, and they will
b... | Python | 0 |
797c4405aa2b75da9b7bdbb7e0e26f8bae3308b6 | handle BadPickleGet on restore | coopy/restore.py | coopy/restore.py | import logging
import fileutils
from snapshot import SnapshotManager
from foundation import RestoreClock
from cPickle import Unpickler, BadPickleGet
logger = logging.getLogger("coopy")
LOG_PREFIX = '[RESTORE] '
def restore(system, basedir):
#save current clock
current_clock = system._clock
#restore from... | import logging
import fileutils
from snapshot import SnapshotManager
from foundation import RestoreClock
from cPickle import Unpickler
logger = logging.getLogger("coopy")
LOG_PREFIX = '[RESTORE] '
def restore(system, basedir):
#save current clock
current_clock = system._clock
#restore from snapshot... | Python | 0 |
4c9b8a55d26df7421decdc05236499f61583ab38 | fix smart folder content getter | novaideo/utilities/smart_folder_utility.py | novaideo/utilities/smart_folder_utility.py | # -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from hypatia.util import ResultSet
from substanced.util import get_oid, find_objectmap
from novaideo.views.filter import (
find_entities)
fro... | # -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# avalaible on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from substanced.util import get_oid
from dace.util import get_obj
from novaideo.views.filter import (
find_entities)
from novaideo.utilities.... | Python | 0.000001 |
70db54eba970f8e8f6c42587675f1525002ea12f | Update wrong status code stated in docstring | hug/redirect.py | hug/redirect.py | """hug/redirect.py
Implements convience redirect methods that raise a redirection exception when called
Copyright (C) 2016 Timothy Edmund Crosley
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... | """hug/redirect.py
Implements convience redirect methods that raise a redirection exception when called
Copyright (C) 2016 Timothy Edmund Crosley
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... | Python | 0 |
1db7ef99aef8691600d74b23a751c6a753e2a5da | Update : Enhancing timer function and exec times storage | hurdles/base.py | hurdles/base.py | # -*- coding:utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
import time
from collections import namedtuple
from functools import wraps
from inspect import getmembers, ismethod
ExecTimeCollection = namedtuple('ExecTimeCollection', ['times', 'scale'])
def extra_setup(se... | # -*- coding:utf-8 -*-
# Copyright (c) 2012 theo crevon
#
# See the file LICENSE for copying permission.
import time
from functools import wraps
from inspect import getmembers, ismethod
def time_it(func, *args, **kwargs):
"""
Decorator whichs times a function execution.
"""
start = time.time()
... | Python | 0 |
aebe8c0b586b408b55b13d8ddd3a974c194455a6 | Update categorical_braninhoo_example.py | examples/categorical_braninhoo_example.py | examples/categorical_braninhoo_example.py | # In this example we will optimize the 'Braninhoo' optimization benchmark with a small twist to
# demonstrate how to set up a categorical variable. There is also a constraint on the function.
import whetlab
import numpy as np
# Define parameters to optimize
parameters = { 'X' : {'type':'float','min':0,'max':15,'size... | import whetlab
import numpy as np
# Define parameters to optimize
parameters = { 'X' : {'type':'float','min':0,'max':15,'size':1},
'Y' : {'type':'float','min':-5,'max':10,'size':1},
'Z' : {'type': 'enum', 'options': ['bad','Good!','OK']}}
#access_token = ''
name = 'Categorical Braninhoo'
... | Python | 0.000001 |
1db096e38a15543aa93ee20357f8f5369b60443d | Exclude failed nodes from pairing | models.py | models.py | """Define additional classes required for the Joint Estimation Experiment."""
from dallinger.experiments import Experiment
from dallinger.models import Network, Node, Info
from sqlalchemy import Integer
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import cast
from dallinger.nodes im... | """Define additional classes required for the Joint Estimation Experiment."""
from dallinger.experiments import Experiment
from dallinger.models import Network, Node, Info
from sqlalchemy import Integer
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import cast
from dallinger.nodes im... | Python | 0.000001 |
c3c986e08dadf3ecdd4f94eca6abf36c22a1c209 | Update DB/ Deploy | models.py | models.py | from sqlalchemy import create_engine, Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def db_connect():
"""
Performs database connection
Returns sqlalchemy engine instance
"""
return create_engine('postgres://fcvxvbdsuotypy:a3b010cca1f... | from sqlalchemy import create_engine, Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def db_connect():
"""
Performs database connection
Returns sqlalchemy engine instance
"""
return create_engine('postgres://fbcmeskynsvati:aURfAdENt6-... | Python | 0 |
6c71dd12abffefdaec062555283afc9346dacc0a | answering haitham questions | modles.py | modles.py | #encoding: utf-8
from django.db import models
#Haitham: (how models works? will the following model be defined in 1 database?)
#daonb: all models are deifned in one database - as define in the project's settings.py
#Haitham: (what does foreign key means?)
#daonb: a one-to-many relationship, helping you connect tw... | #encoding: utf-8
from django.db import models
#Haitham: (how models works? will the following model be defined in 1 database?)
#Haitham: (what does foreign key means?)
#Haitham: how the different model interact?
#Haitham: can we change the models (add/remove fields) in the future?
#Haitham: how to store use... | Python | 0.998489 |
fac8a172a16da011bab9e41afc52f24f833687fc | Simplify the date calculation | monday.py | monday.py | #! /usr/bin/env python
"""Run this during the week to write last week's short-form entry"""
from __future__ import print_function
from datetime import datetime, timedelta
import errno
import operator
import os
import sys
def sunday_after(dt, offset=1):
"""offset == 3 means 3rd Sunday from now, -2 means two Sun... | #! /usr/bin/env python
"""Run this during the week to write last week's short-form entry"""
from __future__ import print_function
from datetime import datetime, timedelta
import errno
import operator
import os
import sys
def sunday_after(dt, offset=1):
"""offset == 3 means 3rd Sunday from now, -2 means two Sun... | Python | 0.999998 |
8dbb1acb0800aef83a599fdd575c22824e5716da | initialize doctors field of the Act model when creating a new appointment | calebasse/actes/models.py | calebasse/actes/models.py | # -*- coding: utf-8 -*-
from django.db import models
from calebasse.agenda.models import Event, EventType
from calebasse.agenda.managers import EventManager
class Act(models.Model):
act_type = models.ForeignKey('ressources.ActType',
verbose_name=u'Type d\'acte')
validated = models.BooleanField(bl... | # -*- coding: utf-8 -*-
from django.db import models
from calebasse.agenda.models import Event, EventType
from calebasse.agenda.managers import EventManager
class Act(models.Model):
act_type = models.ForeignKey('ressources.ActType',
verbose_name=u'Type d\'acte')
validated = models.BooleanField(bl... | Python | 0 |
221d5a352d587eb80b146e79e2baf0d5269f439e | Fix resolution of Place-based locations to known ancestor | carmen/resolvers/place.py | carmen/resolvers/place.py | """Resolvers based on Twitter Places."""
from collections import defaultdict
from itertools import count
import re
import warnings
from ..location import Location, EARTH
from ..names import ALTERNATIVE_COUNTRY_NAMES, US_STATE_ABBREVIATIONS
from ..resolver import AbstractResolver
STATE_RE = re.compile(r'.+,\s*(\w+)... | """Resolvers based on Twitter Places."""
from collections import defaultdict
from itertools import count
import re
import warnings
from ..location import Location, EARTH
from ..names import ALTERNATIVE_COUNTRY_NAMES, US_STATE_ABBREVIATIONS
from ..resolver import AbstractResolver
STATE_RE = re.compile(r'.+,\s*(\w+)... | Python | 0.000004 |
a7bc9b1111630db55a2bbcd96a30145389937d20 | fix a pull | homeassistant/components/thermostat/zwave.py | homeassistant/components/thermostat/zwave.py | """
ZWave Thermostat.
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from homeassistant.components.thermostat import DOMAIN
from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, NETWORK,
ZWaveD... | """
ZWave Thermostat.
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from homeassistant.components.thermostat import DOMAIN
from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.components.zwave import (
ATTR_NODE_ID, ATTR_VALUE_ID, NETWORK,
ZWaveD... | Python | 0.0001 |
996a037cb90afa29305c61d8662fc9e3b5d508e5 | Add name to mixer | mopidy_alsamixer/mixer.py | mopidy_alsamixer/mixer.py | from __future__ import unicode_literals
import logging
import sys
import alsaaudio
from mopidy import mixer
import pykka
logger = logging.getLogger(__name__)
class AlsaMixer(pykka.ThreadingActor, mixer.Mixer):
name = 'alsamixer'
def __init__(self, config):
super(AlsaMixer, self).__init__()
... | from __future__ import unicode_literals
import logging
import sys
import alsaaudio
from mopidy import mixer
import pykka
logger = logging.getLogger(__name__)
class AlsaMixer(pykka.ThreadingActor, mixer.Mixer):
def __init__(self, config):
super(AlsaMixer, self).__init__()
self.config = confi... | Python | 0.000002 |
3a5dfcce22ef2e1da6c2ee680a6bf37228a3be2c | change view file for pantry | flask-api/api/blueprints/pantry/views.py | flask-api/api/blueprints/pantry/views.py | from flask import Blueprint, request, make_response, jsonify, g
from flask.views import MethodView
from flask_restful import Api, Resource, url_for
from api import bcrypt, db
from api.models.user import User
from api.models.ingredient import Ingredient, PantryIngredient
from api.decorators import is_logged_in
pantry_... | from flask import Blueprint, request, make_response, jsonify, g
from flask.views import MethodView
from flask_restful import Api, Resource, url_for
from api import bcrypt, db
from api.models.user import User
from api.models.ingredient import Ingredient, PantryIngredient
from api.decorators import is_logged_in
pantry_... | Python | 0 |
affe8fc9ab1f24aab0463898c84bd7fdaab3e0c1 | Make sure urlrewrite plugin only affects tasks it is configured in. fix #2812 | flexget/plugins/urlrewrite_urlrewrite.py | flexget/plugins/urlrewrite_urlrewrite.py | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
log = logging.getLogger('urlrewrite')
class UrlRewrite(object):
"""
Generic configurable ur... | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
log = logging.getLogger('urlrewrite')
class UrlRewrite(object):
"""
Generic configurable ur... | Python | 0 |
d4ef5e2cb956d7ac7b28497cdc849f7c2bc85712 | add radio by default | shop_catalog/settings.py | shop_catalog/settings.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
SLUG_FIELD_HELP_TEXT = _(
'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
'and can\'t start with a digit.')
PRODUCT_CHANGE_FORM_TE... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
SLUG_FIELD_HELP_TEXT = _(
'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
'and can\'t start with a digit.')
PRODUCT_CHANGE_FORM_TE... | Python | 0.000001 |
aa84a3b3a0b936ab29da5b0a8b3590841e787991 | add properties | biothings_explorer/dispatcher.py | biothings_explorer/dispatcher.py | # -*- coding: utf-8 -*-
"""
biothings_explorer.dispatcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains code that biothings_explorer use to communicate to and receive from APIs. It serves as a glue between "apicall" module and "api_output_parser" module.
"""
from collections import defaultdict
from .registry im... | # -*- coding: utf-8 -*-
"""
biothings_explorer.dispatcher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains code that biothings_explorer use to communicate to and receive from APIs. It serves as a glue between "apicall" module and "api_output_parser" module.
"""
from collections import defaultdict
from .registry im... | Python | 0.000001 |
0b635ffb77acb362c34769a72dfd6d0063c32f38 | Handle range of success codes | chargehound/api_requestor.py | chargehound/api_requestor.py | from __future__ import unicode_literals
import chargehound
import requests
from chargehound.error import create_chargehound_error
from chargehound.version import VERSION
class APIRequestor(object):
def parse_response(self, response):
payload = response.json()
if response.status_code < 400:
... | from __future__ import unicode_literals
import chargehound
import requests
from chargehound.error import create_chargehound_error
from chargehound.version import VERSION
class APIRequestor(object):
def parse_response(self, response):
payload = response.json()
if response.status_code == 200:
... | Python | 0 |
41537854b93137b9455c194645778d05e94ec33c | Fix error when deleting directories. | ide/projects.py | ide/projects.py | import errno
import os
import shutil
WORKSPACE_DIR = os.path.expanduser('~/mclab-ide-projects')
def get_all_projects():
mkdir_p(WORKSPACE_DIR)
return map(Project, os.listdir(WORKSPACE_DIR))
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST or ... | import errno
import os
import shutil
WORKSPACE_DIR = os.path.expanduser('~/mclab-ide-projects')
def get_all_projects():
mkdir_p(WORKSPACE_DIR)
return map(Project, os.listdir(WORKSPACE_DIR))
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST or ... | Python | 0 |
6ef5db75b8b5798e12baec25f5e1d6d26a8c29fa | fix conflict | blitzortung/dataimport/strike.py | blitzortung/dataimport/strike.py | # -*- coding: utf8 -*-
"""
Copyright 2014-2016 Andreas Würl
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 ap... | # -*- coding: utf8 -*-
"""
Copyright 2014-2016 Andreas Würl
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 ap... | Python | 0.031708 |
30089f005f62e84367aa6affd5acbd4920f8086a | fix installation on Arch | cfg/search/__main__.py | cfg/search/__main__.py | from pathlib import Path
from libdotfiles import HOME_DIR, PKG_DIR, packages, util
FZF_DIR = HOME_DIR / ".fzf"
if util.distro_name() == "arch":
packages.try_install("fzf") # super opener
packages.try_install("the_silver_searcher") # fzf dependency
packages.try_install("ripgrep") # super grep (shell)
... | from pathlib import Path
from libdotfiles import HOME_DIR, PKG_DIR, packages, util
FZF_DIR = HOME_DIR / ".fzf"
if util.distro_name() == "arch":
packages.try_install("fzf") # super opener
packages.try_install(
"silver-searcher-git"
) # super grep (vim-fzf dependency)
packages.try_install("ri... | Python | 0 |
a2efba8d942171249b3ed2f28497d84f81cbbb06 | Add lint test and format generated code (#4114) | java-language/google-cloud-language/synth.py | java-language/google-cloud-language/synth.py | # Copyright 2018 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 2018 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... | Python | 0 |
743b2593113a19382e60c3968897c871d98e20a8 | add alternate shorthand arguments, simplify shell execution | alfred.py | alfred.py | #!/usr/bin/python
import argparse, subprocess, re, sys
VERSION="0.1";
parser = argparse.ArgumentParser(description='''Execute a test''',)
parser.add_argument('-f', '--file', type=str, required=True, help="Filename of php file (ex 'script.php')")
parser.add_argument('-q', '--query', type=str, required=True, help="Valu... | #!/usr/bin/python
import argparse, subprocess, re, sys
VERSION="0.1";
parser = argparse.ArgumentParser(description='''Execute a test''',)
parser.add_argument('--file', type=str, required=True, help="Filename of php file (ex 'script.php')")
parser.add_argument('--query', type=str, required=True, help="Value to repla... | Python | 0.000005 |
031e99c3545de7e4e80ddb62a2603ec46e39ffab | Update db.py | app/db.py | app/db.py | # -*- coding: utf-8 -*-
import pymysql.cursors
import logging
import logging.config
logging.config.fileConfig('logging.conf')
db_logger = logging.getLogger()
config = {
'host':'172.17.0.2',
'port':3306,
'user':'root',
'password':'123456',
'db':'test',
'charset':'utf8',
}
connection = pymysql... | # -*- coding: utf-8 -*-
import pymysql.cursors
import logging
import logging.config
logging.config.fileConfig('logging.conf')
db_logger = logging.getLogger()
config = {
'host':'172.17.0.2',
'port':3306,
'user':'root',
'password':'123456',
'db':'test',
'charset':'utf8',
}
connection = pymysql... | Python | 0.000001 |
1a28b026ae586bfac43c55a6d92d801c0bd0d139 | use name as name | adhocracy4/filters/widgets.py | adhocracy4/filters/widgets.py | from itertools import chain
import django_filters
from django.db.models.fields import BLANK_CHOICE_DASH
from django.forms import TextInput
from django.forms.widgets import flatatt
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
class DropdownLinkWidget(django_fi... | from itertools import chain
import django_filters
from django.db.models.fields import BLANK_CHOICE_DASH
from django.forms import TextInput
from django.forms.widgets import flatatt
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
class DropdownLinkWidget(django_fi... | Python | 0.999127 |
f74aaf00050d0bbe14fe921efefcd04bd17f4174 | add intervals | bam2vcf_GATK_wolves.py | bam2vcf_GATK_wolves.py | #!/usr/bin/env python
#import argparse
#from glob import glob
#-s test_samples.txt
#-b /mnt/lfs2/hend6746/devils/reference/sarHar1.fa
#-i /mnt/home/hend6746/scratch/wolves/bed_files/baits_canfam3.1_sorted_merged.bed
from os.path import join as jp
from os.path import abspath
import os
import sys
import argparse
pars... | #!/usr/bin/env python
#import argparse
#from glob import glob
#-s test_samples.txt
#-b /mnt/lfs2/hend6746/devils/reference/sarHar1.fa
#-i /mnt/home/hend6746/scratch/wolves/bed_files/baits_canfam3.1_sorted_merged.bed
from os.path import join as jp
from os.path import abspath
import os
import sys
import argparse
pars... | Python | 0.999983 |
f32f72c136e9b7899732a6b2afbd4ff953faa4ca | Remove mnist dependency and replace with our own mnist download script | cleverhans/utils_mnist.py | cleverhans/utils_mnist.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import array
import functools
import gzip
import operator
import os
import struct
import tempfile
import numpy as np
from cleverhans import utils
def maybe_download_m... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from . import utils
def data_mnist(datadir='/tmp/', train_start=0, train_end=60000, test_start=0,
test_end=10000):
"""
Load a... | Python | 0 |
9c720cf806364e4eaf40da24691bc224a9288485 | Clean combo script | combo.py | combo.py | from libmproxy import filt
import proxyswitch as pswitch
def enable():
settings = ('127.0.0.1', '8080')
pswitch.enable(*settings)
def disable():
pswitch.disable()
def start(context, argv):
context.log(">>> start")
enable()
context.filter = filt.parse("~d ustwo.com")
def request(context, flo... | from flask import Flask
from libmproxy import filt
import proxyswitch as pswitch
# app = Flask('proxapp')
# @app.route('/')
# def hello_world():
# return 'Hello World!'
# @app.route('/foo')
# def foo():
# return 'foo'
def enable():
settings = ('127.0.0.1', '8080')
pswitch.enable(*settings)
def disa... | Python | 0 |
7204f13be70f92749ca88497d11a51fedcd65553 | Move back to `default_player_roles`. | meltingpot/python/utils/substrates/substrate_factory.py | meltingpot/python/utils/substrates/substrate_factory.py | # Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0.000002 |
e9151b46cdfd120daf5ecae00a551f23e85373da | Update comments to reflect config migration | beetsplug/mpdupdate.py | beetsplug/mpdupdate.py | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | Python | 0 |
250e166f02642e9d3c41f3854b6e9e12c560daba | update script for battle | battle.py | battle.py |
# Welcome to Battleship
# http://www.codecademy.com/courses/python-beginner-en-4XuFm/0/1?curriculum_id=4f89dab3d788890003000096
""" In this project you will build a simplified, one-player version of the
classic board game Battleship! In this version of the game, there will be a
single ship hidden in a random locati... |
# Welcome to Battleship
# http://www.codecademy.com/courses/python-beginner-en-4XuFm/0/1?curriculum_id=4f89dab3d788890003000096
""" In this project you will build a simplified, one-player version of the
classic board game Battleship! In this version of the game, there will be a
single ship hidden in a random locati... | Python | 0 |
3566e9a4d59779c1fca5cfa3031d03a1bb5a72ba | remove process executor option | cheeseprism/wsgiapp.py | cheeseprism/wsgiapp.py | from .jenv import EnvFactory
from cheeseprism.auth import BasicAuthenticationPolicy
from cheeseprism.resources import App
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.settings import asbool
import futures
import logging
import os
logger = logg... | from .jenv import EnvFactory
from cheeseprism.auth import BasicAuthenticationPolicy
from cheeseprism.resources import App
from functools import partial
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.settings import asbool
import futures
import logg... | Python | 0.000002 |
8eb938086a77a11cb2df8c83f872b9daa519f858 | fix pyhon3 compat issues in rename. | bento/compat/rename.py | bento/compat/rename.py | import os.path
import os
import random
import errno
def rename(src, dst):
"Atomic rename on windows."
# This is taken from mercurial
try:
os.rename(src, dst)
except OSError:
# If dst exists, rename will fail on windows, and we cannot
# unlink an opened file. Instead, the destina... | import os.path
import os
import random
def rename(src, dst):
"Atomic rename on windows."
# This is taken from mercurial
try:
os.rename(src, dst)
except OSError, err:
# If dst exists, rename will fail on windows, and we cannot
# unlink an opened file. Instead, the destination is ... | Python | 0 |
b61a45c13ffa82356f896f0914d2f28dabea7a7f | Include credentials for heat calling self | heat/engine/clients/os/heat_plugin.py | heat/engine/clients/os/heat_plugin.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
# ... | #
# 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
# ... | Python | 0.000114 |
05c210f1a5f83ebbea2319f48ba58eb054b32ce2 | fix indent | q_out_panel.py | q_out_panel.py | from . import chain
#show_q_output
class QOutPanelCommand(chain.ChainCommand):
def do(self, edit, input=None):
panel = self.view.window().get_output_panel("q")
syntax_file = "Packages/q KDB/syntax/q_output.tmLanguage"
try:
panel.set_syntax_file(syntax_file)
except Exception:
print("Unable to load synta... | from . import chain
#show_q_output
class QOutPanelCommand(chain.ChainCommand):
def do(self, edit, input=None):
panel = self.view.window().get_output_panel("q")
syntax_file = "Packages/q KDB/syntax/q_output.tmLanguage"
try:
sublime.load_binary_resource(syntax_file)
except Exception:... | Python | 0.00006 |
468544c29071e07dc0a8923d8924b5ec43f529e4 | 修复大于4M的文件hash计算错误的问题 | qiniu/utils.py | qiniu/utils.py | # -*- coding: utf-8 -*-
from hashlib import sha1
from base64 import urlsafe_b64encode, urlsafe_b64decode
from .config import _BLOCK_SIZE
from .compat import b, s
try:
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
def urlsafe_base64_encode(data):
"""urlsafe的base64编... | # -*- coding: utf-8 -*-
from hashlib import sha1
from base64 import urlsafe_b64encode, urlsafe_b64decode
from .config import _BLOCK_SIZE
from .compat import b, s
try:
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
def urlsafe_base64_encode(data):
"""urlsafe的base64编... | Python | 0.000001 |
62398ce1fde0402a9c4b77ff018e47716ba1fdd3 | allow restricting the refresh_useractions command by user | tndata_backend/goals/management/commands/refresh_useractions.py | tndata_backend/goals/management/commands/refresh_useractions.py | import logging
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from goals.models import CustomAction, UserAction
logger = logging.getLogger("loggly_logs")
class Command(BaseCommand):
help = 'Updates the next_trigger... | import logging
from django.core.management.base import BaseCommand
from goals.models import CustomAction, UserAction
logger = logging.getLogger("loggly_logs")
class Command(BaseCommand):
help = 'Updates the next_trigger_date field for stale UserActions and CustomActions.'
def handle(self, *args, **options)... | Python | 0.000001 |
5b6587cbe03ff79a29a400fb1f9b29d889b4edc5 | Make executable | appid.py | appid.py | #!/usr/bin/env python3
# Find a Steam appid given its name
import json
import os.path
import sys
from fuzzywuzzy import process, fuzz # ImportError? pip install 'fuzzywuzzy[speedup]'
CACHE_FILE = os.path.abspath(__file__ + "/../appid.json")
try:
with open(CACHE_FILE) as f:
appids = json.load(f)
except FileNotFound... | # Find a Steam appid given its name
import json
import os.path
import sys
from fuzzywuzzy import process, fuzz # ImportError? pip install 'fuzzywuzzy[speedup]'
CACHE_FILE = os.path.abspath(__file__ + "/../appid.json")
try:
with open(CACHE_FILE) as f:
appids = json.load(f)
except FileNotFoundError:
import requests... | Python | 0.004691 |
d2d090383d93e89bd8ce07d533715612cf472152 | Support lists of nodes in astpp | astpp.py | astpp.py | """
A pretty-printing dump function for the ast module. The code was copied from
the ast.dump function and modified slightly to pretty-print.
Alex Leone (acleone ~AT~ gmail.com), 2010-01-30
"""
from ast import *
def dump(node, annotate_fields=True, include_attributes=False, indent=' '):
"""
Return a format... | """
A pretty-printing dump function for the ast module. The code was copied from
the ast.dump function and modified slightly to pretty-print.
Alex Leone (acleone ~AT~ gmail.com), 2010-01-30
"""
from ast import *
def dump(node, annotate_fields=True, include_attributes=False, indent=' '):
"""
Return a format... | Python | 0 |
6b718b0fbfac2c7206a50a451a443079aad362ac | Make ESC navigate previous controllers | subiquity/controllers/__init__.py | subiquity/controllers/__init__.py | # Copyright 2015 Canonical, Ltd.
#
# This program 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 later version.
#
# This program is distribute... | # Copyright 2015 Canonical, Ltd.
#
# This program 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 later version.
#
# This program is distribute... | Python | 0 |
a1996022dd288b5a986cd07b2694f5af514296e4 | Delete unnecessary annotation in examples/bucket_policy.py | examples/bucket_policy.py | examples/bucket_policy.py |
import os
import oss2
import json
# 以下代码展示了bucket_policy相关API的用法,
# 具体policy书写规则参考官网文档说明
# 首先初始化AccessKeyId、AccessKeySecret、Endpoint等信息。
# 通过环境变量获取,或者把诸如“<你的AccessKeyId>”替换成真实的AccessKeyId等。
#
# 以杭州区域为例,Endpoint可以是:
# http://oss-cn-hangzhou.aliyuncs.com
# https://oss-cn-hangzhou.aliyuncs.com
access_key_id = os.ge... |
import os
import oss2
import json
# 以下代码展示了bucket_policy相关API的用法,
# 具体policy书写规则参考官网文档说明
# 首先初始化AccessKeyId、AccessKeySecret、Endpoint等信息。
# 通过环境变量获取,或者把诸如“<你的AccessKeyId>”替换成真实的AccessKeyId等。
#
# 以杭州区域为例,Endpoint可以是:
# http://oss-cn-hangzhou.aliyuncs.com
# https://oss-cn-hangzhou.aliyuncs.com
# 分别以HTTP、HTTPS协议访问。
... | Python | 0.000001 |
268d23ebd987a30312694eb95322b1dad332c291 | Update sender.py | adslproxy/sender.py | adslproxy/sender.py | import re
import time
import requests
from requests.exceptions import ConnectionError, ReadTimeout
from adslproxy.db import RedisClient
from adslproxy.config import *
import platform
if platform.python_version().startswith('2.'):
import commands as subprocess
elif platform.python_version().startswith('3.'):
im... | import re
import time
import requests
from requests.exceptions import ConnectionError, ReadTimeout
from adslproxy.db import RedisClient
from adslproxy.config import *
import platform
if platform.python_version().startswith('2.'):
import commands as subprocess
elif platform.python_version().startswith('3.'):
im... | Python | 0.000001 |
b3b753880a0a4e46c8e436f87d752f348503abb2 | Comment out problematic line for now | examples/custom_plugin.py | examples/custom_plugin.py | """
Defining a Custom Plugin
========================
Test the custom plugin demoed on the `Pythonic Perambulations
<http://jakevdp.github.io/blog/2014/01/10/d3-plugins-truly-interactive/>`_
blog. Hover over the points to see the associated sinusoid.
Use the toolbar buttons at the bottom-right of the plot to enable zo... | """
Defining a Custom Plugin
========================
Test the custom plugin demoed on the `Pythonic Perambulations
<http://jakevdp.github.io/blog/2014/01/10/d3-plugins-truly-interactive/>`_
blog. Hover over the points to see the associated sinusoid.
Use the toolbar buttons at the bottom-right of the plot to enable zo... | Python | 0 |
3665b8859f72ec416682857ab22f7e29fc30f0df | Add field on cached alignments to store more information | alignment/models.py | alignment/models.py | from django.db import models
# Create your models here.
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField()
gn_consensus = models.BinaryField(blank=True) # Store conservation calculation for each GN | from django.db import models
# Create your models here.
class AlignmentConsensus(models.Model):
slug = models.SlugField(max_length=100, unique=True)
alignment = models.BinaryField() | Python | 0 |
61e9b3db58c124cf41ede9fc9a3ad9c01e5bff81 | add select related query for group social links | sociallinks/templatetags/sociallink_tags.py | sociallinks/templatetags/sociallink_tags.py | # -*- coding: utf-8 -*-
from django import template
from django.contrib.contenttypes.models import ContentType
from sociallinks.models import SocialLink, SocialLinkGroup
register = template.Library()
@register.assignment_tag
def obj_social_links(obj):
"""return list of social links for obj. Obj is instance of a... | # -*- coding: utf-8 -*-
from django import template
from django.contrib.contenttypes.models import ContentType
from sociallinks.models import SocialLink, SocialLinkGroup
register = template.Library()
@register.assignment_tag
def obj_social_links(obj):
"""return list of social links for obj. Obj is instance of a... | Python | 0 |
709a7139b4f3acaace53e79c7ca1adafd8f24027 | Use tempfile to save modifications | basic.py | basic.py | """Run a basic simulation"""
import os
import tempfile
import hoomd
from hoomd import md
import molecule
import numpy as np
import pandas
import TimeDep
import gsd.hoomd
from StepSize import generate_steps
def run_npt(snapshot, temp, steps, **kwargs):
"""Initialise a hoomd simulation"""
with hoomd.context.i... | """Run a basic simulation"""
import os
import hoomd
import molecule
import numpy as np
import pandas
import TimeDep
from hoomd import md
import gsd.hoomd
from StepSize import generate_steps
def run_npt(snapshot, temp, steps, **kwargs):
"""Initialise a hoomd simulation"""
with hoomd.context.initialize(kwargs... | Python | 0 |
44f3c42c5eec3c0208dfdf688c80b1aba19ce097 | Fix unit test when running via `tox` in a VsCode bash shell on Windows. | smugcli/terminal_size.py | smugcli/terminal_size.py | #!/usr/bin/env python
# Source: https://gist.github.com/jtriley/1108174
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
originally retrieved from:
... | #!/usr/bin/env python
# Source: https://gist.github.com/jtriley/1108174
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
- get width and height of console
- works on linux,os x,windows,cygwin(windows)
originally retrieved from:
... | Python | 0 |
5d8e6e47964d80f380db27acd120136a43e80550 | Fix tool description in argparse help | aimpoint_mon/make_web_page.py | aimpoint_mon/make_web_page.py | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Make aimpoint monitor web page')
parser.add_argument("--data-root",
default=".",
... | #!/usr/bin/env python
import os
import argparse
import json
from pathlib import Path
from jinja2 import Template
import pyyaks.logger
def get_opt():
parser = argparse.ArgumentParser(description='Get aimpoint drift data '
'from aspect solution files')
parser.add_argument(... | Python | 0.000038 |
02e29e6f7904315dec5079a66cd242c1e48330f9 | Add filters to separate logging events from non-events | nodeconductor/core/log.py | nodeconductor/core/log.py | from __future__ import absolute_import, unicode_literals
import json
import logging
from logging.handlers import SocketHandler
from datetime import datetime
class EventLoggerAdapter(logging.LoggerAdapter, object):
"""
LoggerAdapter
"""
def __init__(self, logger):
super(EventLoggerAdapter, se... | from __future__ import absolute_import, unicode_literals
import json
import logging
from logging.handlers import SocketHandler
from datetime import datetime
class EventLoggerAdapter(logging.LoggerAdapter, object):
"""
LoggerAdapter
"""
def __init__(self, logger):
super(EventLoggerAdapter, se... | Python | 0 |
04b343ec18c4708f9e873e55510e07a9305835ee | add on_delete | analytics/models.py | analytics/models.py | from django.db import models
class Report(models.Model):
""" Represents a report.
"""
SUBACCOUNT_ACTIVITY = "subaccount_activity"
TYPE_CHOICES = (
(SUBACCOUNT_ACTIVITY, "SubAccount Activity"),
)
report_type = models.CharField(max_length=80, choices=TYPE_CHOICES)
started_date = mo... | from django.db import models
class Report(models.Model):
""" Represents a report.
"""
SUBACCOUNT_ACTIVITY = "subaccount_activity"
TYPE_CHOICES = (
(SUBACCOUNT_ACTIVITY, "SubAccount Activity"),
)
report_type = models.CharField(max_length=80, choices=TYPE_CHOICES)
started_date = mo... | Python | 0.000002 |
4a179d877ec9499448da4de05fdd03a0bbcf2300 | Change meta_updated instead of meta_created at update | collectors/base/record.py | collectors/base/record.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import uuid
import scrapy
import logging
from datetime import datetime
from abc import abstractmethod
from . import fields
logger = logging.getLog... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import uuid
import scrapy
import logging
from datetime import datetime
from abc import abstractmethod
from . import fields
logger = logging.getLog... | Python | 0 |
c6160abcb4fa716ed595e2d2e420656fef0d66a7 | Allow override base port when running tests locally | nginx.bzl | nginx.bzl | # Copyright (C) Endpoints Server Proxy Authors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of condi... | # Copyright (C) Endpoints Server Proxy Authors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of condi... | Python | 0.000008 |
628a98f034360bbe48d5a5a7bdaad90165251755 | update application | Controller/exp_monitorThroughput.py | Controller/exp_monitorThroughput.py | # Copyright (c) 2011-2013 Peng Sun. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYRIGHT file.
# HONE application
# monitor the throughputs across hosts of application trafclient
from hone_lib import *
from math import *
import time
K = 0.2
def query... | # Copyright (c) 2011-2013 Peng Sun. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYRIGHT file.
# HONE application
# monitor the throughputs across hosts of application trafclient
from hone_lib import *
from math import *
import time
K = 0.2
def query... | Python | 0.000001 |
619b08b6d19769220d7c2d230797473eb504ba24 | Update trns_validate_SBML_FBAModel.py | plugins/scripts/validate/trns_validate_SBML_FBAModel.py | plugins/scripts/validate/trns_validate_SBML_FBAModel.py | #!/usr/bin/python
# This code is part of KBase project to validate
#the sbml files
#PYTHON USE
import sys, getopt
import os.path
import subprocess
import json
import logging
#KBASE USE
import biokbase.Transform.script_utils as script_utils
desc1 = '''
NAME
trns_validate_KBaseFBA.SBML.py -- Validate the fasta f... | #!/usr/bin/python
# This code is part of KBase project to validate
#the sbml files
#PYTHON USE
import sys, getopt
import os.path
import subprocess
import json
import logging
#KBASE USE
import biokbase.Transform.script_utils as script_utils
desc1 = '''
NAME
trns_validate_KBaseFBA.SBML.py -- Validate the fasta f... | Python | 0.000001 |
36643e757214ac87a2418c94434e657eaf4adb8c | fix a possible bug in anyconfig.schema.validate that it may return success even if validation failed for some cases | anyconfig/schema.py | anyconfig/schema.py | #
# Copyright (C) 2015 Satoru SATOH <ssato redhat.com>
# License: MIT
#
"""anyconfig.schema module.
"""
from __future__ import absolute_import
import anyconfig.compat
try:
import jsonschema
except ImportError:
pass
_SIMPLETYPE_MAP = {list: "array", tuple: "array",
bool: "boolean",
... | #
# Copyright (C) 2015 Satoru SATOH <ssato redhat.com>
# License: MIT
#
"""anyconfig.schema module.
"""
from __future__ import absolute_import
import anyconfig.compat
try:
import jsonschema
except ImportError:
pass
_SIMPLETYPE_MAP = {list: "array", tuple: "array",
bool: "boolean",
... | Python | 0.000007 |
b31217a1a0ed68e0dfee2fdea87aad569c73573f | update batch timing | clock.py | clock.py | from apscheduler.schedulers.blocking import BlockingScheduler
from farmsList.imports import every_night_at_1am
from rq import Queue
from worker import conn
import logging
logging.basicConfig()
q = Queue(connection=conn)
sched = BlockingScheduler()
@sched.scheduled_job('cron', hour=21, minute=14)# hour=1)
def schedule... | from apscheduler.schedulers.blocking import BlockingScheduler
from farmsList.imports import every_night_at_1am
from rq import Queue
from worker import conn
import logging
logging.basicConfig()
q = Queue(connection=conn)
sched = BlockingScheduler()
@sched.scheduled_job('cron', hour=21, minute=11)# hour=1)
def schedule... | Python | 0 |
aed52a30f6a3131d0e5401ef3cb4c9e788fe3979 | Use new pull_requests api element | close_pull_requests.py | close_pull_requests.py | #!/usr/bin/env python
"""
Close PRs on repositories where the master is not on github.
Provide a closing comment, and print the lock URL if desired
"""
import argparse
import logging
import yaml
from client import get_github3_client
DEFAULT_MESSAGE = 'We do not use Pull Requests on this repo. Please see ' \... | #!/usr/bin/env python
"""
Close PRs on repositories where the master is not on github.
Provide a closing comment, and print the lock URL if desired
"""
import argparse
import logging
import yaml
from client import get_github3_client
DEFAULT_MESSAGE = 'We do not use Pull Requests on this repo. Please see ' \... | Python | 0 |
a34994bb6ae23f04627ab384fa2c2905997925a9 | Revert rendering. | web/views.py | web/views.py | import json
from django.http import Http404, HttpResponse
from django.views.generic import TemplateView
from django.shortcuts import redirect, render
from .models import Game, Player
from .utils import create_new_game, generate_unique_anonymous_username, calculate_stats
class HomeView(TemplateView):
template_na... | import json
from django.http import Http404, HttpResponse
from django.views.generic import TemplateView
from django.shortcuts import redirect, render
from django.template.loader import render_to_string
from .models import Game, Player
from .utils import create_new_game, generate_unique_anonymous_username, calculate_s... | Python | 0 |
f958ef0179f72adb4b8c7243fc30395de1c31d6b | add authentication now required by https://issues.apache.org/jira | utils/jira.py | utils/jira.py | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information#
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information#
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | Python | 0 |
afc99f3b6f01a0267c80ebab9f08538da07c9898 | Allow https urls for Youtube embeds | MarkdownPP/Modules/YoutubeEmbed.py | MarkdownPP/Modules/YoutubeEmbed.py | # Copyright (C) 2012 Alex Nisnevich
# Licensed under the MIT license
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import re
import os
from MarkdownPP.Module import Module
from MarkdownPP.Transform import Transform
youtube_url_re = re.compile('^... | # Copyright (C) 2012 Alex Nisnevich
# Licensed under the MIT license
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import re
import os
from MarkdownPP.Module import Module
from MarkdownPP.Transform import Transform
youtube_url_re = re.compile('^... | Python | 0 |
b631482e00e59224cb32682f6a9d221748368158 | Remove os package | fabfile.py | fabfile.py | from datetime import datetime
from fabric.api import (
cd,
env,
local,
put,
run,
sudo,
task
)
PRODUCTION_IP = '54.154.235.243'
PROJECT_DIRECTORY = '/home/ubuntu/ztm/'
BACKUP_DIRECTORY = '/home/ubuntu/backup/'
COMPOSE_FILE = 'compose-production.yml'
@task
def production():
env.run = ... | from datetime import datetime
import os
from fabric.api import (
cd,
env,
local,
put,
run,
sudo,
task
)
PRODUCTION_IP = '54.154.235.243'
PROJECT_DIRECTORY = '/home/ubuntu/ztm/'
BACKUP_DIRECTORY = '/home/ubuntu/backup/'
COMPOSE_FILE = 'compose-production.yml'
@task
def production():
... | Python | 0.000001 |
ea2b67cd016492f1869f50f899360c3151977e79 | Fix docstring term | csunplugged/topics/management/commands/_GlossaryTermsLoader.py | csunplugged/topics/management/commands/_GlossaryTermsLoader.py | """Custom loader for loading glossary terms."""
import os.path
from django.db import transaction
from utils.BaseLoader import BaseLoader
from topics.models import GlossaryTerm
class GlossaryTermsLoader(BaseLoader):
"""Custom loader for loading glossary terms."""
def __init__(self, glossary_folder_path, glo... | """Custom loader for loading glossary terms."""
import os.path
from django.db import transaction
from utils.BaseLoader import BaseLoader
from topics.models import GlossaryTerm
class GlossaryTermsLoader(BaseLoader):
"""Custom loader for loading glossary terms."""
def __init__(self, glossary_folder_path, glo... | Python | 0.000017 |
f4feca8d4c76806c4c1f088e606fb9e66e188c89 | Update cloudtrail mq plugin mapping | mq/plugins/cloudtrail.py | mq/plugins/cloudtrail.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.utilities.key_exists import key_exists
class message(object... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from mozdef_util.utilities.key_exists import key_exists
class message(object... | Python | 0 |
7ede70c94ce992b8c158e887c8d0dd11535ec5b6 | Rewrite maze to use more numpy arrays | Lib/maze.py | Lib/maze.py | '''
Algorithms related to generating and processing mazes, represented as boolean
numpy arrays.
'''
from __future__ import print_function
import numpy as np
import utils
def shrink(w_old, n):
if n < 1: raise Exception('Shrink factor >= 1')
elif n == 1: return w_old
elif n % 2 != 0: raise Exception('Shrink... | '''
Algorithms related to generating and processing mazes, represented as boolean
numpy arrays.
'''
from __future__ import print_function
import numpy as np
import utils
def shrink(w_old, n):
if n < 1: raise Exception('Shrink factor >= 1')
elif n == 1: return w_old
elif n % 2 != 0: raise Exception('Shrink... | Python | 0 |
179308a7061b2e0b1bb10d5c7757a611196608db | change fabfile | fabfile.py | fabfile.py | from distutils.util import strtobool
from fabric.api import local, abort, run, sudo
from fabric.context_managers import cd, settings, hide, shell_env
from fabric.contrib.console import confirm
from getpass import getpass
from fabric.utils import puts
from fabric.state import env
env.control_dir = 'pipecontrol'
def w... | from distutils.util import strtobool
from fabric.api import local, abort, run, sudo
from fabric.context_managers import cd, settings, hide, shell_env
from fabric.contrib.console import confirm
from getpass import getpass
from fabric.utils import puts
from fabric.state import env
env.control_dir = 'pipecontrol'
def w... | Python | 0.000001 |
3f4614720d376a8f8caf008f8a6930d97d65db1a | align french | SCT/benchmark_aligner.py | SCT/benchmark_aligner.py | import sys
import shutil, os
sys.path.insert(0, os.path.expanduser('~/Montreal-Forced-Aligner'))
import time
import logging
import platform
import csv
import statistics
from datetime import datetime
from aligner.command_line.train_and_align import align_corpus, align_corpus_no_dict
#corpus_dir = '/media/share/datase... | import sys
import shutil, os
sys.path.insert(0, os.path.expanduser('~/Montreal-Forced-Aligner'))
import time
import logging
import platform
import csv
import statistics
from datetime import datetime
from aligner.command_line.train_and_align import align_corpus, align_corpus_no_dict
#corpus_dir = '/media/share/datase... | Python | 0.999998 |
3d2b08a971ded9fa4bf3a3d7c69c15e589b6adab | add v0.8.1 (#21798) | var/spack/repos/builtin/packages/py-parso/package.py | var/spack/repos/builtin/packages/py-parso/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 PyParso(PythonPackage):
"""Parso is a Python parser that supports error recovery and round... | # 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 PyParso(PythonPackage):
"""Parso is a Python parser that supports error recovery and round... | Python | 0 |
deb2bb30b6f584a7a899d7c161605efadee468cf | add optional /geo suffix to /pollingstations | polling_stations/api/pollingstations.py | polling_stations/api/pollingstations.py | from rest_framework.decorators import list_route
from rest_framework.mixins import ListModelMixin
from rest_framework.viewsets import GenericViewSet
from rest_framework_gis.serializers import GeoFeatureModelSerializer
from pollingstations.models import PollingStation
class PollingStationSerializer(GeoFeatureModelSeri... | from rest_framework.mixins import ListModelMixin
from rest_framework.viewsets import GenericViewSet
from rest_framework_gis.serializers import GeoFeatureModelSerializer
from pollingstations.models import PollingStation
class PollingStationSerializer(GeoFeatureModelSerializer):
class Meta:
model = Polling... | Python | 0.000003 |
68f420099f1efc655757ec18097c6e389fa95cfb | fix case where an old subscriber subscribe again. it shouldn't stay flagged as old subscriber | product_subscription/models/invoice.py | product_subscription/models/invoice.py | # -*- coding: utf-8 -*-
from datetime import datetime
from openerp import models, fields, api
class AccountInvoice(models.Model):
_inherit = "account.invoice"
subscription = fields.Boolean(string="Subscription")
product_subscription_request = fields.One2many('product.subscription.request','inv... | # -*- coding: utf-8 -*-
from datetime import datetime
from openerp import models, fields, api
class AccountInvoice(models.Model):
_inherit = "account.invoice"
subscription = fields.Boolean(string="Subscription")
product_subscription_request = fields.One2many('product.subscription.request','inv... | Python | 0.000001 |
f961c1031285c5852e46f880668b963d27245ace | Rename _table to table | examples/tictactoe-qlearning.py | examples/tictactoe-qlearning.py | import random
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.player import AlphaBeta, RandPlayer
from capstone.util import ZobristHashing
class TabularQLearning(object):
def __init__(self, env, policy=RandPlayer(), alpha=0.1, gamma=... | import random
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.player import AlphaBeta, RandPlayer
from capstone.util import ZobristHashing
class TabularQLearning(object):
def __init__(self, env, policy=RandPlayer(), alpha=0.1, gamma=... | Python | 0.999999 |
dc40793ad27704c83dbbd2e923bf0cbcd7cb00ed | Handle both event instanciation from object and from serialized events | polyaxon/event_manager/event_service.py | polyaxon/event_manager/event_service.py | from libs.services import Service
class EventService(Service):
__all__ = ('record', 'setup')
event_manager = None
def can_handle(self, event_type):
return isinstance(event_type, str) and self.event_manager.knows(event_type)
def get_event(self, event_type, event_data=None, instance=None, **k... | from libs.services import Service
class EventService(Service):
__all__ = ('record', 'setup')
event_manager = None
def can_handle(self, event_type):
return isinstance(event_type, str) and self.event_manager.knows(event_type)
def get_event(self, event_type, instance, **kwargs):
return... | Python | 0.000011 |
afc0b8cfb34830154b684732d395e68729e3a42f | remove obsolete test | corehq/apps/accounting/tests/test_forms.py | corehq/apps/accounting/tests/test_forms.py | from dateutil.relativedelta import relativedelta
import random
from corehq.apps.accounting.tasks import generate_invoices
from corehq.apps.accounting.forms import AdjustBalanceForm
from corehq.apps.accounting.models import (
CreditAdjustmentReason,
CreditLine,
Invoice,
)
from corehq.apps.accounting.tests.t... | from dateutil.relativedelta import relativedelta
import random
from corehq.apps.accounting.tasks import generate_invoices
from corehq.apps.accounting.forms import AdjustBalanceForm
from corehq.apps.accounting.models import (
CreditAdjustmentReason,
CreditLine,
Invoice,
)
from corehq.apps.accounting.tests.t... | Python | 0.002319 |
19e5608b2d8d16e2c80390927658e8f322dd10e6 | Add new encodings. (#3292) | speech/google/cloud/speech/encoding.py | speech/google/cloud/speech/encoding.py | # Copyright 2016 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 applicable law or agreed to in writing, ... | # Copyright 2016 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 applicable law or agreed to in writing, ... | Python | 0 |
0b82616ca79c9c1fb33ccec8406720160fe053a2 | Prepend manga name for starkana | src/parsers/starkana.py | src/parsers/starkana.py | #!/usr/bin/python
import re
from parsers.base import SiteParserBase
from util import getSourceCode
class Starkana(SiteParserBase):
#re_getPage = re.compile("<option.*?value=\"([^']*?)\"[^>]*>\s*(\d*)</option>")
re_getMaxPages = re.compile('</select> of <strong>(\d*)')
re_getImage = re.compile('img.*?cla... | #!/usr/bin/python
import re
from parsers.base import SiteParserBase
from util import getSourceCode
class Starkana(SiteParserBase):
#re_getPage = re.compile("<option.*?value=\"([^']*?)\"[^>]*>\s*(\d*)</option>")
re_getMaxPages = re.compile('</select> of <strong>(\d*)')
re_getImage = re.compile('img.*?cla... | Python | 0 |
b2f2fcd9322837ea096a28ae584c8d236232c5a5 | remove jython2.5 compat code | proton-j/src/main/resources/cproton.py | proton-j/src/main/resources/cproton.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Python | 0.000001 |
5a71c7b3c98f17da619f630f4fe201da1efbee17 | fix indentation of section checks (should be outside of the loop) | rowprocsv.py | rowprocsv.py | """
Module for reading and exporting csv files exported from Concept2 RowPro
"""
import datetime
import tcx
class RowProCSV:
HEADER_SUMMARY = 'Date,TotalTime,TotalDistance,'
FIELDS_SUMMARY = [
'date', 'total_time', 'total_distance', 'avg_pace', 'unit', 'origin', 'total_cals', 'duty_cycle', 'type', '... | """
Module for reading and exporting csv files exported from Concept2 RowPro
"""
import datetime
import tcx
class RowProCSV:
HEADER_SUMMARY = 'Date,TotalTime,TotalDistance,'
FIELDS_SUMMARY = [
'date', 'total_time', 'total_distance', 'avg_pace', 'unit', 'origin', 'total_cals', 'duty_cycle', 'type', '... | Python | 0 |
27354d34f4f9117c0a3167f4af7d3e3c83d51c59 | bump version # from 0.6.0 -> 0.7.0 | cloudfeaster/__init__.py | cloudfeaster/__init__.py | __version__ = '0.7.0'
| __version__ = '0.6.0'
| Python | 0 |
38d298a81aa8fcd85b16b3879c1665085e5450be | Add description where student should add logic | exercises/control_flow/prime.py | exercises/control_flow/prime.py | #!/bin/python
def is_prime(integer):
"""Determines weather integer is prime, returns a boolean value"""
# add logic here to make sure number < 2 are not prime
for i in range(2, integer):
if integer % i == 0:
return False
return True
print("Should be False (0): %r" % is_prime(0... | #!/bin/python
def is_prime(integer):
"""Determines weather integer is prime, returns a boolean value"""
for i in range(2, integer):
if integer % i == 0:
return False
return True
print("Should be False (0): %r" % is_prime(0))
print("Should be False (1): %r" % is_prime(1))
print("Sho... | Python | 0.000086 |
d5b326d8d368d2ac75c6e078572df8c28704c163 | Use the app string version of foreign keying. It prevents a circular import. | vcs/models.py | vcs/models.py | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | Python | 0 |
8a4d9d18f29abacbce5216f8b4dad07fa879162e | print explicit << DRY RUN >> in summary | redis-migrate/migrate.py | redis-migrate/migrate.py | #!/usr/bin/env python
import os
import argparse
from urlparse import urlparse
import redis
from termcolor import cprint
DEBUG = os.environ.get("DEBUG")
DRY_RUN = os.environ.get("DRY_RUN")
CLEAN_UP = os.environ.get("CLEAN_UP")
if os.environ.get("REPLACE_DST_KEYS"):
REPLACE_DST_KEYS = True
else:
REPLACE_DST_KE... | #!/usr/bin/env python
import os
import argparse
from urlparse import urlparse
import redis
from termcolor import cprint
DEBUG = os.environ.get("DEBUG")
DRY_RUN = os.environ.get("DRY_RUN")
CLEAN_UP = os.environ.get("CLEAN_UP")
if os.environ.get("REPLACE_DST_KEYS"):
REPLACE_DST_KEYS = True
else:
REPLACE_DST_KE... | Python | 0.000004 |
3b001eac78349e1e3f6235b14def0fa6752f6fba | add more dedup special cases | models/dedup_special_cases.py | models/dedup_special_cases.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
data = [
{
"main_profile": ("Hadley Wickham", "cran:reshape"),
"people_to_merge": [
("Hadley Wickham", "cran:GGally")
]
},
{
"main_profile": ("Barry Rowlingson", "cran:geonames"),
"people_to_merge": [
("B. S. Rowlingson", "cran:lgcp"),
("Barry Rowlingson"... | #!/usr/bin/python
# -*- coding: utf-8 -*-
data = [
{
"main_profile": ("Hadley Wickham", "cran:reshape"),
"people_to_merge": [
("Hadley Wickham", "cran:GGally")
]
},
{
"main_profile": ("Barry Rowlingson", "cran:geonames"),
"people_to_merge": [
("B. S. Rowlingson", "cran:lgcp"),
("Barry Rowlingson"... | Python | 0 |
950b99ab173a4e5bf86a6df2dcbcf14e2e28915c | Add function parentheses | clowder/model/project.py | clowder/model/project.py | """Model representation of clowder.yaml project"""
import os
from termcolor import colored
from clowder.utility.git_utilities import (
git_clone_url_at_path,
git_current_sha,
git_litter,
git_status,
git_sync,
git_sync_version,
git_validate_repo_state
)
class Project(object):
"""Model c... | """Model representation of clowder.yaml project"""
import os
from termcolor import colored
from clowder.utility.git_utilities import (
git_clone_url_at_path,
git_current_sha,
git_litter,
git_status,
git_sync,
git_sync_version,
git_validate_repo_state
)
class Project(object):
"""Model c... | Python | 0.998877 |
1abbca6200fa3da0a3216b18b1385f3575edb49a | Move import of Django's get_version into django-registration's get_version, to avoid dependency-order problems. | registration/__init__.py | registration/__init__.py | VERSION = (0, 9, 0, 'beta', 1)
def get_version():
from django.utils.version import get_version as django_get_version
return django_get_version(VERSION) # pragma: no cover
| from django.utils.version import get_version as django_get_version
VERSION = (0, 9, 0, 'beta', 1)
def get_version():
return django_get_version(VERSION) # pragma: no cover
| Python | 0 |
db5cb125fb9b0dd4d3b781d0b85250bdc7a52cba | fix error msg | dvc/command/add.py | dvc/command/add.py | from dvc.exceptions import DvcException
from dvc.command.common.base import CmdBase
class CmdAdd(CmdBase):
def run(self):
for target in self.args.targets:
try:
self.project.add(target)
except DvcException as ex:
self.project.logger.error('Failed to a... | from dvc.exceptions import DvcException
from dvc.command.common.base import CmdBase
class CmdAdd(CmdBase):
def run(self):
for target in self.args.targets:
try:
self.project.add(target)
except DvcException as ex:
self.project.logger.error('Failed to a... | Python | 0 |
3dd67c1d4fbda2d5006c49a5b49345c550c66091 | extend towline backward instead | lib/void/ship.py | lib/void/ship.py | # Copyright (c) 2008 Mikael Lind
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distr... | # Copyright (c) 2008 Mikael Lind
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distr... | Python | 0 |
969b99f02f7db10103eb426e0a31e569998a82ae | fix #2394 | module/plugins/hoster/Http.py | module/plugins/hoster/Http.py | # -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.internal.Hoster import Hoster
class Http(Hoster):
__name__ = "Http"
__type__ = "hoster"
__version__ = "0.06"
__status__ = "testing"
__pattern__ = r'(?:jd|pys?)://.+'
__config__ = [("activated", "bool", "Activated"... | # -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.internal.Hoster import Hoster
class Http(Hoster):
__name__ = "Http"
__type__ = "hoster"
__version__ = "0.06"
__status__ = "testing"
__pattern__ = r'(?:jd|pys?)://.+'
__config__ = [("activated", "bool", "Activated"... | Python | 0 |
b5d32a3b1b8e85222497c4736c0c6707003dc848 | Fix broken database IO tests. | pybtex/tests/database_test/__init__.py | pybtex/tests/database_test/__init__.py | # Copyright (C) 2009 Andrey Golovizin
#
# This program 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.
#
# This program is distribut... | # Copyright (C) 2009 Andrey Golovizin
#
# This program 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.
#
# This program is distribut... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.