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 |
|---|---|---|---|---|---|---|---|
218e7f2686eea1b55a28d041fc4df0118c2ca911 | Update ping_extension.py | third-party-synthetic/active-gate-extensions/extension-third-party-ping/src/ping_extension.py | third-party-synthetic/active-gate-extensions/extension-third-party-ping/src/ping_extension.py | from datetime import datetime
import logging
from ruxit.api.base_plugin import RemoteBasePlugin
from dynatrace import Dynatrace
from dynatrace.synthetic_third_party import SYNTHETIC_EVENT_TYPE_OUTAGE
import pingparsing
log = logging.getLogger(__name__)
class PingExtension(RemoteBasePlugin):
def initialize(sel... | from datetime import datetime
import logging
from ruxit.api.base_plugin import RemoteBasePlugin
from dynatrace import Dynatrace
from dynatrace.synthetic_third_party import SYNTHETIC_EVENT_TYPE_OUTAGE
import pingparsing
log = logging.getLogger(__name__)
class PingExtension(RemoteBasePlugin):
def initialize(sel... | Python | 0 |
1421866ac3c4e4f1f09d17019d058aa903597df5 | Add new feature: find out is current week menu created already | modules/menus_reader.py | modules/menus_reader.py | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif... | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif... | Python | 0.000001 |
8fe2a8735b11a834895d8a71fffa11349f890847 | Fix broken test. | test/cypher/cypher_record_test.py | test/cypher/cypher_record_test.py | #/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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 ... | #/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, Nigel Small
#
# 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 ... | Python | 0.000007 |
fe1d7b70302f56a43bef3c0d400db829510d93da | Replace the old tokenizer tests with the refactored attributes. | test/test_parser/test_tokenize.py | test/test_parser/test_tokenize.py | from io import StringIO
from token import NEWLINE, STRING
from jedi._compatibility import u
from jedi import parser
from ..helpers import unittest
class TokenTest(unittest.TestCase):
def test_end_pos_one_line(self):
parsed = parser.Parser(parser.load_grammar(), u('''
def testit():
a = "huhu"
'''))
... | from io import StringIO
from token import NEWLINE, STRING
from jedi._compatibility import u
from jedi import parser
from ..helpers import unittest
class TokenTest(unittest.TestCase):
def test_end_pos_one_line(self):
parsed = parser.Parser(parser.load_grammar(), u('''
def testit():
a = "huhu"
'''))
... | Python | 0 |
c4c2b7936a89ffbf97d63e4b5d33ea59201c94b0 | Add tests for mine.send | tests/integration/modules/mine.py | tests/integration/modules/mine.py | '''
Test the salt mine system
'''
import integration
class MineTest(integration.ModuleCase):
'''
Test the mine system
'''
def test_get(self):
'''
test mine.get and mine.update
'''
self.assertTrue(self.run_function('mine.update'))
self.assertTrue(self.run_function... | '''
Test the salt mine system
'''
import integration
class MineTest(integration.ModuleCase):
'''
Test the mine system
'''
def test_get(self):
'''
test mine.get
'''
self.assertTrue(self.run_function('mine.update'))
self.assertTrue(self.run_function('mine.get', ['m... | Python | 0 |
e7697caf374b60d69cdd0d089900ac7b300b02fa | boolean evals of expressions return strings | tests/python_tests/filter_test.py | tests/python_tests/filter_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import Todo
import mapnik2
if hasattr(mapnik2,'Expression'):
mapnik2.Filter = mapnik2.Expression
map_ = '''<Map>
<Style name="s">
<Rule>
<Filter><![CDATA[(([region]>=0) and ([region]<=50))]]></Filter>
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from utilities import Todo
import mapnik2
if hasattr(mapnik2,'Expression'):
mapnik2.Filter = mapnik2.Expression
map_ = '''<Map>
<Style name="s">
<Rule>
<Filter><![CDATA[(([region]>=0) and ([region]<=50))]]></Filter>
... | Python | 0.999997 |
08d1873e39531a8cb453fab91e0bb1c95a236cd2 | Update Copyright | tests/test_cli_write_hierarchy.py | tests/test_cli_write_hierarchy.py | #!/usr/bin/env python
"""Test that hierarchy below specified GO terms is printed."""
from __future__ import print_function
__copyright__ = "Copyright (c) 2017-2019, DV Klopfenstein. Haiboa Tang. All rights reserved."
from goatools.cli.wr_hierarchy import WrHierCli
# --o Output file in ASCII text form... | #!/usr/bin/env python
"""Test that hierarchy below specified GO terms is printed."""
from __future__ import print_function
__copyright__ = "Copyright (c) 2017-2018, DV Klopfenstein. Haiboa Tang. All rights reserved."
from goatools.cli.wr_hierarchy import WrHierCli
# --o Output file in ASCII text form... | Python | 0 |
43392fd2dd7d8775ef65a0d0767d7e9a3e170f6d | Fix test in Python 2.6 | tests/transport/threaded/tests.py | tests/transport/threaded/tests.py | import mock
import os
import time
from tempfile import mkstemp
from raven.utils.testutils import TestCase
from raven.base import Client
from raven.transport.threaded import ThreadedHTTPTransport
from raven.utils.urlparse import urlparse
class DummyThreadedScheme(ThreadedHTTPTransport):
def __init__(self, *args,... | import mock
import os
import time
from tempfile import mkstemp
from raven.utils.testutils import TestCase
from raven.base import Client
from raven.transport.threaded import ThreadedHTTPTransport
from raven.utils.urlparse import urlparse
class DummyThreadedScheme(ThreadedHTTPTransport):
def __init__(self, *args,... | Python | 0.002774 |
de93238fb16173f9d5cca3ef67106758e8039a97 | Fix test | thinc/tests/backends/test_lstm.py | thinc/tests/backends/test_lstm.py | from thinc.backends.jax_ops import lstm_weights_forward, backprop_lstm_weights
from thinc.backends.jax_ops import lstm_gates_forward, backprop_lstm_gates
import numpy.testing
import pytest
from hypothesis import given, settings
from ..strategies import ndarrays_of_shape
try:
import jax
has_jax = True
except I... | from thinc.backends.jax_ops import lstm_weights_forward, backprop_lstm_weights
from thinc.backends.jax_ops import lstm_gates_forward, backprop_lstm_gates
import numpy.testing
from hypothesis import given, settings
from ..strategies import ndarrays_of_shape
try:
import jax
except ImportError:
has_jax = False
... | Python | 0.000004 |
b7eefbea83768bd006c677aa5d69cf2a24e6e909 | Fix shebang line. | aeneas.py | aeneas.py | #!/usr/bin/env python
import argparse
from os import environ
def bool_from_str(s):
if isinstance(s, basestring):
s = s.lower()
if s in ['true', 't', '1', 'y']:
return True
if s in ['false', 'f', '0', 'n']:
return False
return bool(s)
AENEAS_DEBUG = bool_from_str(environ.get(... | #!/usr/bin/env python2
import argparse
from os import environ
def bool_from_str(s):
if isinstance(s, basestring):
s = s.lower()
if s in ['true', 't', '1', 'y']:
return True
if s in ['false', 'f', '0', 'n']:
return False
return bool(s)
AENEAS_DEBUG = bool_from_str(environ.get... | Python | 0.000003 |
600b054b950b26db8609d71a75350aaa995bb26e | Add import export to Geography admin | scorecard/admin.py | scorecard/admin.py |
from django.contrib import admin
from django.conf import settings
from django_q.tasks import async_task
from constance import config
from import_export import resources
from import_export.admin import ImportExportModelAdmin
from .models import (
Geography,
MunicipalityProfilesCompilation,
)
@admin.register(... |
from django.contrib import admin
from django.conf import settings
from django_q.tasks import async_task
from constance import config
from .models import (
Geography,
MunicipalityProfilesCompilation,
)
@admin.register(Geography)
class GeographyAdmin(admin.ModelAdmin):
list_display = ("geo_code", "geo_lev... | Python | 0 |
6fb4bf39fd460b5f2d69d665d9e4d09e4279d88b | Add maximum page constraint for Pagination results | common/utils.py | common/utils.py | # common/utils.py
from flask import url_for, current_app
class PaginateData():
""""Pagination class.
Paginate query results
"""
def __init__(self, request, query, resource_for_url, key_name, schema):
self.request = request
self.query = query
self.resource_for_url = resourc... | # common/utils.py
from flask import url_for, current_app
class PaginateData():
""""Pagination class.
Paginate query results
"""
def __init__(self, request, query, resource_for_url, key_name, schema):
self.request = request
self.query = query
self.resource_for_url = resourc... | Python | 0 |
3df6175723f1c9f22fc98ae1cc750046f265398e | Access ruler through naali | bin/pymodules/core/componentpropertyadder.py | bin/pymodules/core/componentpropertyadder.py | import circuits
import naali
import rexviewer as r
#from PythonQt.QtCore import QVariant
import PythonQt
#the ones not listed here are added using the c++ name, e.g. ent.EC_NetworkPosition
compshorthand = {
'EC_OpenSimPrim': 'prim',
'EC_OgrePlaceable': 'placeable',
'EC_NetworkPosition': 'network',
'EC_... | import circuits
import naali
import rexviewer as r
#from PythonQt.QtCore import QVariant
import PythonQt
#the ones not listed here are added using the c++ name, e.g. ent.EC_NetworkPosition
compshorthand = {
'EC_OpenSimPrim': 'prim',
'EC_OgrePlaceable': 'placeable',
'EC_NetworkPosition': 'network',
'EC_... | Python | 0 |
21f1cd585830e9d1b85f4201fb3c4914a4c1bd21 | Update test_code_style.py | _unittests/ut_module/test_code_style.py | _unittests/ut_module/test_code_style.py | # pylint: disable=R1721
"""
@brief test log(time=0s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8
from pyquickhelper.pycode.utils_tests_helper import _extended_refactoring
class TestCodeStyle(unittest.TestCase):
def test_code_style_src(s... | # pylint: disable=R1721
"""
@brief test log(time=0s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8
from pyquickhelper.pycode.utils_tests_helper import _extended_refactoring
class TestCodeStyle(unittest.TestCase):
def test_code_style_src(s... | Python | 0.000004 |
9c38604fa8e85efeed723b47e3486f9d09ea9858 | Fix login cookie | adhocracy/lib/auth/instance_auth_tkt.py | adhocracy/lib/auth/instance_auth_tkt.py | import datetime
from repoze.who.plugins.auth_tkt import AuthTktCookiePlugin, _now
from pylons import config
from paste.deploy.converters import asbool
class InstanceAuthTktCookiePlugin(AuthTktCookiePlugin):
def _get_cookies(self, environ, value, max_age=None):
if max_age is not None:
later = _... | import datetime
from repoze.who.plugins.auth_tkt import AuthTktCookiePlugin, _now
class InstanceAuthTktCookiePlugin(AuthTktCookiePlugin):
def _get_cookies(self, environ, value, max_age=None):
if max_age is not None:
later = _now() + datetime.timedelta(seconds=int(max_age))
# Wdy, ... | Python | 0.000017 |
b886a7db3c6669ccf1e69747cca2fdddc54c15ee | Set encoding when opening languages files, fix error on windows. | lektor/i18n.py | lektor/i18n.py | import os
import json
from io import open
from lektor._compat import iteritems
from lektor.uilink import UI_LANG
translations_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'translations')
KNOWN_LANGUAGES = list(x[:-5] for x in os.listdir(translations_path)
... | import os
import json
from lektor._compat import iteritems
from lektor.uilink import UI_LANG
translations_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'translations')
KNOWN_LANGUAGES = list(x[:-5] for x in os.listdir(translations_path)
if x.endswi... | Python | 0 |
10dc027ee15428d7ca210e0b74e5ae9274de0fa8 | Use raw_input instead of the unmodified words | lianXiangCi.py | lianXiangCi.py | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.ph... | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
... | Python | 0.00008 |
5e13528a3c2912b4238f8f531a8f2c2652292b0a | Add init_db | scripts/init_db.py | scripts/init_db.py | import os
from pymongo import MongoClient
def main():
try:
client = MongoClient(host=os.environ.get('MONGODB_URI'))
db = client.get_default_database()
# tasks
# db.users.create_index(keys='id', name='index_id', unique=True)
# create_admin(db)
db.users.update_many({... | import os
from pymongo import MongoClient
def main():
try:
client = MongoClient(host=os.environ.get('MONGODB_URI'))
db = client.get_default_database()
# tasks
db.users.create_index(keys='id', name='index_id', unique=True)
create_admin(db)
except Exception as e:
... | Python | 0.000042 |
de91561ab7e16a125dd403e395f081c78323a47c | Fix typobug | spectrocrunch/common/listtools.py | spectrocrunch/common/listtools.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2017 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Wout De Nolf (wout.de_nolf@esrf.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software")... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2017 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Wout De Nolf (wout.de_nolf@esrf.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software")... | Python | 0.99804 |
d85a27db790bb4bc1926fc78bcf0f2d54c876e48 | bump version | pvmismatch/__init__.py | pvmismatch/__init__.py | # -*- coding: utf-8 -*-
"""
This is the PVMismatch Package. It contains :mod:`~pvmismatch.pvmismatch_lib`
and :mod:`~pvmismatch.pvmismatch_tk`.
:mod:`~pvmismatch.pvmismatch_lib`
=================================
This package contains the basic library modules, methods, classes and
attributes to model PV system mismatc... | # -*- coding: utf-8 -*-
"""
This is the PVMismatch Package. It contains :mod:`~pvmismatch.pvmismatch_lib`
and :mod:`~pvmismatch.pvmismatch_tk`.
:mod:`~pvmismatch.pvmismatch_lib`
=================================
This package contains the basic library modules, methods, classes and
attributes to model PV system mismatc... | Python | 0 |
45a624e18b9b870163a5852bd4d06c59b3bb5ac2 | Fix base for got on pie binaries (#618) | pwndbg/commands/got.py | pwndbg/commands/got.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import pwndbg.chain
import pwndbg.commands
import pwndbg.enhance
import pwndbg.file
import pwndbg.which
imp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import pwndbg.chain
import pwndbg.commands
import pwndbg.enhance
import pwndbg.file
import pwndbg.which
imp... | Python | 0 |
a735f36102b370415b9f49dae4ee3c5ceda30136 | Update cycling_light.py | apps/hue/cycling_light.py | apps/hue/cycling_light.py |
# -*- coding: utf-8 -*-
# Author : jeonghoonkang, https://github.com/jeonghoonkang
import httplib
import time
conn = httplib.HTTPConnection("10.xxx.xxx.xxxx")
hue_uid = "c274b3c285d19cfxxxxxxxxxx"
restcmd = "/api"+hue_uid+"/lights"
str = " "
xhue = [10000,25000,46000,56280]
def shifthue() :
global str
glo... | # -*- coding: utf-8 -*-
# Author : jeonghoonkang, https://github.com/jeonghoonkang
import httplib
import time
conn = httplib.HTTPConnection("10.xxx.xxx.xxxx")
hue_uid = "c274b3c285d19cfxxxxxxxxxx"
restcmd = "/api"+hue_uid+"/lights"
str = " "
xhue = [10000,25000,46000,56280]
def shifthue() :
global str
glob... | Python | 0.000001 |
1f53a12d60b22263f35a40bf0a7d4cb5396c14e8 | add docstrings in Events | AlphaTwirl/Events/Events.py | AlphaTwirl/Events/Events.py | # Tai Sakuma <tai.sakuma@cern.ch>
##____________________________________________________________________________||
class Events(object):
"""An iterative object for events.
Examples
--------
inputFile = ROOT.TFile.Open(inputPath)
tree = inputFile.Get(treeName)
events = Events(tree)
for ev... | # Tai Sakuma <tai.sakuma@cern.ch>
##____________________________________________________________________________||
class Events(object):
def __init__(self, tree, maxEvents = -1):
self.file = tree.GetDirectory() # so a file won't close
self.tree = tree
self.nEvents = min(self.tree.GetEntries... | Python | 0 |
550f0d7cb91d088a33a44dddebb9542cae2f3b5d | Use an unique identifier for solr taskservice. | src/zeit/cms/generation/install.py | src/zeit/cms/generation/install.py | import lovely.remotetask
import lovely.remotetask.interfaces
import lovely.remotetask.processor
import zeit.cms.content.interfaces
import zeit.cms.content.template
import zeit.cms.generation
import zeit.cms.relation.relation
import zeit.cms.repository.interfaces
import zeit.cms.repository.repository
import zeit.cms.wor... | import lovely.remotetask
import lovely.remotetask.interfaces
import lovely.remotetask.processor
import zeit.cms.content.interfaces
import zeit.cms.content.template
import zeit.cms.generation
import zeit.cms.relation.relation
import zeit.cms.repository.interfaces
import zeit.cms.repository.repository
import zeit.cms.wor... | Python | 0 |
c8d88489f3a4ce01ea8936440daec378b983e768 | Fix CLI typo. | st2client/st2client/models/action_alias.py | st2client/st2client/models/action_alias.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Python | 0.002771 |
03fec45fa269a8badbe047b4911c655c3c952404 | Use consistent CLI command names. | st2client/st2client/models/action_alias.py | st2client/st2client/models/action_alias.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Python | 0 |
be6237173274c98d646f50ad87d4b7bcd38a5707 | Use Unicode strings for file paths | pylinks/links/utils.py | pylinks/links/utils.py | import six
from django.conf import settings
from django.core.exceptions import ValidationError
from pyuploadcare.dj import FileField
from pyuploadcare.api_resources import File
from pyuploadcare.exceptions import InvalidRequestError
# Patch File to pass through S3 URLs
class LinkFile(File):
def __init__(self, cdn_... | import six
from django.conf import settings
from django.core.exceptions import ValidationError
from pyuploadcare.dj import FileField
from pyuploadcare.api_resources import File
from pyuploadcare.exceptions import InvalidRequestError
# Patch File to pass through S3 URLs
class LinkFile(File):
def __init__(self, cdn_... | Python | 0.000001 |
92ef6fda87d70434bc6875062779c72bffd2d723 | Check field type | pymangal/makeschema.py | pymangal/makeschema.py | import json
def makeschema(infos=None, name=None, title="Autogenerated JSON schema"):
""" Generates a JSON scheme from a dict representing the schema sent by the API
:param infos: A ``dict`` with the resource schema
:param name: The name of the resource
:param title: A description of the object
""... | import json
def makeschema(infos=None, name=None, title="Autogenerated JSON schema"):
""" Generates a JSON scheme from a dict representing the schema sent by the API
:param infos: A ``dict`` with the resource schema
:param name: The name of the resource
:param title: A description of the object
""... | Python | 0 |
59c1c893375f6fdf2308385b2c4d331e5af7961b | Prepare 0.5.1 release | pytest_bdd/__init__.py | pytest_bdd/__init__.py | from pytest_bdd.steps import given, when, then # pragma: no cover
from pytest_bdd.scenario import scenario # pragma: no cover
__version__ = '0.5.1'
__all__ = [given.__name__, when.__name__, then.__name__, scenario.__name__] # pragma: no cover
| from pytest_bdd.steps import given, when, then # pragma: no cover
from pytest_bdd.scenario import scenario # pragma: no cover
__version__ = '0.5.0'
__all__ = [given.__name__, when.__name__, then.__name__, scenario.__name__] # pragma: no cover
| Python | 0 |
95d3b17ca32781b4ce81110aa406ab6d15b1ae1c | Update metadata with new tutorials | notebooks/feature_engineering/track_meta.py | notebooks/feature_engineering/track_meta.py | # See also examples/example_track/example_meta.py for a longer, commented example
track = dict(
author_username='matleonard',
course_name='Feature Engineering',
course_url='https://www.kaggle.com/learn/feature-engineering'
)
lessons = [ {'topic': topic_name} for topic_name in
['Baseline... | # See also examples/example_track/example_meta.py for a longer, commented example
track = dict(
author_username='matleonard',
course_name='Feature Engineering',
course_url='https://www.kaggle.com/learn/feature-engineering'
)
lessons = [ {'topic': topic_name} for topic_name in
['Baseline... | Python | 0 |
64275164f9f7c226695774ce1d3a234005ab23a6 | Solve Code Fights digits product problem | CodeFights/digitsProduct.py | CodeFights/digitsProduct.py | #!/usr/local/bin/python
# Code Fights Digits Product Problem
def digitsProduct(product):
def get_single_dig_factors(product):
# Helper function to generate single-digit factors of product
n = product
factors = []
for i in range(9, 1, -1):
while n % i == 0 and n > 1:
... | #!/usr/local/bin/python
# Code Fights Digits Product Problem
def digitsProduct(product):
def get_single_dig_factors(product):
# Helper function to generate single-digit factors of product
n = product
factors = []
while n > 1:
for i in range(9, 1, -1):
if... | Python | 0.999947 |
5000a3c10f1027ab3ced0f40bc32165f2d8a1dde | add ability to read back the summary files | sequana/summary.py | sequana/summary.py | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with this s... | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with this s... | Python | 0 |
5d4b1b16b787dd529a92c76ff2f5e0736443782f | mark external connection to EDW tests xfail | src/encoded/tests/test_edw_file.py | src/encoded/tests/test_edw_file.py | import pytest
import json
from sqlalchemy.engine.base import Engine
import encoded.edw_file
import edw_test_data
pytestmark = [pytest.mark.edw_file]
## TODO: This should be converted to a smoke-type test after build/install is complete
@pytest.mark.xfail
# travis cannot connect to EDW
def test_make_edw():
edw ... | import pytest
import json
from sqlalchemy.engine.base import Engine
import encoded.edw_file
import edw_test_data
pytestmark = [pytest.mark.edw_file]
## edw_file
# def format_edw_fileinfo(file_dict, exclude=None):
# def make_edw(data_host=None):
# def dump_filelist(fileaccs, header=True, typeField=None):
# def dump_f... | Python | 0 |
9b16c980a0b3ac627e8ba2c7ea88231a0f308bd9 | Upgrade celery config | seriesly/celery.py | seriesly/celery.py | from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'seriesly.settings')
app = Celery('seriesly')
# Using a string here means the worker will not have to
# pickle the object whe... | from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'seriesly.settings')
from django.conf import settings # noqa
app = Celery('seriesly')
# Using a string here means the worke... | Python | 0.000001 |
3449534933e5d1e33c4f6b1017d68c804ba1f91f | Allow overriding of bgen pathnames in an optional module bgenlocationcustomize. Editing of bgenlocations.py isn't easy if your Python was supplied by Apple. | Lib/plat-mac/bgenlocations.py | Lib/plat-mac/bgenlocations.py | #
# Local customizations for generating the Carbon interface modules.
# Edit this file to reflect where things should be on your system.
# Note that pathnames are unix-style for OSX MachoPython/unix-Python,
# but mac-style for MacPython, whether running on OS9 or OSX.
#
import sys, os
Error = "bgenlocations.Error"
#
... | #
# Local customizations for generating the Carbon interface modules.
# Edit this file to reflect where things should be on your system.
# Note that pathnames are unix-style for OSX MachoPython/unix-Python,
# but mac-style for MacPython, whether running on OS9 or OSX.
#
import sys, os
Error = "bgenlocations.Error"
#
... | Python | 0 |
633c40d365acd390190e3eef0089cc1e00925e46 | Revert to alpha test mode; fix grammar | NewDoc.py | NewDoc.py | import time
import datetime
import quip
class NewDoc(object):
def __init__(self):
NextWednesday = datetime.datetime.today() + datetime.timedelta(days = 5)
self.NextWednesdayN = NextWednesday.strftime("%m%d")
self.NextWednesdayS = NextWednesday.strftime("%B %d")
if self.NextWednesda... | import time
import datetime
import quip
class NewDoc(object):
def __init__(self):
NextWednesday = datetime.datetime.today() + datetime.timedelta(days = 5)
self.NextWednesdayN = NextWednesday.strftime("%m%d")
self.NextWednesdayS = NextWednesday.strftime("%B %d")
if self.NextWednesda... | Python | 0.000045 |
1c71673f10bc972ad10fc74c32ae66eff5edd4ef | Add some documentation | src/main/cclyzer/analysis_stats.py | src/main/cclyzer/analysis_stats.py | import blox.connect
import collections
Statistic = collections.namedtuple("Statistic", ["header", "value"])
class AnalysisStatistics(object):
def __init__(self, builder):
self._analysis = builder.analysis
# Calculate column widths
hdr_width = max(len(stat.header) for stat in builder.stat... | import blox.connect
import collections
Statistic = collections.namedtuple("Statistic", ["header", "value"])
class AnalysisStatistics(object):
def __init__(self, builder):
self._analysis = builder.analysis
# Calculate column widths
hdr_width = max(len(stat.header) for stat in builder.stat... | Python | 0.000001 |
6a88e390467326f1e53f7b7a10bab777186b3418 | replace post_syncdb with post_migrate | corehq/preindex/models.py | corehq/preindex/models.py | from couchdbkit.ext.django import syncdb
from django.db.models import signals
from corehq.preindex import get_preindex_plugin
def catch_signal(sender, using=None, **kwargs):
"""Function used by syncdb signal"""
if using != 'default':
# only sync for the default DB
return
app_name = sender... | from couchdbkit.ext.django import syncdb
from django.db.models import signals
from corehq.preindex import get_preindex_plugin
def catch_signal(sender, using=None, **kwargs):
"""Function used by syncdb signal"""
if using != 'default':
# only sync for the default DB
return
app_name = sender... | Python | 0.000227 |
65e42c2715d82dcbf4b291728c786f9dcf29f55a | change test.py usage | test/test.py | test/test.py | #!/usr/bin/env python
import argparse
from subprocess import call, check_output, DEVNULL
import os, sys
from datetime import datetime
import getpass
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Test Script')
parser.add_argument('--dockerfiles', metavar='Dockerfile1,Dockerfile2',... | #!/usr/bin/env python
import argparse
from subprocess import call, check_output, DEVNULL
import os, sys
from datetime import datetime
import getpass
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Test Script')
parser.add_argument('dockerfiles', nargs='+', metavar='Dockerfile.xxx.x... | Python | 0.000001 |
4c2e81adfc21b7857d9c01ae70f8f022bfe430ba | print to check thread exit normally | test/test.py | test/test.py | import time
import requests
import numpy as np
import multiprocessing
from concurrent import futures
from multicpu import multi_cpu
def process_job(job):
#time.sleep(1)
count = 10000000
while count>0:
count -= 1
print "ok"
return job
jobs = [i for i in range(10)]
de... | import time
import requests
import numpy as np
import multiprocessing
from concurrent import futures
from multicpu import multi_cpu
def process_job(job):
#time.sleep(1)
count = 10000000
while count>0:
count -= 1
return job
jobs = [i for i in range(10)]
def test_multi_cpu... | Python | 0 |
5cfcb032c1503625aa405ac76d49e67ac01c374b | Update test.py | test/test.py | test/test.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 23 13:03:00 2016
@author: p
"""
import wellapplication as wa
import pandas as pd
import matplotlib
def test_getelev():
x = [-111.21, 41.4]
m = wa.getelev(x)
assert m > 100.0
def test_gethuc():
x = [-111.21, 41.4]
huc_data = wa.get_huc(x)
assert ... | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 23 13:03:00 2016
@author: p
"""
import wellapplication as wa
import pandas as pd
import matplotlib
def test_getelev():
x = [-111.21, 41.4]
m = wa.getelev(x)
assert m > 100.0
def test_gethuc():
x = [-111.21, 41.4]
huc_data = wa.get_huc(x)
assert ... | Python | 0.000001 |
62641f9d0c3c9260217703f80066bbb434697d6e | Change variable name | test_dice.py | test_dice.py | import pytest
import dice
expected_dice_faces = [
(dice.d4, tuple(range(1, 5))),
(dice.d6, tuple(range(1, 7))),
(dice.d8, tuple(range(1, 9))),
(dice.d10, tuple(range(1, 11))),
(dice.d12, tuple(range(1, 13))),
]
@pytest.mark.parametrize('dice,expected', expected_dice_faces)
def test_dice_has_prop... | import pytest
import dice
expected_factory_method_data = [
(dice.d4, tuple(range(1, 5))),
(dice.d6, tuple(range(1, 7))),
(dice.d8, tuple(range(1, 9))),
(dice.d10, tuple(range(1, 11))),
(dice.d12, tuple(range(1, 13))),
]
@pytest.mark.parametrize('dice,expected', expected_factory_method_data)
def ... | Python | 0.000104 |
d75dc845a456782549d00364e2637c7c32b8507a | add additional gate tests | test_gate.py | test_gate.py | import numpy as np
import unittest
import gate
class TestGate(unittest.TestCase):
def test_standard_gates_implemented(self):
gate.QuantumGate('paulix')
gate.QuantumGate('pauliy')
gate.QuantumGate('pauliz')
gate.QuantumGate('swap')
gate.QuantumGate('cnot')
gate.Quantu... | import numpy as np
import unittest
import gate
class TestGate(unittest.TestCase):
def test_standard_gates_implemented(self):
gate.QuantumGate('paulix')
gate.QuantumGate('pauliy')
gate.QuantumGate('pauliz')
gate.QuantumGate('swap')
gate.QuantumGate('cnot')
gate.Quantu... | Python | 0 |
1774e6a90ae94e8c622150fb67195c4f888e96c3 | Add file when building the filepath. Check if usesid exists. If it doesn't set it to "". | backend/scripts/conversion/dfddconvert.py | backend/scripts/conversion/dfddconvert.py | #!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import os
def datafile_path(mcdir, datafile_id):
pieces = datafile_id.split("-")
return os.path.join(mcdir, pieces[1][0:2], pieces[1][2:4], datafile_id)
def id_to_use(f):
if 'usesid' not in f:
f['usesid'] = ""
if ... | #!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import os
def datafile_dir(mcdir, datafile_id):
pieces = datafile_id.split("-")
return os.path.join(mcdir, pieces[1][0:2], pieces[1][2:4])
def id_to_use(f):
if f['usesid'] == "":
return f['id']
return f['usesid']
... | Python | 0 |
fb13b04e09a837faba2f3ac6310cc36073727637 | use nose for testing now (That was easy) | tests/run.py | tests/run.py | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: 2006-2007 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
import sys
try:
import nose
except ImportError:
print >> sys.stderr, "nose is requ... | # -*- coding: utf-8 -*-
"""
Pygments unit tests
~~~~~~~~~~~~~~~~~~
Usage::
python run.py [testfile ...]
:copyright: 2006-2007 by Georg Brandl.
:license: GNU GPL, see LICENSE for more details.
"""
import sys, os, new
import unittest
from os.path import dirname, basename, join, abspath
... | Python | 0 |
3b3e47574f766b4ba033a156eef4394c4034925d | Remove assert(True) | tests/run.py | tests/run.py | #!/usr/bin/env python3
# vim: set ai et ts=4 sw=4:
import os
import random
import subprocess
import requests
import logging
import time
import socket
START = os.environ.get('HURMADB_PORT') is None
PORT = int(os.getenv('HURMADB_PORT', 8000 + int(random.random()*1000)))
logging.basicConfig(level=logging.WARNING)
def ... | #!/usr/bin/env python3
# vim: set ai et ts=4 sw=4:
import os
import random
import subprocess
import requests
import logging
import time
import socket
START = os.environ.get('HURMADB_PORT') is None
PORT = int(os.getenv('HURMADB_PORT', 8000 + int(random.random()*1000)))
logging.basicConfig(level=logging.WARNING)
def ... | Python | 0.000625 |
a39db5ef1763a95fac3a063bde54c2a148f971b9 | add working replace for special symbols | translate.py | translate.py | #!/usr/bin/env python3
import re
# подцепляем словарь из внешнего файла
import translate_dict as dictionary
input_text = None
filename = None
def replace_lang(text, dic):
langs = re.findall('(?:^Languages|(?<= ))(\w+)[, ]*', text)
langru = "Языки "
for lang in langs:
try:
langru = l... | #!/usr/bin/env python3
import re
# подцепляем словарь из внешнего файла
import translate_dict as dictionary
input_text = None
filename = None
def replace_lang(text, dic):
langs = re.findall('(?:^Languages|(?<= ))(\w+)[, ]*', text)
langru = "Языки "
for lang in langs:
try:
langru = l... | Python | 0 |
4b18b48e93186a5ea22b684e0392bf5cba387525 | fix sleep between photos | timelapse.py | timelapse.py | import os
import datetime
import time
import picamera
from PIL import Image, ImageStat, ImageFont, ImageDraw
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.rotation = 180
time.sleep(2) # camera warm-up time
for filename in camera.capture_continuous('images/img_{timesta... | import os
import datetime
import time
import picamera
from PIL import Image, ImageStat, ImageFont, ImageDraw
with picamera.PiCamera() as camera:
camera.resolution = (1024, 768)
camera.rotation = 180
time.sleep(2) # camera warm-up time
for filename in camera.capture_continuous('images/img_{timesta... | Python | 0.000004 |
af6394bca3ee6686ec018bdcb032b8a97ef3e831 | Use config-directive for channel | tsversion.py | tsversion.py | import irc3
from irc3.plugins.command import command
from irc3.plugins.cron import cron
from teamspeak_web_utils import latest_version
@irc3.plugin
class TSVersion(object):
def __init__(self, bot):
self.bot = bot
self.client_version = None
self.server_version = None
config = bot.co... | import irc3
from irc3.plugins.command import command
from irc3.plugins.cron import cron
from teamspeak_web_utils import latest_version
@irc3.plugin
class TSVersion(object):
def __init__(self, bot):
self.bot = bot
self.client_version = None
self.server_version = None
self.target_cha... | Python | 0 |
70181b3069649eddacac86dbcb49cb43733be0ec | Add code comments for begins example | tw_begins.py | tw_begins.py | #!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" %... | #!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentionin... | Python | 0 |
34421909dcad3e4154b849ee4123af3de2252739 | rename NUMBER to INTEGER | toml/toml.py | toml/toml.py | from ply import lex, yacc
class TomlParser():
def __init__(self):
self.lexer = lex.lex(module=self)
self.parser = yacc.yacc(module=self)
# ---- lexing rules
tokens = (
'NAME','INTEGER', 'STRING',
)
literals = ['=']
t_ignore = " \t"
t_NAME = r'[a-zA-Z_][a-zA... | from ply import lex, yacc
class TomlParser():
def __init__(self):
self.lexer = lex.lex(module=self)
self.parser = yacc.yacc(module=self)
# ---- lexing rules
tokens = (
'NAME','NUMBER', 'STRING',
)
literals = ['=']
t_ignore = " \t"
t_NAME = r'[a-zA-Z_][a-zA-... | Python | 0.999999 |
3c4ba4bb89babdb2345dd01c5ddb79d30e7afa02 | bump version to 1.9.8.3 | lib/version.py | lib/version.py | ELECTRUM_VERSION = "1.9.8.3" # version of the client package
PROTOCOL_VERSION = '0.9' # protocol version requested
NEW_SEED_VERSION = 7 # bip32 wallets
OLD_SEED_VERSION = 4 # old electrum deterministic generation
SEED_PREFIX = '01' # the hash of the mnemonic seed must begin with this
| ELECTRUM_VERSION = "1.9.8.1" # version of the client package
PROTOCOL_VERSION = '0.9' # protocol version requested
NEW_SEED_VERSION = 7 # bip32 wallets
OLD_SEED_VERSION = 4 # old electrum deterministic generation
SEED_PREFIX = '01' # the hash of the mnemonic seed must begin with this
| Python | 0.000004 |
c95bff54d8ff6534c40d60f34484f864cc04754a | Add example for when there is no book cover url | lib/web/web.py | lib/web/web.py | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
... | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
... | Python | 0.000399 |
01d38ef789a18fd2852da9dae440e376f46bdc4c | fix missing future with_statement | src/robot/variables/tablesetter.py | src/robot/variables/tablesetter.py | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | Python | 0.998732 |
2750be86174c3438aa73a593ac6832bf7b7e7859 | Set default timesteps to 10 millions. | trainppo2.py | trainppo2.py | #!/usr/bin/env python
import sys
import os.path as osp
import argparse
from datetime import datetime
from belief import BeliefDriveItEnv
from car import Car
from autopilot import LookAheadPilot
from PositionTracking import TruePosition
import tensorflow as tf
from policy import DriveItPolicy
sys.path.append(osp.join(o... | #!/usr/bin/env python
import sys
import os.path as osp
import argparse
from datetime import datetime
from belief import BeliefDriveItEnv
from car import Car
from autopilot import LookAheadPilot
from PositionTracking import TruePosition
import tensorflow as tf
from policy import DriveItPolicy
sys.path.append(osp.join(o... | Python | 0 |
2ad349a890dd87ed5745cfc5879e92ddcd0dfee7 | Fix ProjectOption.unset_value | src/sentry/models/projectoption.py | src/sentry/models/projectoption.py | """
sentry.models.projectoption
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from celery.signals import task_postrun
from django.core.signals import reques... | """
sentry.models.projectoption
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from celery.signals import task_postrun
from django.core.signals import reques... | Python | 0.000003 |
b61c629abf4c33ecce38d1a63b0a2552a42933ee | fix / rewrite (#3052) | src/streamlink/plugins/ard_live.py | src/streamlink/plugins/ard_live.py | import logging
import re
from streamlink.compat import urljoin
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream, HTTPStream
from streamlink.utils import parse_json, verifyjson
log = logging.getLogger(__name__)
class ard_live(Plugin):
_url_re... | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream, HDSStream
from streamlink.compat import urljoin
from streamlink.stream import HTTPStream
class ard_live(Plugin):
swf_url = "http://live.daserste.de/lib/br-player/swf/main.swf"
_u... | Python | 0 |
d6174ad82527680642b3e562f5baede56779e442 | Add dictize method for objects | links/model.py | links/model.py | # This file is part of PyBossa-links.
#
# PyBossa-links is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyBossa-links is dis... | # This file is part of PyBossa-links.
#
# PyBossa-links is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyBossa-links is dis... | Python | 0.000001 |
5698dd61695371b792ba65262ac503e25b1bbb19 | Exclude root and alias pages from search results. | localore/search/views.py | localore/search/views.py | from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import JsonResponse
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from wagtail.wagtailcore.models import Page
from wagtail.wagt... | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import JsonResponse
from django.shortcuts import render
from django.views.decorators.cache import cache_page
from wagtail.wagtailcore.models import Page
from wagtail.wagtailsearch.models import Query
# override per-site cache f... | Python | 0 |
84fa46196865295c68cf8bf6de225503ca0e2a37 | bump version | manager_utils/version.py | manager_utils/version.py | __version__ = '1.3.0'
| __version__ = '1.2.0'
| Python | 0 |
ecc471f94dc2ca2931370e53948d9f674dd673d4 | Add parenthesis to print statement | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | Python | 0.001985 |
c027c5a5542adbe43792455a283df1b0a6f61f33 | Add developer tool versions. | statsmodels/tools/print_version.py | statsmodels/tools/print_version.py | #!/usr/bin/env python
import sys
def show_versions():
print("\nINSTALLED VERSIONS")
print("------------------")
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])
try:
import os
(sysname, nodename, release, version, machine) = os.uname()
print("OS: %s %s %s %s" % (sysname, re... | #!/usr/bin/env python
import sys
def show_versions():
print("\nINSTALLED VERSIONS")
print("------------------")
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])
try:
import os
(sysname, nodename, release, version, machine) = os.uname()
print("OS: %s %s %s %s" % (sysname, re... | Python | 0 |
f448a7c9aa22d1f4277e29b2a714a3317a046091 | Update task.py | bigbench/benchmark_tasks/talkdown/task.py | bigbench/benchmark_tasks/talkdown/task.py | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | Python | 0.000016 |
29b9bf67c86859bebfb9227e4effe1b7318170db | fix tolerance for tests | treeano/nodes/tests/costs_test.py | treeano/nodes/tests/costs_test.py | import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
def test_function_aggregator_node_serialization():
tn.check_serialization(tn.AggregatorNode("a"))
def test_function_elementwise_cost_node_serialization():
... | import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
fX = theano.config.floatX
def test_function_aggregator_node_serialization():
tn.check_serialization(tn.AggregatorNode("a"))
def test_function_elementwise_cost_node_serialization():
... | Python | 0.000001 |
76f1640b2ebb5c85e5989d798bf09277943ff6e2 | Bump suffix | crypto_enigma/_version.py | crypto_enigma/_version.py | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | #!/usr/bin/env python
# encoding: utf8
"""
Description
.. note::
Any additional note.
"""
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy ... | Python | 0.000018 |
9f78edac0f58b0e3f1a8bb2051c62411e027aeb2 | Update cs251tk/webapp/web_cli.py | cs251tk/webapp/web_cli.py | cs251tk/webapp/web_cli.py | import os
from ..common import chdir
from ..student import stash, pull, checkout_date
from ..student.markdownify.process_file import process_file
from PyInquirer import style_from_dict, Token, prompt
def check_student(student, spec, basedir):
files = []
if os.path.exists('{}/{}'.format(student, spec['assignm... | import os
from ..common import chdir
from ..student import stash, pull, checkout_date
from ..student.markdownify.process_file import process_file
from PyInquirer import style_from_dict, Token, prompt
def check_student(student, spec, basedir):
files = []
if os.path.exists('{}/{}'.format(student, spec['assignm... | Python | 0 |
9a7d9e0838bc35f1deb8b8c47a4ecbf01bc51a91 | Fix syntax errors in migration | talkoohakemisto/migrations/versions/1ef4e5f61dac_add_finnish_collations_to_all_text_columns.py | talkoohakemisto/migrations/versions/1ef4e5f61dac_add_finnish_collations_to_all_text_columns.py | """Add Finnish collations to all text columns
Revision ID: 1ef4e5f61dac
Revises: 485b2296735
Create Date: 2014-02-09 21:51:35.842781
"""
# revision identifiers, used by Alembic.
revision = '1ef4e5f61dac'
down_revision = '485b2296735'
from alembic import op
def upgrade():
op.execute(
'''
ALTER ... | """Add Finnish collations to all text columns
Revision ID: 1ef4e5f61dac
Revises: 485b2296735
Create Date: 2014-02-09 21:51:35.842781
"""
# revision identifiers, used by Alembic.
revision = '1ef4e5f61dac'
down_revision = '485b2296735'
from alembic import op
def upgrade():
op.execute(
'''
ALTER ... | Python | 0.00022 |
ce745f27b7de35e54f85cb1c33ce47681d5ab2ab | Fix voresource order | daiquiri/core/renderers/voresource.py | daiquiri/core/renderers/voresource.py | from . import XMLRenderer
from .vosi import CapabilitiesRendererMixin, TablesetRendererMixin
class VoresourceRendererMixin(CapabilitiesRendererMixin, TablesetRendererMixin):
def render_voresource(self, metadata):
self.start('ri:Resource', {
'created': metadata.get('created'),
'upd... | from . import XMLRenderer
from .vosi import CapabilitiesRendererMixin, TablesetRendererMixin
class VoresourceRendererMixin(CapabilitiesRendererMixin, TablesetRendererMixin):
def render_voresource(self, metadata):
self.start('ri:Resource', {
'created': metadata.get('created'),
'upd... | Python | 0.000002 |
4adb78fde502faed78350233896f3efd3f42816e | Define a default interpreter rather than using shutil.copyfile. | cytoplasm/interpreters.py | cytoplasm/interpreters.py | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, sim... | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, sim... | Python | 0 |
34a5ac0d0581e45e79eb1ef5c1172e1bd3e4c9b0 | change id to lowercase d | d120_provider/provider.py | d120_provider/provider.py | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class D120Account(ProviderAccount):
pass
class D120Provider(OAuth2Provider):
id = 'd120'
name = 'D120 OAuth2 Provider'
... | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class D120Account(ProviderAccount):
pass
class D120Provider(OAuth2Provider):
id = 'D120'
name = 'D120 OAuth2 Provider'
... | Python | 0.999826 |
e58781d10d930addc911a2e9b86370ba997cddfc | Make STRtree work with empty input sequence. | shapely/strtree.py | shapely/strtree.py | from shapely.geos import lgeos
import ctypes
class STRtree:
"""
STRtree is an R-tree that is created using the Sort-Tile-Recursive
algorithm. STRtree takes a sequence of geometry objects as initialization
parameter. After initialization the query method can be used to make a
spatial query over thos... | from shapely.geos import lgeos
import ctypes
class STRtree:
"""
STRtree is an R-tree that is created using the Sort-Tile-Recursive
algorithm. STRtree takes a sequence of geometry objects as initialization
parameter. After initialization the query method can be used to make a
spatial query over thos... | Python | 0.000001 |
b4810235dd91e326b088f0ea4fc479ad6b9b7900 | Improve session backend compatibility with Django. | appengine_django/sessions/backends/db.py | appengine_django/sessions/backends/db.py | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 0 |
90a953773192f4150f1acee9f6611a0924fb61d5 | Update haar_positive_creator.py | haar_positive_creator.py | haar_positive_creator.py | #!/usr/bin/env python
#################################################################
# Name : haar_positive_file_creator.py
# Version : 1.0a
# Date created on : 11/08/2015
# Date modified on : 11/08/2015
# Description : A small python tool to create a postive
# : fil... | #!/usr/bin/env python
#################################################################
# Name : haar_positive_file_creator.py
# Version : 1.0a
# Date created on : 11/08/2015
# Date modified on : 11/08/2015
# Description : A small python tool to create a postive
# : fil... | Python | 0 |
c5b408dcb93dc16b4449e9fb46fd7811eecd9aa1 | Use correct config module. | st2actions/st2actions/runners/python_action_wrapper.py | st2actions/st2actions/runners/python_action_wrapper.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Python | 0 |
5e63e3b86623aed099383fa96c7ee079fdce8905 | Update to setup.py so that generated SWIG library is copied over to python installation appropriately. Somehow, I did not include this change in my previous commit. | OpenSim/Wrapping/Python/setup.py | OpenSim/Wrapping/Python/setup.py | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
if os.name == 'posix':
# Linux, etc.
lib_name = '_opensim.so'
elif os.name == 'nt':
# Windows.
lib_name = '_opensim.pyd'
setup(name='opensim',
version='3.1',
description='OpenSim Simulation Framewo... | #!/usr/bin/env python
from distutils.core import setup
setup(name='pyOpenSim',
version='3.1',
description='OpenSim Simulation Framework',
author='OpenSim Team',
author_email='ahabib@stanford.edu',
url='http://opensim.stanford.edu/'
)
| Python | 0.000006 |
08f46549f7ce70416bb0f605fb9da7334b465e50 | Fix attributes. | test/factories/auditlog_factory.py | test/factories/auditlog_factory.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Python | 0 |
30bcdc2c6bc18eb8460ec1706e74bdd72bae0610 | Fix test after using cool_filter | test/python/topology/test_names.py | test/python/topology/test_names.py | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import unittest
import itertools
from streamsx.topology.topology import *
def f42():
pass
class cool_class(object):
def __init__(self):
pass
def __call__(self, t):
return t
class cool_filter(object):
def __init__(self):... | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import unittest
import itertools
from streamsx.topology.topology import *
def f42():
pass
class cool_class(object):
def __init__(self):
pass
def __call__(self, t):
return t
class cool_filter(object):
def __init__(self):... | Python | 0.000001 |
5934669c0edbd914d14612e16be7c88641b50bee | Fix test for eq and test eq with other classes | test/test_chat_chatserverstatus.py | test/test_chat_chatserverstatus.py | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers)... | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers)... | Python | 0 |
03624fa9dbe1a0dbb74e324a35ee0cda44234bc8 | add domain name when having issues in the warn output (#5105) | certbot-apache/certbot_apache/display_ops.py | certbot-apache/certbot_apache/display_ops.py | """Contains UI methods for Apache operations."""
import logging
import os
import zope.component
from certbot import errors
from certbot import interfaces
import certbot.display.util as display_util
logger = logging.getLogger(__name__)
def select_vhost(domain, vhosts):
"""Select an appropriate Apache Vhost.
... | """Contains UI methods for Apache operations."""
import logging
import os
import zope.component
from certbot import errors
from certbot import interfaces
import certbot.display.util as display_util
logger = logging.getLogger(__name__)
def select_vhost(domain, vhosts):
"""Select an appropriate Apache Vhost.
... | Python | 0 |
a004abd76af602192704cf4d01d9daf3903d6477 | Remove unused code | child_switzerland/models/child_compassion.py | child_switzerland/models/child_compassion.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <david@coninckx.com>
#
# The licence is in the file __manifest__.p... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: David Coninckx <david@coninckx.com>
#
# The licence is in the file __manifest__.p... | Python | 0.000006 |
07d17373891b501fa9e20d175ea993e021158c78 | Add TODO | app/slot/controller.py | app/slot/controller.py | # 3rd Party Modules
import datetime
import os
from flask import request, redirect, render_template, json
from app import app
import config
from auth import requires_auth
from app.slot import db_fieldbook, messaging
import utils
def index():
ops = db_fieldbook.get_all_opportunities()
for op in ops:
i... | # 3rd Party Modules
import datetime
import os
from flask import request, redirect, render_template, json
from app import app
import config
from auth import requires_auth
from app.slot import db_fieldbook, messaging
import utils
def index():
ops = db_fieldbook.get_all_opportunities()
for op in ops:
i... | Python | 0.000002 |
92f5cff9edfbeb2219fc2fb714364dc590bd912f | Fix too long line in soc.cache.logic module. | app/soc/cache/logic.py | app/soc/cache/logic.py | #!/usr/bin/python2.5
#
# Copyright 2009 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 applicable... | #!/usr/bin/python2.5
#
# Copyright 2009 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 applicable... | Python | 0.000001 |
bed9390490ad0c9d8d8319ea017f13d075284450 | Make sure SQL file gets closed | calaccess_processed_filings/managers.py | calaccess_processed_filings/managers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom manager for loading raw data in to "filings" models.
"""
from __future__ import unicode_literals
import itertools
# Django tricks
from django.db.models import Q
from django.db import connection
# Managers
from calaccess_processed.managers import BulkLoadSQLMana... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Custom manager for loading raw data in to "filings" models.
"""
from __future__ import unicode_literals
import itertools
# Django tricks
from django.db.models import Q
from django.db import connection
# Managers
from calaccess_processed.managers import BulkLoadSQLMana... | Python | 0.000001 |
a2398d77f550a5b73c5bbd76d30131c88c64caa4 | Make the example a bit more exciting. | swig/test.py | swig/test.py | import formast
e = formast.Expr()
formast.parse_xml("test.txt", e)
class Printer(formast.Visitor):
def expr_uint(self, v):
print v,
def expr_add(self, left, right):
print "(",
self.expr(left)
print "+",
self.expr(right)
print ")",
def expr_sub(self, left, ... | import formast
e = formast.Expr()
formast.parse_xml("test.txt", e)
class Visitor(formast.Visitor):
def expr_uint(self, v):
print(v)
def expr_add(self, left, right):
print "("
self.expr(left)
print "+"
self.expr(right)
print ")"
def expr_sub(self, left, rig... | Python | 0.000001 |
13de22d42ecbc51ea19bdd571262959eb29804d9 | Fix crop_and_resize usage | frcnn/roi_pool.py | frcnn/roi_pool.py | import sonnet as snt
import tensorflow as tf
import numpy as np
slim = tf.contrib.slim
CROP = 'crop'
ROI_POOLING = 'roi_pooling'
class ROIPoolingLayer(snt.AbstractModule):
"""ROIPoolingLayer which applies ROI pooling (or tf.crop_and_resize)"""
def __init__(self, pooling_mode=CROP, pooled_width=7, pooled_hei... | import sonnet as snt
import tensorflow as tf
import numpy as np
CROP = 'crop'
ROI_POOLING = 'roi_pooling'
class ROIPoolingLayer(snt.AbstractModule):
"""ROIPoolingLayer which applies ROI pooling (or tf.crop_and_resize)"""
def __init__(self, pooling_mode=CROP, pooled_width=7, pooled_height=7,
... | Python | 0.000001 |
df9b8428d6575bf68699534c37425bd1bc1c6ae8 | decrease the cache time for the block | paiji2_shoutbox/modular.py | paiji2_shoutbox/modular.py | from django.conf.urls import url, include
from modular_blocks import ModuleApp, TemplateTagBlock, modules
from . import urls
class ShoutboxModule(ModuleApp):
app_name = 'bulletin_board'
name = 'bulletin-board'
urls = url(r'^shoutbox/', include(urls))
templatetag_blocks = [
TemplateTagBlock(
... | from django.conf.urls import url, include
from modular_blocks import ModuleApp, TemplateTagBlock, modules
from . import urls
class ShoutboxModule(ModuleApp):
app_name = 'bulletin_board'
name = 'bulletin-board'
urls = url(r'^shoutbox/', include(urls))
templatetag_blocks = [
TemplateTagBlock(
... | Python | 0.000003 |
c47d11fbe4e09dcec8d0c40d778c38b04b8ccc7b | Add List-Id and List-Unsubscribe headers | uchicagohvz/users/mailing_list.py | uchicagohvz/users/mailing_list.py | # Mailing list configuration
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from uchicagohvz import secrets
from .tasks import smtp_localhost_send
from .models import Profile
from rest_framework.response import Response
from rest_framework.views import APIVi... | # Mailing list configuration
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from uchicagohvz import secrets
from .tasks import smtp_localhost_send
from .models import Profile
from rest_framework.response import Response
from rest_framework.views import APIVi... | Python | 0 |
0cc04e9a486fb7dcf312a5c336f8f529f8b1f32d | Update version 1.0.4 -> 1.0.5 | skcode/__init__.py | skcode/__init__.py | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabie... | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabie... | Python | 0 |
f343a8bc7592ab9befb5c03ccd09db61439e3f76 | remove extra buttons labelled Make Maintenance Visit | erpnext/patches/jan_mar_2012/allocated_to_profile.py | erpnext/patches/jan_mar_2012/allocated_to_profile.py | def execute():
"""
Changes allocated_to option to Profile in
DocType Customer Issue
"""
import webnotes
webnotes.conn.sql("""
UPDATE `tabDocField`
SET options='Profile'
WHERE fieldname='allocated_to'
""")
webnotes.conn.sql("""
DELETE from `tabDocField`
WHERE parent='Customer Issue'
AND label='Mak... | def execute():
"""
Changes allocated_to option to Profile in
DocType Customer Issue
"""
import webnotes
webnotes.conn.sql("""
UPDATE `tabDocField`
SET options='Profile'
WHERE fieldname='allocated_to'
""")
from webnotes.modules.module_manager import reload_doc
reload_doc('support', 'doctype', 'customer... | Python | 0 |
96176bb223f9971311a0a42c6c9845ca1c0170cc | Add base class to throttling | user_management/api/throttling.py | user_management/api/throttling.py | from rest_framework.throttling import ScopedRateThrottle
class DefaultRateMixin(object):
def get_rate(self):
try:
return self.THROTTLE_RATES[self.scope]
except KeyError:
return self.default_rate
class PostRequestThrottleMixin(object):
def allow_request(self, request, ... | from rest_framework.throttling import ScopedRateThrottle
class DefaultRateMixin(object):
def get_rate(self):
try:
return self.THROTTLE_RATES[self.scope]
except KeyError:
return self.default_rate
class PostRequestThrottleMixin(object):
def allow_request(self, request, ... | Python | 0.000001 |
72e0eb9728119d5f9c05c5b456ffb9d0c02962b1 | Correctly replace the winners column with the 0-1-2 values | data_readers.py | data_readers.py | # coding: utf-8
"""
Functions that return the data in the files, sometimes raw, with some cleaning
and/or summarization.
"""
import pandas as pd
RAW_MATCHES_FILE = 'raw_matches.csv'
RAW_WINNERS_FILE = 'raw_winners.csv'
TEAM_RENAMES_FILE = 'team_renames.csv'
def apply_renames(column):
"""Apply team renames to a ... | # coding: utf-8
"""
Functions that return the data in the files, sometimes raw, with some cleaning
and/or summarization.
"""
import pandas as pd
RAW_MATCHES_FILE = 'raw_matches.csv'
RAW_WINNERS_FILE = 'raw_winners.csv'
TEAM_RENAMES_FILE = 'team_renames.csv'
def apply_renames(column):
"""Apply team renames to a ... | Python | 0.999979 |
34ffbbfcd30a3ff0064afdfb5a07f86f425494ea | Add Todo download file test | kboard/functional_test/test_post_file_upload.py | kboard/functional_test/test_post_file_upload.py | import os
from django.conf import settings
from .base import FunctionalTest
class PostFileUploadTest(FunctionalTest):
def test_file_upload(self):
self.browser.get(self.live_server_url)
self.move_to_default_board()
# 지훈이는 첨부파일을 추가하여 새 게시글을 작성하기 위해 글 쓰기 버튼을 누른다.
self.click_create_... | import os
from django.conf import settings
from .base import FunctionalTest
class PostFileUploadTest(FunctionalTest):
def test_file_upload(self):
self.browser.get(self.live_server_url)
self.move_to_default_board()
# 지훈이는 첨부파일을 추가하여 새 게시글을 작성하기 위해 글 쓰기 버튼을 누른다.
self.click_create_... | Python | 0 |
67f3964f88b921f1c84b1e7169408806fdeade26 | hello encoding | fuckingweather.py | fuckingweather.py | """
fuckingweather.py - Willie module for The Fucking Weather
Copyright 2013 Michael Yanovich
Copyright 2013 Edward Powell
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
# -*- coding: utf-8 -*-
from willie.module import commands, rate, priority, NOLIMIT
from willie import web
import re
@comm... | """
fuckingweather.py - Willie module for The Fucking Weather
Copyright 2013 Michael Yanovich
Copyright 2013 Edward Powell
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
from willie.module import commands, rate, priority, NOLIMIT
from willie import web
import re
@commands('fucking_weather', ... | Python | 0.999155 |
07760e1b31c0cc33533d595f7a29e6231d580039 | remove unused component | tests/cypress/dash/v_copy_paste.py | tests/cypress/dash/v_copy_paste.py | # pylint: disable=global-statement
import dash
from dash.dependencies import Input, Output, State
import dash_html_components as html
import os
import pandas as pd
import sys
sys.path.append(
os.path.abspath(
os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir, os.pardir)
)
)
module_names =... | # pylint: disable=global-statement
import dash
from dash.dependencies import Input, Output, State
import dash_html_components as html
import dash_core_components as dcc
import os
import pandas as pd
import sys
sys.path.append(
os.path.abspath(
os.path.join(os.path.dirname(sys.argv[0]), os.pardir, os.pardir... | Python | 0.000004 |
e0713d8c537c17c9a4701fc7dcd9006749072201 | increase dimension for supplier invoice number | l10n_it_account/wizard/check_account_invoive.py | l10n_it_account/wizard/check_account_invoive.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2017 Didotech SRL
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; eithe... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2017 Didotech SRL
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; eithe... | Python | 0 |
3f37df8c9c22e1ee84894fe255334089b4b974b2 | Work on diffusion model | landlab/components/diffusion/diffusion_model.py | landlab/components/diffusion/diffusion_model.py | #! /usr/env/python
"""
Landlab model of 2D diffusion, using DiffusionComponent.
Created July 2013 GT
Last updated August 2013 GT
"""
import sys # for command-line arguments
from landlab import ModelParameterDictionary # for input file
from landlab import create_and_initialize_gri... | #! /usr/env/python
"""
Landlab model of 2D diffusion, using DiffusionComponent.
Created July 2013 GT
Last updated August 2013 GT
"""
import sys # for command-line arguments
from landlab import ModelParameterDictionary # for input file
from landlab import create_and_initialize_gri... | Python | 0.000001 |
70fdc88e73e52a800dd86504bab7fbf9ad89e1d8 | Add partial_path property explicitly to the Work model. | app/soc/models/work.py | app/soc/models/work.py | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | #!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 0 |
226639f98dee43e21db70070108d0c3131d75729 | move to version 0.2.1b | gemini/version.py | gemini/version.py | __version__="0.2.1b"
| __version__="0.2.0b"
| Python | 0.000001 |
e01eccd8af27ad97a20b784b81ddde5cc8515e4b | fix incorrect codding utf8 to utf-8 (#903) | faker/providers/internet/hu_HU/__init__.py | faker/providers/internet/hu_HU/__init__.py | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
free_email_domains = (
'gmail.com',
'hotmail.com',
'yahoo.com',
)
tlds = (
'hu',
'com',
'com.hu',
'info',
'... | # coding=utf8
from __future__ import unicode_literals
from .. import Provider as InternetProvider
class Provider(InternetProvider):
free_email_domains = (
'gmail.com',
'hotmail.com',
'yahoo.com',
)
tlds = (
'hu',
'com',
'com.hu',
'info',
'o... | Python | 0.000018 |
69c6c5126ebed3d2144300259c6d739f5323f0c3 | fix bug, return data instead of none | geotweet/steps.py | geotweet/steps.py | import json
from log import logger, get_rotating_logger
class ProcessStep(object):
""" Base Class used to build data processing chain """
next_step = None
def get_next(self):
return self.next_step
def set_next(self, next_step):
self.next_step = next_step
def next(self, ... | import json
from log import logger, get_rotating_logger
class ProcessStep(object):
""" Base Class used to build data processing chain """
next_step = None
def get_next(self):
return self.next_step
def set_next(self, next_step):
self.next_step = next_step
def next(self, ... | Python | 0.000002 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.