repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
wong2/sentry | refs/heads/master | src/sentry/interfaces/exception.py | 8 | """
sentry.interfaces.exception
~~~~~~~~~~~~~~~~~~~~~~~~~~~
: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
__all__ = ('Exception',)
from django.conf import settings
from sentry.interfaces.base impor... |
abhishekgahlot/scikit-learn | refs/heads/master | sklearn/preprocessing/tests/test_weights.py | 260 | from sklearn.preprocessing._weights import _balance_weights
from sklearn.utils.testing import assert_array_equal
def test_balance_weights():
weights = _balance_weights([0, 0, 1, 1])
assert_array_equal(weights, [1., 1., 1., 1.])
weights = _balance_weights([0, 1, 1, 1, 1])
assert_array_equal(weights, [... |
savoirfairelinux/django | refs/heads/master | tests/model_permalink/models.py | 58 | import warnings
from django.db import models
from django.utils.deprecation import RemovedInDjango21Warning
def set_attr(name, value):
def wrapper(function):
setattr(function, name, value)
return function
return wrapper
with warnings.catch_warnings():
warnings.simplefilter('ignore', cate... |
mandeep/Mausoleum | refs/heads/master | mausoleum/images/__init__.py | 12133432 | |
pgmillon/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_user_device.py | 1 | # Copyright 2019 Fortinet, Inc.
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
oopy/micropython | refs/heads/master | tests/basics/list_mult.py | 55 | # basic multiplication
print([0] * 5)
# check negative, 0, positive; lhs and rhs multiplication
for i in (-4, -2, 0, 2, 4):
print(i * [1, 2])
print([1, 2] * i)
# check that we don't modify existing list
a = [1, 2, 3]
c = a * 3
print(a, c)
# unsupported type on RHS
try:
[] * None
except TypeError:
pri... |
ClovisIRex/Snake-django | refs/heads/master | env/lib/python3.6/site-packages/pylint/test/functional/unused_typing_imports.py | 5 | # pylint: disable=missing-docstring, bad-whitespace
"""Regression test for https://github.com/PyCQA/pylint/issues/1168
The problem was that we weren't handling keyword-only arguments annotations,
which means we were never processing them.
"""
from typing import Optional, Callable, Iterable
def func1(arg: Optional[... |
kool79/intellij-community | refs/heads/master | python/testData/quickdoc/NumPyOnesDoc.py | 79 | import numpy as np
x = np.<the_ref>ones(10)
|
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | common/test/acceptance/pages/lms/find_courses.py | 24 | """
Find courses page (main page of the LMS).
"""
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL
class FindCoursesPage(PageObject):
"""
Find courses page (main page of the LMS).
"""
url = BASE_URL
def is_browser_on_page(self):
return "... |
nditech/elections | refs/heads/master | apollo/formsframework/tasks.py | 2 | from .. import services
from ..factory import create_celery_app
celery = create_celery_app()
@celery.task
def update_submissions(form_pk):
'''
Updates submissions after a form has been updated, so all the fields
in the form are existent in the submissions.
'''
form = services.forms.get(pk=form_pk... |
nachtmaar/androlyze | refs/heads/master | androlyze/log/streamhandler/MsgCollectorStreamHandler.py | 1 |
# encoding: utf-8
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
from Queue import Empty
from logging import StreamHandler
class MsgCollectorStreamHandler(StreamHandler):
''' `StreamHandler` that collects stdout/stderr messages in a `Queue<bool,str> '''
def __init__... |
jblackm2/New-Beginnings | refs/heads/master | spam-bayes.py | 2 | # Copyright (c) 2014 redacted
# Should read the data from gen-email.py
# Produce a table estimating the probabilities of ham or spam
# of future messages based on the exclamation point
# Pr(S|E) = Pr(E|S) Pr(S) / PR(E)
# Pr(S|E) = EnS/S * (S/l) / (E/l)
# Pr(H|E) = EnH/H * (H/1) / (E/1)
# Pr(H|N) = NnH/H * (H/l) / (N/l)... |
chreman/SNERpy | refs/heads/master | test.py | 1 | import SNER
text = "President Barack Obama met Fidel Castro at the United Nations in New York."
entities = SNER.get_NEs(text)
print entities
|
dcadevil/vitess | refs/heads/master | py/vtproto/vtrpc_pb2.py | 4 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: vtrpc.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mes... |
dch312/numpy | refs/heads/master | numpy/lib/tests/test__version.py | 84 | """Tests for the NumpyVersion class.
"""
from __future__ import division, absolute_import, print_function
from numpy.testing import assert_, run_module_suite, assert_raises
from numpy.lib import NumpyVersion
def test_main_versions():
assert_(NumpyVersion('1.8.0') == '1.8.0')
for ver in ['1.9.0', '2.0.0', '1... |
seocam/django | refs/heads/master | django/contrib/gis/db/backends/spatialite/models.py | 510 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connectio... |
pidah/st2contrib | refs/heads/master | packs/rackspace/actions/list_vm_images.py | 12 | from lib.action import PyraxBaseAction
__all__ = [
'ListVMImagesAction'
]
class ListVMImagesAction(PyraxBaseAction):
def run(self):
cs = self.pyrax.cloudservers
imgs = cs.images.list()
result = {}
for img in imgs:
result[img.id] = img.name
return result
|
nicolargo/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/fi/forms.py | 309 | """
FI-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
default_error_messages = {
... |
discosultan/quake-console | refs/heads/master | Samples/Sandbox/Lib/_LWPCookieJar.py | 267 | """Load / save to libwww-perl (LWP) format files.
Actually, the format is slightly extended from that used by LWP's
(libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information
not recorded by LWP.
It uses the version string "2.0", though really there isn't an LWP Cookies
2.0 format. This indicates that ... |
HackerEarth/brahma | refs/heads/master | brahma/settings.py | 2 | # Django settings for brahma project.
import os
import sys
SETTINGS_DIR = os.path.dirname(__file__)
PROJECT_ROOT = os.path.abspath(os.path.join(SETTINGS_DIR, os.pardir))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': ... |
Anlim/decode-Django | refs/heads/master | Django-1.5.1/tests/regressiontests/generic_views/forms.py | 50 | from __future__ import absolute_import
from django import forms
from .models import Author
class AuthorForm(forms.ModelForm):
name = forms.CharField()
slug = forms.SlugField()
class Meta:
model = Author
class ContactForm(forms.Form):
name = forms.CharField()
message = forms.CharField(... |
donlee888/JsObjects | refs/heads/master | Python/PythonParams/src/params/params.py | 2 | '''
Created on May 6, 2012
@author: Charlie
'''
# Notice the default values assigned to these parameters
def bar(one=1, two=2, three=3):
print one
print two
print three
def foo(one, two, three):
print one
print two
print three
# These calls are both legal though bar takes 3 param... |
ecreall/nova-ideo | refs/heads/master | novaideo/content/processes/channel_management/behaviors.py | 1 | # -*- coding: utf8 -*-
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
"""
This module represent all of behaviors used in the
Channel management process definition.
"""
from pyramid.httpexceptions import HTTPFound
fr... |
CuonDeveloper/cuon | refs/heads/master | cuon_client/Client/CUON/cuon/Bank/__init__.py | 12133432 | |
erkanay/django | refs/heads/master | tests/multiple_database/__init__.py | 12133432 | |
CDSFinance/zipline | refs/heads/master | tests/utils/__init__.py | 12133432 | |
tmpgit/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/ro/__init__.py | 12133432 | |
simras/CLAP | refs/heads/master | scripts/adapterHMM_multiPY.py | 1 | #!/usr/bin/python
# adapterHMM2_para.py
# Example adapterHMM2_para.py -f infile.fastq -o out.fastq -l 20 -s TCGTATGCCGTCTTCTGCTTG -p 35 -n
# By Simon H. Rasmussen
# Bioinformatics Centre
# University of Copenhagen
def run(orig_file,cut_file,cutoff,mp,model,seq,ntrim,trim,BS,prime,qtype):
import os
im... |
ppmt/Crust | refs/heads/master | flask/lib/python2.7/site-packages/pbr/pbr_json.py | 40 | # Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
#
# htt... |
bdastur/notes | refs/heads/master | python/asyncio/ev_blocking.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import asyncio
import concurrent.futures
import time
import boto3
def get_instances():
print("Get instances...")
session = boto3.Session(profile_name="dev1", region_name="us-west-2")
ec2_client = session.client("ec2")
data = ec2_client.describe_instance... |
pkimber/enquiry | refs/heads/master | example_enquiry/base.py | 1 | # -*- encoding: utf-8 -*-
""" Django settings """
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse_lazy
def get_env_variable(key):
"""
Get the environment variable or return exception
Copied from Django two scoops book
"""
try:
... |
erwilan/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_snmp_location.py | 55 | #!/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 distribut... |
cafecivet/django_girls_tutorial | refs/heads/master | Lib/site-packages/django/core/cache/backends/dummy.py | 87 | "Dummy cache backend"
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):
key = self.make_key... |
heke123/chromium-crosswalk | refs/heads/master | third_party/cython/src/Cython/Compiler/Lexicon.py | 90 | # cython: language_level=3, py2_import=True
#
# Cython Scanner - Lexical Definitions
#
raw_prefixes = "rR"
bytes_prefixes = "bB"
string_prefixes = "uU" + bytes_prefixes
char_prefixes = "cC"
any_string_prefix = raw_prefixes + string_prefixes + char_prefixes
IDENT = 'IDENT'
def make_lexicon():
from Cython.Plex im... |
suqinhuang/avocado-vt | refs/heads/master | selftests/unit/test_cartesian_config.py | 10 | #!/usr/bin/python
import unittest
import os
import gzip
import sys
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(basedir)
from virttest import cartesian_config
mydi... |
annarev/tensorflow | refs/heads/master | tensorflow/python/saved_model/loader.py | 24 | # Copyright 2015 The TensorFlow Authors. 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 applica... |
bopo/tablib | refs/heads/develop | tablib/packages/markup.py | 53 | # This code is in the public domain, it comes
# with absolutely no warranty and you can do
# absolutely whatever you want with it.
__date__ = '17 May 2007'
__version__ = '1.7'
__doc__= """
This is markup.py - a Python module that attempts to
make it easier to generate HTML/XML from a Python program
in an intuitive, li... |
diagramsoftware/sale-workflow | refs/heads/8.0 | sale_exception_nostock/test/test_utils.py | 35 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, o... |
jhaals/ansible-modules-core | refs/heads/devel | files/lineinfile.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Ahti Kitsik <ak@ahtik.com>
#
# 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 S... |
python-bonobo/bonobo | refs/heads/develop | bonobo/commands/init.py | 2 | import os
from jinja2 import Environment, FileSystemLoader
from mondrian import humanizer
from bonobo.commands import BaseCommand
class InitCommand(BaseCommand):
TEMPLATES = {"bare", "default"}
TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "templates")
def add_arguments(self, parser):
... |
codyh12v/12valvegauges | refs/heads/master | gauges.py | 1 |
import time
import math
import Adafruit_ADS1x15
import RPi.GPIO as GPIO
import max31856 as max
# Create an ADS1115 ADC (16-bit) instance.
adc = Adafruit_ADS1x15.ADS1115()
# Or create an ADS1015 ADC (12-bit) instance.
#adc = Adafruit_ADS1x15.ADS1015()
csPin = 8
misoPin = 9
mosiPin = 10
clkPin = 11
# Note ... |
luxiaok/SaltAdmin | refs/heads/master | view/users.py | 7 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from main import *
# 用户管理
class Index:
def GET(self):
if getLogin():
SID = getLogin()['SID']
ShowName = getLogin()['ShowName']
#print "ShowName: " + ShowName
#return render.users(ShowName=ShowName)
... |
astrofimov/limbo-android | refs/heads/master | jni/qemu/scripts/tracetool/__init__.py | 205 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Machinery for generating tracing-related intermediate files.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__m... |
mkaluza/external_chromium_org | refs/heads/kk44 | tools/cr/cr/auto/build/__init__.py | 137 | # Copyright 2013 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.
"""A package that holds the modules loaded from the output directory.""" |
henryr/Impala | refs/heads/cdh5-trunk | shell/ext-py/sqlparse-0.1.14/tests/test_split.py | 29 | # -*- coding: utf-8 -*-
# Tests splitting functions.
import unittest
from tests.utils import load_file, TestCaseBase
import sqlparse
class SQLSplitTest(TestCaseBase):
"""Tests sqlparse.sqlsplit()."""
_sql1 = 'select * from foo;'
_sql2 = 'select * from bar;'
def test_split_semicolon(self):
... |
Brainbuster/openpli-buildumgebung | refs/heads/master | openembedded-core/meta/lib/oeqa/selftest/lic-checksum.py | 1 | import os
import tempfile
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import bitbake
from oeqa.utils import CommandError
class LicenseTests(oeSelfTest):
# Verify that changing a license file that has an absolute path causes
# the license qa to fail due to a mismatched md5sum.
def t... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.3/tests/regressiontests/comment_tests/tests/comment_form_tests.py | 48 | import time
from django.conf import settings
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from django.utils.hashcompat import sha_constructor
from regressiontests.comment_tests.models import Article
from regressiontests.comment_tests.tests import CommentTest... |
bmoar/ansible | refs/heads/devel | lib/ansible/plugins/callback/timer.py | 141 | import os
import datetime
from datetime import datetime, timedelta
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'aggregate'
CALLBACK_NAME = 'timer... |
wpjesus/codematch | refs/heads/dev | ietf/mailtrigger/migrations/0003_merge_request_trigger.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Recipient=apps.get_model('mailtrigger','Recipient')
MailTrigger=apps.get_model('mailtrigger','MailTrigger')
m = MailTrigger.objects.create(
slug='person_merge_re... |
milrob/essentia | refs/heads/master | test/src/unittest/stats/test_mean.py | 10 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... |
artwr/airflow | refs/heads/master | airflow/contrib/hooks/bigquery_hook.py | 2 | # -*- coding: utf-8 -*-
#
# 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
#... |
georgemarshall/django | refs/heads/master | tests/staticfiles_tests/test_views.py | 123 | import posixpath
from urllib.parse import quote
from django.conf import settings
from django.test import override_settings
from .cases import StaticFilesTestCase, TestDefaults
@override_settings(ROOT_URLCONF='staticfiles_tests.urls.default')
class TestServeStatic(StaticFilesTestCase):
"""
Test static asset ... |
dkodnik/arp | refs/heads/master | addons/delivery/delivery.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
samuel1208/scikit-learn | refs/heads/master | examples/covariance/plot_lw_vs_oas.py | 248 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... |
msabramo/urllib3 | refs/heads/master | test/contrib/test_gae_manager.py | 12 | import unittest
from dummyserver.testcase import HTTPSDummyServerTestCase
from nose.plugins.skip import SkipTest
try:
from google.appengine.api import urlfetch
(urlfetch)
except ImportError:
raise SkipTest("App Engine SDK not available.")
from urllib3.contrib.appengine import AppEngineManager, AppEngineP... |
KnoxMakers/KM-Laser | refs/heads/master | extensions/km_deps/lxml/html/usedoctest.py | 149 | """Doctest module for HTML comparison.
Usage::
>>> import lxml.html.usedoctest
>>> # now do your HTML doctests ...
See `lxml.doctestcompare`.
"""
from lxml import doctestcompare
doctestcompare.temp_install(html=True, del_module=__name__)
|
gkarlin/django-jenkins | refs/heads/master | build/Django/django/forms/__init__.py | 207 | """
Django validation and HTML form handling.
TODO:
Default value for field
Field labels
Nestable Forms
FatalValidationError -- short-circuits all other validators on a form
ValidationWarning
"This form field requires foo.js" and form.js_includes()
"""
from __future__ import absolute_import
f... |
the-black-eagle/script.cu.lrclyrics | refs/heads/jarvis | resources/lib/culrcscrapers/darklyrics/lyricsScraper.py | 1 | #-*- coding: UTF-8 -*-
"""
Scraper for http://www.darklyrics.com/ - the largest metal lyrics archive on the Web.
scraper by smory
"""
import hashlib;
import urllib2;
import re;
from utilities import *
__title__ = "darklyrics"
__priority__ = '230';
__lrc__ = False;
class LyricsFetcher:
def __init__( self ):... |
tempbottle/kbengine | refs/heads/master | kbe/src/lib/python/Lib/lib2to3/tests/test_util.py | 147 | """ Test suite for the code in fixer_util """
# Testing imports
from . import support
# Python imports
import os.path
# Local imports
from lib2to3.pytree import Node, Leaf
from lib2to3 import fixer_util
from lib2to3.fixer_util import Attr, Name, Call, Comma
from lib2to3.pgen2 import token
def parse(code, strip_leve... |
proflayton/pyMediaManip | refs/heads/master | ColorCube.py | 1 | '''
ColorCube.py
Used for Color Quantization
Uses Uniform Quantization
Right now its pretty stupid, would like to eventually make weighted clusters
Author: Brandon Layton
'''
import math
class ColorCube:
division = 0
#default divisions divy up 256 colors (rounded)
def __init__(self,colorSize = 255):
#A = 2... |
bennylope/mock-django | refs/heads/master | mock_django/models.py | 3 | """
mock_django.models
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import mock
__all__ = ('ModelMock',)
# TODO: make foreignkey_id == foreignkey.id
class _ModelMock(mock.MagicMock):
def _get_child_mock(self, **kwargs):
name = kwargs.ge... |
fhaoquan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/sample_doctest_no_docstrings.py | 236 | # This is a sample module used for testing doctest.
#
# This module is for testing how doctest handles a module with no
# docstrings.
class Foo(object):
# A class with no docstring.
def __init__(self):
pass
|
lz1988/django-web2015 | refs/heads/master | tests/regressiontests/aggregation_regress/tests.py | 16 | from __future__ import absolute_import, unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
from django.test import TestCase, Approximate, skip... |
ianatpn/nupictest | refs/heads/master | tests/unit/py2/nupic/encoders/scalar_test.py | 2 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
marcusmueller/gnuradio | refs/heads/master | gr-utils/python/blocktool/tests/test_blocktool.py | 2 | #
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
mark-burnett/code-scientist | refs/heads/master | code_scientist/instruments/duplication/hash_manager.py | 1 | # Copyright (C) 2012 Mark Burnett
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... |
shaistaansari/django | refs/heads/master | tests/model_regress/tests.py | 326 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.db import router
from django.db.models.sql import InsertQuery
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.time... |
sleep-walker/pybugz | refs/heads/master | bugz/utils.py | 1 | import mimetypes
import os
import re
import sys
import tempfile
try:
import readline
except ImportError:
readline = None
BUGZ_COMMENT_TEMPLATE = """
BUGZ: ---------------------------------------------------
%s
BUGZ: Any line beginning with 'BUGZ:' will be ignored.
BUGZ: ---------------------------------------------... |
flodolo/bedrock | refs/heads/master | lib/l10n_utils/management/commands/lang_to_ftl.py | 8 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from hashlib import md5
from io import StringIO
from pathlib import Path
from django.core.management.base import BaseCo... |
LHM0105/KouKou | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... |
yanheven/nova | refs/heads/master | nova/pci/utils.py | 9 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2012 OpenStack Foundation
# 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/li... |
ayumilong/rethinkdb | refs/heads/next | external/v8_3.30.33.16/testing/gmock/scripts/gmock_doctor.py | 163 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
selam/python-vast-xml-generator | refs/heads/master | vast/creative.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Timu Eren <timu.eren@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use self file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
n-west/gnuradio | refs/heads/maint | gr-qtgui/examples/pyqt_const_c.py | 58 | #!/usr/bin/env python
#
# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... |
pombredanne/gensim | refs/heads/develop | gensim/models/lda_worker.py | 19 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Worker ("slave") process used in computing distributed LDA. Run this script \
on every node in your cluster. If you wish, you may ev... |
scripteed/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-bundle-resources.py | 193 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Verifies things related to bundle resources.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, expected_ex... |
XXMrHyde/android_external_chromium_org | refs/heads/darkkat-4.4 | tools/telemetry/telemetry/core/chrome/tracing_backend_unittest.py | 23 | # 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.
import cStringIO
import json
import logging
import os
import unittest
from telemetry.core import util
from telemetry.core.chrome import tracing_backend
... |
75651/kbengine_cloud | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/treewalkers/_base.py | 310 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_N... |
da1z/intellij-community | refs/heads/master | python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/tupleReference_after.py | 33 | coord = (3, 5)
print('X: {}; Y: {}'.format(*coord)) |
quater/calico-containers | refs/heads/master | tests/st/no_orchestrator/test_mainline_single_host.py | 1 | # Copyright (c) 2015-2016 Tigera, 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 applicabl... |
plajjan/NIPAP | refs/heads/master | utilities/convert.py | 7 | #! /usr/bin/env python
#
# Converts schema-based NIPAP database to VRF-based.
#
# To work, it needs the NIPAP database containing the old data in the database
# nipap_old, readable by the user set in nipap.conf
#
import re
import gc
import sys
import time
import psycopg2
import psycopg2.extras
from nipap.nipapconfig ... |
sureleo/leetcode | refs/heads/master | archive/python/string/ValidPalindrome.py | 2 | class Solution:
# @param s, a string
# @return a boolean
def isPalindrome(self, s):
head = 0
tail = len(s) - 1
while head < tail:
if not s[head].isalnum():
head += 1
continue
if not s[tail].isalnum():
tail -= 1
... |
MackZxh/OCA-Choice | refs/heads/8.0 | server-tools/dead_mans_switch_client/tests/test_dead_mans_switch_client.py | 19 | # -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class TestDeadMansSwitchClient(TransactionCase):
def test_dead_mans_switch_client(self):
# test unconfigured case
self.e... |
EvolutionClip/pyload | refs/heads/stable | module/lib/beaker/util.py | 45 | """Beaker utilities"""
try:
import thread as _thread
import threading as _threading
except ImportError:
import dummy_thread as _thread
import dummy_threading as _threading
from datetime import datetime, timedelta
import os
import string
import types
import weakref
import warnings
import sys
py3k = ge... |
kumarshivam675/Mobile10X-Hack | refs/heads/master | sidd/virtualenv-14.0.6/flask/lib/python2.7/site-packages/wheel/pkginfo.py | 565 | """Tools for reading and writing PKG-INFO / METADATA without caring
about the encoding."""
from email.parser import Parser
try:
unicode
_PY3 = False
except NameError:
_PY3 = True
if not _PY3:
from email.generator import Generator
def read_pkg_info_bytes(bytestr):
return Parser().pars... |
google/tmppy | refs/heads/master | _py2tmp/ir0/__init__.py | 1 | # 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 required by applicable law or... |
reingart/gestionlibre | refs/heads/master | languages/es-es.py | 1 | # coding: utf8
{
'': '',
' Quotas: %(quotas)s x%(quota_amount).2f': ' Quotas: %(quotas)s x%(quota_amount).2f',
' Transaction number: %s': ' Transaction number: %s',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression lik... |
vineethguna/heroku-buildpack-libsandbox | refs/heads/master | vendor/pip-1.2.1/tests/test_compat.py | 12 | """
Tests for compatibility workarounds.
"""
import os
from tests.test_pip import (here, reset_env, run_pip, pyversion,
assert_all_changes)
def test_debian_egg_name_workaround():
"""
We can uninstall packages installed with the pyversion removed from the
egg-info metadata dire... |
tysonclugg/django | refs/heads/master | tests/migrations/migrations_test_apps/normal/__init__.py | 12133432 | |
saurabh6790/pow-lib | refs/heads/master | website/doctype/website_sitemap_config/__init__.py | 12133432 | |
philanthropy-u/edx-platform | refs/heads/master | common/lib/capa/capa/safe_exec/tests/__init__.py | 12133432 | |
ebu/PlugIt | refs/heads/master | plugit_proxy/management/commands/__init__.py | 12133432 | |
taimur97/Feeder | refs/heads/master | server/flaskapp/setuserpass.py | 1 | # -*- coding: utf-8 -*-
'''
Usage:
setuserpass.py [-d] username password
Set a user's username/password, creating it
if it did not already exist.
Specifying -d on the commandline removes the user and in that
case a password is not necessary
'''
import sys
from hashlib import sha1
from werkzeug.security import ge... |
javilonas/NCam | refs/heads/master | cross/OpenWrt-SDK-15.05-brcm47xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/host/lib/scons-2.3.1/SCons/Taskmaster.py | 11 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# 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... |
MoritzS/django | refs/heads/master | django/contrib/gis/geos/prototypes/__init__.py | 163 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA
create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx,
cs_gety, cs_... |
akash1808/python-novaclient | refs/heads/master | novaclient/v3/list_extensions.py | 4 | # Copyright 2014 NEC Corporation. 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 b... |
devilry/devilry-django | refs/heads/master | devilry/devilry_group/migrations/0022_auto_20170103_2308.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-01-03 23:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('devilry_group', '0021_merge'),
]
operations = [
migrations.AlterUniqueTogether(
name='feedbackset',
... |
toolmacher/micropython | refs/heads/master | esp8266/modules/websocket_helper.py | 40 | import sys
try:
import ubinascii as binascii
except:
import binascii
try:
import uhashlib as hashlib
except:
import hashlib
DEBUG = 0
def server_handshake(sock):
clr = sock.makefile("rwb", 0)
l = clr.readline()
#sys.stdout.write(repr(l))
webkey = None
while 1:
l = clr.rea... |
marcosmodesto/django-testapp | refs/heads/master | django/django/utils/unittest/runner.py | 571 | """Running tests"""
import sys
import time
import unittest
from django.utils.unittest import result
try:
from django.utils.unittest.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like obj... |
xifle/greensc | refs/heads/master | tools/scons/scons-local-2.0.1/SCons/Conftest.py | 118 | """SCons.Conftest
Autoconf-like configuration support; low level implementation of tests.
"""
#
# Copyright (c) 2003 Stichting NLnet Labs
# Copyright (c) 2001, 2002, 2003 Steven Knight
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation file... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.