repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
srikk595/Multilingual-Search-System-for-tweets
refs/heads/master
partA/venv/lib/python2.7/site-packages/wheel/test/test_basic.py
472
""" Basic wheel tests. """ import os import pkg_resources import json import sys from pkg_resources import resource_filename import wheel.util import wheel.tool from wheel import egg2wheel from wheel.install import WheelFile from zipfile import ZipFile from shutil import rmtree test_distributions = ("complex-dist"...
wilsoncampusano/gae-boilerplate
refs/heads/master
bp_includes/external/wtforms/compat.py
119
import sys if sys.version_info[0] >= 3: text_type = str string_types = str, iteritems = lambda o: o.items() itervalues = lambda o: o.values() izip = zip else: text_type = unicode string_types = basestring, iteritems = lambda o: o.iteritems() itervalues = lambda o: o.itervalues() ...
AIML/scikit-learn
refs/heads/master
sklearn/decomposition/tests/test_incremental_pca.py
297
"""Tests for Incremental PCA.""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises from sklearn import datasets from sklearn.decomposition import PCA, IncrementalPCA iris = datasets.load...
CallaJun/hackprince
refs/heads/master
indico/numpy/core/generate_numpy_api.py
113
from __future__ import division, print_function import os import genapi from genapi import \ TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi import numpy_api # use annotated api when running under cpychecker h_template = r""" #if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_AR...
twiindan/selenium_lessons
refs/heads/master
02_data_types/exercises/03_lifo_exercice.py
1
# We can implement a LIFO (Last In First Out) Queue using the append and pop list methods. stack = ["python", "selenium", "hello"] element = None second_element = None # add an element to the end of the list print (stack) # retrieve the last item from list print(stack) print(element) # retrieve the last item ...
kenorb-contrib/BitTorrent
refs/heads/master
BitTorrent/IPC.py
2
# 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 hope that it will be useful, # bu...
fnouama/intellij-community
refs/heads/master
python/testData/copyPaste/singleLine/IndentInIfInDef.src.py
83
def f(self): <selection> x = 1</selection> if True: b = 2
qaisermazhar/qaisermazhar.github.io
refs/heads/master
markdown_generator/publications.py
197
# coding: utf-8 # # Publications markdown generator for academicpages # # Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_g...
akloster/blender-vraag
refs/heads/master
vraag/verbs.py
1
import bpy import bpy_types from functools import wraps import io_mesh_stl.blender_utils import io_mesh_stl.stl_utils from vraag.utils import find_materials verbs = {} def vraag_verb(method_or_name, base=True, extended=True): def decorator(method): verbs[method_or_name] = method return method ...
kool79/intellij-community
refs/heads/master
python/helpers/docutils/parsers/rst/languages/ru.py
57
# $Id: ru.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Roman Suzi <[email protected]> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each...
walterbender/turtle3D
refs/heads/master
util/configfile.py
4
#!/usr/bin/env python # # Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/> # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your op...
ridfrustum/lettuce
refs/heads/master
tests/functional/invalid_module_name/terrain.py
57
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <[email protected]> # # 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 Foundatio...
gymglish/pelican
refs/heads/master
pelican/tests/test_generators.py
17
# -*- coding: utf-8 -*- from __future__ import unicode_literals import locale import os from codecs import open from shutil import rmtree from tempfile import mkdtemp from pelican.generators import (ArticlesGenerator, Generator, PagesGenerator, StaticGenerator, TemplatePagesGenerator)...
ChanChiChoi/scikit-learn
refs/heads/master
sklearn/metrics/regression.py
175
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <[email protected]> # Ma...
citrix-openstack-build/ceilometer
refs/heads/master
ceilometer/openstack/common/db/sqlalchemy/session.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
coldeasy/python-driver
refs/heads/master
tests/integration/cqlengine/model/test_equality_operations.py
1
# Copyright 2013-2017 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
dannyboi104/SickRage
refs/heads/master
lib/pynma/pynma.py
48
#!/usr/bin/python from xml.dom.minidom import parseString try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection try: from urllib.parse import urlencode except ImportError: from urllib import urlencode __version__ = "1.0" API_SERVER = 'w...
AOSPU/external_chromium_org_tools_gyp
refs/heads/android-5.0/py3
test/lib/TestCommon.py
307
""" TestCommon.py: a testing framework for commands and scripts with commonly useful error handling The TestCommon module provides a simple, high-level interface for writing tests of executable commands and scripts, especially commands and scripts that interact with the file system. All methods throw...
gsnbng/erpnext
refs/heads/develop
erpnext/hr/doctype/employee_onboarding_activity/employee_onboarding_activity.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 EmployeeOnboardingActivity(Document): pass
web30s/odoo-9.0c-20160402
refs/heads/master
hello/templates/openerp/addons/sale_stock/company.py
44
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import fields, models class company(models.Model): _inherit = 'res.company' security_lead = fields.Float('Sales Safety Days', required=True, default = 0.0, help="Margin of error for dates p...
yidongxiainl/lammps
refs/heads/master
bench/KEPLER/build.py
35
#!/usr/local/bin/python # Syntax: build.py target1 target2 ... # targets: # cpu, opt, omp, # gpu/double, gpu/mixed, gpu/single, # cuda/double, cuda/mixed, cuda/single, # intel/cpu, intel/phi, # kokkos/omp, kokkos/phi, kokkos/cuda # gpu = gpu/double + gpu/mixed + ...
CollabQ/CollabQ
refs/heads/master
vendor/django/contrib/gis/tests/relatedapp/tests_mysql.py
45
from tests import *
tethysplatform/TethysCluster
refs/heads/master
tethyscluster/commands/terminate.py
2
# Copyright 2009-2014 Justin Riley # # This file is part of TethysCluster. # # TethysCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # la...
kuiwei/edx-platform
refs/heads/master
common/lib/html_to_text.py
244
"""Provides a function to convert html to plaintext.""" import logging from subprocess import Popen, PIPE log = logging.getLogger(__name__) def html_to_text(html_message): """ Converts an html message to plaintext. Currently uses lynx in a subprocess; should be refactored to use something more python...
ferringb/raygun4py
refs/heads/master
python3/tests/test_raygunprovider.py
2
import unittest, sys from raygun4py import raygunprovider from raygun4py import utilities class TestRaygunSender(unittest.TestCase): def setUp(self): self.sender = raygunprovider.RaygunSender('invalidapikey') self.handler = raygunprovider.RaygunHandler('testkey', 'v1.0') def test_apikey(self)...
GioneeDevTeam/android_kernel_gionee_msm8974
refs/heads/cm-10.1
scripts/build-all.py
305
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
jumpstarter-io/horizon
refs/heads/master
openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py
1
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
mayfieldrobotics/rosbridge_suite
refs/heads/develop
rosbridge_library/src/rosbridge_library/capabilities/fragmentation.py
12
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, 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...
Astyan-42/skepticalscience
refs/heads/master
skepticalsciencewebsite/faq/tests/test_models.py
1
import mock from django.test import TestCase from faq.models import Topic, QandA class TopicTestCase(TestCase): def test__str__(self): topic = mock.Mock(spec=Topic) self.assertEqual(Topic.__str__(topic), topic.name) class QandATestCase(TestCase): def test__str__(self): qanda = mock...
frankito9999/Ecommerce-OAuth-Stripe-Bitcoin
refs/heads/master
node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
505
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
kevinthesun/mxnet
refs/heads/master
example/rcnn/rcnn/symbol/proposal.py
41
# 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...
franek/weboob
refs/heads/master
modules/redmine/__init__.py
5
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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...
timpalpant/calibre
refs/heads/master
src/calibre/ebooks/conversion/plugins/__init__.py
96
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <[email protected]>' __docformat__ = 'restructuredtext en'
bzbarsky/servo
refs/heads/master
tests/wpt/css-tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py
235
def test_quick(setup): pass
daiyinger/esp-idf
refs/heads/master
components/idf_test/integration_test/TestCaseScript/UDPStress/UDPMultiSTASendRecv.py
15
from TCAction import TCActionBase from NativeLog import NativeLog import time import random import string class TestCase(TCActionBase.CommonTCActionBase): def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env...
samatdav/zulip
refs/heads/master
zerver/lib/rest.py
3
from __future__ import absolute_import from typing import Any, Dict from django.utils.module_loading import import_string from django.utils.translation import ugettext as _ from django.views.decorators.csrf import csrf_exempt, csrf_protect from zerver.decorator import authenticated_json_view, authenticated_rest_api_...
xiandiancloud/edxplaltfom-xusong
refs/heads/master
lms/envs/bok_choy.py
12
""" Settings for bok choy tests """ import os from path import path CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=E1120 TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" ########################## Prod-like settings ################################### # These should be as close as poss...
robb-romans/robbmisc
refs/heads/master
scripts/upgrade-pip3-packages.py
1
#!/usr/bin/env python3 ## Update installed pip packages ## From: https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip import pip from subprocess import call for dist in pip.get_installed_distributions(): if 'site-packages' in dist.location: try: call(['pip', 'install', ...
fahhem/openhtf
refs/heads/master
openhtf/util/atomic_write.py
5
# Copyright 2016 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 agre...
s40523236/2016fallcp_hw
refs/heads/gh-pages
plugin/liquid_tags/test_flickr.py
278
from . import flickr try: from unittest.mock import patch except ImportError: from mock import patch import os import pytest import re PLUGIN_DIR = os.path.dirname(__file__) TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') @pytest.mark.parametrize('input,expected', [ ('18873146680 large "test 1"', ...
rightpeter/shadowsocks
refs/heads/master
tests/graceful_cli.py
977
#!/usr/bin/python import socks import time SERVER_IP = '127.0.0.1' SERVER_PORT = 8001 if __name__ == '__main__': s = socks.socksocket() s.set_proxy(socks.SOCKS5, SERVER_IP, 1081) s.connect((SERVER_IP, SERVER_PORT)) s.send(b'test') time.sleep(30) s.close()
wevote/WebAppPublic
refs/heads/master
election/views_admin.py
1
# election/views_admin.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from .controllers import election_remote_retrieve, elections_import_from_master_server, elections_sync_out_list_for_api from .models import Election from .serializers import ElectionSerializer from admin_tools.views import redirect...
glouppe/scikit-learn
refs/heads/master
examples/classification/plot_lda.py
142
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
CUCWD/edx-platform
refs/heads/master
openedx/core/djangoapps/plugins/plugin_signals.py
16
from logging import getLogger from . import constants, registry, utils log = getLogger(__name__) def connect_receivers(project_type): for signals_module, signals_config in _iter_plugins(project_type): for signal, receiver_func, receiver_config in _iter_receivers(signals_module, signals_config): ...
bat-serjo/vivisect
refs/heads/master
vivisect/codegraph.py
3
''' Various codeflow oriented graph constructs. ''' import envi import visgraph.graphcore as v_graphcore from vivisect.const import * class CallGraph(v_graphcore.HierGraph): ''' A graph which represents procedural branches. ''' def __init__(self): v_graphcore.Graph.__init__(self) def getF...
pgagne/robottelo
refs/heads/master
tests/foreman/ui/test_lifecycleenvironment.py
2
"""Test class for Lifecycle Environment UI :Requirement: Lifecycleenvironment :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: LifecycleEnvironments :TestType: Functional :CaseImportance: High :Upstream: No """ from nailgun import entities from navmazing import NavigationTriesExceeded from pytes...
sencha/chromium-spacewalk
refs/heads/master
tools/perf/page_sets/page_cycler/alexa_us.py
34
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class AlexaUsPage(page_module.Page): def __init__(s...
hlt-mt/tensorflow
refs/heads/master
tensorflow/tools/docker/simple_console.py
52
# Copyright 2015 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 a...
DebrahR/project2
refs/heads/master
server/lib/werkzeug/local.py
310
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
ngokevin/zamboni
refs/heads/master
mkt/site/management/commands/clean_redis.py
9
import logging import os import socket import subprocess import sys import tempfile import time from django.core.management.base import BaseCommand import redisutils import redis as redislib log = logging.getLogger('z.redis') # We process the keys in chunks of size CHUNK. CHUNK = 3000 # Remove any sets with less th...
kostaspl/SpiderMonkey38
refs/heads/tmpbr
media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py
29
# 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 helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys im...
kutenai/django
refs/heads/master
tests/requests/test_data_upload_settings.py
12
from io import BytesIO from django.core.exceptions import RequestDataTooBig, TooManyFieldsSent from django.core.handlers.wsgi import WSGIRequest from django.test import SimpleTestCase from django.test.client import FakePayload TOO_MANY_FIELDS_MSG = 'The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_...
deathping1994/treeherder
refs/heads/master
tests/log_parser/test_job_artifact_builder.py
10
from tests import test_utils from treeherder.log_parser.artifactbuildercollection import ArtifactBuilderCollection from treeherder.log_parser.artifactbuilders import BuildbotJobArtifactBuilder from ..sampledata import SampleData def do_test(log): """ Test a single log with the ``JobArtifactBuilder``. ``...
MaheshIBM/keystone
refs/heads/master
keystone/contrib/oauth1/migrate_repo/versions/004_request_token_roles_nullable.py
16
# Copyright 2013 OpenStack Foundation # # 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...
clinc/models
refs/heads/master
im2txt/im2txt/train.py
30
# Copyright 2016 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...
baggioss/hadoop-cdh3u5
refs/heads/master
contrib/hod/hodlib/Common/miniHTMLParser.py
182
#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 thi...
beck/django
refs/heads/master
tests/template_tests/syntax_tests/test_autoescape.py
337
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import SafeClass, UnsafeClass, setup class AutoescapeTagTests(SimpleTestCase): @setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'}) def te...
SFvue/sfvue3
refs/heads/master
tracks/views.py
7
from django.views.generic import TemplateView, RedirectView from django.core.urlresolvers import reverse class TrackHomeView(TemplateView): template_name = 'coming_soon.html' #class TrackHomeView(RedirectView): # def get_redirect_url(self): # return reverse('coming_soon')
FireballDWF/cloud-custodian
refs/heads/master
tools/c7n_kube/c7n_kube/resources/core/service.py
5
# Copyright 2019 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
seibert/numba
refs/heads/master
numba/tests/test_looplifting.py
2
from io import StringIO import numpy as np from numba.core import types from numba.core.compiler import compile_isolated, Flags from numba.tests.support import TestCase, tag, MemoryLeakMixin import unittest looplift_flags = Flags() looplift_flags.set("enable_pyobject") looplift_flags.set("enable_looplift") pyobject...
arnau126/django-mysql
refs/heads/master
src/django_mysql/models/fields/lists.py
2
from django.core import checks from django.db.models import CharField, IntegerField, Lookup, TextField from django.utils.translation import gettext_lazy as _ from django_mysql.forms import SimpleListField from django_mysql.models.lookups import SetContains, SetIContains from django_mysql.models.transforms import SetLe...
kleskjr/scipy
refs/heads/master
scipy/linalg/tests/test_matfuncs.py
24
#!/usr/bin/env python # # Created by: Pearu Peterson, March 2002 # """ Test functions for linalg.matfuncs module """ from __future__ import division, print_function, absolute_import import random import warnings import functools import numpy as np from numpy import array, matrix, identity, dot, sqrt, double from num...
robovm/robovm-studio
refs/heads/master
python/testData/hierarchy/call/Static/Parentheses/main.py
80
from file_1 import target_func def nothing(x): pass target_<caret>func()
yamstudio/mysite
refs/heads/master
blog/apps.py
241
from django.apps import AppConfig class BlogConfig(AppConfig): name = 'blog'
santoshdeshpande/transbiz
refs/heads/master
config/urls.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView urlpatterns = [ url(r'^$', TemplateView.as_view(templ...
ukanga/SickRage
refs/heads/master
lib/sqlalchemy/dialects/postgresql/__init__.py
78
# postgresql/__init__.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import base, psycopg2, pg8000, pypostgresql, zxjdbc base.dialect = psyc...
openstack/monasca-api
refs/heads/master
monasca_api/db/alembic/versions/00597b5c8325_initial.py
2
# Copyright 2018 SUSE Linux GmbH # # 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 writ...
MikkCZ/kitsune
refs/heads/master
kitsune/tags/tests/test_templatetags.py
6
from mock import Mock from nose.tools import eq_ from taggit.models import Tag from kitsune.sumo.tests import TestCase from kitsune.tags.templatetags.jinja_helpers import tags_to_text class TestTagsToText(TestCase): def test_no_tags(self): eq_('', tags_to_text([])) def test_one_tag(self): eq...
rmboggs/django
refs/heads/master
django/db/backends/postgresql/base.py
143
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS from django.db.backends.base.base import BaseDatabaseWrapper from djan...
dongwoooo/project_flask
refs/heads/master
lib/tweepy/cursor.py
27
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from tweepy.error import TweepError class Cursor(object): """Pagination helper class""" def __init__(self, method, *args, **kargs): if hasattr(method, 'pagination_mode'): if method.pagination_mode == 'cursor': ...
kingmotley/SickRage
refs/heads/master
lib/unidecode/x01d.py
240
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/conch/insults/colors.py
146
""" You don't really want to use this module. Try helper.py instead. """ CLEAR = 0 BOLD = 1 DIM = 2 ITALIC = 3 UNDERSCORE = 4 BLINK_SLOW = 5 BLINK_FAST = 6 REVERSE = 7 CONCEALED = 8 FG_BLACK = 30 FG_RED = 31 FG_GREEN = 32 FG_YELLOW = 33 FG_BLUE = 34 FG_MAGENTA = 35 FG_CYAN = 36 FG_WHITE = 37 BG_BLACK = 40 BG_RED = 41 ...
ray-zhong/github_trend_spider
refs/heads/master
ENV/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
327
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import Conf...
hashworks/CouchPotatoServer
refs/heads/forkDev
libs/tornado/options.py
79
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source/Lib/site-packages/joblib/externals/loky/backend/semaphore_tracker.py
9
############################################################################### # Server process to keep track of unlinked semaphores and clean them. # # author: Thomas Moreau # # adapted from multiprocessing/semaphore_tracker.py (17/02/2017) # * include custom spawnv_passfds to start the process # * use custom unli...
testmana2/test
refs/heads/master
Plugins/VcsPlugins/vcsMercurial/ProjectHelper.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2010 - 2015 Detlev Offenbach <[email protected]> # """ Module implementing the VCS project helper for Mercurial. """ from __future__ import unicode_literals import os from PyQt5.QtWidgets import QMenu, QToolBar from E5Gui import E5MessageBox from E5Gui.E5Application ...
amatotech/p2pool
refs/heads/master
p2pool/test/util/test_expiring_dict.py
287
from twisted.internet import defer from twisted.trial import unittest from p2pool.util import deferral, expiring_dict class Test(unittest.TestCase): @defer.inlineCallbacks def test_expiring_dict1(self): e = expiring_dict.ExpiringDict(3, get_touches=True) e[1] = 2 yield deferral.sleep(1...
mikewiebe-ansible/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_netstream_global.py
13
#!/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...
cdepman/falcon_api
refs/heads/master
site-packages/setuptools/command/register.py
986
import distutils.command.register as orig class register(orig.register): __doc__ = orig.register.__doc__ def run(self): # Make sure that we are using valid current name/version info self.run_command('egg_info') orig.register.run(self)
Neamar/django
refs/heads/master
tests/admin_scripts/complex_app/management/commands/duplicate.py
554
from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, **options): self.stdout.write('complex_app')
PatrickChrist/scikit-learn
refs/heads/master
examples/cluster/plot_dbscan.py
346
# -*- coding: utf-8 -*- """ =================================== Demo of DBSCAN clustering algorithm =================================== Finds core samples of high density and expands clusters from them. """ print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn...
yjmade/odoo
refs/heads/8.0
addons/subscription/__openerp__.py
151
# -*- 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...
dymkowsk/mantid
refs/heads/master
qt/paraview_ext/VatesSimpleGui/ViewWidgets/test/suite_MDHistoWorkspace/tst_MDHW_from_4D/test.py
3
def main(): source(findFile("scripts", "test_helpers.py")) source(findFile("scripts", "common_checks.py")) startApplication("MantidPlot") run_script("mdhistos_from_4D.py") get_workspace("SEQ_4D_rebin") check_vsi_state(True, "VSI enabled for 4D rebinned MDHW") get_workspace("SEQ_3D_rebin") ...
ioram7/keystone-federado-pgid2013
refs/heads/master
build/eventlet/examples/twisted/twisted_server.py
8
"""Simple chat demo application. Listen on port 8007 and re-send all the data received to other participants. Demonstrates how to * plug in eventlet into a twisted application (join_reactor) * how to use SpawnFactory to start a new greenlet for each new request. """ from eventlet.twistedutil import join_reactor from...
lepistone/odoo
refs/heads/master
addons/account_analytic_analysis/__openerp__.py
62
# -*- 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...
JRock007/boxxy
refs/heads/master
dist/Boxxy.app/Contents/Resources/lib/python2.7/numpy/ma/__init__.py
76
""" ============= Masked Arrays ============= Arrays sometimes contain invalid or missing data. When doing operations on such arrays, we wish to suppress invalid values, which is the purpose masked arrays fulfill (an example of typical use is given below). For example, examine the following array: >>> x = np.array(...
nomaro/SickBeard_Backup
refs/heads/master
lib/requests/packages/chardet/big5freq.py
323
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
robovm/robovm-studio
refs/heads/master
python/testData/addImport/newThirdPartyImportInBetween/main.after.py
75
import sys import third_party import a print(sys, third_party, a)
rocopartners/django-oscar
refs/heads/master
src/oscar/templatetags/image_tags.py
57
from django import template from django.conf import settings from django.db.models.fields.files import ImageFieldFile register = template.Library() def do_dynamic_image_url(parser, token): tokens = token.split_contents() if len(tokens) < 2: raise template.TemplateSyntaxError( "%r tag req...
krintoxi/NoobSec-Toolkit
refs/heads/master
NoobSecToolkit - MAC OSX/scripts/sshbackdoors/rpyc/lib/__init__.py
14
""" A library of various helpers functions and classes """ import sys import logging class MissingModule(object): __slots__ = ["__name"] def __init__(self, name): self.__name = name def __getattr__(self, name): if name.startswith("__"): # issue 71 raise AttributeError("module %...
Lancea12/sudoku_solver
refs/heads/master
sudoku/models/choice.py
2
from django.db import models from solver.models.cell import Cell class Choice(models.Model): cell = models.ForeignKey(Cell) val = models.IntegerField() class Meta: app_label = "solver"
sbesson/zeroc-ice
refs/heads/master
cpp/test/IceUtil/uuid/run.py
5
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
SUNET/eduid-webapp
refs/heads/master
src/eduid_webapp/letter_proofing/views.py
1
# -*- coding: utf-8 -*- from flask import Blueprint, abort from eduid_common.api.decorators import MarshalWith, UnmarshalWith, can_verify_identity, require_user from eduid_common.api.exceptions import AmTaskFailed, MsgTaskFailed from eduid_common.api.helpers import add_nin_to_user, check_magic_cookie, verify_nin_for...
rcbops/python-django-buildpackage
refs/heads/master
django/contrib/flatpages/middleware.py
641
from django.contrib.flatpages.views import flatpage from django.http import Http404 from django.conf import settings class FlatpageFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a flatpage for non...
alexander-bauer/network-markup
refs/heads/development
python/attributes.py
1
import igraph attb = {'disabled': {'color': 'grey'}} # Applies known attributes, such as "disabled" to vertices by changing # them into igraph-recognized values. The "label" attribute is # automatically set to the supplied name. It returns the modified # vertex. def apply(vertex, name, node): vertex["label"] = na...
yunity/foodsaving-backend
refs/heads/master
karrot/groups/migrations/0024_groupmembership_lastseen_at__required_20180304_1501.py
2
# Generated by Django 2.0.2 on 2018-03-04 15:01 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('groups', '0023_set_sensible_lastseen_at_20180304_1330'), ] operations = [ migrations.AlterField( mo...
VirtueSecurity/aws-extender
refs/heads/master
BappModules/docutils/parsers/rst/directives/tables.py
7
# $Id: tables.py 8039 2017-02-28 12:19:20Z milde $ # Authors: David Goodger <[email protected]>; David Priest # Copyright: This module has been placed in the public domain. """ Directives for table elements. """ __docformat__ = 'reStructuredText' import sys import os.path import csv from docutils import io, nodes...
sjsrey/pysal_core
refs/heads/master
pysal_core/cg/shapes.py
2
""" Computational geometry code for PySAL: Python Spatial Analysis Library. """ __author__ = "Sergio J. Rey, Xinyue Ye, Charles Schmidt, Andrew Winslow" __credits__ = "Copyright (c) 2005-2009 Sergio J. Rey" import doctest import math from warnings import warn from .sphere import arcdist import numpy as np __all__ =...
dataxu/ansible
refs/heads/dx-stable-2.5
test/integration/targets/aws_lambda/files/mini_lambda.py
139
from __future__ import print_function import json import os def handler(event, context): """ The handler function is the function which gets called each time the lambda is run. """ # printing goes to the cloudwatch log allowing us to simply debug the lambda if we can find # the log entry. ...
mewtaylor/django
refs/heads/master
tests/auth_tests/test_tokens.py
297
import unittest from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.test import TestCase from django.utils.six import PY3 class TokenGeneratorTest(TestCase): def test_make...