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 |
|---|---|---|---|---|---|---|---|---|
2e41d420ba879403d0c491276cd2ca5133eef546 | Bump version to 3.0.7. | Uzere/uSim | simpy/__init__.py | simpy/__init__.py | """
The ``simpy`` module aggregates SimPy's most used components into a single
namespace. This is purely for convenience. You can of course also access
everything (and more!) via their actual submodules.
The following tables list all of the available components in this module.
{toc}
"""
from pkgutil import extend_pa... | """
The ``simpy`` module aggregates SimPy's most used components into a single
namespace. This is purely for convenience. You can of course also access
everything (and more!) via their actual submodules.
The following tables list all of the available components in this module.
{toc}
"""
from pkgutil import extend_pa... | mit | Python |
05094307c2f49b7a6207ddaa049ac79e759c03da | Fix deprecation of social OAuth scopes | HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily | lily/users/authentication/social_auth/providers/google.py | lily/users/authentication/social_auth/providers/google.py | from django.conf import settings
from ..exceptions import InvalidProfileError
from .base import BaseAuthProvider
class GoogleAuthProvider(BaseAuthProvider):
client_id = settings.SOCIAL_AUTH_GOOGLE_CLIENT_ID
client_secret = settings.SOCIAL_AUTH_GOOGLE_SECRET
scope = [
'openid',
'email',
... | from django.conf import settings
from ..exceptions import InvalidProfileError
from .base import BaseAuthProvider
class GoogleAuthProvider(BaseAuthProvider):
client_id = settings.SOCIAL_AUTH_GOOGLE_CLIENT_ID
client_secret = settings.SOCIAL_AUTH_GOOGLE_SECRET
scope = [
'https://www.googleapis.com/a... | agpl-3.0 | Python |
2f3ea4843fbec73480f56642e2f5153fac73c157 | fix logging config path | rpetrenko/test-reporter,rpetrenko/test-reporter | server/app.py | server/app.py | import logging.config
from flask import Flask, Blueprint
from server import settings
from server.api.jenkins.endpoints.sites import ns as jenkins_sites_namespace
from server.api.jenkins.endpoints.jobs import ns as jenkins_jobs_namespace
from server.api.jenkins.endpoints.builds import ns as jenkins_builds_namespace
from... | import logging.config
from flask import Flask, Blueprint
from server import settings
from server.api.jenkins.endpoints.sites import ns as jenkins_sites_namespace
from server.api.jenkins.endpoints.jobs import ns as jenkins_jobs_namespace
from server.api.jenkins.endpoints.builds import ns as jenkins_builds_namespace
from... | apache-2.0 | Python |
4aa84a134aeedee2dc8f4fb65d686d1e447c0c5e | change response headers to application/json | prabhakar267/vertikin | server/app.py | server/app.py | import os.path
import pickle
from flask import Flask, request, redirect, jsonify
from flask_cors import CORS
from settings import DEBUG
from constants import GITHUB_REPOSITORY_LINK, DEFAULT_THRESHOLD, THRESHOLD_DELTA
from utils import update_dict, check_prediction
app = Flask(__name__)
CORS(app)
@app.route("/upda... | import json
import os.path
import pickle
from flask import Flask, request, redirect
from flask_cors import CORS
from settings import DEBUG
from constants import GITHUB_REPOSITORY_LINK, DEFAULT_THRESHOLD, THRESHOLD_DELTA
from utils import update_dict, check_prediction
app = Flask(__name__)
CORS(app)
@app.route("/u... | mit | Python |
db423cf7045cc66fc6b006289499bf9c4b7d7713 | change gearauthsite to ga.netpie.io | netpieio/microgear-python | microgear/__init__.py | microgear/__init__.py | import logging
__version__ = '1.1.12'
gearauthsite = "http://ga.netpie.io:8080"
gearauthrequesttokenendpoint = gearauthsite+"/api/rtoken"
gearauthaccesstokenendpoint = gearauthsite+"/api/atoken"
mgrev = "PY11k"
gearkey = None
gearsecret = None
gearalias = None
appid = None
gearname = None
accesstoken = None
requestto... | import logging
__version__ = '1.1.11'
gearauthsite = "http://gearauth.netpie.io:8080"
gearauthrequesttokenendpoint = gearauthsite+"/api/rtoken"
gearauthaccesstokenendpoint = gearauthsite+"/api/atoken"
mgrev = "PY11k"
gearkey = None
gearsecret = None
gearalias = None
appid = None
gearname = None
accesstoken = None
req... | isc | Python |
6ec656a4ab0a255bad85c3157a045849da001352 | Add more granular date locators | has2k1/plotnine,has2k1/plotnine | ggplot/utils/date_breaks.py | ggplot/utils/date_breaks.py | from matplotlib.dates import MinuteLocator, HourLocator, DayLocator
from matplotlib.dates import WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,unit... | from matplotlib.dates import DayLocator, WeekdayLocator, MonthLocator, YearLocator
def parse_break_str(txt):
"parses '10 weeks' into tuple (10, week)."
txt = txt.strip()
if len(txt.split()) == 2:
n, units = txt.split()
else:
n,units = 1, txt
units = units.rstrip('s') # e.g. weeks =>... | mit | Python |
501952d603c9ab05a2f6078eb8ca6d528fb71185 | Fix again. | ViaFerrata/DL_pipeline_TauAppearance,ViaFerrata/DL_pipeline_TauAppearance | examples/parser_orcatrain.py | examples/parser_orcatrain.py | """
Use orca_train with a parser.
Usage:
parser_orcatrain.py FOLDER LIST CONFIG MODEL
parser_orcatrain.py (-h | --help)
Arguments:
FOLDER Path to the folder where everything gets saved to, e.g. the summary.txt, the plots, the trained models, etc.
LIST A .toml file which contains the pathes of the ... | """
Use orca_train with a parser.
Usage:
parser_orcatrain.py FOLDER LIST CONFIG MODEL
parser_orcatrain.py (-h | --help)
Arguments:
FOLDER Path to the folder where everything gets saved to, e.g. the summary.txt, the plots, the trained models, etc.
LIST A .toml file which contains the pathes of the ... | agpl-3.0 | Python |
464ef8576fb9d53574d4976830010c7a9acdd77b | Update sync-org command | alphagov/ghtools | ghtools/command/sync_org.py | ghtools/command/sync_org.py | from __future__ import print_function
import logging
from argh import *
from ghtools.api import GithubAPIClient, ClientError, APIError
log = logging.getLogger(__name__)
def extract_keys(obj, keys):
newobj = {}
for k in keys:
newobj[k] = obj[k]
return newobj
def sync_repo(gh_client, org, repo):
... | from __future__ import print_function
import logging
from argh import *
from ghtools.api import GithubAPIClient, ClientError, APIError
log = logging.getLogger(__name__)
def extract_keys(obj, keys):
newobj = {}
for k in keys:
newobj[k] = obj[k]
return newobj
def sync_repo(gh_client, org, repo):
... | mit | Python |
ef62cec8673f255dd9ce909d23a877ba93bd6bf5 | Raise exception in case of config load error | voidpp/python-tools | voidpp_tools/json_config.py | voidpp_tools/json_config.py |
import os
import json
class JSONConfigLoader():
def __init__(self, base_path):
self.sources = [
os.path.dirname(os.getcwd()),
os.path.dirname(os.path.abspath(base_path)),
os.path.expanduser('~'),
'/etc',
]
def load(self, filename):
tries... |
import os
import json
class JSONConfigLoader():
def __init__(self):
self.sources = [
os.path.dirname(os.getcwd()),
os.path.dirname(os.path.abspath(__file__)),
os.path.expanduser('~'),
'/etc',
]
def load(self, filename):
for source in sel... | mit | Python |
7b160dd70337715db4564e963fcba0d47c40b1bc | test to check that fht/cyfht aborts on non-power-two input | scikit-learn-contrib/scikit-learn-extra | sklearn/utils/tests/test_fht.py | sklearn/utils/tests/test_fht.py | import numpy as np
import numpy.testing as npt
import nose.tools as nt
from scipy.linalg import hadamard
from sklearn.utils.fht import fht
from sklearn.utils.cyfht import fht as cyfht
def single(fht_type):
input_ = np.array([1, 0, 1, 0, 0, 1, 1, 0], dtype=np.float64)
copy = input_.copy()
H = hadamard(8)
... | import numpy as np
import numpy.testing as npt
from scipy.linalg import hadamard
from sklearn.utils.fht import fht
from sklearn.utils.cyfht import fht as cyfht
def single(fht_type):
input_ = np.array([1, 0, 1, 0, 0, 1, 1, 0], dtype=np.float64)
copy = input_.copy()
H = hadamard(8)
fht_type(input_)
n... | bsd-3-clause | Python |
aec0c652606bf4219fd2679576212722778d4e7a | replace setting attributes with setting variables of superclass | scikit-nano/scikit-nano,androomerrill/scikit-nano,scikit-nano/scikit-nano,androomerrill/scikit-nano | sknano/nanogen_gui/_ng_model.py | sknano/nanogen_gui/_ng_model.py | # -*- coding: utf-8 -*-
"""
====================================================
NanoGen model (:mod:`sknano.nanogen_gui._ng_model`)
====================================================
.. currentmodule:: sknano.nanogen_gui._ng_model
"""
from __future__ import absolute_import, division, print_function
__docformat__ =... | # -*- coding: utf-8 -*-
"""
====================================================
NanoGen model (:mod:`sknano.nanogen_gui._ng_model`)
====================================================
.. currentmodule:: sknano.nanogen_gui._ng_model
"""
from __future__ import absolute_import, division, print_function
__docformat__ =... | bsd-2-clause | Python |
b009a0bebc4087fb9adce508c2a11eba086403ed | Revert timesince chunks after monkey patch (fixes #181) | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | core/utils.py | core/utils.py | # -*- coding: utf-8 -*-
from django.utils import timesince, timezone
from django.utils.translation import ngettext
def child_age_string(duration):
"""Monkey patch timesince function to day precision only.
"""
default_timesine_chunks = timesince.TIMESINCE_CHUNKS
timesince.TIMESINCE_CHUNKS = (
(... | # -*- coding: utf-8 -*-
from django.utils import timesince, timezone
from django.utils.translation import ngettext
def child_age_string(duration):
"""Monkey patch timesince function to day precision only.
"""
timesince.TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, 'year'),
(60 * 60 * 24 * 30, ... | bsd-2-clause | Python |
a48ae09ce927622e8a5931dbcb843523d8f4bd23 | Reset warnings before testing warnings | nimasmi/wagtail,torchbox/wagtail,mikedingjan/wagtail,kaedroho/wagtail,zerolab/wagtail,zerolab/wagtail,wagtail/wagtail,chrxr/wagtail,hamsterbacke23/wagtail,rsalmaso/wagtail,kurtrwall/wagtail,quru/wagtail,chrxr/wagtail,kaedroho/wagtail,Toshakins/wagtail,zerolab/wagtail,nealtodd/wagtail,nutztherookie/wagtail,Toshakins/wag... | wagtail/tests/test_utils.py | wagtail/tests/test_utils.py | # -*- coding: utf-8 -*
from __future__ import absolute_import, unicode_literals
import warnings
from django.test import SimpleTestCase
from wagtail.utils.deprecation import RemovedInWagtail17Warning, SearchFieldsShouldBeAList
class TestThisShouldBeAList(SimpleTestCase):
def test_add_a_list(self):
with ... | # -*- coding: utf-8 -*
from __future__ import absolute_import, unicode_literals
import warnings
from django.test import SimpleTestCase
from wagtail.utils.deprecation import RemovedInWagtail17Warning, SearchFieldsShouldBeAList
class TestThisShouldBeAList(SimpleTestCase):
def test_add_a_list(self):
with ... | bsd-3-clause | Python |
1feae718c5ddac00320686fd523cffbdc20268ef | Make updates less frequent | opennode/nodeconductor-saltstack | src/nodeconductor_saltstack/exchange/extension.py | src/nodeconductor_saltstack/exchange/extension.py | from nodeconductor.core import NodeConductorExtension
class ExchangeExtension(NodeConductorExtension):
@staticmethod
def django_app():
return 'nodeconductor_saltstack.exchange'
@staticmethod
def rest_urls():
from .urls import register_in
return register_in
@staticmethod
... | from nodeconductor.core import NodeConductorExtension
class ExchangeExtension(NodeConductorExtension):
@staticmethod
def django_app():
return 'nodeconductor_saltstack.exchange'
@staticmethod
def rest_urls():
from .urls import register_in
return register_in
@staticmethod
... | mit | Python |
78cadb0b87b7787e2d45db95485841d3d909d197 | Fix filter_form when not in collection | SchoolIdolTomodachi/CinderellaProducers,SchoolIdolTomodachi/CinderellaProducers | cpro/views.py | cpro/views.py | import random
from django.shortcuts import render, get_object_or_404
from web.views_collections import item_view, list_view
from web.settings import ENABLED_COLLECTIONS
from web.views import _index_extraContext as web_index_extraContext
from cpro import models, filters
from web.utils import ajaxContext
def _index_extr... | import random
from django.shortcuts import render, get_object_or_404
from web.views_collections import item_view, list_view
from web.settings import ENABLED_COLLECTIONS
from web.views import _index_extraContext as web_index_extraContext
from cpro import models, filters
from web.utils import ajaxContext
def _index_extr... | apache-2.0 | Python |
a436470f00dddcb1764da6b6dc244e86bc71d473 | Add seaborn, collections, itertools to IPython imports | YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts,YeoLab/gscripts | gscripts/ipython_imports.py | gscripts/ipython_imports.py | import numpy as np
import pandas as pd
import matplotlib_venn
import matplotlib.pyplot as plt
import brewer2mpl
import itertools
import seaborn as sns
import collections
import itertools
set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors
red = set1[0]
blue = set1[1]
green = set1[2]
purple = set1[3]
orange ... | import numpy as np
import pandas as pd
import matplotlib_venn
import matplotlib.pyplot as plt
import brewer2mpl
import itertools
set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors
red = set1[0]
blue = set1[1]
green = set1[2]
purple = set1[3]
orange = set1[4]
yellow = set1[5]
brown = set1[6]
pink = set1[7]
... | mit | Python |
c4b27ddc60436c72941c8b7b8703da0efd297603 | update specs | mick-d/nipype,mick-d/nipype,mick-d/nipype,mick-d/nipype | nipype/interfaces/freesurfer/tests/test_auto_ConcatenateLTA.py | nipype/interfaces/freesurfer/tests/test_auto_ConcatenateLTA.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import ConcatenateLTA
def test_ConcatenateLTA_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import ConcatenateLTA
def test_ConcatenateLTA_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | bsd-3-clause | Python |
d9ea3140e47ba1244da07d4f07606db4b65d6fdf | Stop hard-coding examples of port settings in game template, it just confuses things. | jamesbeebop/evennia,jamesbeebop/evennia,jamesbeebop/evennia | evennia/game_template/server/conf/settings.py | evennia/game_template/server/conf/settings.py | """
Evennia settings file.
The available options are found in the default settings file found
here:
{settings_default}
Remember:
Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
When changing a setting requiring a ... | """
Evennia settings file.
The available options are found in the default settings file found
here:
{settings_default}
Remember:
Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
When changing a setting requiring a ... | bsd-3-clause | Python |
4299d86abfa74d49e82a3b5e08104c09c63e7ac1 | Enable Redis Cache | FlowFX/unkenmathe.de,FlowFX/unkenmathe.de,FlowFX/unkenmathe.de,FlowFX/unkenmathe.de | src/config/settings/production.py | src/config/settings/production.py | """Django configuration for production environment."""
from .common import *
# Core Settings
ALLOWED_HOSTS = ['www.unkenmathe.de']
# Security
CSRF_COOKIE_SECURE = True
CSRF_USE_SESSIONS = False # could be True
SECURE_BROWSER_XSS_FILTER = True
SECURE_SSL_REDIRECT = True # Force HTTPS
SECURE_HSTS_INCLUDE_SUBDOMAINS ... | """Django configuration for production environment."""
from .common import *
# Core Settings
ALLOWED_HOSTS = ['www.unkenmathe.de']
# Security
CSRF_COOKIE_SECURE = True
CSRF_USE_SESSIONS = False # could be True
SECURE_BROWSER_XSS_FILTER = True
SECURE_SSL_REDIRECT = True # Force HTTPS
SECURE_HSTS_INCLUDE_SUBDOMAINS ... | agpl-3.0 | Python |
8487715aff17d9bf902a29235174af385ec6e761 | Use FLAGS.dropout_prob | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | nn/rnn/rnn.py | nn/rnn/rnn.py | import tensorflow as tf
from .cell import ln_lstm_cell as _DEFAULT_CELL
from ..util import funcname_scope, dimension_indices
from ..flags import FLAGS
@funcname_scope
def rnn(input_embeddings,
*,
output_embedding_size,
dropout_prob,
sequence_length=None):
return _only_outputs(tf.nn... | import tensorflow as tf
from .cell import ln_lstm_cell as _DEFAULT_CELL
from ..util import funcname_scope, dimension_indices
@funcname_scope
def rnn(input_embeddings,
*,
output_embedding_size,
dropout_prob,
sequence_length=None):
return _only_outputs(tf.nn.rnn(
_DEFAULT_CELL(... | unlicense | Python |
7d9060b3fed6035b21632fb54bcb4f5af1bb4fef | Remove import *. | jwg4/calexicon,jwg4/qual | calexicon/tests/test_constants.py | calexicon/tests/test_constants.py | import unittest
from calexicon.constants import number_of_days_in_400_gregorian_years
class TestConstants(unittest.TestCase):
def test_constants(self):
self.assertEqual(number_of_days_in_400_gregorian_years, 365 * 400 + 97)
| import unittest
from calexicon.constants import *
class TestConstants(unittest.TestCase):
def test_constants(self):
self.assertEqual(number_of_days_in_400_gregorian_years, 365 * 400 + 97)
| apache-2.0 | Python |
287fa30a05ecf14234667eba90663f13760cd638 | Create directories, set bash trace mode | bcle/simplesync | simplesync.py | simplesync.py | #!/usr/bin/python
from sys import exit
from optparse import OptionParser
from os import walk
import os
usage = "usage: %prog [options] src dst"
parser = OptionParser(usage=usage)
parser.add_option("-f", "--file", dest="filename",
help="write report to FILE", metavar="FILE")
parser.add_option("-q", "... | #!/usr/bin/python
from sys import exit
from optparse import OptionParser
from os import walk
import os
usage = "usage: %prog [options] src dst"
parser = OptionParser(usage=usage)
parser.add_option("-f", "--file", dest="filename",
help="write report to FILE", metavar="FILE")
parser.add_option("-q", "... | mit | Python |
79e657542c7a7f48f008c86867be9684bc693d0c | Fix get file instead of path | architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst | cea/datamanagement/zone_helper.py | cea/datamanagement/zone_helper.py | """
This is a template script - an example of how a CEA script should be set up.
NOTE: ADD YOUR SCRIPT'S DOCUMENTATION HERE (what, why, include literature references)
"""
from __future__ import division
from __future__ import print_function
from geopandas import GeoDataFrame as Gdf
from cea.utilities.standardize_coor... | """
This is a template script - an example of how a CEA script should be set up.
NOTE: ADD YOUR SCRIPT'S DOCUMENTATION HERE (what, why, include literature references)
"""
from __future__ import division
from __future__ import print_function
from geopandas import GeoDataFrame as Gdf
from cea.utilities.standardize_coor... | mit | Python |
36052adefae95505e0932919356b56f30b8045ec | add #votefortay | AnilRedshift/votefortay,AnilRedshift/votefortay | plugins/tay.py | plugins/tay.py | from rtmbot.core import Plugin
bot_id = 'U3MSN806S'
header = '<@{}> '.format(bot_id)
responses = {
'hi': 'Nice to meet you, where you been?',
'who should i vote for?': 'Me, of course',
}
class Tay(Plugin):
def process_message(self, data):
print(data)
if data['text'].startswith(header):
... | from rtmbot.core import Plugin
bot_id = 'U3MSN806S'
header = '<@{}> '.format(bot_id)
responses = {
'hi': 'Nice to meet you, where you been?',
}
class Tay(Plugin):
def process_message(self, data):
print(data)
if data['text'].startswith(header):
message = data['text'][len(header):]... | mit | Python |
2eb03f81de6aae6807bb0e7a6032a8b7b1094d69 | Update __init__.py | google/jax-md,google/jax-md | jax_md/__init__.py | jax_md/__init__.py | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | Python |
5f56b2094180eb1b6922b58aece611e26ce5d1df | Fix event source for S3 put events | cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack,cardstack/cardstack | packages/reward-root-submitter/reward_root_submitter/lambda.py | packages/reward-root-submitter/reward_root_submitter/lambda.py | import logging
import urllib
import sentry_sdk
from cloudpathlib import AnyPath
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
from .config import Config
from .main import get_all_unsubmitted_roots, process_file, setup_logging
config = Config()
setup_logging(config)
sentry_sdk.init(
dsn=con... | import logging
import urllib
import sentry_sdk
from cloudpathlib import AnyPath
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
from .config import Config
from .main import get_all_unsubmitted_roots, process_file, setup_logging
config = Config()
setup_logging(config)
sentry_sdk.init(
dsn=con... | mit | Python |
83324c62d9ebbc7dd2010cc3faf391e4654bd02c | add function//still empty one... | Baaaaam/CYCLUS2FCO | cyclus2fco.py | cyclus2fco.py | #! /usr/bin/env python
from __future__ import print_function, unicode_literals
import sys
import subprocess
import io
import re
def read_input(input):
f = open(input, 'r')
matrix = []
for line in f:
print(line)
matrix.append(line)
return matrix
def read( parameters ):
print(paramters)
def recove... | #! /usr/bin/env python
from __future__ import print_function, unicode_literals
import sys
import subprocess
import io
import re
def read_input(input):
print(input)
def read( parameters ):
print(paramters)
#def write_outputfile():
def main():
output = "echo "
prog = 'cyan'
db = 'cyclus.sqlite'
cmd = ... | bsd-3-clause | Python |
3020523e0801f437efaa42f02c8a2d8d37be5522 | Use abslute path for cron to work | afabian80/weather-station,afabian80/weather-station | wunderground-weather.py | wunderground-weather.py | import time
import Adafruit_Nokia_LCD as LCD
import Adafruit_GPIO.SPI as SPI
import Image
import ImageDraw
import ImageFont
import subprocess
import json
import os
bigfontsize = 22
DC = 23
RST = 24
SPI_PORT = 0
SPI_DEVICE = 0
basedir = os.path.dirname(os.path.realpath(__file__))
subprocess.call([os.path.join(basedi... | import time
import Adafruit_Nokia_LCD as LCD
import Adafruit_GPIO.SPI as SPI
import Image
import ImageDraw
import ImageFont
import subprocess
import json
import os
bigfontsize = 22
DC = 23
RST = 24
SPI_PORT = 0
SPI_DEVICE = 0
basedir = os.path.dirname(os.path.realpath(__file__))
subprocess.call([os.path.join(basedi... | apache-2.0 | Python |
13ca5cf007f70220e5efd2ad5b4c3cf6e0c6e1c2 | use pkdlog instead of pkdp for msg | radiasoft/sirepo,mrakitin/sirepo,mrakitin/sirepo,mkeilman/sirepo,radiasoft/sirepo,mrakitin/sirepo,mkeilman/sirepo,mrakitin/sirepo,radiasoft/sirepo,radiasoft/sirepo,mkeilman/sirepo,radiasoft/sirepo,mkeilman/sirepo | sirepo/mpi.py | sirepo/mpi.py | # -*- coding: utf-8 -*-
"""Run Python processes in background
:copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkconfig
from pykern import pkio
from pyker... | # -*- coding: utf-8 -*-
"""Run Python processes in background
:copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkconfig
from pykern import pkio
from pyker... | apache-2.0 | Python |
1d9416c1d16a007c7ffed18918bef780b01ea131 | Fix some bugs in paramsweep.py | petebachant/UNH-RVAT-turbinesFoam,petebachant/UNH-RVAT-turbinesFoam | paramsweep.py | paramsweep.py | #!/usr/bin/env python
"""
Run multiple simulations varying a single parameter.
"""
import foampy
from foampy.dictionaries import replace_value
import numpy as np
from subprocess import call
import os
import pandas as pd
from modules import processing as pr
def zero_tsr_fluc():
"""Set TSR fluctuation amplitude to... | #!/usr/bin/env python
"""
Run multiple simulations varying a single parameter.
"""
import foampy
from foampy.dictionaries import replace_single_line_value
import numpy as np
from subprocess import call
import os
import pandas as pd
from modules import processing as pr
def zero_tsr_fluc():
"""Set TSR fluctuation ... | mit | Python |
7fb1212ab97bca6301d9826258a594f8935bba28 | Change from Google TTS to Festival | 9and3r/mopidy-ttsgpio | mopidy_ttsgpio/tts.py | mopidy_ttsgpio/tts.py | import os
from threading import Thread
music_level = 30
class TTS():
def __init__(self, frontend, config):
self.frontend = frontend
def speak_text(self, text):
t = Thread(target=self.speak_text_thread, args=(text,))
t.start()
def speak_text_thread(self, text):
os.system... | import urllib
import gst
music_level = 30
class TTS():
def __init__(self, frontend, config):
self.frontend = frontend
self.player = gst.element_factory_make("playbin", "tts")
output = gst.parse_bin_from_description(config['audio']['output'],
... | apache-2.0 | Python |
6bd0963d7c4e5212fc9bec30b6588b2c309fa16b | Add tests for view for home, login, registration | jesseklein406/django-imager,jesseklein406/django-imager,jesseklein406/django-imager | imagersite/imagersite/tests.py | imagersite/imagersite/tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, Client
from django.contrib.auth.models import User
from imager_images import Photo
# from imager_profile.models import ImagerProfile
import factory
class UserFactory(factory.django.DjangoModelFacto... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, Client
from django.contrib.auth.models import User
from imager_images import Photo
# from imager_profile.models import ImagerProfile
import factory
class UserFactory(factory.django.DjangoModelFacto... | mit | Python |
2d5ab74091aec0a6a7192345f3bce018a9ec34b6 | fix download_story example | instagrambot/instabot,ohld/instabot,instagrambot/instabot | examples/download_stories.py | examples/download_stories.py | import os
import sys
import argparse
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot
parser = argparse.ArgumentParser(add_help=True)
parser.add_argument('-u', type=str, help="username")
parser.add_argument('-p', type=str, help="password")
parser.add_argument('-story_username', type=str, hel... | import os
import sys
import argparse
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot
parser = argparse.ArgumentParser(add_help=True)
parser.add_argument('username', type=str, help='@username')
parser.add_argument('-story_username', type=str, help='story_username')
args = parser.parse_args()... | apache-2.0 | Python |
7430eba323fbdbf0821d45d57b676c739f61aef0 | Add plot titles and newstyle plt import in OLS vs Ridge example | frank-tancf/scikit-learn,xiaoxiamii/scikit-learn,IshankGulati/scikit-learn,chrisburr/scikit-learn,mugizico/scikit-learn,sinhrks/scikit-learn,xubenben/scikit-learn,elkingtonmcb/scikit-learn,glemaitre/scikit-learn,murali-munna/scikit-learn,bhargav/scikit-learn,kagayakidan/scikit-learn,liyu1990/sklearn,jmschrei/scikit-lea... | examples/linear_model/plot_ols_ridge_variance.py | examples/linear_model/plot_ols_ridge_variance.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause | Python |
9ca9f798db9c7980eb28ad2099a067df4d08b1cc | Use checktime when reloading vim buffer after applying clang-rename | llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra | clang-rename/tool/clang-rename.py | clang-rename/tool/clang-rename.py | '''
Minimal clang-rename integration with Vim.
Before installing make sure one of the following is satisfied:
* clang-rename is in your PATH
* `g:clang_rename_path` in ~/.vimrc points to valid clang-rename executable
* `binary` in clang-rename.py points to valid to clang-rename executable
To install, simply put this... | '''
Minimal clang-rename integration with Vim.
Before installing make sure one of the following is satisfied:
* clang-rename is in your PATH
* `g:clang_rename_path` in ~/.vimrc points to valid clang-rename executable
* `binary` in clang-rename.py points to valid to clang-rename executable
To install, simply put this... | apache-2.0 | Python |
6da0aaf77fe221286981b94eaf7d304568f55957 | Update imports for MovieLister standrard module | rmk135/objects,ets-labs/python-dependency-injector,ets-labs/dependency_injector,rmk135/dependency_injector | examples/stories/movie_lister/movies/__init__.py | examples/stories/movie_lister/movies/__init__.py | """Movies package.
Top-level package of movies library. This package contains catalog of movies
module components - ``MoviesModule``. It is recommended to use movies library
functionality by fetching required instances from ``MoviesModule`` providers.
Each of ``MoviesModule`` providers could be overridden.
"""
from ... | """Movies package.
Top-level package of movies library. This package contains catalog of movies
module components - ``MoviesModule``. It is recommended to use movies library
functionality by fetching required instances from ``MoviesModule`` providers.
Each of ``MoviesModule`` providers could be overridden.
"""
from ... | bsd-3-clause | Python |
e00692777713e0001ea802cc06f6c5b4a81c2342 | complete Project model | cytomine/Cytomine-python-client,cytomine/Cytomine-python-client | client/cytomine/models/project.py | client/cytomine/models/project.py | # -*- coding: utf-8 -*-
# * Copyright (c) 2009-2015. Authors: see NOTICE file.
# *
# * 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... | # -*- coding: utf-8 -*-
# * Copyright (c) 2009-2015. Authors: see NOTICE file.
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0... | apache-2.0 | Python |
ba012434cf46ac2327896fe6aec7c6ea236d3520 | Resolve name shadowing conflict. | gregoiresage/pebble-tool,pebble/pebble-tool,pebble/pebble-tool,gregoiresage/pebble-tool,gregoiresage/pebble-tool,gregoiresage/pebble-tool,pebble/pebble-tool,pebble/pebble-tool | pebble_tool/sdk/__init__.py | pebble_tool/sdk/__init__.py | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import os
import subprocess
from pebble_tool.exceptions import MissingSDK
from pebble_tool.util import get_persist_dir
from .manager import SDKManager
pebble_platforms = ('aplite', 'basalt', 'chalk')
SDK_VERSION = '3'
def sdk_path():
... | from __future__ import absolute_import, print_function
__author__ = 'katharine'
import os
import subprocess
from pebble_tool.exceptions import MissingSDK
from pebble_tool.util import get_persist_dir
from .manager import SDKManager
pebble_platforms = ('aplite', 'basalt', 'chalk')
SDK_VERSION = '3'
def sdk_path():
... | mit | Python |
75d52ec7b0601ef2df16d19573958dcfeff47ed8 | bump version | MacHu-GWU/uszipcode-project,MacHu-GWU/uszipcode-project | uszipcode/_version.py | uszipcode/_version.py | __version__ = "0.2.5"
if __name__ == "__main__": # pragma: no cover
print(__version__)
| __version__ = "0.2.4"
if __name__ == "__main__": # pragma: no cover
print(__version__)
| mit | Python |
8b18834aa1a250876d5e65f733426a6d2ababd17 | update wait time | kyunooh/JellyBlog,kyunooh/JellyBlog,kyunooh/JellyBlog | jellyblog/tests.py | jellyblog/tests.py | from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test import TestCase
from django.test.testcases import LiveServerTestCase
from selenium import webdriver
from jellyblog.views import index
from .models import Category, Note, Document
class NoteViewTest(LiveServerTestCase):
... | from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test import TestCase
from django.test.testcases import LiveServerTestCase
from selenium import webdriver
from jellyblog.views import index
from .models import Category, Note, Document
class NoteViewTest(LiveServerTestCase):
... | apache-2.0 | Python |
2faa1c2d567d92e6885b9ba388b6aaf3d6add17a | Add preference support | yacchin1205/pepper-fluent-logger | fluentlogger/fluentlogger.py | fluentlogger/fluentlogger.py | # -*- coding: utf-8 -*-
import sys
import qi
import random
import threading
from fluent import sender
from fluent import event
PREF_DOMAIN = 'com.github.yacchin1205.fluentlogger'
class FluentLoggerService:
def __init__(self, session):
self.session = session
self.lock = threading.RLock()
se... | # -*- coding: utf-8 -*-
import sys
import qi
import random
import threading
from fluent import sender
from fluent import event
class FluentLoggerService:
def __init__(self):
self.lock = threading.RLock()
self.running = False
def start(self):
with self.lock:
if self.... | mit | Python |
8c3918c38e9618c67f9996af1186d1eaa97d26b8 | add explicit decode | yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/yunity-core | foodsaving/stores/tests/test_notifications.py | foodsaving/stores/tests/test_notifications.py | import json
import responses
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from rest_framework.test import APITestCase
from foodsaving.groups.factories import GroupFactory
from foodsaving.stores.factories import StoreFactory, PickupDateFactory
from foodsaving.users.factories impor... | import json
import responses
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from rest_framework.test import APITestCase
from foodsaving.groups.factories import GroupFactory
from foodsaving.stores.factories import StoreFactory, PickupDateFactory
from foodsaving.users.factories impor... | agpl-3.0 | Python |
4f502980a6338944f4807f2ea7b05bf374b3417c | remove old liquidity formula | christophergandrud/ela_fiscal_costs,christophergandrud/ela_fiscal_costs | formal_modelling/ela_balance_sheet_effects.py | formal_modelling/ela_balance_sheet_effects.py | # Find simplified formula for bank balance sheet change as a result of
# ELA collateral seizure
# Christopher Gandrud
# MIT License
################################################################################
# Import SymPy
import sympy as sp
from sympy.abc import eta, gamma
# Define symbols (eta and gamma import... | # Find simplified formula for bank balance sheet change as a result of
# ELA collateral seizure
# Christopher Gandrud
# MIT License
################################################################################
# Import SymPy
import sympy as sp
from sympy.abc import eta, gamma
# Define symbols (eta and gamma import... | mit | Python |
761d427f3b9a35c40fe76f4068cc0ac44b25d776 | remove Timer and DotManager classes | ucb-sejits/ctree,ucb-sejits/ctree,mbdriscoll/ctree | ctree/util.py | ctree/util.py | __author__ = 'Chick Markley'
def singleton(cls):
instance = cls()
instance.__call__ = lambda: instance
return instance
| __author__ = 'Chick Markley'
import sys
import ast
import math
import time
def singleton(cls):
instance = cls()
instance.__call__ = lambda: instance
return instance
class Timer(object):
"""
Context manager for timing sections of code.
"""
class _stopwatch(object):
"""
T... | bsd-2-clause | Python |
15b770e223e35ee2647284617741ab8f34080a63 | Add VERSION_TUPLE and VERSION | BuzzFeedNews/namestand | namestand/__init__.py | namestand/__init__.py | from namestand.converters import *
from namestand.utils import *
from namestand import patterns
VERSION_TUPLE = (0, 0, 0)
VERSION = ".".join(map(str, VERSION_TUPLE))
| from namestand.converters import *
from namestand.utils import *
from namestand import patterns
| mit | Python |
de66211afbc994a0687fb387ab0ba68c20f34be0 | Set theano as default backend for windows users (#3831) | keras-team/keras,dolaameng/keras,keras-team/keras | keras/backend/__init__.py | keras/backend/__init__.py | from __future__ import absolute_import
from __future__ import print_function
import os
import json
import sys
from .common import epsilon
from .common import floatx
from .common import set_epsilon
from .common import set_floatx
from .common import get_uid
from .common import cast_to_floatx
from .common import image_dim... | from __future__ import absolute_import
from __future__ import print_function
import os
import json
import sys
from .common import epsilon
from .common import floatx
from .common import set_epsilon
from .common import set_floatx
from .common import get_uid
from .common import cast_to_floatx
from .common import image_dim... | apache-2.0 | Python |
ac255dabf9d812657354cd4bdc35e98004d48cf5 | Add relay for Quay.io | pristineio/lambda-webhook | lambdawebhook/hook.py | lambdawebhook/hook.py | #!/usr/bin/env python
import os
import sys
import hashlib
import hmac
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secret), pay... | #!/usr/bin/env python
import os
import sys
import hashlib
import hmac
# Add the lib directory to the path for Lambda to load our libs
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
import requests # NOQA
def verify_signature(secret, signature, payload):
computed_hash = hmac.new(str(secret), pay... | bsd-3-clause | Python |
bb62ec3971db23a9918d608a9867d1bd0cc99899 | bump version | ZettelGeist/zettelgeist,ZettelGeist/zettelgeist,ZettelGeist/zettelgeist | zettelgeist/zversion.py | zettelgeist/zversion.py | #
# ZettelGeist Version for Python
#
__version__ = "1.1.4"
def version():
return __version__
| #
# ZettelGeist Version for Python
#
__version__ = "1.1.3"
def version():
return __version__
| apache-2.0 | Python |
82aa79ed968978074e865ddca084e1ae1830a4b7 | add backward compatibility coverage skip flag in secure_file_system_storage | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator_abstract/models/secure_file_system_storage.py | accelerator_abstract/models/secure_file_system_storage.py | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import base64
from django.core.files.storage import FileSystemStorage
from django.conf import settings
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # pragm... | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import base64
from django.core.files.storage import FileSystemStorage
from django.conf import settings
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
class ... | mit | Python |
9167d5e85d618d1786c8c72eb1eb0cb2f23a8043 | Fix typo in bucket name | alphagov/backdrop,alphagov/backdrop,alphagov/backdrop | backdrop/write/config/development_environment_sample.py | backdrop/write/config/development_environment_sample.py | # Copy this file to development_environment.py
# and replace OAuth credentials your dev credentials
TOKENS = {
'_foo_bucket': '_foo_bucket-bearer-token',
'bucket': 'bucket-bearer-token',
'foo': 'foo-bearer-token',
'foo_bucket': 'foo_bucket-bearer-token',
'licensing': 'licensing-bearer-token',
'l... | # Copy this file to development_environment.py
# and replace OAuth credentials your dev credentials
TOKENS = {
'_foo_bucket': '_foo_bucket-bearer-token',
'bucket': 'bucket-bearer-token',
'foo': 'foo-bearer-token',
'foo_bucket': 'foo_bucket-bearer-token',
'licensing': 'licensing-bearer-token',
'l... | mit | Python |
c41ebf32d3063e93bb18c597b1e8b275f0ce8719 | bump version | alexisbellido/django-zinibu-skeleton,alexisbellido/django-zinibu-skeleton | znbskeleton/__init__.py | znbskeleton/__init__.py | VERSION = (0, 0, 2, 'alpha', 0)
def get_version():
"""
Returns a PEP 386-compliant version number from VERSION.
"""
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre... | VERSION = (0, 0, 1, 'alpha', 0)
def get_version():
"""
Returns a PEP 386-compliant version number from VERSION.
"""
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre... | bsd-2-clause | Python |
6873ab19c083a17b68bc20350d26ad2452ec3d7a | remove one of the two softmask items in the doc | bmcfee/librosa,bmcfee/librosa,librosa/librosa,librosa/librosa,bmcfee/librosa | librosa/util/__init__.py | librosa/util/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities
=========
Array operations
----------------
.. autosummary::
:toctree: generated/
frame
pad_center
fix_length
fix_frames
index_to_slice
softmask
sync
axis_sort
normalize
roll_sparse
sparsify_rows
buf_to_f... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utilities
=========
Array operations
----------------
.. autosummary::
:toctree: generated/
frame
pad_center
fix_length
fix_frames
index_to_slice
softmask
sync
softmask
axis_sort
normalize
roll_sparse
sparsify_rows
... | isc | Python |
108b46f7bfc9af5271248f36bd5e3b7497cfe921 | Customize scripts to work with menu | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ibmcnx/test/loadFunction.py | ibmcnx/test/loadFunction.py | globdict = globals()
def loadFilesService():
global globdict
execfile("filesAdmin.py", globdict)
| def loadFilesService():
execfile("filesAdmin.py")
| apache-2.0 | Python |
b94b8e787c92ddb6a4ae51130de641bc069747b8 | Remove print() call | 11craft/immercv,11craft/immercv,11craft/immercv,11craft/immercv | immercv/cvgraph/commands.py | immercv/cvgraph/commands.py | from immercv.cvgraph.forms import form_for_node_properties
from immercv.cvgraph.models import editable_params, get_by_id, Person, Note
COMMAND_FUNCTIONS = {
# Created via application of `command` decorator.
#
# (labels, operation, relationship_name): update-function,
}
def apply_command(request, propert... | from immercv.cvgraph.forms import form_for_node_properties
from immercv.cvgraph.models import editable_params, get_by_id, Person, Note
COMMAND_FUNCTIONS = {
# Created via application of `command` decorator.
#
# (labels, operation, relationship_name): update-function,
}
def apply_command(request, propert... | bsd-3-clause | Python |
9d21e7cc99b7f0562efed01b611c6bf26f7eb6f5 | Update Interactive Repy Console help URL | aaaaalbert/repy-doodles | interactive_repy_console.py | interactive_repy_console.py | """
interactive_repy_console.py --- an interactive RepyV2 console
Useful if you are tired of typing "from repyportability..." and
"add_dy_support..." into an interactive Python prompt over and over again.
Relevant Python docs:
* https://docs.python.org/2/library/code.html#code.interact
Thank you for the helpful hin... | """
interactive_repy.py --- an interactive RepyV2 console
Useful if you are tired of typing "from repyportability..." and
"add_dy_support..." into an interactive Python prompt over and over again.
Relevant Python docs:
* https://docs.python.org/2/library/code.html#code.interact
Thank you for the helpful hints:
* ht... | unlicense | Python |
255a75fc18231a82974c707509e2a5e6f626d297 | Reformat with black | uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot,uw-it-aca/pivot | pivot/context_processors.py | pivot/context_processors.py | # Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
def support_email(request):
return {"support_email": getattr(settings, "SUPPORT_EMAIL", "")}
def google_analytics(request):
ga_key = getattr(settings, "GOOGLE_ANALYTICS_KEY", False)
r... | # Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
def support_email(request):
return {'support_email': getattr(settings, 'SUPPORT_EMAIL', '')}
def google_analytics(request):
ga_key = getattr(settings, 'GOOGLE_ANALYTICS_KEY', False)
r... | apache-2.0 | Python |
21109c77ca293791f899717b400beaec6f0e08ba | Remove RunTestsForChromeOS. | sahiljain/catapult,benschmaus/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,benschmaus/catapult,benschmaus/catapult,SummerLW/Perf-Insight-Report,benschmaus/catapult,Summ... | telemetry/telemetry/testing/run_chromeos_tests.py | telemetry/telemetry/testing/run_chromeos_tests.py | # Copyright 2014 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.
import logging
from telemetry.testing import run_tests
def RunChromeOSTests(browser_type, tests_to_run):
""" Run ChromeOS tests.
Args:
|browser_typ... | # Copyright 2014 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.
import logging
import os
from telemetry.core import util
from telemetry.testing import run_tests
def RunChromeOSTests(browser_type, tests_to_run):
""" Ru... | bsd-3-clause | Python |
7cca09dbd752541597e2adda1d18f795fe8908db | Fix py3 TypeError during hashing (#558) | leapp-to/prototype,leapp-to/prototype,leapp-to/prototype,leapp-to/prototype | leapp/utils/report.py | leapp/utils/report.py | import hashlib
import json
from leapp.reporting import Remediation
from leapp.utils.audit import get_messages
def fetch_upgrade_report_messages(context_id):
"""
:param context_id: ID to identify the needed messages
:type context_id: str
:return: All upgrade messages of type "Report" withing the given... | import hashlib
import json
from leapp.reporting import Remediation
from leapp.utils.audit import get_messages
def fetch_upgrade_report_messages(context_id):
"""
:param context_id: ID to identify the needed messages
:type context_id: str
:return: All upgrade messages of type "Report" withing the given... | lgpl-2.1 | Python |
91bd7690c1e48b52a270bc45626e771663828c28 | Fix PactGroup created log message | vmalloc/pact | pact/group.py | pact/group.py | from .base import PactBase
from .utils import GroupWaitPredicate
class PactGroup(PactBase):
def __init__(self, pacts):
self._pacts = list(pacts)
super(PactGroup, self).__init__()
def __iadd__(self, other):
self._pacts.append(other)
return self
def _is_finished(self):
... | from .base import PactBase
from .utils import GroupWaitPredicate
class PactGroup(PactBase):
def __init__(self, pacts):
super(PactGroup, self).__init__()
self._pacts = list(pacts)
def __iadd__(self, other):
self._pacts.append(other)
return self
def _is_finished(self):
... | bsd-3-clause | Python |
85931667c7bf01c371d31bd842fefe692fdf1676 | fix api.views.participants | leprikon-cz/leprikon,leprikon-cz/leprikon,leprikon-cz/leprikon,leprikon-cz/leprikon | leprikon/api/views.py | leprikon/api/views.py | from datetime import date, datetime
import pytz
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.utils.timezone import localdate
from ..models.subjects import Subject
from ..views import leader_or_staff_required
@leader_or_staff_required
def participants(request, subje... | from datetime import date, datetime
import pytz
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.utils.timezone import localdate
from ..models.subjects import Subject
from ..views import leader_or_staff_required
@leader_or_staff_required
def participants(request, subje... | bsd-3-clause | Python |
825b2bb27f6c0cc628bd4c1dec097b82e6db8865 | update structure | FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE | python/federatedml/model_interpret/explainer/explainer_base.py | python/federatedml/model_interpret/explainer/explainer_base.py | import numpy as np
from federatedml.util import consts
def data_inst_table_to_arr(data_inst, take_num=500):
take_rs = data_inst.take(take_num)
header = data_inst.schema['header']
ids = []
data_list = []
for id_, inst in take_rs:
ids.append(id_)
data_list.append(inst.features)
... | import numpy as np
from federatedml.util import consts
def data_inst_table_to_arr(data_inst, take_num=500):
take_rs = data_inst.take(take_num)
header = data_inst.schema['header']
ids = []
data_list = []
for id_, inst in take_rs:
ids.append(id_)
data_list.append(inst.features)
d... | apache-2.0 | Python |
6db1ddd9c7776cf07222ae58dc9b2c44135ac59a | Raise ValueError for narrow unicode build | explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy | spacy/__init__.py | spacy/__init__.py | # coding: utf8
from __future__ import unicode_literals
import warnings
import sys
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
# These are imported as part of the API
from thinc.neural.util import prefer_gpu, require_gpu
f... | # coding: utf8
from __future__ import unicode_literals
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
# These are imported as part of the API
from thinc.neural.util import prefer_gpu, require_gpu
from .cli.in... | mit | Python |
094e99f8a1f94622e1046944555f89bac3517fbf | fix pip8 | FingerLiu/flask-wtf-storage | flask_wtf_storage/widgets.py | flask_wtf_storage/widgets.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections.abc import Iterable
from wtforms.widgets import html_params, HTMLString
class FileDisplayWidget(object):
html_params = staticmethod(html_params)
def __init__(self, input_type='string', text=''):
self.input_type = input_type
self.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections.abc import Iterable
from wtforms.widgets import html_params, HTMLString
class FileDisplayWidget(object):
html_params = staticmethod(html_params)
def __init__(self, input_type='string', text=''):
self.input_type = input_type
self.... | mit | Python |
76c12da6c78d8f90ef941c42146e2d61b60a1718 | Handle the lack of error or success from github redirect URI | CocoaPods/sotu.cocoapods.org,CocoaPods/sotu.cocoapods.org | sotu/views.py | sotu/views.py | from rivr.http import ResponseRedirect
from rivr_jinja import JinjaView, JinjaResponse
from sotu.github import *
from sotu.models import Entrant
class IndexView(JinjaView):
template_name = 'index.html'
def get_context_data(self, **kwargs):
parameters = {
'client_id': GITHUB_CLIENT_ID,
... | from rivr.http import ResponseRedirect
from rivr_jinja import JinjaView, JinjaResponse
from sotu.github import *
from sotu.models import Entrant
class IndexView(JinjaView):
template_name = 'index.html'
def get_context_data(self, **kwargs):
parameters = {
'client_id': GITHUB_CLIENT_ID,
... | mit | Python |
5bda1bb85b3a6357f4e88b38ea1e3581c930aad7 | Remove rogue print | kalail/gutter,kalail/gutter,disqus/gutter,kalail/gutter,disqus/gutter | gargoyle/inputs/arguments.py | gargoyle/inputs/arguments.py | import random
class Base(object):
def __proxy_to_value_method(method):
def func(self, *args, **kwargs):
if hasattr(self, 'value'):
return getattr(self.value, method)(*args, **kwargs)
else:
raise NotImplementedError
return func
__lt__ =... | import random
class Base(object):
def __proxy_to_value_method(method):
def func(self, *args, **kwargs):
if hasattr(self, 'value'):
return getattr(self.value, method)(*args, **kwargs)
else:
raise NotImplementedError
return func
__lt__ =... | apache-2.0 | Python |
d423e5329e5e5d8f3e65fa16ccfcb75e30362c9f | Fix test for cloud_init datasource (#3125) | RedHatInsights/insights-core,RedHatInsights/insights-core | insights/tests/datasources/test_cloud_init.py | insights/tests/datasources/test_cloud_init.py | import json
import pytest
from mock.mock import Mock
from insights.core.dr import SkipComponent
from insights.core.spec_factory import DatasourceProvider
from insights.specs.datasources.cloud_init import cloud_cfg, LocalSpecs
CLOUD_CFG = """
users:
- name: demo
ssh-authorized-keys:
- key_one
- key_t... | import json
import pytest
from insights.core.dr import SkipComponent
from insights.core.spec_factory import DatasourceProvider, simple_file
from insights.specs.datasources.cloud_init import cloud_cfg, LocalSpecs
CLOUD_CFG = """
users:
- name: demo
ssh-authorized-keys:
- key_one
- key_two
network:
... | apache-2.0 | Python |
1ad59e0d2c66f89e9e6868e06bfd9ede605a9099 | bump version | Infinidat/infi.pyutils | infi/pyutils/__version__.py | infi/pyutils/__version__.py | __version__ = "0.0.25"
| __version__ = "0.0.24"
| bsd-3-clause | Python |
e5fa86b477ea576c8be7b311482aa52f23202216 | use H5mono pump, optionally | tamasgal/km3pipe,tamasgal/km3pipe | km3pipe/utils/h5concat.py | km3pipe/utils/h5concat.py | # coding=utf-8
# Filename: h5concat.py
"""
Convert ROOT and EVT files to HDF5.
Usage:
h5concat [--verbose] [--ignore-id] OUTFILE INFILES...
h5concat (-h | --help)
h5concat --version
Options:
-h --help Show this screen.
--verbose Print out more progress. [default: False]... | # coding=utf-8
# Filename: h5concat.py
"""
Convert ROOT and EVT files to HDF5.
Usage:
h5concat [--verbose] OUTFILE INFILES...
h5concat (-h | --help)
h5concat --version
Options:
-h --help Show this screen.
--verbose Print out more progress. [default: False].
"""
from __... | mit | Python |
79a4dd82ad0f727031371b8046eff7d417565d95 | Refactor tests to separate assertions out a bit | opencorato/sayit,opencorato/sayit,opencorato/sayit,opencorato/sayit | speeches/tests.py | speeches/tests.py | """
Testing of the speeches app.
Testing documentation is at https://docs.djangoproject.com/en/1.4/topics/testing/
"""
from selenium import webdriver
from django.test import TestCase, LiveServerTestCase
from speeches.models import Speech, Speaker
class SpeechTest(TestCase):
def test_add_speech_page_exists(self)... | """
Testing of the speeches app.
Testing documentation is at https://docs.djangoproject.com/en/1.4/topics/testing/
"""
from selenium import webdriver
from django.test import TestCase, LiveServerTestCase
from speeches.models import Speech, Speaker
class SpeechTest(TestCase):
def test_add_speech(self):
# ... | agpl-3.0 | Python |
403a39e23b1c82e204bc52e22d0eb1bf7c149618 | Print error message | tamasgal/km3pipe,tamasgal/km3pipe | km3pipe/utils/pushover.py | km3pipe/utils/pushover.py | # coding=utf-8
# Filename: tohdf5.py
"""
Send a push message to a device using Pushover.net API.
Usage:
pushover MESSAGE...
pushover (-h | --help)
pushover --version
Options:
MESSAGE The message to send.
-h --help Show this screen.
"""
from __future__ import division, absolute_import, print... | # coding=utf-8
# Filename: tohdf5.py
"""
Send a push message to a device using Pushover.net API.
Usage:
pushover MESSAGE...
pushover (-h | --help)
pushover --version
Options:
MESSAGE The message to send.
-h --help Show this screen.
"""
from __future__ import division, absolute_import, print... | mit | Python |
ad4b6663a2de08fddc0ebef8a08e1f405c0cb80a | Add extension_modueles to the default configuration | SS-RD/pkgcmp | pkgcmp/cli.py | pkgcmp/cli.py | '''
Parse CLI options
'''
# Import python libs
import os
import copy
import argparse
# Import pkgcmp libs
import pkgcmp.scan
# Import third party libs
import yaml
DEFAULTS = {'cachedir': '/var/cache/pkgcmp',
'extension_modules': ''}
def parse():
'''
Parse!!
'''
parser = argparse.ArgumentP... | '''
Parse CLI options
'''
# Import python libs
import os
import copy
import argparse
# Import pkgcmp libs
import pkgcmp.scan
# Import third party libs
import yaml
DEFAULTS = {'cachedir': '/var/cache/pkgcmp'}
def parse():
'''
Parse!!
'''
parser = argparse.ArgumentParser(description='The pkgcmp map gen... | apache-2.0 | Python |
7a641d417d93e1e0c5e972c0cc9fa4afa7ab3175 | update logger formatter | alone-walker/BlogSpider,wartalker/BlogSpider,wartalker/BlogSpider,hack4code/BlogSpider,alone-walker/BlogSpider,hack4code/BlogSpider,hack4code/BlogSpider,alone-walker/BlogSpider,wartalker/BlogSpider,hack4code/BlogSpider,alone-walker/BlogSpider,wartalker/BlogSpider | spider/rpc.py | spider/rpc.py | import logging
import sys
import time
import json
from multiprocessing import Process
import pika
from scrapy.utils.project import get_project_settings
from task import crawl, gen_lxmlspider, gen_blogspider
settings = get_project_settings()
def run(ch, method, properties, body):
args = json.loads(body)['spid... | import logging
import sys
import time
import json
from multiprocessing import Process
import pika
from scrapy.utils.project import get_project_settings
from task import crawl, gen_lxmlspider, gen_blogspider
settings = get_project_settings()
def run(ch, method, properties, body):
args = json.loads(body)['spid... | mit | Python |
595b5c9d7180adbd312c17d51084bebb8914ca1e | Fix token that was not renamed. | conda-forge/conda-forge-webservices,conda-forge/conda-forge-webservices | conda_forge_webservices/status.py | conda_forge_webservices/status.py | import os
import subprocess
def update(token=None):
if token is None:
token = os.environ["STATUS_GH_TOKEN"]
subprocess.check_call([
"statuspage",
"update",
"--org",
"conda-forge",
"--name",
"status",
"--token",
token
])
def main():
... | import os
import subprocess
def update(token=None):
if token is None:
token = os.environ["STATUS_GH_TOKEN"]
subprocess.check_call([
"statuspage",
"update",
"--org",
"conda-forge",
"--name",
"status",
"--token",
token
])
def main():
... | bsd-3-clause | Python |
3e6ee938adef190e9131ecd88689ae5711217b32 | bump version to 0.6.0 | PaulKlumpp/jenkins-autojobs,ptnapoleon/jenkins-autojobs,PaulKlumpp/jenkins-autojobs,gvalkov/jenkins-autojobs,gvalkov/jenkins-autojobs,ptnapoleon/jenkins-autojobs | jenkins_autojobs/version.py | jenkins_autojobs/version.py | #!/usr/bin/env python
# encoding: utf-8
'''
Version information constants and auxiliary functions.
'''
VERSION = (0, 6, 0)
import os
import subprocess as sub
__here__ = os.path.abspath(os.path.dirname(__file__))
def _check_output(*cmd):
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE, cwd=__here__)
... | #!/usr/bin/env python
# encoding: utf-8
'''
Version information constants and auxiliary functions.
'''
VERSION = (0, 5, 0)
import os
import subprocess as sub
__here__ = os.path.abspath(os.path.dirname(__file__))
def _check_output(*cmd):
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE, cwd=__here__)
... | bsd-3-clause | Python |
a3beacc34b4dfc4ccdac06fca6bfe38b1d451860 | Correct bugs | rlouf/patterns-of-segregation | bin/data_prep/extract_shape_msa.py | bin/data_prep/extract_shape_msa.py | """extract_shape_msa.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/crosswalks/msa_blockgroup.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
reader.nex... | """extract_shape_msa.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/crosswalks/msa_blockgroup.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
reader.nex... | bsd-3-clause | Python |
ecc101a28357bfb1f44f63ca6d36d056e2a02339 | Fix testConsoleOutputStream failure | benschmaus/catapult,catapult-project/catapult-csm,benschmaus/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,benschmaus/catapult,benschmaus/catapult,sahiljain/catapult,catapult-project/catapult-csm,sahiljain/catapult,sahiljain/catap... | telemetry/telemetry/core/chrome/inspector_console_unittest.py | telemetry/telemetry/core/chrome/inspector_console_unittest.py | # 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.
import os
import re
import StringIO
from telemetry.core import util
from telemetry.test import tab_test_case
class TabConsoleTest(tab_test_case.TabTestC... | # 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.
import os
import re
import StringIO
from telemetry.core import util
from telemetry.test import tab_test_case
class TabConsoleTest(tab_test_case.TabTestC... | bsd-3-clause | Python |
122031805a58a137245b100c8a83399b4e7c6708 | update version to include LTI changes | edx/xblock-lti-consumer,edx/xblock-lti-consumer,edx/xblock-lti-consumer,edx/xblock-lti-consumer | lti_consumer/__init__.py | lti_consumer/__init__.py | """
Runtime will load the XBlock class from here.
"""
from .lti_xblock import LtiConsumerXBlock
from .apps import LTIConsumerApp
__version__ = '3.1.1'
| """
Runtime will load the XBlock class from here.
"""
from .lti_xblock import LtiConsumerXBlock
from .apps import LTIConsumerApp
__version__ = '3.1.0'
| agpl-3.0 | Python |
a3f832cae8d48157f6dbdb4c68b4a9eee1afa625 | fix test on sourcing percentage | mdietrichc2c/vertical-ngo,jorsea/vertical-ngo,yvaucher/vertical-ngo,jorsea/vertical-ngo | logistic_requisition/tests/test_sourcing_percentage.py | logistic_requisition/tests/test_sourcing_percentage.py | # Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | # Author: Leonardo Pistone
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... | agpl-3.0 | Python |
dd031402ac37629581edb3eb0d8afac6df9ab164 | FIX flake8 | ecino/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,CompassionCH/compassion-modules,eicher31/compassion-modules,eicher31/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,eicher31/compassion-modules,CompassionCH/compassion-modules,ecino/compassion-modules,CompassionCH... | sponsorship_compassion/migrations/10.0.1.0.7/post-migration.py | sponsorship_compassion/migrations/10.0.1.0.7/post-migration.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Badoux <n.badoux@hotmail.com>
#
# The licence is in the file __manifest__... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Badoux <n.badoux@hotmail.com>
#
# The licence is in the file __manifest__... | agpl-3.0 | Python |
5719dc024b3a7c5860c781aa51ab3c8376bed0eb | Update for service changes. | Saturn/livestreamer,blxd/livestreamer,sbstp/streamlink,caorong/livestreamer,javiercantero/streamlink,hmit/livestreamer,wolftankk/livestreamer,gravyboat/streamlink,melmorabity/streamlink,fishscene/streamlink,lyhiving/livestreamer,bastimeyer/streamlink,gravyboat/streamlink,chhe/streamlink,Saturn/livestreamer,melmorabity/... | src/livestreamer/plugins/ilive.py | src/livestreamer/plugins/ilive.py | import re
from livestreamer.compat import urlparse
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import StreamMapper, http, validate
from livestreamer.stream import HLSStream, RTMPStream
CHANNEL_URL = "http://www.mobileonline.tv/channel.php"
_url_re = re.compile("http(s)?://(\w+\.)?streamlive.t... | import re
from operator import methodcaller
from livestreamer.compat import urlparse
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import RTMPStream
_url_re = re.compile("http(s)?://(\w+\.)?ilive.to/")
_rtmp_re = re.compile("""
\$.getJSON\("(?P... | bsd-2-clause | Python |
23f722fb7224f2b837ace0f6a210a3a683fb1fe7 | Stop overridding settings.py and local_settings.py | eHealthAfrica/formhub,ehealthafrica-ci/formhub,eHealthAfrica/formhub,ehealthafrica-ci/formhub,ehealthafrica-ci/formhub,ehealthafrica-ci/formhub,eHealthAfrica/formhub,eHealthAfrica/formhub | formhub/preset/production.py | formhub/preset/production.py | # this system uses structured settings.py as defined in http://www.slideshare.net/jacobian/the-best-and-worst-of-django
try:
from ..settings import *
except ImportError:
import sys, django
django.utils.six.reraise(RuntimeError, *sys.exc_info()[1:]) # use RuntimeError to extend the traceback
except:
ra... | # this system uses structured settings.py as defined in http://www.slideshare.net/jacobian/the-best-and-worst-of-django
try:
from ..settings import *
except ImportError:
import sys, django
django.utils.six.reraise(RuntimeError, *sys.exc_info()[1:]) # use RuntimeError to extend the traceback
except:
ra... | bsd-2-clause | Python |
39d0fd3724e6719f45f2f655750e0659d661c14d | create a reasonable wsgi config | bwootton/Dator,bwootton/Dator,bwootton/Dator,bwootton/Dator | dator/wsgi.py | dator/wsgi.py | """
WSGI config for ruenoor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
import sys
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | """
WSGI config for ruenoor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | mit | Python |
911a8f99898261f62ad09bbad5a0fe2eee8226e3 | address unzip chinese problems | hkutangyu/django_label_site,hkutangyu/django_label_site | label_app/views.py | label_app/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render, HttpResponse
from django.contrib.auth import authenticate
import json
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from django.views.decorators.csrf import csrf_exempt
import os
import shutil
LOGO_SAMP... | from django.shortcuts import render, HttpResponse
from django.contrib.auth import authenticate
import json
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
from django.views.decorators.csrf import csrf_exempt
import os
import shutil
LOGO_SAMPLES_FOLDER = '/home/tangy... | mit | Python |
94fd7ce8452535ba3b76cceb1ff977842bca0d8d | allow SpecsParser to accept dict or filepath | kaczmarj/neurodocker,kaczmarj/neurodocker | neurodocker/parser.py | neurodocker/parser.py | """Class to parse specifications for Dockerfile."""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import, division, print_function
from neurodocker import SUPPORTED_SOFTWARE
from neurodocker.utils import load_json
class SpecsParser(object):
"""Class to parse specifications for Docke... | """Class to parse specifications for Dockerfile."""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import, division, print_function
from neurodocker import SUPPORTED_SOFTWARE
from neurodocker.utils import load_json
class SpecsParser(object):
"""Class to parse specifications for Docke... | apache-2.0 | Python |
4817fb2ff9efb9be73275662f2e851163faa07eb | Add git_find() in addition to git_cat(). | dontnod/nimp | nimp/utilities/git.py | nimp/utilities/git.py | # -*- coding: utf-8 -*-
import os
import subprocess
from nimp.utilities.processes import *
from nimp.utilities.paths import *
def git_cat(path, repository, branch = 'master'):
p = subprocess.Popen('git archive --remote=%s %s %s | tar -xOf -' % (repository, branch, path),
shell = True, ... | # -*- coding: utf-8 -*-
import os
import subprocess
from nimp.utilities.processes import *
from nimp.utilities.paths import *
def git_cat(path, repository, branch = 'master'):
p = subprocess.Popen('git archive --remote=%s %s %s | tar -xOf -' % (repository, branch, path),
shell = True, ... | mit | Python |
8f89e5aba8bfffdb059b7d4d64503cdb5ba4d0f4 | Add grid to picnic | miyakogi/wdom,miyakogi/wdom,miyakogi/wdom | wdom/themes/picnic.py | wdom/themes/picnic.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wdom.tag import NewTagClass as NewTag
from wdom.tag import *
css_files = [
'//cdn.jsdelivr.net/picnicss/5.1.0/picnic.min.css',
]
Button = NewTag('Button', bases=Button)
DefaultButton = NewTag('DefaultButton', 'button', Button)
PrimaryButton = NewTag('PrimaryBu... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wdom.tag import NewTagClass as NewTag
from wdom.tag import *
css_files = [
'//cdn.jsdelivr.net/picnicss/5.1.0/picnic.min.css',
]
Button = NewTag('Button', bases=Button)
DefaultButton = NewTag('DefaultButton', 'button', Button)
PrimaryButton = NewTag('PrimaryBu... | mit | Python |
da7b9593d3e519a0bbbfb2335cc162b16d5fc9a5 | Fix gsutil throttling doc typos | ttiurani/gsutil,mattdr/gsutil,BrandonY/gsutil,GoogleCloudPlatform/gsutil,fishjord/gsutil,dimfeld/gsutil,chriskuehl/gsutil-debian,GoogleCloudPlatform/gsutil,dtjackson/gsutil | gslib/addlhelp/throttling.py | gslib/addlhelp/throttling.py | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 | Python |
64103b20b371602ff98bf5cd60139e5a48833859 | add function list. | oopsmonk/pyWebMOC,oopsmonk/pyWebMOC | pyWebMOC.py | pyWebMOC.py | #!/usr/bin/env python
# Static Routes http://stackoverflow.com/questions/10486224/bottle-static-files
from bottle import route, static_file, debug, run, get, view, redirect
from bottle import post, request, response
import os, inspect, json
import moc
#enable bottle debug
debug(True)
# WebApp route path
routePath =... | #!/usr/bin/env python
# Static Routes http://stackoverflow.com/questions/10486224/bottle-static-files
from bottle import route, static_file, debug, run, get, view, redirect
from bottle import post, request, response
import os, inspect, json
#enable bottle debug
debug(True)
# WebApp route path
routePath = '/pyWebMOC... | mit | Python |
a6f04833afff3b8b2c4080538365aadcf1fb95e7 | Fix points earned policy for the first sequence non-problem item (#156) | harvard-vpal/bridge-adaptivity,harvard-vpal/bridge-adaptivity,harvard-vpal/bridge-adaptivity,harvard-vpal/bridge-adaptivity | bridge_adaptivity/module/policies/policy_points_earned.py | bridge_adaptivity/module/policies/policy_points_earned.py | from django.db.models.aggregates import Count, Sum
from .base import BaseGradingPolicy
class PointsEarnedGradingPolicy(BaseGradingPolicy):
"""Grading policy class calculate grade based upon users earned points."""
public_name = 'Points earned'
require = {
'threshold': True
}
summary_tex... | from django.db.models.aggregates import Count, Sum
from .base import BaseGradingPolicy
class PointsEarnedGradingPolicy(BaseGradingPolicy):
"""Grading policy class calculate grade based upon users earned points."""
public_name = 'Points earned'
require = {
'threshold': True
}
summary_tex... | bsd-3-clause | Python |
a35f63a3f92757a9fc05fc02e93c1405df17d144 | Simplify Github issues search by using the search API | akosthekiss/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator | fuzzinator/tracker/github.py | fuzzinator/tracker/github.py | # Copyright (c) 2016-2019 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
try:
# FIXME: very nasty, but a recent PyGithub version began ... | # Copyright (c) 2016-2019 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
try:
# FIXME: very nasty, but a recent PyGithub version began ... | bsd-3-clause | Python |
ef744829e3ef450bc80e54d132d4130391222169 | remove quota as it's difficult to handle for the moment | tumluliu/rap | rap/base.py | rap/base.py | """Base routing service class"""
import requests
from cachecontrol import CacheControl
from . import __version__
from . import errors
def Session():
"""Returns an HTTP session.
"""
session = requests.Session()
session.headers.update({
'User-Agent': 'rap/{0} {1}'.format(__version__,
... | """Base routing service class"""
import requests
from cachecontrol import CacheControl
from . import __version__
from . import errors
def Session():
"""Returns an HTTP session.
"""
session = requests.Session()
session.headers.update({
'User-Agent': 'rap/{0} {1}'.format(__version__,
... | mit | Python |
a25cf164268387ee0a195d8759a1dcaec6c69579 | Fix inccorect open path | Korovasoft/Regional,Korovasoft/Regional,Korovasoft/Regional | regional.py | regional.py | #!/usr/bin/env python3
import re
from sys import argv
comment_symbols = {'cpp': '//', 'py': '#', 'rb': '#', 'tex': '%'}
filename = argv[1].split("/")[-1]
basename, extension = filename.split(".")
comment_symbol = comment_symbols[extension]
# define states
RECORDING = 1
SEARCHING = 0
# define initial state
state = ... | #!/usr/bin/env python3
import re
from sys import argv
comment_symbols = {'cpp': '//', 'py': '#', 'rb': '#', 'tex': '%'}
filename = argv[1].split("/")[-1]
basename, extension = filename.split(".")
comment_symbol = comment_symbols[extension]
# define states
RECORDING = 1
SEARCHING = 0
# define initial state
state = ... | mit | Python |
9f5804fe39615067d6710819f6eb28aca053151a | Remove redundant Group declaration | amolenaar/gaphor,amolenaar/gaphor | gaphor/diagram/interfaces.py | gaphor/diagram/interfaces.py | """
This module describes the interfaces specific to the gaphor.diagram module.
These interfaces are:
- IConnect
Use to define adapters for connecting
- Editor
Text editor interface
"""
from functools import singledispatch
from gaphor.misc.generic.multidispatch import multidispatch
@singledispatch
def Edit... | """
This module describes the interfaces specific to the gaphor.diagram module.
These interfaces are:
- IConnect
Use to define adapters for connecting
- Editor
Text editor interface
"""
from functools import singledispatch
from gaphor.misc.generic.multidispatch import multidispatch
@singledispatch
def Edit... | lgpl-2.1 | Python |
f58fcb36cd730af61439ca2eda5be5e5a59de6dc | change odd | waytai/open,waytai/open,waytai/open,waytai/open,waytai/open,waytai/open,waytai/open | python/odd.py | python/odd.py | #########################################################################
#-*- coding:utf-8 -*-
# File Name: odd.py
#########################################################################
#!/bin/python
def is_odd(n):
return n % 2 == 1
odd = lambda n : n %2 == 1
print list(filter(is_odd, [1,2,3,4,5,6,7,8,9]))
p... | #########################################################################
#-*- coding:utf-8 -*-
# File Name: odd.py
#########################################################################
#!/bin/python
def is_odd(n):
return n % 2 == 1
print list(filter(is_odd, [1,2,3,4,5,6,7,8,9]))
| bsd-2-clause | Python |
19952d2c85dba982a25d7e7dbc4e543f9a4479cf | add helper util methods for get/creating tables and groups | ulmo-dev/ulmo-common | pyhis/util.py | pyhis/util.py | """
pyhis.util
~~~~~~~~~~
Collection of useful functions for common use cases
"""
import os
import appdirs
import pandas
import pyhis
#http://midgewater.twdb.state.tx.us/tpwd/soap/wateroneflow.wsdl
#http://midgewater.twdb.state.tx.us/tceq/soap/wateroneflow.wsdl
#http://midgewater.twdb.state.tx.us/cbi/soap... | """
pyhis.util
~~~~~~~~~~
Collection of useful functions for common use cases
"""
import os
import appdirs
import pandas
import pyhis
#http://midgewater.twdb.state.tx.us/tpwd/soap/wateroneflow.wsdl
#http://midgewater.twdb.state.tx.us/tceq/soap/wateroneflow.wsdl
#http://midgewater.twdb.state.tx.us/cbi/soap... | bsd-3-clause | Python |
c7a83691bfeff61e16cbfa688d7e9fc61cad9a77 | support pycryptodome | google/adiantum,google/adiantum,google/adiantum | python/aes.py | python/aes.py | # Copyright 2018 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
import Crypto.Cipher.AES
import cipher
class AES(cipher.Blockcipher):
def set_keylen(self, k):
self.choose_variant(lambda v: v["... | # Copyright 2018 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
import Crypto.Cipher.AES
import cipher
class AES(cipher.Blockcipher):
def set_keylen(self, k):
self.choose_variant(lambda v: v["... | mit | Python |
f640d8cafe7d974d99ab47e0da417fa65a3b2db0 | Update for version 1.7 of the slack plugin | asmundg/jenkins-jobs-slack,hayderimran7/jenkins-jobs-slack,jovandeginste/jenkins-jobs-mattermost,sunyi00/jenkins-jobs-slack | jenkins_jobs_slack/slack.py | jenkins_jobs_slack/slack.py | import xml.etree.ElementTree as XML
def slack_properties(parser, xml_parent, data):
"""yaml: slack
Example::
properties:
- slack:
notify-start: true
notify-success: true
notify-aborted: true
notify-notbuilt: true
notify-unstable: true... | import xml.etree.ElementTree as XML
def slack_properties(parser, xml_parent, data):
"""yaml: slack
Example::
properties:
- slack:
notify-start: true
notify-success: true
notify-aborted: true
notify-notbuilt: true
notify-unstable: true... | mit | Python |
d1ed5a7a8aadf4c3581b7f77fc2c61c43ab52b01 | Fix undo of PlatformPhysicsOperation after the SceneNode changes | ynotstartups/Wanhao,ad1217/Cura,derekhe/Cura,derekhe/Cura,senttech/Cura,DeskboxBrazil/Cura,fieldOfView/Cura,lo0ol/Ultimaker-Cura,DeskboxBrazil/Cura,markwal/Cura,totalretribution/Cura,senttech/Cura,hmflash/Cura,bq/Ultimaker-Cura,quillford/Cura,fxtentacle/Cura,Curahelper/Cura,Curahelper/Cura,ynotstartups/Wanhao,bq/Ultima... | PlatformPhysicsOperation.py | PlatformPhysicsOperation.py | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | from UM.Operations.Operation import Operation
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.TranslateOperation import TranslateOperation
from UM.Operations.GroupedOperation import GroupedOperation
## A specialised operation designed specifically to modify the previous operat... | agpl-3.0 | Python |
ffa266d37b1587775324b7707cb29f68085a2b47 | Bump version | CompassionCH/l10n-switzerland,CompassionCH/l10n-switzerland | l10n_ch_zip/__manifest__.py | l10n_ch_zip/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright 2011-2017 Camptocamp SA
# Copyright 2014 Olivier Jossen (brain-tec AG)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Switzerland - Postal codes (ZIP) list',
'version': '10.0.1.0.1',
'author': '''
Camptocamp,
brain-tec AG,
... | # -*- coding: utf-8 -*-
# Copyright 2011-2017 Camptocamp SA
# Copyright 2014 Olivier Jossen (brain-tec AG)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Switzerland - Postal codes (ZIP) list',
'version': '10.0.1.0.0',
'author': '''
Camptocamp,
brain-tec AG,
... | agpl-3.0 | Python |
721efc62d1f7132f2683ec0ceddc1735a57abd36 | add 4.1.3 (#19296) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/busco/package.py | var/spack/repos/builtin/packages/busco/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Busco(PythonPackage):
"""Assesses genome assembly and annotation completeness with Benchma... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Busco(PythonPackage):
"""Assesses genome assembly and annotation completeness with Benchma... | lgpl-2.1 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.