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
df301fad7106b0631215b96299801b81ccc38a0e
Update geoipupdater.py
mortn/geoipupdater
geoipupdater.py
geoipupdater.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Update GeoIP.dat if newer version exists on maxmind.com Intended to run as a cronjob """ __author__ = 'Morten Abildgaard <morten@abildgaard.org>' __version__ = '1.1' import logging as log import os, sys from cStringIO import StringIO from datetime import datetime from g...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Update GeoIP.dat if newer version exists on maxmind.com Intended to run as a cronjob """ __author__ = 'Morten Abildgaard <morten@abildgaard.org>' __version__ = '1.1' import logging as log import os, sys from cStringIO import StringIO from datetime import datetime from g...
apache-2.0
Python
3d8d181c6aea1c80c860b6735c878899baa57f70
Update main.py
jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi,jeonghoonkang/BerePi
apps/telegram/diskreport/main.py
apps/telegram/diskreport/main.py
# -*- coding: utf-8 -*- # Author : JeongooonKang (github.com/jeonghoonkang) import json import time import socket import fcntl import struct import os import datetime import telegram import requests from pytz import timezone def get_ip_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) info...
# -*- coding: utf-8 -*- # Author : JeongooonKang (github.com/jeonghoonkang) import json import time import local_port_scanning import socket import fcntl import struct import os def get_ip_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) info = fcntl.ioctl (s.fileno(), 0x8915, s...
bsd-2-clause
Python
3ba1ffaedc35ed4334db1ad33cdcb99f605953c3
add trace_module to debugutils
doublereedkurt/boltons
boltons/debugutils.py
boltons/debugutils.py
# -*- coding: utf-8 -*- """ A small set of utilities useful for debugging misbehaving applications. Currently this focuses on ways to use :mod:`pdb`, the built-in Python debugger. """ __all__ = ['pdb_on_signal', 'pdb_on_exception', 'trace_module'] def pdb_on_signal(signalnum=None): """Installs a signal handler f...
# -*- coding: utf-8 -*- """ A small set of utilities useful for debugging misbehaving applications. Currently this focuses on ways to use :mod:`pdb`, the built-in Python debugger. """ __all__ = ['pdb_on_signal', 'pdb_on_exception'] def pdb_on_signal(signalnum=None): """Installs a signal handler for *signalnum*, ...
bsd-3-clause
Python
ad11ab338b5b04919c18900ece86096dbe3222f8
Update error message
vimeo/vimeo.py,gabrielgisoldo/vimeo.py
vimeo/exceptions.py
vimeo/exceptions.py
#!/usr/bin/env python class BaseVimeoException(Exception): def _get_message(self, response): json = None try: json = response.json() except: pass if json: message = json['error'] else: message = response.text return m...
#!/usr/bin/env python class BaseVimeoException(Exception): def _get_message(self, response): json = None try: json = response.json() except: pass if json: message = json['error'] else: message = response.text return m...
apache-2.0
Python
4a41b33286cf881f0b3aa09c29a4aaa3568b5259
Convert numpy int to native int for JSON serialization
reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualis...
website/stats/plots/mimp.py
website/stats/plots/mimp.py
from analyses.mimp import glycosylation_sub_types, run_mimp from helpers.plots import stacked_bar_plot from ..store import counter @counter @stacked_bar_plot def gains_and_losses_for_glycosylation_subtypes(): results = {} effects = 'loss', 'gain' for source_name in ['mc3', 'clinvar']: for site_ty...
from analyses.mimp import glycosylation_sub_types, run_mimp from helpers.plots import stacked_bar_plot from ..store import counter @counter @stacked_bar_plot def gains_and_losses_for_glycosylation_subtypes(): results = {} effects = 'loss', 'gain' for source_name in ['mc3', 'clinvar']: for site_ty...
lgpl-2.1
Python
0872a48326cc19afd4371d153897eae26487b0f4
fix bug
PytLab/VASPy,PytLab/VASPy
scripts/create_xsd.py
scripts/create_xsd.py
''' Script to convert CONTCAR to .xsd file ''' import commands from vaspy.matstudio import XsdFile from vaspy.atomco import PosCar status, output = commands.getstatusoutput('ls *.xsd | head -1') xsd = XsdFile(filename=output) poscar = PosCar(filename='CONTCAR') xsd.data = poscar.data jobname = output.split('.')[0...
''' Script to convert CONTCAR to .xsd file ''' from vaspy.matstudio import XsdFile from vaspy.atomco import PosCar status, output = commands.getstatusoutput('ls *.xsd | head -1') xsd = XsdFile(filename=output) poscar = PosCar(filename='CONTCAR') xsd.data = poscar.data jobname = output.split('.')[0] xsd.tofile(fil...
mit
Python
e287fe67a7c4aaf231b0eb0003cdd18cb615da47
Bump version to 18.04.15-1
charlievieth/GoSubl,charlievieth/GoSubl
gosubl/about.py
gosubl/about.py
import re import sublime # GoSublime Globals ANN = 'a18.04.15-1' VERSION = 'r18.04.15-1' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
import re import sublime # GoSublime Globals ANN = 'a14.02.25-1' VERSION = 'r14.12.06-1' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
mit
Python
a54a2dc1cd055c1a9a897fe09876b7a505b5facf
Add dummy vendor to test settings
django-oscar/django-oscar-sagepay-direct
tests/settings.py
tests/settings.py
SECRET_KEY = 'asdf' HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', }, } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } import logging logging.disable(logging.CRITICAL) INSTALLED_APPS...
SECRET_KEY = 'asdf' HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', }, } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } import logging logging.disable(logging.CRITICAL) INSTALLED_APPS...
bsd-3-clause
Python
f98c0dcabc40a4967c19b76551499afe32026fd9
Add response class and define is_response() on test strategy
nirmalvp/python-social-auth,clef/python-social-auth,bjorand/python-social-auth,nirmalvp/python-social-auth,python-social-auth/social-storage-sqlalchemy,barseghyanartur/python-social-auth,noodle-learns-programming/python-social-auth,DhiaEddineSaidi/python-social-auth,jameslittle/python-social-auth,VishvajitP/python-soci...
tests/strategy.py
tests/strategy.py
from social.strategies.base import BaseStrategy, BaseTemplateStrategy TEST_URI = 'http://myapp.com' TEST_HOST = 'myapp.com' class Redirect(object): def __init__(self, url): self.url = url class Response(object): def __init__(self, value): self.value = value class TestTemplateStrategy(Bas...
from social.strategies.base import BaseStrategy, BaseTemplateStrategy TEST_URI = 'http://myapp.com' TEST_HOST = 'myapp.com' class Redirect(object): def __init__(self, url): self.url = url class TestTemplateStrategy(BaseTemplateStrategy): def render_template(self, tpl, context): return tpl ...
bsd-3-clause
Python
0730a438ce4ef90a9ef18e926a8363b7df19af4f
Use getattr() to support Python 2.6 and older.
metasmile/grit-i18n,sevansahumIlovemuhammad/grit-i18n,lhopps/grit-i18n,joisig/grit-i18n,metasmile/grit-i18n,megamanfx/grit-i18n,invalidstatement/grit-i18n,skidzen/grit-i18n,CrankWheel/grit-i18n,lhopps/grit-i18n,willbittner/grit-i18n,qjw/grit-i18n,megamanfx/grit-i18n,invalidstatement/grit-i18n,qjw/grit-i18n,sevansahumIl...
grit/lazy_re.py
grit/lazy_re.py
#!/usr/bin/python # Copyright (c) 2012 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. '''In GRIT, we used to compile a lot of regular expressions at parse time. Since many of them never get used, we use lazy_re to compil...
#!/usr/bin/python # Copyright (c) 2012 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. '''In GRIT, we used to compile a lot of regular expressions at parse time. Since many of them never get used, we use lazy_re to compil...
bsd-2-clause
Python
d7232d855d406a26b2485b5c1fcd587e90fddf39
Fix Runtime warnings on async tests
RazerM/ratelimiter
tests/test_aio.py
tests/test_aio.py
import pytest from ratelimiter import RateLimiter @pytest.mark.asyncio async def test_alock(event_loop): rl = RateLimiter(max_calls=10, period=0.01) assert rl._alock is None async with rl: pass alock = rl._alock assert alock async with rl: pass assert rl._alock is aloc...
import pytest from ratelimiter import RateLimiter @pytest.mark.asyncio async def test_alock(): rl = RateLimiter(max_calls=10, period=0.01) assert rl._alock is None async with rl: pass alock = rl._alock assert alock async with rl: pass assert rl._alock is alock
apache-2.0
Python
37e31972cc36efd93a92cf52d80bdce8e2a6458e
Add trailing slash to dental plan detail url
agendaodonto/server,agendaodonto/server
app/schedule/urls.py
app/schedule/urls.py
from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns from app.schedule.views.clinic import ClinicDetail from app.schedule.views.clinic import ClinicList, ClinicPatients from app.schedule.views.dental_plan import DentalPlanList, DentalPlanDetail from app.schedule.views.dentist ...
from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns from app.schedule.views.clinic import ClinicDetail from app.schedule.views.clinic import ClinicList, ClinicPatients from app.schedule.views.dental_plan import DentalPlanList, DentalPlanDetail from app.schedule.views.dentist ...
agpl-3.0
Python
97cbc26ee7343b36cdea7766f79a18f1a2e2700c
make main docstring one line for flit
almarklein/pywasm,almarklein/wasmfun,almarklein/wasmfun,almarklein/pywasm,almarklein/wasmfun
wasmfun/__init__.py
wasmfun/__init__.py
""" A Python library that provides tools to handle WASM code. """ __version__ = '0.1' from ._opcodes import OPCODES from .fields import * from .util import *
""" A Python library that provides tools to handle WASM code, like generating WASM, and perhaps someday interpreting it too. """ __version__ = '0.1' from ._opcodes import OPCODES from .fields import * from .util import *
bsd-2-clause
Python
85b88eff8eb2d745649c9d8e60ebb45067c8f214
make launch ipdb_on_exception importable
michelesr/ipdb
ipdb/__init__.py
ipdb/__init__.py
# Copyright (c) 2007, 2010, 2011, 2012 Godefroid Chapelle # # This file is part of ipdb. # GNU package is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 2 of the License, or (at your option) # ...
# Copyright (c) 2007, 2010, 2011, 2012 Godefroid Chapelle # # This file is part of ipdb. # GNU package is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 2 of the License, or (at your option) # ...
bsd-3-clause
Python
85415c225de51ace61eff76a493f31bd4cd3955f
fix the incorrect filename
zzw922cn/Automatic_Speech_Recognition,zzw922cn/Automatic_Speech_Recognition
speechvalley/feature/libri/__init__.py
speechvalley/feature/libri/__init__.py
# encoding: utf-8 # ****************************************************** # Author : zzw922cn # Last modified: 2017-12-09 11:00 # Email : zzw922cn@gmail.com # Filename : __init__.py # Description : Feature preprocessing for LibriSpeech dataset # ****************************************************** ...
# encoding: utf-8 # ****************************************************** # Author : zzw922cn # Last modified: 2017-12-09 11:00 # Email : zzw922cn@gmail.com # Filename : __init__.py # Description : Feature preprocessing for LibriSpeech dataset # ****************************************************** ...
mit
Python
f096ff7d7e5b460e40878510d4222d6f82eb3e99
Bump version for pypi to 0.2018.07.08.0419
oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb
ipwb/__init__.py
ipwb/__init__.py
__version__ = '0.2018.07.08.0419'
__version__ = '0.2018.07.08.0414'
mit
Python
3a7a258f8e9cf255642dc8fb0fa8c207f73e37cf
add unit test for deprecating properties
yanikou19/monty,gmatteo/monty,materialsvirtuallab/monty,gpetretto/monty,materialsvirtuallab/monty,davidwaroquiers/monty,gmatteo/monty,davidwaroquiers/monty
tests/test_dev.py
tests/test_dev.py
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import warnings from monty.dev import deprecated, requires class DecoratorTest(unittest.TestCase): d...
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import warnings from monty.dev import deprecated, requires class DecoratorTest(unittest.TestCase): d...
mit
Python
b929b73880a7bf3cba97b138ddb96f6c3cf165b0
add MIDDLEWARE_CLASSES for Django 1.7
jannon/django-haystack,sgaist/django-haystack,kuanyui/django-haystack,cyanut/django-haystack,django-searchstack/django-searchstack,antonyr/django-haystack,fisle/django-haystack,ruimashita/django-haystack,django-searchstack/django-searchstack,comandrei/django-haystack,jannon/django-haystack,barseghyanartur/django-haysta...
test_haystack/settings.py
test_haystack/settings.py
import os from tempfile import mkdtemp SECRET_KEY = "Please do not spew DeprecationWarnings" # Haystack settings for running tests. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'haystack_tests.db', } } INSTALLED_APPS = [ 'django.contrib.admin', 'django.co...
import os from tempfile import mkdtemp SECRET_KEY = "Please do not spew DeprecationWarnings" # Haystack settings for running tests. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'haystack_tests.db', } } INSTALLED_APPS = [ 'django.contrib.admin', 'django.co...
bsd-3-clause
Python
d47d56525f85c5fa8b1f6b817a85479b9eb07582
Add query_entities to functions module import
joshfriend/sqlalchemy-utils,joshfriend/sqlalchemy-utils,cheungpat/sqlalchemy-utils,marrybird/sqlalchemy-utils,rmoorman/sqlalchemy-utils,spoqa/sqlalchemy-utils,tonyseek/sqlalchemy-utils,tonyseek/sqlalchemy-utils,JackWink/sqlalchemy-utils,konstantinoskostis/sqlalchemy-utils
sqlalchemy_utils/functions/__init__.py
sqlalchemy_utils/functions/__init__.py
from .defer_except import defer_except from .mock import create_mock_engine, mock_engine from .render import render_expression, render_statement from .sort_query import sort_query, QuerySorterException from .database import ( database_exists, create_database, drop_database, escape_like, is_auto_assi...
from .defer_except import defer_except from .mock import create_mock_engine, mock_engine from .render import render_expression, render_statement from .sort_query import sort_query, QuerySorterException from .database import ( database_exists, create_database, drop_database, escape_like, is_auto_assi...
bsd-3-clause
Python
a5e9bcdf365921818c8c69810f014664a03ebf3e
update conan script
Enhex/Cereal-Optional-NVP,Enhex/Cereal-Optional-NVP
test_package/conanfile.py
test_package/conanfile.py
import os from conans import ConanFile, CMake, tools class CerealoptionalnvpTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" def build(self): cmake = CMake(self) # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is # i...
from conans import ConanFile, CMake import os class CerealoptionalnvpTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" def build(self): cmake = CMake(self) # Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package" ...
mit
Python
178993d9f1da3b1bfade0b3fca076bd069936115
Fix name of postgresql dialect.
konstantinoskostis/sqlalchemy-utils,joshfriend/sqlalchemy-utils,tonyseek/sqlalchemy-utils,JackWink/sqlalchemy-utils,cheungpat/sqlalchemy-utils,spoqa/sqlalchemy-utils,marrybird/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,rmoorman/sqlalchemy-utils
sqlalchemy_utils/functions/database.py
sqlalchemy_utils/functions/database.py
from sqlalchemy.engine.url import make_url import sqlalchemy as sa from sqlalchemy.exc import ProgrammingError, OperationalError import os def database_exists(url): """Check if a database exists. """ url = make_url(url) database = url.database url.database = None engine = sa.create_engine(ur...
from sqlalchemy.engine.url import make_url import sqlalchemy as sa from sqlalchemy.exc import ProgrammingError import os def database_exists(url): """Check if a database exists. """ url = make_url(url) database = url.database url.database = None engine = sa.create_engine(url) if engine....
bsd-3-clause
Python
91242483a79a66eb18fdcbf1090422541d6a06b0
Add support for .db2 files
jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow
wdbc/environment.py
wdbc/environment.py
# -*- coding: utf-8 -*- import os, os.path from .. import wdbc stripfilename = wdbc.getfilename class Environment(object): def __init__(self, build, locale="enGB", base="/var/www/sigrie/caches/caches/"): self.build = build self.path = "%s/%i/%s/" % (base, build, locale) if not os.path.exists(self.path): ra...
# -*- coding: utf-8 -*- import os, os.path from .. import wdbc stripfilename = wdbc.getfilename class Environment(object): def __init__(self, build, locale="enGB", base="/var/www/sigrie/caches/caches/"): self.build = build self.path = "%s/%i/%s/" % (base, build, locale) if not os.path.exists(self.path): ra...
cc0-1.0
Python
a95f43767cb95d5a0137a6563c6fdbd725663aa6
fix community dump
hasadna/OpenCommunity,yaniv14/OpenCommunity,nonZero/OpenCommunity,nonZero/OpenCommunity,yaniv14/OpenCommunity,yaniv14/OpenCommunity,nonZero/OpenCommunity,hasadna/OpenCommunity,hasadna/OpenCommunity,nonZero/OpenCommunity,hasadna/OpenCommunity,yaniv14/OpenCommunity
src/communities/management/commands/dump_community.py
src/communities/management/commands/dump_community.py
from communities.models import Community from django.core import serializers from django.core.management.base import BaseCommand from issues.models import Issue, IssueComment, IssueCommentRevision, Proposal from meetings.models import Meeting, AgendaItem, MeetingParticipant, \ MeetingExternalParticipant from users....
from communities.models import Community from django.core import serializers from django.core.management.base import BaseCommand from issues.models import Issue, IssueComment, IssueCommentRevision, Proposal from meetings.models import Meeting, AgendaItem, MeetingParticipant, \ MeetingExternalParticipant from users....
bsd-3-clause
Python
ffb95904557695594a93bdf203fc6f65a5b27244
add reservation for exact day
kojdjak/django-reservations,kojdjak/django-reservations
reservations/rutils.py
reservations/rutils.py
from django.utils import timezone, dateparse from datetime import datetime, timedelta from .models import Reservation, Field ''' kind of utils for django-reservations ''' class ReservationExist(Exception): pass def create_reservation(field_id, res_date, reservation_time, user): ''' Create reservation....
from django.utils import timezone, dateparse from datetime import datetime, timedelta from .models import Reservation, Field ''' kind of utils for django-reservations ''' class ReservationExist(Exception): pass def create_reservation(field_id, res_date, reservation_time, user): field = Field.objects.get(i...
mit
Python
88c74cd60724fd68c30f31f87940d4558b092023
Add char protection, remove ending line return
moreymat/omw-graph,moreymat/omw-graph,moreymat/omw-graph
parser/srcs/simpleFileParser.py
parser/srcs/simpleFileParser.py
#!/usr/bin/env python #-*- coding: utf-8 -*- """ Simple File Parser """ import os import sys __author__ = 'Guieu Christophe, Tallot Adrien' __date__ = '25-03-2014' __version__ = '0.1' dtl = [] ccl = [] deli = '' def verifyFile(filename): if filename == '': print('Error : put filename') sys.ex...
#!/usr/bin/env python #-*- coding: utf-8 -*- """ Simple File Parser """ import os import sys __author__ = 'Guieu Christophe, Tallot Adrien' __date__ = '25-03-2014' __version__ = '0.1' dtl = [] ccl = [] deli = '' def verifyFile(filename): if filename == '': print('Error : put filename') sys.ex...
mit
Python
1e7a6bcd6a2236feb32ec36224a3fb224f0e374c
Add license key in __openerp__.py
bmya/server-tools,bmya/server-tools,brain-tec/server-tools,brain-tec/server-tools,brain-tec/server-tools,bmya/server-tools
dbfilter_from_header/__openerp__.py
dbfilter_from_header/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Python
2c4a33772817a98cacc5bd82517cfd5918711f28
Add allowed hosts
nsavch/xanmel-web
xanmel_web/settings/prod.py
xanmel_web/settings/prod.py
from .default import * ALLOWED_HOSTS = ['xon.teichisma.info'] DEBUG = False TEMPLATE_DEBUG = False with open('/etc/xanmel.yaml', 'r') as f: XANMEL_CONFIG = yaml.safe_load(f) XONOTIC_SERVERS = XANMEL_CONFIG['modules']['xanmel.modules.xonotic.XonoticModule']['servers']
from .default import * DEBUG = False TEMPLATE_DEBUG = False with open('/etc/xanmel.yaml', 'r') as f: XANMEL_CONFIG = yaml.safe_load(f) XONOTIC_SERVERS = XANMEL_CONFIG['modules']['xanmel.modules.xonotic.XonoticModule']['servers']
agpl-3.0
Python
7ab9403b1733360a53681ba39a0040c4231e8382
Fix to Rest
luizcieslak/AlGDock,gkumar7/AlGDock,gkumar7/AlGDock,gkumar7/AlGDock,luizcieslak/AlGDock,luizcieslak/AlGDock,gkumar7/AlGDock,luizcieslak/AlGDock
gui/api/REST.py
gui/api/REST.py
from flask import Flask, jsonify import os from cross_domain import * app = Flask(__name__) try: TARGET = os.environ['TARGET'] AlGDock = os.environ['AlGDock'] except Exception: print 'export TARGET=<path to data>' exit(1) import sys sys.path.insert(0, AlGDock) from BindingPMF_arguments import * @ap...
from flask import Flask, jsonify import os from cross_domain import * app = Flask(__name__) try: TARGET = os.environ['TARGET'] AlGDock = os.environ['AlGDock'] except Exception: print 'export TARGET=<path to data>' exit(1) import sys sys.path.insert(0, AlGDock) from BindingPMF_arguments import * @ap...
mit
Python
c4d2272db2d5259ff54503a20ef92ae642ae34da
Hide swap if it is zero
yang-ling/i3pystatus,yang-ling/i3pystatus
i3pystatus/mem_swap.py
i3pystatus/mem_swap.py
from i3pystatus import IntervalModule from psutil import swap_memory from .core.util import round_dict class Swap(IntervalModule): """ Shows memory load .. rubric:: Available formatters * {used_swap} Requires psutil (from PyPI) """ format = "{used_swap} MiB" divisor = 1024 ** 2 ...
from i3pystatus import IntervalModule from psutil import swap_memory from .core.util import round_dict class Swap(IntervalModule): """ Shows memory load .. rubric:: Available formatters * {used_swap} Requires psutil (from PyPI) """ format = "{used_swap} MiB" divisor = 1024 ** 2 ...
mit
Python
244a8ef2d3976970f8647e5fdd3979932cebe6d7
Remove debug task from Celery
fengthedroid/heroes-of-the-storm-replay-parser,fengthedroid/heroes-of-the-storm-replay-parser,Oize/heroes-of-the-storm-replay-parser,Oize/heroes-of-the-storm-replay-parser,karlgluck/heroes-of-the-storm-replay-parser,Oize/heroes-of-the-storm-replay-parser
webserver/celery.py
webserver/celery.py
from __future__ import absolute_import import os from celery import Celery from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webserver.settings') app = Celery('webserver') # Using a string here means the worker will n...
from __future__ import absolute_import import os from celery import Celery from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webserver.settings') app = Celery('webserver') # Using a string here means the worker will n...
mit
Python
ea6d18725f06ee76963d36c7e910a3d0a100e967
change the name in my groups py
moranmo29/ShareLink,moranmo29/ShareLink,moranmo29/ShareLink
web/pages/mygroups.py
web/pages/mygroups.py
from google.appengine.ext.webapp import template import webapp2 import json from models.user import User from models.link import Link from models.group import Group class IndexHandler(webapp2.RequestHandler): def get(self): template_params={} user = None if self.request.cookies.get('our_token'): #the cookie...
from google.appengine.ext.webapp import template import webapp2 import json from models.user import User from models.link import Link from models.group import Group class IndexHandler(webapp2.RequestHandler): def get(self): template_params={} user = None if self.request.cookies.get('our_token'): #the cookie...
mit
Python
e4af848276255543e0ece169068a5d46fdd0549a
add specific LaTeX processing exception
cstrelioff/resumepy,cstrelioff/resumepy
resumepy/exceptions.py
resumepy/exceptions.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Christopher C. Strelioff <chris.strelioff@gmail.com> # # Distributed under terms of the MIT license. """exceptions.py Exceptions for the resumepy packge. """ class resumepyException(Exception): """Root resumepy Exception.""" ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Christopher C. Strelioff <chris.strelioff@gmail.com> # # Distributed under terms of the MIT license. """exceptions.py Exceptions for the resumepy packge. """ class resumepyException(Exception): """Root resumepy Exception.""" ...
mit
Python
d151e632cbcdc033d0687922c95d70b69dcb7233
test for searchUID for full record
tainstr/misura.canon,tainstr/misura.canon
misura/canon/indexer/tests/test_indexer.py
misura/canon/indexer/tests/test_indexer.py
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from misura import parameters as params from misura.canon import indexer import os cur_dir = os.path.dirname(os.path.realpath(__file__)) paths = [cur_dir + '/files'] dbPath = cur_dir + '/files/test.sqlite' class Indexer(unittest.TestCase): def setUp(se...
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from misura import parameters as params from misura.canon import indexer import os cur_dir = os.path.dirname(os.path.realpath(__file__)) paths = [cur_dir + '/files'] dbPath = cur_dir + '/files/test.sqlite' class Indexer(unittest.TestCase): def setUp(se...
mit
Python
09ffeb2f53b853914056e165e4e9824e025d2d31
Add missing dependency.
mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju
utility.py
utility.py
from contextlib import contextmanager import errno import os import socket import sys from jujupy import until_timeout @contextmanager def scoped_environ(): old_environ = dict(os.environ) try: yield finally: os.environ.clear() os.environ.update(old_environ) def wait_for_port(hos...
from contextlib import contextmanager import errno import os import socket from jujupy import until_timeout @contextmanager def scoped_environ(): old_environ = dict(os.environ) try: yield finally: os.environ.clear() os.environ.update(old_environ) def wait_for_port(host, port, cl...
agpl-3.0
Python
24a101c333ddc58fd4d00f96e80acbe37d747a03
Add genre properties
AudioCommons/ac-annotator,AudioCommons/ac-annotator,AudioCommons/ac-annotator
music_annotator/views.py
music_annotator/views.py
from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt import json def index(request): freesound_ids = ['181425', '370934', '191630', '191630', '232014', '219056', '325407'] return render(request, 'choose_sound.html', {'freesound_ids': freesound_ids}) @csrf_exempt def annot...
from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt import json def index(request): freesound_ids = ['181425', '370934', '191630', '191630', '232014', '219056', '325407'] return render(request, 'choose_sound.html', {'freesound_ids': freesound_ids}) @csrf_exempt def annot...
apache-2.0
Python
946aa536852ddd191aa4cb9550702b014c68dae4
Check pep8
Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot
tests/models/talk_test.py
tests/models/talk_test.py
from unittest import TestCase from unittest.mock import patch, MagicMock from meetup_facebook_bot.models.talk import Talk class TalkTestCase(TestCase): def setUp(self): self.db_session = MagicMock() self.like_mock = MagicMock() self.user_id = 1 self.talk_id = 1 self.talk =...
from unittest import TestCase from unittest.mock import patch, MagicMock from meetup_facebook_bot.models.talk import Talk class TalkTestCase(TestCase): def setUp(self): self.db_session = MagicMock() self.user_id = 1 self.talk_id = 1 @patch('meetup_facebook_bot.models.talk.Like') d...
mit
Python
51e2515f1d8fe595f14edc40d5ea34fcb4b6844c
Bump version post-release
praekeltfoundation/seaworthy
seaworthy/__init__.py
seaworthy/__init__.py
""" seaworthy ~~~~~~~~~ .. todo:: Write some API reference docs for :mod:`seaworthy`. """ from .helpers import DockerHelper from .logs import output_lines, wait_for_logs_matching __all__ = ['DockerHelper', 'output_lines', 'wait_for_logs_matching'] __version__ = '0.2.2.dev0'
""" seaworthy ~~~~~~~~~ .. todo:: Write some API reference docs for :mod:`seaworthy`. """ from .helpers import DockerHelper from .logs import output_lines, wait_for_logs_matching __all__ = ['DockerHelper', 'output_lines', 'wait_for_logs_matching'] __version__ = '0.2.1'
bsd-3-clause
Python
1e6f4c9bb79c4709ea17005025aa976ab035fe30
switch to spaces indentation
fcfort/nyc-parking-ticket-checker
ticket_checker.py
ticket_checker.py
import argparse import mechanize import re from bs4 import BeautifulSoup BEAUTIFUL_SOUP_PARSER = "html.parser" parser = argparse.ArgumentParser() parser.add_argument('--violation', help='Violation #') args = parser.parse_args() br = mechanize.Browser() # Get first URL br.open("http://www1.nyc.gov/assets/finance/jum...
import argparse import mechanize import re from bs4 import BeautifulSoup BEAUTIFUL_SOUP_PARSER = "html.parser" parser = argparse.ArgumentParser() parser.add_argument('--violation', help='Violation #') args = parser.parse_args() br = mechanize.Browser() # Get first URL br.open("http://www1.nyc.gov/assets/finance/jum...
apache-2.0
Python
37ad21112e41133450284f9d99d323cae901dd06
Update version
fedelemantuano/tika-app-python
tikapp/version.py
tikapp/version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2016 Fedele Mantuano (https://twitter.com/fedelemantuano) 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/lice...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2016 Fedele Mantuano (https://twitter.com/fedelemantuano) 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/lice...
apache-2.0
Python
122a870812f3000639a439943bde980a6810a22e
Check output length before sending
corpnewt/CorpBot.py,corpnewt/CorpBot.py
Cogs/Ascii.py
Cogs/Ascii.py
from discord.ext import commands from Cogs import Utils, DisplayName, PickList, FuzzySearch, Message import pyfiglet def setup(bot): # Add the bot bot.add_cog(Ascii(bot)) class Ascii(commands.Cog): def __init__(self, bot): self.bot = bot global Utils, DisplayName Utils = self.bot.get_cog(...
from discord.ext import commands from Cogs import Utils, DisplayName, PickList, FuzzySearch, Message import pyfiglet def setup(bot): # Add the bot bot.add_cog(Ascii(bot)) class Ascii(commands.Cog): def __init__(self, bot): self.bot = bot global Utils, DisplayName Utils = self.bot.get_cog(...
mit
Python
0ce8f07d670d5fb6d5e52669ea97ef10c7a784e2
update number of neighbors for knn graph
usc-isi-i2/WEDC,usc-isi-i2/WEDC
wedc/domain/service/category_identification/graph/knn_graph.py
wedc/domain/service/category_identification/graph/knn_graph.py
from sklearn.neighbors import NearestNeighbors from sklearn import preprocessing import numpy as np # X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) # X = np.array([]) # X = np.append(X, [[1, 1, 0, 0]], axis=0) # X = np.append(X, [[0, 0, 0, 0]], axis=0) # print X # X = np.array(np.mat('1 2; 3...
from sklearn.neighbors import NearestNeighbors from sklearn import preprocessing import numpy as np # X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) # X = np.array([]) # X = np.append(X, [[1, 1, 0, 0]], axis=0) # X = np.append(X, [[0, 0, 0, 0]], axis=0) # print X # X = np.array(np.mat('1 2; 3...
apache-2.0
Python
1f9964e0a39e405c06c274f50cc18d03a181cdec
remove what is hopefully unncessary code
opencord/xos,zdw/xos,opencord/xos,cboling/xos,zdw/xos,cboling/xos,cboling/xos,zdw/xos,cboling/xos,open-cloud/xos,open-cloud/xos,cboling/xos,zdw/xos,opencord/xos,open-cloud/xos
xos/observers/helloworldservice/steps/sync_helloworldtenant.py
xos/observers/helloworldservice/steps/sync_helloworldtenant.py
import os import sys from django.db.models import Q, F from helloworldservice.models import HelloWorldService, HelloWorldTenant from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible parentdir = os.path.join(os.path.dirname(__file__), "..") sys.path.insert(0, parentdir) # Class to define how we ...
import os import sys from django.db.models import Q, F from helloworldservice.models import HelloWorldService, HelloWorldTenant from observers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible parentdir = os.path.join(os.path.dirname(__file__), "..") sys.path.insert(0, parentdir) # Class to define how we ...
apache-2.0
Python
96e28bc426947d6e30000f7d867adebf6a1fe267
Set version as 0.4.6
Alignak-monitoring-contrib/alignak-notifications,Alignak-monitoring-contrib/alignak-notifications
version.py
version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # David Durieux. david.durieux@alignak.net # """ Alignak - Checks pack for mail, slack,... notifications """ # Package name __pkg_name__ = u"alignak_notifications" # Checks types for PyPI k...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # David Durieux. david.durieux@alignak.net # """ Alignak - Checks pack for mail, slack,... notifications """ # Package name __pkg_name__ = u"alignak_notifications" # Checks types for PyPI k...
agpl-3.0
Python
adbcb045d89fcb20f5ed758e985ba0f432178f6b
Set version as 0.2.2
Alignak-monitoring-contrib/alignak-module-ws,Alignak-monitoring-contrib/alignak-module-ws
version.py
version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak - Receiver module for the external commands """ # Package name __pkg_name__ = u"alignak_module_ws" # Module type for PyPI keywords # Used for: # - PyPI keywords __module_types__ = u"web-services" # Application manifest __version__ = u"0.2.2" __author__ = u...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Alignak - Receiver module for the external commands """ # Package name __pkg_name__ = u"alignak_module_ws" # Module type for PyPI keywords # Used for: # - PyPI keywords __module_types__ = u"web-services" # Application manifest __version__ = u"0.2.1" __author__ = u...
agpl-3.0
Python
13ec50a7e2187edb03174ed4a9dbf8767f4c6ad4
Tag commit for v0.0.8-master generated by gitmake.py
ryansturmer/gitmake
version.py
version.py
major = 0 minor=0 patch=8 branch="master" timestamp=1376412892.53
major = 0 minor=0 patch=0 branch="dev" timestamp=1376412824.91
mit
Python
5770754c7b451a9e175b4906a26dfae5ce4fe1e6
Enable optimization.
ncareol/spatialdb,ncareol/spatialdb
tool_spatialdb.py
tool_spatialdb.py
import os import sys import eol_scons tools = ['sqlitedb','doxygen','prefixoptions'] env = Environment(tools = ['default'] + tools) thisdir = env.Dir('.').srcnode().abspath libsources = Split(""" SpatiaLiteDB.cpp """) headers = Split(""" SpatiaLiteDB.h """) env.AppendUnique(CPPDEFINES=['SPATIALITE_AMALGAMATION',]) ...
import os import sys import eol_scons tools = ['sqlitedb','doxygen','prefixoptions'] env = Environment(tools = ['default'] + tools) thisdir = env.Dir('.').srcnode().abspath libsources = Split(""" SpatiaLiteDB.cpp """) headers = Split(""" SpatiaLiteDB.h """) env.AppendUnique(CPPDEFINES=['SPATIALITE_AMALGAMATION',]) ...
bsd-3-clause
Python
cf7aed705dbfeaa8b9e56a0649fd70f48d80d33f
bump protocol version number, to see which servers have get_header and get_merkle
protonn/electrum-dgb-server,repos-bitcoin/electrum-server,erasmospunk/electrum-server,cryptapus/electrum-server,mazaclub/electrum-nmc-server,thelazier/electrum-dash-server,Kefkius/encompass-mercury,electrumalt/electrum-ixc-server,electrumalt/electrum-doge-server,vialectrum/vialectrum-server,lbryio/lbryum-server,nmarley...
version.py
version.py
VERSION = "0.2"
VERSION = "0.1"
mit
Python
0e6e66b4e4ea13e28f089e363d8f1409623566b6
Implement set() method.
RedMoonStudios/hetzner
hetzner/rdns.py
hetzner/rdns.py
from urllib import urlencode from hetzner import RobotError class ReverseDNS(object): def __init__(self, conn, ip=None, result=None): self.conn = conn self.ip = ip self.update_info(result) def update_info(self, result=None): if result is None: try: ...
from urllib import urlencode from hetzner import RobotError class ReverseDNS(object): def __init__(self, conn, ip=None, result=None): self.conn = conn self.ip = ip self.update_info(result) def update_info(self, result=None): if result is None: try: ...
bsd-3-clause
Python
f3fd5fb2fefa0cdf421c4a76154300c7395444f4
bump version
Stvad/anki,jakesyl/ruby-card,Arthaey/anki,xuewenfei/anki,socialpercon/anki-1,go38/anki,kenjhim/anki,ospalh/libanki3,hssm/anki,holycrepe/anki,jakesyl/ruby-card,eduOS/anki,abeyer/anki,hssm/anki,LucasCabello/anki,florianjacob/anki,sunclx/anki,subfusc/anki,jkitching/anki
anki/__init__.py
anki/__init__.py
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import sys import os import platform if sys.version_info[0] > 2: raise Exception("Anki should be run with Python 2") elif sys.version_info[1] < 6: raise Exception("...
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import sys import os import platform if sys.version_info[0] > 2: raise Exception("Anki should be run with Python 2") elif sys.version_info[1] < 6: raise Exception("...
agpl-3.0
Python
9dc22371a6b79a455a137d313ca8643ac59afec2
Update announcements.py
Boijangle/GroupMe-Message-Bot
announcements.py
announcements.py
import sys import icalendar import requests import pytz from datetime import datetime, timedelta from libs import post_text from icalendar import Calendar from database import find_bot_nname import re r = requests.get(sys.argv[2]) icsData = r.text cal = Calendar.from_ical(icsData) for evt in cal.walk('vevent'): ...
import sys import icalendar import requests import pytz from datetime import datetime, timedelta from libs import post_text from icalendar import Calendar from database import find_bot_nname import re r = requests.get(sys.argv[2]) icsData = r.text cal = Calendar.from_ical(icsData) for evt in cal.walk('vevent'): ...
mit
Python
b832c794ad28d3dd9675a72389fc8f0a00a2c035
Fix yapf
adamtheturtle/vws-python,adamtheturtle/vws-python
tests/mock_vws/test_target_summary.py
tests/mock_vws/test_target_summary.py
""" Tests for the mock of the target summary endpoint. """ import pytest from urllib.parse import urljoin import requests from requests_mock import GET from tests.utils import VuforiaServerCredentials from vws._request_utils import authorization_header, rfc_1123_date @pytest.mark.usefixtures('verify_mock_vuforia')...
""" Tests for the mock of the target summary endpoint. """ import pytest from urllib.parse import urljoin import requests from requests_mock import GET from tests.utils import VuforiaServerCredentials from vws._request_utils import authorization_header, rfc_1123_date @pytest.mark.usefixtures('verify_mock_vuforia')...
mit
Python
98540ab8e936ccf605d66dac66aa731a9ee83b42
remove trailing line flake8
marcelometal/pyvows,heynemann/pyvows
tests/no_subcontext_extension_vows.py
tests/no_subcontext_extension_vows.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pyvows testing engine # https://github.com/heynemann/pyvows # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com from pyvows import Vows, expect @Vows.batch class ContextClass(V...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pyvows testing engine # https://github.com/heynemann/pyvows # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com from pyvows import Vows, expect @Vows.batch class ContextClass(V...
mit
Python
81dfd09b8ad7a3e070227040e3fa6714578e8773
Add parameter documentation to forking module
VEVO/hidi
hidi/forking.py
hidi/forking.py
from hidi.transform import Transform from functools import partial from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor def map_fn(pipeline, io, progress, **kwargs): return pipeline.run(io, progress=progress, **kwargs) class ExecutorFork(Transform): def __init__(self, pipelines, progress=F...
from hidi.transform import Transform from functools import partial from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor def map_fn(pipeline, io, progress, **kwargs): return pipeline.run(io, progress=progress, **kwargs) class ExecutorFork(Transform): def __init__(self, pipelines, progress=F...
apache-2.0
Python
5045181241e9a6e4a2cd05a93da7ee0b63b4a568
Allow the foreground reindex process to be interrupted.
kostko/itsy
itsy/management/commands/itsy_reindex.py
itsy/management/commands/itsy_reindex.py
import optparse import traceback from django.core.management import base as management_base from django.utils import importlib from ... import document as itsy_document from ... import tasks as itsy_tasks class Command(management_base.BaseCommand): args = "class_path" help = "Performs a reindex of the given docu...
import optparse import traceback from django.core.management import base as management_base from django.utils import importlib from ... import document as itsy_document from ... import tasks as itsy_tasks class Command(management_base.BaseCommand): args = "class_path" help = "Performs a reindex of the given docu...
bsd-3-clause
Python
181ffad1eaebc14532d9a3172df1805f7bc066d7
Fix crash with Printer.warning
nuagenetworks/monolithe,little-dude/monolithe,little-dude/monolithe,nuagenetworks/monolithe,little-dude/monolithe,nuagenetworks/monolithe
monolithe/generators/vspk/vspkgenerator.py
monolithe/generators/vspk/vspkgenerator.py
# -*- coding: utf-8 -*- import os import shutil from monolithe.lib.utils.vsdk import VSDKUtils from monolithe.lib.utils.printer import Printer class VSPKGenerator(object): """ Create a VSPK Package containing SDK versions """ def __init__(self, versions): """ Initialize a VSPKGenerator ...
# -*- coding: utf-8 -*- import os import shutil from monolithe.lib.utils.vsdk import VSDKUtils from monolithe.lib.utils.printer import Printer class VSPKGenerator(object): """ Create a VSPK Package containing SDK versions """ def __init__(self, versions): """ Initialize a VSPKGenerator ...
bsd-3-clause
Python
06640caec2aea61a17eab32e6806ec40e55e70cb
Bump version to 0.16.2
incuna/incuna-feincms,incuna/incuna-feincms,incuna/incuna-feincms
incunafein/__init__.py
incunafein/__init__.py
__version__ = (0, 16, 2) def get_version(): return '.'.join(map(str, __version__))
__version__ = (0, 16, 1) def get_version(): return '.'.join(map(str, __version__))
bsd-2-clause
Python
3cc4f50162db35de5a9cb17b2abb002f3152abb4
Fix arg parsing tests
ionrock/withenv
tests/test_arg_parsing.py
tests/test_arg_parsing.py
import pytest from withenv import cli class TestArgParsing(object): def setup(self): self.result = { 'cmd': [], 'actions': [] } def test_defaults(self): assert cli.parse_args([]) == self.result def test_mixed_long_with_cmd(self): self.result['acti...
import pytest from withenv.cli import parse_args class TestArgParsing(object): def setup(self): self.result = { 'cmd': [], 'env_files': [], 'env_dirs': [], } def test_defaults(self): assert parse_args([]) == self.result def test_single_short(s...
bsd-3-clause
Python
8d515e0329d9305fe6a1aa1f917c4ba3730e8a88
use safe_eval instead of eval
acsone/stock-logistics-warehouse,kmee/stock-logistics-warehouse,open-synergy/stock-logistics-warehouse
stock_available/models/product_product.py
stock_available/models/product_product.py
# -*- coding: utf-8 -*- # © 2014 Numérigraphe SARL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api from openerp.addons import decimal_precision as dp from openerp.tools.safe_eval import safe_eval class ProductProduct(models.Model): """Add a field for t...
# -*- coding: utf-8 -*- # © 2014 Numérigraphe SARL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api from openerp.addons import decimal_precision as dp class ProductProduct(models.Model): """Add a field for the stock available to promise. Useful impl...
agpl-3.0
Python
466a29cb543c097c3976f096b1b0b349fc1bd645
Remove exception handling in main
salvor7/MarkovChainBibleBot
ReligiousPhraseMC/holy_twitter.py
ReligiousPhraseMC/holy_twitter.py
"""Coordinates the twitter api with the markov chain models""" import json from pprint import pprint from tweepy import Stream, OAuthHandler, API from tweepy.streaming import StreamListener from holy_markov import OldTestaPassagesMarkov from twitter_secrets import api_tokens as at class HolyListener(StreamListener)...
"""Coordinates the twitter api with the markov chain models""" import json from pprint import pprint from tweepy import Stream, OAuthHandler, API from tweepy.streaming import StreamListener from holy_markov import OldTestaPassagesMarkov from twitter_secrets import api_tokens as at class HolyListener(StreamListener)...
mit
Python
fde3d8d078d7ca45bd7db50b5c89c8f5f923d786
Rewrite harmonic_centrality to better use iterator
tmilicic/networkx,Sixshaman/networkx,andnovar/networkx,OrkoHunter/networkx,goulu/networkx,michaelpacer/networkx,JamesClough/networkx,cmtm/networkx,jfinkels/networkx,NvanAdrichem/networkx,SanketDG/networkx
networkx/algorithms/centrality/harmonic.py
networkx/algorithms/centrality/harmonic.py
""" Harmonic centrality measure. """ # Copyright (C) 2015 by # Alessandro Luongo # BSD license. from __future__ import division import functools import networkx as nx __author__ = "\n".join(['Alessandro Luongo (alessandro.luongo@studenti.unimi.it']) __all__ = ['harmonic_centrality'] def harmonic_centrality(...
""" Harmonic centrality measure. """ # Copyright (C) 2015 by # Alessandro Luongo # BSD license. from __future__ import division import functools import networkx as nx __author__ = "\n".join(['Alessandro Luongo (alessandro.luongo@studenti.unimi.it']) __all__ = ['harmonic_centrality'] def harmonic_centrality(...
bsd-3-clause
Python
c18884b10f345a8a094a3c4bf589888027d43bd5
Remove url inlude for Django 2.0
gunthercox/ChatterBot,vkosuri/ChatterBot
examples/django_app/example_app/urls.py
examples/django_app/example_app/urls.py
from django.conf.urls import url from django.contrib import admin from example_app.views import ChatterBotAppView, ChatterBotApiView urlpatterns = [ url(r'^$', ChatterBotAppView.as_view(), name='main'), url(r'^admin/', admin.site.urls, name='admin'), url(r'^api/chatterbot/', ChatterBotApiView.as_view(), n...
from django.conf.urls import include, url from django.contrib import admin from example_app.views import ChatterBotAppView, ChatterBotApiView urlpatterns = [ url(r'^$', ChatterBotAppView.as_view(), name='main'), url(r'^admin/', include(admin.site.urls), name='admin'), url(r'^api/chatterbot/', ChatterBotAp...
bsd-3-clause
Python
68f24127a3f2ff31176301b624352ecffcd4fa15
Add created and updated fields when a post is created, also extends update from basemodel
oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog
app/models/post.py
app/models/post.py
from datetime import datetime from flask_user import current_user from .base import BaseModel class Post(BaseModel): def __init__(self, **kwargs): # Add a comment list field self.created = self.updated = datetime.now() self.comment_list = [] super().__init__(**kwargs) def add...
from .base import BaseModel from flask_user import current_user class Post(BaseModel): def __init__(self, **kwargs): # Add a comment list field self.comment_list = [] super().__init__(**kwargs) def add_comment(self, comment_id): """ Append a comment id to a comment_list field...
mit
Python
d7e02bf6a36a19dad268deae94757a21447b8220
remove the executable bit and the hashbang in the python script
OpenFAST/r-test,OpenFAST/r-test
runCertTestsLocally.py
runCertTestsLocally.py
""" This script runs all of the CertTest cases to create a local 'gold standard' set of solutions. """ import os import sys import shutil import subprocess # if the local output directory already exists, bail for two reasons # 1. don't silenty overwrite previous outputs # 2. the python filesystem methods aren...
#!/usr/bin/python """ This script runs all of the CertTest cases to create a local 'gold standard' set of solutions. """ import os import sys import shutil import subprocess # if the local output directory already exists, bail for two reasons # 1. don't silenty overwrite previous outputs # 2. the python files...
apache-2.0
Python
780a7a3880bcfc1b54da5b06273ffc8a05abd94c
Replace `ExampleSerializer` by `features.serialize_example`
google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,...
tf3d/datasets/utils/example_parser.py
tf3d/datasets/utils/example_parser.py
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
Python
607cc13eb791f763c4d34256568ef5f45177ca3b
Revise typo for fibonacci_memo() and use generator
bowen0701/algorithms_data_structures
alg_fibonacci.py
alg_fibonacci.py
"""Fibonacci series: 0, 1, 1, 2, 3, 5, 8,... - Fib(0) = 0 - Fib(1) = 1 - Fib(n) = Fib(n - 1) + Fib(n - 2) """ from __future__ import absolute_import from __future__ import print_function from __future__ import division def fibonacci_recur(n): """Get the nth number of Fibonacci series, Fn, by recursion. - ...
"""Fibonacci series: 0, 1, 1, 2, 3, 5, 8,... - Fib(0) = 0 - Fib(1) = 1 - Fib(n) = Fib(n - 1) + Fib(n - 2) """ from __future__ import absolute_import from __future__ import print_function from __future__ import division def fibonacci_recur(n): """Get the nth number of Fibonacci series, Fn, by recursion. - ...
bsd-2-clause
Python
369d0e1a0040f7f4331cb7607dbaaaa8ab9d6f96
Fix response with 504 code when SF is off-line
ZachMassia/platformio,bkudria/platformio,jrobeson/platformio,jrobeson/platformio,mseroczynski/platformio,dkuku/platformio,eiginn/platformio,platformio/platformio-core,atyenoria/platformio,mplewis/platformio,jrobeson/platformio,platformio/platformio-core,jrobeson/platformio,valeros/platformio,bkudria/platformio,platform...
tests/test_pkgmanifest.py
tests/test_pkgmanifest.py
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. import pytest import requests from os.path import basename from platformio.util import get_api_result @pytest.fixture(scope="session") def sfpkglist(): result = None r = None try: r = requests.get("http://sourceforge.net/...
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. import pytest import requests from os.path import basename from platformio.util import get_api_result @pytest.fixture(scope="session") def sfpkglist(): result = None r = None try: r = requests.get("http://sourceforge.net/...
apache-2.0
Python
06ed4fe212b0b35056c931aab0b084d2276ee79f
Use allOnlyFields instead of roundabout way, to remain atomic
kata198/indexedredis,kata198/indexedredis
IndexedRedis/compat_convert.py
IndexedRedis/compat_convert.py
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # Some conversion functions import copy # vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : def compat_convertPickleFields(mdlClass): ''' compat_convertPickleFields - Convert pickle fields on given model from ...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # Some conversion functions import copy # vim:set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : # TODO: Add a "filterFetchOnlyFields" helper method def compat_convertPickleFields(mdlClass): ''' compat_convertPick...
lgpl-2.1
Python
c709cba9f84fa15b50819b5e77ab7cc66db8d647
simplify output
buganini/bsdconv,buganini/bsdconv,buganini/bsdconv,buganini/bsdconv
tools/findAinB.py
tools/findAinB.py
import sys import re sep = re.compile(r"\s+") stp = re.compile(r"^0[xX]") fa = open(sys.argv[1]) fb = open(sys.argv[2]) la = {} lb = {} for f,l in ((fa, la), (fb, lb)): for ln in f: ln = ln.strip().upper() if ln == "": continue if ln.startswith("#"): continue a = sep.split(ln) p = stp.sub("", a[0])...
import sys import re sep = re.compile(r"\s+") stp = re.compile(r"^0[xX]") fa = open(sys.argv[1]) fb = open(sys.argv[2]) la = {} lb = {} for f,l in ((fa, la), (fb, lb)): for ln in f: ln = ln.strip().upper() if ln == "": continue if ln.startswith("#"): continue a = sep.split(ln) p = stp.sub("", a[0])...
bsd-2-clause
Python
78659ab199fef51cf8dbe15cbc2e7ed08b78eba9
Add video search
moscowpython/moscowpython,moscowpython/moscowpython,VladimirFilonov/moscowdjango,VladimirFilonov/moscowdjango,moscowpython/moscowpython,moscowdjango/moscowdjango,moscowdjango/moscowdjango,VladimirFilonov/moscowdjango,moscowdjango/moscowdjango
apps/meetup/admin.py
apps/meetup/admin.py
# coding: utf-8 from django.contrib import admin from .forms import EventAdminForm from .models import Photo, Venue, MediaCoverage, Talk, Sponsor, Speaker, \ Event, Tutorial, Vote def oembed_presentation(obj): return bool(obj.presentation_data) oembed_presentation.short_description = u'Слайды' oembed_presenta...
# coding: utf-8 from django.contrib import admin from .forms import EventAdminForm from .models import Photo, Venue, MediaCoverage, Talk, Sponsor, Speaker, \ Event, Tutorial, Vote def oembed_presentation(obj): return bool(obj.presentation_data) oembed_presentation.short_description = u'Слайды' oembed_presenta...
bsd-3-clause
Python
2a646f248e3a9e3d6ca1ffe1c9594af3b597dcb1
Add edge cases for undo-push
zhangela/git-undo
wrapper.py
wrapper.py
import subprocess import os import sys import sqlite3 import hashlib import time prompt = '> ' # strip new line repo_path = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).strip() # folder to store all settings and backups common_path = os.path.expanduser("~/Library/Application Support/git-undo/") ...
import subprocess import os import sys import sqlite3 import hashlib import time prompt = '> ' # strip new line repo_path = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).strip() # folder to store all settings and backups common_path = os.path.expanduser("~/Library/Application Support/git-undo/") ...
mit
Python
7df8fc65fe7130a27aa85d9f88c32d0d50e93aff
Fix the mobilenet_ssd_quant_test expected result
iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples,iree-org/iree-samples
tflitehub/mobilenet_ssd_quant_test.py
tflitehub/mobilenet_ssd_quant_test.py
# RUN: %PYTHON %s import absl.testing import numpy import os import test_util import urllib.request from PIL import Image # Model from https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess.tflite # but trimmed the final TFLite_PostProcess op. model_path = "https://storage.googl...
# RUN: %PYTHON %s # XFAIL: * import absl.testing import numpy import os import test_util import urllib.request from PIL import Image # Model from https://github.com/google-coral/test_data/raw/master/ssd_mobilenet_v2_face_quant_postprocess.tflite # but trimmed the final TFLite_PostProcess op. model_path = "https://st...
apache-2.0
Python
e7f63f1efd482eb42d8941a6748ed217c69b4c3c
Add polls.models.Poll and polls.models.Choice
datphan/teracy-tutorial,teracyhq/django-tutorial
apps/polls/models.py
apps/polls/models.py
from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice_text = models.CharField(max_length=200) votes = models.IntegerField(default=0)
from django.db import models # Create your models here.
bsd-3-clause
Python
8a750370c70c53822da4420caf3d3090544ff7d0
Fix static analysis issue
lpenz/anac-civ-csv-upload
anac/__init__.py
anac/__init__.py
# encoding: utf-8 '''Interface com a ANAC''' import logging import re from netrc import netrc from mechanize import Browser def _log(): if not _log.logger: _log.logger = logging.getLogger() return _log.logger _log.logger = None class Anac(object): def __init__(self, dryrun): self.dry...
# encoding: utf-8 '''Interface com a ANAC''' import logging import re from netrc import netrc from mechanize import Browser def _log(): if not _log.logger: _log.logger = logging.getLogger() return _log.logger _log.logger = None class Anac(object): def __init__(self, dryrun): self.dryru...
apache-2.0
Python
3243f199fb46d2d6f95ae9afd18b1570f9b5f529
Fix up bad last commit
SingingTree/AStatsScraper,SingingTree/AStatsScraper
astatsscraper/parsing.py
astatsscraper/parsing.py
def parse_app_page(response): # Should always be able to grab a title title = response.xpath('//div[@class = "panel panel-default panel-gameinfo"]/div[@class = "panel-heading"]/text()').extract()[0].strip() # Parse times into floats time_to_hundo = response.xpath('//table[@class = "Default1000"]/tr/td[s...
def parse_app_page(response): # Should always be able to grab a title title = response.xpath('//div[@class = "panel panel-default panel-gameinfo"]/div[@class = "panel-heading"]/text()').extract()[0].strip() # Parse times into floats time_to_hundo = response.xpath('//table[@class = "Default1000"]/tr/td[s...
mit
Python
6b9e636f24ca12a33b9e9a761e6c26ec1b36dec8
update label in form
liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin
meinberlin/apps/maptopicprio/forms.py
meinberlin/apps/maptopicprio/forms.py
from ckeditor_uploader import fields from django import forms from django.utils.translation import ugettext_lazy as _ from adhocracy4.categories.forms import CategorizableFieldMixin from adhocracy4.labels.mixins import LabelsAddableFieldMixin from adhocracy4.maps import widgets as maps_widgets from . import models ...
from ckeditor_uploader import fields from django import forms from django.utils.translation import ugettext_lazy as _ from adhocracy4.categories.forms import CategorizableFieldMixin from adhocracy4.labels.mixins import LabelsAddableFieldMixin from adhocracy4.maps import widgets as maps_widgets from . import models ...
agpl-3.0
Python
ddbefe2684cfc375e47c2ef1763bb1214a822f02
Add import of RetentionContestOption
opencivicdata/python-opencivicdata,opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata-django,opencivicdata/python-opencivicdata
opencivicdata/elections/models/__init__.py
opencivicdata/elections/models/__init__.py
# flake8: NOQA from .election import Election, ElectionIdentifier, ElectionSource from .candidacy import Candidacy, CandidacySource from .contests.base import ContestBase from .contests.ballot_measure import (BallotMeasureContest, BallotMeasureContestOption, BallotMeasureContestIde...
# flake8: NOQA from .election import Election, ElectionIdentifier, ElectionSource from .candidacy import Candidacy, CandidacySource from .contests.base import ContestBase from .contests.ballot_measure import (BallotMeasureContest, BallotMeasureContestOption, BallotMeasureContestIde...
bsd-3-clause
Python
9c7231be8440b575ff0758ea4f1cb0d7c1fe7f96
disable fixture tests on CI due to wonky GDAL version on travis. 'pyb -v django_test' will still execute these.
hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub
src/main/python/hub/tests/tests_fixtures.py
src/main/python/hub/tests/tests_fixtures.py
# -*- coding: utf-8 -*- ''' This test tries to format all fixtures with all available formats. ''' from __future__ import unicode_literals from rest_framework.test import APITestCase import os class FixtureTest(APITestCase): pass EXCLUDED_DOCUMENTS = [ 'Dummy', # those are for paging tests and just repe...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework.test import APITestCase ''' This test tries to format all fixtures with all available formats. ''' class FixtureTest(APITestCase): pass EXCLUDED_DOCUMENTS = [ 'Dummy', # those are for paging tests and just repeat 'emp...
mit
Python
b3a0ef94e4d892ff1cd11e2caa138f4388732aed
Add architecture to RuntimeSerializer
Turupawn/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website,lutris/website,lutris/website,Turupawn/website
runners/serializers.py
runners/serializers.py
# pylint: disable=R0903 from rest_framework import serializers from .models import Runner, RunnerVersion, Runtime class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'architecture', 'url', 'default') class RunnerSerializer(se...
# pylint: disable=R0903 from rest_framework import serializers from .models import Runner, RunnerVersion, Runtime class RunnerVersionSerializer(serializers.ModelSerializer): class Meta(object): model = RunnerVersion fields = ('version', 'architecture', 'url', 'default') class RunnerSerializer(se...
agpl-3.0
Python
c5fcd5e333491ffd5a1c802cc6332c8214b02021
Fix datetime/timezone issue
hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website
authentication/models.py
authentication/models.py
import uuid from datetime import timedelta from django.utils import timezone from django.contrib.auth.admin import User from django.db import models # Time the activation is valid in hours VALID_TIME = 2 class UserAuthentication(models.Model): user = models.ForeignKey(User) key = models.UUIDField(default=uui...
import uuid from datetime import datetime, timedelta from django.contrib.auth.admin import User from django.db import models # Time the activation is valid in hours VALID_TIME = 2 class UserAuthentication(models.Model): user = models.ForeignKey(User) key = models.UUIDField(default=uuid.uuid4, editable=False...
mit
Python
c24adb58c9a64fdaf2c0ad598b9431636dba31de
fix ConfigParser import
funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor
lib/config_parser.py
lib/config_parser.py
from ConfigParser import ConfigParser defaults = {'parse': 'defaultparse', 'clean': True, 'consolidate': True, 'datadir': '/data/patentdata/patents/2013', 'dataregex': 'ipg\d{6}.xml', 'years': None, 'downloaddir' : None} def extract_process_optio...
import ConfigParser defaults = {'parse': 'defaultparse', 'clean': True, 'consolidate': True, 'datadir': '/data/patentdata/patents/2013', 'dataregex': 'ipg\d{6}.xml', 'years': None, 'downloaddir' : None} def extract_process_options(handler): "...
bsd-2-clause
Python
3c0c9778252510ac9c4088f20d4bc0dd5ea1f63c
Update point.py
aelbouchti/Implot
implib/point.py
implib/point.py
from math import sqrt class point(): #declaration point xyz 3D def __init__(self, *args): self.X= 0 self.Y= 0 self.Z= 0 self.L= [] self.dim= 0 for i, j in enumerate(args): self.L.append(j) self.dim= i+1 while self.dim<...
from math import sqrt class point(): #declaration point xyz 3D def __init__(self, *args): self.X=0 self.Y=0 self.Z=0 self.L=[] self.dim=0 for i, j in enumerate(args): self.L.append(j) self.dim=i+1 while self.dim<3: ...
mit
Python
37ab91ad50bb8f473012d8bf678445707c2da7b1
Delete print
maferelo/saleor,UITools/saleor,UITools/saleor,mociepka/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,mociepka/saleor,UITools/saleor,mociepka/saleor
saleor/core/filters.py
saleor/core/filters.py
from __future__ import unicode_literals from django_filters import FilterSet class SortedFilterSet(FilterSet): ''' Base class for filtersets used in dashboard views. Adds flag is_bound_unsorted to indicate if FilterSet has data from filters other than sort_by. ''' def __init__(self, data, *arg...
from __future__ import unicode_literals from django_filters import FilterSet class SortedFilterSet(FilterSet): ''' Base class for filtersets used in dashboard views. Adds flag is_bound_unsorted to indicate if FilterSet has data from filters other than sort_by. ''' def __init__(self, data, *arg...
bsd-3-clause
Python
cd41fdbdb53008c9701213d4f223bb8df0514ecb
Remove unused custom functions `local_tz_to_utc`, `utc_to_local_tz`
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
byceps/util/datetime/timezone.py
byceps/util/datetime/timezone.py
""" byceps.util.datetime.timezone ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Timezone helpers :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from flask import current_app def get_timezone_string() -> str: """Return the configured default timezone as a string.""" re...
""" byceps.util.datetime.timezone ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Timezone helpers :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import datetime from flask import current_app import pendulum def local_tz_to_utc(dt: datetime): """Convert date...
bsd-3-clause
Python
90015e2477131c7169ac0742b266b67f3f2ac78c
fix title canonicalization
karissa/papertalk,karissa/papertalk,karissa/papertalk
papertalk/utils/utils.py
papertalk/utils/utils.py
import urllib, urllib2 try: import simplejson as json except ImportError: try: import json except ImportError: raise ImportError import datetime from bson.objectid import ObjectId from werkzeug import Response UA = 'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100913 Firefo...
import urllib, urllib2 try: import simplejson as json except ImportError: try: import json except ImportError: raise ImportError import datetime from bson.objectid import ObjectId from werkzeug import Response UA = 'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) Gecko/20100913 Firefo...
mit
Python
5415f0b66b08ef964c1c3e3f94ea37c4a6542dec
update Sevenoaks import script
DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_sevenoaks.py
polling_stations/apps/data_collection/management/commands/import_sevenoaks.py
from data_collection.management.commands import BaseShpStationsShpDistrictsImporter class Command(BaseShpStationsShpDistrictsImporter): srid = 27700 council_id = 'E07000111' districts_name = 'New May 2017/SDC_PollingDistricts_2017' stations_name = 'New May 2017/SDC_CouncilElections2017.shp' electio...
from data_collection.management.commands import BaseShpStationsShpDistrictsImporter class Command(BaseShpStationsShpDistrictsImporter): srid = 27700 council_id = 'E07000111' districts_name = 'May 2017/SDC_PollingDistricts_2017' stations_name = 'May 2017/SDC_CouncilElecPollingStn2017.shp' elections ...
bsd-3-clause
Python
5f5471fd4c8a4b5563c846cfcf271e00c4246160
add loader processor
cappatar/knesset-data-pipelines,cappatar/knesset-data-pipelines
datapackage_pipelines_knesset/members/processors/load_members.py
datapackage_pipelines_knesset/members/processors/load_members.py
from datapackage_pipelines_knesset.common.base_processors.add_resource import AddResourceBaseProcessor # only loads members with the following positionId: SUPPORTED_POSITION_IDS = [43, 61] class Processor(AddResourceBaseProcessor): def _get_schema(self, resource_descriptor): return resource_descriptor.ge...
from datapackage_pipelines_knesset.common.base_processors.add_resource import AddResourceBaseProcessor from sqlalchemy import or_ import os import logging # only loads members with the following positionId: SUPPORTED_POSITION_IDS = [43, 61] class Processor(AddResourceBaseProcessor): def _get_schema(self, resourc...
mit
Python
8b562e43d003f5ced034cb7e27e630dcd33168ad
Update at 2017-07-14 21-45-02
amoshyc/tthl-code
train_timeconv.py
train_timeconv.py
import json from pathlib import Path import numpy as np import pandas as pd import tensorflow as tf from keras.backend.tensorflow_backend import set_session config = tf.ConfigProto() config.gpu_options.allow_growth = True set_session(tf.Session(config=config)) from keras.models import Sequential, Model from keras.pr...
import json from pathlib import Path import numpy as np import pandas as pd import tensorflow as tf from keras.backend.tensorflow_backend import set_session config = tf.ConfigProto() config.gpu_options.allow_growth = True set_session(tf.Session(config=config)) from keras.models import Sequential, Model from keras.pr...
apache-2.0
Python
d5ea69a6b065be5fbba3f4b990373d537318d00c
bump version
slash-testing/backslash-python,vmalloc/backslash-python
backslash/__version__.py
backslash/__version__.py
__version__ = "2.19.2"
__version__ = "2.19.1"
bsd-3-clause
Python
0fb3f5840532200ce21042f47d770e0d2ceb068b
fix up comments in staging settings file
texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84
txlege84/txlege84/settings/staging.py
txlege84/txlege84/settings/staging.py
#################### # STAGING SETTINGS # #################### import dj_database_url from .base import * LOGGING = { 'version': 1, 'handlers': { 'console':{ 'level':'DEBUG', 'class':'logging.StreamHandler', }, }, 'loggers': { 'django.request': { ...
####################### # PRODUCTION SETTINGS # ####################### import dj_database_url from .base import * LOGGING = { 'version': 1, 'handlers': { 'console':{ 'level':'DEBUG', 'class':'logging.StreamHandler', }, }, 'loggers': { 'django.request':...
mit
Python
d5ab2226cab8d695854961774835cea25576e39c
remove redirect
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
bulbs/videos/views.py
bulbs/videos/views.py
from django.conf import settings from django.http import Http404 from django.views.generic import DetailView from django.views.decorators.cache import cache_control import requests class SeriesDetailView(DetailView): def get_template_names(self): template_names = ["videos/series-detail.html"] re...
from django.conf import settings from django.http import Http404 from django.views.generic import DetailView from django.views.decorators.cache import cache_control import requests class SeriesDetailView(DetailView): redirect_correct_path = False def get_template_names(self): template_names = ["vide...
mit
Python
1af389a1e92b531d1a78db51b45169536c48ef25
bump to 0.8.16.
tsuru/tsuru-circus
tsuru/__init__.py
tsuru/__init__.py
# Copyright 2015 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.8.16"
# Copyright 2015 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.8.15"
bsd-3-clause
Python
61fdbe0dba79dc19cda5320a0ad1352facf12d3d
Rework imports and ignore known mypy issues
pypa/twine
twine/__init__.py
twine/__init__.py
# Copyright 2018 Donald Stufft and individual contributors # # 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 la...
# Copyright 2018 Donald Stufft and individual contributors # # 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 la...
apache-2.0
Python
7fbbaf258d6c77b72b76d3a324ed7ea06d8f923e
Rename post data variable to be more inline with requests default
incuna/django-txtlocal
txtlocal/utils.py
txtlocal/utils.py
import requests from django.conf import settings from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.http import urlencode def send_sms(text, recipient_list, sender=None, username=None, password=None, **kwargs): """ Render and send a...
import requests from django.conf import settings from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.http import urlencode def send_sms(text, recipient_list, sender=None, username=None, password=None, **kwargs): """ Render and send a...
bsd-2-clause
Python
a13244776b9017e8a339a94e0fe06d32fa61596d
Hide output from some tests
pfmoore/invoke,mkusz/invoke,pfmoore/invoke,pyinvoke/invoke,mkusz/invoke,pyinvoke/invoke
integration/runners.py
integration/runners.py
import os from spec import Spec from invoke import run from _util import assert_cpu_usage class Runner_(Spec): def setup(self): os.chdir(os.path.join(os.path.dirname(__file__), '_support')) class responding: # TODO: update respond_*.py so they timeout instead of hanging forever # w...
import os from spec import Spec from invoke import run from _util import assert_cpu_usage class Runner_(Spec): def setup(self): os.chdir(os.path.join(os.path.dirname(__file__), '_support')) class responding: # TODO: update respond_*.py so they timeout instead of hanging forever # w...
bsd-2-clause
Python
b8d3002eb7bdad0ba0fef2820bb887b126c2d15f
Create socket if not created by the Node
dushyant88/lymph,alazaro/lymph,lyudmildrx/lymph,mouadino/lymph,deliveryhero/lymph,emulbreh/lymph,mouadino/lymph,itakouna/lymph,torte/lymph,emulbreh/lymph,alazaro/lymph,alazaro/lymph,mamachanko/lymph,itakouna/lymph,itakouna/lymph,mouadino/lymph,mamachanko/lymph,mamachanko/lymph,lyudmildrx/lymph,kstrempel/lymph,Drahflow/...
iris/web/interfaces.py
iris/web/interfaces.py
from gevent.pywsgi import WSGIServer from werkzeug.wrappers import Request from werkzeug.exceptions import HTTPException from iris.core.interfaces import Interface from iris.core import trace from iris.utils.sockets import create_socket class WebServiceInterface(Interface): http_port = 80 def __init__(self,...
from gevent.pywsgi import WSGIServer from werkzeug.wrappers import Request from werkzeug.exceptions import HTTPException from iris.core.interfaces import Interface from iris.core import trace from iris.utils.sockets import create_socket class WebServiceInterface(Interface): http_port = 80 def __init__(self,...
apache-2.0
Python
ec9588025890d86747667c00aaae6b58a548997c
Bump version
simplefin/siloscript,simplefin/siloscript,simplefin/siloscript
siloscript/version.py
siloscript/version.py
# Copyright (c) The SimpleFIN Team # See LICENSE for details. __version__ = "0.2.1"
# Copyright (c) The SimpleFIN Team # See LICENSE for details. __version__ = "0.1.0-dev"
apache-2.0
Python
b1ade8f0705a692cf09aaefe05fcb5469f08170b
Add parenthesis for python3 support
pdedumast/ShapeVariationAnalyzer,DCBIA-OrthoLab/ShapeVariationAnalyzer,DCBIA-OrthoLab/ShapeVariationAnalyzer,DCBIA-OrthoLab/ShapeVariationAnalyzer,pdedumast/ShapeVariationAnalyzer
src/py/generatelib/add_heatkernel_vtk.py
src/py/generatelib/add_heatkernel_vtk.py
import argparse import inputData import glob import os import vtk import scipy.io as sio import numpy as np from vtk.util import numpy_support parser = argparse.ArgumentParser(description='Shape Variation Analyzer') parser.add_argument('--dataPath', action='store', dest='dirwithSub', help='folder with subclasses', re...
import argparse import inputData import glob import os import vtk import scipy.io as sio import numpy as np from vtk.util import numpy_support parser = argparse.ArgumentParser(description='Shape Variation Analyzer') parser.add_argument('--dataPath', action='store', dest='dirwithSub', help='folder with subclasses', re...
apache-2.0
Python
7c430d4679ce1cc51f7566bc6479fee8aa7427d6
Use platform_group in Android device metric (#2515)
google/clusterfuzz,google/clusterfuzz,google/clusterfuzz,google/clusterfuzz,google/clusterfuzz,google/clusterfuzz,google/clusterfuzz,google/clusterfuzz
src/python/bot/startup/android_heartbeat.py
src/python/bot/startup/android_heartbeat.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
dc20ec37ff2cd19b96d0023d8ada1e11350a7b2f
Remove user_id requirement (#8527)
mvaled/sentry,mvaled/sentry,mvaled/sentry,mvaled/sentry,mvaled/sentry,ifduyue/sentry,looker/sentry,beeftornado/sentry,ifduyue/sentry,beeftornado/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,looker/sentry,ifduyue/sentry,looker/sentry,beeftornado/sentry,ifduyue/sentry,looker/sentry
src/sentry/analytics/events/project_issue_searched.py
src/sentry/analytics/events/project_issue_searched.py
from __future__ import absolute_import, print_function from sentry import analytics class ProjectIssueSearchEvent(analytics.Event): type = 'project_issue.searched' attributes = ( analytics.Attribute('user_id', required=False), analytics.Attribute('organization_id'), analytics.Attribu...
from __future__ import absolute_import, print_function from sentry import analytics class ProjectIssueSearchEvent(analytics.Event): type = 'project_issue.searched' attributes = ( analytics.Attribute('user_id'), analytics.Attribute('organization_id'), analytics.Attribute('project_id')...
bsd-3-clause
Python
0e7d35b5d7ed62e1500741134156dffacf6fee84
Fix doc error.
koenedaele/skosprovider
skosprovider/utils.py
skosprovider/utils.py
# -*- coding: utf-8 -*- ''' This module contains utility functions for dealing with skos providers. ''' from skosprovider.skos import ( Concept, Collection ) def dict_dumper(provider): ''' Dump a provider to a format that can be passed to a :class:`skosprovider.providers.DictionaryProvider`. ...
# -*- coding: utf-8 -*- ''' This module contains utility functions for dealing with skos providers. ''' from skosprovider.skos import ( Concept, Collection ) def dict_dumper(provider): ''' Dump a provider to a format that can be passed to a :class:`skosprovider.providers.FlatDictionaryProvider` o...
mit
Python