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 |
|---|---|---|---|---|---|---|---|---|
18b769ed14028f771877439a6e9c73e333671986 | use LOG_LEVEL env variable | joliveros/bitmex-websocket,joliveros/bitmex-websocket | bitmex_websocket/_settings_base.py | bitmex_websocket/_settings_base.py | from os.path import join
import logging
import os
import alog
########################################################################################################################
# Connection/Auth
######################################################################################################################... | from os.path import join
import logging
import os
########################################################################################################################
# Connection/Auth
########################################################################################################################
# API UR... | mit | Python |
6bb9a4ed50ad879c56cdeae0dedb49bba6780780 | Use IRC Nicks instead of real names. | honza/nigel | matchers/volunteer.py | matchers/volunteer.py | import random
from base import BaseMatcher
class VolunteerMatcher(BaseMatcher):
dev_text = "volunteer someone"
all_text = "volunteer a dev"
dev_candidates = ['sjl', 'arthurdebert', 'honza', 'fernandotakai', 'nicksergeant']
all_candidates = dev_candidates + ['cz', 'ehazlett']
def respond(self, mes... | import random
from base import BaseMatcher
class VolunteerMatcher(BaseMatcher):
dev_text = "volunteer someone"
all_text = "volunteer a dev"
dev_candidates = ['Steve', 'Arthur', 'Honza', 'Fernando', 'Nick']
all_candidates = dev_candidates + ['Craig', 'Evan']
def respond(self, message, user=None):
... | bsd-2-clause | Python |
c475cf3e65100dd3cff3c992fc756fb2078b6195 | Update example project | gears/flask-gears | example/app.py | example/app.py | from flask import Flask, render_template
from flask_gears import Gears
from gears_stylus import StylusCompiler
app = Flask(__name__)
gears = Gears()
gears.init_app(app)
env = gears.get_environment(app)
env.compilers.register('.styl', StylusCompiler.as_handler())
@app.route('/')
def index():
return render_temp... | import os
from flask import Flask, render_template
from flask_gears import Gears
NODE_PATH = os.path.join(os.path.dirname(__file__), 'node_modules')
NODE_PATH = os.path.normpath(os.path.abspath(NODE_PATH))
os.environ['NODE_PATH'] = NODE_PATH
app = Flask(__name__)
gears = Gears()
gears.init_app(app)
@app.route('/... | isc | Python |
fc319b99854145ac217f50f675cb7fffb1b52e9f | Add author to should-I-boot-this.py | kernelci/lava-ci-staging,kernelci/lava-ci-staging,kernelci/lava-ci-staging | should-I-boot-this.py | should-I-boot-this.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*
#
# Copyright (C) 2017 Free Electrons SAS
# Author: Florent Jacquet <florent.jacquet@free-electrons.com>
#
# This module is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software ... | #!/usr/bin/env python3
# -*- coding:utf-8 -*
#
# Copyright (C) 2017 Free Electrons SAS
# Author:
#
# This module is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | lgpl-2.1 | Python |
187d038bcd7cb8fd1d819f827bd1e081b762e9de | Prepare for next version | simplefin/siloscript,simplefin/siloscript,simplefin/siloscript | siloscript/version.py | siloscript/version.py | # Copyright (c) The SimpleFIN Team
# See LICENSE for details.
__version__ = "0.3.0-dev"
| # Copyright (c) The SimpleFIN Team
# See LICENSE for details.
__version__ = "0.2.1"
| apache-2.0 | Python |
b24083b0991157a1e0d8a533fc1cac3aa2e4523c | Order similar artist results properly | FreeMusicNinja/api.freemusic.ninja | similarities/utils.py | similarities/utils.py | from django.db.models import Q
import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
... | import echonest
from artists.models import Artist
from echonest.models import SimilarResponse
from users.models import User
from .models import (GeneralArtist, UserSimilarity, Similarity,
update_similarities)
def add_new_similarities(artist, force_update=False):
similarities = []
response... | bsd-3-clause | Python |
c9d1edf1148ed503c02510c998ee9da9394fa848 | Add a `;` at the end of each line and escape `"` character in content string (iOS only) | saminerve/localizable | lib/ios.py | lib/ios.py | import os
import subprocess
from files import findFiles
import codecs
def init(args):
path = args["root"] if "root" in args else "."
path = path + (("/"+args["path"]) if "path" in args else "")
global storyboardFiles, stringsFiles
storyboardFiles = findFiles(".storyboard", path+"/Base.lproj")
stringsFiles = findF... | import os
import subprocess
from files import findFiles
import codecs
def init(args):
path = args["root"] if "root" in args else "."
path = path + (("/"+args["path"]) if "path" in args else "")
global storyboardFiles, stringsFiles
storyboardFiles = findFiles(".storyboard", path+"/Base.lproj")
stringsFiles = findF... | unlicense | Python |
5b101517628e1f87a956e78e99fde442d08fc5e6 | Make attributes executable and add in table to model map | rcbau/fuzzy-happiness | fuzzy_happiness/attributes.py | fuzzy_happiness/attributes.py | #!/usr/bin/python
#
# Copyright 2013 Rackspace Australia
#
# 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 o... | #!/usr/bin/python
#
# Copyright 2013 Rackspace Australia
#
# 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 o... | apache-2.0 | Python |
dfb3ef220b53b03b0f5007d8712ad3704fc860f6 | Use KafkaProducer | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/change_feed/producer.py | corehq/apps/change_feed/producer.py | from __future__ import unicode_literals
from __future__ import absolute_import
import json
import time
from django.conf import settings
from kafka import KafkaProducer
from kafka.common import LeaderNotAvailableError, FailedPayloadsError, KafkaUnavailableError
from six.moves import range
from corehq.util.soft_assert ... | from __future__ import unicode_literals
from __future__ import absolute_import
import json
import time
from corehq.util.soft_assert import soft_assert
from kafka import SimpleProducer
from kafka.common import LeaderNotAvailableError, FailedPayloadsError, KafkaUnavailableError
from corehq.apps.change_feed.connection im... | bsd-3-clause | Python |
5cac0d8b336cb8efe7d819d47abf46ccadea7b29 | Fix typo/bug in validate_params function | kmike/django-generic-images,kmike/django-generic-images,kmike/django-generic-images | generic_utils/templatetags.py | generic_utils/templatetags.py | from django import template
class InvalidParamsError(template.TemplateSyntaxError):
''' Custom exception class to distinguish usual TemplateSyntaxErrors
and validation errors for templatetags introduced by ``validate_params``
function'''
pass
def validate_params(bits, arguments_count, keyword... | from django import template
class InvalidParamsError(template.TemplateSyntaxError):
''' Custom exception class to distinguish usual TemplateSyntaxErrors
and validation errors for templatetags introduced by ``validate_params``
function'''
pass
def validate_params(bits, arguments_count, keyword... | mit | Python |
0cdc4901f604b64ab26adf0cad867bf58e72f91a | update to debug | justinwp/croplands,justinwp/croplands | gfsad/views/api/processors.py | gfsad/views/api/processors.py | from flask import request
from gfsad.exceptions import Unauthorized
from gfsad.utils.s3 import upload_image
from gfsad.tasks.records import get_ndvi
from gfsad.auth import allowed_roles, verify_role, load_user
def api_roles(role):
def wrapper(*args, **kwargs):
if not allowed_roles(role):
raise... | from flask import request
from gfsad.exceptions import Unauthorized
from gfsad.utils.s3 import upload_image
from gfsad.tasks.records import get_ndvi
from gfsad.auth import allowed_roles, verify_role, load_user
def api_roles(role):
def wrapper(*args, **kwargs):
if not allowed_roles(role):
raise... | mit | Python |
d37faaa3950f9468a9276d8202177a3f4e48f632 | Clean up mnist example | explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc | examples/mnist_mlp.py | examples/mnist_mlp.py | from __future__ import print_function
import plac
import dill as pickle
from tqdm import tqdm
from thinc.neural.vec2vec import Model, ReLu, Softmax
from thinc.api import clone, chain
from thinc.extra import datasets
from thinc.neural.ops import CupyOps
def main(depth=2, width=512, nb_epoch=20):
Model.ops = CupyO... | from __future__ import print_function
import plac
import dill as pickle
from thinc.neural.vec2vec import Model, ReLu, Softmax
from thinc.neural._classes.batchnorm import BatchNorm as BN
from thinc.api import clone, chain
from thinc.loss import categorical_crossentropy
from thinc.extra import datasets
def main(depth... | mit | Python |
330074331c13f9adfe1abe182b61c241324aa0e8 | Remove old permission system in files | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | files/views.py | files/views.py | from django.shortcuts import render
from .models import Image
from .forms import ImageForm
from .templatetags.render_single_image import render_image
from django.views.generic import CreateView, DeleteView, UpdateView, ListView
from django.shortcuts import redirect
from django.http import HttpResponseRedirect, HttpResp... | from django.shortcuts import render
from .models import Image
from .forms import ImageForm
from .templatetags.render_single_image import render_image
from django.views.generic import CreateView, DeleteView, UpdateView, ListView
from django.shortcuts import redirect
from django.http import HttpResponseRedirect, HttpResp... | mit | Python |
eb67b659d1419ecc39fead03c9a2bd85a5a2c5fb | add coerce_type setting | night-crawler/django-docker-helpers | django_docker_helpers/utils.py | django_docker_helpers/utils.py | import os
import sys
import typing as t
from yaml import load
def dotkey(obj, dot_path: str, default=None):
val = obj
sentinel = object()
if '.' not in dot_path:
return obj.get(dot_path, default)
for path_item in dot_path.split('.'):
if not hasattr(val, 'get'):
return def... | import os
import sys
import typing as t
from yaml import load
def dotkey(obj, dot_path: str, default=None):
val = obj
sentinel = object()
if '.' not in dot_path:
return obj.get(dot_path, default)
for path_item in dot_path.split('.'):
if not hasattr(val, 'get'):
return def... | mit | Python |
4b747baa8325196534bc2182e5af53bd20068589 | update taskstats, don't use raw data | roolebo/pyroute2,roolebo/pyroute2 | examples/taskstats.py | examples/taskstats.py | '''
Simple taskstats sample.
'''
import os
from pyroute2 import TaskStats
pid = os.getpid()
ts = TaskStats()
# bind is required in the case of generic netlink
ts.bind()
ret = ts.get_pid_stat(int(pid))[0]
# parsed structure
print(ret)
ts.close()
| '''
Simple taskstats sample.
'''
import os
from pyroute2 import TaskStats
from pyroute2.common import hexdump
pid = os.getpid()
ts = TaskStats()
# bind is required in the case of generic netlink
ts.bind()
ret = ts.get_pid_stat(int(pid))[0]
# raw hex structure to check alignment
print(hexdump(ret.raw))
# parsed structu... | apache-2.0 | Python |
ca98e4e30fc12195dbddd795a65c24e5880e6029 | Install python-six package in Ubuntu | Azure/azure-linux-extensions,vityagi/azure-linux-extensions,andyliuliming/azure-linux-extensions,andyliuliming/azure-linux-extensions,jasonzio/azure-linux-extensions,bpramod/azure-linux-extensions,krkhan/azure-linux-extensions,Azure/azure-linux-extensions,jasonzio/azure-linux-extensions,jasonzio/azure-linux-extensions,... | VMEncryption/main/patch/UbuntuPatching.py | VMEncryption/main/patch/UbuntuPatching.py | #!/usr/bin/python
#
# Copyright 2015 Microsoft Corporation
#
# 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... | #!/usr/bin/python
#
# Copyright 2015 Microsoft Corporation
#
# 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... | apache-2.0 | Python |
48ed2d3d5d06138b4116a29ef091ed8f21561476 | Bump version to 0.0.7 | portfoliome/pgawedge | pgawedge/_version.py | pgawedge/_version.py | version_info = (0, 0, 7)
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 0, 6)
__version__ = '.'.join(map(str, version_info))
| mit | Python |
78fd850094c2517aeea76640a9821d62ba999579 | remove duplicate service_yaml parameter (#932) | googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript,googleapis/gapic-generator-typescript | rules_typescript_gapic/typescript_gapic.bzl | rules_typescript_gapic/typescript_gapic.bzl | # Copyright 2020 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 2020 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 |
5d2e48ae1b6feffa2e0f969b1f4545e46944b095 | tweak to note | praekelt/molo,praekelt/molo,praekelt/molo,praekelt/molo | molo/core/backends.py | molo/core/backends.py | from django.contrib.auth.models import Group
from django_cas_ng.backends import CASBackend
class MoloCASBackend(CASBackend):
def authenticate(self, ticket, service, request):
user = super(
MoloCASBackend, self).authenticate(ticket, service, request)
if user is None:
return... | from django.contrib.auth.models import Group
from django_cas_ng.backends import CASBackend
class MoloCASBackend(CASBackend):
def authenticate(self, ticket, service, request):
user = super(
MoloCASBackend, self).authenticate(ticket, service, request)
if user is None:
return... | bsd-2-clause | Python |
af4a3ee0dc9afe88428b1c85c03f376c8652bffe | Update query-4.py | ibm-messaging/iot-device-samples,amprasanna/iot-device-samples,amprasanna/iot-device-samples,ibm-messaging/iot-device-samples,amprasanna/iot-device-samples,ibm-messaging/iot-device-samples | historian-cloudant/query-4.py | historian-cloudant/query-4.py | # *****************************************************************************
# Copyright (c) 2016 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | # *****************************************************************************
# Copyright (c) 2014 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | epl-1.0 | Python |
4ea234ff62edcc1f6191ac2648b01b3427fca7fc | REFACTOR : Removed unixpackage checks for compilation system packages (build-essential) | hitchtest/hitchrabbit | hitchrabbit/rabbit_package.py | hitchrabbit/rabbit_package.py | from hitchtest import HitchPackage, utils
from subprocess import check_output, call
from hitchtest.environment import checks
from os.path import join, exists
from os import makedirs, chdir, chmod
import shutil
import getpass
import stat
import os
ISSUES_URL = "http://github.com/hitchtest/hitchrabbit/issues"
class Rab... | from hitchtest import HitchPackage, utils
from subprocess import check_output, call
from hitchtest.environment import checks
from os.path import join, exists
from os import makedirs, chdir, chmod
import shutil
import getpass
import stat
import os
ISSUES_URL = "http://github.com/hitchtest/hitchrabbit/issues"
class Rab... | agpl-3.0 | Python |
7016b7bb026e0fe557ca06efa81dace9999e526d | Write a slightly less dumb protocol? | HubbeKing/Hubbot_Twisted | hubbot/Modules/Healthcheck.py | hubbot/Modules/Healthcheck.py | from twisted.protocols import basic
from twisted.internet import protocol, reactor
from hubbot.moduleinterface import ModuleInterface
class HealthcheckProtocol(basic.LineReceiver):
def lineReceived(self, line):
response_body = "All is well. Ish."
self.sendLine("HTTP/1.0 200 OK".encode("UTF-8"))
... | from twisted.internet import reactor, protocol
from hubbot.moduleinterface import ModuleInterface
class Echo(protocol.Protocol):
"""This is just about the simplest possible protocol"""
def dataReceived(self, data):
"""As soon as any data is received, write it back."""
self.transport.write(da... | mit | Python |
6d487b873f7b5f4ac026e923603ef96707bcc0f2 | Add a docstring to the main __init__.py | frostidaho/dynmen | src/dynmen/__init__.py | src/dynmen/__init__.py | # -*- coding: utf-8 -*-
"""
dynmen - A simple python interface to dynamic menus like dmenu or rofi
import dynmen
menu = dynmen.Menu(['dmenu', '-fn', 'Sans-30'])
output = menu({'a': 1, 'b': 2, 'c': 3})
You can make the menu non-blocking by setting:
menu.process_mode = 'futures'
Please see the repository for more e... | # -*- coding: utf-8 -*-
from .menu import Menu, MenuError
del menu
def new_dmenu(**kwargs):
from .dmenu import DMenu
return DMenu(**kwargs)
def new_rofi(**kwargs):
from .rofi import Rofi
return Rofi(**kwargs)
| mit | Python |
86c37485ebfac86c249d1e1c19b58a19a3b9dc5c | Implement is_used for git | dealertrack/flake8-diff,miki725/flake8-diff | flake8diff/vcs/git.py | flake8diff/vcs/git.py | from __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class GitVCS(VCSBase):
"""
Git support implementation
"""
name = 'git'
def get_vcs(self):
"""
Ge... | from __future__ import unicode_literals, print_function
import logging
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class GitVCS(VCSBase):
"""
Git support implementation
"""
name = 'git'
def get_vcs(self):
"""
Get git binary execut... | mit | Python |
715084463ea259897ca23adddc27cfe214605f04 | fix bug | Parkayun/initpy,janusnic/initpy,wzyuliyang/initpy | flask_init/creator.py | flask_init/creator.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
import functools
import inspect
import os
from .exceptions import InvalidFileName, InvalidFolderName, RootPathDoesNotExists
from .templates import blank_template
def name_validator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
func_args = inspect... | #!/usr/bin/python
# -*- coding:utf-8 -*-
import functools
import inspect
import os
from .exceptions import InvalidFileName, InvalidFolderName, RootPathDoesNotExists
from .templates import blank_template
def name_validator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
func_args = inspect... | mit | Python |
9fdbef053acb3dea9d54ce9e8078ed2393d54560 | Allow "foo/bar" branches to be browsed with "/foo:bar/..." | CodethinkLabs/mustard,CodethinkLabs/mustard | mustard/repository.py | mustard/repository.py | # Copyright (C) 2012 Codethink Limited
import cliapp
import collections
import os
import pygit2
class Repository(object):
def __init__(self, app, dirname):
self.app = app
self.dirname = dirname
self.repo = pygit2.Repository(self.dirname)
self.checked_out = True if self.repo.wor... | # Copyright (C) 2012 Codethink Limited
import cliapp
import collections
import os
import pygit2
class Repository(object):
def __init__(self, app, dirname):
self.app = app
self.dirname = dirname
self.repo = pygit2.Repository(self.dirname)
self.checked_out = True if self.repo.wor... | agpl-3.0 | Python |
b2905ee06ded6d5992b52f364370a5508c1c002a | use "simple_query_string" for raw user query | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | mygpo/search/index.py | mygpo/search/index.py |
""" Contains code for indexing other objects """
from pyes import ES, QueryStringQuery, FunctionScoreQuery
from pyes.exceptions import IndexAlreadyExistsException, NoServerAvailable
from django.conf import settings
from mygpo.search.json import podcast_to_json
from mygpo.search.models import PodcastResult
import l... |
""" Contains code for indexing other objects """
from pyes import ES, QueryStringQuery, FunctionScoreQuery
from pyes.exceptions import IndexAlreadyExistsException, NoServerAvailable
from django.conf import settings
from mygpo.search.json import podcast_to_json
from mygpo.search.models import PodcastResult
import l... | agpl-3.0 | Python |
3fcc04ba2156820de488475ddfd08ef4519627d5 | Update views.py | 02agarwalt/FNGS_website,02agarwalt/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website,02agarwalt/FNGS_website,ebridge2/FNGS_website,ebridge2/FNGS_website | fngs/analyze/views.py | fngs/analyze/views.py | from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionFor... | from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionFor... | apache-2.0 | Python |
d3fbce0c8e73513cc29c5c15be6575ba708fec0f | Add copyright statement | CarnegieHall/linked-data | get_geoInfo.py | get_geoInfo.py | # !/usr/local/bin/python3.4.2
# ----Copyright (c) 2017 Carnegie Hall | The MIT License (MIT)----
# ----For the full license terms, please visit https://github.com/CarnegieHall/linked-data/blob/master/LICENSE----
## Argument[0] is script to run
## Argument[1] is path to entityDict
import httplib2
import json
import lx... | # !/usr/local/bin/python3.4
## Argument[0] is script to run
## Argument[1] is path to entityDict
import httplib2
import json
import lxml
import os
import re
import sys
import time
from bs4 import BeautifulSoup
from rdflib import Graph, Literal, Namespace, URIRef
from rdflib.namespace import RDFS
from rdflib.plugins.s... | mit | Python |
2262399bf8e8501547ff16dfa1ef95818437df35 | add rea v0.2 to table defs | openego/ego.io,openego/ego.io | egoio/db_tables/calc_ego_re.py | egoio/db_tables/calc_ego_re.py | # coding: utf-8
from sqlalchemy import BigInteger, Column, Float, Integer, SmallInteger, String, \
Table, Text, text, Numeric
from geoalchemy2.types import Geometry
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class EgoDeuDea(Base):
__tablename__ ... | # coding: utf-8
from sqlalchemy import BigInteger, Column, Float, Integer, SmallInteger, String, \
Table, Text, text, Numeric
from geoalchemy2.types import Geometry
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class EgoDeuDea(Base):
__tablename__ ... | agpl-3.0 | Python |
2bf16e3512ffa20e9da583123b2face80fac3ab3 | remove queue urls from dev | bryanph/OIPA,VincentVW/OIPA,bryanph/OIPA,tokatikato/OIPA,catalpainternational/OIPA,catalpainternational/OIPA,openaid-IATI/OIPA,catalpainternational/OIPA,bryanph/OIPA,tokatikato/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,VincentVW/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,VincentVW/OIPA,zimmerman-zimme... | OIPA/OIPA/urls.py | OIPA/OIPA/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from api.v3.urls import api_v3_docs
admin.autodiscover()
urlpatterns = patterns(
'',
# (r'^admin/queue/', include('django_r... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from api.v3.urls import api_v3_docs
admin.autodiscover()
urlpatterns = patterns(
'',
(r'^admin/queue/', include('django_rq.... | agpl-3.0 | Python |
8a5486efc58bc26096a254e8a4d0316e2054ff5e | Split long line | fusionbox/django-authtools | authtools/backends.py | authtools/backends.py | from django.contrib.auth.backends import ModelBackend
from django import VERSION as DJANGO_VERSION
class CaseInsensitiveUsernameFieldBackendMixin(object):
"""
This authentication backend assumes that usernames are email addresses and simply
lowercases a username before an attempt is made to authenticate s... | from django.contrib.auth.backends import ModelBackend
from django import VERSION as DJANGO_VERSION
class CaseInsensitiveUsernameFieldBackendMixin(object):
"""
This authentication backend assumes that usernames are email addresses and simply
lowercases a username before an attempt is made to authenticate s... | bsd-2-clause | Python |
7cc5874b77d848dca26ebf6f0df96698fb7cccac | bump version for branch update | gopythongo/gopythongo,gopythongo/gopythongo | src/py/gopythongo/__init__.py | src/py/gopythongo/__init__.py | # -* coding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
version = "0.7.5.dev0"
program_version = "GoPythonGo %s" % version
| # -* coding: utf-8 *-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
version = "0.7.4.dev0"
program_version = "GoPythonGo %s" % version
| mpl-2.0 | Python |
97c2056e4a0511b593d0646359e9a28d72d88bd3 | Change some code in sanic aiomysql code | lixxu/sanic,jrocketfingers/sanic,yunstanford/sanic,ai0/sanic,lixxu/sanic,ashleysommer/sanic,Tim-Erwin/sanic,ai0/sanic,channelcat/sanic,ashleysommer/sanic,channelcat/sanic,r0fls/sanic,lixxu/sanic,r0fls/sanic,yunstanford/sanic,jrocketfingers/sanic,yunstanford/sanic,lixxu/sanic,ashleysommer/sanic,yunstanford/sanic,channel... | examples/sanic_aiomysql_with_global_pool.py | examples/sanic_aiomysql_with_global_pool.py | # encoding: utf-8
"""
You need the aiomysql
"""
import asyncio
import os
import aiomysql
from sanic import Sanic
from sanic.response import json
database_name = os.environ['DATABASE_NAME']
database_host = os.environ['DATABASE_HOST']
database_user = os.environ['DATABASE_USER']
database_password = os.environ['DATABASE_... | # encoding: utf-8
"""
You need the aiomysql
"""
import asyncio
import os
import aiomysql
import uvloop
from sanic import Sanic
from sanic.response import json
database_name = os.environ['DATABASE_NAME']
database_host = os.environ['DATABASE_HOST']
database_user = os.environ['DATABASE_USER']
database_password = os.envi... | mit | Python |
99f1bd9b7a02415b2e0ccc2e36144bca79b96386 | Fix migrations dependency | caesar2164/edx-platform,Stanford-Online/edx-platform,Stanford-Online/edx-platform,caesar2164/edx-platform,caesar2164/edx-platform,Stanford-Online/edx-platform,caesar2164/edx-platform,Stanford-Online/edx-platform | lms/djangoapps/bulk_email/migrations/0003_config_model_feature_flag.py | lms/djangoapps/bulk_email/migrations/0003_config_model_feature_flag.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('bulk_ema... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('bulk_ema... | agpl-3.0 | Python |
5560b0c055760cd1d06c533b7f83a563633cb6fc | Allow running individual tests from runtests.py | tsouvarev/django-money,recklessromeo/django-money,iXioN/django-money,recklessromeo/django-money,tsouvarev/django-money,iXioN/django-money,rescale/django-money,AlexRiina/django-money | runtests.py | runtests.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.conf import settings
settings.configure(
DEBUG=True,
# AUTH_USER_MODEL='testdata.CustomUser',
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.conf import settings
settings.configure(
DEBUG=True,
# AUTH_USER_MODEL='testdata.CustomUser',
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}... | bsd-3-clause | Python |
cd4e3f3f42cf570bd2280bfa5067c64638dc6c96 | add directory iterator | aureooms/sak,aureooms/sak | sak/iter.py | sak/iter.py | import lib.args, lib.sys, fileinput, itertools, getpass, lib.file
# polyfill for generator zip function
if hasattr( itertools , "izip" ) :
_zip = itertools.izip
else :
_zip = zip
def directories ( callable = None , iterable = None ) :
iterable = lib.args.listify( iterable )
callable = lib.args.listify( callab... | import lib.args, lib.sys, fileinput, itertools, getpass, lib.file
# polyfill for generator zip function
if hasattr( itertools , "izip" ) :
_zip = itertools.izip
else :
_zip = zip
def imap ( callable = None , iterable = None ) :
iterable = lib.args.listify( iterable )
callable = lib.args.listify( callable )
... | agpl-3.0 | Python |
63775ca941ad1925a5451c7c4b63cb7eae701fa8 | Remove qnet.cc shorthand module | mabuchilab/QNET | qnet/__init__.py | qnet/__init__.py | # This file is part of QNET.
#
# QNET 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.
#
# QNET is distributed in the hope... | # This file is part of QNET.
#
# QNET 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.
#
# QNET is distributed in the hope... | mit | Python |
71c3714fc46dfefa6f0875e1a0a8781b6aca5a8d | Clean up fourier samples. | mwhoffman/pygp | pygp/inference/_fourier.py | pygp/inference/_fourier.py | """
Approximations to the GP using random Fourier features.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import scipy.linalg as sla
# local imports
from ..utils.random import rstate
from ..utils.e... | """
Approximations to the GP using random Fourier features.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# global imports
import numpy as np
import scipy.linalg as sla
# local imports
from ..utils.random import rstate
from ..utils.e... | bsd-2-clause | Python |
d86d9710c71d95311a8039ed6c194ca6c4962210 | remove the stuff that we may or may not want to implement | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/facts/win_files.py | pyinfra/facts/win_files.py | from __future__ import unicode_literals
import re
from pyinfra.api.facts import FactBase
from .util.win_files import parse_win_ls_output
class WinFile(FactBase):
# Types must match WIN_FLAG_TO_TYPE in .util.win_files.py
type = 'file'
shell = 'ps'
def command(self, name):
self.name = name
... | from __future__ import unicode_literals
import re
from pyinfra.api.facts import FactBase
from .util.win_files import parse_win_ls_output
class WinFile(FactBase):
# Types must match WIN_FLAG_TO_TYPE in .util.win_files.py
type = 'file'
shell = 'ps'
def command(self, name):
self.name = name
... | mit | Python |
884c08c601af31906379a877d0d8ce2b65dff988 | Complete sets | ahartz1/python_koans,ahartz1/python_koans | python3/koans/about_sets.py | python3/koans/about_sets.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutSets(Koan):
def test_sets_make_keep_lists_unique(self):
highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod']
there_can_only_be_only_one = set(highlanders)
self.assert... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutSets(Koan):
def test_sets_make_keep_lists_unique(self):
highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas', 'MacLeod', 'Malcolm', 'MacLeod']
there_can_only_be_only_one = set(highlanders)
self.assert... | mit | Python |
71cc46b1759e468f7faaef72f75df2798143455d | Update version.py | dpressel/baseline,dpressel/baseline,dpressel/baseline,dpressel/baseline | python/baseline/version.py | python/baseline/version.py | __version__ = "1.5.14"
| __version__ = "1.5.13"
| apache-2.0 | Python |
a1358ba2deec091ca077932693db1a68a9b53995 | Update __init__.py to properly expose KerasTransformer via 'from sparkdl import KerasTransformer' (#96) | databricks/spark-deep-learning | python/sparkdl/__init__.py | python/sparkdl/__init__.py | # Copyright 2017 Databricks, 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 writin... | # Copyright 2017 Databricks, 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 writin... | apache-2.0 | Python |
e1fadf6570d683b6bfcf9c8bb8c8933aca1feaba | load caffe, torch, bigdl model | intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL,intel-analytics/BigDL,intel-analytics/BigDL | python/test/dev/modules.py | python/test/dev/modules.py | #
# Copyright 2016 The BigDL 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 applicable law or agreed to in ... | #
# Copyright 2016 The BigDL 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 applicable law or agreed to in ... | apache-2.0 | Python |
7e4bc4249daeef8f9e8a6965c38ceab2ff998bf5 | handle events-based methods | woju/qubes-core-admin,woju/qubes-core-admin,QubesOS/qubes-core-admin,marmarek/qubes-core-admin,QubesOS/qubes-core-admin,marmarek/qubes-core-admin,woju/qubes-core-admin,marmarek/qubes-core-admin,QubesOS/qubes-core-admin,woju/qubes-core-admin | qubes/tools/qubesd_query.py | qubes/tools/qubesd_query.py | #!/usr/bin/env python3.6
import argparse
import asyncio
import signal
import sys
QUBESD_SOCK = '/var/run/qubesd.sock'
try:
asyncio.ensure_future
except AttributeError:
asyncio.ensure_future = asyncio.async
parser = argparse.ArgumentParser(
description='low-level qubesd interrogation tool')
parser.add_a... | #!/usr/bin/env python3.6
import argparse
import asyncio
import signal
import sys
QUBESD_SOCK = '/var/run/qubesd.sock'
try:
asyncio.ensure_future
except AttributeError:
asyncio.ensure_future = asyncio.async
parser = argparse.ArgumentParser(
description='low-level qubesd interrogation tool')
parser.add_a... | lgpl-2.1 | Python |
493ce497e5d84d8db9c37816aefea9099df42e90 | Add Synonym and related classes | sherlocke/pywatson | pywatson/answer/synonym.py | pywatson/answer/synonym.py | from pywatson.util.map_initializable import MapInitializable
class SynSetSynonym(MapInitializable):
def __init__(self, is_chosen, value, weight):
self.is_chosen = is_chosen
self.value = value
self.weight = weight
@classmethod
def from_mapping(cls, syn_mapping):
return cls(... | class Synonym(object):
def __init__(self):
pass
| mit | Python |
b9487ee71ca2aac0d7ae3be955a9c7629ca35956 | Check the isolate version before running it. | eunchong/build,eunchong/build,eunchong/build,eunchong/build | scripts/slave/recipe_modules/isolate/resources/isolate.py | scripts/slave/recipe_modules/isolate/resources/isolate.py | #!/usr/bin/env python
# Copyright 2015 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.
"""Calls either isolate.py or isolate Go executable in the checkout.
"""
import os
import subprocess
import sys
def try_go(path, arg... | #!/usr/bin/env python
# Copyright 2015 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.
"""Calls either isolate.py or isolate Go executable in the checkout.
"""
import os
import subprocess
import sys
def main():
path =... | bsd-3-clause | Python |
a950f73e043064cc9eac202c686397029f54c7ea | Disable multiple :/ | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | readthedocs/config/utils.py | readthedocs/config/utils.py | """Shared functions for the config module."""
import yaml
def to_dict(value):
"""Recursively transform a class from `config.models` to a dict."""
if hasattr(value, 'as_dict'):
return value.as_dict()
if isinstance(value, list):
return [
to_dict(v)
for v in value
... | """Shared functions for the config module."""
import yaml
def to_dict(value):
"""Recursively transform a class from `config.models` to a dict."""
if hasattr(value, 'as_dict'):
return value.as_dict()
if isinstance(value, list):
return [
to_dict(v)
for v in value
... | mit | Python |
e7035094822777479be3f40c28dd1ecc52baab49 | Update user.py | samfcmc/fenixedu-python-sdk | fenixedu/user.py | fenixedu/user.py |
""" User: """
class User(object):
def __init__(self, access_token = None, refresh_token = None,
token_expires = None):
self.access_token = access_token
self.refresh_token = refresh_token
self.token_expires = token_expires
|
""" User: """
class User(object):
def __init__(self, access_token = None, refresh_token = None,
token_expires = None, code = None):
self.access_token = access_token
self.refresh_token = refresh_token
self.token_expires = token_expires
self.code = code
| mit | Python |
b1cf7ca8fbe70d77787c7256e161d2baf220f39a | Update urls.py | gmkou/FikaNote,gmkou/FikaNote,gmkou/FikaNote | fikanote/urls.py | fikanote/urls.py | from django.conf.urls import include, url, handler404
import app.views
import app.feed
import app.shownote
import app.agenda
import app.agendajson
urlpatterns = [
url(r'^$', app.views.index, name='index'),
url(r'^(?P<number>\d+)/$', app.views.episode),
url(r'^agenda', app.agenda.agenda),
url(r'^agendaj... | from django.conf.urls import patterns, include, url, handler404
import app.views
import app.feed
import app.shownote
import app.agenda
import app.agendajson
urlpatterns = [
url(r'^$', app.views.index, name='index'),
url(r'^(?P<number>\d+)/$', app.views.episode),
url(r'^agenda', app.agenda.agenda),
url(... | mit | Python |
9c8b3bed9f47fc1218590b971de9b9723741d7c2 | Disable the old admin panel | clubadm/clubadm,clubadm/clubadm,clubadm/clubadm | clubadm/urls.py | clubadm/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.views import logout
from clubadm import views, admin
urlpatterns = [
url(r"^$", views.home, name="home"),
url(r"^login$", views.login, name="login"),
url(r"^callback$", views.callback, name="callback"),
... | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.views import logout
from clubadm import views, admin
urlpatterns = [
url(r"^$", views.home, name="home"),
url(r"^login$", views.login, name="login"),
url(r"^callback$", views.callback, name="callback"),
... | mit | Python |
76d118577ec966ffe2c13c8009866299fcb3f962 | fix the bug that will generate !!python/unicode | espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf | tools/ci/python_packages/tiny_test_fw/Utility/GitlabCIJob.py | tools/ci/python_packages/tiny_test_fw/Utility/GitlabCIJob.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# 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 ... | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# 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 ... | apache-2.0 | Python |
91cee59a1ab45be18d1cbb3de7545055de353d0e | add werkzeug routing: allows '/endpoint/<some_id>' style routing | philipn/flask-sockets,kennethreitz/flask-sockets | flask_sockets.py | flask_sockets.py | # -*- coding: utf-8 -*-
from werkzeug.routing import Map, Rule
from werkzeug.exceptions import NotFound
def log_request(self):
log = self.server.log
if log:
if hasattr(log, 'info'):
log.info(self.format_request() + '\n')
else:
log.write(self.format_request() + '\n')
# ... | # -*- coding: utf-8 -*-
def log_request(self):
log = self.server.log
if log:
if hasattr(log, 'info'):
log.info(self.format_request() + '\n')
else:
log.write(self.format_request() + '\n')
# Monkeys are made for freedom.
try:
import gevent
from geventwebsocket.gu... | mit | Python |
af199fbaa6637f308795fcbca8c284c8edbb234e | move add out of ez_norm layer | 255BITS/HyperGAN,255BITS/HyperGAN | hypergan/modules/ez_norm.py | hypergan/modules/ez_norm.py | import torch.nn as nn
from hypergan.modules.modulated_conv2d import EqualLinear
class EzNorm(nn.Module):
def __init__(self, style_size, channels, dims, equal_linear=False, use_conv=True, dim=1):
super(EzNorm, self).__init__()
if equal_linear:
self.beta = EqualLinear(style_size, channel... | import torch.nn as nn
from hypergan.modules.modulated_conv2d import EqualLinear
class EzNorm(nn.Module):
def __init__(self, style_size, channels, dims, equal_linear=False, use_conv=True, dim=1):
super(EzNorm, self).__init__()
if equal_linear:
self.beta = EqualLinear(style_size, channel... | mit | Python |
219b6e24e28c9a7e11c0119adebcf97f14fa8018 | Change port | disqus/codebox,disqus/codebox | codebox/conf.py | codebox/conf.py | """
codebox.conf
~~~~~~~~~~~
:copyright: (c) 2011 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import os, os.path
import urlparse
class Config(object):
DEBUG = False
TESTING = False
LOG_LEVEL = os.environ.get('LOG_LEVEL', 'DEBUG')
SECRET_KEY = os.environ.get('SECRET_KEY', '... | """
codebox.conf
~~~~~~~~~~~
:copyright: (c) 2011 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import os, os.path
import urlparse
class Config(object):
DEBUG = False
TESTING = False
LOG_LEVEL = os.environ.get('LOG_LEVEL', 'DEBUG')
SECRET_KEY = os.environ.get('SECRET_KEY', '... | apache-2.0 | Python |
ef0b36954f0e0caa6c7f732dc024a444e8583c94 | Add pre-commit hook and reformat code thanks to black | OCA/server-tools,OCA/server-tools,YannickB/server-tools,YannickB/server-tools,YannickB/server-tools,OCA/server-tools | base_sparse_field_list_support/__manifest__.py | base_sparse_field_list_support/__manifest__.py | # -*- coding: utf-8 -*-
{
"name": "Base Sparse Field List Support",
"summary": "add list support to convert_to_cache()",
"version": "10.0.1.0.0",
"category": "Technical Settings",
"website": "www.akretion.com",
"author": "Akretion",
"license": "AGPL-3",
"application": False,
"install... | # -*- coding: utf-8 -*-
{
"name": "Base Sparse Field List Support",
"summary": "add list support to convert_to_cache()",
"version": "10.0.1.0.0",
'category': 'Technical Settings',
"website": "www.akretion.com",
"author": "Akretion",
"license": "AGPL-3",
"application": False,
"install... | agpl-3.0 | Python |
f98acc3c0fc52ab5eea229976276ca7da3ee964c | Bump version to 0.0.5 | yasyf/bcferries | bcferries/__init__.py | bcferries/__init__.py | VERSION = '0.0.5'
from bcferries import BCFerries
| VERSION = '0.0.4'
from bcferries import BCFerries
| mit | Python |
d9333e03d10d9b4172d3fbf233c48a3117b4f82c | Add docstrings to Timer | ktbs/ktbs-bench,ktbs/ktbs-bench | ktbs_bench/utils/timer.py | ktbs_bench/utils/timer.py | import resource
import logging
from time import time
class Timer(object):
"""
Measure process duration.
The timer is a little object that must be started and stopped to compute
delta times.
Examples
--------
Measuring time
>>> from time import sleep
>>> my_timer = Timer() # time... | import resource
import logging
from time import time
class Timer:
"""Measure process duration."""
def __init__(self, tick_now=True):
self.start_time = []
if tick_now:
self.start_time = self.tick()
self.stop_time = {}
self.delta = {}
@staticmethod
def tick()... | mit | Python |
5a23904ef475d1f2c298dfea33b95eb763302ee9 | Remove unused code | fastmonkeys/kuulemma,fastmonkeys/kuulemma,City-of-Helsinki/kuulemma,City-of-Helsinki/kuulemma,City-of-Helsinki/kuulemma,fastmonkeys/kuulemma | kuulemma/views/hearing.py | kuulemma/views/hearing.py | from flask import Blueprint, redirect, render_template, url_for
from ..models import Hearing
hearing = Blueprint(
name='hearing',
import_name=__name__,
url_prefix='/kuulemiset'
)
# Redirects to the first hearing before the real index page is implemented.
@hearing.route('')
def index():
hearing = Hea... | from flask import Blueprint, redirect, render_template, url_for
from sqlalchemy import desc
from ..models import Comment, Hearing
hearing = Blueprint(
name='hearing',
import_name=__name__,
url_prefix='/kuulemiset'
)
# Redirects to the first hearing before the real index page is implemented.
@hearing.rou... | agpl-3.0 | Python |
214534a86fe8a7113cfc56255e201f5500744215 | Fix the Auth section not showing up in automatic admin. | ergodicbreak/evennia,TheTypoMaster/evennia,titeuf87/evennia,jamesbeebop/evennia,ypwalter/evennia,ypwalter/evennia,TheTypoMaster/evennia,ergodicbreak/evennia,feend78/evennia,mrkulk/text-world,TheTypoMaster/evennia,emergebtc/evennia,jamesbeebop/evennia,feend78/evennia,feend78/evennia,emergebtc/evennia,shollen/evennia,mrk... | game/web/urls.py | game/web/urls.py | #
# File that determines what each URL points to. This uses _Python_ regular
# expressions, not Perl's.
#
# See:
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autod... | #
# File that determines what each URL points to. This uses _Python_ regular
# expressions, not Perl's.
#
# See:
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
#admin.auto... | bsd-3-clause | Python |
7a2cbbe715e3bbe5030b5f61c0ba6fb84725e17d | fix doctest | yannicklm/pycp | pycp/util.py | pycp/util.py | """Various useful functions"""
import os
def debug(message):
"""Print debug mesages when env. var PYCP_DEBUG is set."""
if os.environ.get("PYCP_DEBUG"):
print message
def human_readable(size):
"""Build a nice human readable string from a size given in
bytes
"""
if size < 1024**2:
... | """Various useful functions"""
import os
def debug(message):
"""Print debug mesages when env. var PYCP_DEBUG is set."""
if os.environ.get("PYCP_DEBUG"):
print message
def human_readable(size):
"""Build a nice human readable string from a size given in
bytes
"""
if size < 1024**2:
... | mit | Python |
ea91ba0aa69d8982a055b8d73a98e5161287a6b2 | Add a method for nan processing | gciteam6/xgboost,gciteam6/xgboost | src/features/time_series.py | src/features/time_series.py | # Built-in modules
import re
# Hand-made modules
from .base import DataFrameHandlerBase
REGEX_DROP_LABEL_NAME_PREFIXES = {
"max_ws_",
"ave_wv_",
"ave_ws_",
"max_tp_",
"min_tp_",
"sl_",
"sd_",
"vb_",
"weather_",
"dsr_",
"dsd_",
"dsr_"
}
DROP_LABEL_NAMES = [
"weather",... | # Built-in modules
import re
# Hand-made modules
from .base import DataFrameHandlerBase
REGEX_DROP_LABEL_NAME_PREFIXES = {
"max_ws_",
"ave_wv_",
"ave_ws_",
"max_tp_",
"min_tp_",
"sl_",
"sd_",
"vb_",
"weather_",
"dsr_",
"dsd_",
"dsr_"
}
DROP_LABEL_NAMES = [
"weather",... | mit | Python |
9439fff96fa82e6415f796f5872de727d417789c | create wp users | epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp | src/wordpress/configurator.py | src/wordpress/configurator.py | import os
import logging
import subprocess
from .models import WPException, WPUser
class WPRawConfig:
""" First object to implement some business logic
- is the site installed? properly configured ?
It provides also the methods to actually interact with WP-CLI
- generic run_wp_cli
... | import os
import logging
import subprocess
from .models import WPException, WPUser
class WPRawConfig:
""" First object to implement some business logic
- is the site installed? properly configured ?
It provides also the methods to actually interact with WP-CLI
- generic run_wp_cli
... | mit | Python |
19bbe44705652292a2d2e7ff83b833fa61997c4d | Remove unused imports | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin | geotrek/common/templatetags/geotrek_tags.py | geotrek/common/templatetags/geotrek_tags.py | from django import template
from django.conf import settings
from datetime import datetime, timedelta
from django.utils.translation import gettext_lazy as _
register = template.Library()
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")
@register.simple_tag
def is_topology_mode... | from geotrek.zoning.models import RestrictedAreaType, RestrictedArea
from django import template
from django.conf import settings
from datetime import datetime, timedelta
import json
from django.utils.translation import gettext_lazy as _
register = template.Library()
@register.simple_tag
def settings_value(name):
... | bsd-2-clause | Python |
d8f27ed360454e10ba0cd718430af28ffef2d445 | Test fixes | CodersOfTheNight/stubilous | stubilous/tests.py | stubilous/tests.py | from pytest import fixture
from stubilous.config import Config
@fixture
def config_file() -> str:
return """
---
server:
port: 80
host: localhost
"""
@fixture
def basic_config(config_file) -> Config:
from io import StringIO
import yaml
buff = StringIO()
buff.write(config_file)
buff.seek... | from pytest import fixture
from stubilous.config import Config
@fixture
def basic_config() -> Config:
from io import StringIO
import yaml
buff = StringIO()
buff.write("""
---
server:
port: 80
host: localhost
""")
return Config.from_dict(yaml.load(buff))
def test_service_... | mit | Python |
10426b049baeceb8dda1390650503e1d75ff8b64 | Add initial fixtures for the categories. | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/common/management/commands/common_load_fixtures.py | us_ignite/common/management/commands/common_load_fixtures.py | import urlparse
from django.conf import settings
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from us_ignite.profiles.models import Category, Interest
INTEREST_LIST = (
('SDN', 'sdn'),
('OpenFlow', 'openflow'),
('Ultra fast', 'ultra-fast'),
('Advan... | import urlparse
from django.conf import settings
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from us_ignite.profiles.models import Interest
INTEREST_LIST = (
('SDN', 'sdn'),
('OpenFlow', 'openflow'),
('Ultra fast', 'ultra-fast'),
('Advanced wirele... | bsd-3-clause | Python |
ec750644703a8e1f2c4a0bb03993acd07154143c | Add update profile command | chickenzord/plurk-cli | plurk-cli.py | plurk-cli.py | #!/usr/bin/env python
import click
import json
import plurkenv
plurk = plurkenv.init()
@click.group()
def cli():
pass
@cli.command()
@click.option('--key', '-k', default = None)
@click.option('--list-keys', '-l', is_flag = True)
@click.pass_context
def whoami(ctx, key, list_keys):
ctx.forward(whois, user_id = N... | #!/usr/bin/env python
import click
import json
import plurkenv
plurk = plurkenv.init()
@click.group()
def cli():
pass
@cli.command()
@click.option('--key', '-k', default = None)
@click.option('--list-keys', '-l', is_flag = True)
@click.pass_context
def whoami(ctx, key, list_keys):
ctx.forward(whois, user_id = N... | mit | Python |
ade661b74082197974d2e134253e494a92d26772 | use python version specified in /usr/bin/env, not /usr/local/bin/python. | ianupright/micropsi2,printedheart/micropsi2,ianupright/micropsi2,printedheart/micropsi2,printedheart/micropsi2,ianupright/micropsi2 | src/micropsi_core/runtime.py | src/micropsi_core/runtime.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MicroPsi runtime component;
maintains a set of users, worlds (up to one per user), and agents, and provides an interface to external clients
"""
__author__ = 'joscha'
__date__ = '10.05.12'
import micropsi_core.nodenet
import micropsi_core.world
def main():
pass
... | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
MicroPsi runtime component;
maintains a set of users, worlds (up to one per user), and agents, and provides an interface to external clients
"""
__author__ = 'joscha'
__date__ = '10.05.12'
import micropsi_core.nodenet
import micropsi_core.world
def main():
pas... | mit | Python |
6593dffe70fc4bfa5a3d2c9966fb4886d2063c01 | add socket.io | haifengat/hf_at_py,haifengat/hf_at_py | web_flask/run.py | web_flask/run.py | #!flask/bin/python
from flask import Flask, render_template
from flask_socketio import SocketIO #pip install flask-socketio
from app import app
app.config['SECRET_KEY'] = 'secret!' #app.secret_key = os.urandom(10)
socketio = SocketIO(app)
@socketio.on_error()
def error_handler(e):
print(e)
#this fires
@socketio.... | #!flask/bin/python
from app import app
app.run(debug=True)
| apache-2.0 | Python |
3701f179cc058872e7637dbc810cf363481e28ba | Remove default version from bots | aaxelb/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,laurenbarker/SHARE,aaxelb/SHARE,zamattiac/SHARE,CenterForOpenScience/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,zamattiac/SHARE,zamattiac/SHARE | share/bot.py | share/bot.py | import abc
import logging
from celery.schedules import crontab
from share.robot import RobotAppConfig
logger = logging.getLogger(__name__)
class BotAppConfig(RobotAppConfig, metaclass=abc.ABCMeta):
schedule = crontab(minute=0, hour=0)
task = 'share.tasks.BotTask'
description = 'TODO' # TODO
@pro... | import abc
import logging
from celery.schedules import crontab
from share.robot import RobotAppConfig
logger = logging.getLogger(__name__)
class BotAppConfig(RobotAppConfig, metaclass=abc.ABCMeta):
version = '0.0.0'
schedule = crontab(minute=0, hour=0)
task = 'share.tasks.BotTask'
description = 'T... | apache-2.0 | Python |
6888113c424f4ff9d1f5add24bb2f7c2a718e853 | Allow duplicate flags via lists of values | blitzrk/sublime_libsass,blitzrk/sublime_libsass | libsass/project.py | libsass/project.py | import json
from libsass.pathutils import subpaths, mkdir_p
import os
default_opts = {
"output_dir": "build/css",
"options": {
"line-comments": True,
"line-numbers": True,
"style": "nested"
}
}
def find_config(top):
'''Search up parent tree for libsass config file'''... | import json
from libsass.pathutils import subpaths, mkdir_p
import os
default_opts = {
"output_dir": "build/css",
"options": {
"line-comments": True,
"line-numbers": True,
"style": "nested"
}
}
def find_config(top):
'''Search up parent tree for libsass config file'''... | mit | Python |
04eb784155c650b471295bac8f0a125b25d0c5b7 | Use of parse_tag function of bibformat_utils instead of bibformat_engine | inveniosoftware/invenio-formatter,inveniosoftware/invenio-formatter,tiborsimko/invenio-formatter,inveniosoftware/invenio-formatter,tiborsimko/invenio-formatter,tiborsimko/invenio-formatter | lib/elements/bfe_field.py | lib/elements/bfe_field.py | # -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio 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... | # -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio 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... | mit | Python |
fb53f2ed0e6337d6f5766f47cb67c204c89c0568 | Fix oauth2 revoke URI, new URL doesn't seem to work | GAM-team/GAM,GAM-team/GAM | src/oauth2client/__init__.py | src/oauth2client/__init__.py | # 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 required by applicable law or ... | # 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 required by applicable law or ... | apache-2.0 | Python |
79a35406c1d0b01c16c1252d09e33107fa10a245 | Set fields correctly | DoriftoShoes/bawt | bawt/mock/RPi.py | bawt/mock/RPi.py |
class GPIO(object):
BCM = 1
OUT = 1
IN = 1
ANNOUNCEMENT = '''
############################################################
# #
# WARNING: RPi.GPIO unavailable. #
# bawt.mock.RPi.GPIO will be used... |
class GPIO(object):
BCM = "BCM"
OUT = "OUT"
ANNOUNCEMENT = '''
############################################################
# #
# WARNING: RPi.GPIO unavailable. #
# bawt.mock.RPi.GPIO will be used in... | apache-2.0 | Python |
05bb358e2e9344cb6c99f8b5e0bf51e06a7632dd | change inspect_dir function to inspect directories of Scenes that already exist | ibamacsr/indicar-process,ibamacsr/indicar_process,ibamacsr/indicar_process,ibamacsr/indicar_process,ibamacsr/indicar-process | indicarprocess/imagery/tasks.py | indicarprocess/imagery/tasks.py | # -*- coding: utf-8 -*-
from os import listdir
from django.contrib.gis.geos import Polygon
from .models import Scene, Image, ScheduledDownload
from .utils import calendar_date, get_bounds, get_cloud_rate
def download_all():
"""Download all new Scenes of ScheduledDownloads."""
for sd in ScheduledDownload.obj... | # -*- coding: utf-8 -*-
from os import listdir
from django.contrib.gis.geos import Polygon
from .models import Scene, Image, ScheduledDownload
from .utils import calendar_date, get_bounds, get_cloud_rate
def download_all():
"""Download all new Scenes of ScheduledDownloads."""
for sd in ScheduledDownload.obj... | agpl-3.0 | Python |
7283c27bb43c19ad7b59aa14b7407b59bd0ed6ef | Set release version | goanpeca/loghub,spyder-ide/loghub | loghub/__init__.py | loghub/__init__.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (See LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Changelog... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (See LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Changelog... | mit | Python |
99ec449a7f00f28dc6fd474e37f01dfb68cd33c1 | Add query argument, docstrings, and logging | bgyori/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra,bgyori/indra,johnbachman/belpy,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/indra | indra/sources/virhostnet/api.py | indra/sources/virhostnet/api.py | import pandas
import logging
from .processor import VirhostnetProcessor
logger = logging.getLogger(__name__)
vhn_url = ('http://virhostnet.prabi.fr:9090/psicquic/webservices/current/'\
'search/query/')
data_columns = [
'host_grounding', 'vir_grounding', 'host_mnemonic', 'vir_mnemonic',
'host_mne... | import pandas
from .processor import VirhostnetProcessor
vhn_url = ('http://virhostnet.prabi.fr:9090/psicquic/webservices/current/'\
'search/query/*')
data_columns = [
'host_grounding', 'vir_grounding', 'host_mnemonic', 'vir_mnemonic',
'host_mnemonic2', 'vir_mnemonic2', 'exp_method',
'dash', '... | bsd-2-clause | Python |
497bfcee0a639c69c796386b536077a6815b90c0 | update cluster cant have job name | fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools | databricks/cluster-config.py | databricks/cluster-config.py | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
BRANCH = sys.argv[3]
JOB_PARAMETERS = sys.argv[4]
ENV = sys.argv[5]
FILE_LOCATION = sys.argv[6]
# Run Get request with api_command param
# /jobs/list/ with a... | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
BRANCH = sys.argv[3]
JOB_PARAMETERS = sys.argv[4]
ENV = sys.argv[5]
FILE_LOCATION = sys.argv[6]
# Run Get request with api_command param
# /jobs/list/ with a... | cc0-1.0 | Python |
d06cea7508f6403b522b7593de83b2a3fabaad2a | add logic for subnet param | fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools,fedspendingtransparency/data-act-build-tools | databricks/cluster_config.py | databricks/cluster_config.py | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
from run_databricks_jobs import getJobIds, getRequest
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
BRANCH = sys.argv[3]
JOB_PARAMETERS = sys.argv[4]
ENV = sys.argv[5]
FILE_LOCATION = sys.argv[6]
def up... | import sys
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
from run_databricks_jobs import getJobIds, getRequest
INSTANCE_ID = sys.argv[1]
JOB_NAME = sys.argv[2]
BRANCH = sys.argv[3]
JOB_PARAMETERS = sys.argv[4]
ENV = sys.argv[5]
FILE_LOCATION = sys.argv[6]
def up... | cc0-1.0 | Python |
4335d38594be32af379c646eb87620f9d0fdd206 | Update cybergis-script-geoserver-import-styles.py | state-hiu/cybergis-scripts,state-hiu/cybergis-scripts | bin/cybergis-script-geoserver-import-styles.py | bin/cybergis-script-geoserver-import-styles.py | from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import sys
import os
import subprocess
#==#
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib')))
import cybergis.gs
#==#
parser = argparse.ArgumentParser(d... | from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import sys
import os
import subprocess
#==#
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'lib')))
import cybergis.gs._geoserver_import_styles
#==#
parser = ... | mit | Python |
5df30d2c3d21b339173bcc830525811371380513 | Update version.py | thetestpeople/Geist,kebarr/Geist | geist/version.py | geist/version.py | __version__ = '1.0a8'
| __version__ = '1.0a7'
| mit | Python |
68795e05944b1cb9d15e733b04d961385713459c | Fix save_crops | NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect | inselect/workflow/save_crops.py | inselect/workflow/save_crops.py | #!/usr/bin/env python
"""Saves cropped object images
"""
import argparse
import traceback
from pathlib import Path
# Import numpy here to prevent PyInstaller build from breaking
# TODO LH find a better solution
import numpy
import inselect
import inselect.lib.utils
from inselect.lib.document import InselectDocumen... | #!/usr/bin/env python
"""Saves cropped object images
"""
import argparse
import traceback
from pathlib import Path
# Import numpy here to prevent PyInstaller build from breaking
# TODO LH find a better solution
import numpy
import inselect
import inselect.lib.utils
from inselect.lib.document import InselectDocumen... | bsd-3-clause | Python |
05b9b87c8980c7d93d9e55769d9ea8da245aa75b | Remove a request | BakeCode/performance-testing,BakeCode/performance-testing | config.py | config.py | from performance_testing.config import Config, Request
CONFIG = Config()
CONFIG.host = 'http://www.example.com'
CONFIG.clients_count = 2
CONFIG.requests_count = 10
CONFIG.requests = [
Request(url='/', type='GET', data=''),
Request(url='/about', type='GET', data='')
]
| from performance_testing.config import Config, Request
CONFIG = Config()
CONFIG.host = 'http://www.example.com'
CONFIG.clients_count = 2
CONFIG.requests_count = 10
CONFIG.requests = [
Request(url='/', type='GET', data=''),
Request(url='/about', type='GET', data=''),
Request(url='/imprint', type='GET', dat... | mit | Python |
e55cccb6f57f666b7608eb9f96ec023d28b1e737 | Add to notes | jonathanstallings/data-structures,jay-tyler/data-structures | priorityq.py | priorityq.py | from __future__ import unicode_literals
from functools import total_ordering
from binary_heap import BinaryHeap
@total_ordering # Will build out the remaining comparison methods
class QNode(object):
"""A class for a queue node."""
def __init__(self, val, priority=None):
self.val = val
self.p... | from __future__ import unicode_literals
from functools import total_ordering
from binary_heap import BinaryHeap
@total_ordering # Will build out the remaining comparison methods
class QNode(object):
"""A class for a queue node."""
def __init__(self, val, priority=None):
self.val = val
self.p... | mit | Python |
ac00356aa0bca06750fdadbd5d5dcdbca138fa63 | Improve wording of a comment. | sliedes/clang-triage | config.py | config.py | TOP = '/home/sliedes/scratch/build/clang-triage'
# git repository directory
LLVM_SRC = TOP + '/llvm.src'
# build directory
BUILD = TOP + '/clang-triage.ninja'
# The directory to save the HTML report to
REPORT_DIR = '/home/sliedes/public_html/clang-triage'
# The filename of the actual XHTML report file under REPORT_... | TOP = '/home/sliedes/scratch/build/clang-triage'
# git repository directory
LLVM_SRC = TOP + '/llvm.src'
# build directory
BUILD = TOP + '/clang-triage.ninja'
# The directory to save the HTML report to
REPORT_DIR = '/home/sliedes/public_html/clang-triage'
# The filename of the actual XHTML report file under REPORT_... | mit | Python |
83e820209f9980e6c9103908b14ff07fee23dc41 | Change .env variable to KCLS_USER | mphuie/kcls-myaccount | getCheckedOut.py | getCheckedOut.py | import requests
from bs4 import BeautifulSoup
import json
from dotenv import load_dotenv
import os
load_dotenv(".env")
s = requests.Session()
r = s.get("https://kcls.bibliocommons.com/user/login", verify=False)
payload = {
"name": os.environ.get("KCLS_USER"),
"user_pin": os.environ.get("PIN")
}
p = s.post(... | import requests
from bs4 import BeautifulSoup
import json
from dotenv import load_dotenv
import os
load_dotenv(".env")
s = requests.Session()
r = s.get("https://kcls.bibliocommons.com/user/login", verify=False)
payload = {
"name": os.environ.get("USER"),
"user_pin": os.environ.get("PIN")
}
s.post("https://... | apache-2.0 | Python |
55dafd618d020d97a704ea1f6ec32551a5683513 | Add default SECRET_KEY to config | paulaylingdev/blogsite,paulaylingdev/blogsite | config.py | config.py | """Application configuration file."""
# Flask
DEBUG = False
SECRET_KEY = 'CHANGEME'
# Flask SQLAlchemy
SQLALCHEMY_DATABASE_URI = "sqlite:///foo.db"
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Flask-HTMLmin
MINIFY_PAGE = True
# Flask Bcrypt
BCRYPT_LOG_ROUNDS = 14
# Flask-WTF
WTF_CSRF_SECRET_KEY ... | """Application configuration file."""
# Flask
DEBUG = False
SECRET_KEY = ''
# Flask SQLAlchemy
SQLALCHEMY_DATABASE_URI = "sqlite:///foo.db"
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Flask-HTMLmin
MINIFY_PAGE = True
# Flask Bcrypt
BCRYPT_LOG_ROUNDS = 14
# Flask-WTF
WTF_CSRF_SECRET_KEY = ''
| mit | Python |
12715c03a80d236630e1178baa5f5b4644d69d3a | increase schedule sleep time | paulgessinger/coalics,paulgessinger/coalics,paulgessinger/coalics | config.py | config.py | import os
PQ_PW=os.environ.get("POSTGRES_PASSWORD")
PQ_USER=os.environ.get("POSTGRES_USER")
PQ_DB=os.environ.get("POSTGRES_DB")
SQLALCHEMY_DATABASE_URI = 'postgresql+pygresql://'+PQ_USER+':'+PQ_PW+'@db/'+PQ_DB
CSRF_SECRET_KEY = os.environ.get("COALICS_CSRF_KEY").encode("utf-8")
SQLALCHEMY_TRACK_MODIFICATIONS = False
... | import os
PQ_PW=os.environ.get("POSTGRES_PASSWORD")
PQ_USER=os.environ.get("POSTGRES_USER")
PQ_DB=os.environ.get("POSTGRES_DB")
SQLALCHEMY_DATABASE_URI = 'postgresql+pygresql://'+PQ_USER+':'+PQ_PW+'@db/'+PQ_DB
CSRF_SECRET_KEY = os.environ.get("COALICS_CSRF_KEY").encode("utf-8")
SQLALCHEMY_TRACK_MODIFICATIONS = False
... | mit | Python |
ff105fc6d16f82b9acb7ca234154139ce8b39a8f | Refactor file deletion into own method | mgarbacz/bucketeer | bucketeer/uploader.py | bucketeer/uploader.py | import boto, os, hashlib, json
# Upload modified files with bucket and directory specified in config.json
def upload_from_config():
config = json.loads(open('config.json').read())
upload(config['bucket'], config['dir'])
# Upload modified files in src_folder to the s3 bucket named
def upload(bucket_name, src_fold... | import boto, os, hashlib, json
# Upload modified files with bucket and directory specified in config.json
def upload_from_config():
config = json.loads(open('config.json').read())
upload(config['bucket'], config['dir'])
# Upload modified files in src_folder to the s3 bucket named
def upload(bucket_name, src_fold... | mit | Python |
f0246b9897d89c1ec6f2361bbb488c4e162e5c5e | Make timestamps more specific as temporal context fades. | madbook/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,sim642/reddit-plugin-liveupdate,madbook/reddit-plugin-liveupdate,florenceyeun/reddit-plugin-liveupdate | reddit_liveupdate/utils.py | reddit_liveupdate/utils.py | import datetime
import itertools
import pytz
from babel.dates import format_time, format_datetime
from pylons import c
def pairwise(iterable):
a, b = itertools.tee(iterable)
next(b, None)
return itertools.izip(a, b)
def pretty_time(dt):
display_tz = pytz.timezone(c.liveupdate_event.timezone)
t... | import itertools
import pytz
from babel.dates import format_time
from pylons import c
def pairwise(iterable):
a, b = itertools.tee(iterable)
next(b, None)
return itertools.izip(a, b)
def pretty_time(dt):
display_tz = pytz.timezone(c.liveupdate_event.timezone)
return format_time(
time=... | bsd-3-clause | Python |
d2b4b9318df648e5d8808992883beae29c7d60f7 | Remove "with .. as" statement from .py | gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim | pylib/gfxprim/render_utils.py | pylib/gfxprim/render_utils.py | #
# gfxprim.render_utils
#
import jinja2
import logging as log
import os
import time
import re
def template_error(s, *args):
raise Exception(s, *args)
def create_environment(config, template_dir):
env = jinja2.Environment(
line_statement_prefix = "%%",
line_comment_prefix = "##",
undefined = ji... | #
# gfxprim.render_utils
#
import jinja2
import logging as log
import os
import time
import re
def template_error(s, *args):
raise Exception(s, *args)
def create_environment(config, template_dir):
env = jinja2.Environment(
line_statement_prefix = "%%",
line_comment_prefix = "##",
undefined = ji... | lgpl-2.1 | Python |
95998bd2472a79294fcb3cb10cce99198a38d7cf | Change Wiblog models to make dates less prone to change | lo-windigo/fragdev,lo-windigo/fragdev | wiblog/models.py | wiblog/models.py | from django.db import models
from django.core.urlresolvers import reverse
## Tag - A text tag, used to categorize posts
class Tag(models.Model):
desc = models.CharField('Tag', max_length=50, unique=True)
def __str__(self):
return self.desc
def get_absolute_url(self):
return reverse("wiblog:tags", args=[self.... | from django.db import models
from django.core.urlresolvers import reverse
## Tag - A text tag, used to categorize posts
class Tag(models.Model):
desc = models.CharField('Tag', max_length=50, unique=True)
def __str__(self):
return self.desc
def get_absolute_url(self):
return reverse("wiblog:tags", args=[self.... | agpl-3.0 | Python |
e74bc9fd3908785c02941e400b97ce48ed45f099 | Remove obsolete import. | ohsu-qin/qipipe | qipipe/interfaces/__init__.py | qipipe/interfaces/__init__.py | from .compress import Compress
from .copy import Copy
from .fix_dicom import FixDicom
from .group_dicom import GroupDicom
from .map_ctp import MapCTP
from .move import Move
from .glue import Glue
from .uncompress import Uncompress
from .xnat_upload import XNATUpload | from .compress import Compress
from .copy import Copy
from .fix_dicom import FixDicom
from .group_dicom import GroupDicom
from .map_ctp import MapCTP
from .move import Move
from .glue import Glue
from .stage_ctp import StageCTP
from .uncompress import Uncompress
from .xnat_upload import XNATUpload | bsd-2-clause | Python |
0f7e9177a29859e208fcab1a51007beac2a733f6 | Remove system info from KNX diagnostic (#64721) | toddeye/home-assistant,mezz64/home-assistant,nkgilley/home-assistant,rohitranjan1991/home-assistant,rohitranjan1991/home-assistant,w1ll1am23/home-assistant,rohitranjan1991/home-assistant,GenericStudent/home-assistant,mezz64/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,toddeye/home-assistant,GenericSt... | homeassistant/components/knx/diagnostics.py | homeassistant/components/knx/diagnostics.py | """Diagnostics support for KNX."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant import config as conf_util
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from . import CONFIG_SCHEMA
from .const import DOMAIN
... | """Diagnostics support for KNX."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant import config as conf_util
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.system_info import async_get... | apache-2.0 | Python |
603df7a0622ee32255aa04acb68cbcc3f9a4842f | rework pass_fail script as a module | OpenFAST/OpenFAST,OpenFAST/OpenFAST,OpenFAST/OpenFAST | reg_tests/lib/pass_fail.py | reg_tests/lib/pass_fail.py | #
# Copyright 2017 National Renewable Energy Laboratory
#
# 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 la... | #
# Copyright 2017 National Renewable Energy Laboratory
#
# 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 la... | apache-2.0 | Python |
331764246dced0d9fc31d86671d1b1ecbc1dc335 | update to zimport file adding try/except to ensure works for all files | lamastex/scalable-data-science,lamastex/scalable-data-science,lamastex/scalable-data-science,lamastex/scalable-data-science,lamastex/scalable-data-science,lamastex/scalable-data-science | _sds/basics/infrastructure/onpremise/dockerCompose/zimport/zimport.py | _sds/basics/infrastructure/onpremise/dockerCompose/zimport/zimport.py | #! /usr/bin/python3
import argparse
import json
import requests
import time
import os
from os.path import isfile, join
parser = argparse.ArgumentParser(description = "Import one or more Zeppelin \
notebooks into a running Zeppelin server. The imported files will be found \
in the folder set in ZEPPELIN_NOTEBO... | #! /usr/bin/python3
import argparse
import json
import requests
import time
import os
from os.path import isfile, join
parser = argparse.ArgumentParser(description = "Import one or more Zeppelin \
notebooks into a running Zeppelin server. The imported files will be found \
in the folder set in ZEPPELIN_NOTEBO... | unlicense | Python |
6d2027b25c98d26d4012a6c39ed421bb8a74d4d7 | Split pygstc ending calls | RidgeRun/gstd-1.x,RidgeRun/gstd-1.x,RidgeRun/gstd-1.x,RidgeRun/gstd-1.x | examples/pygstc/simple_pipeline.py | examples/pygstc/simple_pipeline.py | import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printError():
print("To play run: python3 si... | import time
import sys
from pygstc.gstc import *
from pygstc.logger import *
#Create a custom logger with loglevel=DEBUG
gstd_logger = CustomLogger('simple_pipeline', loglevel='DEBUG')
#Create the client with the logger
gstd_client = GstdClient(logger=gstd_logger)
def printError():
print("To play run: python3 si... | lgpl-2.1 | Python |
b02e1a4031d897b112647f5b84369d08d1ec967a | improve docstring for leapfrog integrator | adrn/streams,adrn/streams | streams/integrate/leapfrog.py | streams/integrate/leapfrog.py | # coding: utf-8
""" """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import uuid
# Third-party
import numpy as np
from ..potential import Potential
from ..util import _validate_coord
__all__ = ["PotentialIntegrator", "leapfrog"]
d... | # coding: utf-8
""" """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import uuid
# Third-party
import numpy as np
from ..potential import Potential
from ..util import _validate_coord
__all__ = ["PotentialIntegrator", "leapfrog"]
d... | mit | Python |
540c5f2969e75a0f461e9d46090cfe8d92c53b00 | Remove history name error for absolute paths | aayushkapadia/chemical_reaction_simulator | Simulator/plot.py | Simulator/plot.py | from Simulator import *
import XMLParser
import textToXML
def getHistoryFileName(xmlFileName):
y = xmlFileName[:-3]
y = y + 'txt'
i = len(y) - 1
while i>=0 :
if y[i]=='\\' or y[i]=='/' :
break
i-=1
if i>=0 :
return y[:i+1] + 'history_' + y[i+1:]
else:
return 'history_' + y
def plotFromXML(fileNa... | from Simulator import *
import XMLParser
import textToXML
def getHistoryFileName(xmlFileName):
y = xmlFileName[:-3]
return 'history_' + y + 'txt'
def plotFromXML(fileName,simulationTime,chemicalList):
historyFile = getHistoryFileName(fileName)
sim = XMLParser.getSimulator(fileName)
sim.simulate(int(simulationTi... | mit | Python |
992d23e83c33d7e99c380c72536cbe86e1c1c4b2 | add copyright header to net.py | google/flight-lab,google/flight-lab,google/flight-lab,google/flight-lab | controller/common/net.py | controller/common/net.py | # Copyright 2018 Flight Lab 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | import socket
def get_ip():
"""Get primary IP (the one with a default route) of local machine.
This works on both Linux and Windows platforms, and doesn't require working
internet connection.
"""
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# doesn't even have to be reachable
s.conn... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.