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 |
|---|---|---|---|---|---|---|---|---|
139cfb7756aa6c01d547c0a88cac939c6e88e926 | Print where file is saved to. | nmabhi/Webface,Alexx-G/openface,xinfang/face-recognize,nmabhi/Webface,francisleunggie/openface,xinfang/face-recognize,cmusatyalab/openface,nhzandi/openface,francisleunggie/openface,Alexx-G/openface,francisleunggie/openface,Alexx-G/openface,nhzandi/openface,nmabhi/Webface,cmusatyalab/openface,Alexx-G/openface,cmusatyala... | util/tsne.py | util/tsne.py | #!/usr/bin/env python2
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
plt.style.use('bmh')
import os
import sys
import argparse
print("""
Note: This e... | #!/usr/bin/env python2
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
plt.style.use('bmh')
import os
import sys
import argparse
print("""
Note: This e... | apache-2.0 | Python |
e844847323a39f8bfd1870a21071f9f07f110274 | manage password | eregnier/checkme,eregnier/checkme,eregnier/checkme | models/user.py | models/user.py | from peewee import CharField, DateTimeField
from flask_login import UserMixin
from hashlib import sha1
from time import mktime
import datetime
from models.base import BaseModel
class User(BaseModel, UserMixin):
created = DateTimeField(default=datetime.datetime.now)
email = CharField(max_length=50)
passwo... | from peewee import CharField, DateTimeField
from flask_login import UserMixin
from hashlib import sha1
from time import mktime
import datetime
from models.base import BaseModel
class User(BaseModel, UserMixin):
created = DateTimeField(default=datetime.datetime.now)
email = CharField(max_length=50)
passwo... | mit | Python |
31381728cb8d76314c82833d4400b4140fcc573f | Change parameter name so it does not conflict with an url parameter called "name". | akx/django-jinja,glogiotatidis/django-jinja,glogiotatidis/django-jinja,akx/django-jinja,akx/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,akx/django-jinja,niwinz/django-jinja | django_jinja/builtins/global_context.py | django_jinja/builtins/global_context.py | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
l... | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
l... | bsd-3-clause | Python |
6dffa2d22fa5da3b2d8fbcdff04477ff0116bfc1 | Resolve a bug in the write function | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | utilities.py | utilities.py | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for el... | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for el... | apache-2.0 | Python |
55f4507c2285b5927e911a455065dd9c6d60112a | add a Node.__repr__ method | bootc/pypuppetdbquery | pypuppetdbquery/ast.py | pypuppetdbquery/ast.py | # -*- coding: utf-8 -*-
#
# This file is part of pypuppetdbquery.
# Copyright © 2016 Chris Boot <bootc@bootc.net>
#
# 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.or... | # -*- coding: utf-8 -*-
#
# This file is part of pypuppetdbquery.
# Copyright © 2016 Chris Boot <bootc@bootc.net>
#
# 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.or... | apache-2.0 | Python |
4be8aea26f5dbec2c93413f6e545a47e850a7382 | Mark test as xfail due to new connection factory behavior | sim0629/irc | irc/tests/test_client.py | irc/tests/test_client.py | import datetime
import random
import pytest
import mock
import irc.client
def test_version():
assert 'VERSION' in vars(irc.client)
assert isinstance(irc.client.VERSION, tuple)
assert irc.client.VERSION, "No VERSION detected."
def test_delayed_command_order():
"""
delayed commands should be sorted by delay time... | import datetime
import random
import pytest
import mock
import irc.client
def test_version():
assert 'VERSION' in vars(irc.client)
assert isinstance(irc.client.VERSION, tuple)
assert irc.client.VERSION, "No VERSION detected."
def test_delayed_command_order():
"""
delayed commands should be sorted by delay time... | lgpl-2.1 | Python |
0314334373b380c41e72ed41bfef1f7cbc65b894 | Add CAN_DETECT | chriscoyfish/coala-bears,dosarudaniel/coala-bears,coala/coala-bears,yashtrivedi96/coala-bears,meetmangukiya/coala-bears,Asnelchristian/coala-bears,refeed/coala-bears,mr-karan/coala-bears,dosarudaniel/coala-bears,coala/coala-bears,sounak98/coala-bears,dosarudaniel/coala-bears,shreyans800755/coala-bears,sounak98/coala-be... | bears/yml/YAMLLintBear.py | bears/yml/YAMLLintBear.py | from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.PipRequirement import PipRequirement
@linter(executable='yamllint',
output_format="regex",
output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): '
r'\[(?P<severity>error|warning)\] (?P<message>.+)')
cl... | from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.PipRequirement import PipRequirement
@linter(executable='yamllint',
output_format="regex",
output_regex=r'.+:(?P<line>\d+):(?P<column>\d+): '
r'\[(?P<severity>error|warning)\] (?P<message>.+)')
cl... | agpl-3.0 | Python |
0d9b29c80502f8c4f23920ec65bc89093d553e47 | Corrige numero da versao do pacote | mstuttgart/python-sigep,mstuttgart/pysigep | pysigep/__version__.py | pysigep/__version__.py | __title__ = 'pysigep'
__description__ = 'API python para uso dos serviços fornecidos pelo ' \
'SIGEPWeb dos Correios '
__version__ = '0.1.0'
__url__ = 'https://github.com/mstuttgart/pysigep'
__download_url__ = 'https://github.com/mstuttgart/pysigep'
__author__ = 'Michell Stuttgart'
__author_email__ = ... | __title__ = 'pysigep'
__description__ = 'API python para uso dos serviços fornecidos pelo ' \
'SIGEPWeb dos Correios '
__version__ = '0.4.4'
__url__ = 'https://github.com/mstuttgart/pysigep'
__download_url__ = 'https://github.com/mstuttgart/pysigep'
__author__ = 'Michell Stuttgart'
__author_email__ = ... | mit | Python |
2373734b9eda5c887621ee64a2ca755850685699 | test c-model | Oscarlight/PiNN_Caffe2,Oscarlight/PiNN_Caffe2,Oscarlight/PiNN_Caffe2,Oscarlight/PiNN_Caffe2 | transiNXOR_modeling/transixor_predictor.py | transiNXOR_modeling/transixor_predictor.py | import sys
sys.path.append('../')
import numpy as np
from itertools import product
from pinn_api import predict_ids_grads, predict_ids
import matplotlib.pyplot as plt
import glob
## ------------ True data ---------------
ids_file = glob.glob('./transiXOR_data/current_D9.npy')
# ids_file = glob.glob('./transiXOR_data... | import sys
sys.path.append('../')
import numpy as np
from itertools import product
from pinn_api import predict_ids_grads, predict_ids
import matplotlib.pyplot as plt
import glob
## ------------ True data ---------------
ids_file = glob.glob('./transiXOR_data/current_D9.npy')
# ids_file = glob.glob('./transiXOR_data... | mit | Python |
d692ed6c48fc36b296b9a3e952dd1f70b133210c | add migrate script to remove ezid from suggestions | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | portality/migrate/p1p2/suggestionrestructure.py | portality/migrate/p1p2/suggestionrestructure.py | from portality import models, settings
import requests, json
# first thing to do is delete suggestions which are marked "waiting for answer"
q = {
"query" : {
"bool" : {
"must" : [
{"term" : {"admin.application_status.exact" : "waiting for answer"}}
]
}
... | from portality import models, settings
import requests, json
# first thing to do is delete suggestions which are marked "waiting for answer"
q = {
"query" : {
"bool" : {
"must" : [
{"term" : {"admin.application_status.exact" : "waiting for answer"}}
]
}
... | apache-2.0 | Python |
4bc871aaa72fa1d793203e5627a2ac5f859ae27d | add dependencies; still incomplete | Minhmo/tardis,kaushik94/tardis,Minhmo/tardis,Tobychev/tardis,Tobychev/tardis,Tobychev/tardis,wkerzendorf/tardis,kaushik94/tardis,kaushik94/tardis,Minhmo/tardis,orbitfold/tardis,wkerzendorf/tardis,utkbansal/tardis,utkbansal/tardis,orbitfold/tardis,utkbansal/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,wkerz... | tardis/montecarlo/setup_package.py | tardis/montecarlo/setup_package.py | #setting the right include
from setuptools import Extension
import numpy as np
import os
from astropy_helpers.setup_helpers import get_distutils_option
from glob import glob
if get_distutils_option('with_openmp', ['build', 'install', 'develop']) is not None:
compile_args = ['-fopenmp', '-W', '-Wall', '-Wmissing-p... | #setting the right include
from setuptools import Extension
import numpy as np
import os
from astropy_helpers.setup_helpers import get_distutils_option
from glob import glob
if get_distutils_option('with_openmp', ['build', 'install', 'develop']) is not None:
compile_args = ['-fopenmp', '-W', '-Wall', '-Wmissing-p... | bsd-3-clause | Python |
df16f3e9c49ba2fb3cdbfdc62e120c6358eb25f9 | Add 'dump_header' function | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/common/markup/__init__.py | edgedb/lang/common/markup/__init__.py | ##
# Copyright (c) 2011 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
from . import elements, serializer, renderers
from .serializer import serialize
from .serializer import base as _base_serializer
from semantix.exceptions import ExceptionContext as _ExceptionContext
from semantix.utils import ... | ##
# Copyright (c) 2011 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
from . import elements, serializer, renderers
from .serializer import serialize
from .serializer import base as _base_serializer
from semantix.exceptions import ExceptionContext as _ExceptionContext
from semantix.utils import ... | apache-2.0 | Python |
ab6e5754283999ece4e77da959c6f9c868b964a7 | Add Security Manager information | Shosta/Report-Creation-on-Python | variables.py | variables.py | """
Define the variables in a module.
"""
NOT_EVALUATED_PHASE = 'Not Evaluated'
NOT_STARTED_PHASE = 'Not Started'
IN_PROGRESS_PHASE = 'In Progress'
DONE_PHASE = 'Done'
SECURITY_MANAGER_NAME = 'Rémi Lavedrine'
SECURITY_MANAGER_EMAIL = 'remi.lavedrine@orange.com'
SECURITY_MANAGER_PHONE = '06 31 17 80 39'
| """
Define the variables in a module.
"""
NOT_EVALUATED_PHASE = 'Not Evaluated'
NOT_STARTED_PHASE = 'Not Started'
IN_PROGRESS_PHASE = 'In Progress'
DONE_PHASE = 'Done'
| mpl-2.0 | Python |
e44021fff840435fe49aaef1a1531cb2ccf44e43 | Add back to "rebuild_data" command | barberscore/barberscore-api,dbinetti/barberscore-django,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api | project/api/management/commands/rebuild_data.py | project/api/management/commands/rebuild_data.py | # Django
from django.apps import apps
from django.core.management.base import BaseCommand
from django.utils import timezone
import datetime
class Command(BaseCommand):
help = "Command to rebuild denorms."
def add_arguments(self, parser):
parser.add_argument(
'--days',
type=int... | # Django
from django.apps import apps
from django.core.management.base import BaseCommand
from django.utils import timezone
import datetime
class Command(BaseCommand):
help = "Command to rebuild denorms."
def add_arguments(self, parser):
parser.add_argument(
'--days',
type=int... | bsd-2-clause | Python |
48b33bedda0da0ad324f8f7a3ac2fbafa8e6f665 | change issue commit to markdown | ZhangBohan/BotMoment | moment/main.py | moment/main.py | from sanic import Sanic
from sanic.response import json as response_json
import aiohttp
import json
from moment.gitlab_message_dict import get_dingtalk_data
app = Sanic(__name__)
async def post(url, json_data):
headers = {
"Content-Type": "application/json"
}
conn = aiohttp.TCPConnector(verify_ss... | from sanic import Sanic
from sanic.response import json as response_json
import aiohttp
import json
from moment.gitlab_message_dict import get_dingtalk_data
app = Sanic(__name__)
async def post(url, json_data):
headers = {
"Content-Type": "application/json"
}
conn = aiohttp.TCPConnector(verify_ss... | mit | Python |
8ec6b8b6c2f099261f85a3f68b5d6e87cbdb1c25 | set context to none for ws:// | Vaelor/python-mattermost-driver | src/mattermostdriver/websocket.py | src/mattermostdriver/websocket.py | import json
import ssl
import asyncio
import logging
import websockets
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('mattermostdriver.websocket')
class Websocket:
def __init__(self, options, token):
self.options = options
self._token = token
@asyncio.coroutine
def connect(self, event_handl... | import json
import ssl
import asyncio
import logging
import websockets
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('mattermostdriver.websocket')
class Websocket:
def __init__(self, options, token):
self.options = options
self._token = token
@asyncio.coroutine
def connect(self, event_handl... | mit | Python |
238c49d4fb1fe67ffd63ed7b9dc5dce0915ae389 | remove internationalisation of uri. fix issue #2 | ramusus/django-authopenid,ramusus/django-authopenid,psi29a/django-authopenid,ramusus/django-authopenid,psi29a/django-authopenid | django_authopenid/urls.py | django_authopenid/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext as _
urlpatterns = patterns('django_authopenid.views',
# yadis rdf
url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'),
# manage account registration
url(r'^signin/$', 'signin', name='... | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext as _
urlpatterns = patterns('django_authopenid.views',
# yadis rdf
url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'),
# manage account registration
url(r'^%s$' % _('signin/'), 'signi... | apache-2.0 | Python |
fe314468c4a8c02650b3b983a239acd06bfc003f | Improve config file handling on the job. | matz-e/lobster,matz-e/lobster,matz-e/lobster | lobster/cmssw/data/job.py | lobster/cmssw/data/job.py | #!/usr/bin/env python
import base64
import json
import os
import pickle
import shutil
import subprocess
import sys
fragment = """import FWCore.ParameterSet.Config as cms
process.source.fileNames = cms.untracked.vstring({input_files})
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
process.sour... | #!/usr/bin/env python
import base64
import json
import os
import pickle
import subprocess
import sys
def edit_process_source(cmssw_config_file, config_params):
(dataset_files, lumis) = config_params
config = open(cmssw_config_file, 'a')
with open(cmssw_config_file, 'a') as config:
fragment = ('imp... | mit | Python |
abffd85d6038494eea93b277b2d25af816dc2b78 | Enable bidi tests for Firefox 86+ | joshmgrant/selenium,SeleniumHQ/selenium,valfirst/selenium,valfirst/selenium,HtmlUnit/selenium,titusfortner/selenium,titusfortner/selenium,titusfortner/selenium,titusfortner/selenium,joshmgrant/selenium,titusfortner/selenium,HtmlUnit/selenium,valfirst/selenium,joshmgrant/selenium,HtmlUnit/selenium,HtmlUnit/selenium,Html... | py/test/selenium/webdriver/common/bidi_tests.py | py/test/selenium/webdriver/common/bidi_tests.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 | Python |
9722016a0117682fa7d0d5599a8dc2f1a75f7c6a | remove softmax / centroidloss | pyannote/pyannote-audio,pyannote/pyannote-audio,pyannote/pyannote-audio | pyannote/audio/embedding/approaches/__init__.py | pyannote/audio/embedding/approaches/__init__.py | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | mit | Python |
57a1e59f034b0edbabaa76376ba6475d6e4d0297 | Add code to work out the Julian representation of a date. | jwg4/calexicon,jwg4/qual | qual/calendars/main.py | qual/calendars/main.py | from datetime import date, timedelta
from qual.helpers import ordinal, month_string
from date import DateWithCalendar, InvalidDate
from base import Calendar
class ProlepticGregorianCalendar(Calendar):
display_name = "Proleptic Gregorian Calendar"
def date(self, year, month, day):
try:
d =... | from datetime import date, timedelta
from qual.helpers import ordinal, month_string
from date import DateWithCalendar, InvalidDate
from base import Calendar
class ProlepticGregorianCalendar(Calendar):
display_name = "Proleptic Gregorian Calendar"
def date(self, year, month, day):
try:
d =... | apache-2.0 | Python |
82f563d7ed8dc53d00edf361af1f607f9a89b918 | Add the rv32mi tests. | AngelTerrones/Algol,AngelTerrones/Algol | Simulation/core/conftest.py | Simulation/core/conftest.py | #!/usr/bin/env python
# Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | #!/usr/bin/env python
# Copyright (c) 2015 Angel Terrones (<angelterrones@gmail.com>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | mit | Python |
b193f9ccabb1093db8a803f7994adb14a85caf5a | Update __init__.py | KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise | djconnectwise/__init__.py | djconnectwise/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 3, 32, 'final')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
| # -*- coding: utf-8 -*-
VERSION = (0, 3, 31, 'final')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
default_app_config = 'djconnectwise.apps.DjangoConnectwiseConfig'
| mit | Python |
b8e1d2419a1dbe065e1828599e60867bc845f0e3 | Add some docs to nm root package | bastings/neuralmonkey,ufal/neuralmonkey,bastings/neuralmonkey,bastings/neuralmonkey,ufal/neuralmonkey,juliakreutzer/bandit-neuralmonkey,ufal/neuralmonkey,bastings/neuralmonkey,ufal/neuralmonkey,juliakreutzer/bandit-neuralmonkey,juliakreutzer/bandit-neuralmonkey,bastings/neuralmonkey,juliakreutzer/bandit-neuralmonkey,ju... | neuralmonkey/__init__.py | neuralmonkey/__init__.py | """The neuralmonkey package is the root package of this project."""
| bsd-3-clause | Python | |
aa741b5a2b18a7df402325b53476eba36e448b40 | Update to 0.0.49 | KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise,AparatTechnologies/django-connectwise | djconnectwise/__init__.py | djconnectwise/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 0, 49, 'alpha')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
| # -*- coding: utf-8 -*-
VERSION = (0, 0, 48, 'alpha')
# pragma: no cover
if VERSION[-1] != "final":
__version__ = '.'.join(map(str, VERSION))
else:
# pragma: no cover
__version__ = '.'.join(map(str, VERSION[:-1]))
| mit | Python |
95f09bc7d61d6ea0a1228229a5092e2bff889855 | make website_multi_company_demo hidden | it-projects-llc/website-addons,it-projects-llc/website-addons,it-projects-llc/website-addons | website_multi_company_demo/__manifest__.py | website_multi_company_demo/__manifest__.py | # -*- coding: utf-8 -*-
{
"name": """Demo Data for \"Real Multi Website\"""",
"summary": """Provides demo websites""",
"category": "Hidden",
# "live_test_URL": "",
"images": [],
"version": "1.0.0",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "apps@... | # -*- coding: utf-8 -*-
{
"name": """Demo Data for \"Real Multi Website\"""",
"summary": """Provides demo websites""",
"category": "eCommerce",
# "live_test_URL": "",
"images": [],
"version": "1.0.0",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "ap... | mit | Python |
a8333a5c3e9c6b07df2b04782c9e0cc3c4b6e60c | Bump Version | nluedtke/brochat-bot | common.py | common.py | VERSION_YEAR = 2017
VERSION_MONTH = 10
VERSION_DAY = 5
VERSION_REV = 0
whos_in = None
twitter = None
users = {}
twilio_client = None
ARGS = {}
smmry_api_key = None
# Variable hold trumps last tweet id
last_id = 0
trump_chance_roll_rdy = False
# Runtime stats
duels_conducted = 0
items_awarded = 0
trump_tweets_seen = ... | VERSION_YEAR = 2017
VERSION_MONTH = 10
VERSION_DAY = 2
VERSION_REV = 1
whos_in = None
twitter = None
users = {}
twilio_client = None
ARGS = {}
smmry_api_key = None
# Variable hold trumps last tweet id
last_id = 0
trump_chance_roll_rdy = False
# Runtime stats
duels_conducted = 0
items_awarded = 0
trump_tweets_seen = ... | mit | Python |
7047816b5edc7911685219d53970c892728d0220 | add os to config | pcd1193182/hauler-tool,pcd1193182/hauler-tool,pcd1193182/hauler-tool | config.py | config.py | # -*- encoding: utf-8 -*-
import datetime
import os
# -----------------------------------------------------
# Application configurations
# ------------------------------------------------------
DEBUG = True
SECRET_KEY = os.environ['SECRET_KEY']
PORT = os.environ['PORT']
HOST = os.environ['HOST']
# -------------------... | # -*- encoding: utf-8 -*-
import datetime
# -----------------------------------------------------
# Application configurations
# ------------------------------------------------------
DEBUG = True
SECRET_KEY = os.environ['SECRET_KEY']
PORT = os.environ['PORT']
HOST = os.environ['HOST']
# -----------------------------... | mit | Python |
5560a37e222f8bf8aade08c17d1a4edb1b821d8a | Advance version number 0.9.1 | TRUFA-rnaseq/trufa-web,TRUFA-rnaseq/trufa-web,TRUFA-rnaseq/trufa-web,TRUFA-rnaseq/trufa-web | config.py | config.py | PROJECT_NAME = "trufa"
VERSION = "0.9.1"
REMOTEHOST = "genorama@altamira1.ifca.es"
# for testing
REMOTEHOME = "testing"
DATADIR = "testing"
# for stable
#REMOTEHOME = "users"
#DATADIR = "/gpfs/res_projects/cvcv/webserver/users/"
# for testing
PIPE_LAUNCH = "../server_side/pipe_launcher.py"
# for stable
#PIPE_LAUNC... | PROJECT_NAME = "trufa"
VERSION = "0.9.0"
REMOTEHOST = "genorama@altamira1.ifca.es"
# for testing
REMOTEHOME = "testing"
DATADIR = "testing"
# for stable
#REMOTEHOME = "users"
#DATADIR = "/gpfs/res_projects/cvcv/webserver/users/"
# for testing
PIPE_LAUNCH = "../server_side/pipe_launcher.py"
# for stable
#PIPE_LAUNC... | bsd-3-clause | Python |
9a09b6fdcd26fbacfa73574835da1fe27a8760f6 | Add separate config for preview. | LandRegistry/lc-alpha-b2b-processor,LandRegistry/lc-automatic-process | config.py | config.py |
class Config(object):
DEBUG = False
class DevelopmentConfig(Config):
DEBUG = True
RULES_ENGINE_URL = "http://localhost:5005"
BANKRUPTCY_DATABASE_API = "http://localhost:5004"
CASEWORK_DATABASE_API = "http://localhost:5006"
class PreviewConfig(Config):
RULES_ENGINE_URL = "http://localhost:5... |
class Config(object):
DEBUG = False
class DevelopmentConfig(object):
DEBUG = True
RULES_ENGINE_URL = "http://localhost:5005"
BANKRUPTCY_DATABASE_API = "http://localhost:5004"
CASEWORK_DATABASE_API = "http://localhost:5006" | mit | Python |
7f13b29cc918f63c4d1fc24717c0a0b5d2f5f8ad | Fix problem with array values. | jcsharp/DriveIt | filter.py | filter.py | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_ga... | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_ga... | mit | Python |
9378ee0d414321bd557b478ffb6725ee899bc9b0 | simplify code and add comment | CaptainDesAstres/Simple-Blender-Render-Manager | TaskList/FileInfo/FileInfo.py | TaskList/FileInfo/FileInfo.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage blender file info'''
import xml.etree.ElementTree as xmlMod
from TaskList.FileInfo.Scene import *
from usefullFunctions import XML
import os
class FileInfo:
'''class to manage blender file info'''
def __init__(self, xml):
'''initialize blender file ... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage blender file info'''
import xml.etree.ElementTree as xmlMod
from TaskList.FileInfo.Scene import *
from usefullFunctions import XML
import os
class FileInfo:
'''class to manage blender file info'''
def __init__(self, xml):
'''initialize blender file ... | mit | Python |
b0f25b7263a42fbd1e90cf7ebe3dcba50f9cfe42 | use the correct class name | sassoftware/amiconfig,sassoftware/amiconfig | amiconfig/plugins/rmakeserver.py | amiconfig/plugins/rmakeserver.py | #
# Copyright (c) 2008 rPath, Inc.
#
import os
from rmakeplugin import rMakePlugin
class AMIConfigPlugin(rMakePlugin):
name = 'rmakeserver'
def pluginMethod(self):
self._setupProxy()
self._setuprBuilder()
self._setupRepoUrl()
def _setupProxy(self):
proxycfg = '/etc/rmake... | #
# Copyright (c) 2008 rPath, Inc.
#
import os
from rmakeplugin import rMakePlugin
class rMakeServer(rMakePlugin):
name = 'rmakeserver'
def pluginMethod(self):
self._setupProxy()
self._setuprBuilder()
self._setupRepoUrl()
def _setupProxy(self):
proxycfg = '/etc/rmake/ser... | apache-2.0 | Python |
ba31be554d3cc4fd51b7189434071596143b686c | add audio.load.readrecf | NickleDave/hybrid-vocal-classifier | hvc/audio/load.py | hvc/audio/load.py | import numpy as np
def read_cbin(filename):
"""
loads .cbin files output by EvTAF
"""
data = np.fromfile(filename,dtype=">d") # ">d" means big endian, double
return data
def readrecf(filename):
"""
reads .rec files output by EvTAF
"""
rec_dict = {}
with open(filename,'r') as ... | import numpy as np
def read_cbin(filename):
"""
loads .cbin files output by EvTAF
"""
data = np.fromfile(filename,dtype=">d") # ">d" means big endian, double
return data
def readrecf(filename):
"""
reads .rec files output by EvTAF
"""
| bsd-3-clause | Python |
4b46c07b795e3e16c16a8897ac42a0755e88c213 | Use trial logging. | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | analysis/sanity-count-markers.py | analysis/sanity-count-markers.py | #!/usr/bin/env python
import climate
import collections
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
logging = climate.get_logger('count')
def count(trial):
trial.load()
trial.mask_dropouts()
total = len(trial.df)
markers = {m: trial.df[m + '-c'].count() / total for m in trial.m... | #!/usr/bin/env python
import climate
import collections
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
logging = climate.get_logger('count')
def count(trial):
trial.load()
trial.mask_dropouts()
total = len(trial.df)
markers = {m: trial.df[m + '-c'].count() / total for m in trial.m... | mit | Python |
be291475601657cbcd3903679c77c2860b543308 | fix doc | deepchem/deepchem,deepchem/deepchem,peastman/deepchem,peastman/deepchem | deepchem/feat/tests/test_dummy_featurizer.py | deepchem/feat/tests/test_dummy_featurizer.py | import unittest
import deepchem as dc
import numpy as np
class TestDummyFeaturizer(unittest.TestCase):
"""
Test for DummyFeaturizer.
"""
def test_featurize(self):
"""
Test the featurize method on an array of inputs.
"""
input_array = np.array([[
"N#C[S-].O=C(CBr)c1ccc(C(F)(F)F)cc1>CCO... | import unittest
import deepchem as dc
import numpy as np
class TestDummyFeaturizer(unittest.TestCase):
"""
Test for DummyFeaturizer.
"""
def test_featurize(self):
"""
Test the featurize method on a list of inputs.
"""
input_array = np.array([[
"N#C[S-].O=C(CBr)c1ccc(C(F)(F... | mit | Python |
c8a97a33449eedc110169cb9b3f0120124d95e49 | Add tiny test for ToPickle (#6021) | dask/distributed,dask/distributed,dask/distributed,dask/distributed | distributed/protocol/tests/test_to_pickle.py | distributed/protocol/tests/test_to_pickle.py | from typing import Dict
import dask.config
from dask.highlevelgraph import HighLevelGraph, MaterializedLayer
from distributed.client import Client
from distributed.protocol import dumps, loads
from distributed.protocol.serialize import ToPickle
from distributed.utils_test import gen_cluster
def test_ToPickle():
... | from typing import Dict
import dask.config
from dask.highlevelgraph import HighLevelGraph, MaterializedLayer
from distributed.client import Client
from distributed.protocol.serialize import ToPickle
from distributed.utils_test import gen_cluster
class NonMsgPackSerializableLayer(MaterializedLayer):
"""Layer tha... | bsd-3-clause | Python |
288d02bccf08ff0498767aafca9bd37509213ec3 | Update forms.py | carthage-college/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthagecollege/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms | djforms/communications/printrequest/forms.py | djforms/communications/printrequest/forms.py | # -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from localflavor.us.forms import USPhoneNumberField
from djforms.communications.printrequest.models import PrintRequest, FORMATS
class PrintRequestForm(forms.ModelForm):
phone = USPhoneNumberField(
label = "Phone ... | # -*- coding: utf-8 -*-
from django import forms
from django.conf import settings
from localflavor.us.forms import USPhoneNumberField
from djforms.communications.printrequest.models import PrintRequest, FORMATS
class PrintRequestForm(forms.ModelForm):
phone = USPhoneNumberField(
label = "Phone ... | unlicense | Python |
1b13a929122c2bcb7e524b39183610ac3e57f191 | Mark Show.upcoming as @staticmethod | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | karspexet/show/models.py | karspexet/show/models.py | from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
... | from django.db import models
import datetime
class Production(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return self.name
class Show(models.Model):
production = models.ForeignKey(Production, on_delete=models.PROTECT)
... | mit | Python |
18282c34d3497934da6d1f9a36d3feb5bdf74297 | Adjust sos-report tests for label change | Scribery/cockpit,stefwalter/cockpit,larskarlitski/cockpit,SotolitoLabs/cockpit,larskarlitski/cockpit,harishanand95/cockpit,moraleslazaro/cockpit,andreasn/cockpit,cockpit-project/cockpit,SotolitoLabs/cockpit,moraleslazaro/cockpit,moraleslazaro/cockpit,xhad/cockpit,SotolitoLabs/cockpit,andreasn/cockpit,mvollmer/cockpit,S... | test/avocado/selenium-sosreport.py | test/avocado/selenium-sosreport.py | #!/usr/bin/python
# we need to be able to find and import seleniumlib, so add this directory
import os
import sys
machine_test_dir = os.path.dirname(os.path.abspath(__file__))
if not machine_test_dir in sys.path:
sys.path.insert(1, machine_test_dir)
from avocado import main
from avocado.utils import process
from... | #!/usr/bin/python
# we need to be able to find and import seleniumlib, so add this directory
import os
import sys
machine_test_dir = os.path.dirname(os.path.abspath(__file__))
if not machine_test_dir in sys.path:
sys.path.insert(1, machine_test_dir)
from avocado import main
from avocado.utils import process
from... | lgpl-2.1 | Python |
5906946b0287536976f816884169e3a3c91df043 | Add a verbose_name and help_text to the User.id Property. | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/models/user.py | app/soc/models/user.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange 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... | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange 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 |
b717696b5cff69e3586e06c399be7d06c057e503 | Make spawn_n() stub properly ignore errors in the child thread work | barnsnake351/nova,dawnpower/nova,alvarolopez/nova,JioCloud/nova_test_latest,joker946/nova,apporc/nova,cyx1231st/nova,dims/nova,klmitch/nova,mgagne/nova,openstack/nova,orbitfp7/nova,phenoxim/nova,rajalokan/nova,Stavitsky/nova,akash1808/nova_test_latest,apporc/nova,projectcalico/calico-nova,devendermishrajio/nova_test_la... | nova/tests/fake_utils.py | nova/tests/fake_utils.py | # Copyright (c) 2013 Rackspace Hosting
#
# 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... | # Copyright (c) 2013 Rackspace Hosting
#
# 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... | apache-2.0 | Python |
1f65be1f67867fc445b692df0f9390d6aa576e02 | Fix import in common/utils | Zloool/manyfaced-honeypot | manyfaced/common/utils.py | manyfaced/common/utils.py | import time
import pickle
from socket import error as socket_error
from status import CLIENT_TIMEOUT
def dump_file(data):
try:
with file('temp.db') as f:
string_file = f.read()
db = pickle.loads(string_file)
except:
db = list()
db.append(data)
with open('temp.db', ... | import time
import pickle
from socket import error as socket_error
from manyfaced.common.status import CLIENT_TIMEOUT
def dump_file(data):
try:
with file('temp.db') as f:
string_file = f.read()
db = pickle.loads(string_file)
except:
db = list()
db.append(data)
with... | mit | Python |
03f99a79941ade157689534e7ed0d0d196dd4d56 | fix grep command | stevenschlansker/Singularity,nvoron23/Singularity,stevenschlansker/Singularity,tejasmanohar/Singularity,grepsr/Singularity,andrhamm/Singularity,evertrue/Singularity,hs-jenkins-bot/Singularity,acbellini/Singularity,acbellini/Singularity,andrhamm/Singularity,grepsr/Singularity,calebTomlinson/Singularity,grepsr/Singularit... | scripts/logfetch/grep.py | scripts/logfetch/grep.py | import os
import sys
from termcolor import colored
GREP_COMMAND_FORMAT = 'xargs -n {0} {1} < {2}'
DEFAULT_GREP_COMMAND = 'grep --color=always \'{0}\''
def grep_files(args, all_logs):
if args.grep:
greplist_filename = '{0}/.greplist'.format(args.dest)
create_greplist(args, all_logs, greplist_filename)
co... | import os
import sys
from termcolor import colored
GREP_COMMAND_FORMAT = 'xargs -n {0} {1} < {2}'
DEFAULT_GREP_COMMAND = 'grep --color=always \'{1}\''
def grep_files(args, all_logs):
if args.grep:
greplist_filename = '{0}/.greplist'.format(args.dest)
create_greplist(args, all_logs, greplist_filename)
co... | apache-2.0 | Python |
3eea445a445a9154758cd82c11c52751f2804eca | add axis to 3d example | aringh/odl,odlgroup/odl,kohr-h/odl,odlgroup/odl,kohr-h/odl,aringh/odl | examples/tomo/xray_trafo_parallel_3d.py | examples/tomo/xray_trafo_parallel_3d.py | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | mpl-2.0 | Python |
e76777897bed5b9396d126e384555ea230b35784 | Use StaticFileStorage to determine source directories | jrief/django-sass-processor,jrief/django-sass-processor | sass_processor/apps.py | sass_processor/apps.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready... | mit | Python |
81622074d2d7544b897cec196257b130904f06b7 | Comment about JSON | virajs/selenium-1,winhamwr/selenium,akiellor/selenium,akiellor/selenium,virajs/selenium-1,virajs/selenium-1,virajs/selenium-1,winhamwr/selenium,virajs/selenium-1,akiellor/selenium,virajs/selenium-1,akiellor/selenium,winhamwr/selenium,akiellor/selenium,akiellor/selenium,winhamwr/selenium,virajs/selenium-1,virajs/seleniu... | firefox/src/py/extensionconnection.py | firefox/src/py/extensionconnection.py | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | Python |
b6b514d385e8e18d03b939cf5fae9873c9f02a21 | add constraint for price_list_ite | bank-netforce/netforce,bank-netforce/netforce,bank-netforce/netforce,bank-netforce/netforce,bank-netforce/netforce,bank-netforce/netforce | netforce_product/netforce_product/models/price_list_item.py | netforce_product/netforce_product/models/price_list_item.py | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit | Python |
577c0bff1e7333fe0f0fd5e45ce7c7cf19710605 | Fix migration [WAL-904] | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/migrations/0052_customer_subnets.py | nodeconductor/structure/migrations/0052_customer_subnets.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-07 08:52
from __future__ import unicode_literals
from django.db import migrations, models
import nodeconductor.core.validators
class Migration(migrations.Migration):
dependencies = [
('structure', '0051_add_customer_email_phone_agreement_nu... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-07 08:52
from __future__ import unicode_literals
from django.db import migrations, models
import nodeconductor.core.validators
class Migration(migrations.Migration):
dependencies = [
('structure', '0051_add_customer_email_phone_agreement_nu... | mit | Python |
f9a02492ca8f902ca349e60ce42dee4cadbd35c0 | Make run under Python 2.4. | rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror,rhaberkorn/scintilla-mirror | include/HFacer.py | include/HFacer.py | # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
# definition file.
# The header files are copied to a temporary file apart from the section between a //++Autogenerated
# comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile
# func... | # HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
# definition file.
# The header files are copied to a temporary file apart from the section between a //++Autogenerated
# comment and a //--Autogenerated comment which is generated by the printHFile and printLexHFile
# func... | isc | Python |
8683400f5c76a5afd71655c67eef89e98b39c19c | make test runnable standalone | radical-cybertools/radical.ensemblemd,radical-cybertools/radical.ensemblemd | tests/test_issues/test_issue_26.py | tests/test_issues/test_issue_26.py | #!/usr/bin/env python
from radical.entk import Pipeline, Stage, Task, AppManager
from radical.entk import states
from radical.entk.exceptions import *
import pytest
import os
hostname = os.environ.get('RMQ_HOSTNAME','localhost')
port = int(os.environ.get('RMQ_PORT',5672))
# MLAB = 'mongodb://entk:entk123@ds143511.mla... | from radical.entk import Pipeline, Stage, Task, AppManager
from radical.entk import states
from radical.entk.exceptions import *
import pytest
import os
hostname = os.environ.get('RMQ_HOSTNAME','localhost')
port = int(os.environ.get('RMQ_PORT',5672))
# MLAB = 'mongodb://entk:entk123@ds143511.mlab.com:43511/entk_0_7_4_... | mit | Python |
e5d13f315624be780fd60a04ff255f6682bdd84b | Update set_student_guardian.py | geekroot/erpnext,gsnbng/erpnext,geekroot/erpnext,indictranstech/erpnext,indictranstech/erpnext,gsnbng/erpnext,njmube/erpnext,gsnbng/erpnext,gsnbng/erpnext,Aptitudetech/ERPNext,njmube/erpnext,njmube/erpnext,indictranstech/erpnext,geekroot/erpnext,indictranstech/erpnext,njmube/erpnext,geekroot/erpnext | erpnext/patches/v7_1/set_student_guardian.py | erpnext/patches/v7_1/set_student_guardian.py | import frappe
def execute():
if frappe.db.exists("DocType", "Guardian"):
frappe.reload_doc("schools", "doctype", "student")
frappe.reload_doc("schools", "doctype", "student_guardian")
frappe.reload_doc("schools", "doctype", "student_sibling")
if "student" not in frappe.db.get_table_columns("Guardian"):
ret... | import frappe
def execute():
if frappe.db.exists("DocType", "Guardian"):
frappe.reload_doc("schools", "doctype", "student")
frappe.reload_doc("schools", "doctype", "student_guardian")
frappe.reload_doc("schools", "doctype", "student_sibling")
guardian = frappe.get_all("Guardian", fields=["name", "student"])
... | agpl-3.0 | Python |
9986da1599e5beaaad49d389b2a2ee3d4f308991 | fix https://github.com/BackofenLab/AlgoDat/issues/61 | TobiasFaller/AlgoDat,BackofenLab/AlgoDat,BackofenLab/AlgoDat,BackofenLab/AlgoDat,TobiasFaller/AlgoDat,TobiasFaller/AlgoDat,TobiasFaller/AlgoDat,BackofenLab/AlgoDat,BackofenLab/AlgoDat,TobiasFaller/AlgoDat | Lecture-4/Code/AssociativeArray.py | Lecture-4/Code/AssociativeArray.py | # creates a new map (called dictionary)
countries = {"DE" : "Deutschland", \
"EN" : "England"}
# check if element exists
if "EN" in countries:
print("Found %s!" % countries["EN"])
# map key "DE" to value "Germany"
countries["DE"] = "Germany"
# delete key "DE"
del countries["DE"]
| # creates a new map (called dictionary)
countries = {"DE" : "Deutschland", \
"EN" : "England"}
# check if element exists
if "EN" in countries:
print("Found %s!" % countries["EN"])
# map key "DE" to value 0
countries["DE"] = "Germany"
# delete key "DE"
del countries["DE"]
| mit | Python |
f98ef68949b8875daeb5b8346a65a842a682a5df | replace linebreaks in version strings | lilydjwg/nvchecker | nvchecker/get_version.py | nvchecker/get_version.py | # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
import logging
from importlib import import_module
logger = logging.getLogger(__name__)
handler_precedence = (
'github', 'aur', 'pypi', 'archpkg', 'debianpkg', 'ubuntupkg',
'gems', 'pacman',
'cmd', 'bitbucket', 'regex', 'manual', 'vc... | # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
import logging
from importlib import import_module
logger = logging.getLogger(__name__)
handler_precedence = (
'github', 'aur', 'pypi', 'archpkg', 'debianpkg', 'ubuntupkg',
'gems', 'pacman',
'cmd', 'bitbucket', 'regex', 'manual', 'vc... | mit | Python |
11c81ff161cad04a24a8746b93d3afb64e6a5b49 | fix typo | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | python/example_code/ec2/describe_subnets.py | python/example_code/ec2/describe_subnets.py | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is d... | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is d... | apache-2.0 | Python |
4c4e997767681e91f5d115e998cda22433eae7f6 | allow to set a mode (list|map) | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | apps/mapideas/views.py | apps/mapideas/views.py | import django_filters
from django.contrib import messages
from django.utils.translation import ugettext as _
from adhocracy4.maps import mixins as map_mixins
from adhocracy4.modules import views as module_views
from apps.contrib import filters
from . import forms
from . import models
def get_ordering_choices(reque... | import django_filters
from django.contrib import messages
from django.utils.translation import ugettext as _
from adhocracy4.maps import mixins as map_mixins
from adhocracy4.modules import views as module_views
from apps.contrib import filters
from . import forms
from . import models
def get_ordering_choices(reque... | agpl-3.0 | Python |
dac0afb3db74b1e8cd144993e662dc8ac0622cb9 | Add missing import to FTP module | opensistemas-hub/osbrain | osbrain/ftp.py | osbrain/ftp.py | """
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.aut... | """
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers impo... | apache-2.0 | Python |
c450ee554daf1b5c4143e33d5688df2fed776f99 | fix bug: 隐藏管理后台侧边栏配置owner字段,修复不填写作者无法保存侧边栏内容问题 | boldmanQ/blogsys,boldmanQ/blogsys | blogsys/blogsys/adminx.py | blogsys/blogsys/adminx.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:zq time:2018/3/15
from __future__ import unicode_literals
import xadmin
from xadmin.views import CommAdminView
class BaseOwnerAdmin(object):
'''
1.用来处理文章、分类、标签、侧边栏、友链这些model的owner子段自动补充
2.用来针对queryset过滤当前用户的数据
'''
exclude = ('owner',)
def... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:zq time:2018/3/15
from __future__ import unicode_literals
import xadmin
from xadmin.views import CommAdminView
class BaseOwnerAdmin(object):
'''
1.用来处理文章、分类、标签、侧边栏、友链这些model的owner子段自动补充
2.用来针对queryset过滤当前用户的数据
'''
exclude = ('owner')
def ... | mit | Python |
a6128825eb7b4267a2a5a3116ec2625fdd8d3552 | Add outsuffix to prottable-qvality driver | glormph/msstitch | app/drivers/prottable/qvality.py | app/drivers/prottable/qvality.py | from app.drivers.pycolator.qvality import QvalityDriver
from app.actions.prottable import qvality as preparation
from app.readers import tsv
class ProttableQvalityDriver(QvalityDriver):
"""Runs qvality on two protein tables"""
outsuffix = '_protqvality.txt'
def __init__(self, **kwargs):
super(Pro... | from app.drivers.pycolator.qvality import QvalityDriver
from app.actions.prottable import qvality as preparation
from app.readers import tsv
class ProttableQvalityDriver(QvalityDriver):
def __init__(self, **kwargs):
super(ProttableQvalityDriver).__init__(**kwargs)
self.score_get_fun = preparation.... | mit | Python |
3199b523a67f9c241950992a07fe38d2bbee07dc | Update migration file for namechange | RockinRobin/seednetwork,RockinRobin/seednetwork,RockinRobin/seednetwork | seedlibrary/migrations/0003_extendedview_fix.py | seedlibrary/migrations/0003_extendedview_fix.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameFi... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.Rename... | mit | Python |
17b0f5d7b718bc12755f7ddefdd76ee9312adf5f | Add content type text/html to response | sanchopanca/reader,sanchopanca/reader | books.py | books.py | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status ... | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status ... | agpl-3.0 | Python |
75b5f6acc441efe66c22b548ea21c5a16210af33 | Update cuberun model with BN, and input shape. | johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification | bird/models/cuberun.py | bird/models/cuberun.py | from keras.layers import Input
from keras.layers import Dense, Activation, Dropout, Flatten
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras import backend as K
def CubeRun(nb_classes):
""" Instan... | import json
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
model = Sequential()
# conv (64 5x5 kernels, stride size 2x1)
# TODO : 1 channel?
model.add(Convolution2D(64, 5, 5, input_s... | mit | Python |
ced7ff090c44f706fa161b5e5bed8f36fb6570c9 | Set default pool to 1 worker. | soasme/blackgate | blackgate/component.py | blackgate/component.py | # -*- coding: utf-8 -*-
from functools import partial
from blackgate.executor_pools import ExecutorPools
from blackgate.circuit_beaker import NoCircuitBeaker, InProcessCircuitBeaker, get_circuit_beaker
class Component(object):
def __init__(self):
self.pools = ExecutorPools()
self.circuit_beaker... | # -*- coding: utf-8 -*-
from functools import partial
from blackgate.executor_pools import ExecutorPools
from blackgate.circuit_beaker import NoCircuitBeaker, InProcessCircuitBeaker, get_circuit_beaker
class Component(object):
def __init__(self):
self.pools = ExecutorPools()
self.circuit_beaker... | mit | Python |
89237e9af27fa46c08ec90cab4029f41b335708f | fix pep8 violations | simphony/simphony-common | examples/plugin/simphony_example/__init__.py | examples/plugin/simphony_example/__init__.py | # Functions, classes and constants exported here will be available
# when the `example` module is imported.
__all__ = ['A', 'B']
from .code import A, B
| # Functions, classes and constants exported here will be available
# when the `example` module is imported.
__all__ = ['A', 'B']
from .code import A, B
| bsd-2-clause | Python |
4a498d83c15f89e00c095659df1fc38377acc0a3 | fix permissions for rewards | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/rewards/models.py | bluebottle/rewards/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import (CreationDateTimeField,
ModificationDateTimeField)
from bluebottle.utils.fields import MoneyField
from bluebottle.utils.utils import StatusDefinition
... | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import (CreationDateTimeField,
ModificationDateTimeField)
from bluebottle.utils.fields import MoneyField
from bluebottle.utils.utils import StatusDefinition
... | bsd-3-clause | Python |
7851e867aec82f771683cc267ecb5989d2005aa1 | add same features as program in 03-janus | pdebuyl-lab/RMPCDMD,laurensdeprez/RMPCDMD,pdebuyl-lab/RMPCDMD,pdebuyl/RMPCDMD,laurensdeprez/RMPCDMD,pdebuyl/RMPCDMD | experiments/01-single-dimer/plot_velocity.py | experiments/01-single-dimer/plot_velocity.py | #!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str, help='H5MD datafile')
parser.add_argument('--directed', action='store_true')
parser.add_argument('--histogram', action='store_true')
args = parser.parse_args()
import numpy as np
import h5py
import matplot... | #!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str, help='H5MD datafile')
parser.add_argument('--directed', action='store_true')
args = parser.parse_args()
import numpy as np
import h5py
import matplotlib.pyplot as plt
with h5py.File(args.file, 'r') as f:
... | bsd-3-clause | Python |
aabe64773baf0516ecce2e96793221d5bfa91040 | change to use environment variables | osbock/InternetOfSilly | scripts/sillyserver.py | scripts/sillyserver.py | # Example of using the MQTT client class to subscribe to a feed and print out
# any changes made to the feed. Edit the variables below to configure the key,
# username, and feed to subscribe to for changes.
# Import standard python modules.
import sys, os, serial
# Import Adafruit IO MQTT client.
from Adafruit_IO im... | # Example of using the MQTT client class to subscribe to a feed and print out
# any changes made to the feed. Edit the variables below to configure the key,
# username, and feed to subscribe to for changes.
# Import standard python modules.
import sys
import serial
# Import Adafruit IO MQTT client.
from Adafruit_IO ... | mit | Python |
d4879a7640869b16e1ea50cdbff84f173a81b521 | simplify variable | Fizzadar/pyinfra,Fizzadar/pyinfra | examples/apt.py | examples/apt.py | from pyinfra import host
from pyinfra.modules import apt
SUDO = True
code_name = host.fact.linux_distribution['release_meta'].get('DISTRIB_CODENAME')
print(host.fact.linux_name, code_name)
if host.fact.linux_name in ['Debian', 'Ubuntu']:
apt.packages(
{'Install some packages'},
['vim-addon-manag... | from pyinfra import host
from pyinfra.modules import apt
SUDO = True
# Note: Using linux_distribution fact so running from docker
# will show valid name since the lsb-release tool is not installed,
# otherwise could just use host.fact.linux_name
linux_name = host.fact.linux_distribution.get('name', '')
code_name = ho... | mit | Python |
630e362e727d4c7274b987008488d203e21f8ec6 | Use default quality | JustinWingChungHui/electionleaflets,DemocracyClub/electionleaflets,DemocracyClub/electionleaflets,DemocracyClub/electionleaflets,JustinWingChungHui/electionleaflets,JustinWingChungHui/electionleaflets,JustinWingChungHui/electionleaflets | electionleaflets/apps/api/serializers.py | electionleaflets/apps/api/serializers.py | from rest_framework import serializers
from sorl.thumbnail import get_thumbnail
from leaflets.models import Leaflet, LeafletImage
from constituencies.models import Constituency
from uk_political_parties.models import Party
from people.models import Person
class ConstituencySerializer(serializers.ModelSerializer):
... | from rest_framework import serializers
from sorl.thumbnail import get_thumbnail
from leaflets.models import Leaflet, LeafletImage
from constituencies.models import Constituency
from uk_political_parties.models import Party
from people.models import Person
class ConstituencySerializer(serializers.ModelSerializer):
... | mit | Python |
4626a20b2d46a3a8ea17d265dff220c5a02700d8 | Fix bug in clang-format's vim integration cause by r186789. | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-cl... | tools/clang-format/clang-format.py | tools/clang-format/clang-format.py | # This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<CR>
# imap <C-I> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i
#
# The first line enables clang-f... | # This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<CR>
# imap <C-I> <ESC>:pyf <path-to-this-file>/clang-format.py<CR>i
#
# The first line enables clang-f... | apache-2.0 | Python |
f2de502608833dda82908a6bb4f639645f785c06 | Change to support PEP Varible naming scheme | jdgwartney/pulse-api-cli,jdgwartney/boundary-api-cli,boundary/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/boundary-api-cli,boundary/boundary-api-cli,boundary/pulse-api-cli,jdgwartney/pulse-api-cli | boundary/hostgroup_update.py | boundary/hostgroup_update.py | #
# Copyright 2015 BMC Software, 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 ... | #
# Copyright 2015 BMC Software, 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 ... | apache-2.0 | Python |
9670454dbb7b2ec4ef61d60080a1bb798c3ace74 | use integer amounts for payment capture | hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice,hasgeek/boxoffice | boxoffice/extapi/razorpay.py | boxoffice/extapi/razorpay.py | # -*- coding: utf-8 -*-
import requests
from coaster.utils import LabeledEnum
from baseframe import __
from boxoffice import app
# Don't use a trailing slash
base_url = 'https://api.razorpay.com/v1/payments'
__all__ = ['RAZORPAY_PAYMENT_STATUS', 'capture_payment']
class RAZORPAY_PAYMENT_STATUS(LabeledEnum):
""... | # -*- coding: utf-8 -*-
import requests
from coaster.utils import LabeledEnum
from baseframe import __
from boxoffice import app
# Don't use a trailing slash
base_url = 'https://api.razorpay.com/v1/payments'
__all__ = ['RAZORPAY_PAYMENT_STATUS', 'capture_payment']
class RAZORPAY_PAYMENT_STATUS(LabeledEnum):
""... | agpl-3.0 | Python |
f8944c0ac5a80d72852d9b2ea1dc1fc7d79a1891 | Add test for deserialising | Ghostkeeper/Luna | plugins/data/enumerated/test/test_enumerated_type.py | plugins/data/enumerated/test/test_enumerated_type.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | cc0-1.0 | Python |
2be23846aabae5307ef817561661783b44c43160 | Move error-message logic into exception class | mlibrary/image-conversion-and-validation,mlibrary/image-conversion-and-validation | falcom/table.py | falcom/table.py | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class Table:
class InputStrContainsCarriageReturn (RuntimeError):
pass
class InconsistentColumnCounts (RuntimeError):
... | # Copyright (c) 2017 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.
class Table:
class InputStrContainsCarriageReturn (RuntimeError):
pass
class InconsistentColumnCounts (RuntimeError):
... | bsd-3-clause | Python |
4ce117b65d4a6f18d327f00866eaa4383f908094 | Revert "meter import path." | gizmoguy/faucet,shivarammysore/faucet,Bairdo/faucet,wackerly/faucet,anarkiwi/faucet,gizmoguy/faucet,trentindav/faucet,faucetsdn/faucet,mwutzke/faucet,anarkiwi/faucet,trungdtbk/faucet,trentindav/faucet,Bairdo/faucet,byllyfish/faucet,REANNZ/faucet,byllyfish/faucet,REANNZ/faucet,wackerly/faucet,shivarammysore/faucet,fauce... | faucet/meter.py | faucet/meter.py | """Configure meters."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... | """Configure meters."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... | apache-2.0 | Python |
db8b991600ab0a812e1d9af1a6e4bb7be25b5bd4 | fix apply_tote_contents_hint | pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc | jsk_2016_01_baxter_apc/node_scripts/apply_tote_contents_hint.py | jsk_2016_01_baxter_apc/node_scripts/apply_tote_contents_hint.py | #!/usr/bin/env python
import numpy as np
from jsk_2015_05_baxter_apc.msg import ObjectRecognition
import jsk_apc2016_common
from jsk_recognition_msgs.msg import ClassificationResult
from jsk_topic_tools import ConnectionBasedTransport
from jsk_topic_tools.log_utils import jsk_logwarn
import rospy
class ApplyToteCon... | #!/usr/bin/env python
import numpy as np
from jsk_2015_05_baxter_apc.msg import ObjectRecognition
import jsk_apc2016_common
from jsk_recognition_msgs.msg import ClassificationResult
from jsk_topic_tools import ConnectionBasedTransport
from jsk_topic_tools.log_utils import jsk_logwarn
import rospy
class ApplyToteCon... | bsd-3-clause | Python |
02efde47b5cf20b7385eacaa3f21454ffa636ad7 | Update CodeStarConnections::Connection per 2020-07-23 update | cloudtools/troposphere,cloudtools/troposphere | troposphere/codestarconnections.py | troposphere/codestarconnections.py | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if conne... | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if conne... | bsd-2-clause | Python |
c86d689e3593b6221b8b9120f6af16b32c2211d9 | Add __all__ and __version__ to __init__.py. | kivhift/pu | src/pu/__init__.py | src/pu/__init__.py | __all__ = 'utils'.split()
__version__ = '1.0.0'
| mit | Python | |
92469456222a8d5c00595ca34ea21c66042a5040 | modify main loop | m4tx/techswarm-receiver | parser/main.py | parser/main.py | import config
import parse
pipeout = open(config.PIPE_NAME, 'r')
while True:
input_record = pipeout.readline()
if input_record.split(',')[0] == '$GYRO':
gyro = input_record
if input_record.split(',')[0] == '$ACCEL':
accel = pipeout.readline()
if input_record.split(',')[0] == '$MAGNET':
... | import config
import parse
pipeout = open(config.PIPE_NAME, 'r')
while True:
input_record = pipeout.readline()
if input_record.split(',')[0] == '$GYRO':
gyro = input_record
accel = pipeout.readline()
magnet = pipeout.readline()
pressure = pipeout.readline()
parse.parse_... | mit | Python |
39e5defbb12da62fc132e89437b1ce408b85ec6b | Fix parsertests script exit code. | spookysys/systemverilog,vaisup/systemverilog-1,svstuff/systemverilog,svstuff/systemverilog,spookysys/systemverilog,vaisup/systemverilog-1,svstuff/systemverilog,vaisup/systemverilog-1,svstuff/systemverilog,spookysys/systemverilog,svstuff/systemverilog,vaisup/systemverilog-1,spookysys/systemverilog,spookysys/systemverilo... | parsertests.py | parsertests.py | #!/usr/bin/env python
import sys
import os
import os.path as path
import glob
import subprocess as sp
from collections import namedtuple
from multiprocessing import Pool
# TODO: remove this silly script and write the tests in scala/gradle.
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = ... | #!/usr/bin/env python
import sys
import os
import os.path as path
import glob
import subprocess as sp
from collections import namedtuple
from multiprocessing import Pool
# TODO: remove this silly script and write the tests in scala/gradle.
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = ... | mit | Python |
a9b7f92edb7b3a73a2b38a45c5ad6a0deee18e19 | Add GA tracking | keyan/blog | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'keyan'
SITENAME = u'keyan pishdadian'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/Detroit'
DEFAULT_LANG = u'en'
THEME = "themes/flasky"
# Site analytics
GOOGLE_ANALYTICS_ACCOUNT = "UA-93664476-1"
# Feed generatio... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'keyan'
SITENAME = u'keyan pishdadian'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'America/Detroit'
DEFAULT_LANG = u'en'
THEME = "themes/flasky"
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None... | mit | Python |
c8a1b3a7475d3e964814cb9be2a82d00bba745d0 | Update settings | yannbaumgartner/histoires-de-briques,yannbaumgartner/histoires-de-briques | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Yann Baumgartner'
SITENAME = u'Histoires de briques'
SITESUBTITLE = 'Un site dédié aux LEGO®'
SITEURL = ''
GITHUB_URL = 'https://github.com/yannbaumgartner/histoires-de-briques.git'
PATH = 'content'
PAGE_PATHS = ['pages... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Yann Baumgartner'
SITENAME = u'Histoires de briques'
SITESUBTITLE = 'Un site dédié aux LEGO®'
SITEURL = ''
GITHUB_URL = 'https://github.com/yannbaumgartner/histoires-de-briques.git'
PATH = 'content'
PAGE_PATHS = ['pages... | agpl-3.0 | Python |
0a6e486a27a48c59e48f458ce1217848ed73ff24 | Fix time zone config | irskep/nestweb,irskep/nestweb | pelicanconf.py | pelicanconf.py | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Eric, Etan, Fred, Genny, and Steve'
SITENAME = u'The Nest'
SITEURL = ''
TIMEZONE = 'PST'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRA... | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'Eric, Etan, Fred, Genny, and Steve'
SITENAME = u'The Nest'
SITEURL = ''
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM =... | bsd-3-clause | Python |
c08e28a23778280e577793156ce5b455ba80f92f | Tag new release: 2.3.0 | Floobits/floobits-sublime,Floobits/floobits-sublime | floo/version.py | floo/version.py | PLUGIN_VERSION = '2.3.0'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.03'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| PLUGIN_VERSION = '2.2.13'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.03'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| apache-2.0 | Python |
fcc77ac1557ab7f5c3d5605240ea505b8b61b321 | Update utils.py | GuidoE/django-follow,GuidoE/django-follow | follow/utils.py | follow/utils.py | from django.core.urlresolvers import reverse
from django.db.models.fields.related import ManyToManyField, ForeignKey
from follow.models import Follow
from follow.registry import registry, model_map
from django import VERSION as DjangoVersion
if float('%s.%s' % DjangoVersion[:2]) >= 1.7:
module_name = 'model_name'
e... | from django.core.urlresolvers import reverse
from django.db.models.fields.related import ManyToManyField, ForeignKey
from follow.models import Follow
from follow.registry import registry, model_map
from django import VERSION as DjangoVersion
if float('%s.%s' % DjangoVersion[:2]) > 1.7:
module_name = 'model_name'
el... | mit | Python |
2191f877270fc984d5a8e7cc2ffe9ab8c1630101 | fix style | fgirault/smeuhsocial,amarandon/smeuhsocial,fgirault/smeuhsocial,fgirault/smeuhsocial,amarandon/smeuhsocial,amarandon/smeuhsocial | apps/smeuhoverride/views.py | apps/smeuhoverride/views.py | # Create your views here.
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.http import Http404, HttpResponse
from d... | # Create your views here.
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.http import Http404, HttpResponse
from d... | mit | Python |
1ca331975ab91cf619c3c785ead5b352af47963a | Use local thread storage. | modoboa/modoboa,bearstech/modoboa,tonioo/modoboa,modoboa/modoboa,bearstech/modoboa,bearstech/modoboa,modoboa/modoboa,bearstech/modoboa,tonioo/modoboa,tonioo/modoboa,modoboa/modoboa | modoboa/lib/middleware.py | modoboa/lib/middleware.py | # coding: utf-8
"""Custom middlewares."""
from threading import local
from django.http import HttpResponseRedirect
from modoboa.lib.exceptions import ModoboaException
from modoboa.lib.signals import request_accessor
from modoboa.lib.web_utils import (
_render_error, ajax_response, render_to_json_response
)
_lo... | # coding: utf-8
"""Custom middlewares."""
from django.http import HttpResponseRedirect
from modoboa.lib.exceptions import ModoboaException
from modoboa.lib.signals import request_accessor
from modoboa.lib.web_utils import (
_render_error, ajax_response, render_to_json_response
)
from . import singleton
class ... | isc | Python |
70ce7627b11bf804660bc66a60910f66f8f106bd | Reformat code | jdgwartney/boundary-api-cli,jdgwartney/pulse-api-cli,jdgwartney/boundary-api-cli,boundary/boundary-api-cli,jdgwartney/pulse-api-cli,wcainboundary/boundary-api-cli,wcainboundary/boundary-api-cli,boundary/pulse-api-cli,boundary/pulse-api-cli,boundary/boundary-api-cli | boundary/metric_delete.py | boundary/metric_delete.py | #
# Copyright 2014-2015 Boundary, 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... | #
# Copyright 2014-2015 Boundary, 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... | apache-2.0 | Python |
b628e466f86bc27cbe45ec27a02d4774a0efd3bb | Clean out dist and build before building | relekang/python-semantic-release,relekang/python-semantic-release | semantic_release/pypi.py | semantic_release/pypi.py | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:pa... | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:pa... | mit | Python |
f6cad1777023ceb53db8599bc2e74bf0ab2aa0a7 | Prepare for next dev release | totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator | orchestrator/__init__.py | orchestrator/__init__.py | from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.5.2'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
| from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.5.1'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
| mit | Python |
569c056e016131ec4325185ee9fe814018d5e1fe | Fix problem on no-longer existing bands that are still as logged in session available | dennisausbremen/tunefish,dennisausbremen/tunefish,dennisausbremen/tunefish | server/bands/__init__.py | server/bands/__init__.py | from flask import session, redirect, url_for, g, jsonify, Response
from flask.views import MethodView
from server.models import Band
class RestrictedBandPage(MethodView):
def dispatch_request(self, *args, **kwargs):
if not 'bandId' in session:
return redirect(url_for('bands.session.index'))
... | from flask import session, redirect, url_for, g, jsonify, Response
from flask.views import MethodView
from server.models import Band
class RestrictedBandPage(MethodView):
def dispatch_request(self, *args, **kwargs):
if not 'bandId' in session:
return redirect(url_for('bands.session.index'))
... | apache-2.0 | Python |
08c25e4ff96765c057397582327a36a6a1d3b7cb | fix caching unicode error | c4fcm/our-cup,c4fcm/our-cup,c4fcm/our-cup | ourcup/util/filecache.py | ourcup/util/filecache.py | import hashlib, os, codecs, logging
'''
Super basic file-based cache (utf-8 friendly). Helpful if you're developing a
webpage scraper and want to be a bit more polite to the server you're scraping
while developing. The idea is that it caches content in files, each named by the
key you pass in (use the md5_key help... | import hashlib, os, codecs, logging
'''
Super basic file-based cache (utf-8 friendly). Helpful if you're developing a
webpage scraper and want to be a bit more polite to the server you're scraping
while developing. The idea is that it caches content in files, each named by the
key you pass in (use the md5_key help... | mit | Python |
a3353e1b4c3e181958a877c8e2485c2c7eed4201 | Update pd_utils for python3 | ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project,ricardog/raster-project | projections/pd_utils.py | projections/pd_utils.py | import numpy.lib
import numpy as np
import pandas as pd
import _pickle as pickle
def save_pandas(fname, data):
'''Save DataFrame or Series
Parameters
----------
fname : str
filename to use
data: Pandas DataFrame or Series
'''
np.save(open(fname, 'wb'), data)
if len(data.shape) ... | import numpy.lib
import numpy as np
import pandas as pd
import _pickle as pickle
def save_pandas(fname, data):
'''Save DataFrame or Series
Parameters
----------
fname : str
filename to use
data: Pandas DataFrame or Series
'''
np.save(open(fname, 'w'), data)
if len(data.shape) =... | apache-2.0 | Python |
006eff6a9376c65e0632efe79ec6d39cbc50f80b | remove UI element namespaces | tim-janik/rapicorn,tim-janik/rapicorn,tim-janik/rapicorn,tim-janik/rapicorn,tim-janik/rapicorn | docs/tutorial/tuthello.py | docs/tutorial/tuthello.py | # Licensed CC0 Public Domain: http://creativecommons.org/publicdomain/zero/1.0
# [HelloRapicorn-EXAMPLE]
# Load and import a versioned Rapicorn module into the 'Rapicorn' namespace
import Rapicorn1307 as Rapicorn
# Setup the application object, unsing a unique application name.
app = Rapicorn.app_init ("Hello Rapicorn... | # Licensed CC0 Public Domain: http://creativecommons.org/publicdomain/zero/1.0
# [HelloRapicorn-EXAMPLE]
# Load and import a versioned Rapicorn module into the 'Rapicorn' namespace
import Rapicorn1307 as Rapicorn
# Setup the application object, unsing a unique application name.
app = Rapicorn.app_init ("Hello Rapicorn... | mpl-2.0 | Python |
ec2456eac36a96c9819920bf8b4176e6a37ad9a5 | Rename productclass made during migration | KenMutemi/saleor,HyperManTT/ECommerceSaleor,mociepka/saleor,maferelo/saleor,maferelo/saleor,tfroehlich82/saleor,tfroehlich82/saleor,car3oon/saleor,itbabu/saleor,KenMutemi/saleor,KenMutemi/saleor,UITools/saleor,UITools/saleor,jreigel/saleor,mociepka/saleor,tfroehlich82/saleor,itbabu/saleor,car3oon/saleor,UITools/saleor,... | saleor/product/migrations/0020_attribute_data_to_class.py | saleor/product/migrations/0020_attribute_data_to_class.py | from __future__ import unicode_literals
from django.db import migrations, models
def move_data(apps, schema_editor):
Product = apps.get_model('product', 'Product')
ProductClass = apps.get_model('product', 'ProductClass')
for product in Product.objects.all():
attributes = product.attributes.all()... | from __future__ import unicode_literals
from django.db import migrations, models
def move_data(apps, schema_editor):
Product = apps.get_model('product', 'Product')
ProductClass = apps.get_model('product', 'ProductClass')
for product in Product.objects.all():
attributes = product.attributes.all()... | bsd-3-clause | Python |
f31e8215838e40960abff6c86be8c66cbf113c95 | Make the endpoint return geojson as opposed to wkt geometry | Kitware/minerva,Kitware/minerva,Kitware/minerva | server/rest/twofishes.py | server/rest/twofishes.py | import requests
from shapely.wkt import loads
from shapely.geometry import mapping
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET',... | import requests
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource
class TwoFishes(Resource):
def __init__(self):
self.resourceName = 'minerva_geocoder'
self.route('GET', (), self.geocode)
self.route('GET', ('autocomplete',), sel... | apache-2.0 | Python |
9ece50e71d2c5eab7b97edc5b8bbdfb410ce64bf | edit admin.py | dresl/django_choice_and_question,dresl/django_choice_and_question | polls/admin.py | polls/admin.py | from django.contrib import admin
from polls.models import Choice, Question
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date'... | from django.contrib import admin
from polls.models import Choice, Question
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class QuestionAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question_text']}),
('Date information', {'fields': ['pub_date'... | apache-2.0 | Python |
5b63950cb3fa018b63ccb0be3faeceef684f9299 | Add persistent storage | felixbade/webanalytics | ipinfo.py | ipinfo.py | from ipaddress import ip_address, ip_network
import shelve
from ipwhois import IPWhois
ip_whois_shelve_filename = 'ip_whois'
known_networks = shelve.open(ip_whois_shelve_filename)
def updateIpInfo(ip):
info = IPWhois(ip).lookup()
# these two lines might break on some input
net = info['nets'][0]
netwo... | from ipaddress import ip_address, ip_network
from ipwhois import IPWhois
known_networks = {}
def updateIpInfo(ip):
info = IPWhois(ip).lookup()
# these two lines might break on some input
net = info['nets'][0]
networks = net['cidr'].split(', ')
for network in networks:
network = ip_network... | mit | Python |
f63ddd4c4e98322fcff651aefb298f7724dc9bff | Add help text, rename 'history' to graph | flukiluke/eris | basil.py | basil.py | import subprocess
import time
import tempfile
last_watered = 0
COOLDOWN = 60
WATER_MAX_SECS = 60
HELPTEXT = {}
def basilcmd(cmds):
output = subprocess.check_output(['ssh', 'rrpi', './basilbot/cli.py', *cmds], stderr=subprocess.STDOUT)
return output
HELPTEXT['moisture'] = 'Check the instantaneous moisture o... | import subprocess
import time
import tempfile
last_watered = 0
COOLDOWN = 60
def basilcmd(cmds):
output = subprocess.check_output(['ssh', 'rrpi', './basilbot/cli.py', *cmds], stderr=subprocess.STDOUT)
return output
def moisture():
output = basilcmd(['moisture'])
return 'Soil moisture content: ' + ... | mit | Python |
6c3ba0617575d2d178c2f1a2632cea5f5ba09d5f | Revert "Updated License" | DatiData/grabLocation_py | grabLocation.py | grabLocation.py | from geopy.geocoders import GoogleV3
from geopy.exc import GeocoderTimedOut
import time # For rate limiting purposes
# Using Geopy copyright 2006-2016 geopy authors
# Geopy available at https://github.com/geopy/geopy
# This program is copyright 2017 Joseph Johaneman
# And is released under the 3 Clause BSD License... | from geopy.geocoders import GoogleV3
from geopy.exc import GeocoderTimedOut
import time # For rate limiting purposes
# Using Geopy copyright 2006-2016 geopy authors
# Geopy available at https://github.com/geopy/geopy
# This program is copyright 2017 Joseph Johaneman
# And is released under the MIT License
# What ... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.