commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
f428dace08e11cdba34767dea989380fa6d4e423 | Add long_description | setup.py | setup.py | #!/usr/bin/env python
import os
from setuptools import setup
requires = [
'mecab-python3',
]
def read(name):
return open(os.path.join(os.path.dirname(__file__), name)).read()
setup(
name='miura',
version='0.1.0',
description='MIURA: pattern matcher for morpheme sequences',
long_descripti... | #!/usr/bin/env python
from setuptools import setup
requires = [
'mecab-python3',
]
setup(
name='miura',
version='0.1.0',
description='MIURA: pattern matcher for morpheme sequences',
author='Yuya Unno',
author_email='unnonouno@gmail.com',
url='https://github.com/unnonouno/miura',
p... | Python | 0.001235 |
d24daa18023d0d59d70a4328466613f3a03de039 | add tests_require packages | setup.py | setup.py | import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
setup(
author="",
author_email="",
description="",
name="pinax-co... | import codecs
from os import path
from setuptools import find_packages, setup
def read(*parts):
filename = path.join(path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
setup(
author="",
author_email="",
description="",
name="pinax-co... | Python | 0.000001 |
a61b79a6d427745f3bf240554b3dd852d8e6ed65 | Add classifiers | setup.py | setup.py | from distutils.core import setup
setup(name='Fridge',
version='0.1',
py_modules=['fridge'],
description='Persistent JSON-encoded distionary',
author='Anton Barkovsky',
author_email='swarmer.pm@gmail.com',
url='http://fridge.readthedocs.org/',
classifiers=[
... | from distutils.core import setup
setup(name='Fridge',
version='0.1',
py_modules=['fridge'],
description='Persistent JSON-encoded distionary',
author='Anton Barkovsky',
author_email='swarmer.pm@gmail.com',
url='http://fridge.readthedocs.org/')
| Python | 0.000907 |
3bf4ce1f01d3e67702d91ccf4119ad6d956af99e | bump to 0.4.4 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of socketpool.
# See the NOTICE for more information.
import os
from setuptools import setup, find_packages
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License... | #!/usr/bin/env python
# -*- coding: utf-8 -
#
# This file is part of socketpool.
# See the NOTICE for more information.
import os
from setuptools import setup, find_packages
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License... | Python | 0.000019 |
590a7b926af1e57d48a087f18556caa4f3e1170c | Remove the duplicated filter in PreferenceAdmin | admin.py | admin.py | # -*- coding: utf-8 -*-
# File: src/webframe/admin.py
# Date: 2019-11-21 14:55
# Author: Kenson Man <kenson@breakthrough.org.hk>
# Desc: The file provide the Admin-Tools in webframe module
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _, ugettext
from .models import *
impo... | # -*- coding: utf-8 -*-
# File: src/webframe/admin.py
# Date: 2019-11-21 14:55
# Author: Kenson Man <kenson@breakthrough.org.hk>
# Desc: The file provide the Admin-Tools in webframe module
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _, ugettext
from .models import *
impo... | Python | 0.000001 |
b6b4e423ede0a63a6c0a058cacc665aa08849046 | Replace Unwrapped with Value on proto method names (#2283) | synth.py | synth.py | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 |
83dd154759a430918931072e8e82db413c4f5741 | Use proper settings | tasks.py | tasks.py | # encoding: utf-8
from invoke import task
from waterbutler import settings
@task
def tornado(port=settings.PORT, address=settings.ADDRESS, debug=settings.DEBUG):
from waterbutler.server import serve
serve(port, address, debug)
| # encoding: utf-8
from invoke import task
from waterbutler.server import settings
@task
def tornado(port=settings.PORT, address=settings.ADDRESS, debug=settings.DEBUG):
from waterbutler.server import serve
serve(port, address, debug)
| Python | 0.000008 |
cae6d756294c90b93e5505ce5eec9f93ced83398 | Improve test task; switch flake8->syntax | tasks.py | tasks.py | # -*- coding: utf-8 -*-
import os
import sys
import webbrowser
from invoke import task
docs_dir = 'docs'
build_dir = os.path.join(docs_dir, '_build')
@task
def test(ctx, watch=False, last_failing=False):
"""Run the tests.
Note: --watch requires pytest-xdist to be installed.
"""
import pytest
syn... | # -*- coding: utf-8 -*-
import os
import sys
import webbrowser
from invoke import task
docs_dir = 'docs'
build_dir = os.path.join(docs_dir, '_build')
@task
def test(ctx):
flake(ctx)
import pytest
errcode = pytest.main(['tests'])
sys.exit(errcode)
@task
def flake(ctx):
"""Run flake8 on codebase."... | Python | 0.000005 |
1235589dae5cf5dc1a8bf1114f65f0b36bb7bca1 | Simplify tests | tests.py | tests.py | """
Unit tests runner for ``django-guardian`` based on boundled example project.
Tests are independent from this example application but setuptools need
instructions how to interpret ``test`` command when we run::
python setup.py test
"""
import os
import sys
def main():
os.environ.setdefault(
"DJAN... | """
Unit tests runner for ``django-guardian`` based on boundled example project.
Tests are independent from this example application but setuptools need
instructions how to interpret ``test`` command when we run::
python setup.py test
"""
import os
import sys
import django
os.environ["DJANGO_SETTINGS_MODULE"] = ... | Python | 0.000002 |
64986995b8f13c5ce1f9adf9e3abfe2e6661a3d7 | Improve precision of docstring wording | tests.py | tests.py |
import unittest
from pysenbug import pysenbug
class TestPysenbug(unittest.TestCase):
""" Subclass unittest's TestCase in order to unit test the pysenbug module.
Due to the intentionally unpredictable nature of some of pysenbug's
use cases, there is no simple deterministic test that will always
concl... |
import unittest
from pysenbug import pysenbug
class TestPysenbug(unittest.TestCase):
""" Due to the intentionally unpredictable nature of some of pysenbug's
use cases, there is no simple deterministic test that will always
conclusively prove that the function worked as intended in a finite number
of ... | Python | 0.000463 |
3826d023191a9c1c559a4b53768a67293c7c2aba | Tweak coverage excludes. | tests.py | tests.py | import os
import sys
import unittest
import doctest
import django
south = ()
try:
if django.VERSION < (1,7):
import south
south = ('south',)
except ImportError:
pass
BASE_PATH = os.path.dirname(__file__)
def main():
"""
Standalone django model test with a 'memory-only-django-installat... | import os
import sys
import unittest
import doctest
import django
south = ()
try:
if django.VERSION < (1,7):
import south
south = ('south',)
except ImportError:
pass
BASE_PATH = os.path.dirname(__file__)
def main():
"""
Standalone django model test with a 'memory-only-django-installat... | Python | 0 |
a8efe19b3dd6c92381bf60ed34cdf1d65d49ad72 | Add test for should_dedent | tests.py | tests.py | import os
from os.path import isdir
import pytest
from filesystem_tree import FilesystemTree
@pytest.yield_fixture
def fs():
fs = FilesystemTree()
yield fs
fs.remove()
def test_it_can_be_instantiated():
assert FilesystemTree().__class__.__name__ == 'FilesystemTree'
def test_args_go_to_mk_not_root(... | import os
from os.path import isdir
import pytest
from filesystem_tree import FilesystemTree
@pytest.yield_fixture
def fs():
fs = FilesystemTree()
yield fs
fs.remove()
def test_it_can_be_instantiated():
assert FilesystemTree().__class__.__name__ == 'FilesystemTree'
def test_args_go_to_mk_not_root(... | Python | 0.000061 |
e6f14f8ef1bb0ab247d331b6ef023d35543663be | Update tests. | tests.py | tests.py | from io import open
import unittest
from partitioned_hash_join import (
build_hash_table,
h1,
is_duplicate,
join,
letters_for_result,
value_for_letter,
LETTERS
)
class PartitionedHashJoinTests(unittest.TestCase):
def test_h1(self):
self.assertEqual(h1('H1234567890'), 123)
... | from io import open
import unittest
from partitioned_hash_join import (
build_hash_table,
h1,
join,
write
)
class PartitionedHashJoinTests(unittest.TestCase):
def test_h1(self):
self.assertEqual(h1('H1234567890'), 12)
def test_join(self):
r = open('r_test_bucket.txt', 'r')
... | Python | 0 |
2a9f27c46810cb14d25ddb3282c72de4303ee5bd | raise KeyError on getitem | tests.py | tests.py | import unittest
class KV(object):
def __len__(self):
return 0
def __getitem__(self, key):
raise KeyError
class KVTest(unittest.TestCase):
def test_new_kv_is_empty(self):
self.assertEqual(len(KV()), 0)
def test_get_missing_value_raises_key_error(self):
with self.as... | import unittest
class KV(object):
def __len__(self):
return 0
class KVTest(unittest.TestCase):
def test_new_kv_is_empty(self):
self.assertEqual(len(KV()), 0)
| Python | 0 |
7090057e5d2c747cb2ee9550dba651537ce06664 | Add comment | train.py | train.py | #!/usr/bin/python3
import os
import time
import pickle
import configparser
import shutil
from time import localtime, strftime
from subprocess import call
from optparse import OptionParser
parser = OptionParser()
parser.add_option("--config_file", dest="config_file")
(options, args) = parser.parse_args()
config_file =... | #!/usr/bin/python3
import os
import time
import pickle
import configparser
import shutil
from time import localtime, strftime
from subprocess import call
from optparse import OptionParser
parser = OptionParser()
parser.add_option("--config_file", dest="config_file")
(options, args) = parser.parse_args()
config_file =... | Python | 0 |
561340c241dcbd9021e27dda44675ff8eaed9ad3 | add unix_socket argument | src/mysql.py | src/mysql.py | #!/usr/bin/env python
#
# igcollect - Mysql Status
#
# Copyright (c) 2016, InnoGames GmbH
#
try:
from mysql.connector import connect
except ImportError:
from MySQLdb import connect
from argparse import ArgumentParser
from time import time
def parse_args():
parser = ArgumentParser()
parser.add_argume... | #!/usr/bin/env python
#
# igcollect - Mysql Status
#
# Copyright (c) 2016, InnoGames GmbH
#
try:
from mysql.connector import connect
except ImportError:
from MySQLdb import connect
from argparse import ArgumentParser
from time import time
def parse_args():
parser = ArgumentParser()
parser.add_argume... | Python | 0.000015 |
b33ffb6d15c29697c158743f89c2adf5a2e19e32 | Update working draft URL. | src/setup.py | src/setup.py | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | Python | 0 |
51084b951d7d878d5400a6bfca1c8da1793b0a17 | Modify init method of staffto take in staff person type only | src/staff.py | src/staff.py | from .person import Person
class Staff(Person):
def __init__(self, first_name, last_name, person_id, has_living_space = None, has_office = None):
super(Staff, self).__init__(first_name, last_name, "staff", "N", person_id, has_living_space, has_office)
| from .person import Person
class Staff(Person):
def __init__(self, first_name, last_name, person_type, person_id, has_living_space = None, has_office = None):
super(Staff, self).__init__(first_name, last_name, person_type, "N", person_id, has_living_space, has_office)
| Python | 0 |
b4564cedb3e2829846ded5dc07cdb9dec45b6808 | allow for no body of with expression | src/parse.py | src/parse.py | import tokenize
import ast
bools = ['true', 'false']
class Parser:
def __init__(self, source_string):
self.tokenizer = tokenize.Tokenizer(source_string)
self.function_map = {
'if': self.if_,
'define': self.define,
'lambda': self.lambda_,
'struct': s... | import tokenize
import ast
bools = ['true', 'false']
class Parser:
def __init__(self, source_string):
self.tokenizer = tokenize.Tokenizer(source_string)
self.function_map = {
'if': self.if_,
'define': self.define,
'lambda': self.lambda_,
'struct': s... | Python | 0.000019 |
54b7a22465be75a81257a4f3f31cc3247fd67550 | fix encoding issues during indexation | core/processor.py | core/processor.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import sys
sys.path.append('gen-py.twisted')
sys.path.append('../lib')
import lru
from memorystructure import MemoryStructure as ms
# TODO:
# - handle errorcode
# - metadataItems -> parsing later ?
def generate_cache_from_pages_list(pageList, precision_limit = 1,... | """
"""
import sys
sys.path.append('gen-py.twisted')
sys.path.append('../lib')
import lru
from memorystructure import MemoryStructure as ms
# TODO:
# - handle errorcode
# - metadataItems -> parsing later ?
def generate_cache_from_pages_list(pageList, precision_limit = 1, precision_exceptions = [], verbose = False) :... | Python | 0.000006 |
74c294d11c3ba98f497df73fdd5d5061da601975 | add the -j argument | src/scons.py | src/scons.py | #!/usr/bin/env python
import getopt
import os.path
import string
import sys
def PrintUsage():
print "Usage: scons [OPTION]... TARGET..."
print "Build TARGET or multiple TARGET(s)"
print " "
print ' -f CONSCRIPT execute CONSCRIPT instead of "SConstruct"'
print " -j N execute... | #!/usr/bin/env python
import getopt
import os.path
import string
import sys
opts, targets = getopt.getopt(sys.argv[1:], 'f:')
Scripts = []
for o, a in opts:
if o == '-f': Scripts.append(a)
if not Scripts:
Scripts.append('SConstruct')
# XXX The commented-out code here adds any "scons" subdirs in anything
... | Python | 0.009493 |
194687d9b3809bb2e976c194c2245264c395000a | add some doctest cases of anyconfig.tests.common.MaskedImportLoader | anyconfig/tests/common.py | anyconfig/tests/common.py | #
# Copyright (C) 2011 - 2014 Satoru SATOH <ssato at redhat.com>
#
import imp
import os.path
import sys
import tempfile
def selfdir():
return os.path.dirname(__file__)
def setup_workdir():
return tempfile.mkdtemp(dir="/tmp", prefix="python-anyconfig-tests-")
def cleanup_workdir(workdir):
"""
FIXME... | #
# Copyright (C) 2011 - 2014 Satoru SATOH <ssato at redhat.com>
#
import imp
import os.path
import sys
import tempfile
def selfdir():
return os.path.dirname(__file__)
def setup_workdir():
return tempfile.mkdtemp(dir="/tmp", prefix="python-anyconfig-tests-")
def cleanup_workdir(workdir):
"""
FIXME... | Python | 0 |
73f20bde3e0d66b9b6bd787b0c2a0a581e132faa | Add `list` command to show available instances | bossimage/cli.py | bossimage/cli.py | # Copyright 2016 Joseph Wright <rjosephwright@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | # Copyright 2016 Joseph Wright <rjosephwright@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | Python | 0.000001 |
0f6272aef4fd37ca1b6cf1a0a86ccaab6ff90f82 | Add year-month parsing to monthfield in admin. | dkmodelfields/adminforms/monthfield.py | dkmodelfields/adminforms/monthfield.py | # -*- coding: utf-8 -*-
"""Admin support code for MonthFields.
"""
from dk import ttcal
from django.forms.fields import CharField
from django.forms import ValidationError
from django.forms.util import flatatt
from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
class MonthInput(T... | # -*- coding: utf-8 -*-
"""Admin support code for MonthFields.
"""
from dk import ttcal
from django.forms.fields import CharField
from django.forms import ValidationError
from django.forms.util import flatatt
from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
class MonthInput(T... | Python | 0 |
6bd9d8de1066bcd4b63ad41da676cf764b4ff00d | Update reference to sv-benchmarks | benchexec/tools/sv_benchmarks_util.py | benchexec/tools/sv_benchmarks_util.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
"""
This module contains some useful functions related to tasks in the sv-benchmarks
repos... | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
"""
This module contains some useful functions related to tasks in the sv-benchmarks
repos... | Python | 0 |
e34d437fb9ede1c5a547bbabe99978207e2a389b | Make paths manipulation stuff private | sugar/env.py | sugar/env.py | import os
import sys
import pwd
try:
from sugar.__uninstalled__ import *
except ImportError:
from sugar.__installed__ import *
import sugar.setup
def setup():
for path in sugar_python_path:
sys.path.insert(0, path)
if os.environ.has_key('PYTHONPATH'):
old_path = os.environ['PYTHONPATH']
os.environ['PYTH... | import os
import sys
import pwd
try:
from sugar.__uninstalled__ import *
except ImportError:
from sugar.__installed__ import *
import sugar.setup
def add_to_python_path(path):
sys.path.insert(0, path)
if os.environ.has_key('PYTHONPATH'):
old_path = os.environ['PYTHONPATH']
os.environ['PYTHONPATH'] = path + '... | Python | 0 |
0e2d9b496ab12d512e56041d9f4ffbadf7fab4ab | Remove unused method | sugar/env.py | sugar/env.py | # Copyright (C) 2006, Red Hat, Inc.
#
# This library 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 of the License, or (at your option) any later version.
#
# This library is distrib... | # Copyright (C) 2006, Red Hat, Inc.
#
# This library 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 of the License, or (at your option) any later version.
#
# This library is distrib... | Python | 0.000006 |
29b0f18a3b7dcc6e0123889c1c845d7511677c96 | fix indentation | squad/run.py | squad/run.py | import os
import sys
from squad.version import __version__
from squad.manage import main as manage
__usage__ = """usage: squad [OPTIONS]
Options:
-f, --fast Fast startup: skip potentially slow operations, such as
running database migrations and compiling static assets
-h, --... | import os
import sys
from squad.version import __version__
from squad.manage import main as manage
__usage__ = """usage: squad [OPTIONS]
Options:
-f, --fast Fast startup: skip potentially slow operations, such as
running database migrations and compiling static assets
-h, --he... | Python | 0.000096 |
0e0096e664997ffa935273ba66b46a1e943a685a | add json support to dump_lol | python/tools/dump_lol.py | python/tools/dump_lol.py | #!/usr/bin/python
import argparse
from l20n.format.lol.parser import Parser
import pyast.dump.raw, pyast.dump.json
def read_file(filename, charset='utf-8', errors='strict'):
with open(filename, 'rb') as f:
return f.read().decode(charset, errors)
def dump_lol(path, t):
source = read_file(path)
p ... | #!/usr/bin/python
import argparse
from l20n.format.lol.parser import Parser
import pyast
def read_file(filename, charset='utf-8', errors='strict'):
with open(filename, 'rb') as f:
return f.read().decode(charset, errors)
def dump_lol(path):
source = read_file(path)
p = Parser()
lol = p.parse(... | Python | 0.000001 |
9e7137c241684d450e8ec62fc365fd21bd20b38d | Fix gunicorn socket path | docker/usr/local/etc/gunicorn/pixel.py | docker/usr/local/etc/gunicorn/pixel.py | # Gunicorn-django settings
bind = ['unix:/app/pixel/run/gunicorn.sock']
graceful_timeout = 90
loglevel = 'error'
name = 'pixel'
python_path = '/app/pixel'
timeout = 90
workers = 3
| # Gunicorn-django settings
bind = ['unix:/app/run/gunicorn.sock']
graceful_timeout = 90
loglevel = 'error'
name = 'pixel'
python_path = '/app/pixel'
timeout = 90
workers = 3
| Python | 0.000001 |
2934b9d8de31c65fcc19bceacd16070856ca51b7 | Remove unused import of mock. | analog/tests/test_formats.py | analog/tests/test_formats.py | """Test the analog.formats module."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
import pytest
from analog.exceptions import InvalidFormatExpressionError
from analog.formats import LogFormat, NGINX
def test_predefined_valid_nginx():
... | """Test the analog.formats module."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime
try:
from unittest import mock
except ImportError:
import mock
import pytest
from analog.exceptions import InvalidFormatExpressionError
from analog... | Python | 0 |
d288a9c2433a3771e163700b44c51124da3ec338 | Fix date value from last modified to created. | post.py | post.py | # -*- coding: utf-8 -*-
import codecs
import re
import subprocess
import markdown
from jinja2 import Markup
class Post:
_pattern = r"\[\[(.*)\|(.*)\]\]|\[\[(.*)\]\]"
def __init__(self, post_id, working_dir=None):
self.post_id = post_id
self.title = post_id.replace('-', ' ')
filename ... | # -*- coding: utf-8 -*-
import codecs
import re
import subprocess
import markdown
from jinja2 import Markup
class Post:
_pattern = r"\[\[(.*)\|(.*)\]\]|\[\[(.*)\]\]"
def __init__(self, post_id, working_dir=None):
self.post_id = post_id
self.title = post_id.replace('-', ' ')
filename ... | Python | 0 |
d8cbe19c067a74366b3c3b0426217fa8b3eed59e | Update for API changes. | src/livestreamer/plugins/mlgtv.py | src/livestreamer/plugins/mlgtv.py | import re
from functools import partial
from livestreamer.plugin import Plugin
from livestreamer.stream import HDSStream, HLSStream
from livestreamer.utils import res_json, verifyjson, urlget
CONFIG_API_URL = "http://www.majorleaguegaming.com/player/config.json"
STREAM_API_URL = "http://streamapi.majorleaguegaming.... | from livestreamer.plugin import Plugin
from livestreamer.stream import HDSStream, HLSStream
from livestreamer.utils import res_json, verifyjson, urlget
import re
CONFIG_URL = "http://www.majorleaguegaming.com/player/config.json"
STREAM_ID_REGEX = r"<meta content='.+/([\w_-]+).+' property='og:video'>"
URL_REGEX = r"ht... | Python | 0 |
b829a4b8e53dc84703e03aba662b21cf1faa0a29 | Update annual_emissions.py | cea/plots/optimization/annual_emissions.py | cea/plots/optimization/annual_emissions.py | from __future__ import division
from __future__ import print_function
import plotly.graph_objs as go
import cea.plots.optimization
from cea.plots.variable_naming import NAMING, COLOR
__author__ = "Daren Thomas"
__copyright__ = "Copyright 2019, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Jimeno A.... | from __future__ import division
from __future__ import print_function
import plotly.graph_objs as go
import cea.plots.optimization
from cea.plots.variable_naming import NAMING, COLOR
__author__ = "Daren Thomas"
__copyright__ = "Copyright 2019, Architecture and Building Systems - ETH Zurich"
__credits__ = ["Jimeno A.... | Python | 0 |
5dffee80650dafda570647dde759660a3a6c9c49 | Add tests to ensure withdrawn projects have all the entity properties updated as expected. | tests/app/soc/modules/gsoc/views/test_withdraw_projects.py | tests/app/soc/modules/gsoc/views/test_withdraw_projects.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 0 |
4d1a33462e73111f2507c4fd1e990af2952ad3df | Fix serializer tests | demo/tests/serializers/tests_validations.py | demo/tests/serializers/tests_validations.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from formidable.models import Formidable
from formidable.serializers.validation import (
MinLengthSerializer, RegexpSerializer,
ValidationSerializer
)
class ValidationSerializerTest(TestCase):
increment = 0... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from formidable.models import Formidable
from formidable.serializers.validation import (
MinLengthSerializer, RegexpSerializer,
ValidationSerializer
)
class ValidationSerializerTest(TestCase):
def setUp(se... | Python | 0.000003 |
74a9cfe1206e3314890af165e5c8193c687844a0 | Add files via upload | post.py | post.py | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 4 16:23:07 2017
@author: mojod
"""
import random
import tweepy
import time
consumer_key='L3MsyCOoqgSPc4jzZV8wero0d'
consumer_secret='ZCOI3x1f8GZ9c2cJ8kPYyyBW4gRX4MJBbyHijGE1UObnAow6ka'
access_token='3789452353-dmM75KVaDGqIPz6ZtzP8b5Q6VkvzQQo9Sn34ZOZ'
ac... | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 4 16:23:07 2017
@author: mojod
"""
import random
import tweepy
consumer_key='L3MsyCOoqgSPc4jzZV8wero0d'
consumer_secret='ZCOI3x1f8GZ9c2cJ8kPYyyBW4gRX4MJBbyHijGE1UObnAow6ka'
access_token='3789452353-dmM75KVaDGqIPz6ZtzP8b5Q6VkvzQQo9Sn34ZOZ'
access_token_s... | Python | 0 |
f922671cf3f29ea55ac9077fd3579da5a7504f25 | Add typecheck to SigmodCrossEntropy | chainer/functions/sigmoid_cross_entropy.py | chainer/functions/sigmoid_cross_entropy.py | import numpy
from chainer import cuda
from chainer import function
from chainer.functions import sigmoid
from chainer.utils import type_check
class SigmoidCrossEntropy(function.Function):
"""Sigmoid activation followed by a sigmoid cross entropy loss."""
def __init__(self, use_cudnn=True):
self.use... | import numpy
from chainer import cuda
from chainer import function
from chainer.functions import sigmoid
class SigmoidCrossEntropy(function.Function):
"""Sigmoid activation followed by a sigmoid cross entropy loss."""
def __init__(self, use_cudnn=True):
self.use_cudnn = use_cudnn
def forward_c... | Python | 0 |
85d2c012bfaeeb04fa8dd31cd05a04a8dc43c14e | Add tests that have and get of nonterms raise exceptions | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(... | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
| Python | 0 |
25737b0d0389d0ccbd12d01f9076a889891f0a22 | Update XENIFACE and XENVIF | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | Python | 0 |
b6a09c80d349adc91e2a05de8864b75bcb4b71dc | Put whqled xenvif #56 into trunk | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | Python | 0 |
5d749f1d3e69ce233bd5ac81b39e535c0d02a954 | Move back to last merged tools versions, to overcome buildnumber issue | manifestspecific.py | manifestspecific.py | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | # Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of c... | Python | 0 |
bd3d60cdfbc4cb8ed7810eb433b7ccb8f802f235 | Move post.py to the new wiki helper. | post.py | post.py | #!/usr/bin/python
# Read irc logs from our private channel and post them to our wiki
import json
import os
import re
import sys
import textwrap
import wiki
with open(os.path.expanduser('~/.mediawiki'), 'r') as f:
conf = json.loads(f.read())
day_re = re.compile('^--- Day changed (.*)$')
human_re = re.compile('.... | #!/usr/bin/python
# Read irc logs from our private channel and post them to our wiki
import json
import os
import re
import sys
import textwrap
from simplemediawiki import MediaWiki
with open(os.path.expanduser('~/.mediawiki'), 'r') as f:
conf = json.loads(f.read())
wiki = MediaWiki(conf['url'])
day_re = re.... | Python | 0 |
516c18a74f1b606b03ab07091cb0004e75c0a49b | Fix kate plugin | kate_plugin.py | kate_plugin.py | """
isort/kate_plugin.py
Provides a simple kate plugin that enables the use of isort to sort Python imports
in the currently open kate file.
Copyright (C) 2013 Timothy Edmund Crosley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Pu... | """
isort/kate_plugin.py
Provides a simple kate plugin that enables the use of isort to sort Python imports
in the currently open kate file.
Copyright (C) 2013 Timothy Edmund Crosley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Pu... | Python | 0 |
f2dfbfbee1cd87f2e6f499b78eae1a8ca39dd529 | create a category form | qanda/qanda_app/forms.py | qanda/qanda_app/forms.py | from django.forms import ModelForm, Textarea, TextInput, Select
from models import Question, Answer, Reply, Category
from django import forms
from django.conf import settings
from django.utils.translation import ugettext as _
class QuestionForm(ModelForm):
def __init__(self, *args, **kwargs):
super(QuestionForm, s... | from django.forms import ModelForm, Textarea, TextInput, Select
from models import Question, Answer, Reply
from django import forms
from django.conf import settings
from django.utils.translation import ugettext as _
class QuestionForm(ModelForm):
def __init__(self, *args, **kwargs):
super(QuestionForm, self).__ini... | Python | 0.000911 |
5d69fa2a169274c65bfd047199a2df9c88f188e3 | use the taggit widget in question form | qanda/qanda_app/forms.py | qanda/qanda_app/forms.py | from django.forms import ModelForm, Textarea, TextInput, Select
from models import Question, Answer, Reply
from django import forms
class QuestionForm(ModelForm):
def __init__(self, *args, **kwargs):
super(QuestionForm, self).__init__(*args, **kwargs)
self.fields['category'].required = False
class Meta:
mode... | from django.forms import ModelForm, Textarea, TextInput, Select
from models import Question, Answer, Reply
from django import forms
class QuestionForm(ModelForm):
def __init__(self, *args, **kwargs):
super(QuestionForm, self).__init__(*args, **kwargs)
self.fields['category'].required = False
class Meta:
mode... | Python | 0.000001 |
174a374a685829ede49236f820122b442b9ec920 | Fix taichi_dynamic example (#4767) | python/taichi/examples/features/sparse/taichi_dynamic.py | python/taichi/examples/features/sparse/taichi_dynamic.py | import taichi as ti
ti.init()
x = ti.field(ti.i32)
l = ti.field(ti.i32)
n = 16
ti.root.dense(ti.i, n).dynamic(ti.j, n).place(x)
ti.root.dense(ti.i, n).place(l)
@ti.kernel
def make_lists():
for i in range(n):
for j in range(i):
ti.append(x.parent(), i, j * j)
l[i] = ti.length(x.paren... | import taichi as ti
x = ti.field(ti.i32)
l = ti.field(ti.i32)
n = 16
ti.init()
ti.root.dense(ti.i, n).dynamic(ti.j, n).place(x)
ti.root.dense(ti.i, n).place(l)
@ti.kernel
def make_lists():
for i in range(n):
for j in range(i):
ti.append(x.parent(), i, j * j)
l[i] = ti.length(x.paren... | Python | 0 |
d57161b9449faa1218e4dab55fe4b2bd6f0c3436 | Remove unused code and get rid of flake8 errors | utils.py | utils.py | import json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bea... | import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.ge... | Python | 0 |
f6d7707abcd80524857386d96495cc79795cd5d5 | use htmlparser to get a word meaning in yahoo dictionary | ydict.py | ydict.py | import urllib.request
from html.parser import HTMLParser
class DictParser(HTMLParser):
def __init__(self):
super().__init__()
self.content = False
# self.query_string = None
self.li_counter = 0
self.ignore_flag = False
def handle_starttag(self, tag, attrs):
if se... | import urllib.request
from html.parser import HTMLParser
class DictParser(HTMLParser):
# def __init__(self):
# super.__init__()
def handle_starttag(self, tag, attrs):
print("Encountered a start tag:", tag)
def handle_endtag(self, tag):
print("Encountered an end tag :", tag)
def ... | Python | 0.000006 |
0545539a6d3df83af57f973a82cff2961cbe32ec | Test db login | km3pipe/tests/test_db.py | km3pipe/tests/test_db.py | # coding=utf-8
# Filename: test_core.py
# pylint: disable=C0111,E1003,R0904,C0103,R0201,C0102
from __future__ import division, absolute_import, print_function
from km3pipe.testing import TestCase, MagicMock
from km3pipe.db import DBManager, DOMContainer
from km3pipe.logger import logging
__author__ = "Tamas Gal"
__c... | # coding=utf-8
# Filename: test_core.py
# pylint: disable=C0111,E1003,R0904,C0103,R0201,C0102
from __future__ import division, absolute_import, print_function
from km3pipe.testing import TestCase
from km3pipe.db import DOMContainer
__author__ = "Tamas Gal"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT co... | Python | 0.000001 |
bd23202dca2ac26c324aa036d9b9b95092cc43b8 | fix joined options parsing. | wa/framework/entrypoint.py | wa/framework/entrypoint.py | # Copyright 2013-2015 ARM Limited
#
# 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 w... | # Copyright 2013-2015 ARM Limited
#
# 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 w... | Python | 0.000005 |
ffbc39b4eeb4a3e4850f83faa13c1ddf616d2328 | Add mail to administrators | tools/wcloud/wcloud/utils.py | tools/wcloud/wcloud/utils.py | import sys
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
DEFAULT_EMAIL_HOST = 'mail.deusto.es'
EMAILS_SENT = []
def send_email(app, body_text, subject, from_email, to_email, body_html=None):
email_host = app.config.get('EMAIL_HOST', DEFAULT_EMAIL_HOST)
i... | import sys
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
DEFAULT_EMAIL_HOST = 'mail.deusto.es'
EMAILS_SENT = []
def send_email(app, body_text, subject, from_email, to_email, body_html=None):
email_host = app.config.get('EMAIL_HOST', DEFAULT_EMAIL_HOST)
i... | Python | 0.000001 |
abf3758d86c1ee37e458d79e62be69e4c23e515c | switch from single quote to double quote | wqflask/tests/wqflask/show_trait/test_export_trait_data.py | wqflask/tests/wqflask/show_trait/test_export_trait_data.py | import unittest
from wqflask.show_trait.export_trait_data import dict_to_sorted_list
from wqflask.show_trait.export_trait_data import cmp_samples
class TestExportTraits(unittest.TestCase):
"""Test methods related to converting dict to sortedlist"""
def test_dict_to_sortedlist(self):
"""test for conve... | import unittest
from wqflask.show_trait.export_trait_data import dict_to_sorted_list
from wqflask.show_trait.export_trait_data import cmp_samples
class TestExportTraits(unittest.TestCase):
"""Test methods related to converting dict to sortedlist"""
def test_dict_to_sortedlist(self):
'''test for conve... | Python | 0 |
ae3f9fbcf2bedba6798460569b10260c9acaa1bf | fix url to match filter | watcher/tweakerswatcher.py | watcher/tweakerswatcher.py | import requests
import json
import os.path
from watcher.watcher import Watcher
class TweakersWatcher(Watcher):
watcher_name = 'Tweakers Pricewatch'
filename = 'site_tweakers.txt'
def parse_site(self):
url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&d... | import requests
import json
import os.path
from watcher.watcher import Watcher
class TweakersWatcher(Watcher):
watcher_name = 'Tweakers Pricewatch'
filename = 'site_tweakers.txt'
def parse_site(self):
url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&d... | Python | 0 |
d3effa1b80c8d56c98451f335b8099b72fa1f61b | Remove orderdict | yelp_kafka_tool/kafka_cluster_manager/cluster_info/util.py | yelp_kafka_tool/kafka_cluster_manager/cluster_info/util.py | from collections import Counter
def get_partitions_per_broker(brokers):
"""Return partition count for each broker."""
return dict(
(broker, len(broker.partitions))
for broker in brokers
)
def get_leaders_per_broker(brokers, partitions):
"""Return count for each broker the number of t... | from collections import Counter, OrderedDict
def get_partitions_per_broker(brokers):
"""Return partition count for each broker."""
return dict(
(broker, len(broker.partitions))
for broker in brokers
)
def get_leaders_per_broker(brokers, partitions):
"""Return count for each broker th... | Python | 0.000065 |
b0212d5489b10956976365c862470e338c45509a | Test twisted and cares resolvers in netutil_test. | tornado/test/netutil_test.py | tornado/test/netutil_test.py | from __future__ import absolute_import, division, print_function, with_statement
import socket
from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip
from tornado.testing import AsyncTestCase, gen_test
from tornado.test.util import unittest
try:
from concurrent import futures
except ImportEr... | from __future__ import absolute_import, division, print_function, with_statement
import socket
from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip
from tornado.testing import AsyncTestCase, gen_test
from tornado.test.util import unittest
try:
from concurrent import futures
except ImportEr... | Python | 0 |
b0b40db76e3c602eb0c49cf99b2ab8c6ef533751 | suprime le param si la valeurr est None | sara_flexbe_states/src/sara_flexbe_states/SetRosParam.py | sara_flexbe_states/src/sara_flexbe_states/SetRosParam.py | # !/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
'''
Created on 21.09.2017
@author: Philippe La Madeleine
'''
class SetRosParam(EventState):
'''
Store a value in the ros parameter server for later use.
-- ParamName string The desired value.
># Value ob... | # !/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
'''
Created on 21.09.2017
@author: Philippe La Madeleine
'''
class SetRosParam(EventState):
'''
Store a value in the ros parameter server for later use.
-- ParamName string The desired value.
># Value ob... | Python | 0.999914 |
738fc28922e0807bd292c8257ac251f5f743c237 | Fix pep8 errors. | kotti_dkbase/__init__.py | kotti_dkbase/__init__.py | from pyramid.httpexceptions import HTTPError
from pyramid.httpexceptions import HTTPNotFound
from kotti_dkbase.views import error_view
from kotti_dkbase.views import exception_decorator
def includeme(config):
config.include('pyramid_zcml')
config.load_zcml('configure.zcml')
config.add_view(
error_... | from pyramid.httpexceptions import HTTPError
from pyramid.httpexceptions import HTTPNotFound
from kotti_dkbase.views import error_view
from kotti_dkbase.views import exception_decorator
def includeme(config):
config.include('pyramid_zcml')
config.load_zcml('configure.zcml')
config.add_view(
error_v... | Python | 0.000004 |
4b44947911660ceee3a09da08c7c22509f953872 | add TODOs | utils.py | utils.py | from __future__ import absolute_import
import csv
import logging
import json
import re
from collections import defaultdict
from utils.handlers import ColorizingStreamHandler, JSONFileHandler
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.addHandler(ColorizingStreamHandler())
logger.addHand... | from __future__ import absolute_import
import csv
import logging
import json
import re
from collections import defaultdict
from utils.handlers import ColorizingStreamHandler, JSONFileHandler
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.addHandler(ColorizingStreamHandler())
logger.addHand... | Python | 0 |
9a861757011e2f8ba17bc30b0e874d087f5afd7b | Bump version to 6.0.1b1 | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | Python | 0 |
225d3f4abe2a9145dba3f3b1e0a72b9db4aea0f7 | Fix DOB plot title | plots/gender_by_dob.py | plots/gender_by_dob.py | import dateutil
import pandas
from bokeh.charts import TimeSeries, Line
from bokeh.plotting import gridplot
from bokeh.resources import CDN
from bokeh.embed import autoload_static
import os
def plot(newest_changes):
ra_len = 1 #rolling average lenght
dox = pandas.DataFrame()
interesante = ['female','male... | import dateutil
import pandas
from bokeh.charts import TimeSeries, Line
from bokeh.plotting import gridplot
from bokeh.resources import CDN
from bokeh.embed import autoload_static
import os
def plot(newest_changes):
ra_len = 1 #rolling average lenght
dox = pandas.DataFrame()
interesante = ['female','male... | Python | 0.000005 |
491d7eca2137613978a7d88ad74fcdda9dcb5e5c | add find_packages to setup.py | plugins/geoip/setup.py | plugins/geoip/setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
version = '0.1.0'
setup(
name="alerta-geoip",
version=version,
description='Alerta plugin for GeoIP Lookup',
url='https://github.com/alerta/alerta-contrib',
license='Apache License 2.0',
author='Nick Satterly',
author_email... | #!/usr/bin/env python
import setuptools
version = '0.1.0'
setuptools.setup(
name="alerta-geoip",
version=version,
description='Alerta plugin for GeoIP Lookup',
url='https://github.com/alerta/alerta-contrib',
license='Apache License 2.0',
author='Nick Satterly',
author_email='nick.satterly... | Python | 0.000001 |
e3b71c58a409239845588ed9f20970243db45dba | add delay to slow balls movement in pygame1_sample | pong/pygame1_sample.py | pong/pygame1_sample.py | import sys, pygame
import time
pygame.init()
size = width, height = 640, 480
speed = [1, 1]
black = 0, 0, 0
screen = pygame.display.set_mode(size)
ball = pygame.image.load("ball.gif")
ballrect = ball.get_rect()
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
ball... | import sys, pygame
pygame.init()
size = width, height = 640, 480
speed = [2, 2]
black = 0, 0, 0
screen = pygame.display.set_mode(size)
ball = pygame.image.load("ball.gif")
ballrect = ball.get_rect()
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
ballrect = ballre... | Python | 0 |
a3a19a7aa8d8b4691ddd569197024961f95f4678 | Rename search method to search_html | twitterwebsearch/searcher.py | twitterwebsearch/searcher.py | """
Module for using the web interface of Twitter's search.
"""
import sys
import time
import datetime
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.... | """
Module for using the web interface of Twitter's search.
"""
import sys
import time
import datetime
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.... | Python | 0.000022 |
126e6be2dd7b61809656ada1adfe3c64cbe24c47 | Add couchbase/spock to branch merge set. | engines/ep/scripts/unmerged-commits.py | engines/ep/scripts/unmerged-commits.py | #!/usr/bin/env python2.7
# Script to show which commit(s) are not yet merged between our release branches.
from __future__ import print_function
import subprocess
import sys
class bcolors:
"""Define ANSI color codes, if we're running under a TTY."""
if sys.stdout.isatty():
HEADER = '\033[36m'
... | #!/usr/bin/env python2.7
# Script to show which commit(s) are not yet merged between our release branches.
from __future__ import print_function
import subprocess
import sys
class bcolors:
"""Define ANSI color codes, if we're running under a TTY."""
if sys.stdout.isatty():
HEADER = '\033[36m'
... | Python | 0.000001 |
c94960b8c42ab46331cf1f5b76c2c2f4deb33b9d | fix KeyError on small word set | typetrainer/tutors/common.py | typetrainer/tutors/common.py | import random
import collections
import itertools
from typetrainer.generator import make_char_chain, generate_word
class Filler(object):
def __init__(self, words, make_lengths_seq):
self.dist = {}
self.first, self.other, self.word_chars = make_char_chain(words, 3, self.dist)
self.lengths =... | import random
import collections
import itertools
from typetrainer.generator import make_char_chain, generate_word
class Filler(object):
def __init__(self, words, make_lengths_seq):
self.dist = {}
self.first, self.other, self.word_chars = make_char_chain(words, 3, self.dist)
self.lengths =... | Python | 0.000004 |
078e409d3c09e9ec0699ea95a2786c2342474bba | Return timestamp as a float in JSON. | views.py | views.py | import json
from collections import deque
from flask import request, render_template
from flask import current_app as app, abort
from util import make_status_response, generate_filename, jsonify
RECORDS_QUEUE = deque(maxlen=100)
def _prime_records_queue(q):
filename = generate_filename(app.config)
try:
... | import json
from collections import deque
from flask import request, render_template
from flask import current_app as app, abort
from util import make_status_response, generate_filename, jsonify
RECORDS_QUEUE = deque(maxlen=100)
def _prime_records_queue(q):
with open(generate_filename(app.config), 'r') as trac... | Python | 0 |
2a7ed7c2d6f37c3b6965ad92b21cecc0a4abd91a | Add first verion to upload via BioBlend | upload_datasets_to_galaxy.py | upload_datasets_to_galaxy.py | #!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Lib... | #!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")... | Python | 0 |
1f4006ba9831f47a7ccc3fa0f8f9fbbb44b0c217 | fix plot_matplotlib_hist2d.py covariance matrix | examples/plotting/plot_matplotlib_hist2d.py | examples/plotting/plot_matplotlib_hist2d.py | #!/usr/bin/env python
"""
========================================
Plot a 2D ROOT histogram with matplotlib
========================================
This example demonstrates how a 2D ROOT histogram can be displayed with
matplotlib.
"""
print __doc__
import ROOT
from matplotlib import pyplot as plt
from rootpy.plottin... | #!/usr/bin/env python
"""
========================================
Plot a 2D ROOT histogram with matplotlib
========================================
This example demonstrates how a 2D ROOT histogram can be displayed with
matplotlib.
"""
print __doc__
import ROOT
from matplotlib import pyplot as plt
from rootpy.plottin... | Python | 0.000153 |
0e7a6f58bc740479a616c973c5973bd255501004 | Update feedback_tags.py | feedback_form/templatetags/feedback_tags.py | feedback_form/templatetags/feedback_tags.py | """Template tags and filters for the ``feedback_form`` app."""
from django import template
from ..app_settings import * # NOQA
from ..forms import FeedbackForm
register = template.Library()
@register.inclusion_tag('feedback_form/partials/form.html', takes_context=True)
def feedback_form(context):
"""Template t... | """Template tags and filters for the ``feedback_form`` app."""
from django import template
from ..app_settings import * # NOQA
from ..forms import FeedbackForm
register = template.Library()
@register.inclusion_tag('feedback_form/partials/form.html', takes_context=True)
def feedback_form(context):
"""Template t... | Python | 0 |
426dd82e9b2a7c2de2b6ba9091ad67057ffe9f5f | Create db, if there isn't one. | statiki.wsgi | statiki.wsgi | import os
from os.path import abspath, dirname
import sys
#active the python virtualenv for this application
HOME = os.environ['HOME']
activate_this = '%s/.virtualenvs/statiki/bin/activate_this.py' % HOME
execfile(activate_this, dict(__file__=activate_this))
# Add the source directory to the path
HERE = dirname(abspa... | import os
from os.path import abspath, dirname
import sys
#active the python virtualenv for this application
HOME = os.environ['HOME']
activate_this = '%s/.virtualenvs/statiki/bin/activate_this.py' % HOME
execfile(activate_this, dict(__file__=activate_this))
# Add the source directory to the path
HERE = dirname(abspa... | Python | 0 |
78bfcf1561597113a91f7449642085a392c20429 | use doctype instead of service name to send email | frappe/integrations/offsite_backup_utils.py | frappe/integrations/offsite_backup_utils.py | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import glob
import os
from frappe.utils import split_emails, get_backups_path
def send_email(success, service_name, doctype, email... | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import glob
import os
from frappe.utils import split_emails, get_backups_path
def send_email(success, service_name, doctype, email... | Python | 0 |
5659ae2668edb934f422e15edb81b1977da9b2c2 | clean up | sail.py | sail.py | #!/usr/bin/python
# David Kohreidze
import csv
import os
import re
with open('keywords.csv', 'rU') as csvf:
reader = csv.reader(csvf)
links = {rows[0]:rows[1] for rows in reader}
for f in os.listdir('.'):
if os.path.isfile(f):
if f.endswith(".txt"):
s = open(f).read()
print "Processing %s.." %f
f... | #!/usr/bin/python
# David Kohreidze
import csv
import os
import re
with open('keywords.csv', 'rU') as csvf:
reader = csv.reader(csvf)
links = {rows[0]:rows[1] for rows in reader} # builds dictionary from file
for f in os.listdir('.'): # for every file in the current directory
if os.path.isfile(f): # must be a f... | Python | 0.000001 |
03c221d7ac1ca955b41577d525bd40b6188045ea | Clarify comment. | size.py | size.py | #!/usr/bin/python
# calculate the number of pixels for a stimulus
# fixed: viewer distance, vertical resolution, visual angle
# argv[1] = vertical screen height (cm)
from math import atan2, degrees
import sys
if sys.argv[1]:
h = float(sys.argv[1])
else:
h = 21.5 # Dell laptop
h = 20.6 # M... | #!/usr/bin/python
# calculate the number of pixels for a stimulus
# fixed: viewer distance, vertical resolution, visual angle
# argv[1] = vertical screen height
from math import atan2, degrees
import sys
if sys.argv[1]:
h = float(sys.argv[1])
else:
h = 21.5 # Dell laptop
h = 20.6 # Macboo... | Python | 0.000001 |
3972f861fae155b84bc344810b0e5a1c8cbb418c | Fix SMBC next page XPath | webcomix/supported_comics.py | webcomix/supported_comics.py | supported_comics = {
"xkcd": ("http://xkcd.com/1/", "//a[@rel='next']/@href", "//div[@id='comic']//img/@src"),
"Nedroid": ("http://nedroid.com/2005/09/2210-whee/", "//div[@class='nav-next']/a/@href", "//div[@id='comic']/img/@src"),
"JL8": ("http://limbero.org/jl8/1", "//a[text()='>']/@href", "//img/@src"),
... | supported_comics = {
"xkcd": ("http://xkcd.com/1/", "//a[@rel='next']/@href", "//div[@id='comic']//img/@src"),
"Nedroid": ("http://nedroid.com/2005/09/2210-whee/", "//div[@class='nav-next']/a/@href", "//div[@id='comic']/img/@src"),
"JL8": ("http://limbero.org/jl8/1", "//a[text()='>']/@href", "//img/@src"),
... | Python | 0.000221 |
b256c42f393d32d4f060fe04a1349d30c3018146 | add option to disable smart output for tasks. | task.py | task.py | from hashlib import md5
import subprocess
from cPickle \
import \
dumps
from toydist.core.utils \
import \
pprint
from errors \
import \
TaskRunFailure
# TODO:
# - factory for tasks, so that tasks can be created from strings
# instead of import (import not extensible)
class Ta... | from hashlib import md5
import subprocess
from cPickle \
import \
dumps
from toydist.core.utils \
import \
pprint
from errors \
import \
TaskRunFailure
# TODO:
# - factory for tasks, so that tasks can be created from strings
# instead of import (import not extensible)
class Ta... | Python | 0 |
c0ebc5d757e71c06a8ca3597bf92d496aa0dd5ee | update test child age | test.py | test.py | import os
import unittest
import tempfile
import json
from app import app
from app.models import db, Child, User
from datetime import datetime
class ChildViewTestCase(unittest.TestCase):
def test_child_view(self):
first_name = "Martha"
last_name = "Sosa"
birth_date= datetime.strptime(... | import os
import unittest
import tempfile
import json
from app import app
from app.models import db, Child, User
from datetime import datetime
class ChildViewTestCase(unittest.TestCase):
def test_child_view(self):
first_name = "Martha"
last_name = "Sosa"
birth_date= datetime.strptime(... | Python | 0.000002 |
e890ac9ef00193beac77b757c62911553cebf656 | Change save path to local path | test.py | test.py | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg') | Python | 0.000001 |
89b1bfaad82f1e19df51b189b65ce940983d0da1 | comment out cfl in tests since it seems to be broken. | test.py | test.py | ###
# Copyright (c) 2012-2014, spline
# All rights reserved.
###
from supybot.test import *
class ScoresTestCase(PluginTestCase):
plugins = ('Scores',)
def testScores(self):
# cfb, cfl, d1bb, golf, mlb, nascar, nba, ncb, ncw, nfl, nhl, racing, tennis, and wnba
conf.supybot.plugins.Scores... | ###
# Copyright (c) 2012-2014, spline
# All rights reserved.
###
from supybot.test import *
class ScoresTestCase(PluginTestCase):
plugins = ('Scores',)
def testScores(self):
# cfb, cfl, d1bb, golf, mlb, nascar, nba, ncb, ncw, nfl, nhl, racing, tennis, and wnba
conf.supybot.plugins.Scores... | Python | 0 |
ac8d6210b1e48e7ce1131412b45d23846b7c73d2 | Fix to minor style issue | test.py | test.py | import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| Python | 0.000001 |
5e089a1b155071bb9f009657320c9c12418f517d | debug travis | test.py | test.py | #!/usr/bin/env python
from numpy import array,nan,uint16,int64
from numpy.testing import assert_allclose
from datetime import datetime
#
try:
from .airMass import airmass
from .rawDMCreader import goRead
from .plotSolarElev import compsolar
except Exception as e:
print(e)
from airMass import airmass... | #!/usr/bin/env python
from numpy import array,nan,uint16,int64
from numpy.testing import assert_allclose
from datetime import datetime
#
try:
from .airMass import airmass
from .rawDMCreader import goRead
from .plotSolarElev import compsolar
except:
from airMass import airmass
from rawDMCreader impor... | Python | 0.000001 |
e859119ba7c898c9c5a1e3c9a719050461abc249 | test installed package | test.py | test.py | #!/usr/bin/env python3
import sys
from os import path
from unittest import TestLoader, TextTestRunner
print("Python {}".format(sys.version))
if not '--test-installed' in sys.argv:
libdir = path.join(path.abspath(path.curdir), 'lib')
sys.path.insert(0, libdir)
from tsdesktop import version
version.println()
... | #!/usr/bin/env python3
import sys
from os import path
from unittest import TestLoader, TextTestRunner
print("Python {}".format(sys.version))
libdir = path.join(path.abspath(path.curdir), 'lib')
sys.path.insert(0, libdir)
from tsdesktop import version
version.println()
ldr = TestLoader()
suite = ldr.discover('tsdesk... | Python | 0 |
10a78f1d5cfb38c14c7e5434fdd5258fdf41a351 | Fix failing tests (oops) | test.py | test.py | #!/usr/bin/env python
import os
import subprocess
import time
import glob
import unittest
class TestPasses(unittest.TestCase):
@classmethod
def setUpClass(self):
clean()
self.output = run_zx_spec("bin/test-passes.tap")
def test_zx_spec_header_displayed(self):
self.assertRegexpMatc... | #!/usr/bin/env python
import os
import subprocess
import time
import glob
import unittest
class TestPasses(unittest.TestCase):
@classmethod
def setUpClass(self):
clean()
self.output = run_zx_spec("bin/test-passes.tap")
def test_zx_spec_header_displayed(self):
self.assertRegexpMatc... | Python | 0.000002 |
8638e02de720954ed33098ec88a044dee38302f6 | test ... | test.py | test.py | #!/usr/bin/env python
import os
import socket
import sys
def test():
print "hello"
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
server_address = '/var/run/docker.sock'
sock.connect(server_address)
pass
if __name__=="__main__":
test()
sys.exit(0)
| #!/usr/bin/env python
import os
import socket
import sys
def test():
print "hello"
pass
if __name__=="__main__":
test()
sys.exit(0)
| Python | 0 |
25e2c02ebc9a19ad7fe193ed5912fcd21bec4065 | Test if machine deciphers correctly | test.py | test.py | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | Python | 0.00308 |
a93c281e126f41d9ac388ec2dafd829eed2ea6b1 | add coverage flags | test.py | test.py | import os
import sys
import subprocess
import shlex
import shutil
import sys
import time
import datetime
HERE = os.path.abspath(os.path.dirname(__file__))
# ------------------------------------------------------------------------------
def exe(command):
"""
Executes command and returns string representation... | import os
import sys
import subprocess
import shlex
import shutil
import sys
import time
import datetime
HERE = os.path.abspath(os.path.dirname(__file__))
# ------------------------------------------------------------------------------
def exe(command):
"""
Executes command and returns string representation... | Python | 0 |
c04d010366009eb49f94960ddbdaedbb5850dd98 | Fix typo in test.py | test.py | test.py | import steam, sys
valid_modes = ["bp", "schema", "assets-catalog"]
try:
testmode = sys.argv[2]
testkey = sys.argv[1]
if testmode not in valid_modes: raise Exception
except:
sys.stderr.write("Run " + sys.argv[0] + " <apikey> " + "<" + ", ".join(valid_modes) + ">\n")
raise SystemExit
steam.set_api_... | import steam, sys
valid_modes = ["bp", "schema", "assets-catalog"]
try:
testmode = sys.argv[2]
testkey = sys.argv[1]
if testmode not in valid_modes: raise Exception
except:
sys.stderr.write("Run " + sys.argv[0] + " <apikey> " + "<" + ", ".join(valid_modes) + ">\n")
raise SystemExit
steam.set_api_... | Python | 0.999785 |
4893105835a8acf4ee19a96c6fefce45f08ec08f | fix some | test.py | test.py | from __future__ import print_function
import logging
from logging import StreamHandler
from memory_profiler import profile
logger = logging.getLogger()
logger.addHandler(StreamHandler())
logger.setLevel(logging.DEBUG)
def glow_pyconf_ppt():
import requests
for i in range(1, 24):
s = requests.get('ht... | from __future__ import print_function
import logging
from logging import StreamHandler
from memory_profiler import profile
logger = logging.getLogger()
logger.addHandler(StreamHandler())
logger.setLevel(logging.DEBUG)
def glow_pyconf_ppt():
import requests
for i in range(1, 24):
s = requests.get('ht... | Python | 0.947237 |
e057b586e2dc43ff367cb1ed6fc5bbb7dbfe514c | print flask | test.py | test.py | import flask
print flask | import flask
| Python | 0.000006 |
848751ca2906a5e1e8e5ccf3828bf13994b074fe | Update test script | test.py | test.py | import xorcise
try:
console = xorcise.turn_on_console()
console.erase()
line = xorcise.Line()
console.print_line(0, line)
line = xorcise.Line(
xorcise.Character("h", xorcise.ColorAttribute.get_best_match((0, 0, 0))),
xorcise.Character("e", xorcise.ColorAttribute.get_best_match((0, 0, 255))),
... | import xorcise
try:
console = xorcise.turn_on_console()
console.erase()
line = xorcise.Line()
console.print_line(0, line)
line = xorcise.Line(
xorcise.Character("h", xorcise.ColorAttribute.black),
xorcise.Character("e", xorcise.ColorAttribute.blue),
xorcise.Character("l", xorcise.ColorAtt... | Python | 0.000001 |
35b2028ed09f64442092bdcb617c80acd1741948 | Fix for ticket #18 | urls.py | urls.py | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from mailng.extensions import loadextensions, loadmenus
loadextensions()
urlpatterns = patterns('',
# Example:
# (r'^mailng/',... | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from mailng.extensions import loadextensions, loadmenus
loadextensions()
urlpatterns = patterns('',
# Example:
# (r'^mailng/',... | Python | 0 |
a5357056bda5daf741a5096f88c50dc93bfff1b7 | fix typo | urls.py | urls.py | from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^forum/', include('nidarholm.forum.urls.debate')),
(r'^news/', include('nidarholm.news.urls.story')),
(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^forum/', include('nidarholm.forum.urls.debate')),
(r'^news/', include('nidarholm.news.urls.story'))
(r'^admin/', include(admin.site.urls)),
)
| Python | 0.999991 |
b8faad87145b777d5bf1fc807fc06dd940d0816d | Put messaging app's urls under a path | urls.py | urls.py | from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.conf import settings
#from ajax_select import urls as ajax_select_urls
from tastypie.api import Api
from storybase.api import CreativeCommonsLicenseGetProxyView
from storybase_asset.urls import urlpatterns as ass... | from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.conf import settings
#from ajax_select import urls as ajax_select_urls
from tastypie.api import Api
from storybase.api import CreativeCommonsLicenseGetProxyView
from storybase_asset.urls import urlpatterns as ass... | Python | 0 |
fbba73e772e5055dce81dd2a3f8814011733f882 | Add ajax_select lookup url. | urls.py | urls.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
## Author: Adriano Monteiro Marques <adriano@umitproject.org>
## Author: Diogo Pinheiro <diogormpinheiro@gmail.com>
##
## Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA
##
## This program is free software: you can redistribute it and/or modify... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
## Author: Adriano Monteiro Marques <adriano@umitproject.org>
## Author: Diogo Pinheiro <diogormpinheiro@gmail.com>
##
## Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA
##
## This program is free software: you can redistribute it and/or modify... | Python | 0 |
3ac72f0a9f83988584cee89896eaeb5c6f06d6b0 | Fix `previous_float` in util.py | util.py | util.py | # util.py
# Imports
import re
# raise_if_not_shape
def raise_if_not_shape(name, A, shape):
"""Raise a `ValueError` if the np.ndarray `A` does not have dimensions
`shape`."""
if A.shape != shape:
raise ValueError('{}.shape != {}'.format(name, shape))
# previous_float
PARSE_FLOAT_RE = ... | # util.py
# Imports
import re
# raise_if_not_shape
def raise_if_not_shape(name, A, shape):
"""Raise a `ValueError` if the np.ndarray `A` does not have dimensions
`shape`."""
if A.shape != shape:
raise ValueError('{}.shape != {}'.format(name, shape))
# previous_float
PARSE_FLOAT_RE = ... | Python | 0.000554 |
7e3f28329d887229345fa0e8085ca7e09fe7686e | Improve wsgi.py | wsgi.py | wsgi.py | # -*- coding: utf-8 -*-
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
application = get_wsgi_application()
| Python | 0.000005 |
8947f6f7733593ec2b701aaa0b6fb98d973b7850 | Add pull to wsgi startup process, and /uptime route to the app | wsgi.py | wsgi.py | import os
import sys
import time
import datetime
from apscheduler.scheduler import Scheduler
from bottle import Bottle, mako_view
# sys.path is a global for this python thread, so this enables local imports throughout the app
sys.path.insert(0, '.')
from fetch import fetch
from settings import datadir
from sync import... | import os
import sys
import time
import datetime
from apscheduler.scheduler import Scheduler
from bottle import Bottle, mako_view
# sys.path is a global for this python thread, so this enables local imports throughout the app
sys.path.insert(0, '.')
from fetch import fetch
from settings import datadir
from sync import... | Python | 0 |
0f570e5a0f33583dbc419be5d6d71ce9c804e131 | Upgrade comments | wsgi.py | wsgi.py | """
WSGI config for {{ project_name }} project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.setting... | """
WSGI config for {{ project_name }} project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.setting... | Python | 0 |
1e362ab8704c76e3606fae9317dd85eeb06259ea | remove superflous block size | zero.py | zero.py | #!/bin/py
import os
count = 1
def zeroToDrive():
''' write zeros to drive '''
wipes = 1
for int in range(count):
os.system(("dd if=/dev/zero |pv --progress --timer --rate --bytes| dd of=/dev/null bs=4096"))
# os.system(os.system(("dd if=/dev/zero| pv -ptrb | dd of=/dev/null bs=4096"))... | #!/bin/py
import os
count = 1
def zeroToDrive():
''' write zeros to drive '''
wipes = 1
for int in range(count):
os.system(("dd if=/dev/zero bs=4096 | pv --progress --timer --rate --bytes| dd of=/dev/null bs=4096"))
# os.system(os.system(("dd if=/dev/zero bs=4096 | pv -ptrb | dd of=/d... | Python | 0 |
1aae9f83bb0117e5bb02ab6579ff6f6e767752a5 | Use safer .get to access dict | relative_import.py | relative_import.py | '''
Copyright (c) 2014 Joaquin Duo - File under MIT License
Import this module to enable explicit relative importing on a submodule or
sub-package running it as a main module. Doing so is useful for running smoke
tests or small scripts within the module.
If you are using this tool enabled on production, make sure yo... | '''
Copyright (c) 2014 Joaquin Duo - File under MIT License
Import this module to enable explicit relative importing on a submodule or
sub-package running it as a main module. Doing so is useful for running smoke
tests or small scripts within the module.
If you are using this tool enabled on production, make sure yo... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.