repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jleinonen/eoshdf | refs/heads/master | eoshdf/eoshdf.py | 1 | """
Copyright (C) 2015--2016 Jussi Leinonen
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, distr... |
sinisterchipmunk/tomato | refs/heads/master | ext/tomato/external/v8/tools/jsmin.py | 52 | #!/usr/bin/python2.4
# Copyright 2009 the V8 project authors. 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... |
baskervald/steamchat.py | refs/heads/master | steamchat/view.py | 2 | import curses
FLIST_WIDTH = 40
class View:
def main(self, stdscr):
self.resize()
self.stdscr = stdscr
while self.running:
self.stdscr.refresh()
self.flist.refresh()
self.chat.refresh()
self.test.refresh()
self.handler(self.stdscr.g... |
alazaro/tennis_tournament | refs/heads/master | permission_backend_nonrel/backends.py | 6 | from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from models import UserPermissionList, GroupPermissionList
class NonrelPermissionBackend(ModelBackend):
"""
Implements Django's permission system on Django-Nonrel
"""
supports_object_permissions = False
... |
glue-viz/glue-qt | refs/heads/master | glue/core/tests/test_link_manager.py | 2 | #pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
import numpy as np
from ..data import Data, Component
from ..component_link import ComponentLink
from ..link_manager import (LinkManager, accessible_links, discover_links,
find_dependents)
from ..data import ComponentID, DerivedComponent
... |
Lujeni/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_devtestlabartifactsource_info.py | 20 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
stasiek/robotframework | refs/heads/master | atest/testdata/test_libraries/MyLibDir/SubModuleLib.py | 37 | def keyword_in_mylibdir_submodulelib():
pass
|
abhishekgahlot/compbio | refs/heads/master | compbio/synteny/fuzzy.py | 2 | """
Implements a fuzzy definition of synteny
"""
from itertools import chain
import rasmus
from rasmus import util
from rasmus.linked_list import LinkedList
from rasmus.sets import UnionFind
from compbio.regionlib import Region
from . import SyntenyBlock
def iter_windows(hits, radius):
"""Iterate through... |
klmitch/neutron | refs/heads/master | neutron/tests/common/base.py | 34 | # 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... |
lindamar/ecclesi | refs/heads/master | env/lib/python2.7/site-packages/setuptools/command/build_ext.py | 193 | import os
import sys
import itertools
import imp
from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler, get_config_var
from distutils.errors import DistutilsError
from d... |
facebookresearch/faiss | refs/heads/master | faiss/python/__init__.py | 1 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#@nolint
# not linting this file because it imports * from swigfaiss, which
# causes a ton of useless warnings.
import numpy as np
import sy... |
Muxi-X/muxi_site | refs/heads/develop | muxiwebsite/auth/views.py | 2 | # coding: utf-8
"""
views.py
~~~~~~~~
视图文件
/login: 统一登录页
/logout: 统一登出页
"""
from . import auth
from .. import db
from ..models import User
from .forms import LoginForm, RegisterForm
from flask import render_template, redirect, request, url_for, flash, session
from flask_login import l... |
stormi/weblate | refs/heads/master | weblate/trans/tests/test_search.py | 8 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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... |
barbarubra/Don-t-know-What-i-m-doing. | refs/heads/master | python-build/python-libs/gdata/src/gdata/oauth/rsa.py | 225 | #!/usr/bin/python
"""
requires tlslite - http://trevp.net/tlslite/
"""
import binascii
from gdata.tlslite.utils import keyfactory
from gdata.tlslite.utils import cryptomath
# XXX andy: ugly local import due to module name, oauth.oauth
import gdata.oauth as oauth
class OAuthSignatureMethod_RSA_SHA1(oauth.OAuthSign... |
pavelchristof/gomoku-ai | refs/heads/master | tensorflow/examples/adding_an_op/fact_test.py | 166 | # 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... |
40223221/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/heapq.py | 628 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
txm/make-good | refs/heads/master | django/contrib/localflavor/nl/forms.py | 311 | """
NL-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
pc_re = re.compile('^\d{4}[A-Z]{2}$... |
redhat-openstack/horizon | refs/heads/mitaka-patches | openstack_dashboard/dashboards/identity/ngusers/panel.py | 38 | # Copyright 2015 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
mmalyska/eve-wspace | refs/heads/develop | evewspace/SiteTracker/migrations/0003_auto__add_systemweight.py | 17 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SystemWeight'
db.create_table('SiteTracker_systemweight', (
('system', self.gf('... |
wemanuel/smry | refs/heads/master | smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/pyasn1-modules/pyasn1_modules/rfc3414.py | 127 | #
# SNMPv3 message syntax
#
# ASN.1 source from:
# http://www.ietf.org/rfc/rfc3414.txt
#
from pyasn1.type import univ, namedtype, namedval, tag, constraint
class UsmSecurityParameters(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('msgAuthoritativeEngineID', univ.OctetString()),
... |
jbenden/ansible | refs/heads/devel | lib/ansible/parsing/quoting.py | 241 | # (c) 2014 James Cammarata, <jcammarata@ansible.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 Software Foundation, either version 3 of the License, or
# (at your option) any late... |
erinxocon/OctoPrint-Neopixelstatus | refs/heads/master | octoprint_NeoPixelStatus/color_utils.py | 1 | #!/usr/bin/env python
"""Helper functions to make color manipulations easier."""
from __future__ import division
import math
def remap(x, oldmin, oldmax, newmin, newmax):
"""Remap the float x from the range oldmin-oldmax to the range newmin-newmax
Does not clamp values that exceed min or max.
For examp... |
maxrothman/aws-alfred-workflow | refs/heads/master | venv/lib/python2.7/site-packages/docutils/languages/__init__.py | 170 | # $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# Internationalization details are documented in
# <http://docutils.sf.net/docs/howto/i18n.html>.
"""
This package contains modules for language-dependent fe... |
jnns/wagtail | refs/heads/master | wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py | 12 | from __future__ import unicode_literals
from django.conf import settings
from django import template
from django.contrib.humanize.templatetags.humanize import intcomma
from django.template.defaultfilters import stringfilter
from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.models import get_navigation_me... |
ModestoCabrera/is210-week-11-warmup | refs/heads/master | car.py | 7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Contains the car class."""
class Car(object):
"""A moving vehicle definition."""
def __init__(self, color='red'):
"""Constructor for the Car() class.
Args:
color (string): The color of the car. Defaults to ``'red'``.
Attri... |
MarcJoan/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/3_squashed_5.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "3_auto"),
("migrations", "4_auto"),
("migrations", "5_auto"),
]
dependencies = [("migrations", "2_auto")]
ope... |
mozilla/build-relengapi | refs/heads/master | relengapi/blueprints/tooltool/test_tables.py | 1 | # 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 __future__ import absolute_import
from nose.tools import eq_
from relengapi.blueprints.tooltool import tables
fr... |
Shaps/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/rpm_key.py | 31 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# Copyright: (c) 2013, Héctor Acosta <hector.acosta@gazzang.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... |
AloneRoad/Inforlearn | refs/heads/1.0-rc3 | .google_appengine/lib/django/django/template/loader_tags.py | 33 | from django.template import TemplateSyntaxError, TemplateDoesNotExist, resolve_variable
from django.template import Library, Node
from django.template.loader import get_template, get_template_from_string, find_template_source
from django.conf import settings
register = Library()
class ExtendsError(Exception):
pas... |
ondra-novak/chromium.src | refs/heads/nw | native_client_sdk/PRESUBMIT.py | 33 | # 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.
"""Top-level presubmit script for isolate.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API ... |
shubhdev/openedx | refs/heads/master | lms/djangoapps/courseware/tests/test_course_info.py | 30 | """
Test the course_info xblock
"""
import mock
from nose.plugins.attrib import attr
from django.core.urlresolvers import reverse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import TEST... |
Kwpolska/rot | refs/heads/master | pbar.py | 1 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# River of Text
# Copyright © 2013, Kwpolska.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain th... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v8/services/types/media_file_service.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
larsmans/scikit-learn | refs/heads/master | sklearn/linear_model/least_angle.py | 8 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... |
silentfuzzle/calibre | refs/heads/master | src/calibre/utils/search_query_parser.py | 14 | #!/usr/bin/env python2
# encoding: utf-8
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
'''
A parser for search queries with a syntax very similar to that used by
the Google search engine.
For details on the search query syntax see :class:`Sear... |
Juraci/tempest | refs/heads/master | tempest/api/compute/images/test_list_images.py | 17 | # Copyright 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/licenses/LICENSE-2.0
#
# Unless requ... |
shawnbrown/gpn | refs/heads/master | gpn/tests/test_node.py | 1 | # -*- coding: utf-8 -*-
import os
import sqlite3
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO # New stdlib location in 3.0
from gpn.tests import _unittest as unittest
from gpn.tests.common import MkdtempTestCase
from gpn.node import Node
from gpn.connector import... |
grengojbo/django-livesettings | refs/heads/master | tests/urls.py | 2 | from django.conf.urls.defaults import patterns, include
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/settings/$', include('livesettings.urls')),
)
|
aabbox/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_crypt.py | 91 | from test import support
import unittest
crypt = support.import_module('crypt')
class CryptTestCase(unittest.TestCase):
def test_crypt(self):
c = crypt.crypt('mypassword', 'ab')
if support.verbose:
print('Test encryption: ', c)
def test_salt(self):
self.assertEqual(len(cr... |
paulsheridan/data-structures | refs/heads/master | src/test_graphtraverse.py | 1 | import pytest
GRAPH_LIST = [[{1: {2: 3}, 2: {}}, 1, 2, True],
[{1: {2: 3}, 2: {3: 9}, 3: {1: 9}}, 1, 9, False],
[{1: {2: 2, 3: 2}, 2: {}, 3: {}}, 1, 3, True],
[{1: {2: 2, 3: 2}, 2: {4: 6, 5: 6, 6: 6},
3: {7: 2, 8: 2}, 4: {}, 5: {}, 6: {}, 7:
{6:... |
bradwoo8621/Swift-Study | refs/heads/master | Instagram/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/win/gyptest-cl-warning-as-error.py | 344 | #!/usr/bin/env python
# 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.
"""
Make sure warning-as-error is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(... |
acshi/osf.io | refs/heads/develop | website/project/taxonomies/__init__.py | 4 | from modularodm import fields
from modularodm.exceptions import ValidationValueError
from framework.mongo import (
ObjectId,
StoredObject,
utils as mongo_utils
)
from website.util import api_v2_url
@mongo_utils.unique_on(['text'])
class Subject(StoredObject):
_id = fields.StringField(primary=True, d... |
masayuko/beaker | refs/heads/rework2 | tests/test_domain_setting.py | 1 | import re
import os
from beaker.middleware import SessionMiddleware
from nose import SkipTest
try:
from webtest import TestApp
except ImportError:
raise SkipTest("webtest not installed")
def teardown():
import shutil
shutil.rmtree('./cache', True)
def simple_app(environ, start_response):
session ... |
mpetyx/pychatbot | refs/heads/master | AIML/howie-src-0.6.0/scripts/acronym.py | 2 | #!/usr/bin/python
"""
Acronym Decoder v1.0
usage: acronym.py [-max N] [-f] A.C.R.O.N.Y.M.
Prints the known expansions of the specified acronym. If the optional -max
parameter is specified, at most N matches will be output. If -f is passed,
the output is printed in "friendly" mode; otherwise, the matches will be out... |
GamecoinFuture/Gamecoin | refs/heads/master | share/qt/extract_strings_qt.py | 2945 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... |
SimonBiggs/poc-brachyoptimisation | refs/heads/master | utilities.py | 1 | # Copyright (C) 2015 Simon Biggs
# 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, or (at your option) any later version.
# This program is distributed in... |
ifduyue/django | refs/heads/master | tests/template_tests/filter_tests/test_truncatechars_html.py | 40 | from django.template.defaultfilters import truncatechars_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatechars_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0), '...')
def test_truncate(self):
... |
CristianBB/SickRage | refs/heads/develop | sickbeard/notifiers/pytivo.py | 3 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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... |
carsonmcdonald/selenium | refs/heads/master | py/test/selenium/webdriver/common/typing_tests.py | 60 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
michael-dev2rights/ansible | refs/heads/ansible-d2r | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py | 26 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
marcydoty/geraldo | refs/heads/master | site/newsite/django_1_0/django/utils/termcolors.py | 73 | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
del color_names
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'bli... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/testData/testRunner/env/unit/subfolder/__init__.py | 981 | __author__ = 'traff'
|
benjaminy/Charcoal | refs/heads/master | Testing/MicroTests/JustCalling/rec.py | 1 | A = [ 4, 8, 3, 5, 6, 7, 2, 1, 0 ]
def f( n, x ):
if n < 2:
return A[ x ]
else:
return f( ( n + 1 ) / 2, f( n / 2, x ) )
N = 100000000
print( f( N, 1 ) )
|
pvlib/pvlib-python | refs/heads/master | pvlib/tests/test_modelchain.py | 1 | import sys
import numpy as np
import pandas as pd
from pvlib import iam, modelchain, pvsystem, temperature, inverter
from pvlib.modelchain import ModelChain
from pvlib.pvsystem import PVSystem
from pvlib.tracking import SingleAxisTracker
from pvlib.location import Location
from pvlib._deprecation import pvlibDeprecat... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/source_control/github/github_webhook_info.py | 25 | #!/usr/bin/python
#
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],... |
hosseinmh/jango_learning | refs/heads/master | .venv/lib/python2.7/site-packages/setuptools/depends.py | 336 | import sys
import imp
import marshal
from distutils.version import StrictVersion
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from .py33compat import Bytecode
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... |
AnubhaAgrawal/todoman | refs/heads/master | tests/test_formatter.py | 1 | from datetime import date, datetime, time, timedelta
import pytest
import pytz
from freezegun import freeze_time
from todoman.cli import cli
from todoman.formatters import rgb_to_ansi
@pytest.mark.parametrize('interval', [
(65, 'in a minute'),
(-10800, '3 hours ago'),
])
@pytest.mark.parametrize('tz', ['CET... |
lwiecek/django | refs/heads/master | tests/messages_tests/test_api.py | 337 | from django.contrib import messages
from django.test import RequestFactory, SimpleTestCase
class DummyStorage(object):
"""
dummy message-store to test the api methods
"""
def __init__(self):
self.store = []
def add(self, level, message, extra_tags=''):
self.store.append(message)
... |
dentaku65/pelisalacarta | refs/heads/master | python/main-classic/channels/ayuda.py | 2 | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# ayuda - Videos de ayuda y tutoriales para pelisalacarta
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# contribuci?n de jurrabi
#----------------------------------------------------... |
wzbozon/scikit-learn | refs/heads/master | sklearn/cross_decomposition/pls_.py | 187 | """
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_array, check_consistent_length
from ..externals import six
import w... |
w84miracle/flask-sb-admin2 | refs/heads/master | sbadmin.py | 1 | #!/usr/bin/env python
from flask import Flask, url_for, render_template, send_from_directory
import jinja2.exceptions
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/<pagename>')
def admin(pagename):
return render_template(pagename+'.html')
@app.route('/<p... |
jayoshih/content-curation | refs/heads/master | contentcuration/contentcuration/migrations/0007_merge.py | 5 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-23 22:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0005_formatpreset_thumbnail'),
('contentcuration', '0006_contentnode_publi... |
MwanzanFelipe/rockletonfortune | refs/heads/master | lib/django/core/checks/registry.py | 162 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.utils.itercompat import is_iterable
class Tags(object):
"""
Built-in tags for internal checks.
"""
admin = 'admin'
caches = 'caches'
compatibility = 'compatibility'
models = 'models'
... |
jasonrhaas/ramlfications | refs/heads/master | tests/test_validate.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Spotify AB
from __future__ import absolute_import, division, print_function
import os
import pytest
from ramlfications import errors
from ramlfications.config import setup_config
from ramlfications.parser import parse_raml as parse
from ramlfications._helpers import load_... |
vkachurka/py-leveldb | refs/heads/master | test/test.py | 42 | #!/usr/bin/python
# Copyright (c) Arni Mar Jonsson.
# See LICENSE for details.
import sys, string, unittest, itertools
class TestLevelDB(unittest.TestCase):
def setUp(self):
# import local leveldb
import leveldb as _leveldb
self.leveldb = _leveldb
dir(self.leveldb)
# Python2/3 compat
if ... |
petemounce/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_ntp.py | 45 | #!/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... |
bear/parsedatetime | refs/heads/master | tests/TestMultiple.py | 3 | # -*- coding: utf-8 -*-
"""
Test parsing of strings with multiple chunks
"""
from __future__ import unicode_literals
import sys
import time
import datetime
import parsedatetime as pdt
from . import utils
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class test(unittest.Tes... |
DMLoy/ECommerceBasic | refs/heads/master | lib/python2.7/site-packages/PIL/GbrImagePlugin.py | 40 | #
# The Python Imaging Library
# $Id$
#
# load a GIMP brush file
#
# History:
# 96-03-14 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
import Image, ImageFile
def i32(c):
return ord(c[3]) + (or... |
semonte/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/hgweb/wsgicgi.py | 96 | # hgweb/wsgicgi.py - CGI->WSGI translator
#
# Copyright 2006 Eric Hopper <hopper@omnifarious.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# This was originally copied from the public domain code at
# http://www.python.org... |
antoan2/incubator-mxnet | refs/heads/master | tests/python/unittest/test_gluon_contrib.py | 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
# "License"); you may not u... |
closeio/flask-admin | refs/heads/master | flask_admin/contrib/sqla/typefmt.py | 34 | from flask_admin.model.typefmt import BASE_FORMATTERS, list_formatter
from sqlalchemy.orm.collections import InstrumentedList
DEFAULT_FORMATTERS = BASE_FORMATTERS.copy()
DEFAULT_FORMATTERS.update({
InstrumentedList: list_formatter
})
|
fhe-odoo/odoo | refs/heads/8.0 | addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py | 340 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
ajvpot/CTFd | refs/heads/master | migrations/versions/1093835a1051_add_default_email_templates.py | 4 | """Add default email templates
Revision ID: 1093835a1051
Revises: a03403986a32
Create Date: 2020-02-15 01:32:10.959373
"""
from alembic import op
from sqlalchemy.sql import column, table
from CTFd.models import db
from CTFd.utils.email import (
DEFAULT_PASSWORD_RESET_BODY,
DEFAULT_PASSWORD_RESET_SUBJECT,
... |
FHannes/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/_test_attach_to_process.py | 88 | import subprocess
import sys
print(sys.executable)
if __name__ == '__main__':
p = subprocess.Popen([sys.executable, '-u', '_always_live_program.py'])
import attach_pydevd
attach_pydevd.main(attach_pydevd.process_command_line(['--pid', str(p.pid)]))
p.wait()
|
rob356/SickRage | refs/heads/master | lib/unidecode/x086.py | 252 | data = (
'Tuo ', # 0x00
'Wu ', # 0x01
'Rui ', # 0x02
'Rui ', # 0x03
'Qi ', # 0x04
'Heng ', # 0x05
'Lu ', # 0x06
'Su ', # 0x07
'Tui ', # 0x08
'Mang ', # 0x09
'Yun ', # 0x0a
'Pin ', # 0x0b
'Yu ', # 0x0c
'Xun ', # 0x0d
'Ji ', # 0x0e
'Jiong ', # 0x0f
'Xian ', # 0x10
'Mo ',... |
IllusionRom-deprecated/android_platform_tools_idea | refs/heads/master | python/lib/Lib/site-packages/django/core/management/commands/shell.py | 230 | import os
from django.core.management.base import NoArgsCommand
from optparse import make_option
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--plain', action='store_true', dest='plain',
help='Tells Django to use plain Python, not IPython.'),
)
... |
Tetchain/pycoin | refs/heads/master | pycoin/services/__init__.py | 20 | from .providers import spendables_for_address, get_tx_db
|
mglukhikh/intellij-community | refs/heads/master | python/helpers/profiler/thriftpy/protocol/exc.py | 46 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from ..thrift import TException
class TProtocolException(TException):
"""Custom Protocol Exception class"""
UNKNOWN = 0
INVALID_DATA = 1
NEGATIVE_SIZE = 2
SIZE_LIMIT = 3
BAD_VERSION = 4
def __init__(self, type=UNKNOWN, mess... |
jlegendary/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_kernel_pca.py | 155 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
assert_equal, assert_not_equal,
assert_raises)
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import mak... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/shared_dressed_fed_dub_commander_bith_female_01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_fed_dub_commander_bith_female_01.iff"
result.attribute... |
googlearchive/py-gfm | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name='py-gfm',
version='0.1.1',
description='An implementation of Github-Flavored Markdown written as an extension to the Python Markdown library.',
author='Dart Team',
author_email='misc@dartlang.org',
url='https://github.com/dart-lang/py-gfm'... |
jiangzhuo/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/shift_jisx0213.py | 816 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... |
vinnyoodles/algorithms | refs/heads/master | python/dcp/problem4.py | 1 | # This problem was asked by Stripe.
# Given an array of integers, find the first missing positive integer in linear time and constant space.
# In other words, find the lowest positive integer that does not exist in the array.
# The array can contain duplicates and negative numbers as well.
# For example, the input [3,... |
stbka/ansible | refs/heads/devel | lib/ansible/parsing/yaml/loader.py | 234 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 Software Foundation, either version 3 of the License, or
# (at your option) an... |
benfitzpatrick/cylc | refs/heads/master | lib/isodatetime/tests.py | 2 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# (C) British Crown Copyright 2013-2014 Met Office.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Sof... |
savoirfairelinux/account-financial-tools | refs/heads/7.0 | account_tax_update/model/__init__.py | 46 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
# This module copyright (C) 2013 Camptocamp (<http://www.camptocamp.com>).
#
# This program is fr... |
kyleabeauchamp/fah-projects | refs/heads/master | code/analysis/strip_water_siegetank.py | 1 | import numpy as np
import os
import glob
import mdtraj as md
min_traj_length = 100
trj0 = md.load("system.subset.pdb")
filenames = glob.glob("full_Trajectories/*.h5")
for in_filename in filenames:
print(in_filename)
out_filename = os.path.join("./Trajectories/", os.path.split(in_filename)[1])
trj = md.loa... |
bpsinc-native/src_third_party_webpagereplay | refs/heads/master | third_party/nbhttp/push_tcp.py | 9 | #!/usr/bin/env python
import traceback
__copyright__ = """\
Copyright (c) 2008-2009 Mark Nottingham
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 limitat... |
procoder317/scikit-learn | refs/heads/master | sklearn/datasets/tests/test_svmlight_format.py | 228 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... |
shownomercy/django | refs/heads/master | django/conf/locale/de_CH/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... |
IV-GII/Ingenia | refs/heads/master | Versiones antiguas/proyecto_base/pedidos/urls.py | 3 | from django.conf.urls import patterns, url
from pedidos import views
urlpatterns = patterns ('',
url(r'^$',views.index, name='index'),
url(r'^alta_usuario/',views.alta_usuario, name='alta_usuario'),
url(r'^asignar_pedido/',views.asignar_pedido, name='asignar_pedido'),
url(r'^actualizar_pedido/',views.actualizar_p... |
ptemplier/ansible | refs/heads/devel | lib/ansible/modules/monitoring/sensu_subscription.py | 29 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
hungtt57/matchmaker | refs/heads/master | lib/python2.7/site-packages/pyasn1/type/constraint.py | 382 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... |
rhelmer/socorro-lib | refs/heads/master | socorro/external/es/supersearch.py | 1 | # 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/.
import datetime
import re
from elasticsearch_dsl import Search, F, Q
from elasticsearch.exceptions import NotFoundError
... |
itsjeyd/edx-platform | refs/heads/master | lms/djangoapps/grades/module_grades.py | 14 | """
Functionality for module-level grades.
"""
# TODO The score computation in this file is not accurate
# since it is summing percentages instead of computing a
# final percentage of the individual sums.
# Regardless, this file and its code should be removed soon
# as part of TNL-5062.
from django.test.client import ... |
nvoron23/brython | refs/heads/master | site/tests/unittests/test/test_re.py | 24 | from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only
import io
import re
from re import Scanner
import sre_constants
import sys
import string
import traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if... |
hTrap/junction | refs/heads/master | wsgi.py | 9 | """
WSGI config for junction project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi im... |
0k/OpenUpgrade | refs/heads/8.0 | addons/hr_applicant_document/__openerp__.py | 312 | # -*- coding: utf-8 -*-
{
'name': 'Applicant Resumes and Letters',
'version': '1.0',
'category': 'Human Resources',
'sequence': 25,
'summary': 'Search job applications by Index content.',
'description': """This module allows you to search job applications by content
of resumes and letters."... |
cculianu/bitcoin-abc | refs/heads/master | test/functional/wallet_keypool.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet keypool and interaction with wallet encryption/locking."""
import time
from test_frame... |
Arno-Nymous/pyload | refs/heads/stable | module/plugins/crypter/RSLayerCom.py | 7 | # -*- coding: utf-8 -*-
from ..internal.DeadCrypter import DeadCrypter
class RSLayerCom(DeadCrypter):
__name__ = "RSLayerCom"
__type__ = "crypter"
__version__ = "0.26"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?rs-layer\.com/directory-'
__config__ = [("activated", "bool", "Activa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.