repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
rpm-software-management/createrepo_c
doc/python/conf.py
6
8128
# -*- coding: utf-8 -*- # # createrepo_c documentation build configuration file, created by # sphinx-quickstart on Tue Jan 8 13:45:14 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
gpl-2.0
zaina/nova
nova/keymgr/__init__.py
70
1079
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
vFense/vFenseAgent-nix
agent/deps/rpm6/Python-2.7.5/lib/python2.7/test/test_smtplib.py
74
18342
import asyncore import email.utils import socket import smtpd import smtplib import StringIO import sys import time import select import unittest from test import test_support try: import threading except ImportError: threading = None HOST = test_support.HOST def server(evt, buf, serv): serv.listen(5) ...
lgpl-3.0
anksp21/Community-Zenpacks
ZenPacks.chudler.GoogleAppEngine/ZenPacks/chudler/GoogleAppEngine/AppEngineEvents.py
3
3307
"""03FEB10 This file doesn't do anything. It still references some vmware specific things, and in general needs work""" import types from Products.ZenUtils.Utils import prepId _rcvtime_field='rcvtime' def byRcvtimeField(x,y): xtime=x.fields[_rcvtime_field] ytime=y.fields[_rcvtime_field] if xtime > ytime:...
gpl-2.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/test/tool_shed/base/twilltestcase.py
1
89289
import common import string import os import re import test_db_util import shutil import logging import time import tempfile import tarfile import urllib import galaxy.webapps.tool_shed.util.hgweb_config import galaxy.model.tool_shed_install as galaxy_model import galaxy.util from base.tool_shed_util import repository...
gpl-3.0
nickgentoo/scikit-learn-graph
skgraph/kernel/ODDSTGraphKernelListFeaturesForDeep.py
1
33681
# -*- coding: utf-8 -*- """ Created on Wed Jun 24 12:44:02 2015 Copyright 2015 Nicolo' Navarin, Riccardo Tesselli This file is part of scikit-learn-graph. scikit-learn-graph 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 ...
gpl-3.0
kyvinh/home-assistant
homeassistant/components/pilight.py
22
5795
""" Component to create an interface to a Pilight daemon. For more details about this component, please refer to the documentation at https://home-assistant.io/components/pilight/ """ import logging import functools import socket import threading from datetime import timedelta import voluptuous as vol from homeassi...
apache-2.0
Motaku/ansible
contrib/inventory/openshift.py
132
3564
#!/usr/bin/env python # (c) 2013, Michael Scherer <misc@zarb.org> # # 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 o...
gpl-3.0
EDUlib/eTracesX
Stopout-Prediction/record_experiments.py
1
2074
import sql_functions def record_experiment(db_name, username, passwd, host, port, lead, lag, auc_train, testing_course, auc_test, p_lambda, p_epsilon, exp_time_stamp): conn = sql_functions.openSQLConnectionP(db_name, username, passwd, host, port) ##returns exp_id sql = '''INSERT INTO `%s`.`experime...
agpl-3.0
shivylp/xLisp
xLisp/builtins.py
1
6369
import sys import inspect from .utils import load_module from .xtypes import macrofn, normalfn, xLispSymbol, xLambdaFunction, \ xLispString, xLispList, xLispNumber, get_xlisp_type @normalfn("exec") def execute_f(env, file_path): assert isinstance(file_path, str), "file-path must be a string" ...
gpl-3.0
google/trax
trax/supervised/lr_schedules_test.py
1
3304
# coding=utf-8 # Copyright 2021 The Trax 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 law or a...
apache-2.0
Mazecreator/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/vector_laplace_diag_test.py
71
7544
# 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...
apache-2.0
DonBeo/scikit-learn
sklearn/datasets/__init__.py
74
3616
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
IKholopov/HackUPC2017
hackupc/env/lib/python3.5/site-packages/django/contrib/auth/forms.py
28
15044
from __future__ import unicode_literals import unicodedata from django import forms from django.contrib.auth import ( authenticate, get_user_model, password_validation, ) from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, identify_hasher, ) from django.contrib.auth.models import User from dja...
apache-2.0
adeelahmad84/api
url_test.py
1
1192
#!/usr/bin/env python # -- coding: utf-8 -- """ File: scraping.py Author: Adeel Ahmad Email: adeelahmad84@me.com Github: https://github.com/adeelahmad84 Description: Web Scraping script. """ import doctest from time import sleep import requests def main(): """ Retrieve a...
mit
theovoss/python_koans
python2/libs/colorama/ansi.py
527
1039
# 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[' def code_to_chars(code): return CSI + str(code) + 'm' class AnsiCodes(object): def __...
mit
TigorC/zulip
zerver/views/webhooks/jira.py
10
7825
# Webhooks for external integrations. from __future__ import absolute_import from typing import Any, Optional, Text from django.utils.translation import ugettext as _ from django.db.models import Q from django.conf import settings from django.http import HttpRequest, HttpResponse from zerver.models import Client, Use...
apache-2.0
mschenck/aurora
src/test/python/apache/aurora/client/api/test_api.py
1
6443
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
xuweiliang/Codelibrary
nova/objects/instance_pci_requests.py
9
5768
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
sahiljain/catapult
dashboard/dashboard/create_health_report_test.py
3
11174
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import webapp2 import webtest from google.appengine.ext import ndb from google.appengine.api import users from dashboard import create_health_report from d...
bsd-3-clause
linearregression/socorro
socorro/unittest/cron/testNamedCursor.py
11
6171
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ This is a named cursor proof of concept, flanged together quickly to use nose (see rename below) because all the bit...
mpl-2.0
samisalkosuo/pureapp
simplejson/tests/test_bitsize_int_as_string.py
121
2297
from unittest import TestCase import simplejson as json class TestBitSizeIntAsString(TestCase): # Python 2.5, at least the one that ships on Mac OS X, calculates # 2 ** 31 as 0! It manages to calculate 1 << 31 correctly. values = [ (200, 200), ((1 << 31) - 1, (1 << 31) - 1), ((1 <...
apache-2.0
tensorflow/tensorflow
tensorflow/python/eager/wrap_function_test.py
23
20983
# Copyright 2018 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
porduna/weblabdeusto
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment/experiment44/server_config.py
968
1526
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
bbirand/python-driver
tests/unit/test_types.py
7
12397
# Copyright 2013-2015 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...
apache-2.0
gvigneron/multitenancy_gae_pipeline
tests/testutil.py
2
2891
#!/usr/bin/python2.5 # # Copyright 2009 Google 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...
apache-2.0
renard/ansible
lib/ansible/plugins/cache/memory.py
159
1272
# (c) 2014, Brian Coca, Josh Drake, et al # (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 = ''' cache: memory short_description: RAM ba...
gpl-3.0
msiebuhr/v8.go
v8/test/message/testcfg.py
49
4646
# Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
mit
lokirius/python-for-android
python3-alpha/python3-src/Lib/encodings/cp864.py
272
33663
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.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_map) def decode(self,input,errors='strict'): ...
apache-2.0
fhaoquan/kbengine
kbe/src/lib/python/Lib/test/test_range.py
67
23223
# Python test set -- built-in functions import test.support, unittest import sys import pickle import itertools # pure Python implementations (3 args only), for comparison def pyrange(start, stop, step): if (start - stop) // step < 0: # replace stop with next element in the sequence of integers # ...
lgpl-3.0
ZihengJiang/mxnet
example/kaggle-ndsb2/Train.py
52
7078
# 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...
apache-2.0
wooga/airflow
tests/providers/apache/hive/sensors/test_named_hive_partition.py
1
9124
# # 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...
apache-2.0
durandtdd/luna
rsc/generate-opcodes.py
1
3352
def read_opcodes(path_rsc): """ Read opcode from resource file """ with open(path_rsc + "opcodes.txt", "r") as file: text = file.read() text = text.replace(".u8", "DUMMY") text = text.replace("u8", "UINT8") text = text.replace("i8", "INT8") text = text.replace("u16", "UI...
mit
thaumos/ansible
test/units/module_utils/test_distribution_version.py
17
46542
# -*- coding: utf-8 -*- # Copyright: (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 from itertools import product import mock import pytest from ansible.module...
gpl-3.0
moijes12/oh-mainline
mysite/search/migrations/0072_auto__chg_field_bug_tracker_id.py
15
19375
# encoding: 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): # Changing field 'Bug.tracker_id' db.alter_column('search_bug', 'tracker_id', self.gf('django.db.models.fi...
agpl-3.0
moqada/django-simple-spam-blocker
tests/tests/wsgi.py
5
1132
""" WSGI config for tests project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
bsd-3-clause
3nids/QGIS
python/plugins/processing/algs/gdal/ColorRelief.py
30
6386
# -*- coding: utf-8 -*- """ *************************************************************************** ColorRelief.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
gpl-2.0
flingone/git-repo
subcmds/diff.py
140
1414
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
yqm/sl4a
python/gdata/tests/gdata_tests/health_test.py
127
7162
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
saullocastro/pyNastran
pyNastran/op2/result_objects/element_table_object.py
1
27322
from __future__ import print_function from six import iteritems from six.moves import zip, range from struct import Struct, pack import numpy as np from numpy import array, zeros, angle, float32, searchsorted, empty from numpy import allclose, asarray, vstack, swapaxes, hstack, array_equal from pyNastran.op2.result_o...
lgpl-3.0
goldeneye-source/ges-python
lib/test/test_codecmaps_jp.py
16
1929
# # test_codecmaps_jp.py # Codec mapping tests for Japanese encodings # from test import support from test import multibytecodec_support import unittest class TestCP932Map(multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp932' mapfileurl = 'http://www.unicode.org/...
gpl-3.0
jelugbo/tundex
common/test/acceptance/pages/lms/auto_auth.py
62
2410
""" Auto-auth page (used to automatically log in during testing). """ import re import urllib from bok_choy.page_object import PageObject from . import AUTH_BASE_URL class AutoAuthPage(PageObject): """ The automatic authorization page. When allowed via the django settings file, visiting this url will...
agpl-3.0
olgabot/pelican-plugins
liquid_tags/gram.py
41
3590
""" Instagram Image Tag ------------------- By `Tom Spalding <https://github.com/digitalvapor>`_ You can see a working example at `antivapor.net/instagram-tag.html <http://antivapor.net/instagram-tag.html>`_. Based on `Liquid Image Tag <https://github.com/getpelican/pelican-plugins/blob/master/liquid_tags/img.py>`_ ...
agpl-3.0
inliniac/suricata
doc/devguide/conf.py
7
9795
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys i...
gpl-2.0
KnowNo/reviewboard
reviewboard/webapi/tests/test_review_group.py
8
11335
from __future__ import unicode_literals from django.utils import six from djblets.db.query import get_object_or_none from djblets.testing.decorators import add_fixtures from djblets.webapi.errors import PERMISSION_DENIED from reviewboard.reviews.models import Group, ReviewRequest from reviewboard.site.models import L...
mit
spthaolt/breakpad
src/tools/gyp/test/variables/gyptest-commands.py
138
1372
#!/usr/bin/env python # Copyright (c) 2009 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. """ Test variable expansion of '<!()' syntax commands. """ import os import TestGyp test = TestGyp.TestGyp(format='gypd') expect = test....
bsd-3-clause
microcosm-cc/microweb
comments/views.py
1
11131
import grequests import logging from urlparse import urlunparse from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import render from django.views.decorators.cache im...
mit
nagamanicg/ml_lab_ecsc_306
labwork/lab7/sci-learn/pca_iris.py
65
1485
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= PCA example with Iris Data-set ========================================================= Principal Component Analysis applied to the Iris dataset. See `here <https://en.wikipedia.org/wiki/Iris_flower_data_set>`_ f...
apache-2.0
zimmerle/gnuradio
gr-digital/python/cpm.py
16
8787
# # CPM modulation and demodulation. # # # Copyright 2005-2007,2011 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 ve...
gpl-3.0
Kapeli/PopClip-Extensions
source/Trello/requests/packages/chardet/euckrfreq.py
3121
45978
######################## 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 R...
mit
ykim362/mxnet
tests/nightly/test_tutorial.py
27
4030
# 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...
apache-2.0
stackforge/senlin
senlin/objects/health_registry.py
2
2731
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
apache-2.0
Antiun/account-invoicing
stock_picking_invoicing_incoterm/stock.py
10
1717
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014-15 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0
michelts/lettuce
tests/integration/lib/Django-1.2.5/django/utils/simplejson/decoder.py
409
11952
"""Implementation of JSONDecoder """ import re import sys import struct from django.utils.simplejson.scanner import make_scanner c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys...
gpl-3.0
HHStudent/fizzbuzz
fizzbuzz.py
1
1184
""" fizzbuzz.py Author: Dimitri Credit: Mr. Dennison Assignment: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. We will use a v...
mit
yang1fan2/nematus
mosesdecoder-master/scripts/training/bilingual-lm/extract_test.py
8
2946
#!/usr/bin/env python # # This file is part of moses. Its use is licensed under the GNU Lesser General # Public License version 2.1 or, at your option, any later version. """Create a test corpus, using a previously pruned vocabulary.""" import logging import optparse import os import os.path import sys import extr...
bsd-3-clause
k0nane/R915_kernel_GB
Kernel/tools/perf/scripts/python/check-perf-trace.py
948
2501
# perf trace event handlers, generated by perf trace -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. Ba...
gpl-3.0
handroissuazo/tensorflow
tensorflow/python/kernel_tests/qr_op_test.py
84
5376
# 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...
apache-2.0
nicoddemus/guessit
guessit/date.py
11
4412
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
lgpl-3.0
pyjs/pyjs
pyjswidgets/pyjamas/DOM.oldmoz.py
7
3011
def compare(elem1, elem2): JS(""" if (!@{{elem1}} && !@{{elem2}}) { return true; } else if (!@{{elem1}} || !@{{elem2}}) { return false; } if (!@{{elem1}}['isSameNode']) { return (@{{elem1}} == @{{elem2}}); } return (@{{elem1}}['isSameNode'](@{{elem2}})); """) def eventGet...
apache-2.0
vybstat/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
espadrine/opera
chromium/src/third_party/pyelftools/test/run_readelf_tests.py
4
6914
#!/usr/bin/env python #------------------------------------------------------------------------------- # test/run_readelf_tests.py # # Automatic test runner for elftools & readelf # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------...
bsd-3-clause
yanheven/horizon
openstack_dashboard/dashboards/project/data_processing/jobs/tabs.py
38
1172
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
wfxiang08/django185
tests/utils_tests/test_encoding.py
13
4548
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import datetime import unittest from django.utils import six from django.utils.encoding import ( escape_uri_path, filepath_to_uri, force_bytes, force_text, iri_to_uri, uri_to_iri, ) from django.utils.http import urlquote_plus class TestEncodi...
bsd-3-clause
sergeychipiga/selenium
py/test/selenium/webdriver/firefox/__init__.py
57
1247
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google 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 requ...
apache-2.0
goodwinnk/intellij-community
python/testData/MockSdk3.4/Lib/io.py
165
3395
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
apache-2.0
yinquan529/platform-external-chromium_org-tools-grit
grit/util.py
36
20291
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Utilities used by GRIT. ''' import codecs import htmlentitydefs import os import re import shutil import sys import tempfile im...
bsd-2-clause
bitmazk/django-calendarium
calendarium/tests/tags_tests.py
1
2015
"""Tests for the template tags of the ``calendarium`` app.""" from django.template import Context, Template from django.test import TestCase from django.utils import timezone from mixer.backend.django import mixer from ..templatetags.calendarium_tags import get_upcoming_events, get_week_URL class RenderUpcomingEven...
mit
codoo/clouder
clouder/clouder_application.py
2
17191
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Buron # Copyright 2015, TODAY Clouder SASU # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License with Attribution # ...
gpl-3.0
binape/code-snippets
00-QuickExamples/zfgrep.py
1
2606
#!/usr/bin/env python # # Author: Alen Archuleta # Date: 2015-11-26 # lookup string in zip or jar file # import os import sys import zipfile import re import getopt def exec_lookup(fp, options): re_content = re.compile(options["MatchString"]) def match_content(fileinfo): matched = False conte...
mit
jimi-c/ansible
lib/ansible/modules/cloud/oneandone/oneandone_firewall_policy.py
74
18691
#!/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
rchav/vinerack
saleor/registration/utils.py
18
6990
import hashlib import hmac import logging try: from urllib.parse import parse_qs, urlencode, urljoin, urlunparse except ImportError: from urllib import urlencode from urlparse import parse_qs, urljoin, urlunparse from django.core.urlresolvers import reverse from django.conf import settings import requests ...
bsd-3-clause
miing/mci_migo_packages_django-preflight
setup.py
1
1975
# -*- encoding: utf-8 -*- # Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). import sys try: from ast import PyCF_ONLY_AST except ImportError: PyCF_ONLY_AST = 1024 from setuptools import setup def get_version(): retu...
agpl-3.0
shivam1111/odoo
addons/pad_project/__openerp__.py
312
1500
# -*- 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
olapaola/olapaola-android-scripting
python/src/Lib/test/test_logging.py
48
29218
#!/usr/bin/env python # # Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
apache-2.0
jvanz/vanzstuff
old/loganalyzer/log_filter_job_v2.py
1
11257
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Para tentar simplificar a execução toda a aplicação e Toda a aplicação foi desenvolvida usando threads. Onde cada thread executa tem uma terefa especifica. São elas: * SplitLogFileTask: Thread que fica observando um diretório em busca de novos arquivos de log. Quando u...
gpl-3.0
ojengwa/Bookie
docs/conf.py
9
7014
# -*- coding: utf-8 -*- # # Bookie documentation build configuration file, created by # sphinx-quickstart on Fri Feb 4 23:04:10 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
agpl-3.0
azide0x37/modocDB
venv/lib/python2.7/site-packages/setuptools/command/rotate.py
285
2062
import distutils, os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import * class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest file...
mit
BaconPancakes/valor
lib/youtube_dl/extractor/radiofrance.py
91
2089
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class RadioFranceIE(InfoExtractor): _VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)' IE_NAME = 'radiofrance' _TEST = { 'url': 'http://maison.radiofrance.fr/radiovisio...
gpl-3.0
oinopion/django
tests/template_tests/filter_tests/test_linebreaksbr.py
331
1742
from django.template.defaultfilters import linebreaksbr from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinebreaksbrTests(SimpleTestCase): """ The contents in "linebreaksbr" are escaped according to the current autoescape setting. "...
bsd-3-clause
transientlunatic/minke
docs/conf.py
1
8668
#!/usr/bin/env python # -*- coding: utf-8 -*- # # minke documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autog...
isc
virtualopensystems/neutron
neutron/tests/unit/mlnx/test_defaults.py
25
1508
# Copyright (c) 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 ...
apache-2.0
khchine5/voga
lino_voga/__init__.py
1
1141
# -*- coding: UTF-8 -*- # Copyright 2013-2018 Rumma & Ko Ltd # This file is part of Lino Voga. # # Lino Voga 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 you...
agpl-3.0
diegoguimaraes/django
tests/admin_checks/models.py
54
1687
""" Tests of ModelAdmin system checks logic. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey class Album(models.Model): title = models.CharFie...
bsd-3-clause
drufat/sympy
sympy/parsing/mathematica.py
96
1996
from __future__ import print_function, division from re import match from sympy import sympify def mathematica(s): return sympify(parse(s)) def parse(s): s = s.strip() # Begin rules rules = ( # Arithmetic operation between a constant and a function (r"\A(\d+)([*/+-^])(\w+\[[^\]]+[^...
bsd-3-clause
sontek/rethinkdb
scripts/VirtuaBuild/vcoptparse.py
46
9888
# Copyright 2010-2012 RethinkDB, all rights reserved. """ vcoptparse is short for Value-Centric Option Parser. It's a tiny argument parsing library. It has less features than optparse or argparse, but it kicks more ass. optparse and argparse allow the client to specify the flags that should be parsed, and as an aftert...
agpl-3.0
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/pywebsocket/src/example/origin_check_wsh.py
516
1992
# Copyright 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...
bsd-3-clause
kingland/go-v8
v8-3.28/tools/generate_shim_headers/generate_shim_headers.py
120
4689
#!/usr/bin/env python # # Copyright 2013 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
mit
ecino/compassion-modules
message_center_compassion/tests/test_onramp_controller.py
3
2304
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2018 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Nicolas Bornand # # The licence is in the file __manifest__.py # ################...
agpl-3.0
prarthitm/edxplatform
common/djangoapps/course_modes/tests/test_views.py
8
18032
""" Tests for course_modes views. """ from datetime import datetime import unittest import decimal import ddt import freezegun from mock import patch from nose.plugins.attrib import attr from django.conf import settings from django.core.urlresolvers import reverse from lms.djangoapps.commerce.tests import test_utils...
agpl-3.0
suhe/odoo
openerp/modules/registry.py
19
20208
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. """ Models registries. """ from collections import Mapping, defaultdict import logging import os import threading import openerp from .. import SUPERUSER_ID from openerp.tools import assertion_report, lazy_property, cl...
gpl-3.0
simmetria/sentry
src/sentry/models.py
1
28971
""" sentry.models ~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging import math import time import uuid import urlparse from hashlib import md5 from indexer.models import Ba...
bsd-3-clause
ebaste/word_cloud
doc/sphinxext/numpy_ext/docscrape_sphinx.py
52
8004
import re import inspect import textwrap import pydoc import sphinx from docscrape import NumpyDocString from docscrape import FunctionDoc from docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config sel...
mit
fullcoins/fullcoin
qa/rpc-tests/bip65-cltv-p2p.py
40
6411
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, N...
mit
g-weatherill/oq-hazardlib
openquake/hazardlib/tests/gsim/tusa_langer_2015_test.py
2
3771
# The Hazard Library # Copyright (C) 2015 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Th...
agpl-3.0
varuntiwari27/rally
rally/plugins/openstack/scenarios/manila/utils.py
2
9948
# Copyright 2015 Mirantis 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...
apache-2.0
abhattad4/Digi-Menu
digimenu2/django/utils/jslex.py
251
7779
"""JsLex: a lexer for Javascript""" # Originally from https://bitbucket.org/ned/jslex from __future__ import unicode_literals import re class Tok(object): """ A specification for a token class. """ num = 0 def __init__(self, name, regex, next=None): self.id = Tok.num Tok.num += 1...
bsd-3-clause
rfriedlein/zenoss
ZenPacks/ZenPacks.Coredial.StatusReport/ZenPacks/Coredial/StatusReport/interfaces.py
19
1837
from Products.Zuul.form import schema from Products.Zuul.interfaces.component import IComponentInfo from Products.Zuul.interfaces.template import IRRDDataSourceInfo # ZuulMessageFactory is the translation layer. You will see strings intended to # been seen in the web interface wrapped in _t(). This is so that these st...
gpl-3.0
zetaops/ulakbus
ulakbus/views/bap/proje_talep/bap_fasil_aktarim_talep.py
1
14089
# -*- coding: utf-8 -*- # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from collections import defaultdict from ulakbus.models import BAPProje, BAPButcePlani, BAPGundem from zengine.views.crud import CrudView from zengine.for...
gpl-3.0
isaac-philip/loolu
common/django/core/management/validation.py
1
15733
import sys from django.core.management.color import color_style from django.utils.itercompat import is_iterable class ModelErrorCollection: def __init__(self, outfile=sys.stdout): self.errors = [] self.outfile = outfile self.style = color_style() def add(self, context, error): ...
mit