repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
ftomassetti/intellij-community
refs/heads/master
python/testData/refactoring/pullup/withComments.py
80
class Foo: def foo(self): print("a") class Boo(Foo): def boo(self): """ In python we use multi-line comments inside of method body """ print "rrrrr"
nemmeviu/hosts-footprint
refs/heads/master
global/global/urls.py
1
"""global URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
archf/ansible
refs/heads/devel
test/units/plugins/callback/test_callback.py
122
# (c) 2012-2014, Chris Meyers <chris.meyers.fsu@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...
lrowe/rdflib
refs/heads/master
test/test_sparqlupdatestore.py
1
# -*- coding: utf-8 -*- import unittest import re from rdflib import ConjunctiveGraph, URIRef from rdflib.util import from_n3 # this assumed SPARQL1.1 query/update endpoints # running locally at http://localhost:3030/ukpp/ # for instance fuseki started with ./fuseki-server --mem --update /ukpp # THIS WILL DELETE ALL...
jespino/django-lot
refs/heads/master
tests/tests.py
1
import json import datetime import unittest import django if django.VERSION >= (1, 7): django.setup() from django.conf import settings from django.template import Template, Context from django.core.management import call_command from django.test.client import Client, RequestFactory from django.views.generic impor...
DanteOnline/free-art
refs/heads/master
venv/lib/python3.4/site-packages/django/contrib/gis/db/backends/oracle/operations.py
64
""" This module contains the spatial lookup types, and the `get_geo_where_clause` routine for Oracle Spatial. Please note that WKT support is broken on the XE version, and thus this backend will not work on such platforms. Specifically, XE lacks support for an internal JVM, and Java libraries are required to use...
SteveRidout/sprintly-to-github
refs/heads/master
getSprintlyData.py
1
#!/bin/python import urllib, urllib2, base64, sys, json if (len(sys.argv) != 4): print "This fetches ticket data related to a sprint.ly product and writes" print "it to sprintlyData.json" print "" print "Please run again with the following arguments:" print "1. Username" print "2. API key (fro...
ccxt/ccxt
refs/heads/master
examples/py/async-basic.py
1
# -*- coding: utf-8 -*- import asyncio import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async_support as ccxt # noqa: E402 async def test_binance(): exchange = ccxt.binance({'enableRateLimit': True}) mark...
motion2015/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/library_content_module.py
10
# -*- coding: utf-8 -*- """ LibraryContent: The XBlock used to include blocks from a library in a course. """ import json from lxml import etree from copy import copy from capa.responsetypes import registry from gettext import ngettext from lazy import lazy from .mako_module import MakoModuleDescriptor from opaque_key...
BhallaLab/moose
refs/heads/master
moose-core/python/moose/chemUtil/add_Delete_ChemicalSolver.py
2
# -*- coding: utf-8 -*- __author__ = "HarshaRani" __credits__ = ["Upi Lab"] __license__ = "GPL3" __version__ = "1.0.0" __maintainer__ = "HarshaRani" __email__ = "hrani@ncbs.res.in" __status__ = "Development" __updated__ = "Sep 03 2018" ''' mooseAddChemSolver and mooseD...
anthgur/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/py/testing/path/test_svnauth.py
55
import py from py.path import SvnAuth import time import sys svnbin = py.path.local.sysfind('svn') def make_repo_auth(repo, userdata): """ write config to repo user information in userdata is used for auth userdata has user names as keys, and a tuple (password, readwrite) as values, wher...
AladdinSonni/youtube-dl
refs/heads/master
youtube_dl/extractor/mtv.py
54
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, compat_str, ) from ..utils import ( ExtractorError, find_xpath_attr, fix_xml_ampersands, HEADRequest, unescapeHTML, url_basename, ...
pedrobaeza/odoo
refs/heads/master
addons/product_margin/__init__.py
444
# -*- 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...
dubourg/openturns
refs/heads/master
python/test/t_FORM_interval.py
2
#! /usr/bin/env python from __future__ import print_function import openturns as ot # Build the event 'vector takes its values in interval' # using a comparison operator and a threshold in order # to be compatible with more algorithms than Monte Carlo def buildEvent(vector, interval): dimension = vector.getDime...
alphapapa/youtube-dl
refs/heads/master
youtube_dl/extractor/ringtv.py
124
from __future__ import unicode_literals import re from .common import InfoExtractor class RingTVIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ringtv\.craveonline\.com/(?P<type>news|videos/video)/(?P<id>[^/?#]+)' _TEST = { "url": "http://ringtv.craveonline.com/news/310833-luis-collazo-says-victo...
dgjustice/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_feature.py
7
#!/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...
tadebayo/myedge
refs/heads/master
myvenv/Lib/site-packages/easy_thumbnails/sorl-tests/utils.py
7
from django.conf import settings from easy_thumbnails.utils import * try: set except NameError: from sets import Set as set # For Python 2.3 MEDIA_ROOT_LENGTH = len(os.path.normpath(settings.MEDIA_ROOT)) utils_tests = r""" >>> from easy_thumbnails.tests.utils import * >>> from easy_thumbnails.tests.base ...
ralekseenkov/launchpad-reporting
refs/heads/master
launchpad/lpdata.py
1
from launchpadlib.launchpad import Launchpad from bug import Bug from project import Project from ttl_cache import ttl_cache class LaunchpadData(): BUG_STATUSES = {"New": ["New"], "Incomplete": ["Incomplete"], "Open": ["Triaged", "In Progress", "Confirmed"], ...
barbarubra/Don-t-know-What-i-m-doing.
refs/heads/master
python/src/Tools/freeze/makemakefile.py
53
# Write the actual Makefile. import os def makemakefile(outfp, makevars, files, target): outfp.write("# Makefile generated by freeze.py script\n\n") keys = makevars.keys() keys.sort() for key in keys: outfp.write("%s=%s\n" % (key, makevars[key])) outfp.write("\nall: %s\n\n" % target) ...
MonsterKiller/django-material
refs/heads/master
tests/integration/tests/test_dateinput.py
10
import json from django import forms from django_webtest import WebTest from . import build_test_urls class DateInputForm(forms.Form): test_field = forms.DateField( widget=forms.DateInput(attrs={'data-test': 'Test Attr'})) data_field = forms.BooleanField(required=False, widget=forms.HiddenInput, init...
wkschwartz/django
refs/heads/stable/3.2.x
tests/prefetch_related/test_uuid.py
133
from django.test import TestCase from .models import Flea, House, Person, Pet, Room class UUIDPrefetchRelated(TestCase): def test_prefetch_related_from_uuid_model(self): Pet.objects.create(name='Fifi').people.add( Person.objects.create(name='Ellen'), Person.objects.create(name='G...
omaciel/robottelo
refs/heads/master
tests/foreman/cli/test_contentview.py
1
"""Test class for Content Views :Requirement: Contentview :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: ContentViews :TestType: Functional :CaseImportance: High :Upstream: No """ import random import os from fauxfactory import gen_alphanumeric, gen_string from robottelo import manifests, ssh ...
balloob/netdisco
refs/heads/master
netdisco/mdns.py
1
"""Add support for discovering mDNS services.""" import itertools import logging from typing import List # noqa: F401 from zeroconf import DNSPointer, DNSRecord from zeroconf import Error as ZeroconfError from zeroconf import ServiceBrowser, ServiceInfo, ServiceStateChange, Zeroconf _LOGGER = logging.getLogger(__nam...
arunlodhi/pymc3
refs/heads/master
pymc3/examples/disaster_model.py
10
""" A model for coal mining disasters data with a changepoint switchpoint ~ U(0, 110) early_mean ~ Exp(1.) late_mean ~ Exp(1.) disasters[t] ~ Po(early_mean if t <= switchpoint, late_mean otherwise) """ from pymc3 import * import theano.tensor as t from numpy import arange, array, ones, concatenate from numpy.random...
yakubiw/subterfuge
refs/heads/master
main/models.py
22
from django.db import models class credentials(models.Model): source = models.CharField(max_length=300) username = models.CharField(max_length=300) password = models.CharField(max_length=300) date = models.CharField(max_length=300) class setup(models.Model): ip = models....
biolab/orange
refs/heads/master
docs/reference/rst/code/statistics-contingency7.py
6
import Orange iris = Orange.data.Table("iris") cont = Orange.statistics.contingency.ClassVar("sepal length", iris) print "Inner variable: ", cont.inner_variable.name print "Outer variable: ", cont.outer_variable.name print print "Class variable: ", cont.class_var.name print "Attribute: ", cont.variable.name prin...
msebire/intellij-community
refs/heads/master
python/helpers/py2only/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...
ovnicraft/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/wrapper_module.py
125
# Same as vertical, # But w/o css delimiters between children from xmodule.vertical_block import VerticalBlock # HACK: This shouldn't be hard-coded to two types # OBSOLETE: This obsoletes 'type' class_priority = ['video', 'problem'] class WrapperBlock(VerticalBlock): ''' Layout block for laying out sub-bloc...
stefanw/django-cms
refs/heads/develop
cms/south_migrations/0025_placeholder_migration.py
1680
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
tlakshman26/cinder-https-changes
refs/heads/master
cinder/tests/unit/backup/fake_service_with_verify.py
33
# Copyright (C) 2014 Deutsche Telekom AG # 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 r...
cgstudiomap/cgstudiomap
refs/heads/develop
main/eggs/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/lib/pagesizes.py
33
#!/bin/env python #Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/pagesizes.py """This module defines a few common page sizes in points (1/72 inch). To be expanded to include things like label s...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/nntplib.py
156
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
ChrisAntaki/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/test/main_unittest.py
124
# Copyright (C) 2012 Google, Inc. # # 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 the above copyright # notice, this list of conditions and the following disclaimer...
mrambausek/PPFem
refs/heads/master
ppfem/elements/__init__.py
10
# PPFem: An educational finite element code # Copyright (C) 2015 Matthias Rambausek # # 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 ...
levelrf/level_basestation
refs/heads/master
gnuradio-core/src/python/gnuradio/gr/qa_vector_map.py
15
#!/usr/bin/env python # # Copyright 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 option) # ...
suutari-ai/shoop
refs/heads/master
shuup/admin/modules/contacts/mass_actions.py
3
# This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from django.core.urlresolvers import reverse from django.utils.translation import ugettext...
OpenFacetracker/facetracker-core
refs/heads/master
lib/youtube-dl/youtube_dl/extractor/telemb.py
177
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import remove_start class TeleMBIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html' _TESTS = [ { 'url': 'http://www.telemb...
OPNay/android_kernel_samsung_jalte
refs/heads/immortal-14.1.dev
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
johnwang117/learn-python-the-hard-way
refs/heads/master
ex30.py
1
people = 30 cars = 40 buses = 15 if cars > people: print('We should take the cars.') elif cars < people: print('We should not take the cars.') else: print('We can\'t decide.') if buses > cars: print('That\'s too many buses.') elif buses < cars: print('Maybe we could take the buses.') else: print('We still can\...
netjunki/trac-Pygit2
refs/heads/mergewithbeta1.0
trac/tests/core.py
6
# -*- coding: utf-8 -*- # # Copyright (C)2005-2009 Edgewall Software # Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.e...
simonemurzilli/geonode
refs/heads/master
geonode/catalogue/backends/__init__.py
396
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
3dfxsoftware/cbss-addons
refs/heads/master
npg_account_make_deposit/wizard/add_deposit_items.py
1
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This progr...
sopier/django
refs/heads/master
tests/check_framework/models.py
396
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models class SimpleModel(models.Model): field = models.IntegerField() manager = models.manager.Manager()
pcu4dros/pandora-core
refs/heads/master
workspace/lib/python3.5/site-packages/pip/_vendor/cachecontrol/compat.py
479
try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin try: import cPickle as pickle except ImportError: import pickle from pip._vendor.requests.packages.urllib3.response import HTTPResponse from pip._vendor.requests.packages.urllib3.util import is_fp_closed # Replic...
datalink747/three.js
refs/heads/master
utils/converters/obj/convert_obj_three.py
160
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader) ------------------------- How to use this converter ------------------------- python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bo...
jean/sentry
refs/heads/master
tests/sentry/api/endpoints/test_project_release_file_details.py
4
from __future__ import absolute_import import six from django.core.urlresolvers import reverse from sentry.models import File, Release, ReleaseFile from sentry.testutils import APITestCase class ReleaseFileDetailsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) project =...
tuxfux-hlp-notes/python-batches
refs/heads/master
archieves/batch-61/files/myenv/lib/python2.7/site-packages/pip/vcs/git.py
340
from __future__ import absolute_import import logging import tempfile import os.path from pip.compat import samefile from pip.exceptions import BadCommand from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip._vendor.packaging.versio...
msabramo/ansible
refs/heads/devel
lib/ansible/executor/__init__.py
7690
# (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...
aldryn/heroku-buildpack-python
refs/heads/master
vendor/pip-1.4.1/pip/util.py
79
import sys import shutil import os import stat import re import posixpath import pkg_resources import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, ...
tafaRU/odoo
refs/heads/8.0
addons/account/account_move_line.py
11
# -*- 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...
vrenaville/OCB
refs/heads/8.0
addons/account_test/__openerp__.py
313
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved. # Philmer <philmer@cciconnect.be> # # This progra...
CityGenerator/Megacosm-Generator
refs/heads/develop
tests/test_country.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- "Fully test this module's functionality through the use of fixtures." from megacosm.generators import Country, Region import unittest2 as unittest import fakeredis from config import TestConfiguration import fixtures class TestCountry(unittest.TestCase): def setUp(s...
MockyJoke/numbers
refs/heads/master
ex10/code/wikipedia_popular.py
1
# coding: utf-8 # In[25]: import findspark findspark.init() import sys from pyspark.sql import SparkSession, functions, types spark = SparkSession.builder.appName('wikipedia_popular').getOrCreate() assert sys.version_info >= (3, 4) # make sure we have Python 3.4+ assert spark.version >= '2.1' # make sure we have ...
gregvonkuster/bioconda-recipes
refs/heads/master
recipes/peptide-shaker/1.16.4/peptide-shaker.py
63
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
mbarkhau/kson
refs/heads/master
py/setup.py
1
from setuptools import setup from os.path import join, dirname from kson import __version__ def read(fname): return open(join(dirname(__file__), fname)).read() setup( name='kson', version=__version__, description='Keystripped Schemafied Object Notation', long_description=read('../README.md'), ...
NeostreamTechnology/Microservices
refs/heads/master
venv/lib/python2.7/site-packages/click/__init__.py
135
# -*- coding: utf-8 -*- """ click ~~~~~ Click is a simple Python module that wraps the stdlib's optparse to make writing command line scripts fun. Unlike other modules, it's based around a simple API that does not come with too much magic and is composable. In case optparse ever gets removed ...
MungoRae/home-assistant
refs/heads/dev
homeassistant/components/alarm_control_panel/verisure.py
11
""" Interfaces with Verisure alarm control panel. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/alarm_control_panel.verisure/ """ import logging from time import sleep import homeassistant.components.alarm_control_panel as alarm from homeassistant.comp...
encbladexp/ansible
refs/heads/devel
lib/ansible/plugins/lookup/random_choice.py
29
# (c) 2013, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 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 DOCUMENTATION = """ name: random_choice author: M...
mikebenfield/scipy
refs/heads/master
scipy/special/tests/test_sici.py
47
import numpy as np import scipy.special as sc from scipy.special._testutils import FuncData def test_sici_consistency(): # Make sure the implementation of sici for real arguments agrees # with the implementation of sici for complex arguments. # On the negative real axis Cephes drops the imaginary part i...
mrry/tensorflow
refs/heads/windows
tensorflow/contrib/rnn/python/kernel_tests/fused_rnn_cell_test.py
10
# 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...
novafloss/workalendar
refs/heads/master
workalendar/tests/test_america.py
2
from datetime import date from . import GenericCalendarTest from ..america import ( Argentina, Barbados, Chile, Colombia, Mexico, Panama, Paraguay ) class ArgentinaTest(GenericCalendarTest): cal_class = Argentina def test_holidays_2018(self): holidays = self.cal.holidays_set(2018) # 1. Añ...
sunny94/temp
refs/heads/iss8501_parsing
sympy/concrete/delta.py
4
from __future__ import print_function, division from sympy.core import Add, Mul, S, Dummy, symbols from sympy.core.cache import cacheit from sympy.core.compatibility import default_sort_key from sympy.functions import KroneckerDelta, Piecewise, piecewise_fold from sympy.sets import Interval @cacheit def _expand_delt...
liberorbis/libernext
refs/heads/master
env/lib/python2.7/site-packages/wheel/test/complex-dist/complexdist/__init__.py
566
def main(): return
zestrada/nova-cs498cc
refs/heads/master
nova/virt/powervm/common.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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 # # ...
LordDamionDevil/Lony
refs/heads/master
lib/aiohttp/cookiejar.py
16
import datetime import re from collections import defaultdict from collections.abc import Mapping from http.cookies import Morsel, SimpleCookie from math import ceil from urllib.parse import urlsplit from .abc import AbstractCookieJar from .helpers import is_ip_address class CookieJar(AbstractCookieJar): """Impl...
mbareta/edx-platform-ft
refs/heads/open-release/eucalyptus.master
common/djangoapps/terrain/factories.py
163
''' Factories are defined in other modules and absorbed here into the lettuce world so that they can be used by both unit tests and integration / BDD tests. ''' import student.tests.factories as sf import xmodule.modulestore.tests.factories as xf import course_modes.tests.factories as cmf from lettuce import world # U...
keflavich/TurbuStat
refs/heads/master
turbustat/statistics/scf/__init__.py
1
from scf import SCF, SCF_Distance
amboxer21/scrapy
refs/heads/master
tests/__init__.py
24
""" tests: this package contains all Scrapy unittests see http://doc.scrapy.org/en/latest/contributing.html#running-tests """ import os try: import unittest.mock as mock except ImportError: import mock tests_datadir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'sample_data') def get_testdata(...
eurosata1/e2
refs/heads/master
lib/python/Screens/ConfigMenu.py
33
from Screen import Screen from Components.ConfigList import ConfigList from Components.config import config from Components.ActionMap import ActionMap class ConfigMenu(Screen): #create a generic class for view/edit settings #all stuff come from xml file #configtype / datasource / validate-call / ... def __init__(...
mehtapgundogan/Tellal
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/colorama/ansi.py
442
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' class ...
rexshihaoren/scikit-learn
refs/heads/master
sklearn/svm/base.py
11
from __future__ import print_function import numpy as np import scipy.sparse as sp import warnings from abc import ABCMeta, abstractmethod from . import libsvm, liblinear from . import libsvm_sparse from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning from ..preprocessing import LabelEncoder from...
petemounce/ansible-modules-extras
refs/heads/devel
system/svc.py
83
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@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 Licen...
jaxkodex/odoo
refs/heads/8.0
openerp/addons/test_impex/__openerp__.py
361
# -*- coding: utf-8 -*- { 'name': 'test-import-export', 'version': '0.1', 'category': 'Tests', 'description': """A module to test import/export.""", 'author': 'OpenERP SA', 'maintainer': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['base'], 'data': ['ir.model.access...
joopert/home-assistant
refs/heads/dev
tests/components/hue/test_sensor_base.py
2
"""Philips Hue sensors platform tests.""" import asyncio from collections import deque import datetime import logging from unittest.mock import Mock import aiohue from aiohue.sensors import Sensors import pytest from homeassistant import config_entries from homeassistant.components import hue from homeassistant.compo...
bankonme/www.freedomsponsors.org
refs/heads/master
djangoproject/gh_frespo_integration/tests/__init__.py
3
# from django.conf import settings # # if not settings.TEST_WITH_NOSE: # from test_github_adapter import *
jk1/intellij-community
refs/heads/master
python/testData/completion/percentStringDictFuncKeys.py
31
print("Other string %(<caret>)d" % {str(4): int('4')})
infoxchange/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/conf/__init__.py
65
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import os import re import time # Needed for Windows from ...
dpiers/coderang-meteor
refs/heads/master
public/jsrepl/extern/python/reloop-closured/lib/python2.7/encodings/koi8_u.py
593
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
TansyArron/pants
refs/heads/master
src/python/pants/backend/android/targets/android_binary.py
14
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.a...
nutztherookie/wagtail
refs/heads/master
wagtail/wagtailimages/tests/tests.py
3
from __future__ import absolute_import, unicode_literals import os import unittest import warnings from django import forms, template from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import TestCase, override_setting...
wd5/jangr
refs/heads/master
_django/utils/importlib.py
445
# Taken from Python 2.7 with permission from/by the original author. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex'): raise ValueError("'package' not set to a string") dot = len(package) for x in ...
incorrectusername/coala-bears
refs/heads/master
bears/go/__init__.py
37
""" Go related bears. """
Shukkan/Studing
refs/heads/master
ex21.py
1
def add(a, b): print "ADDING %d + %d" % (a, b) return a + b def subtract(a, b): print "SUBTRACT %d - %d" % (a, b) return a - b def multiply(a, b): print "MULTIPLYING %d * %d" % (a, b) return a * b def divide(a, b): print "DIVIDING %d / %d" % (a, b) return a / b print "Let's do some math with just functions!" ...
paran0ids0ul/infernal-twin
refs/heads/master
build/pip/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py
2768
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
krafczyk/spack
refs/heads/develop
var/spack/repos/builtin/packages/poppler/package.py
2
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Kodiack/WhileyWeb
refs/heads/master
lib/cherrypy/test/benchmark.py
36
"""CherryPy Benchmark Tool Usage: benchmark.py --null --notests --help --cpmodpy --modpython --ab=path --apache=path --null: use a null Request object (to bench the HTTP server only) --notests: start the server but do not run the tests; this allows you to check th...
hiepthai/django-activity-stream
refs/heads/master
actstream/tests/test_feeds.py
1
from datetime import datetime from django.conf import settings from django.utils.feedgenerator import rfc2822_date, rfc3339_date from actstream.tests import base class FeedsTestCase(base.DataTestCase): urls = 'actstream.urls' @property def rss_base(self): return ['<?xml version="1.0" encoding="...
VanirAOSP/kernel_samsung_exynos5420
refs/heads/kk44
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
systers/mailman-old-archive
refs/heads/master
src/mailman/app/membership.py
7
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
mablae/weblate
refs/heads/master
weblate/trans/south_migrations/0072_auto__add_field_translation_have_comment.py
1
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Translation.have_comment' db.add_column(u'trans_translation', 'have_comment', self.gf('django.db.models.fields.Inte...
zopyx/pyfilesystem
refs/heads/master
fs/wrapfs/lazyfs.py
14
""" fs.wrapfs.lazyfs ================ A class for lazy initialization of an FS object. This module provides the class LazyFS, an FS wrapper class that can lazily initialize its underlying FS object. """ import sys try: from threading import Lock except ImportError: from fs.base import DummyLock as Lock fr...
tlatzko/spmcluster
refs/heads/master
.tox/2.6-nocov/lib/python2.6/site-packages/nose/importer.py
79
"""Implements an importer that looks only in specific path (ignoring sys.path), and uses a per-path cache in addition to sys.modules. This is necessary because test modules in different directories frequently have the same names, which means that the first loaded would mask the rest when using the builtin importer. """...
NicoSantangelo/sublime-text-trello
refs/heads/master
lib/requests/structures.py
67
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
dexterx17/nodoSocket
refs/heads/master
clients/Python-2.7.6/Lib/plat-mac/Carbon/CF.py
82
from _CF import *
iRGBit/QGIS
refs/heads/master
python/plugins/processing/gui/ScriptEdit.py
9
# -*- coding: utf-8 -*- """ *************************************************************************** ScriptEdit.py --------------------- Date : April 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com ****************...
chromium/chromium
refs/heads/master
third_party/blink/tools/blinkpy/common/checkout/diff_test_data.py
9
# Copyright (C) 2011 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 of conditions and the f...
kubeflow/pipelines
refs/heads/master
components/deprecated/tfx/ExampleValidator/with_URI_IO/component.py
1
from typing import NamedTuple def ExampleValidator( statistics_uri: 'ExampleStatisticsUri', schema_uri: 'SchemaUri', output_anomalies_uri: 'ExampleAnomaliesUri', exclude_splits: str = None, beam_pipeline_args: list = None, ) -> NamedTuple('Outputs', [ ('anomalies_uri', 'ExampleAnomaliesUri'), ]...
jaabell/Seismogram
refs/heads/master
syntheticSeismogramImport.py
4
from IPython.display import set_matplotlib_formats from IPython.html.widgets import * import matplotlib from syntheticSeismogram import * from EOSC350widget import wiggle, ViewWiggle set_matplotlib_formats('png') matplotlib.rcParams['savefig.dpi'] = 100 # Change this to adjust figure size import numpy as np
anudeepsharma/autorest
refs/heads/master
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/models/error.py
432
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
carymrobbins/helga-haskell
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup( name='helga-haskell', version='0.2.1', author="Cary M. Robbins", description='Evaluate Haskell expressions using helga!', author_email="carymrobbins@gmail.com", url="https://github.com/carymrobbins/helga-haskell", packages=find_packages(), ...