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
8b96a3189f744820763b77075a08f67c898075d4
Remove default log handlers
NewAcropolis/api,NewAcropolis/api,NewAcropolis/api
app/__init__.py
app/__init__.py
import os import logging from logging.handlers import RotatingFileHandler from flask import Blueprint, Flask from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() application = Flask(__name__) def create_app(**kwargs): from app.config import configs environment_state = get_env() application.config...
import os import logging from logging.handlers import RotatingFileHandler from flask import Blueprint, Flask from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() application = Flask(__name__) def create_app(**kwargs): from app.config import configs environment_state = get_env() application.config...
mit
Python
2fe22f80d2a75dec50d2af56df16669149b1197d
change version
kontron/robotframework-ipmilibrary
src/IpmiLibrary/version.py
src/IpmiLibrary/version.py
# This file was autogenerated by setup.py __version__ = '0.2.2'
# This file was autogenerated by setup.py __version__ = '0.2.1-dirty'
apache-2.0
Python
88de184c1d9daa79e47873b0bd8912ea67b32ec1
Change the VCAP_SERVICE key for elasticsearch
alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api
app/__init__.py
app/__init__.py
from flask import Flask import base64 import json from config import config as configs from flask.ext.elasticsearch import FlaskElasticsearch from dmutils import init_app, flask_featureflags feature_flags = flask_featureflags.FeatureFlag() elasticsearch_client = FlaskElasticsearch() def create_app(config_name): ...
from flask import Flask import base64 import json from config import config as configs from flask.ext.elasticsearch import FlaskElasticsearch from dmutils import init_app, flask_featureflags feature_flags = flask_featureflags.FeatureFlag() elasticsearch_client = FlaskElasticsearch() def create_app(config_name): ...
mit
Python
15f1abef288411539b512f6bdb572c4a54aa5447
Correct down_revision dag_id/state index creation
lyft/incubator-airflow,artwr/airflow,mrkm4ntr/incubator-airflow,stverhae/incubator-airflow,hamedhsn/incubator-airflow,OpringaoDoTurno/airflow,dgies/incubator-airflow,preete-dixit-ck/incubator-airflow,AllisonWang/incubator-airflow,gilt/incubator-airflow,mtagle/airflow,malmiron/incubator-airflow,sekikn/incubator-airflow,...
airflow/migrations/versions/127d2bf2dfa7_add_dag_id_state_index_on_dag_run_table.py
airflow/migrations/versions/127d2bf2dfa7_add_dag_id_state_index_on_dag_run_table.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
3321b1bbaf6f68a823eb625f8921d14b8caf574a
Fix user reference on admin membership page
wagnerand/olympia,mozilla/olympia,diox/olympia,kumar303/addons-server,mozilla/addons-server,kumar303/addons-server,atiqueahmedziad/addons-server,psiinon/addons-server,wagnerand/olympia,eviljeff/olympia,diox/olympia,bqbn/addons-server,aviarypl/mozilla-l10n-addons-server,wagnerand/addons-server,eviljeff/olympia,kumar303/...
src/olympia/access/admin.py
src/olympia/access/admin.py
from django.core.urlresolvers import reverse from django.contrib import admin from django.utils.html import format_html from .models import Group, GroupUser class GroupUserInline(admin.TabularInline): model = GroupUser raw_id_fields = ('user',) readonly_fields = ('user_profile_link',) def user_profi...
from django.core.urlresolvers import reverse from django.contrib import admin from django.utils.html import format_html from .models import Group, GroupUser class GroupUserInline(admin.TabularInline): model = GroupUser raw_id_fields = ('user',) readonly_fields = ('user_profile_link',) def user_profi...
bsd-3-clause
Python
a026662fb1ba7a99c4323fa4a1d9731f437cda3a
Update makedb
jasonsbrooks/ysniff-software,jasonsbrooks/ysniff-software
devops/makedb.py
devops/makedb.py
import boto.dynamodb dynamoconn = boto.dynamodb.connect_to_region('us-east-1') table_schema_macs = dynamoconn.create_schema(hash_key_name='MAC',hash_key_proto_value=str) table_schema_ips = dynamoconn.create_schema(hash_key_name='LOCATION',hash_key_proto_value=str) dynamoconn.create_table(name='prod-ysniff',schema=tab...
import boto.dynamodb dynamoconn = boto.dynamodb.connect_to_region('us-east-1') table_schema_macs = dynamoconn.create_schema(hash_key_name='MAC',hash_key_proto_value=str) table_schema_ips = dynamoconn.create_schema(hash_key_name='LOCATION',hash_key_proto_value=str) dynamoconn.create_table(name='dev3-ysniff',schema=tab...
mit
Python
1547ab8ccfcd7db4e1f2f15e40f482a2adb0d94e
Fix for: https://github.com/TechEmpower/FrameworkBenchmarks/pull/688#issuecomment-32546800
methane/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,s-ludwig/FrameworkBenchmarks,Eyepea/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,jeevatkm/FrameworkBenchmarks,steveklabnik/FrameworkBenchmarks,hamiltont/FrameworkBenchmarks,sagenschneider...
ninja-standalone/setup.py
ninja-standalone/setup.py
import subprocess import sys import setup_util import os def start(args, logfile, errfile): setup_util.replace_text("ninja-standalone/src/main/java/conf/application.conf", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306") try: subprocess.check_call("mvn clean compile assembly:single", shell=Tr...
import subprocess import sys import setup_util import os def start(args, logfile, errfile): setup_util.replace_text("ninja-standalone/src/main/java/conf/application.conf", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306") try: subprocess.check_call("mvn clean compile assembly:single", shell=Tr...
bsd-3-clause
Python
e3059c66541946afaf7e40776d7fb921bf56073b
Bump version for PyPi
rkhleics/wagtailmodeladmin,rkhleics/wagtailmodeladmin,ababic/wagtailmodeladmin,ababic/wagtailmodeladmin
wagtailmodeladmin/__init__.py
wagtailmodeladmin/__init__.py
__version__ = '2.4.6'
__version__ = '2.4.5'
mit
Python
1ecc56995405e9fe734f185e4a56e07a289fd4f6
Allow for different computers to analyse different ensemble members.
markmuetz/stormtracks,markmuetz/stormtracks
ipython_setup.py
ipython_setup.py
import time import datetime as dt import socket import detect as d import load as l import match as m import plotting as pl #num_ensemble_members = 56 num_ensemble_members = 3 start = time.time() print(start) short_name = socket.gethostname().split('.')[0] if short_name == 'linz': ensemble_member_range = rang...
import time import datetime as dt import detect as d import load as l import match as m import plotting as pl #num_ensemble_members = 56 num_ensemble_members = 3 start = time.time() print(start) tracks, cou = l.load_ibtracks_year(2005) ncdata = d.NCData(2005) gdatas = [] all_good_matches = [] for i in range(num_en...
mit
Python
c037f405de773a3c9e9a7affedf2ee154a3c1766
Remove and replace task.id field, instead of Alter
Koed00/django-q
django_q/migrations/0003_auto_20150708_1326.py
django_q/migrations/0003_auto_20150708_1326.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('django_q', '0002_auto_20150630_1624'), ] operations = [ migrations.AlterModelOptions( name='failure', ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('django_q', '0002_auto_20150630_1624'), ] operations = [ migrations.AlterModelOptions( name='failure', ...
mit
Python
576e53e729992dddad5f51f8116848719a6f0d23
use insert() rather than a new variable
keon/algorithms,amaozhao/algorithms
array/plus_one.py
array/plus_one.py
# Given a non-negative number represented as an array of digits, # plus one to the number. # The digits are stored such that the most significant # digit is at the head of the list. def plusOne(digits): """ :type digits: List[int] :rtype: List[int] """ digits[-1] = digits[-1] + 1 res = [] ...
# Given a non-negative number represented as an array of digits, # plus one to the number. # The digits are stored such that the most significant # digit is at the head of the list. def plusOne(digits): """ :type digits: List[int] :rtype: List[int] """ digits[-1] = digits[-1] + 1 res = [] ...
mit
Python
4f54aed65d0717e0512797964588fab31660fc6c
생성자 () 안했었음
gomjellie/SoongSiri,gomjellie/SoongSiri
app/managers.py
app/managers.py
from .message import * class Singleton(type): instance = None def __call__(cls, *args, **kwargs): if not cls.instance: cls.instance = super(Singleton, cls).__call__(*args, **kwargs) return cls.instance class APIManager(metaclass=Singleton): def process(self, stat, req=None):...
from .message import * class Singleton(type): instance = None def __call__(cls, *args, **kwargs): if not cls.instance: cls.instance = super(Singleton, cls).__call__(*args, **kwargs) return cls.instance class APIManager(metaclass=Singleton): def process(self, stat, req=None):...
mit
Python
69c18f28f4c5c1ad7c7469b1ac214b58d70a01fd
Update logpm.py
TingPing/plugins,TingPing/plugins
HexChat/logpm.py
HexChat/logpm.py
import hexchat __module_name__ = "LogPMs" __module_author__ = "TingPing" __module_version__ = "1" __module_description__ = "Auto log pm's" def open_cb(word, word_eol, userdata): chan = hexchat.get_info('channel') if chan[0] != '#' and chan not in hexchat.get_prefs('irc_no_hilight'): hexchat.command('chanopt text_...
import hexchat __module_name__ = "LogPM" __module_author__ = "TingPing" __module_version__ = "0" __module_description__ = "Auto log pm's" def open_cb(word, word_eol, userdata): if hexchat.get_info('channel')[0] != '#': hexchat.command('chanopt text_logging on') hexchat.hook_print("Open Context", open_cb)
mit
Python
f22752aacbac9400bda207a5199322b1d1f709d6
Update landing fields names.
1flow/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow
oneflow/landing/models.py
oneflow/landing/models.py
# -*- coding: utf-8 -*- from transmeta import TransMeta from django.utils.translation import ugettext_lazy as _ from django.db import models class LandingContent(models.Model): __metaclass__ = TransMeta name = models.CharField(_('Template variable name'), max_length=128, u...
# -*- coding: utf-8 -*- from transmeta import TransMeta from django.utils.translation import ugettext_lazy as _ from django.db import models class LandingContent(models.Model): __metaclass__ = TransMeta name = models.CharField(_('Name'), max_length=128) content = models.TextField(_('Content')) ...
agpl-3.0
Python
3880e4cd73630b19863ecf9bb500fa168cba2722
Bump the version missed in the 0.0.76 prep CR.
baroquebobcat/pants,15Dkatz/pants,benjyw/pants,foursquare/pants,manasapte/pants,landism/pants,tdyas/pants,ericzundel/pants,twitter/pants,wisechengyi/pants,lahosken/pants,lahosken/pants,peiyuwang/pants,kwlzn/pants,landism/pants,peiyuwang/pants,gmalmquist/pants,tdyas/pants,manasapte/pants,landism/pants,ericzundel/pants,g...
src/python/pants/version.py
src/python/pants/version.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.revi...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.revi...
apache-2.0
Python
7d62bea75a4d75546475eeea10ccc12cc8c408bc
Add color to robot
anassinator/dqn-obstacle-avoidance
simulator.py
simulator.py
# -*- coding: utf-8 -*- from robot import Robot from world import World from PythonQt import QtGui from director import applogic from director import objectmodel as om from director import visualization as vis from director.consoleapp import ConsoleApp class Simulator(object): """Simulator.""" def __init__...
# -*- coding: utf-8 -*- from robot import Robot from world import World from PythonQt import QtGui from director import applogic from director import objectmodel as om from director import visualization as vis from director.consoleapp import ConsoleApp class Simulator(object): """Simulator.""" def __init__...
mit
Python
92f1dcee29cdfaff49953b3035d5d7127885cc23
fix editing runs in admin
scottbecker/autolims,scottbecker/autolims,scottbecker/autolims
autolims/admin.py
autolims/admin.py
from django.contrib import admin from django.apps import apps app = apps.get_app_config('autolims') class RunAdmin(admin.ModelAdmin): #autoprotocol can only be set on creation def get_readonly_fields(self, request, obj=None): if obj is not None: return ['protocol'] return [] ...
from django.contrib import admin from django.apps import apps app = apps.get_app_config('autolims') class RunAdmin(admin.ModelAdmin): #autoprotocol can only be set on creation def get_readonly_fields(self, request, obj=None): if obj is not None: return ['autoprotocol'] return ...
mit
Python
fecba5b596180b403cefd5a8072079fcce6012d3
Add a more useful name that shows this is a task.
jessicalucci/TaskManagement,citrix-openstack-build/taskflow,junneyang/taskflow,citrix-openstack-build/taskflow,jimbobhickville/taskflow,varunarya10/taskflow,jessicalucci/TaskManagement,openstack/taskflow,jimbobhickville/taskflow,varunarya10/taskflow,pombredanne/taskflow-1,openstack/taskflow,pombredanne/taskflow-1,junne...
taskflow/task.py
taskflow/task.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
apache-2.0
Python
168e0128ff09de95fb3946da29a8244dd2baf26e
Correct user type hint
m-ober/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps
byceps/services/authentication/session/models/current_user.py
byceps/services/authentication/session/models/current_user.py
""" byceps.services.authentication.session.models.current_user ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from enum import Enum from typing import Optional, Set, Union from .....services.user.models.user i...
""" byceps.services.authentication.session.models.current_user ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2018 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from enum import Enum from typing import Optional, Set from .....services.user.models.user import U...
bsd-3-clause
Python
d577545431c1e41a8987497ee116472f20404252
Change PyZ3950 to use git+git
mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject
molly/installer/__init__.py
molly/installer/__init__.py
# Packages which Molly needs, but Pip can't handle PIP_PACKAGES = [ ('PyZ3950', 'git+git://github.com/oucs/PyZ3950.git'), # Custom PyZ3950, contains some bug fixes ('django-compress', 'git+git://github.com/mollyproject/django-compress.git#egg=django-compress'), # Fork of django-compress contains some extra feat...
# Packages which Molly needs, but Pip can't handle PIP_PACKAGES = [ ('PyZ3950', 'git+http://github.com/oucs/PyZ3950.git'), # Custom PyZ3950, contains some bug fixes ('django-compress', 'git+git://github.com/mollyproject/django-compress.git#egg=django-compress'), # Fork of django-compress contains some extra fea...
apache-2.0
Python
1d8592d3d958b50e726654e3a3c95c6957a605d3
Correct crypto calls to sign
alkadis/vcv,SysTheron/adhocracy,DanielNeugebauer/adhocracy,liqd/adhocracy,liqd/adhocracy,SysTheron/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,alkadis/vcv,liqd/adhocracy,phihag/adhocracy,alkadis/vcv,phihag/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,DanielNeuge...
src/adhocracy/lib/crypto.py
src/adhocracy/lib/crypto.py
import hashlib import hmac from pylons import config try: from hmac import compare_digest except ImportError: # Python < 3.3 def compare_digest(a, b): # We'll just try emulating it here and hope that the network noise # is sufficient and the Python interpreter isn't too clever if typ...
import hashlib import hmac from pylons import config try: from hmac import compare_digest except ImportError: # Python < 3.3 def compare_digest(a, b): # We'll just try emulating it here and hope that the network noise # is sufficient and the Python interpreter isn't too clever if typ...
agpl-3.0
Python
6183054ac61ca69e71a8ee5821f97e163d29a3fb
Make path to TODO file configurable
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
bumblebee/modules/todo.py
bumblebee/modules/todo.py
# pylint: disable=C0111,R0903 """Displays the number of todo items from a text file Parameters: * todo.file: File to read TODOs from (defaults to ~/Documents/todo.txt) """ import platform import bumblebee.input import bumblebee.output import bumblebee.engine class Module(bumblebee.engine.Module): de...
# pylint: disable=C0111,R0903 """Displays the number of todo items in ~/Documents/todo.txt""" import platform import bumblebee.input import bumblebee.output import bumblebee.engine class Module(bumblebee.engine.Module): def __init__(self, engine, config): super(Module, self).__init__(engine, conf...
mit
Python
e79facf3688cf6b98d18c475b5f41ced6248cc64
Document rename_mp3.py
jleung51/scripts,jleung51/scripts,jleung51/scripts
mp3-formatter/rename_mp3.py
mp3-formatter/rename_mp3.py
#!/usr/bin/python3 # This Python 3 file reads (from stdin) a list of tracks, each separated by # a newline, and renames the MP3 files in the current folder to the tracklist. import ID3 import os import sys def read_tracklist(): """Return list of tracks from stdin. """ tracklist = [] for line in sys....
#!/usr/bin/python3 import ID3 import os import sys def read_tracklist(): tracklist = [] for line in sys.stdin: tracklist.append(line) return tracklist def match_length(files, tracklist): if len(files) != len(tracklist): raise RuntimeError( str(len(tracklist)) + ...
mit
Python
8c177c84d0b0ea6e63fdaa50d317cfad4528ac57
add todo
opencivicdata/scrapers-ca,opencivicdata/scrapers-ca
ca_on_lambton/__init__.py
ca_on_lambton/__init__.py
from __future__ import unicode_literals from utils import CanadianJurisdiction from pupa.scrape import Organization class Lambton(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/cd:3538' division_name = 'Lambton' name = 'Lambton County Council' url = 'h...
from __future__ import unicode_literals from utils import CanadianJurisdiction from pupa.scrape import Organization class Lambton(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/cd:3538' division_name = 'Lambton' name = 'Lambton County Council' url = 'h...
mit
Python
022a9ee685c317a43482034257937defc726c36e
use metasite delimiter for sites with multiple IDs
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
cgi-bin/request/recent.py
cgi-bin/request/recent.py
#!/usr/bin/env python """ Return a simple CSV of recent observations from the database """ import psycopg2 import cgi import sys import memcache def run(sid): """ run() """ dbconn = psycopg2.connect(database='iem', host='iemdb', user='nobody') cursor = dbconn.cursor() cursor.execute("""SELECT val...
#!/usr/bin/env python """ Return a simple CSV of recent observations from the database """ import psycopg2 import cgi import sys import memcache def run(sid): """ run() """ dbconn = psycopg2.connect(database='iem', host='iemdb', user='nobody') cursor = dbconn.cursor() cursor.execute("""SELECT val...
mit
Python
5109e5dcea8364182bfbccb6c616d0b2d9a7e4be
Update test.py
inkenbrandt/WellApplication
test/test.py
test/test.py
# -*- coding: utf-8 -*- """ Created on Sat Jan 23 13:03:00 2016 @author: p """ import wellapplication as wa import pandas as pd import matplotlib def test_getelev(): x = [-111.21, 41.4] m = wa.getelev(x) assert m > 100.0 def test_gethuc(): x = [-111.21, 41.4] huc_data = wa.get_huc(x) assert ...
# -*- coding: utf-8 -*- """ Created on Sat Jan 23 13:03:00 2016 @author: p """ import wellapplication as wa import pandas as pd import matplotlib def test_getelev(): x = [-111.21, 41.4] m = wa.getelev(x) assert m > 100.0 def test_gethuc(): x = [-111.21, 41.4] huc_data = wa.get_huc(x) assert ...
mit
Python
239ae541caa0f8ddcb3b26b91289669c69e15cdb
Support python2-like sorting in python3
oneklc/dimod,oneklc/dimod
dimod/compatibility23.py
dimod/compatibility23.py
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
Python
e3835b3b28f21262719c8ffe63e390c12963a69f
make tiles accessable at /layername/ and /tiles/layername/
trailbehind/EasyTileServer,trailbehind/EasyTileServer
webApp/easyTileServer/urls.py
webApp/easyTileServer/urls.py
from django.conf.urls import patterns, include, url from rest_framework import routers from django.contrib.auth.decorators import login_required from layers import views from django.contrib import admin admin.autodiscover() router = routers.DefaultRouter() router.register(r'layeradmin', views.LayerAdmin) urlpatter...
from django.conf.urls import patterns, include, url from rest_framework import routers from django.contrib.auth.decorators import login_required from layers import views from django.contrib import admin admin.autodiscover() router = routers.DefaultRouter() router.register(r'layeradmin', views.LayerAdmin) urlpatter...
bsd-3-clause
Python
d1ac8994ac19d59860e305409221e5f93ff8a148
Include a default DATABASES setting in settings_base
wangjun/djangae,jscissr/djangae,jscissr/djangae,chargrizzle/djangae,nealedj/djangae,leekchan/djangae,SiPiggles/djangae,leekchan/djangae,grzes/djangae,asendecka/djangae,trik/djangae,potatolondon/djangae,chargrizzle/djangae,kirberich/djangae,armirusco/djangae,pablorecio/djangae,stucox/djangae,stucox/djangae,pablorecio/dj...
djangae/settings_base.py
djangae/settings_base.py
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage' FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 FILE_UPLOAD_HANDLERS = ( 'djangae.storage.BlobstoreFileUploadHandler', 'django.core.files.uploadhandler.MemoryFileUploadHandler', ) DATABASES = { 'default': { 'ENGINE': 'djangae.db.backends.appengin...
DEFAULT_FILE_STORAGE = 'djangae.storage.BlobstoreStorage' FILE_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 FILE_UPLOAD_HANDLERS = ( 'djangae.storage.BlobstoreFileUploadHandler', 'django.core.files.uploadhandler.MemoryFileUploadHandler', )
bsd-3-clause
Python
d755d53fdacc686200abfc0dd0409f4233af510d
Fix bug with error while run django-admin loaddata.
Dybov/real_estate_agency,Dybov/real_estate_agency,Dybov/real_estate_agency
real_estate_agency/new_buildings/signals.py
real_estate_agency/new_buildings/signals.py
from django.db.models.signals import post_save, m2m_changed from django.dispatch import receiver from .models import NewBuilding, NewApartment, ResidentalComplex @receiver( post_save, sender=NewBuilding, dispatch_uid="save_apartment_after_building_saved" ) def newbuilding_post_saver(sender, instance, crea...
from django.db.models.signals import post_save, m2m_changed from django.dispatch import receiver from .models import NewBuilding, NewApartment, ResidentalComplex @receiver(post_save, sender=NewBuilding, dispatch_uid="save_apartment_after_building_saved") def newbuilding_post_saver(sender, instance...
mit
Python
1df3cb78ef27b61eb85f6570b75bb2d7c6b17e03
Allow complete paths for script
nojhan/weboob-devel,Konubinix/weboob,RouxRC/weboob,sputnick-dev/weboob,yannrouillard/weboob,nojhan/weboob-devel,frankrousseau/weboob,Konubinix/weboob,yannrouillard/weboob,yannrouillard/weboob,Boussadia/weboob,sputnick-dev/weboob,Boussadia/weboob,laurent-george/weboob,willprice/weboob,Konubinix/weboob,laurent-george/web...
tools/local_run.py
tools/local_run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess import sys import os if len(sys.argv) < 2: print "Usage: %s SCRIPTNAME [args]" % sys.argv[0] sys.exit(1) else: script = sys.argv[1] args = sys.argv[2:] project = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) wd ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess import sys import os if len(sys.argv) < 2: print "Usage: %s SCRIPTNAME [args]" % sys.argv[0] sys.exit(1) else: script = sys.argv[1] args = sys.argv[2:] project = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) wd ...
agpl-3.0
Python
d606c8053cea1d3d23e4858b31cd8a3120869dcb
add libraries to system via PYTHONPATH
linkmax91/bitquant,linkmax91/bitquant,joequant/bitquant,linkmax91/bitquant,joequant/bitquant,linkmax91/bitquant,joequant/bitquant,joequant/bitquant,joequant/bitquant,linkmax91/bitquant,linkmax91/bitquant
web/scripts/ipython_config.py
web/scripts/ipython_config.py
def init_ipython(): from os.path import expanduser import sys import os.path import os home = expanduser("~") os.environ['PYTHONPATH'] = \ ':'.join( [os.path.join(home, "ipython"), os.path.join(home, "git", "bitquant", "web", "scripts")] ) init_ipython()
def init_ipython(): from os.path import expanduser import sys import os.path import os home = expanduser("~") sys.path.append(os.path.join(home, "ipython")) sys.path.append(os.path.join(home, "git", "bitquant", "web", "scripts")) init_ipython()
bsd-2-clause
Python
bf8e5410afed79c243466e06c61bc5c994dda00f
Use the object.__new__ decorator to create a singleton instance of the YES object.
PyCQA/astroid
astroid/util.py
astroid/util.py
# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the #...
# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the #...
lgpl-2.1
Python
983487ea68e7e285d9d7329c6e52d9454f46ee95
format fixed and debugging done
mitenjain/nanopore,mitenjain/nanopore,isovic/marginAlign,benedictpaten/marginAlign,mitenjain/nanopore,mitenjain/nanopore,mitenjain/nanopore,mitenjain/nanopore,benedictpaten/marginAlign,benedictpaten/marginAlign,mitenjain/nanopore,mitenjain/nanopore,isovic/marginAlign
nanopore/analyses/fastqc.py
nanopore/analyses/fastqc.py
from nanopore.analyses.abstractAnalysis import AbstractAnalysis from sonLib.bioio import system import os class FastQC(AbstractAnalysis): def run(self): system("fastqc %s --outdir=%s" % (self.readFastqFile, self.outputDir))
from nanopore.analyses.abstractAnalysis import AbstractAnalysis from sonLib.bioio import system import os class FastQC(AbstractAnalysis): def run(self): system("fastqc %s --outdir=%s" % (self.readFastQFile, self.outputDir))
mit
Python
423d9b9e294ef20fafbb1cb67a6c54c38112cddb
Improve Worker resistance against external code exceptions
alvarogzp/telegram-bot,alvarogzp/telegram-bot
bot/multithreading/worker.py
bot/multithreading/worker.py
import queue import threading class Worker: def __init__(self, name: str, work_queue: queue.Queue, error_handler: callable): self.name = name self.queue = work_queue # using an event instead of a boolean flag to avoid race conditions between threads self.end = threading.Event() ...
import queue import threading class Worker: def __init__(self, name: str, work_queue: queue.Queue, error_handler: callable): self.name = name self.queue = work_queue # using an event instead of a boolean flag to avoid race conditions between threads self.end = threading.Event() ...
agpl-3.0
Python
5cbc98cf59ab1d81faaa07b392bf92b282f044fc
add result count param to expand()
StephanieMak/CS3245PatentSearchEngine,weikengary/CS3245PatentSearchEngine
QueryExpansion.py
QueryExpansion.py
''' This module expands the given patent query with the terms collected from the top 10 of Google patent search. ''' import nltk import json import urllib import urllib2 import HTMLParser import string def expand(query, google_result_count = 3): # Maximum value for google_result_count allowed is only 8 if goo...
''' This module expands the given patent query with the terms collected from the top 10 of Google patent search. ''' import nltk import json import urllib import urllib2 import HTMLParser import string def expand(query): url = 'https://ajax.googleapis.com/ajax/services/search/patent?v=1.0&rsz=3&q=' + urllib.quote...
apache-2.0
Python
46c63fea860217fecf4ca334149970e8df7fd149
Change init param of wordnet
nlesc-sherlock/concept-search,nlesc-sherlock/concept-search,nlesc-sherlock/concept-search,nlesc-sherlock/concept-search
webserver/webTermSuggester.py
webserver/webTermSuggester.py
#!/usr/bin/env python ################################################################################ # Created by Oscar Martinez # # o.rubi@esciencecenter.nl # #######################################################...
#!/usr/bin/env python ################################################################################ # Created by Oscar Martinez # # o.rubi@esciencecenter.nl # #######################################################...
apache-2.0
Python
e6988b51017890f1398de56e2870b439a928381d
clean up install_modules.py
joejulian/openstack-guest-agents-unix,prometheanfire/openstack-guest-agents-unix,prometheanfire/openstack-guest-agents-unix,joejulian/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,coreos/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,promet...
src/unix/install_modules.py
src/unix/install_modules.py
import os import shutil import subprocess import sys # For nova_agent binary test_mode = True def install_plugins(destdir): import plugins to_install = set() for modname in sys.modules: try: mod_fn = __import__(modname).__file__ except: continue ...
import sys import os import shutil import plugins test_mode = True if len(sys.argv) < 2: print "No destination directory specified" sys.exit(1) dest_dir = sys.argv[1] to_install = set() for modname in sys.modules: try: mod_fn = __import__(modname).__file__ except: continue (m...
apache-2.0
Python
3cb6484231841e0125ca456fc15cae5e20d625d9
bump version to 0.3
dpranke/pyjson5
json5/version.py
json5/version.py
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
Python
b912374b96fac67e213e65ea980e402c214fa54f
check the finance book via the journal entry
gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext
erpnext/accounts/doctype/finance_book/test_finance_book.py
erpnext/accounts/doctype/finance_book/test_finance_book.py
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry import frappe import unittest class TestFinanceBook(unittest.TestCase): def ...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestFinanceBook(unittest.TestCase): pass
agpl-3.0
Python
94ac3f9efb1bc76f6d418d549349d2f3caec4114
Bump 0.3.0
shin-/dockerpy-creds,shin-/dockerpy-creds
dockerpycreds/version.py
dockerpycreds/version.py
version = "0.3.0" version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
version = "0.2.3" version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
apache-2.0
Python
0358809377d7217fbef7c000ac772387fa4a9249
Rename notifications to messages.
whatsthehubbub/rippleeffect,whatsthehubbub/rippleeffect,whatsthehubbub/rippleeffect,whatsthehubbub/rippleeffect,whatsthehubbub/rippleeffect
riskgame/urls.py
riskgame/urls.py
from django.conf.urls import patterns, url from django.views.generic.base import TemplateView urlpatterns = patterns('', url(r'^$', 'riskgame.views.index', name='index'), # url(r'^pre/launch/$', 'riskgame.views.pre_launch', name='pre_launch'), url(r'^teams/$', 'riskgame.views.teams', name='teams'), ...
from django.conf.urls import patterns, url from django.views.generic.base import TemplateView urlpatterns = patterns('', url(r'^$', 'riskgame.views.index', name='index'), # url(r'^pre/launch/$', 'riskgame.views.pre_launch', name='pre_launch'), url(r'^teams/$', 'riskgame.views.teams', name='teams'), ...
mit
Python
a683d160267ee4d8e139a19b9adacdf8f82f370c
bump version number of rmgpy to 1.0.4
nyee/RMG-Py,pierrelb/RMG-Py,nyee/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,nickvandewiele/RMG-Py
rmgpy/version.py
rmgpy/version.py
# This file describes the version of RMG-Py __version__ = '1.0.4'
# This file describes the version of RMG-Py __version__ = '1.0.3'
mit
Python
66e2e3bee9996a0cb55c7b802a638e42bc72ccbe
Use formatted flag on astyle to simplify code
stopthatcow/zazu,stopthatcow/zazu
zazu/plugins/astyle_styler.py
zazu/plugins/astyle_styler.py
# -*- coding: utf-8 -*- """astyle plugin for zazu""" import zazu.styler import zazu.util __author__ = "Nicholas Wiles" __copyright__ = "Copyright 2017" class AstyleStyler(zazu.styler.Styler): """Astyle plugin for code styling""" def style_file(self, file, verbose, dry_run): """Run astyle on a file""...
# -*- coding: utf-8 -*- """astyle plugin for zazu""" import zazu.styler import zazu.util __author__ = "Nicholas Wiles" __copyright__ = "Copyright 2017" class AstyleStyler(zazu.styler.Styler): """Astyle plugin for code styling""" def style_file(self, file, verbose, dry_run): """Run astyle on a file""...
mit
Python
3342c5c82960274b0ed2ba9500e33d305f1b4399
Correct ESLint case
stopthatcow/zazu,stopthatcow/zazu
zazu/plugins/eslint_styler.py
zazu/plugins/eslint_styler.py
# -*- coding: utf-8 -*- """ESLint plugin for zazu.""" import zazu.styler zazu.util.lazy_import(locals(), [ 'subprocess', 'os', 'tempfile' ]) __author__ = "Patrick Moore" __copyright__ = "Copyright 2018" class ESLintStyler(zazu.styler.Styler): """ESLint plugin for code styling.""" def style_strin...
# -*- coding: utf-8 -*- """eslint plugin for zazu.""" import zazu.styler zazu.util.lazy_import(locals(), [ 'subprocess', 'os', 'tempfile' ]) __author__ = "Patrick Moore" __copyright__ = "Copyright 2018" class eslintStyler(zazu.styler.Styler): """ESLint plugin for code styling.""" def style_strin...
mit
Python
807aa2ec34441e919f27079eb4ed075f76fe17e5
Add log_bernoulli shortname
RuiShu/tensorbayes
tensorbayes/distributions.py
tensorbayes/distributions.py
""" Assumes softplus activations for gaussian """ import tensorflow as tf import numpy as np def log_bernoulli(x, logits, eps=0.0, axis=-1): return log_bernoulli_with_logits(x, logits, eps, axis) def log_bernoulli_with_logits(x, logits, eps=0.0, axis=-1): if eps > 0.0: max_val = np.log(1.0 - eps) - np...
""" Assumes softplus activations for gaussian """ import tensorflow as tf import numpy as np def log_bernoulli_with_logits(x, logits, eps=0.0, axis=-1): if eps > 0.0: max_val = np.log(1.0 - eps) - np.log(eps) logits = tf.clip_by_value(logits, -max_val, max_val, nam...
mit
Python
979424d0510834abb3918777f8b6a46b344d2bee
Bump version number
johanvdw/niche_vlaanderen
niche_vlaanderen/version.py
niche_vlaanderen/version.py
__version__ = "1.0a6"
__version__ = "1.0a5"
mit
Python
45cc00d2f4bf1ec5dfec60301e48c984af9acb64
Add validator json to PACKAGE_DATA
INCF/pybids
bids/version.py
bids/version.py
from __future__ import absolute_import, division, print_function import os CLASSIFIERS = ["Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS I...
from __future__ import absolute_import, division, print_function import os CLASSIFIERS = ["Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS I...
mit
Python
887cb1b1a021b6d4a1952fdeb178e602d8cabfdc
Fix `clifford.test.run_all_tests` to use pytest
arsenovic/clifford,arsenovic/clifford
clifford/test/__init__.py
clifford/test/__init__.py
import os import pytest def run_all_tests(*args): """ Invoke pytest, forwarding options to pytest.main """ pytest.main([os.path.dirname(__file__)] + list(args))
from .test_algebra_initialisation import * from .test_clifford import * from .test_io import * from .test_g3c_tools import * from .test_tools import * from .test_g3c_CUDA import * import unittest def run_all_tests(): unittest.main()
bsd-3-clause
Python
e222de58671a11c83e70c90f2bac10e576240214
Adjust to new script parameter syntax
imagej/imagej-legacy,imagej/imagej-legacy,imagej/imagej-legacy,imagej/imagej-legacy
src/main/resources/script_templates/ImageJ_1.x/Examples/Process_Folder.py
src/main/resources/script_templates/ImageJ_1.x/Examples/Process_Folder.py
#@ File (label = "Input directory", style = "directory") srcFile #@ File (label = "Output directory", style = "directory") dstFile #@ String (label = "File extension", value=".tif") ext #@ String (label = "File name contains", value = "") containString #@ boolean (label = "Keep directory structure when saving",...
# @File(label = "Input directory", style = "directory") srcFile # @File(label = "Output directory", style = "directory") dstFile # @String(label = "File extension", value=".tif") ext # @String(label = "File name contains", value = "") containString # @boolean(label = "Keep directory structure when saving", value = true...
bsd-2-clause
Python
612521ba5c9fe9dace98f09d07e359bbbef29d48
update __manifest__
akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil
l10n_br_base/__manifest__.py
l10n_br_base/__manifest__.py
# -*- coding: utf-8 -*- # Copyright (C) 2009 - TODAY Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Base', 'summary': 'Customization of base module for implementations in Brazil.', 'category': 'Localisation', 'license': 'AGPL-3'...
# -*- coding: utf-8 -*- # Copyright (C) 2009 - TODAY Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Base', 'summary': 'Customization of base module for implementations in Brazil.', 'category': 'Localisation', 'license': 'AGPL-3'...
agpl-3.0
Python
174d9d0a131a65924a4f4ef9eb5ae2edf56202a6
Update l10n_br_sale depedency
OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil
l10n_br_sale/__manifest__.py
l10n_br_sale/__manifest__.py
# Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Brazilian Localization Sale", "category": "Localisation", "license": "AGPL-3", "author": 'Akretion, ' 'Odoo Community Association (OCA)', "website": "http://odoo-...
# Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Brazilian Localization Sale", "category": "Localisation", "license": "AGPL-3", "author": 'Akretion, ' 'Odoo Community Association (OCA)', "website": "http://odoo-...
agpl-3.0
Python
ed968fabd811690e0a2f2011b5ed44cec31145c7
Fix broken import in translate_nuc script.
cfe-lab/MiCall,cfe-lab/MiCall,cfe-lab/MiCall
micall/tests/microtest/translate_nuc.py
micall/tests/microtest/translate_nuc.py
from micall.core import aln2counts """ Translate nucleotide sequence to amino acid sequence and compare the result with an expected sequence. You might also want to identify the amino acid sequence with BLASTp: http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch """ nuc_seq = ''.join([ ...
import aln2counts """ Translate nucleotide sequence to amino acid sequence and compare the result with an expected sequence. You might also want to identify the amino acid sequence with BLASTp: http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch """ nuc_seq = ''.join([ "CCTCAGGTCACTCT...
agpl-3.0
Python
65c52d9982cf3a87bd6f3efa9591a8781a799ffb
Change selector (site changed)
laurent-george/weboob,Konubinix/weboob,willprice/weboob,RouxRC/weboob,nojhan/weboob-devel,sputnick-dev/weboob,frankrousseau/weboob,Boussadia/weboob,nojhan/weboob-devel,franek/weboob,Konubinix/weboob,laurent-george/weboob,frankrousseau/weboob,Konubinix/weboob,sputnick-dev/weboob,sputnick-dev/weboob,RouxRC/weboob,eirmag/...
modules/leclercmobile/pages/homepage.py
modules/leclercmobile/pages/homepage.py
# -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # This file is part of weboob. # # weboob 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 o...
# -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # This file is part of weboob. # # weboob 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 o...
agpl-3.0
Python
7c2d5304b0f305d069a4265043c19cbae71b3e06
Add several routes
DavidJFelix/hatchit,DavidJFelix/hatchit,DavidJFelix/hatchit
src/flock.py
src/flock.py
#!/usr/bin/env python from flask import Flask, jsonify, redirect, render_template, request, session, url_for app = Flask(__name__) app.secret_key = 'development' @app.route('/') def hello_world(): return render_template('base.html') @app.route('/u/<user>') @app.route('/user/<user>') def get_user(user): pass @ap...
#!/usr/bin/env python from flask import Flask, jsonify, redirect, render_template, request, session, url_for app = Flask(__name__) app.secret_key = 'development' @app.route('/') def hello_world(): return render_template('base.html') if __name__ == '__main__': app.run()
agpl-3.0
Python
c9ef00ff3225aa545cbb1a3da592c9af1bb0791e
Fix issue when GIT is not tagged.
weijia/django-git,weijia/django-git
django_git/management/commands/git_pull_utils/git_folder_enum.py
django_git/management/commands/git_pull_utils/git_folder_enum.py
from django_git.models import RepoInfo from tagging.models import Tag, TaggedItem def enum_git_repo(tag_name="git"): tag_filter = Tag.objects.filter(name=tag_name) if tag_filter.exists(): tag = tag_filter[0] tagged_item_list = TaggedItem.objects.filter(tag__exact=tag.pk) for tagged_ite...
from django_git.models import RepoInfo from tagging.models import Tag, TaggedItem def enum_git_repo(tag_name="git"): tag_filter = Tag.objects.filter(name=tag_name) if tag_filter.exists(): tag = tag_filter[0] tagged_item_list = TaggedItem.objects.filter(tag__exact=tag.pk) for tagged_ite...
bsd-3-clause
Python
b40439e3b1e99027952308fa1ce5bcc8ebfbcabb
Remove a useless parameter
Kozea/sitenco
sitenco/config/bug_tracker.py
sitenco/config/bug_tracker.py
""" Bug tracker tools. """ import abc from docutils import nodes from .tool import Tool, Role class BugTracker(Tool): """Abstract class for bug tracker tools.""" __metaclass__ = abc.ABCMeta def __init__(self, project_name): self.project_name = project_name super(BugTracker, self).__ini...
""" Bug tracker tools. """ import abc from docutils import nodes from .tool import Tool, Role class BugTracker(Tool): """Abstract class for bug tracker tools.""" __metaclass__ = abc.ABCMeta def __init__(self, project_name): self.project_name = project_name super(BugTracker, self).__ini...
bsd-3-clause
Python
3454f377c82c11e4ec1485ec96d7af4123cc78ed
Add linux logos in show symbols script
mkofinas/prompt-support,mkofinas/prompt-support
test/symbols/show_glyphs.py
test/symbols/show_glyphs.py
#!/usr/bin/env python # -*- coding: utf-8 -*- devicons_start = "e700" devicons_end = "e7c5" print "Devicons" for ii in xrange(int(devicons_start, 16), int(devicons_end, 16) + 1): print unichr(ii), custom_start = "e5fa" custom_end = "e62b" print "\nCustom" for ii in xrange(int(custom_start, 16), int(custom_end, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- devicons_start = "e700" devicons_end = "e7c5" print "Devicons" for ii in xrange(int(devicons_start, 16), int(devicons_end, 16) + 1): print unichr(ii), custom_start = "e5fa" custom_end = "e62b" print "\nCustom" for ii in xrange(int(custom_start, 16), int(custom_end, ...
mit
Python
7258923a3fc6467c2aac2c81f108c71e790a9e6b
Fix bug in RegEx parser mixin
elegion/djangodash2013,elegion/djangodash2013
wtl/wtparser/parsers/regex.py
wtl/wtparser/parsers/regex.py
import re from itertools import repeat class RegexParserMixin(object): quoted_re = r'''(?P<q>"|')(?P<x>.+)(?P=q)''' version_re = r'''(?P<s>[<>=~]*)\s*(?P<n>.*)''' def _get_value(self, lines, prefix, regex): filtered = self._lines_startwith(lines, '{0} '.format(prefix)) return self._match(...
import re from itertools import repeat class RegexParserMixin(object): quoted_re = r'''(?P<q>"|')(?P<x>.+)(?P=q)''' version_re = r'''(?P<s>[<>=~]*)\s*(?P<n>.*)''' def _get_value(self, lines, prefix, regex): filtered = self._lines_startwith(lines, '{0} '.format(prefix)) return self._match(...
mit
Python
43ec7668045b04ca6b0d265113c763f22b40396d
Remove bin generation
matslindh/codingchallenges,matslindh/codingchallenges
knowit2016/knowit19.py
knowit2016/knowit19.py
import string out = open("input/knowit19_output.pgm", "w") #out_bin = open("input/knowit19_output.bin", "wb") s = ''.join(open("input/knowit19").readlines()).replace("\n", '') for i in range(0, len(s), 2): pass #out_bin.write(chr(int(s[i:i + 2])).encode("ascii")) height = 21 width = int(len(s) / (height * 2)...
import string out = open("input/knowit19_output.pgm", "w") out_bin = open("input/knowit19_output.bin", "wb") s = ''.join(open("input/knowit19").readlines()).replace("\n", '') for i in range(0, len(s), 2): out_bin.write(chr(int(s[i:i + 2])).encode("ascii")) height = 21 width = int(len(s) / (height * 2)) out.writ...
mit
Python
9633f3ee1a3431cb373a4652afbfc2cd8b3b4c23
Allow specifying modules to be mocked
Stvad/CrowdAnki,Stvad/CrowdAnki,Stvad/CrowdAnki
test_utils/anki/__init__.py
test_utils/anki/__init__.py
from typing import List from typing import Optional import sys from unittest.mock import MagicMock class MockAnkiModules: """ I'd like to get rid of the situation when this is required, but for now this helps with the situation that anki modules are not available during test runtime. """ module_na...
import sys from unittest.mock import MagicMock class MockAnkiModules: """ I'd like to get rid of the situation when this is required, but for now this helps with the situation that anki modules are not available during test runtime. """ modules_list = ['anki', 'anki.hooks', 'anki.exporting', 'anki...
mit
Python
30ddea8aa577bc6bff64c9da543c559258a4e51f
fix plot_rereference_eeg example
bloyl/mne-python,olafhauk/mne-python,larsoner/mne-python,kambysese/mne-python,drammock/mne-python,teonlamont/mne-python,Teekuningas/mne-python,Teekuningas/mne-python,cjayb/mne-python,pravsripad/mne-python,olafhauk/mne-python,wmvanvliet/mne-python,olafhauk/mne-python,adykstra/mne-python,mne-tools/mne-python,Eric89GXL/mn...
examples/preprocessing/plot_rereference_eeg.py
examples/preprocessing/plot_rereference_eeg.py
""" ============================= Re-referencing the EEG signal ============================= Load raw data and apply some EEG referencing schemes. """ # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne fr...
""" ============================= Re-referencing the EEG signal ============================= Load raw data and apply some EEG referencing schemes. """ # Authors: Marijn van Vliet <w.m.vanvliet@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne fr...
bsd-3-clause
Python
8d6905d35dbae5cc16769989bc666e01c4e289ef
fix setting xlabel and ylabel (#8454)
Teekuningas/mne-python,mne-tools/mne-python,pravsripad/mne-python,Eric89GXL/mne-python,Teekuningas/mne-python,pravsripad/mne-python,kingjr/mne-python,mne-tools/mne-python,kingjr/mne-python,bloyl/mne-python,rkmaddox/mne-python,pravsripad/mne-python,drammock/mne-python,mne-tools/mne-python,drammock/mne-python,bloyl/mne-p...
examples/visualization/plot_topo_customized.py
examples/visualization/plot_topo_customized.py
""" ======================================== Plot custom topographies for MEG sensors ======================================== This example exposes the :func:`~mne.viz.iter_topography` function that makes it very easy to generate custom sensor topography plots. Here we will plot the power spectrum of each channel on a...
""" ======================================== Plot custom topographies for MEG sensors ======================================== This example exposes the :func:`~mne.viz.iter_topography` function that makes it very easy to generate custom sensor topography plots. Here we will plot the power spectrum of each channel on a...
bsd-3-clause
Python
a1bbd3d68e4729ac232f03b8980edd1dec93006d
use relative import path in package
gilsho/kryptonite
kryptonite/__init__.py
kryptonite/__init__.py
from .cipher import Cipher, DecryptionError from .password import conceal, verify
from cipher import Cipher, DecryptionError from password import conceal, verify
mit
Python
036a3b1d0037ea0d6888df4ab4b5f052040c95c8
Remove errant space.
ameily/mongo-python-driver,ultrabug/mongo-python-driver,ShaneHarvey/mongo-python-driver,ramnes/mongo-python-driver,mongodb/mongo-python-driver,macdiesel/mongo-python-driver,gormanb/mongo-python-driver,pigate/mongo-python-driver,brianwrf/mongo-python-driver,ramnes/mongo-python-driver,jameslittle/mongo-python-driver,rych...
bson/py3compat.py
bson/py3compat.py
# Copyright 2009-2012 10gen, 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 2009-2012 10gen, 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...
apache-2.0
Python
f28209b1ba9d2fe84753a05cacd810e38f314a7e
Replace hvad with parler in settings
czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq
test_settings.py
test_settings.py
# -*- coding: utf-8 -*- HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', 'URL': 'http://localhost:9001/solr/default', 'TIMEOUT': 60 * 5, 'INCLUDE_SPELLING': True, 'BATCH_SIZE': 100, 'EXCLUDED_INDEXES': ['thirdpartyapp.searc...
# -*- coding: utf-8 -*- HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', 'URL': 'http://localhost:9001/solr/default', 'TIMEOUT': 60 * 5, 'INCLUDE_SPELLING': True, 'BATCH_SIZE': 100, 'EXCLUDED_INDEXES': ['thirdpartyapp.searc...
bsd-3-clause
Python
30956e5cff8b94b4c6998f34a3dfbfaa423dac9b
load up typography
tBaxter/Tango,tBaxter/Tango
test_settings.py
test_settings.py
SECRET_KEY = "lorem ipsum" INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sites', 'autotagger', 'tango_shared', 'tango_user', 'video', 'typogrify' # installed by shared, keeps templates happy ) DATABASES = { 'default': { 'ENGINE': '...
SECRET_KEY = "lorem ipsum" INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sites', 'autotagger', 'tango_shared', 'tango_user', 'video' ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }...
mit
Python
ae98a9955545a8a895c4b66802e2762fdffe9272
set allowed hosts
bhoggard/nurtureart,bhoggard/nurtureart,bhoggard/nurtureart
nurtureart/settings/prod.py
nurtureart/settings/prod.py
from .base import * DEBUG = False TEMPLATE_DEBUG = False SECRET_KEY = os.environ.get('SECRET_KEY') ALLOWED_HOSTS = ['nurtureart.artcat.com']
from .base import * DEBUG = False TEMPLATE_DEBUG = False SECRET_KEY = os.environ.get('SECRET_KEY')
mit
Python
0b5d8476c7656d6088fd4cf62bdcbce6bd8dfd4c
remove unused imports
DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj
portality/migrate/20191128_2056_keywords_to_lower/operations.py
portality/migrate/20191128_2056_keywords_to_lower/operations.py
def rewrite_keywords(journal_like): bib = journal_like.bibjson() kwords = [k.lower() for k in bib.keywords] bib.set_keywords(kwords)
from portality import models from portality.core import app import esprit import re def rewrite_keywords(journal_like): bib = journal_like.bibjson() kwords = [k.lower() for k in bib.keywords] bib.set_keywords(kwords)
apache-2.0
Python
7164a4c14d8b4abfbeac83475539c9c68a5d5807
Remove VALID_USERNAME regex from utils.py
hasgeek/funnel,hasgeek/funnel,hasgeek/lastuser,hasgeek/funnel,hasgeek/funnel,hasgeek/lastuser,hasgeek/lastuser,hasgeek/lastuser,hasgeek/funnel,hasgeek/lastuser
lastuser_core/utils.py
lastuser_core/utils.py
# -*- coding: utf-8 -*- # Id generation import re import urlparse from urllib import urlencode as make_query_string # --- Constants --------------------------------------------------------------- PHONE_STRIP_RE = re.compile(r'[\t .()\[\]-]+') PHONE_VALID_RE = re.compile(r'^\+[0-9]+$') # --- Utilities --------------...
# -*- coding: utf-8 -*- # Id generation import re import urlparse from urllib import urlencode as make_query_string # --- Constants --------------------------------------------------------------- USERNAME_VALID_RE = re.compile('^[a-z0-9][a-z0-9-]*[a-z0-9]$') PHONE_STRIP_RE = re.compile(r'[\t .()\[\]-]+') PHONE_VALID...
agpl-3.0
Python
67efd82370159628ac0c19ad89fcf186efa6a535
Fix small issues
cboling/xos,zdw/xos,open-cloud/xos,zdw/xos,opencord/xos,zdw/xos,open-cloud/xos,cboling/xos,zdw/xos,cboling/xos,cboling/xos,open-cloud/xos,cboling/xos,opencord/xos,opencord/xos
xos/observers/helloworldservice_complete/steps/sync_helloworldtenant.py
xos/observers/helloworldservice_complete/steps/sync_helloworldtenant.py
import os import sys from django.db.models import Q, F from helloworldservice_complete.models import HelloWorldServiceComplete, HelloWorldTenantComplete from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible parentdir = os.path.join(os.path.dirname(__file__), "..") sys.path.insert(0, parentdir) ...
import os import sys from django.db.models import Q, F from helloworldservice_complete.models import HelloWorldServiceComplete, HelloWorldTenantComplete from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible parentdir = os.path.join(os.path.dirname(__file__), "..") sys.path.insert(0, parentdir) ...
apache-2.0
Python
f203d508fc83158794061a56cdd9f0a941716883
Bump version
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
bulbs/__init__.py
bulbs/__init__.py
__version__ = "3.9.0"
__version__ = "3.8.1"
mit
Python
24515e08362cdfc1ee6e4a8582ae4988055ca946
Update admin
vinta/sublimall-server,socketubs/sublimall-server,vinta/sublimall-server
sublimall/accounts/admin.py
sublimall/accounts/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Member from .models import Registration class MemberAdmin(admin.ModelAdmin): list_display = ('email', 'api_key', 'is_active', ) class RegistrationAdmin(admin.ModelAdmin): list_display = ('get_email', 'key', ) def get_email(se...
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin from .models import Member from .models import Registration class MemberInline(admin.TabularInline): model = Member can_delete = False class MemberAdmin(admin...
mit
Python
05fe7895a672b3a221fb4a02ba1f37b772e30a9b
Update openacademy_course.py
JesusZapata/openacademy-project
openacademy/model/openacademy_course.py
openacademy/model/openacademy_course.py
# -*- coding: utf-8 -*- from openerp import api, models, fields, _ ''' This module create model of Course ''' class Course(models.Model): ''' This class create model of Course ''' _name = 'openacademy.course' # Model odoo name name = fields.Char(string='Title', required=True) # Field reserved to...
# -*- coding: utf-8 -*- from openerp import api, models, fields, _ ''' This module create model of Course ''' class Course(models.Model): ''' This class create model of Course ''' _name = 'openacademy.course' # Model odoo name name = fields.Char(string='Title', required=True) # Field reserved to...
apache-2.0
Python
6f5d25d6dec2455bf408cb2292ff4d33f248cdde
update get_identifier method
datamade/la-metro-councilmatic,datamade/la-metro-councilmatic,datamade/la-metro-councilmatic,datamade/la-metro-councilmatic
lametro/utils.py
lametro/utils.py
import re import pytz from datetime import datetime, timedelta import requests import lxml.html from lxml.etree import tostring from django.conf import settings from django.utils import timezone from councilmatic_core.models import Organization, Event app_timezone = pytz.timezone(settings.TIME_ZONE) def format_full...
import re import pytz from datetime import datetime, timedelta import requests import lxml.html from lxml.etree import tostring from django.conf import settings from django.utils import timezone from councilmatic_core.models import Organization, Event app_timezone = pytz.timezone(settings.TIME_ZONE) def format_full...
mit
Python
deb87fefcc7fa76de3ae29ae58e816e49184d100
Add numpy.round to model api
openfisca/openfisca-core,openfisca/openfisca-core
openfisca_core/model_api.py
openfisca_core/model_api.py
# -*- coding: utf-8 -*- from datetime import date # noqa analysis:ignore from numpy import ( # noqa analysis:ignore logical_not as not_, maximum as max_, minimum as min_, round as round_, select, where, ) from .columns import ( # noqa analysis:ignore AgeCol, BoolCol, DateCol, ...
# -*- coding: utf-8 -*- from datetime import date # noqa analysis:ignore from numpy import maximum as max_, minimum as min_, logical_not as not_, where, select # noqa analysis:ignore from .columns import ( # noqa analysis:ignore AgeCol, BoolCol, DateCol, EnumCol, FixedStrCol, FloatCol, ...
agpl-3.0
Python
bf3729cfb2d4b98077e4936c8f184c20df99506d
fix reporting of "no instances" found.
GoogleCloudPlatform/gcpdiag,GoogleCloudPlatform/gcpdiag,GoogleCloudPlatform/gcpdiag
gcpdiag/lint/gce/err_2021_002_osconfig_perm.py
gcpdiag/lint/gce/err_2021_002_osconfig_perm.py
# Copyright 2021 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, ...
# Copyright 2021 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, ...
apache-2.0
Python
b7b2b31f93fcf01b79d148d2296726de73d4b1e8
Fix "Allow help options to ddev run command" (#5605)
DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/run.py
datadog_checks_dev/datadog_checks/dev/tooling/commands/run.py
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ...subprocess import run_command from ...utils import chdir from ..constants import get_root from .console import UNKNOWN_OPTIONS @click.command(context_settings=UNKNOWN_OPTIONS, short...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ...subprocess import run_command from ...utils import chdir from ..constants import get_root from .console import UNKNOWN_OPTIONS @click.command(context_settings=UNKNOWN_OPTIONS, short...
bsd-3-clause
Python
b6c7338666c89843d734517e7efc8a0336bedd3b
Fix url pattern to stop requiring two trailing slashes.
RickMohr/otm-core,RickMohr/otm-core,clever-crow-consulting/otm-core,maurizi/otm-core,recklessromeo/otm-core,maurizi/otm-core,clever-crow-consulting/otm-core,RickMohr/otm-core,recklessromeo/otm-core,maurizi/otm-core,recklessromeo/otm-core,clever-crow-consulting/otm-core,RickMohr/otm-core,recklessromeo/otm-core,maurizi/o...
opentreemap/treemap/urls.py
opentreemap/treemap/urls.py
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.conf.urls import patterns, include, url from treemap.views import index, settings urlpatterns = patterns( '', url(r'^$', index), url(r'^config/settings.js$', settings) )
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.conf.urls import patterns, include, url from treemap.views import index, settings urlpatterns = patterns( '', url(r'^/$', index), url(r'^config/settings.js$', settings) )
agpl-3.0
Python
ccd2afdc687c3d6b7d01bed130e1b0097a4fdc2d
Implement experiment workflow execution with transpose method.
InScience/DAMIS-old,InScience/DAMIS-old
src/damis/run_experiment.py
src/damis/run_experiment.py
import sys from damis.models import Experiment, Connection from damis.settings import BUILDOUT_DIR from os.path import splitext from algorithms.preprocess import transpose def transpose_data_callable(X, c, *args, **kwargs): X_absolute = BUILDOUT_DIR + '/var/www' + X Y = '%s_transposed%s' % splitext(X) Y_ab...
import sys from damis.models import Experiment exp_pk = sys.argv[1] exp = Experiment.objects.get(pk=exp_pk) exp.status = 'FINISHED' exp.save()
agpl-3.0
Python
b1f6db340516050b78e20315f90ba0ac9954f0a1
add plots for mach 3 and 2
cuspaceflight/firefish,cuspaceflight/firefish
examples/plot_fin_flutter.py
examples/plot_fin_flutter.py
""" An example script which generates a plot of flutter velocity versus altitude. Run via: python plot_fin_flutter.py The plot is written to: flutter-velocity-example.pdf """ # Configure matplotlib to generate PDF output rather than popping a window up import matplotlib matplotlib.use('PDF') import numpy as np from...
""" An example script which generates a plot of flutter velocity versus altitude. Run via: python plot_fin_flutter.py The plot is written to: flutter-velocity-example.pdf """ # Configure matplotlib to generate PDF output rather than popping a window up import matplotlib matplotlib.use('PDF') import numpy as np from...
apache-2.0
Python
a4e85f6b9668fc09dd0443b7b1dcfa953206c64c
Update copyright
kcha/bio_utilities,kcha/bio_utilities
src/create_random_reads.py
src/create_random_reads.py
#!/usr/bin/python # (c) 8/31/2009, Kevin Ha, McGill University # # Filename: Generate random reads for testing purposes import sys from Bio.Seq import Seq from Bio import SeqIO from Bio.SeqRecord import SeqRecord from Bio.Alphabet import IUPAC import random from optparse import OptionParser READ_LEN = 50 NUM_READS = ...
#!/usr/bin/python # @created 8/31/2009 # # Filename: Generate random reads for testing purposes import sys from Bio.Seq import Seq from Bio import SeqIO from Bio.SeqRecord import SeqRecord from Bio.Alphabet import IUPAC import random from optparse import OptionParser READ_LEN = 50 NUM_READS = 200 ###################...
mit
Python
4a37ea6a05c00cdebd72262156d1823e6579b478
Return to normal
brotherlogic/pictureframe,brotherlogic/pictureframe,brotherlogic/pictureframe
runAndRestart.py
runAndRestart.py
import os import sys verbose = False if verbose: print "Running in verbose mode" lines_before = len(os.popen('find ./codestore').readlines()) if verbose: print "\n".join(os.popen('./syncer.sh ' + sys.argv[1]).readlines()) else: os.popen('./syncer.sh ' + sys.argv[1]).readlines() lines_after = len(os.popen...
import os import sys verbose = True if verbose: print "Running in verbose mode" lines_before = len(os.popen('find ./codestore').readlines()) if verbose: print "\n".join(os.popen('./syncer.sh ' + sys.argv[1]).readlines()) else: os.popen('./syncer.sh ' + sys.argv[1]).readlines() lines_after = len(os.popen(...
apache-2.0
Python
5bca63680255a98288474a93a48590cddf16a2da
Remove legacy route
seekheart/show_watchdog,asishm/show_watchdog,seekheart/show_watchdog,seekheart/show_watchdog,asishm/show_watchdog,asishm/show_watchdog
run_flask_app.py
run_flask_app.py
#!/usr/bin/env python #import stuff from flask import Flask, render_template, request, redirect, url_for, abort from flask_wtf import Form from watchdog import watcher import os import urllib.parse from data_model.models import db, imdbInfo from setting import DevelopmentConfig from fuzzywuzzy import fuzz app = Flask...
#!/usr/bin/env python #import stuff from flask import Flask, render_template, request, redirect, url_for, abort from flask_wtf import Form from watchdog import watcher import os import urllib.parse from data_model.models import db, imdbInfo from setting import DevelopmentConfig from fuzzywuzzy import fuzz app = Flask...
mit
Python
f4dd7dfe6294d02b22ed0fbd1ac29e1c401ac758
fix image url
Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith,Kyria/LazyBlacksmith
lazyblacksmith/models/user/user.py
lazyblacksmith/models/user/user.py
# -*- encoding: utf-8 -*- from . import db from lazyblacksmith.models.utcdatetime import UTCDateTime from flask_login import UserMixin from sqlalchemy import func class User(db.Model, UserMixin): character_id = db.Column( db.BigInteger, primary_key=True, autoincrement=False ) cha...
# -*- encoding: utf-8 -*- from . import db from lazyblacksmith.models.utcdatetime import UTCDateTime from esipy import EsiClient from flask_login import UserMixin from sqlalchemy import func class User(db.Model, UserMixin): character_id = db.Column( db.BigInteger, primary_key=True, autoi...
bsd-3-clause
Python
a8c70e2f470714dc4365e551c4ba266ff14ec0bd
Revise problem docstring
bowen0701/algorithms_data_structures
lc0983_minimum_cost_for_tickets.py
lc0983_minimum_cost_for_tickets.py
"""Leetcode 983. Minimum Cost For Tickets Medium URL: https://leetcode.com/problems/minimum-cost-for-tickets/ In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array days. Each day is an integer from 1 to 365....
"""Leetcode 983. Minimum Cost For Tickets Medium URL: https://leetcode.com/problems/minimum-cost-for-tickets/ In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array days. Each day is an integer from 1 to 365....
bsd-2-clause
Python
beea4a514db73387fca80859a9cb8e7afbc21f27
Update ex7.py
Kaggle/learntools,Kaggle/learntools
learntools/machine_learning/ex7.py
learntools/machine_learning/ex7.py
import numpy as np from numpy import array import pandas as pd from learntools.core import * class CheckSubmittablePreds(CodingProblem): _var = 'test_preds' _solution = CS(""" # In previous code cell rf_model_on_full_data = RandomForestRegressor() rf_model_on_full_data.fit(X, y) # Then in last code cell test_...
import numpy as np from numpy import array import pandas as pd from learntools.core import * class CheckSubmittablePreds(CodingProblem): _var = 'test_preds' _solution = CS(""" # In previous code cell rf_model_on_full_data = RandomForestRegressor() rf_model_on_full_data.fit(X, y) # Then in last code cell test_...
apache-2.0
Python
d93d960319e22badccd68499df11f2a728dbbc04
Fix test_utils_project under Windows
kmike/scrapy,ArturGaspar/scrapy,eLRuLL/scrapy,starrify/scrapy,elacuesta/scrapy,elacuesta/scrapy,ArturGaspar/scrapy,finfish/scrapy,scrapy/scrapy,dangra/scrapy,Ryezhang/scrapy,kmike/scrapy,ArturGaspar/scrapy,scrapy/scrapy,eLRuLL/scrapy,pablohoffman/scrapy,wujuguang/scrapy,finfish/scrapy,Ryezhang/scrapy,finfish/scrapy,paw...
tests/test_utils_project.py
tests/test_utils_project.py
import unittest import os import tempfile import shutil import contextlib from scrapy.utils.project import data_path @contextlib.contextmanager def inside_a_project(): prev_dir = os.getcwd() project_dir = tempfile.mkdtemp() try: os.chdir(project_dir) with open('scrapy.cfg', 'w') as f: ...
import unittest import os import tempfile import shutil import contextlib from scrapy.utils.project import data_path @contextlib.contextmanager def inside_a_project(): prev_dir = os.getcwd() project_dir = tempfile.mkdtemp() try: os.chdir(project_dir) with open('scrapy.cfg', 'w') as f: ...
bsd-3-clause
Python
0c2112133146c19b4c2dc246d3927ee1b4f2d20c
Use 0.0.5 model.
izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext,izimobile/libshorttext
blvd_analyze.py
blvd_analyze.py
# coding=utf-8 import blvd_text import json from libshorttext.analyzer import * from libshorttext.classifier import * analyzer = Analyzer('outputs/0.0.5.model') import zerorpc import logging logging.basicConfig() class BlvdAnalyzer(): def __init__(self): self.is_currently_useless = True @static...
# coding=utf-8 import blvd_text import json from libshorttext.analyzer import * from libshorttext.classifier import * analyzer = Analyzer('outputs/0.0.3.model') import zerorpc import logging logging.basicConfig() class BlvdAnalyzer(): def __init__(self): self.is_currently_useless = True @static...
bsd-3-clause
Python
f082b03421794509f2db736aca3d93f850e2c85e
Test new vim
cancro7/gem5,cancro7/gem5,cancro7/gem5,cancro7/gem5,cancro7/gem5,cancro7/gem5,cancro7/gem5
configs/lapo/reg_fault.py
configs/lapo/reg_fault.py
""" This file creates a barebones system and executes 'hello', a simple Hello World application. This config file assumes that the x86 ISA was built. See gem5/configs/learning_gem5/part1/simple.py for a general script. """ # import the m5 (gem5) library created when gem5 is built import m5 # import all of the SimObj...
""" This file creates a barebones system and executes 'hello', a simple Hello World application. This config file assumes that the x86 ISA was built. See gem5/configs/learning_gem5/part1/simple.py for a general script. """ # import the m5 (gem5) library created when gem5 is built import m5 # import all of the SimObj...
bsd-3-clause
Python
a9da2a04cb05af1cc65d1e4535a514a710d1f24b
Fix #389: Spelling of deprecated.
RaD/django-south,philipn/django-south,nimnull/django-south,philipn/django-south,RaD/django-south,nimnull/django-south,RaD/django-south
south/management/commands/startmigration.py
south/management/commands/startmigration.py
""" Now-obsolete startmigration command. """ from optparse import make_option from django.core.management.base import BaseCommand from django.core.management.color import no_style class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--model', action='append', dest='added_mod...
""" Now-obsolete startmigration command. """ from optparse import make_option from django.core.management.base import BaseCommand from django.core.management.color import no_style class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--model', action='append', dest='added_mod...
apache-2.0
Python
1da262affaa5bf2a9ca50936c327ec63090dd275
remove assert
benagricola/exabgp,PowerDNS/exabgp,blablacar/exabgp,dneiter/exabgp,earies/exabgp,lochiiconnectivity/exabgp,PowerDNS/exabgp,fugitifduck/exabgp,dneiter/exabgp,earies/exabgp,benagricola/exabgp,lochiiconnectivity/exabgp,dneiter/exabgp,blablacar/exabgp,earies/exabgp,fugitifduck/exabgp,benagricola/exabgp,lochiiconnectivity/e...
lib/exabgp/bgp/message/update/attribute/community/extended/rt.py
lib/exabgp/bgp/message/update/attribute/community/extended/rt.py
# encoding: utf-8 """ rt.py Created by Thomas Mangin on 2014-06-20. Copyright (c) 2014-2014 Orange. All rights reserved. """ import socket from struct import pack,unpack from exabgp.bgp.message.open.asn import ASN from exabgp.bgp.message.update.attribute.community.extended import ExtendedCommunity # ==============...
# encoding: utf-8 """ rt.py Created by Thomas Mangin on 2014-06-20. Copyright (c) 2014-2014 Orange. All rights reserved. """ import socket from struct import pack,unpack from exabgp.bgp.message.open.asn import ASN from exabgp.bgp.message.update.attribute.community.extended import ExtendedCommunity # ==============...
bsd-3-clause
Python
f0083b4053ceb43f9cf6a386f01f377736783f9a
Add unicode for NodeRelation
binoculars/osf.io,pattisdr/osf.io,chennan47/osf.io,CenterForOpenScience/osf.io,binoculars/osf.io,hmoco/osf.io,mattclark/osf.io,Nesiehr/osf.io,sloria/osf.io,Nesiehr/osf.io,pattisdr/osf.io,erinspace/osf.io,caseyrollins/osf.io,mfraezz/osf.io,leb2dg/osf.io,hmoco/osf.io,adlius/osf.io,Johnetordoff/osf.io,Nesiehr/osf.io,aaxel...
osf/models/node_relation.py
osf/models/node_relation.py
from django.db import models from .base import BaseModel, ObjectIDMixin class NodeRelation(ObjectIDMixin, BaseModel): parent = models.ForeignKey('AbstractNode', related_name='node_relations') child = models.ForeignKey('AbstractNode') is_node_link = models.BooleanField(default=False, db_index=True) d...
from django.db import models from .base import BaseModel, ObjectIDMixin class NodeRelation(ObjectIDMixin, BaseModel): parent = models.ForeignKey('AbstractNode', related_name='node_relations') child = models.ForeignKey('AbstractNode') is_node_link = models.BooleanField(default=False, db_index=True) @...
apache-2.0
Python
6d11692f17f1c23ad0267d684c569c171b0f06e4
Print MiB/s stats for pickling.
tabish121/pyActiveMQ,tabish121/pyActiveMQ,tabish121/pyActiveMQ
src/examples/numpypickle.py
src/examples/numpypickle.py
#!/usr/bin/env python # Copyright 2007 Albert Strasheim <fullung@gmail.com> # # 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 requ...
#!/usr/bin/env python # Copyright 2007 Albert Strasheim <fullung@gmail.com> # # 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 requ...
apache-2.0
Python
9c4ae70661cf3a4e4d2f3876b3e81e95fae3f619
revise __openerp__.py
amdeb/odoo-connector
connector8/__openerp__.py
connector8/__openerp__.py
# -*- coding: utf-8 -*- {'name': 'Connector8', 'version': '0.1', 'author': 'Amdeb', 'license': 'AGPL-3', 'category': 'Generic Modules', 'description': """ This is a port of OCA connector to Odoo 8.0 """, 'depends': ['mail' ], 'data': ['security/connector_security.xml', 'security/ir.model....
# -*- coding: utf-8 -*- {'name': 'Connector8', 'version': '0.1', 'author': 'Amdeb', 'license': 'AGPL-3', 'category': 'Generic Modules', 'description': """ This is a port of OCA connector to Odoo 8.0 """, 'depends': ['base', 'base_setup', ], 'data': ['security/connector_security.xml', ...
agpl-3.0
Python
c1075f9d696bae82474c4010731eb6392425e939
Disable VEP cluster test until mismatch is resolved (#6597)
danking/hail,cseed/hail,danking/hail,cseed/hail,hail-is/hail,cseed/hail,hail-is/hail,hail-is/hail,cseed/hail,danking/hail,danking/hail,danking/hail,danking/hail,hail-is/hail,cseed/hail,cseed/hail,danking/hail,hail-is/hail,hail-is/hail,hail-is/hail,danking/hail,hail-is/hail,cseed/hail,cseed/hail
hail/python/cluster-tests/cluster-vep-check.py
hail/python/cluster-tests/cluster-vep-check.py
import hail as hl GOLD_STD = 'gs://hail-common/vep/vep/vep_examplars/vep_no_csq_4dc19bc1b.mt/' GOLD_STD_CSQ = 'gs://hail-common/vep/vep/vep_examplars/vep_csq_4dc19bc1b.mt/' for path, csq in [(GOLD_STD, False), (GOLD_STD_CSQ, True)]: print(f"Checking 'hl.vep' replicates on '{path}'") expected = hl.read_matrix_...
import hail as hl GOLD_STD = 'gs://hail-common/vep/vep/vep_examplars/vep_no_csq_4dc19bc1b.mt/' GOLD_STD_CSQ = 'gs://hail-common/vep/vep/vep_examplars/vep_csq_4dc19bc1b.mt/' for path, csq in [(GOLD_STD, False), (GOLD_STD_CSQ, True)]: print(f"Checking 'hl.vep' replicates on '{path}'") expected = hl.read_matrix_...
mit
Python
95520e1b5020ff805d4bd3f51ac5c64d0f1a3215
add computing reversed records
it-projects-llc/misc-addons,it-projects-llc/misc-addons,it-projects-llc/misc-addons
base_details/models/base_details.py
base_details/models/base_details.py
# -*- coding: utf-8 -*- from odoo import fields, models, api class BaseDetails(models.AbstractModel): """Model to be inherited by Model where details field has to be added""" _name = 'base_details' def _model_selection(self): return [] @property def details(self): if self.details...
# -*- coding: utf-8 -*- from odoo import fields, models class BaseDetails(models.AbstractModel): _name = 'base_details' def _model_selection(self): return [] @property def details(self): if self.details_model and self.details_model in self.env and self.details_res_id: det...
mit
Python
85a5a3b716de02b2f091577c8d84d3d5286849e8
Update frames_rendering.py
duboviy/study_languages
image_translate/frames_rendering.py
image_translate/frames_rendering.py
# need to install python-opencv, pygame, numpy, scipy, PIL import sys import pygame from pygame.locals import * import opencv #this is important for capturing/displaying images from opencv import highgui def get_image(camera): img = highgui.cvQueryFrame(camera) # Add the line below if you need it (Ubuntu 8....
# need to install python-opencv, pygame, numpy, scipy, PIL import sys import pygame import Image from pygame.locals import * import opencv #this is important for capturing/displaying images from opencv import highgui def get_image(camera): img = highgui.cvQueryFrame(camera) # Add the line below if you need ...
mit
Python
7d43f58fbcefae5885c3fd364e26c7f27d1e239a
migrate command fix
condograde/sqlibrist
sqlibrist/commands/migrate.py
sqlibrist/commands/migrate.py
# -*- coding: utf8 -*- import glob import os from sys import stdout from sqlibrist.helpers import get_engine, get_config, ApplyMigrationFailed def unapplied_migrations(migration_list, last_migration): on = False for migration in migration_list: if migration.split('/')[-1] == last_migration: ...
# -*- coding: utf8 -*- import glob import os from sys import stdout from sqlibrist.helpers import get_engine, get_config, ApplyMigrationFailed def unapplied_migrations(migration_list, last_migration): on = False for migration in migration_list: if migration.split('/')[-1] == last_migration: ...
mit
Python
99227d137c5257e5a850d65114d1d9c30072e738
Make buildversion.py accept the argument - to print to stdout instead of a file
code-google-com/srcdemo2,AGSPhoenix/srcdemo2,EtiennePerot/srcdemo2,n1889/srcdemo2,AGSPhoenix/srcdemo2,EtiennePerot/srcdemo2,n1889/srcdemo2,EtiennePerot/srcdemo2,code-google-com/srcdemo2,n1889/srcdemo2,EtiennePerot/srcdemo2,xxtbg/srcdemo2,slav9nin/srcdemo2,xxtbg/srcdemo2,code-google-com/srcdemo2,Nofe92/srcdemo2,n1889/sr...
package/any/buildversion.py
package/any/buildversion.py
#!/usr/bin/env python import sys, time if '-' in sys.argv: print(time.strftime('%Y-%m-%d')) else: f = open('version.txt', 'w') f.write(time.strftime('%Y-%m-%d')) f.close()
import time f = open('version.txt', 'w') f.write(time.strftime('%Y-%m-%d')) f.close()
bsd-2-clause
Python