repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
UManPychron/pychron | refs/heads/develop | alembic_dvc/versions/69484796482_sample_prep_updates.py | 2 | """sample prep updates
Revision ID: 69484796482
Revises: 35388de3b2c1
Create Date: 2018-02-26 15:56:36.885264
"""
# revision identifiers, used by Alembic.
import datetime
from sqlalchemy import func
revision = '69484796482'
down_revision = '508864cbfc71'
from alembic import op
import sqlalchemy as sa
def upgrad... |
JioCloud/cinder | refs/heads/master | cinder/tests/unit/api/extensions/__init__.py | 12133432 | |
vesmbo/alexsash | refs/heads/master | app/onesite/migrations/__init__.py | 12133432 | |
pzfreo/ox-clo | refs/heads/master | code/wind-and-sfpd/python3-wind-sfpd.py | 1 | from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext, Row
from dateutil.parser import parse
from datetime import datetime
from numpy import array
from scipy import spatial
from pyspark.mllib.linalg import Vectors
from pyspark.mllib.stat import Statistics
#spark sql setup
conf = SparkConf... |
rajarammallya/melange | refs/heads/master | melange/tests/unit/test_ipam_views.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/gs/lifecycle.py | 157 | # Copyright 2013 Google Inc.
#
# 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, merge, publish, dis-
# trib... |
2014c2g2/2014c2 | refs/heads/master | exts/sphinx.search.py | 38 | # -*- coding: utf-8 -*-
"""
sphinx.search
~~~~~~~~~~~~~
Create a search index for offline search.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
採用結巴套件 for Python3 進行中文繁體內容的分詞
https://github.com/fxsjy/jieba
"""
imp... |
waheedahmed/edx-platform | refs/heads/master | lms/djangoapps/commerce/urls.py | 53 | """
Defines the URL routes for this app.
"""
from django.conf.urls import patterns, url
from commerce import views
urlpatterns = patterns(
'',
url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'),
url(r'^checkout/error/$', views.checkout_error, name='checkout_error'),
url(r'^chec... |
ai-ku/langvis | refs/heads/master | jython-2.1/Lib/test/test_time.py | 7 | from test_support import *
import time
print_test('time (test_time.py)', 1)
time.altzone
time.clock()
t = 1.0e9
print_test('gmtime', 2)
assert time.gmtime(t)[0] == 2001 #(2001, 9, 9, 1, 46, 40, 6, 252, 0)
print_test('asctime')
assert time.asctime((2001, 9, 9, 1, 46, 40, 6, 252, 0))[-4:] == '2001' #'Sun Sep 09 01:4... |
nandoflorestan/babel | refs/heads/master | docs/conf.py | 6 | # -*- coding: utf-8 -*-
#
# Babel documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 3 17:53:01 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
jackytu/newbrandx | refs/heads/rankx | tests/_site/shipping/methods.py | 118 | class Free(object):
pass |
mohamedadaly/trex | refs/heads/master | build/msvc/gen.py | 1 | from __future__ import print_function
import sys
import os
vcppguid = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" # C++ project
siguid = "2150E333-8FDC-42A3-9474-1A3956D46DE8" # project group
# to generate a new uuid:
#
# import uuid
# uuid.uuid4().__str__().upper()
def create_mex_project(name, uuid11, uuid09):
return... |
selfcommit/simian | refs/heads/master | src/tests/simian/mac/munki/handlers/icons_test.py | 2 | #!/usr/bin/env python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
codeworldprodigy/lab4 | refs/heads/master | lib/werkzeug/datastructures.py | 314 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... |
a7xtony1/plugin.video.ELECTROMERIDAtv | refs/heads/master | modules/libraries/pyaes/aes.py | 177 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
puuu/micropython | refs/heads/master | tests/basics/op_error_memoryview.py | 4 | # test errors from bad operations (unary, binary, etc)
try:
memoryview
except:
import sys
print("SKIP")
sys.exit()
def test_exc(code, exc):
try:
exec(code)
print("no exception")
except exc:
print("right exception")
except:
print("wrong exception")
# unsuppor... |
priyankarani/nereid-checkout | refs/heads/develop | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import sys
import re
import os
import ConfigParser
import unittest
from setuptools import setup, Command
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class SQLiteTest(Command):
"""
Run the tests on SQLite
... |
CCI-MOC/nova | refs/heads/k2k-liberty | nova/image/download/base.py | 118 | # Copyright 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
boyombo/django-stations | refs/heads/master | stations/insure/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
jainayush975/zulip | refs/heads/master | zerver/tests/test_push_notifications.py | 9 | import mock
from mock import call
import time
from typing import Any, Dict, Union, SupportsInt, Text
import gcm
from django.test import TestCase
from django.conf import settings
from zerver.models import PushDeviceToken, UserProfile, Message
from zerver.models import get_user_profile_by_email, receives_online_notifi... |
hurricup/intellij-community | refs/heads/master | python/testData/mover/multiLineSelection5_afterDown.py | 83 | class Test(object):
def q(self):
c = 3
<selection><caret>a = 1
b = 2
</selection> |
40223119/2015w11 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/html/entities.py | 814 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... |
schristophe/starspot | refs/heads/master | starspot/color/__init__.py | 2 | #
#
import bolcor as bc
|
KamranMackey/readthedocs.org | refs/heads/master | readthedocs/rtd_tests/tests/test_views.py | 10 | from django.test import TestCase
from django.contrib.auth.models import User
from projects.models import Project
from projects.forms import UpdateProjectForm
class Testmaker(TestCase):
fixtures = ["eric"]
def test_imported_docs(self):
# Test Import
self.client.login(username='eric', password... |
nohona/cron-crm | refs/heads/master | usr/local/certbot/certbot/plugins/common_test.py | 4 | """Tests for certbot.plugins.common."""
import os
import shutil
import tempfile
import unittest
import mock
import OpenSSL
from acme import challenges
from acme import jose
from certbot import achallenges
from certbot.tests import acme_util
from certbot.tests import util as test_util
class NamespaceFunctionsTest(... |
coreyoconnor/nixops | refs/heads/master | nixops/util.py | 2 | # -*- coding: utf-8 -*-
import os
import sys
import time
import json
import copy
import fcntl
import base64
import select
import socket
import struct
import shutil
import tempfile
import subprocess
import logging
import atexit
from StringIO import StringIO
devnull = open(os.devnull, 'rw')
def check_wait(test, initi... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.5/tests/modeltests/signals/tests.py | 112 | from __future__ import absolute_import
from django.db.models import signals
from django.dispatch import receiver
from django.test import TestCase
from django.utils import six
from .models import Person, Car
# #8285: signals can be any callable
class PostDeleteHandler(object):
def __init__(self, data):
s... |
OpenSoccerManager/opensoccermanager-editor | refs/heads/master | uigtk/clubs.py | 1 | #!/usr/bin/env python3
# This file is part of OpenSoccerManager-Editor.
#
# OpenSoccerManager is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any la... |
manassolanki/erpnext | refs/heads/develop | erpnext/hr/doctype/travel_request/travel_request.py | 18 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class TravelRequest(Document):
pass
|
VirtualWatershed/vwadaptor | refs/heads/master | vwadaptor/worker.py | 2 | import os
from celery import Celery
from vwadaptor.settings import DevConfig, ProdConfig
if os.environ.get("VWADAPTOR_ENV") == 'prod':
config = ProdConfig
else:
config = DevConfig
celery= Celery('vwadaptor',
broker=config.CELERY_BROKER_URL,
backend=config.CELERY_RESULT_BACKEND... |
alqfahad/odoo | refs/heads/8.0 | openerp/addons/base/ir/ir_translation.py | 117 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
westernx/vee | refs/heads/master | vee/_vendor/setuptools/depends.py | 462 | import sys
import imp
import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
from setuptools import compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building or inst... |
coala-analyzer/coala-bears | refs/heads/master | bears/general/LicenseHeaderBear.py | 3 | import re
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
class LicenseHeaderBear(LocalBear):
"""
Checks for copyright notice in a file.
"""
LANGUAGES = {'All'}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}
LICEN... |
jbenden/ansible | refs/heads/devel | lib/ansible/modules/windows/win_security_policy.py | 18 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
gppezzi/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/s/scalapack.py | 12 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
diofeher/django-nfa | refs/heads/master | django/core/serializers/base.py | 2 | """
Module for abstract serializer/unserializer base classes.
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.db import models
from django.utils.encoding import smart_str, smart_unicode
class SerializationError(Exception):
"""Something bad happened dur... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/whoosh/support/charset.py | 95 | # coding=utf-8
"""This module contains tools for working with Sphinx charset table files. These files
are useful for doing case and accent folding.
See :class:`whoosh.analysis.CharsetTokenizer` and :class:`whoosh.analysis.CharsetFilter`.
"""
from collections import defaultdict
import re
from whoosh.compat import izi... |
MatthewWilkes/django-oscar | refs/heads/master | src/oscar/apps/checkout/exceptions.py | 63 | class FailedPreCondition(Exception):
def __init__(self, url, message=None, messages=None):
self.url = url
if message:
self.messages = [message]
elif messages:
self.messages = messages
else:
self.messages = []
class PassedSkipCondition(Exception)... |
justvanbloom/airtime | refs/heads/2.5.x | python_apps/media-monitor/mm2/media/monitor/toucher.py | 10 | # -*- coding: utf-8 -*-
import pure as mmp
import os
from log import Loggable
from exceptions import CouldNotCreateIndexFile
from ..saas.thread import InstanceInheritingThread
class Toucher(Loggable):
"""
Class responsible for touching a file at a certain path when called
"""
de... |
cortedeltimo/SickRage | refs/heads/master | lib/sqlalchemy/ext/instrumentation.py | 80 | """Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM. Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed... |
Reroot/stagger | refs/heads/master | test/fileutil.py | 15 | #!/usr/bin/env python3
#
# fileutil.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... |
bencevans/mopidy | refs/heads/develop | tests/core/test_mixer.py | 17 | from __future__ import absolute_import, unicode_literals
import unittest
import mock
import pykka
from mopidy import core, mixer
from tests import dummy_mixer
class CoreMixerTest(unittest.TestCase):
def setUp(self): # noqa: N802
self.mixer = mock.Mock(spec=mixer.Mixer)
self.core = core.Core(... |
mattmccarthy11/vidly-development | refs/heads/master | bk/mediadrop/lib/tests/helpers_test.py | 10 | # -*- coding: utf-8 -*-
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/plat-linux3/IN.py | 3 | # Generated by h2py from /usr/include/netinet/in.h
_NETINET_IN_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC95_SOURCE = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 200809L
_XOPEN_SOURCE = 700
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_S... |
mbareta/edx-platform-ft | refs/heads/open-release/eucalyptus.master | lms/djangoapps/badges/api/views.py | 17 | """
API views for badges
"""
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework import generics
from rest_framework.exceptions import APIException
from openedx.core.djangoapps.user_api.permissions import is_field_shared_factory
from openedx.core.lib.api.authenticatio... |
dkubiak789/odoo | refs/heads/8.0 | openerp/addons/base/tests/test_api.py | 182 |
from openerp import models
from openerp.tools import mute_logger
from openerp.osv.orm import except_orm
from openerp.tests import common
class TestAPI(common.TransactionCase):
""" test the new API of the ORM """
def assertIsRecordset(self, value, model):
self.assertIsInstance(value, models.BaseModel... |
snakeleon/YouCompleteMe-x64 | refs/heads/master | third_party/ycmd/ycmd/completers/language_server/generic_lsp_completer.py | 3 | # Copyright (C) 2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd... |
PabloPiaggi/plumed2 | refs/heads/master | user-doc/tutorials/lugano-2/wham.py | 6 | import math
import sys
# arguments read from command line
# name of input file
FILENAME_ = sys.argv[1]
# number of BIAS
NBIAS_ = int(sys.argv[2])
# temperature
KBT_ = float(sys.argv[3])
# default parameters for WHAM
# number of WHAM iterations
NWHAM_ = 10000
# convergence thresold
THRES_ = 1.0e-10
def get_wham_weigh... |
frnhr/django-cms | refs/heads/develop | cms/extensions/toolbar.py | 43 | # -*- coding: utf-8 -*-
from cms.utils.urlutils import admin_reverse
from cms.api import get_page_draft
from cms.toolbar_base import CMSToolbar
from cms.utils import get_cms_setting
from cms.utils.permissions import has_page_change_permission
from django.core.urlresolvers import NoReverseMatch
class ExtensionToolbar(... |
ap--/python-seabreeze | refs/heads/master | src/seabreeze/pyseabreeze/transport.py | 1 | """Implementation of the Seabreeze Transport layer.
Some spectrometers can support different transports (usb, network, rs232, etc.)
"""
import importlib
import inspect
import logging
import warnings
from functools import partial
import usb.core
import usb.util
try:
from functools import partialmethod
except Imp... |
openslack/openslack-monitor | refs/heads/master | portal/web/controller/expression.py | 5 | # -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'
from web import app
from flask import request, g, render_template, jsonify
from web.model.expression import Expression
from web.model.action import Action
from frame.params import required_chk
from frame.config import UIC_ADDRESS
@app.route('/expressions')
def expressio... |
hale36/SRTV | refs/heads/master | lib/imdb/_exceptions.py | 128 | """
_exceptions module (imdb package).
This module provides the exception hierarchy used by the imdb package.
Copyright 2004-2009 Davide Alberani <da@erlug.linux.it>
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 Soft... |
xuweiliang/Codelibrary | refs/heads/master | nova/virt/libvirt/volume/gpfs.py | 54 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
jpadilla/dj-stripe | refs/heads/master | tests/apps/testapp_namespaced/__init__.py | 12133432 | |
gm2211/vpnAlfredWorkflow | refs/heads/develop | src/alp/core_dependencies/__init__.py | 12133432 | |
wmde/jenkins-job-builder | refs/heads/master | tests/properties/__init__.py | 12133432 | |
gajendrasinghSolanki/qualitybots | refs/heads/master | src/appengine/filters/__init__.py | 12133432 | |
Juniper/neutron | refs/heads/master | neutron/plugins/bigswitch/config.py | 6 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Big Switch Networks, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.a... |
zlsun/XX-Net | refs/heads/master | code/default/python27/1.0/lib/wsgiref/validate.py | 23 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/django-extensions/django_extensions/templatetags/highlighting.py | 44 | """
Similar to syntax_color.py but this is intended more for being able to
copy+paste actual code into your Django templates without needing to
escape or anything crazy.
http://lobstertech.com/2008/aug/30/django_syntax_highlight_template_tag/
Example:
{% load highlighting %}
<style>
@import url("http://lobsterte... |
krull/docker-zenoss4 | refs/heads/master | init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.Microsoft.Windows-2.6.9.egg/ZenPacks/zenoss/Microsoft/Windows/migrate/RemoveWinRMServices.py | 1 | ##############################################################################
#
# Copyright (C) Zenoss, Inc. 2016, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python-build/python-libs/gdata/src/gdata/client.py | 133 | #!/usr/bin/env python
#
# Copyright (C) 2008, 2009 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 appli... |
yaroslavprogrammer/django-axes | refs/heads/master | axes/test_urls.py | 29 | from django.conf.urls import patterns, include
from django.contrib import admin
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
) |
arunpersaud/pico-python | refs/heads/master | examples/specgram_plot.py | 3 | # -*- coding: utf-8
#
# Colin O'Flynn, Copyright (C) 2013. All Rights Reserved. <coflynn@newae.com>
#
import math
import time
import inspect
import numpy as np
from picoscope import ps6000
import pylab as plt
import scipy
import scipy.fftpack
def fft(signal, freq):
FFT = abs(scipy.fft(signal))
FFTdb = 20*sci... |
xsynergy510x/android_external_chromium_org | refs/heads/cm-12.1 | components/policy/resources/PRESUBMIT.py | 44 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# If this presubmit check fails or misbehaves, please complain to
# mnissler@chromium.org, pastarmovj@chromium.org or joaodasilva@chromium.org.
import i... |
hw20686832/simple_crawler | refs/heads/master | utils/logger.py | 1 | #coding:utf-8
import logging
class Logger(object):
def __init__(self):
self.handler = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s [%(name)s]-%(levelname)s: %(message)s")
self.handler.setFormatter(formatter)
def getlog(self, logger="crawler", level=None):
... |
dvberkel/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/logger.py | 489 | class NoOpLogger(object):
def critical(self, msg):
pass
def error(self, msg):
pass
def info(self, msg):
pass
def warning(self, msg):
pass
def debug(self, msg):
pass
logger = NoOpLogger()
_set_logger = False
def set_logger(new_logger):
global _set_log... |
barbuza/django | refs/heads/master | tests/migrations/migrations_test_apps/lookuperror_a/migrations/0004_a4.py | 381 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0003_a3'),
]
operations = [
migrations.CreateModel(
name='A4',
fields=[
... |
towerjoo/mindsbook | refs/heads/master | django/conf/urls/shortcut.py | 353 | from django.conf.urls.defaults import *
urlpatterns = patterns('django.views',
(r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
)
|
Onirik79/aaritmud | refs/heads/master | data/proto_items/carrozzone-zingaro/__init__.py | 12133432 | |
chuckoy/monopoly-cash-tracker | refs/heads/master | monopoly/__init__.py | 12133432 | |
centrumholdings/cthulhubot | refs/heads/master | tests/unit_project/tests/test_particular_commands.py | 1 | from djangosanetesting import UnitTestCase
from mock import Mock
from django.conf import settings
from cthulhubot.commands import get_available_commands, get_command, get_undiscovered_commands
from cthulhubot.mongo import get_database_name
from cthulhubot.models import Project
from cthulhubot.commands import Git, AD... |
timm/timmnix | refs/heads/master | pypy3-v5.5.0-linux64/lib-python/3/test/test_eof.py | 88 | """test script for a few new invalid token catches"""
import unittest
from test import support
class EOFTestCase(unittest.TestCase):
def test_EOFC(self):
expect = "EOL while scanning string literal (<string>, line 1)"
try:
eval("""'this is a test\
""")
except Syntax... |
NSAmelchev/ignite | refs/heads/master | modules/platforms/python/pyignite/datatypes/__init__.py | 11 | # Licensed to the Apache Software Foundation (ASF) 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 ... |
SaschaMester/delicium | refs/heads/master | tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py | 1 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import logging
import urlparse
from common.chrome_proxy_measurements import ChromeProxyValidation
from integration_tests import chrome_proxy_m... |
brian-l/django-1.4.10 | refs/heads/master | django/forms/extras/widgets.py | 88 | """
Extra HTML Widget classes
"""
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
from django.conf import settings
__all__ =... |
mattiacarpin/opportunistic | refs/heads/master | src/flow-monitor/examples/wifi-olsr-flowmon.py | 108 | # -*- Mode: Python; -*-
# Copyright (c) 2009 INESC Porto
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
#... |
40223112/w16test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_program.py | 738 | import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... |
klahnakoski/cloc | refs/heads/master | cloc/util/vendor/dateutil/zoneinfo/__init__.py | 144 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
from dateutil.tz import tzfile
from tarfile import TarFile
import os
__author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>"
__license__ = "Simplifie... |
unicefuganda/edtrac | refs/heads/master | edtrac_project/rapidsms_geoserver/geoserver/management/commands/__init__.py | 12133432 | |
OpenSlides/openslides-csv-export | refs/heads/master | tests/__init__.py | 12133432 | |
Maccimo/intellij-community | refs/heads/master | python/testData/formatter/multilineElifCondition.py | 22 | if foo and \
bar == 42:
pass
elif foo and \
bar:
pass
elif foo and \
bar == 24:
pass |
xhat/micropython | refs/heads/master | tests/float/math_fun_special.py | 44 | # test the special functions imported from math
try:
from math import *
erf
except (ImportError, NameError):
print("SKIP")
import sys
sys.exit()
test_values = [-8., -2.5, -1, -0.5, 0.0, 0.5, 2.5, 8.,]
pos_test_values = [0.001, 0.1, 0.5, 1.0, 1.5, 10.,]
functions = [
('erf', erf, test_values),... |
ESOedX/edx-platform | refs/heads/master | lms/djangoapps/discussion/django_comment_client/tests/factories.py | 2 | # pylint: disable=missing-docstring
from __future__ import absolute_import
from factory.django import DjangoModelFactory
from openedx.core.djangoapps.django_comment_common.models import Permission, Role
class RoleFactory(DjangoModelFactory):
class Meta(object):
model = Role
name = 'Student'
cou... |
ThinkOpen-Solutions/odoo | refs/heads/stable | addons/l10n_in_hr_payroll/report/__init__.py | 424 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... |
vipins/ccccms | refs/heads/master | env/Lib/site-packages/django/utils/safestring.py | 392 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
f... |
gevious/flask_slither | refs/heads/master | tests/acceptance/minimal-test.py | 1 | # -*- coding: utf-8 -*-
# The minimal test setup consists of a basic resource linked to a mongo
# database. Only the most basic functions are tested, without authentication
# or validation. It is designed to mimic a basic out-the-box resource and
# ensure that works as expected.
from bson.objectid import ObjectId
from... |
tmimori/erpnext | refs/heads/develop | erpnext/stock/doctype/variant_attribute/variant_attribute.py | 18 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class VariantAttribute(Document):
pass
|
ahmadRagheb/goldenHR | refs/heads/master | erpnext/commands/__init__.py | 41 | # Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, absolute_import, print_function
import click
import frappe
from frappe.commands import pass_context, get_site
def call_command(cmd, context):
return click.Context(cmd, obj=c... |
expertmm/KivyPixels | refs/heads/master | kivypixels.py | 1 | from pythonpixels import PPImage, PPColor
# from pythonpixels import PPColor
from pythonpixels import vec4_from_vec3, bgr_from_hex
import pygame
import os
from pythonpixels import bufferToTupleStyleString
# formerly static_createFromImageFile
def load_image(self,fileName):
returnKVI = None
if os.path.exists(f... |
skg-net/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_ipaddrgroup.py | 20 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
frederick-masterton/django | refs/heads/master | tests/datetimes/__init__.py | 12133432 | |
KellyChan/python-examples | refs/heads/master | python/algorithms-py/algos/twosum/python/twosum.py | 6 | import time
class TwoSum(object):
def __init__(self, nums, target):
self.nums = nums
self.target = target
def brute_force(self):
"""
- time complexity: O(n^2)
- space complexity: O(1)
"""
time_start = time.time()
for i in range(len(self.nums... |
Colabra/SMU | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | 1283 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... |
specialunderwear/django-easymode | refs/heads/master | easymode/i18n/meta/utils.py | 3 | """
utility functions used by easymode's i18n.meta package to get localized attributes
from a class.
"""
from django.conf import settings
from django.utils import translation
from easymode.utils import first_match
from easymode.utils.languagecode import get_real_fieldname
from easymode.utils import first_match
def v... |
ryan-talley/f5-cccl | refs/heads/master | f5_cccl/resource/ltm/profile/__init__.py | 1 | #!/usr/bin/env python
# Copyright (c) 2017,2018, F5 Networks, 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 app... |
dbentley/pants | refs/heads/master | pants-plugins/src/python/internal_backend/__init__.py | 12133432 | |
tmimori/frappe | refs/heads/develop | frappe/integrations/doctype/s3_backup_settings/__init__.py | 12133432 | |
myaskevich/python-bype | refs/heads/master | test/__init__.py | 12133432 | |
dnouri/Lasagne | refs/heads/master | nntools/theano_extensions/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.