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 |
|---|---|---|---|---|---|---|---|---|
f6ff8ff655ebe5ddf9303e73a49c0da731fd0f1e | bump version 0.1.6 | solvebio/solvebio-python,solvebio/solvebio-python,solvebio/solvebio-python | solve/__init__.py | solve/__init__.py | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Solve, Inc. <http://www.solvebio.com>. All rights reserved.
#
# email: contact@solvebio.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Solve, Inc. <http://www.solvebio.com>. All rights reserved.
#
# email: contact@solvebio.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | mit | Python |
7d9115aaa429f0a6453c8fcc75c77abc2bdaec93 | Set up basic structure of code | keon/algorithms,amaozhao/algorithms | sort/heap_sort.py | sort/heap_sort.py | def heap_sort(arr):
""" Heapsort
Complexity: O(n log(n))
"""
pass
def heapify(arr):
pass
array = [1,5,65,23,57,1232,-1,-5,-2,242,100,4,423,2,564,9,0,10,43,64]
print(array)
heap_sort(array)
print(array) | mit | Python | |
a089d273d9b098a5504ff16e9ff09b3047ef7fe2 | add --skip | vstinner/pyperf,haypo/perf | doc/examples/plot.py | doc/examples/plot.py | import argparse
import matplotlib.pyplot as plt
import perf
import statistics
def plot_bench(args, bench):
if not args.split_runs:
values = bench.get_values()
if args.skip:
values = values[args.skip:]
values = [value for value in values]
plt.plot(values, label='values')... | import argparse
import matplotlib.pyplot as plt
import perf
def plot_bench(args, bench):
if not args.split_runs:
values = bench.get_values()
values = [value for value in values]
plt.plot(values, label='values')
mean = bench.mean()
plt.plot([mean] * len(values), label='mean... | mit | Python |
a7ac159703e391228df82999e9df0dca36ec4ae2 | Add missing plugin command | EDITD/ansible-elasticsearch_dev | filter_plugins/filters.py | filter_plugins/filters.py | def get_major_version(filename):
return int(filename[14])
def get_elasticsearch_base_url(version):
if version < 5:
return 'https://download.elasticsearch.org/elasticsearch/elasticsearch'
return 'https://artifacts.elastic.co/downloads/elasticsearch'
def get_elasticsearch_generic_command(version, ... | def get_major_version(filename):
return int(filename[14])
def get_elasticsearch_base_url(version):
if version < 5:
return 'https://download.elasticsearch.org/elasticsearch/elasticsearch'
return 'https://artifacts.elastic.co/downloads/elasticsearch'
def get_elasticsearch_generic_command(version, ... | mit | Python |
d60531ec6b2379aef1db11bd07389f054cfd28c6 | Add subtitle version to map_ytid2amaraid.py | danielhollas/AmaraUpload,danielhollas/AmaraUpload | map_ytid2amaraid.py | map_ytid2amaraid.py | #!/usr/bin/env python3
import argparse, sys
from pprint import pprint
from amara_api import *
from utils import answer_me
def read_cmd():
"""Function for reading command line options."""
desc = "Program for mapping YouTube IDs to Amara IDs. If given video is not on Amara, it is created."
parser = argparse.Arg... | #!/usr/bin/env python3
import argparse, sys
from pprint import pprint
from amara_api import *
from utils import answer_me
def read_cmd():
"""Function for reading command line options."""
desc = "Program for mapping YouTube IDs to Amara IDs. If given video is not on Amara, it is created."
parser = argparse.Arg... | mit | Python |
5a5c7192a58b26837d375ad683d59622c73d267f | Fix download.py for GloVe vectors. | spacy-io/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,raphael0202/spaCy,spacy-io/spaCy,explosion/spaCy,banglakit/spaCy,spacy-io/spaCy,banglakit/spaCy,explosion/spaCy,spacy-io/spaCy,banglakit/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,raphael0202/spaCy,honnibal/spaCy,recognai/spaCy,ho... | spacy/download.py | spacy/download.py | from __future__ import print_function
import sys
import sputnik
from sputnik.package_list import (PackageNotFoundException,
CompatiblePackageNotFoundException)
from . import about
def download(lang, force=False, fail_on_exist=True):
if force:
sputnik.purge(about.__titl... | from __future__ import print_function
import sys
import sputnik
from sputnik.package_list import (PackageNotFoundException,
CompatiblePackageNotFoundException)
from . import about
def download(lang, force=False, fail_on_exist=True):
if force:
sputnik.purge(about.__titl... | mit | Python |
4aed31ffe84909204bde4a82d2a97bf591a2be2c | Add check for empty result to country_lookup | mkrnr/wikiwhere | utils/country_lookup.py | utils/country_lookup.py | '''
Created on Feb 23, 2016
@author: Tatiana Sennikova, Martin Koerner <info@mkoerner.de>
'''
from urllib2 import urlopen
import json
# Get place using GoogleMaps API
def get_country(lat, lon):
country=""
# town=""
url = "http://maps.googleapis.com/maps/api/geocode/json?"
url += "latlng=%s,%s&sensor=... | '''
Created on Feb 23, 2016
@author: Tatiana Sennikova, Martin Koerner <info@mkoerner.de>
'''
from urllib2 import urlopen
import json
# Get place using GoogleMaps API
def get_country(lat, lon):
country=""
# town=""
url = "http://maps.googleapis.com/maps/api/geocode/json?"
url += "latlng=%s,%s&sensor=... | mit | Python |
156746c7f3cca902b158b454c6d3f28ce2b5c66a | fix comment | musalbas/mcc-mnc-table | get-mcc-mnc-table-json.py | get-mcc-mnc-table-json.py | # Get the Mobile Country Codes (MCC) and Mobile Network Codes (MNC) table
# from mcc-mnc.com and output it in JSON format.
import re
import urllib2
import json
td_re = re.compile('<td>([^<]*)</td>'*6)
html = urllib2.urlopen('http://mcc-mnc.com/').read()
tbody_start = False
mcc_mnc_list = []
for line in html.split... | # Get the Mobile Country Codes (MCC) and Mobile Network Codes (MNC) table
# from mcc-mnc.com and output it in CSV format.
import re
import urllib2
import json
td_re = re.compile('<td>([^<]*)</td>'*6)
html = urllib2.urlopen('http://mcc-mnc.com/').read()
tbody_start = False
mcc_mnc_list = []
for line in html.split(... | mit | Python |
a9f3cb4b22f4d7b35fcd5258eb0fec9ff02438da | Add context to __all__. | kirkeby/sheared | dtml/__init__.py | dtml/__init__.py | __all__ = ['abml', 'tales', 'tal', 'context']
| __all__ = ['abml', 'tales', 'tal']
| mit | Python |
90088f44ff2bdb6d2c6826c71e3a29923a5e2f47 | Update version | galeone/dynamic-training-bench | dytb/__init__.py | dytb/__init__.py | #Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu>
#
#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/.
#Exhibit B is not attached; this software is compatible with the
#lic... | #Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu>
#
#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/.
#Exhibit B is not attached; this software is compatible with the
#lic... | mpl-2.0 | Python |
8f9a2ebd1f424a92b46f791ad8b7089a613cd04f | Configure dj-static and dj-database-url | JeffPaine/nhd_search,JeffPaine/nhd_search | nhd_search/settings.py | nhd_search/settings.py | """
Django settings for nhd_search project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROC... | """
Django settings for nhd_search project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROC... | mit | Python |
ee7335a44ff6e99169216f36cb0d40a55a521fbb | remove duplicates and sorted config options | iglpdc/nipype,dmordom/nipype,carlohamalainen/nipype,dgellis90/nipype,JohnGriffiths/nipype,fprados/nipype,FredLoney/nipype,mick-d/nipype,mick-d/nipype_source,arokem/nipype,grlee77/nipype,sgiavasis/nipype,sgiavasis/nipype,arokem/nipype,blakedewey/nipype,rameshvs/nipype,carolFrohlich/nipype,glatard/nipype,glatard/nipype,b... | nipype/utils/config.py | nipype/utils/config.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Created on 20 Apr 2010
logging options : INFO, DEBUG
hash_method : content, timestamp
@author: Chris Filo Gorgolewski
'''
import ConfigParser, os
from StringIO import StringIO
import os
homedir = os.... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
'''
Created on 20 Apr 2010
logging options : INFO, DEBUG
hash_method : content, timestamp
@author: Chris Filo Gorgolewski
'''
import ConfigParser, os
from StringIO import StringIO
import os
homedir = os.... | bsd-3-clause | Python |
577c290e4509ec957aa45a0e6ab96a5aa2faa1e2 | Add Py3k support | subeax/grab,huiyi1990/grab,kevinlondon/grab,huiyi1990/grab,giserh/grab,istinspring/grab,lorien/grab,codevlabs/grab,alihalabyah/grab,raybuhr/grab,maurobaraldi/grab,maurobaraldi/grab,liorvh/grab,codevlabs/grab,kevinlondon/grab,raybuhr/grab,pombredanne/grab-1,subeax/grab,subeax/grab,SpaceAppsXploration/grab,shaunstanislau... | grab/util/py3k_support.py | grab/util/py3k_support.py | import sys
# Backward compatibility for xrange function, basestring datatype
# unicode function/type, unichr function and raw_input function
if sys.version_info >= (3, ):
xrange = range
basestring = str
unicode = str
unichr = chr
raw_input = input
#from grab.util.py3k_support import *
| import sys
# Backward compatibility for xrange function, basestring datatype
# unicode function/type, unichr function and raw_input function
if sys.version_info >= (3,):
xrange = range
basestring = str
unicode = str
unichr = chr
raw_input = input
#from grab.util.py3k_support import *
| mit | Python |
0d28033a29b4565cc7dbf7726698079d7a93327f | Improve graph labels. | computationalmodelling/virtualmicromagnetics,computationalmodelling/virtualmicromagnetics,fangohr/virtualmicromagnetics,fangohr/virtualmicromagnetics | docs/graphs/graph.py | docs/graphs/graph.py | #!/usr/bin/python
# The purpose of this script is to create a graph that shows the processes
# involved for the user.
from graphviz import Digraph
# Node properties
font = "verdana"
envNodeProps = {"shape": "egg", "fontname": font, "fillcolor": "forestgreen",
"margin": "0.1, 0.1", "style": "filled"}... | #!/usr/bin/python
# The purpose of this script is to create a graph that shows the processes
# involved for the user.
from graphviz import Digraph
# Node properties
font = "verdana"
envNodeProps = {"shape": "egg", "fontname": font, "fillcolor": "forestgreen",
"margin": "0.1, 0.1", "style": "filled"}... | bsd-3-clause | Python |
c462c8c7c0861d68de9c85dc12b28579e1ea49b3 | set storagePath | sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint | mint/web/catalog.py | mint/web/catalog.py | #
# Copyright (c) 2008 rPath, Inc.
#
# All Rights Reserved
#
import os
from mod_python import Cookie
from conary.lib import coveragehook
from mint import maintenance
from mint import shimclient
from mint.session import SqlSession
from catalogService import handler_apache
def getAuthFromSession(req, cfg):
# the ... | #
# Copyright (c) 2008 rPath, Inc.
#
# All Rights Reserved
#
from mod_python import Cookie
from conary.lib import coveragehook
from mint import maintenance
from mint import shimclient
from mint.session import SqlSession
from catalogService import handler_apache
def getAuthFromSession(req, cfg):
# the pysid cooki... | apache-2.0 | Python |
12fe14c0f61ab550df40ccde73db09109c06d71a | Bump version | pombredanne/django-spurl,j4mie/django-spurl,albertkoch/django-spurl | spurl/__init__.py | spurl/__init__.py | __version__ = '0.2'
__author__ = 'Jamie Matthews (http://j4mie.org) <jamie.matthews@gmail.com>'
| __version__ = '0.1'
__author__ = 'Jamie Matthews (http://j4mie.org) <jamie.matthews@gmail.com>'
| unlicense | Python |
bfd166e9679e6fa06e694fd5e587fcf10186d79b | Fix a crash if there is no ~/.python/rc.py | philipdexter/vx,philipdexter/vx | vx_intro.py | vx_intro.py | import vx
import math
import os
import sys
_tick_functions = []
def _register_tick_function(f, front=False):
if front:
_tick_functions.insert(0, f)
else:
_tick_functions.append(f)
def _tick():
for f in _tick_functions:
f()
vx.my_vx = _tick
vx.register_tick_function = _register_tic... | import vx
import math
import os
import sys
_tick_functions = []
def _register_tick_function(f, front=False):
if front:
_tick_functions.insert(0, f)
else:
_tick_functions.append(f)
def _tick():
for f in _tick_functions:
f()
vx.my_vx = _tick
vx.register_tick_function = _register_tic... | mit | Python |
2791b45c2eaaef11a2dfa78b58b89c6a7268a89d | Add the slug of the curses while send PreNotification | UrLab/beta402,UrLab/beta402,UrLab/DocHub,UrLab/beta402,UrLab/DocHub,UrLab/DocHub,UrLab/DocHub | documents/signals.py | documents/signals.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Copyright 2014, Cercle Informatique ASBL. All rights reserved.
#
# 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 ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Copyright 2014, Cercle Informatique ASBL. All rights reserved.
#
# 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 ... | agpl-3.0 | Python |
6b44159d82b5e19ee31b6890a9850f28e5446a08 | Update __openerp__.py | ingadhoc/website | website_sale_promotion/__openerp__.py | website_sale_promotion/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 | Python |
2962539c683fb00e1c88d629f0d7af689a6648e2 | Add missing module docstring | jcollado/esis | esis/__init__.py | esis/__init__.py | # -*- coding: utf-8 -*-
"""Elastic Search Index & Search."""
__author__ = 'Javier Collado'
__email__ = 'jcollado@nowsecure.com'
__version__ = '0.1.0'
| # -*- coding: utf-8 -*-
__author__ = 'Javier Collado'
__email__ = 'jcollado@nowsecure.com'
__version__ = '0.1.0'
| mit | Python |
02179e336c04d1613a6aa10a02f99a784afb7cbb | remove unused imports | dchabot/python-pcaspy,dchabot/python-pcaspy,dchabot/python-pcaspy | example/dummy.py | example/dummy.py | #!/usr/bin/env python
from pcaspy import Driver, SimpleServer
prefix = 'MTEST:'
pvdb = {
'RAND' : {
'prec' : 3,
},
}
class myDriver(Driver):
def __init__(self):
super(myDriver, self).__init__()
if __name__ == '__main__':
server = SimpleServer()
server.createPV(prefix, pvdb)
... | #!/usr/bin/env python
from pcaspy import Driver, SimpleServer
import time
prefix = 'MTEST:'
pvdb = {
'RAND' : {
'prec' : 3,
},
}
class myDriver(Driver):
def __init__(self):
super(myDriver, self).__init__()
if __name__ == '__main__':
server = SimpleServer()
server.createPV(prefix... | bsd-3-clause | Python |
798348035562b4302d83ffe6036079b9f9438e4f | Change 'colour' to 'colour' | mcgid/morenines,mcgid/morenines | morenines/output.py | morenines/output.py | import click
import sys
GOOD_COLOR = 'green'
WARN_COLOR = 'yellow'
BAD_COLOR = 'red'
IGNORED_COLOR = 'blue'
def set_output_color(color):
# Print nothing except the ANSI escape sequence
click.secho('', nl=False, fg=color, reset=False)
def clear_output_color():
# Print nothing except the reset escape sequ... | import click
import sys
GOOD_COLOUR = 'green'
WARN_COLOUR = 'yellow'
BAD_COLOUR = 'red'
IGNORED_COLOUR = 'blue'
def set_output_colour(colour):
# Print nothing except the ANSI escape sequence
click.secho('', nl=False, fg=colour, reset=False)
def clear_output_colour():
# Print nothing except the reset esc... | mit | Python |
399660e977091e141d4283672b03c774d7f6516a | add quotes to make the problematic filename stand out more | voc/voctomix,h01ger/voctomix,h01ger/voctomix,voc/voctomix | voctocore/lib/config.py | voctocore/lib/config.py | import os.path
import logging
from configparser import SafeConfigParser
from lib.args import Args
__all__ = ['Config']
class VocConfigParser(SafeConfigParser):
def getlist(self, section, option):
return [x.strip() for x in self.get(section, option).split(',')]
files = [
os.path.join(os.path.dirname... | import os.path
import logging
from configparser import SafeConfigParser
from lib.args import Args
__all__ = ['Config']
class VocConfigParser(SafeConfigParser):
def getlist(self, section, option):
return [x.strip() for x in self.get(section, option).split(',')]
files = [
os.path.join(os.path.dirname... | mit | Python |
091b33d4e809a7c72bb26246407e0a4f84b383d1 | update version | newfies-dialer/newfies-dialer,romonzaman/newfies-dialer,emartonline/newfies-dialer,saydulk/newfies-dialer,romonzaman/newfies-dialer,berinhard/newfies-dialer,laprice/newfies-dialer,Star2Billing/newfies-dialer,laprice/newfies-dialer,romonzaman/newfies-dialer,emartonline/newfies-dialer,Star2Billing/newfies-dialer,romonzam... | newfies/__init__.py | newfies/__init__.py | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2012 Star2B... | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2012 Star2B... | mpl-2.0 | Python |
e9f652eb469dde352c1585979e79853260e3a3d5 | Change spaces | den-che/nginx-parser | nginx_log_parser.py | nginx_log_parser.py | import os
import re
code_500 = []
nginx_log_list = []
def load_log_file(filepath):
if not os.path.exists(filepath):
return None
else:
with open(filepath,'r') as log_file:
for line in log_file:
nginx_log_list.append(line)
return nginx_log_list
def log_parser_code_500(nginx_log):
for line in nginx... | import os
import re
code_500 = []
nginx_log_list = []
def load_log_file(filepath):
if not os.path.exists(filepath):
return None
else:
with open(filepath,'r') as log_file:
for line in log_file:
nginx_log_list.append(line)
return nginx_log_list
def log_parser_code_500(nginx_log):
for line in nginx_... | mit | Python |
8c596c2fa818c9e98f22ba8e596bef0e7978a786 | Bump version to 0.3.4 | nioinnovation/nio-cli,neutralio/nio-cli | nio_cli/__init__.py | nio_cli/__init__.py | __version__ = '0.3.4'
| __version__ = '0.4.0'
| apache-2.0 | Python |
bc593f1716a8e36e65cf75a58e524e77d38d5d9c | Add a rudimentary quantile factory function. | debrouwere/python-ballpark | notation/statistics.py | notation/statistics.py | # encoding: utf-8
# included for ease of use with Python 2 (which has no statistics package)
def mean(values):
return float(sum(values)) / len(values)
def quantile(p):
def bound_quantile(values):
ix = int(len(values) * p)
if len(values) % 2:
return values[ix]
elif ix < 1... | # encoding: utf-8
# included for ease of use with Python 2 (which has no statistics package)
def mean(values):
return float(sum(values)) / len(values)
def median(values):
middle = (len(values) - 1) // 2
if len(values) % 2:
return values[middle]
else:
return mean(values[middle:middle ... | isc | Python |
612b58c11ca76ffde9915ecdba5f2c29ed8e3576 | fix duplicated channel for 0.5+ | felinx/nsqworker | nsqworker/bootstrap.py | nsqworker/bootstrap.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 feilong.me All rights reserved.
#
# @author: Felinx Lee <felinx.lee@gmail.com>
# Created on May 4, 2013
#
import logging
import nsq
from tornado.options import define, options
from nsqworker.workers.worker import load_worker
define("topic", default="demo", help="nsq top... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 feilong.me All rights reserved.
#
# @author: Felinx Lee <felinx.lee@gmail.com>
# Created on May 4, 2013
#
import logging
import nsq
from tornado.options import define, options
from nsqworker.workers.worker import load_worker
define("topic", default="demo", help="nsq top... | apache-2.0 | Python |
e8f39cc8db7231ffd743a4e6760d62e2ebccb1ba | print msg | rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh | fabfile/india.py | fabfile/india.py | from fabric.api import task
from util import ec2secgroup_openport, yaml_file_replace
from cloudmesh_install import config_file
from cloudmesh.config.cm_config import yaml_attribute_replace
@task
def configure():
"""configure india environment for cloudmesh rapid deployment"""
# running on server mode with... | from fabric.api import task
from util import ec2secgroup_openport, yaml_file_replace
from cloudmesh_install import config_file
from cloudmesh.config.cm_config import yaml_attribute_replace
@task
def configure():
"""configure india environment for cloudmesh rapid deployment"""
# running on server mode with... | apache-2.0 | Python |
91b37d5a12799284f553723ef9936e95283b2111 | add admin view for testing | arteria/django-favicon-plus | favicon/admin.py | favicon/admin.py | from django.contrib import admin
from favicon.models import Favicon
class FaviconAdmin(admin.ModelAdmin):
list_display = ('title', 'isFavicon')
admin.site.register(Favicon, FaviconAdmin)
class FaviconImgAdmin(admin.ModelAdmin):
list_display = ('faviconFK', 'rel', 'size', 'faviconImage')
def queryset(s... | from django.contrib import admin
from favicon.models import Favicon
class FaviconAdmin(admin.ModelAdmin):
list_display = ('title', 'isFavicon')
admin.site.register(Favicon, FaviconAdmin)
| mit | Python |
f7a5cc2310929bb20dd7506c917830788ead07aa | Test multi-branch push | PMEAL/OpenPNM | openpnm/__version__.py | openpnm/__version__.py | __version__ = '2.4.10'
| __version__ = '2.4.2'
| mit | Python |
3b1942bd0b4212bad663e0feb834d1c922b3ab3e | Fix URLS | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | fellowms/urls.py | fellowms/urls.py | """fellowms URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | """fellowms URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | bsd-3-clause | Python |
9cd541e7f16e5febd79800a59038a9ee03bc59bc | switch hard cutoff docstring to napoleon | mir-group/flare,mir-group/flare | flare/cutoffs.py | flare/cutoffs.py | """
The cutoffs module gives a few different options for smoothly sending the GP
kernel to zero near the boundary of the cutoff sphere.
"""
from math import cos, sin, pi
from numba import njit
@njit
def hard_cutoff(r_cut: float, ri: float, ci: float):
"""A hard cutoff that assigns a value of 1 to all interatomic ... | """
The cutoffs module gives a few different options for smoothly sending the GP
kernel to zero near the boundary of the cutoff sphere.
"""
from math import cos, sin, pi
from numba import njit
@njit
def hard_cutoff(r_cut: float, ri: float, ci: float):
"""A hard cutoff that assigns a value of 1 to all interatomic ... | mit | Python |
195bf6de2a5a79caf9ef23646448ed83ca91f5b9 | add one diagonal to plot_rdm | njchiang/task-fmri-utils,njchiang/task-fmri-utils,njchiang/task-fmri-utils | fmri_core/vis.py | fmri_core/vis.py | # TODO : populate after development is done
from nilearn import plotting as nplt
from .utils import unmask_img
from numpy import allclose
from scipy.spatial.distance import squareform
from scipy.stats import rankdata
from numpy import eye
from matplotlib.pyplot import colorbar, imshow
from sklearn.preprocessing import ... | # TODO : populate after development is done
from nilearn import plotting as nplt
from .utils import unmask_img
from numpy import allclose
from scipy.spatial.distance import squareform
from scipy.stats import rankdata
from matplotlib.pyplot import colorbar, imshow
from sklearn.preprocessing import minmax_scale
def plot... | mit | Python |
314dfba160037df434ab8f0d5a026a8219fa1cc0 | sort special commands | rgs1/xcmd | xcmd/tests/test_xcmd.py | xcmd/tests/test_xcmd.py | # -*- coding: utf-8 -*-
""" test xcmd proper """
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from xcmd.xcmd import (
ensure_params,
Optional,
Required,
XCmd
)
class XCmdTestCase(unittest.TestCase):
""" Xcmd tests cases """
@classm... | # -*- coding: utf-8 -*-
""" test xcmd proper """
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from xcmd.xcmd import (
ensure_params,
Optional,
Required,
XCmd
)
class XCmdTestCase(unittest.TestCase):
""" Xcmd tests cases """
@classm... | apache-2.0 | Python |
0e7529b1d54ca16d5ca133f803d9d8d46e512711 | add notes | Tatsh/xirvik-tools | xirvik/commands/util.py | xirvik/commands/util.py | """Utility functions for CLI commands."""
from functools import lru_cache
from os.path import basename
from typing import Optional
import argparse
import logging
import sys
@lru_cache()
def setup_logging_stdout(name: Optional[str] = None,
verbose: bool = False) -> logging.Logger:
"""Basic... | from functools import lru_cache
from os.path import basename
from typing import Optional
import argparse
import logging
import sys
@lru_cache()
def setup_logging_stdout(name: Optional[str] = None,
verbose: bool = False) -> logging.Logger:
name = name if name else basename(sys.argv[0])
... | mit | Python |
b59c304f7cffd9cc6b9441c23af57eaf1370f617 | Fix auth issue when accessing root path "/" | openstack/zaqar,openstack/zaqar,openstack/zaqar,openstack/zaqar | zaqar/transport/auth.py | zaqar/transport/auth.py | # Copyright (c) 2013 Red Hat, 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 writ... | # Copyright (c) 2013 Red Hat, 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 writ... | apache-2.0 | Python |
ad62ac82d35c44157da2844f2ad13392ce47dead | Bump version to 0.12.0.dev | tempbottle/eventlet,collinstocks/eventlet,tempbottle/eventlet,lindenlab/eventlet,lindenlab/eventlet,collinstocks/eventlet,lindenlab/eventlet | eventlet/__init__.py | eventlet/__init__.py | version_info = (0, 12, 0, "dev")
__version__ = ".".join(map(str, version_info))
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sle... | version_info = (0, 11, 0)
__version__ = ".".join(map(str, version_info))
try:
from eventlet import greenthread
from eventlet import greenpool
from eventlet import queue
from eventlet import timeout
from eventlet import patcher
from eventlet import convenience
import greenlet
sleep = gr... | mit | Python |
9f7bb40a0f114dab847c515d7a25caf9d419e70b | Reorder permission choices to make Admin2 display safer | SlideAtlas/SlideAtlas-Server,SlideAtlas/SlideAtlas-Server,SlideAtlas/SlideAtlas-Server,SlideAtlas/SlideAtlas-Server | slideatlas/models/common/permission.py | slideatlas/models/common/permission.py | # coding=utf-8
from collections import namedtuple
from functools import partial
from mongoengine import EmbeddedDocument, ObjectIdField, StringField
from .model_document import ToSonDocumentMixin
################################################################################
__all__ = ('Permission', 'AdminSitePerm... | # coding=utf-8
from collections import namedtuple
from functools import partial
from mongoengine import EmbeddedDocument, ObjectIdField, StringField
from .model_document import ToSonDocumentMixin
################################################################################
__all__ = ('Permission', 'AdminSitePerm... | apache-2.0 | Python |
bd247703d346cab9ffa6bbf14d10a67f738db1db | Test Handler Log | kkstu/Torweb,kkstu/Torweb | handler/index.py | handler/index.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
# Index Page
from BaseHandler import BaseHandler
from tornado.web import authenticated as Auth
class IndexHandler(BaseHandler):
#@Auth
def get(self):
self.log.info('Hell,Index page!') # Log Test
self.render('index/index.html')
| #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
# Index Page
from BaseHandler import BaseHandler
from tornado.web import authenticated as Auth
class IndexHandler(BaseHandler):
#@Auth
def get(self):
self.render('index/index.html')
| mit | Python |
8195043db28783672f401c0ee1f5bb999b1a37d1 | Fix runtests to pass on Django 1.3.1. | mlavin/django-hilbert,mlavin/django-hilbert | hilbert/tests/runtests.py | hilbert/tests/runtests.py | import os
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
},
INSTALLED_APPS=(
'django.contr... | import os
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
},
INSTALLED_APPS=(
'django.contr... | bsd-2-clause | Python |
39d734be1b9ebe672c9294b26ac823ffae94ea43 | Test newline appending | Vnet-as/cisco-olt-client | cisco_olt_client/tests/test_client.py | cisco_olt_client/tests/test_client.py |
from cisco_olt_client.client import OltClient
from cisco_olt_client.client import exec_command, socket
def test_init():
client = OltClient('hostname', 'username', 'password')
assert client.hostname == 'hostname'
assert client.username == 'username'
assert client.password == 'password'
def test_get_... |
from cisco_olt_client.client import OltClient
from cisco_olt_client.client import exec_command, socket
def test_init():
client = OltClient('hostname', 'username', 'password')
assert client.hostname == 'hostname'
assert client.username == 'username'
assert client.password == 'password'
def test_get_... | mit | Python |
3b7e8aa42213bd92797cbcb9d248c2c07c2e2fa6 | Fix potential bug with generators in And and Or Triggers | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/trigger.py | hoomd/trigger.py | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
from inspect import isclass
class Trigger(_hoomd.Trigger):
pass
class Periodic(_hoomd.PeriodicTrigger, Trigger):
def __init_... | # Copyright (c) 2009-2019 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
from hoomd import _hoomd
from inspect import isclass
class Trigger(_hoomd.Trigger):
pass
class Periodic(_hoomd.PeriodicTrigger, Trigger):
def __init_... | bsd-3-clause | Python |
f168532270242e8406c50cff20b5e748c7943539 | Remove all references to ds9 | deepzot/bashes,deepzot/bashes | examples/g3bashes.py | examples/g3bashes.py | #!/usr/bin/env python
import argparse
import math
import numpy as np
import galsim
import bashes
def main():
# Parse command-line args.
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
bashes.great3.Observation.addArgs(parser)
bashes.Estimator.addArgs(parser)... | #!/usr/bin/env python
import argparse
import math
import numpy as np
import galsim
import bashes
def main():
# Parse command-line args.
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
bashes.great3.Observation.addArgs(parser)
bashes.Estimator.addArgs(parser)... | mit | Python |
54c856e987bf570c7bcb8c449726a5d2895c0241 | Fix octopus.run for new events model. | richardingham/octopus,richardingham/octopus,richardingham/octopus,richardingham/octopus | octopus/__init__.py | octopus/__init__.py |
__version__ = "trunk"
def run (runnable, logging = True):
from twisted.internet import reactor
if reactor.running:
return runnable.run()
else:
if logging:
import sys
from twisted.python import log
log.startLogging(sys.stdout)
runnable.on("log", log.msg)
def _complete (result):
reactor.stop... |
__version__ = "trunk"
def run (runnable, logging = True):
from twisted.internet import reactor
if reactor.running:
return runnable.run()
else:
def _complete (result):
reactor.stop()
def _run ():
runnable.run().addBoth(_complete)
if logging:
import sys
from twisted.python import log
log.s... | mit | Python |
9f606a7ffe24c0d0f7025d9c663c6f3f0c3f9590 | Remove commented out code | jongiddy/balcazapy,jongiddy/balcazapy,jongiddy/balcazapy | examples/rest/web.py | examples/rest/web.py | from balcaza.t2types import *
from balcaza.t2activity import *
from balcaza.t2flow import Workflow
flow = Workflow(title = 'Web Page Headers and Title')
GetWebPage = flow.task.RetrieveWebPage << HTTP.GET('http://www.biovel.eu/')
# We can chain several tasks together using the pipe symbol
# We can use activities, whi... | from balcaza.t2types import *
from balcaza.t2activity import *
from balcaza.t2flow import Workflow
flow = Workflow(title = 'Web Page Headers and Title')
GetWebPage = flow.task.RetrieveWebPage << HTTP.GET('http://www.biovel.eu/')
# StringListToString = BeanshellCode(
# '''String seperatorString = "\\n";
# if (sepera... | lgpl-2.1 | Python |
be23cc409de018a9d268ec20262ff39535f776aa | use evaluate preset | pfnet/chainercv,yuyu2172/chainercv,chainer/chainercv,chainer/chainercv,yuyu2172/chainercv | examples/ssd/eval.py | examples/ssd/eval.py | import argparse
import sys
import chainer
from chainer import iterators
from chainercv.datasets import VOCDetectionDataset
from chainercv.evaluations import eval_detection_voc
from chainercv.links import SSD300
from chainercv.links import SSD512
def main():
parser = argparse.ArgumentParser()
parser.add_argu... | import argparse
import sys
import chainer
from chainer import iterators
from chainercv.datasets import VOCDetectionDataset
from chainercv.evaluations import eval_detection_voc
from chainercv.links import SSD300
from chainercv.links import SSD512
def main():
parser = argparse.ArgumentParser()
parser.add_argu... | mit | Python |
eda5ebfe721a1149167e0bb7cd278287383c701f | Fix path for statics | Atom1c/home,Atom1c/home,Atom1c/home | firstapp/settings.py | firstapp/settings.py | """
Django settings for firstapp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | """
Django settings for firstapp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | unlicense | Python |
19afdb08e541c483d861eb01c06fac41cf329c43 | Fix flake error | houqp/floyd-cli,mckayward/floyd-cli,mckayward/floyd-cli,houqp/floyd-cli | floyd/client/auth.py | floyd/client/auth.py | import requests
import floyd
from floyd.exceptions import AuthenticationException
from floyd.client.base import FloydHttpClient
from floyd.model.user import User
class AuthClient(FloydHttpClient):
"""
Auth/User specific client
"""
def __init__(self):
self.base_url = "{}/api/v1/user/".format(f... | import requests
import floyd
from floyd.exceptions import AuthenticationException
from floyd.client.base import FloydHttpClient
from floyd.model.user import User
class AuthClient(FloydHttpClient):
"""
Auth/User specific client
"""
def __init__(self):
self.base_url = "{}/api/v1/user/".format(f... | apache-2.0 | Python |
0af2ed0a81168f01420b753660ef428a35bd17a8 | delete redudant code. | gardenia22/leetcode | fractionToDecimal.py | fractionToDecimal.py | class Solution(object):
def fractionToDecimal(self, numerator, denominator):
"""
:type numerator: int
:type denominator: int
:rtype: str
"""
if denominator==0: return None
if numerator==0: return "0"
sign = 1
if numerator<0:
numera... | class Solution(object):
def fractionToDecimal(self, numerator, denominator):
"""
:type numerator: int
:type denominator: int
:rtype: str
"""
if denominator==0: return None
if numerator==0: return "0"
sign = 1
if numerator<0:
numera... | cc0-1.0 | Python |
7eeb4c122cf019ce8a9159d4efc5cdbd6897c8e4 | Add distance and velocity scales to configuration; allow them to be set on the flu | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | galpy/util/config.py | galpy/util/config.py | import os, os.path
try:
import configparser
except:
from six.moves import configparser
# The default configuration
default_configuration= {'astropy-units':'False',
'ro':'8.',
'vo':'220.'}
default_filename= os.path.join(os.path.expanduser('~'),'.galpyrc')
def write... | import os, os.path
try:
import configparser
except:
from six.moves import configparser
# The default configuration
default_configuration= {'astropy-units':'False'}
default_filename= os.path.join(os.path.expanduser('~'),'.galpyrc')
def write_default(filename):
writeconfig= configparser.ConfigParser()
# W... | bsd-3-clause | Python |
fa98f32ce9c2d4e7dff8281bf5e6f154b82599d6 | Use python import lib (django import lib will be removed in 1.9). | brilliant-org/gargoyle,brilliant-org/gargoyle,brilliant-org/gargoyle | gargoyle/__init__.py | gargoyle/__init__.py | """
gargoyle
~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
__all__ = ('gargoyle', 'ConditionSet', 'autodiscover', 'VERSION')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('gargoyle').version
except Exception, e:
VERSION = 'unkno... | """
gargoyle
~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
__all__ = ('gargoyle', 'ConditionSet', 'autodiscover', 'VERSION')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('gargoyle').version
except Exception, e:
VERSION = 'unkno... | apache-2.0 | Python |
57d26ccf02409388a4383e8bc37b5790ca3296de | Upgrade to vREADME.md conversion to reStructuredText failed. Error: [Errno 2] No such file or directory 0.2.5 | biolink/ontobio,biolink/ontobio | ontobio/__init__.py | ontobio/__init__.py | __version__ = '0.2.5'
| __version__ = '0.2.4'
| bsd-3-clause | Python |
e839ad022b9410d946b2f4305c28150256ed3689 | make submodules available on "openrtb" without explicit imports | gsakkis/openrtb,anossov/openrtb | openrtb/__init__.py | openrtb/__init__.py | from . import request
from . import response
from . import constants
from . import macros
from . import mobile
from . import iab | bsd-2-clause | Python | |
3443c7164e490e0607fff599c497a4fc054f3c48 | Update i18n domain to correct project name | citrix-openstack-build/oslo.cache,openstack/oslo.cache,openstack/oslo.cache | oslo_cache/_i18n.py | oslo_cache/_i18n.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | Python |
ec235e290b4428dec2db03a19d678eba52f02fb5 | Use module namespaces to distinguish names instead of 'original_' prefix | jaraco/keyring | keyring/getpassbackend.py | keyring/getpassbackend.py | """Specific support for getpass."""
import os
import getpass
import keyring.core
def get_password(prompt='Password: ', stream=None,
service_name='Python',
username=None):
if username is None:
username = getpass.getuser()
return keyring.core.get_password(service_name, ... | """Specific support for getpass."""
import os
import getpass
from keyring.core import get_password as original_get_password
def get_password(prompt='Password: ', stream=None,
service_name='Python',
username=None):
if username is None:
username = getpass.getuser()
retu... | mit | Python |
cb32c2b91985128dbbbfc2ae906dee6e57f4df77 | fix url | tehron/tehbot | tehbot/plugins/translate/__init__.py | tehbot/plugins/translate/__init__.py | from tehbot.plugins import *
import tehbot.plugins as plugins
import urllib
import urllib2
import json
import shlex
class TranslatePlugin(StandardPlugin):
def __init__(self):
StandardPlugin.__init__(self)
self.parser.add_argument("words", metavar='W', nargs="+")
self.parser.add_argument("-f... | from tehbot.plugins import *
import tehbot.plugins as plugins
import urllib
import urllib2
import lxml.html
import shlex
class TranslatePlugin(StandardPlugin):
def __init__(self):
StandardPlugin.__init__(self)
self.parser.add_argument("words", metavar='W', nargs="+")
self.parser.add_argumen... | mit | Python |
ee450dca143e10b48f6e5cd1e535b9d8cceae5e0 | Update relationship helper | AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,hasanalom/ggrc-core,prasannav7/ggrc-core,plamut/ggrc-core,prasannav7/ggrc-core,prasannav7/ggrc-core,hasanalom/ggrc-core,VinnieJohns/ggrc-core,hasanalom/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,andrei-karalion... | src/ggrc/models/relationship_helper.py | src/ggrc/models/relationship_helper.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from sqlalchemy import and_
from ggrc import db
from ggrc.models.relationship i... | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from sqlalchemy import and_
from ggrc import db
from ggrc.models.relationship ... | apache-2.0 | Python |
ce9512198c65235d70fdbd0c879d8f6866afa8eb | Update station-update.py | cllamb0/dosenet-raspberrypi,bearing/dosenet-raspberrypi,cllamb0/dosenet-raspberrypi,yarocoder/dosenet-raspberrypi,tybtab/dosenet-raspberrypi,yarocoder/dosenet-raspberrypi,bearing/dosenet-raspberrypi,tybtab/dosenet-raspberrypi | station-update.py | station-update.py | # Author: Yaro Kaminskiy
'''
This script securely copies the Pi-hat network configuration file from the Dosenet servers to a Pi-hat at a school of interest and
updates the network ID on the network configuration file for the Pi-hat.
'''
# Import the relevant modules and functions from the appropriate libraries... | # Author: Yaro Kaminskiy
'''
This script securely copies the Pi-hat network configuration file from the Dosenet servers to a Pi-hat at a school of interest and
updates the network ID on the network configuration file for the Pi-hat.
'''
# Import the relevant modules and functions from the appropriate libraries... | mit | Python |
7714ca6632ba55b979ae6f849a235f581b4f49eb | disable line splitting by default | omniscale/imposm,Alpstein/imposm | imposm/config.py | imposm/config.py | # Copyright 2011 Omniscale (http://omniscale.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2011 Omniscale (http://omniscale.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 | Python |
778cf0b053fe48f270b08668ecc0131f0f29dd64 | Complete iter sol | bowen0701/algorithms_data_structures | lc0057_insert_interval.py | lc0057_insert_interval.py | """Leetcode 57. Insert Interval
Hard
Given a set of non-overlapping intervals, insert a new interval into the intervals
(merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Example 1:
Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
Output: [[1,5],[6,9]]
... | """Leetcode 57. Insert Interval
Hard
Given a set of non-overlapping intervals, insert a new interval into the intervals
(merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Example 1:
Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
Output: [[1,5],[6,9]]
... | bsd-2-clause | Python |
dbadc5d9dd2e4dbab8a079e1b5cecec5c59c91f9 | Add comments: bottom-up DP by iter | bowen0701/algorithms_data_structures | lc0070_climbing_stairs.py | lc0070_climbing_stairs.py | """Leetcode 70. Climbing Stairs
Easy
URL: https://leetcode.com/problems/climbing-stairs/
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways
can you climb to the top?
Note: Given n will be a positive integer.
Example 1:
Input:... | """Leetcode 70. Climbing Stairs
Easy
URL: https://leetcode.com/problems/climbing-stairs/
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways
can you climb to the top?
Note: Given n will be a positive integer.
Example 1:
Input:... | bsd-2-clause | Python |
9bba5074f11d9be5892a0e996cf04ce338e20e2c | optimize code for judging whether is 403 | ResolveWang/WeiboSpider,ResolveWang/WeiboSpider | page_parse/basic.py | page_parse/basic.py | from bs4 import BeautifulSoup
from decorators import parse_decorator
@parse_decorator(False)
def is_404(html):
soup = BeautifulSoup(html, 'html.parser')
try:
# request is redirected by js code
if "http://weibo.com/sorry?pagenotfound" in html:
return True
elif soup.title.te... | from bs4 import BeautifulSoup
from decorators import parse_decorator
@parse_decorator(False)
def is_404(html):
soup = BeautifulSoup(html, 'html.parser')
# 前一种情况是处理直接用js实现重定向的页面
try:
if "http://weibo.com/sorry?pagenotfound" in html:
return True
elif soup.title.text == '404错误':
... | mit | Python |
4581408acb9c8369bbee029f120e57bd5079c348 | fix demo | mcfletch/AutobahnPython,iffy/AutobahnPython,hzruandd/AutobahnPython,tavendo/AutobahnPython,tomwire/AutobahnPython,wrapp/AutobahnPython,jvdm/AutobahnPython,inirudebwoy/AutobahnPython,dash-dash/AutobahnPython,wrapp/AutobahnPython,dash-dash/AutobahnPython,flyser/AutobahnPython,nucular/AutobahnPython,iffy/AutobahnPython,le... | demo/echo/echo_server_with_logging.py | demo/echo/echo_server_with_logging.py | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | apache-2.0 | Python |
4a711a2709ec5d8a8e04bb0f735fcfaa319cffdf | Fix the displayed error message in V2 API | tonyli71/designate,openstack/designate,ionrock/designate,ionrock/designate,ramsateesh/designate,grahamhayes/designate,cneill/designate-testing,muraliselva10/designate,muraliselva10/designate,cneill/designate-testing,openstack/designate,tonyli71/designate,muraliselva10/designate,grahamhayes/designate,ionrock/designate,t... | designate/objects/validation_error.py | designate/objects/validation_error.py | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | apache-2.0 | Python |
15ddfc5094c367f26a00ecefc31afe05c69033c9 | Update views.py | carthagecollege/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthage-college/django-djforms,carthage-college/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthagecollege/django-djforms | djforms/communications/print/views.py | djforms/communications/print/views.py | from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse_lazy
from djforms.communications.print.forms import ChanceOfForm
from djtools.utils.mail import send_mail... | unlicense | Python | |
d0ade9b2e945c13edfe21237fb060cdb3c21c442 | Set a new version number: 0.9.0-alpha0. | WoLpH/jedi,dwillmer/jedi,jonashaag/jedi,tjwei/jedi,mfussenegger/jedi,WoLpH/jedi,jonashaag/jedi,dwillmer/jedi,mfussenegger/jedi,tjwei/jedi,flurischt/jedi,flurischt/jedi | jedi/__init__.py | jedi/__init__.py | """
Jedi is an autocompletion tool for Python that can be used in IDEs/editors.
Jedi works. Jedi is fast. It understands all of the basic Python syntax
elements including many builtin functions.
Additionaly, Jedi suports two different goto functions and has support for
renaming as well as Pydoc support and some other ... | """
Jedi is an autocompletion tool for Python that can be used in IDEs/editors.
Jedi works. Jedi is fast. It understands all of the basic Python syntax
elements including many builtin functions.
Additionaly, Jedi suports two different goto functions and has support for
renaming as well as Pydoc support and some other ... | mit | Python |
4dd9abd6a9df35ef6b6488cccdd3b4a7f80c094a | add test for console error | Kriechi/mitmproxy,mhils/mitmproxy,vhaupert/mitmproxy,Kriechi/mitmproxy,mitmproxy/mitmproxy,mitmproxy/mitmproxy,mitmproxy/mitmproxy,vhaupert/mitmproxy,mhils/mitmproxy,mhils/mitmproxy,Kriechi/mitmproxy,mhils/mitmproxy,vhaupert/mitmproxy,mitmproxy/mitmproxy,vhaupert/mitmproxy,mitmproxy/mitmproxy,Kriechi/mitmproxy,mhils/mi... | test/mitmproxy/test_command_lexer.py | test/mitmproxy/test_command_lexer.py | import pyparsing
import pytest
from hypothesis import given, example
from hypothesis.strategies import text
from mitmproxy import command_lexer
@pytest.mark.parametrize(
"test_input,valid", [
("'foo'", True),
('"foo"', True),
("'foo' bar'", False),
("'foo\\' bar'", True),
... | import pyparsing
import pytest
from hypothesis import given, example
from hypothesis.strategies import text
from mitmproxy import command_lexer
@pytest.mark.parametrize(
"test_input,valid", [
("'foo'", True),
('"foo"', True),
("'foo' bar'", False),
("'foo\\' bar'", True),
... | mit | Python |
7695eb4199033cbd6b70f716f94d2f13256eac61 | Fix space | dotastro/hack-list-submission-app,dotastro/hack-list-submission-app | dotastro_hack_submission/add_files.py | dotastro_hack_submission/add_files.py | from github import InputGitTreeElement
def add_files(repo, branch, message, files):
"""
Add a new file to a new branch in a GitHub repo
"""
# Get commit then git commit (not sure about the difference)
commit = repo.get_branch('master').commit
git_commit = repo.get_git_commit(commit.sha)
... | from github import InputGitTreeElement
def add_files(repo, branch, message, files):
"""
Add a new file to a new branch in a GitHub repo
"""
# Get commit then git commit (not sure about the difference)
commit = repo.get_branch('master').commit
git_commit = repo.get_git_commit(commit.sha)
... | mit | Python |
e1f622394fbb4f3fe970274fa112a296a3e99d34 | Update version to 1.1.0. | lweasel/piquant,lweasel/piquant | piquant/__init__.py | piquant/__init__.py | __version__ = "1.1.0"
| __version__ = "1.0.0"
| mit | Python |
568f57be69e58112ac1742d62ca1c60a672e654b | Change parsing logic to fix rare bug | Kankroc/pdf2image,Belval/pdf2image | pdf2image/pdf2image.py | pdf2image/pdf2image.py | import os
import sys
import tempfile
from subprocess import Popen, PIPE
from PIL import Image
from io import BytesIO
def convert_from_path(pdf_path, dpi=200, output_folder=None):
"""
Description: Convert PDF to Image will throw whenever one of the condition is reached
Parameters:
pdf_p... | import os
import sys
import tempfile
from subprocess import Popen, PIPE
from PIL import Image
from io import BytesIO
def convert_from_path(pdf_path, dpi=200, output_folder=None):
"""
Description: Convert PDF to Image will throw whenever one of the condition is reached
Parameters:
pdf_p... | mit | Python |
9e62ede0dbac92fe6e019dc41231d5c41b74634b | Fix import path. | stanford-mast/nn_dataflow | tests/loop_blocking_test/__init__.py | tests/loop_blocking_test/__init__.py | """ $lic$
Copyright (C) 2016-2017 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
If you use this program in your research, we request that you reference th... | """ $lic$
Copyright (C) 2016-2017 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
If you use this program in your research, we request that you reference th... | bsd-3-clause | Python |
8a12765bb4679169db72aa2a6dcf97033935ed19 | Fix test_marker_cluster() | ocefpaf/folium,ocefpaf/folium,python-visualization/folium,python-visualization/folium | tests/plugins/test_marker_cluster.py | tests/plugins/test_marker_cluster.py | # -*- coding: utf-8 -*-
"""
Test MarkerCluster
------------------
"""
from __future__ import (absolute_import, division, print_function)
import folium
from folium import plugins
from jinja2 import Template
import numpy as np
def test_marker_cluster():
N = 100
np.random.seed(seed=26082009)
data = np.... | # -*- coding: utf-8 -*-
"""
Test MarkerCluster
------------------
"""
from __future__ import (absolute_import, division, print_function)
import folium
from folium import plugins
from jinja2 import Template
import numpy as np
def test_marker_cluster():
N = 100
np.random.seed(seed=26082009)
data = np.... | mit | Python |
1df73f0d3ad58529af4ea467e4e0a12ec27cb88a | Update version | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | heufybot/__init__.py | heufybot/__init__.py | __version__ = "0.6.0"
| __version__ = "0.5.1"
| mit | Python |
6d23cf127d84f4d0cec4e14a4860b77dafc43d26 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/dd86ee005d040b1bffe201e1b0b6317793d29b79. | karllessard/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,Intel-tensorflow... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "dd86ee005d040b1bffe201e1b0b6317793d29b79"
TFRT_SHA256 = "ab15420fb2529bb7095ac8c8ab27fd6cb3621dda2d1ce3... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a0bab4f954981456013d2d50cef9d4a1dd086cca"
TFRT_SHA256 = "cd0af38f5ccc78adcf9e3c6eb4fc1e82134c316ae91327... | apache-2.0 | Python |
d0f69c225e767da8180f7f5adf0444505a3b0c2a | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0f09e1bfa72855b9f00c28dd95a95f848c42170c. | frreiss/tensorflow-fred,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0f09e1bfa72855b9f00c28dd95a95f848c42170c"
TFRT_SHA256 = "21923a998212b9b1f3b05b4cf00f18c5e5c866b54fc603... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "b1c7cce21ba4661c17ac72421c6a0e2015e7bef3"
TFRT_SHA256 = "f80438bee9906e9ecb1a8a4ae2365374ac1e8a28389728... | apache-2.0 | Python |
dda3263b1931733ffe818b92e1ede693ba648646 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/d128a635e3c72c8d2d13974f7747e3b1115a37ef. | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_librar... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d128a635e3c72c8d2d13974f7747e3b1115a37ef"
TFRT_SHA256 = "b5974c85b4142a4640905b1f3d44... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "da541333433f74881d8f44947369756d40d5e7fe"
TFRT_SHA256 = "df492c902908141405e88af81c4b... | apache-2.0 | Python |
7863e3b6dd66c5ab801325810034e9706b24c37b | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/c046ed097b15a522e9c6c6cda1a31b1ca85328f5. | Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflo... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c046ed097b15a522e9c6c6cda1a31b1ca85328f5"
TFRT_SHA256 = "37bee85d22c32873de455cd06ffe4fa2d8a4320b5d17c8... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c2016eabb0f7d6339d629b0e4d804b34b9b85e7d"
TFRT_SHA256 = "b889c390f2675e27b2b31c5ff5ca587da891aa27cb5846... | apache-2.0 | Python |
22871c07fdc4b3ad8f2c8965981be5328fdbbf57 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/75970f31f559f43ce0cabc2a4fecd28a2741bdb1. | tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,gau... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "75970f31f559f43ce0cabc2a4fecd28a2741bdb1"
TFRT_SHA256 = "456a5e96a260cb2dd6dab01b5cdb248f08233d0ed3d801... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ef99b130971cbbc43b8201d3545e9198c1be5ae0"
TFRT_SHA256 = "c8db5cd07d49f8f7fd60ac3bcf8cb29a7922858a6114fa... | apache-2.0 | Python |
1965be57792c5a9f890a0982f5359710854bf005 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/928000d021775f8b82b496f318c34f002c095d2c. | paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "928000d021775f8b82b496f318c34f002c095d2c"
TFRT_SHA256 = "91fcdd9663f4bf5f725ed86a3bd1... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "530d3c4e9493a00e6dc51451353ea156e7c1b058"
TFRT_SHA256 = "fedad2d676ea9f9aaa82036d8e45... | apache-2.0 | Python |
4e8374a7fe1bdf4c13d758e92a98a830c84a25ae | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/aeaf46a23ce59da113d618f6a48951581f2a4777. | tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow,pao... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "aeaf46a23ce59da113d618f6a48951581f2a4777"
TFRT_SHA256 = "9ec67bbe9b8a149b01ea4461c3f7... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "e76e777d3a308f2ddad6e6cc61da1b4217cae92b"
TFRT_SHA256 = "1219d79c5c7003d7cf2ca67b4fbc... | apache-2.0 | Python |
8f54aa9bb6aa9b914055b6735bb9ac25cb181b50 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/beb27dc304ba02d4ff17441cdb6c7f5edd77f4a4. | paolodedios/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "beb27dc304ba02d4ff17441cdb6c7f5edd77f4a4"
TFRT_SHA256 = "59025d0b9f98d514dfba37275509... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0a77ba77a0e7f58932a038381d997c231947c77f"
TFRT_SHA256 = "b9925ab84a02b3ebb711b0acd86b... | apache-2.0 | Python |
2d3dc42d621092cade7d5f0791a0308ea27d5af4 | Remove unused imports in image2.py | frostidaho/qtile,frostidaho/qtile | libqtile/widget/image2.py | libqtile/widget/image2.py | from __future__ import division
from . import base
from .. import bar
from .. import images
class Image2(base._Widget, base.MarginMixin):
"""Display an image on the bar"""
orientations = base.ORIENTATION_BOTH
defaults = [
('loaded_image', None, 'image created by libqtile.images.Loader'),
]
... | from __future__ import division
import os
import cairocffi
from . import base
from .. import bar
from .. import images
class Image2(base._Widget, base.MarginMixin):
"""Display an image on the bar"""
orientations = base.ORIENTATION_BOTH
defaults = [
('loaded_image', None, 'image created by libqt... | mit | Python |
d5c21e054f553efac91fbf22deffe6f7a4249252 | Add pickle support | skuarch/namebench,sund/namebench,cloudcache/namebench,tcffisher/namebench,jaechankim/namebench,cartersgenes/namebench,jaded44/namebench,Bandito43/namebench,el-lumbergato/namebench,donavoncade/namebench,Trinitaria/namebench,corruptnova/namebench,omerhasan/namebench,asolfre/namebench,wa111/namebench,TorpedoXL/namebench,j... | tools/check_nameserver_popularity.py | tools/check_nameserver_popularity.py | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -syslog -"4.2.2.1" -site:cqcounter.com -site:flow.n... | #!/usr/bin/env python
import os
import sys
import time
import traceback
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = ' -site:ebrara.com -statistics -"country name" -"Q_RTT" -site:botsvsbrowsers.com -"ptr record" -site:... | apache-2.0 | Python |
0ae360b675f2dd0b3607af1bc7b72864e43236b2 | Change default example for allowed hosts | leyyin/stk-stats,supertuxkart/stk-stats,leyyin/stk-stats,supertuxkart/stk-stats | userreport/settings_local.EXAMPLE.py | userreport/settings_local.EXAMPLE.py | # Fill in this file and save as settings_local.py
PROJECT_NAME = 'SuperTuxKart'
PROJECT_URL = 'http://supertuxkart.net/'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
# Add the name/ip of the server that is running the stats server
ALLOWED_HOSTS = ["addons.supe... | # Fill in this file and save as settings_local.py
PROJECT_NAME = 'SuperTuxKart'
PROJECT_URL = 'http://supertuxkart.net/'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
# Add the name/ip of the server that is running the stats server
ALLOWED_HOSTS = ["api.stkaddo... | mit | Python |
24bf60cfaf58913ece8f6848edc8b46c051fc558 | Load google maps JavaScript file from https URL, otherwise it won't work on ssl enabled websites with modern browsers (e.g. Chrome). | voodmania/django-location-field,caioariede/django-location-field,voodmania/django-location-field,Mixser/django-location-field,recklessromeo/django-location-field,Mixser/django-location-field,undernewmanagement/django-location-field,caioariede/django-location-field,recklessromeo/django-location-field,janusnic/django-loc... | location_field/widgets.py | location_field/widgets.py | from django.forms import widgets
from django.utils.safestring import mark_safe
class LocationWidget(widgets.TextInput):
def __init__(self, attrs=None, based_fields=None, zoom=None, **kwargs):
self.based_fields = based_fields
self.zoom = zoom
super(LocationWidget, self).__init__(attrs)
... | from django.forms import widgets
from django.utils.safestring import mark_safe
class LocationWidget(widgets.TextInput):
def __init__(self, attrs=None, based_fields=None, zoom=None, **kwargs):
self.based_fields = based_fields
self.zoom = zoom
super(LocationWidget, self).__init__(attrs)
... | mit | Python |
2c87dbacf9dd5ac8c56c33e170e406d8b5728ef6 | Fix english in models | 21strun/django-maintenancemode,21strun/django-maintenancemode | maintenancemode/models.py | maintenancemode/models.py | #!/usr/bin/env python
# coding: utf-8
from django.db import models
class IgnoredUrls(models.Model):
url = models.CharField(
verbose_name=u"Ignored url pattern", default='^/', max_length=12800)
class Meta:
verbose_name = u"ignored url pattern"
verbose_name_plural = u"ignored url patte... | #!/usr/bin/env python
# coding: utf-8
from django.db import models
class IgnoredUrls(models.Model):
url = models.CharField(
verbose_name=u"Ignored url pattern", default='^/', max_length=12800)
class Meta:
verbose_name = u"ignored url pattern"
verbose_name_plural = u"ignored urls patt... | bsd-3-clause | Python |
18882392d141d0c858f198d9870464bb68f34753 | Use non-external links for generator/overview | DanLindeman/memegen,DanLindeman/memegen,DanLindeman/memegen,DanLindeman/memegen | memegen/routes/_common.py | memegen/routes/_common.py | import pprint
import logging
from urllib.parse import unquote
import requests
from flask import (Response, url_for as _url_for, render_template, send_file,
current_app, request)
GITHUB_BASE = "https://raw.githubusercontent.com/jacebrowning/memegen/master/"
CONTRIBUTING_URL = GITHUB_BASE + "CONTRIBU... | import pprint
import logging
from urllib.parse import unquote
import requests
from flask import (Response, url_for as _url_for, render_template, send_file,
current_app, request)
GITHUB_BASE = "https://raw.githubusercontent.com/jacebrowning/memegen/master/"
CONTRIBUTING_URL = GITHUB_BASE + "CONTRIBU... | mit | Python |
6fc2e75426eb34755bf6dbedbd21a4345d9c5738 | Add tests for website plugin | Muzer/smartbot,Cyanogenoid/smartbot,thomasleese/smartbot-old,tomleese/smartbot | plugins/websites.py | plugins/websites.py | import io
import re
import unittest
from smartbot import utils
class Plugin:
def on_message(self, bot, msg, reply):
match = re.findall(r"(https?://[^\s]+)", msg["message"], re.IGNORECASE)
for i, url in enumerate(match):
title = utils.web.get_title(url)
if title:
... | import re
from smartbot import utils
class Plugin:
def on_message(self, bot, msg, reply):
match = re.findall(r"(https?://[^\s]+)", msg["message"], re.IGNORECASE)
for i, url in enumerate(match):
title = utils.web.get_title(url)
if title:
reply("[{0}]: {1}".f... | mit | Python |
dc18cc9cfe9c701d7b5df689e0b353dcf8912e10 | add __path__ to LocalModule, to make python 3.3 happy | adamchainz/plumbum,tomerfiliba/plumbum,vodik/plumbum,henryiii/plumbum,pombredanne/plumbum,tigrawap/plumbum,siemens/plumbum,henryiii/plumbum,tigrawap/plumbum,vodik/plumbum,adamchainz/plumbum,weka-io/plumbum,astraw38/plumbum,tomerfiliba/plumbum,AndydeCleyre/plumbum,AndydeCleyre/plumbum,pombredanne/plumbum,fahhem/plumbum,... | plumbum/__init__.py | plumbum/__init__.py | r"""
Plumbum Shell Combinators
-------------------------
A wrist-handy library for writing shell-like scripts in Python, that can serve
as a ``Popen`` replacement, and much more::
>>> from plumbum.cmd import ls, grep, wc, cat
>>> ls()
u'build.py\ndist\ndocs\nLICENSE\nplumbum\nREADME.rst\nsetup.py\ntests\n... | r"""
Plumbum Shell Combinators
-------------------------
A wrist-handy library for writing shell-like scripts in Python, that can serve
as a ``Popen`` replacement, and much more::
>>> from plumbum.cmd import ls, grep, wc, cat
>>> ls()
u'build.py\ndist\ndocs\nLICENSE\nplumbum\nREADME.rst\nsetup.py\ntests\n... | mit | Python |
eb71d6eddf4cae21a6ae9bc96f6a97fd6515bd65 | FIx for running SPADE scripts against pgdb utility | MontrealCorpusTools/PolyglotDB,PhonologicalCorpusTools/PolyglotDB,PhonologicalCorpusTools/PolyglotDB,PhonologicalCorpusTools/PyAnnotationGraph,PhonologicalCorpusTools/PyAnnotationGraph,MontrealCorpusTools/PolyglotDB | polyglotdb/utils.py | polyglotdb/utils.py | from contextlib import contextmanager
import sys
from . import CorpusContext
from .client.client import PGDBClient, ClientError
from requests.exceptions import ConnectionError
def get_corpora_list(config):
"""
Get a list of all corpora on using a database configuration
Parameters
----------
confi... | from contextlib import contextmanager
import sys
from . import CorpusContext
from .client.client import PGDBClient, ClientError
from requests.exceptions import ConnectionError
def get_corpora_list(config):
"""
Get a list of all corpora on using a database configuration
Parameters
----------
confi... | mit | Python |
6335aa9b84965069ca4b29e46e6fbf832fd9f714 | Change speed test for big integers | brython-dev/brython,brython-dev/brython,brython-dev/brython | www/speed/benchmarks/big_integers.py | www/speed/benchmarks/big_integers.py | n = 60
for i in range(10000):
2 ** n
| for i in range(100):
2 ** 60
| bsd-3-clause | Python |
8099e223e7e4ef7e4c7e4a376ab1d85e85503b1e | fix naming issue | paberr/ppython | ppython/__main__.py | ppython/__main__.py | #!/usr/bin/env python3
import argparse
from curtsies import Input
from ppython.input_handler import InputHandler
from ppython.interpreter import Interpreter
from pygments import highlight
from pygments.formatters.terminal256 import TerminalTrueColorFormatter
from pygments.lexers.python import Python3Lexer
from ppyth... | #!/usr/bin/env python3
import argparse
from curtsies import Input
from ppython.input_handler import InputHandler
from ppython.interpreter import Interpreter
from pygments import highlight
from pygments.formatters.terminal256 import TerminalTrueColorFormatter
from pygments.lexers.python import Python3Lexer
from ppyth... | mit | Python |
e9ae12f30b0db8338b9303b4fa8fe863a8f2b462 | fix module name | uw-it-aca/library-guides-lti,uw-it-aca/library-guides-lti,uw-it-aca/library-guides-lti | libguide/urls.py | libguide/urls.py | from django.conf.urls import patterns, url, include
from libguide.views import LibGuideView
urlpatterns = patterns(
'',
url(r'^$', LibGuideView.as_view()),
)
| from django.conf.urls import patterns, url, include
from libguides.views import LibGuideView
urlpatterns = patterns(
'',
url(r'^$', LibGuideView.as_view()),
)
| apache-2.0 | Python |
58b8b63a8a8e9d1b61d8fc1a0f84f8b2a697efc3 | Use flask.__version__ instead of pkg_resources. | lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,lepture/flask-debugtoolbar,dianchang/flask-debugtoolbar,dianchang/flask-debugtoolbar | flask_debugtoolbar/panels/versions.py | flask_debugtoolbar/panels/versions.py | from flask import __version__ as flask_version
from flask_debugtoolbar.panels import DebugPanel
_ = lambda x: x
class VersionDebugPanel(DebugPanel):
"""
Panel that displays the Flask version.
"""
name = 'Version'
has_content = False
def nav_title(self):
return _('Versions')
def n... | import pkg_resources
from flask_debugtoolbar.panels import DebugPanel
_ = lambda x: x
flask_version = pkg_resources.get_distribution('Flask').version
class VersionDebugPanel(DebugPanel):
"""
Panel that displays the Django version.
"""
name = 'Version'
has_content = False
def nav_title(self)... | bsd-3-clause | Python |
2daf8db3a54f834feeb28b938cdbe3dc115c0eb8 | Add a parameter to knight.py to remove user rights. | dattatreya303/zulip,jessedhillon/zulip,JanzTam/zulip,natanovia/zulip,xuanhan863/zulip,vikas-parashar/zulip,kokoar/zulip,dhcrzf/zulip,niftynei/zulip,hayderimran7/zulip,showell/zulip,SmartPeople/zulip,verma-varsha/zulip,bastianh/zulip,vakila/zulip,johnnygaddarr/zulip,brockwhittaker/zulip,jrowan/zulip,hengqujushi/zulip,so... | zephyr/management/commands/knight.py | zephyr/management/commands/knight.py | from __future__ import absolute_import
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from django.core import validators
from guardian.shortcuts import assign_p... | from __future__ import absolute_import
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from django.db.utils import IntegrityError
from django.core import validators
from guardian.shortcuts import assign_p... | apache-2.0 | Python |
9c3b83e62cd7eecd74044252380ded27c98e6955 | add annotations for mongodb and IPP | zmap/ztag | ztag/annotations/protocols_zgrab2.py | ztag/annotations/protocols_zgrab2.py | import sys
from ztag.annotation import Annotation
from ztag import protocols
# Category tags: add the key tag to anything with any of the tags in the value.
ZGRAB2_CATEGORY_TAGS = {
"database": set(["mssql", "mysql", "oracle", "postgres", "mongodb"]),
}
def __process(self, obj, meta):
tag = self.protocol.p... | import sys
from ztag.annotation import Annotation
from ztag import protocols
# Category tags: add the key tag to anything with any of the tags in the value.
ZGRAB2_CATEGORY_TAGS = {
"database": set(["mssql", "mysql", "oracle", "postgres" ]),
}
def __process(self, obj, meta):
tag = self.protocol.pretty_name
... | apache-2.0 | Python |
b2685eb591b41344c669f135f943e9fb1770c693 | Refactor list_students | HarrisonAlpine/google-classroom-tools | list_students.py | list_students.py | #!/usr/bin/env python
import googlehelper as gh
import json
credentials = gh.get_credentials(gh.SCOPE_ROSTERS)
service = gh.get_service(credentials)
# course_id = '7155852796' # Computer Programming A1
# course_id = '7621825175' # Robotics
course_id = '7557587733' # Computer Programming A4
students = gh.download_... | #!/usr/bin/env python
# from googlehelper import *
import googlehelper as gh
import json
credentials = gh.get_credentials(gh.SCOPE_ROSTERS)
service = gh.get_service(credentials)
# course_id = '7155852796' # Computer Programming A1
# course_id = '7621825175' # Robotics
course_id = '7557587733' # Computer Programmin... | mit | Python |
4d203f47569ab3437bebd72cfa8c0a5baacb906e | disable unar on windows | markokr/rarfile,markokr/rarfile | test/test_tool.py | test/test_tool.py | """Alt tool tests
"""
import sys
import pytest
import rarfile
def install_unar_tool():
rarfile.tool_setup(unrar=False, unar=True, bsdtar=False, force=True)
def install_bsdtar_tool():
rarfile.tool_setup(unrar=False, unar=False, bsdtar=True, force=True)
def uninstall_alt_tool():
rarfile.tool_setup(forc... | """Alt tool tests
"""
import rarfile
def install_unar_tool():
rarfile.tool_setup(unrar=False, unar=True, bsdtar=False, force=True)
def install_bsdtar_tool():
rarfile.tool_setup(unrar=False, unar=False, bsdtar=True, force=True)
def uninstall_alt_tool():
rarfile.tool_setup(force=True)
def test_read_rar3... | isc | Python |
1314ca8a41d2452a2d153d18962dcda3672b8746 | Replace inf and -inf with NaN. | secimTools/SECIMTools,secimTools/SECIMTools,secimTools/SECIMTools | log_transform.py | log_transform.py | #!/usr/bin/env python
# Built-in packages
import logging
import argparse
from argparse import RawDescriptionHelpFormatter
# Add-on packages
import numpy as np
import pandas as pd
# Local Packages
from interface import wideToDesign
import logger as sl
def getOptions():
""" Function to pull in arguments """
... | #!/usr/bin/env python
# Built-in packages
import logging
import argparse
from argparse import RawDescriptionHelpFormatter
# Add-on packages
import numpy as np
import pandas as pd
# Local Packages
from interface import wideToDesign
import logger as sl
def getOptions():
""" Function to pull in arguments """
... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.