repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringclasses
981 values
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
rooshilp/CMPUT410W15-project
testenv/lib/python2.7/site-packages/django/db/models/related.py
62
3102
from collections import namedtuple from django.utils.encoding import smart_text from django.db.models.fields import BLANK_CHOICE_DASH # PathInfo is used when converting lookups (fk__somecol). The contents # describe the relation in Model terms (model Options and Fields for both # sides of the relation. The join_field...
gpl-2.0
Jason-Gew/Python_modules
authenticate.py
1
2754
#!/usr/bin/env python # # authenticate.py module is create by Jason/Ge Wu # Purpose to fast set up and verify username & password # for system or software access. from getpass import getpass # Disable password display on console import base64 # If necessary, use more advanced encryption such as AES, MD5 e...
gpl-3.0
jrief/django-shop
shop/admin/defaults/customer.py
3
1832
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from django.utils.html import format_html_join from django.utils.translation import ugettext_lazy as _ from shop.admin.customer import CustomerProxy, CustomerInlineAdminBase, CustomerAdminBase class CustomerInlineAdmin(...
bsd-3-clause
vinayan3/clpricehistory
django/contrib/gis/geos/linestring.py
411
5568
from django.contrib.gis.geos.base import numpy from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.point import Point from django.contrib.gis.geos import prototypes as cap...
bsd-3-clause
brandond/ansible
test/units/plugins/connection/test_psrp.py
40
4802
# -*- coding: utf-8 -*- # (c) 2018, Jordan Borean <jborean@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from io import Strin...
gpl-3.0
miyucy/oppia
extensions/rules/set_of_unicode_string.py
20
2309
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
dosiecki/NewsBlur
utils/munin/newsblur_tasks_pipeline.py
4
1488
#!/srv/newsblur/venv/newsblur/bin/python from utils.munin.base import MuninGraph class NBMuninGraph(MuninGraph): @property def graph_config(self): graph = { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Task Pipeline', 'graph_vlabel' : 'Feed fetch pipelin...
mit
siosio/intellij-community
python/helpers/pockets/iterators.py
30
8342
# -*- coding: utf-8 -*- # Copyright (c) 2016 the Pockets team, see AUTHORS. # Licensed under the BSD License, see LICENSE for details. """A pocket full of useful iterators!""" from __future__ import absolute_import import collections import six __all__ = ["peek_iter", "modify_iter"] class peek_iter(object): "...
apache-2.0
pvthuy/word2vec
word2vec/wordclusters.py
8
1115
from __future__ import division, print_function, unicode_literals import numpy as np class WordClusters(object): def __init__(self, vocab, clusters): self.vocab = vocab self.clusters = clusters def ix(self, word): """ Returns the index on self.vocab and self.clusters for `wo...
apache-2.0
victoredwardocallaghan/pygments-main
pygments/lexers/_phpbuiltins.py
10
122176
# -*- coding: utf-8 -*- """ pygments.lexers._phpbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file loads the function names and their modules from the php webpage and generates itself. Do not alter the MODULES dict by hand! WARNING: the generation transfers quite much data over your ...
bsd-2-clause
petervanderdoes/wger
wger/utils/fields.py
1
1559
# This file is part of wger Workout Manager. # # wger Workout Manager 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. # # wger W...
agpl-3.0
PongPi/isl-odoo
addons/note_pad/__openerp__.py
312
1691
# -*- 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...
agpl-3.0
Teagan42/home-assistant
tests/components/http/test_data_validator.py
7
1929
"""Test data validator decorator.""" from unittest.mock import Mock from aiohttp import web import voluptuous as vol from homeassistant.components.http import HomeAssistantView from homeassistant.components.http.data_validator import RequestDataValidator async def get_client(aiohttp_client, validator): """Gener...
apache-2.0
uclouvain/osis
base/migrations/0054_scoresencoding.py
1
2269
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-05-02 15:06 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('base', '0053_auto_20160529_2355'), ] operations = [ migrations.RunSQL( """...
agpl-3.0
fermasia/android_kernel_oneplus_msm8974
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
openstack/third-party-ci-tools
monitoring/nagios/checks/check_jenkins.py
4
1519
#!/usr/bin/env python import argparse import urllib import utils def check_jenkins_status(job_name, warning_threshold, critial_threshold): """Returns a tuple of exit code and message string Exit codes are either 2 -> critical, 1 -> warning, or 0 -> OK There code is determined based on the job health sc...
apache-2.0
mapr/hue
desktop/core/ext-py/Django-1.6.10/django/http/utils.py
134
1501
""" Functions that modify an HTTP request or response in some way. """ # This group of functions are run as part of the response handling, after # everything else, including all response middleware. Think of them as # "compulsory response middleware". Be careful about what goes here, because # it's a little fiddly to ...
apache-2.0
EduPepperPD/pepper2013
lms/djangoapps/bulk_email/forms.py
8
1640
""" Defines a form for providing validation of CourseEmail templates. """ import logging from django import forms from django.core.exceptions import ValidationError from bulk_email.models import CourseEmailTemplate, COURSE_EMAIL_MESSAGE_BODY_TAG log = logging.getLogger(__name__) class CourseEmailTemplateForm(forms...
agpl-3.0
314r/joliebulle
joliebulle/view/base.py
1
1815
#joliebulle 3.6 #Copyright (C) 2010-2016 Pierre Tavares #Copyright (C) 2012-2015 joliebulle's authors #See AUTHORS file. #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 Li...
gpl-3.0
mihaip/NewsBlur
vendor/pynliner/__init__.py
19
9059
#!/usr/bin/env python """Pynliner : Convert CSS to inline styles Python CSS-to-inline-styles conversion tool for HTML using BeautifulSoup and cssutils Copyright (c) 2011 Tanner Netterville Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
mit
shawncaojob/LC
QUESTIONS/44_wildcard_matching.py
1
1859
# 44. Wildcard Matching My Submissions QuestionEditorial Solution # Total Accepted: 59032 Total Submissions: 333961 Difficulty: Hard # Implement wildcard pattern matching with support for '?' and '*'. # # '?' Matches any single character. # '*' Matches any sequence of characters (including the empty sequence). # # Th...
gpl-3.0
aminert/scikit-learn
sklearn/feature_selection/__init__.py
244
1088
""" The :mod:`sklearn.feature_selection` module implements feature selection algorithms. It currently includes univariate filter selection methods and the recursive feature elimination algorithm. """ from .univariate_selection import chi2 from .univariate_selection import f_classif from .univariate_selection import f_...
bsd-3-clause
Kongsea/tensorflow
tensorflow/python/keras/applications/inception_resnet_v2/__init__.py
23
1193
# Copyright 2017 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...
apache-2.0
caioariede/pyq
sizzle/match.py
1
3323
from .selector import Selector class MatchEngine(object): pseudo_fns = {} selector_class = Selector def __init__(self): self.register_pseudo('not', self.pseudo_not) self.register_pseudo('has', self.pseudo_has) def register_pseudo(self, name, fn): self.pseudo_fns[name] = fn ...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_fcntl.py
5
2984
"""Test program for the fcntl C module. OS/2+EMX doesn't support the file locking operations. """ import os import struct import sys import unittest from test.support import verbose, TESTFN, unlink, run_unittest, import_module # Skip test if no fnctl module. fcntl = import_module('fcntl') # TODO - Write tests for ...
mit
tunneln/CarnotKE
jyhton/lib-python/2.7/pstats.py
117
26711
"""Class for printing reports on profiled python code.""" # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement # # Licensed under t...
apache-2.0
tchx84/sugar-toolkit-gtk3
examples/ticket2855.py
9
1630
# Copyright (C) 2007, Red Hat, Inc. # # 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 option) any later version. # # This library is distrib...
lgpl-2.1
yati-sagade/RyDyrect
django/contrib/messages/tests/fallback.py
311
6978
from django.contrib.messages import constants from django.contrib.messages.storage.fallback import FallbackStorage, \ CookieStorage from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.tests.cookie import set_cookie_data, \ stored_cookie_messages_count from django.contrib.message...
bsd-3-clause
privateip/ansible
lib/ansible/modules/cloud/amazon/sts_session_token.py
48
5459
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
lesiavl/selenium_perfomance_tests
utender_load/create_tender.py
4
2484
#!/usr/bin/env python # -*- coding: utf-8 -*- from selenium import webdriver from page_objects import * from datetime import datetime import unittest import argparse tender_id = None class SeleniumMixin(unittest.TestCase): def assertlementIsPresentById(self, elem_id): try: self.driver.find_el...
apache-2.0
chriskmanx/qmole
QMOLEDEV/node/tools/scons/scons-local-1.2.0/SCons/Tool/icl.py
12
1840
"""engine.SCons.Tool.icl Tool-specific initialization for the Intel C/C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons ...
gpl-3.0
benthomasson/ansible
lib/ansible/modules/network/vyos/vyos_static_route.py
11
7392
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
zploskey/servo
tests/wpt/web-platform-tests/tools/py/py/_path/cacheutil.py
278
3333
""" This module contains multithread-safe cache implementations. All Caches have getorbuild(key, builder) delentry(key) methods and allow configuration when instantiating the cache class. """ from time import time as gettime class BasicCache(object): def __init__(self, maxentries=128): self.maxe...
mpl-2.0
SCSSG/Odoo-SCS
addons/account/account_invoice.py
3
79288
# -*- 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...
agpl-3.0
beyoungwoo/C_glibc_Sample
_Algorithm/ProjectEuler_python/euler_42.py
1
2038
#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Coded triangle numbers</h2><div id="problem_info" class="info"><h3>Problem 42</h3><span>Published on Friday,...
gpl-3.0
pgoeser/gnuradio
gr-comedi/src/qa_comedi.py
15
1240
#!/usr/bin/env python # # Copyright 2005,2007 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 opt...
gpl-3.0
ojengwa/oh-mainline
vendor/packages/docutils/test/test_transforms/test_contents.py
19
10659
#! /usr/bin/env python # $Id: test_contents.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for `docutils.transforms.parts.Contents` (via `docutils.transforms.universal.LastReaderPending`). """ from __init__ ...
agpl-3.0
zorroz/microblog
flask/lib/python2.7/site-packages/openid/extensions/draft/pape2.py
156
9330
"""An implementation of the OpenID Provider Authentication Policy Extension 1.0 @see: http://openid.net/developers/specs/ @since: 2.1.0 """ __all__ = [ 'Request', 'Response', 'ns_uri', 'AUTH_PHISHING_RESISTANT', 'AUTH_MULTI_FACTOR', 'AUTH_MULTI_FACTOR_PHYSICAL', ] from openid.extension i...
bsd-3-clause
BassantMorsi/finderApp
lib/python2.7/site-packages/django/test/signals.py
45
6752
import os import threading import time import warnings from django.apps import apps from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import Signal, receiver...
mit
Krabappel2548/kernel_msm8x60
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
Pointedstick/ReplicatorG
skein_engines/skeinforge-40/fabmetheus_utilities/geometry/geometry_tools/dictionary.py
2
5368
""" Boolean geometry dictionary object. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_utilities impor...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py
330
38349
# Copyright 2015,2016 Nir Cohen # # 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...
gpl-3.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_hub_virtual_network_connections_operations.py
1
8982
# 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 may ...
mit
KNMI/VERCE
verce-hpc-pe/src/test/graph_testing/grouping_alltoone.py
3
4256
''' This is a dispy graph which produces a workflow with a pipeline in which the producer node ``prod`` sends data to the consumer node ``cons1`` which then sends data to node ``cons2``. Note that in this graph we have defined several instances of the cons1 and cons2 nodes and all the instances of the cons1 node are ...
mit
Squishymedia/feedingdb
src/feeddb/feed/migrations/0058_muscleowl_emg_sono.py
1
40048
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SonoSensor.muscle' db.add_column(u'feed_sonosensor', 'mus...
gpl-3.0
ardi69/pyload-0.4.10
lib/Python/Lib/PIL/PSDraw.py
20
6872
# # The Python Imaging Library # $Id$ # # simple postscript graphics interface # # History: # 1996-04-20 fl Created # 1999-01-10 fl Added gsave/grestore to image method # 2005-05-04 fl Fixed floating point issue in image (from Eric Etheridge) # # Copyright (c) 1997-2005 by Secret Labs AB. All rights reserved. # ...
gpl-3.0
GheRivero/ansible
lib/ansible/modules/cloud/docker/docker_secret.py
16
8297
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
gpl-3.0
pkruskal/scikit-learn
sklearn/covariance/graph_lasso_.py
127
25626
"""GraphLasso: sparse inverse covariance estimation with an l1-penalized estimator. """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause # Copyright: INRIA import warnings import operator import sys import time import numpy as np from scipy import linalg from .empirical_covariance_ im...
bsd-3-clause
fighterlyt/bite-project
server/handlers/common_util.py
17
2084
# Copyright 2011 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...
apache-2.0
edxnercel/edx-platform
lms/djangoapps/certificates/migrations/0019_auto__add_certificatehtmlviewconfiguration.py
101
7978
# -*- 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 'CertificateHtmlViewConfiguration' db.create_table('certificates_certificatehtmlviewconfigura...
agpl-3.0
kirca/OpenUpgrade
addons/hr_timesheet_invoice/report/__init__.py
433
1136
# -*- 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...
agpl-3.0
tetherless-world/graphene
whyis/datastore/user.py
2
1067
from flask_security import UserMixin from flask_security.utils import verify_and_update_password from whyis.namespace import dc, auth, foaf, prov from .single import single from .multiple import multiple from .mapped_resource import MappedResource class User(MappedResource, UserMixin): rdf_type = prov.Agent ...
apache-2.0
ksrajkumar/openerp-6.1
openerp/addons/idea/wizard/idea_post_vote.py
9
6466
# -*- 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...
agpl-3.0
jayceyxc/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/webdesign/tests.py
232
1092
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from django.contrib.webdesign.lorem_ipsum import * from django.template import loader, Context class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur...
apache-2.0
Tranzystorek/servo
tests/wpt/web-platform-tests/tools/html5lib/setup.py
418
1694
from distutils.core import setup import os import codecs classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Pyt...
mpl-2.0
alphagov/notifications-api
migrations/versions/0321_drop_postage_constraints.py
1
2423
""" Revision ID: 0321_drop_postage_constraints Revises: 0320_optimise_notifications Create Date: 2020-06-08 11:48:53.315768 """ import os from alembic import op revision = '0321_drop_postage_constraints' down_revision = '0320_optimise_notifications' environment = os.environ['NOTIFY_ENVIRONMENT'] def upgrade(): ...
mit
int19h/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/ctypes/macholib/dylib.py
320
1828
""" Generic dylib path manipulation """ import re __all__ = ['dylib_info'] DYLIB_RE = re.compile(r"""(?x) (?P<location>^.*)(?:^|/) (?P<name> (?P<shortname>\w+?) (?:\.(?P<version>[^._]+))? (?:_(?P<suffix>[^._]+))? \.dylib$ ) """) def dylib_info(filename): """ A dylib name can take one of the ...
apache-2.0
ARG-TLQ/Red-DiscordBot
redbot/pytest/core.py
4
3759
import random from collections import namedtuple from pathlib import Path import weakref import pytest from redbot.core import Config from redbot.core.bot import Red from redbot.core import config as config_module, drivers __all__ = [ "override_data_path", "coroutine", "driver", "config", "config_...
gpl-3.0
fin/memorial-page
mysite/receivers.py
43
1348
from django.dispatch import receiver from account.signals import password_changed from account.signals import user_sign_up_attempt, user_signed_up from account.signals import user_login_attempt, user_logged_in from pinax.eventlog.models import log @receiver(user_logged_in) def handle_user_logged_in(sender, **kwargs...
mit
reidyd/legume
examples/bounceball/server.py
2
4144
#!/usr/bin/env python import time import legume import shared import random class ServerBall(shared.Ball): BALL_ID = 0 def __init__(self, env): shared.Ball.__init__(self, env) self.x = random.randint(0, shared.ZONE_WIDTH) self.y = random.randint(0, shared.ZONE_HEIGHT) self.vx =...
bsd-3-clause
jayc0b0/Projects
Python/Security/caesarCypher.py
1
1545
# Jacob Orner (jayc0b0) # Caesar Cypher script def main(): # Declare variables and take input global alphabet alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', ...
mit
jiachenning/odoo
addons/account_cancel/__init__.py
702
1046
# -*- 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...
agpl-3.0
denismakogon/pyvcloud
tests/vca_type_tests.py
3
2884
from nose.tools import with_setup from testconfig import config from pyvcloud import vcloudair from pyvcloud.vcloudair import VCA class TestVCAType: def test_0001(self): """Identify vCloud Director Standalone""" vca = VCA(host='https://p1v21-vcd.vchs.vmware.com', username='', verify=True, log=Tr...
apache-2.0
chenc10/Spark-PAF
python/pyspark/traceback_utils.py
160
2679
# # 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 us...
apache-2.0
chrispitzer/toucan-sam
toucansam/core/models.py
1
5910
import re from urlparse import urlparse, parse_qs from datetime import timedelta from django.core.urlresolvers import reverse from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from django.utils.safestring import mark_safe from durationfield.db.models.fields.duration im...
gpl-2.0
aldariz/Sick-Beard
lib/html5lib/treewalkers/etree.py
98
4817
import gettext _ = gettext.gettext try: from types import ModuleType except: from new import module as ModuleType import copy import re import _base from html5lib.constants import voidElements tag_regexp = re.compile("{([^}]*)}(.*)") moduleCache = {} def getETreeModule(ElementTreeImplementation): name ...
gpl-3.0
yangqian/plugin.video.pandatv
addon.py
1
4342
# -*- coding: utf-8 -*- # Module: default # Author: Yangqian # Created on: 25.12.2015 # License: GPL v.3 https://www.gnu.org/copyleft/gpl.html # Largely following the example at # https://github.com/romanvm/plugin.video.example/blob/master/main.py import xbmc,xbmcgui,urllib2,re,xbmcplugin from BeautifulSoup import Be...
lgpl-3.0
krunal3103/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_skipping.py
165
26964
import pytest import sys from _pytest.skipping import MarkEvaluator, folded_skips, pytest_runtest_setup from _pytest.runner import runtestprotocol class TestEvaluator: def test_no_marker(self, testdir): item = testdir.getitem("def test_func(): pass") evalskipif = MarkEvaluator(item, 'skipif') ...
mpl-2.0
bezhermoso/powerline
tools/colors_find.py
32
1671
#!/usr/bin/env python # vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import os from colormath.color_objects import sRGBColor, LabColor from colormath.color_conversions import convert_color from colormath.color_diff import delta_e_cie2000 ...
mit
xxd3vin/spp-sdk
opt/Python27/Lib/site-packages/numpy/lib/tests/test_regression.py
11
8028
from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount import numpy as np rlevel = 1 class TestRegression(TestCase): def test_poly1d(self,level=rlevel): """Ticket #28""" assert_equal(np.poly1d([1]) - np.poly1d([1,0]), np.poly1d([-1,1])) def tes...
mit
rajat1994/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
sasukeh/cinder
cinder/tests/unit/api/v2/test_snapshots.py
10
24185
# Copyright 2011 Denali Systems, 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 requ...
apache-2.0
emilk/sproxel
distro/common/lib/compiler/syntax.py
25
1490
"""Check for errs in the AST. The Python parser does not catch all syntax errors. Others, like assignments with invalid targets, are caught in the code generation phase. The compiler package catches some errors in the transformer module. But it seems clearer to write checkers that use the AST to detect error...
bsd-3-clause
apagac/cfme_tests
cfme/tests/cloud/test_quota_tagging.py
3
10773
# -*- coding: utf-8 -*- import fauxfactory import pytest from riggerlib import recursive_update from widgetastic.utils import partial_match from cfme import test_requirements from cfme.cloud.provider.openstack import OpenStackProvider from cfme.services.service_catalogs import ServiceCatalogs from cfme.utils.appliance...
gpl-2.0
haiyangd/python-porject
src/ovirt/node/setup/core/diagnostics_page.py
2
3004
#!/usr/bin/python # -*- coding: utf-8 -*- # # diagnostics_page.py - Copyright (C) 2012-2014 Red Hat, Inc. # Written by Fabian Deutsch <fabiand@redhat.com> # # 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 F...
gpl-2.0
fontenele/scrapy
tests/test_commands.py
105
8613
import os import sys import subprocess import tempfile from time import sleep from os.path import exists, join, abspath from shutil import rmtree from tempfile import mkdtemp from twisted.trial import unittest from twisted.internet import defer from scrapy.utils.python import retry_on_eintr from scrapy.utils.test imp...
bsd-3-clause
UXE/local-edx
cms/djangoapps/contentstore/tests/test_orphan.py
32
4165
""" Test finding orphans via the view and django config """ import json from contentstore.tests.utils import CourseTestCase from student.models import CourseEnrollment from xmodule.modulestore.django import modulestore from contentstore.utils import reverse_course_url class TestOrphan(CourseTestCase): """ Tes...
agpl-3.0
jakobj/nest-simulator
pynest/examples/Potjans_2014/run_microcircuit.py
14
3878
# -*- coding: utf-8 -*- # # run_microcircuit.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 2 of the Licens...
gpl-2.0
RenderBroken/msm8974_Victara-Stock_render_kernel
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
ipcamit/ipcamit.github.io
node_modules/pygmentize-bundled/vendor/pygments/pygments/scanner.py
365
3114
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
mit
tensorflow/tensor2tensor
tensor2tensor/utils/rouge_test.py
1
4407
# coding=utf-8 # Copyright 2021 The Tensor2Tensor Authors. # # 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...
apache-2.0
kvar/ansible
lib/ansible/module_utils/facts/system/fips.py
232
1338
# Determine if a system is in 'fips' mode # # 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. ...
gpl-3.0
pwoodworth/intellij-community
python/lib/Lib/email/test/test_email_renamed.py
134
118811
# Copyright (C) 2001-2007 Python Software Foundation # Contact: email-sig@python.org # email package unit tests import os import sys import time import base64 import difflib import unittest import warnings from cStringIO import StringIO import email from email.charset import Charset from email.header import Header, ...
apache-2.0
kisel/trex-core
scripts/external_libs/nose-1.3.4/python3/nose/ext/dtcompat.py
11
88107
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! # # Modified for inclusion in nose to provide support for DocFileTest in #...
apache-2.0
zhaishaomin/LDS-prefetcher-research
gem5_src/arch/x86/isa/insts/simd128/integer/data_reordering/extract_and_insert.py
91
2838
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
apache-2.0
GheRivero/ansible
lib/ansible/modules/cloud/amazon/ec2_ami_copy.py
12
7355
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. # ...
gpl-3.0
onedal88/Exploits-1
Minishare 1.4.1 /exp/exp5.py
3
1396
#exp5 #!/usr/bin/python import socket target_address="127.0.0.1" target_port=80 buffer = "GET " buffer+= "\x90" * 1787 buffer+= "\x65\x82\xA5\x7C" # EIP Overwrite. Shell32.dll, XP SP2, JMP ESP, 7CA58265. buffer+= "\x90" * 16 buffer+= ("\xdb\xca\xd9\x74\x24\xf4\x58\xbb\x17\xb3\xcd\x3f\x2b\xc9\xb1" "\x33\...
gpl-3.0
LighthouseHPC/lighthouse
src/Dlighthouse/registration/tests/__init__.py
59
1347
from django.test import TestCase import registration from registration.tests.backends import * from registration.tests.forms import * from registration.tests.models import * from registration.tests.views import * class RegistrationVersionInfoTests(TestCase): """ Test django-registration's internal version-r...
mit
MiltosD/CEFELRC
lib/python2.7/site-packages/django_jenkins/tasks/run_pyflakes.py
3
1798
# -*- coding: utf-8 -*- import os import re import sys from pyflakes.scripts import pyflakes from cStringIO import StringIO from django_jenkins.functions import relpath from django_jenkins.tasks import BaseTask, get_apps_locations class Task(BaseTask): def __init__(self, test_labels, options): super(Task,...
bsd-3-clause
Dino0631/RedRain-Bot
cogs/lib/websockets/test_client_server.py
8
17883
import asyncio import logging import os import ssl import unittest import unittest.mock from .client import * from .exceptions import ConnectionClosed, InvalidHandshake from .http import USER_AGENT, read_response from .server import * # Avoid displaying stack traces at the ERROR logging level. logging.basicConfig(le...
gpl-3.0
douglas-reid/mixer
bin/bazel_to_go.py
3
5775
#!/usr/bin/env python # # Makes a bazel workspace play nicely with standard go tools # go build # go test # should work after this # # It does so by making symlinks from WORKSPACE/vendor to the bazel # sandbox dirs # import glob import os import ast from urlparse import urlparse THIS_DIR = os.path.dirname(os.path.ab...
apache-2.0
onitake/ansible
test/units/modules/network/f5/test_bigip_provision.py
21
4395
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
tangentlabs/django-fancypages
fancypages/compat.py
1
1314
# -*- coding: utf-8 -*- from django.conf import settings from django.core.exceptions import ImproperlyConfigured _user_model = None try: from django.utils.module_loading import import_string except ImportError: from django.utils.module_loading import import_by_path as import_string # noqa def get_user_mod...
bsd-3-clause
apache/infrastructure-puppet
modules/gitbox/files/bin/graduate-podling.py
3
5934
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, V...
apache-2.0
neumerance/deploy
.venv/lib/python2.7/site-packages/cinderclient/utils.py
3
9043
# Copyright 2013 OpenStack LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
fullcontact/hesiod53
hesiod53/sync.py
1
11846
#!/usr/bin/env python from boto.route53.record import ResourceRecordSets from boto.route53.status import Status import boto.route53 as r53 from collections import namedtuple import argparse import time import yaml # a DNS record for hesiod # fqdn should include the trailing . # value should contain the value without...
mit
sk-yoh/qiaoy-byte
lib/werkzeug/http.py
317
33404
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
apache-2.0
trmznt/rhombus
rhombus/views/gallery.py
1
2066
from rhombus.views import * @roles( PUBLIC ) def index(request): """ input tags gallery """ static = False html = div( div(h3('Input Gallery'))) eform = form( name='rhombus/gallery', method=POST, action='') eform.add( fieldset( input_hidden(name='rhombus-gall...
lgpl-3.0
lifeinoppo/littlefishlet-scode
RES/REF/python_sourcecode/ipython-master/IPython/utils/decorators.py
36
2071
# encoding: utf-8 """Decorators that don't go anywhere else. This module contains misc. decorators that don't really go with another module in :mod:`IPython.utils`. Beore putting something here please see if it should go into another topical module in :mod:`IPython.utils`. """ #---------------------------------------...
gpl-2.0
cadencewatches/frappe
frappe/website/doctype/blog_post/test_blog_post.py
1
5111
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt """Use blog post test to test permission restriction logic""" import frappe import frappe.defaults import unittest from frappe.core.page.user_properties.user_properties import add, remove, get_properties, clear_rest...
mit