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
adaur/SickRage
lib/cachecontrol/adapter.py
59
4184
import functools from requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = set(['PUT', 'DELETE']) def __init__(self, cache=None, ...
gpl-3.0
kantlove/flask-simple-page
Lib/site-packages/werkzeug/__init__.py
116
7211
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
mit
zorojean/pyspider
pyspider/database/mysql/projectdb.py
76
2401
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-07-17 21:06:43 import time import mysql.connector from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB from pyspider.database.base...
apache-2.0
nicolargo/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/ie/ie_counties.py
503
1127
""" Sources: Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland """ from django.utils.translation import ugettext_lazy as _ IE_COUNTY_CHOICES = ( ('antrim', _('Antrim')), ('armagh', _('Armagh')), ('carlow', _('Carlow')), ('cavan', _('Cavan')), ('clare', _('Clare')), ('cork...
apache-2.0
mkopar/VirClass
VirClass/tests/test_load.py
2
37875
# pylint: disable=missing-docstring, protected-access, unused-argument, too-many-arguments, too-many-statements # pylint: disable=too-many-locals, bad-continuation # pydocstyle: disable=missing-docstring from collections import defaultdict from io import StringIO from unittest import TestCase, main from unittest import...
mit
dermoth/gramps
gramps/gen/filters/rules/test/place_rules_test.py
8
7946
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2016 Tom Samstag # Copyright (C) 2017 Serge Noiraud # # 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 2 of the ...
gpl-2.0
ujenmr/ansible
lib/ansible/modules/network/fortios/fortios_router_multicast_flow.py
21
8926
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
cjaymes/pyscap
src/scap/model/oval_5/defs/windows/RegKeyEffectiveRightsStateElement.py
1
3469
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
n0m4dz/odoo
openerp/addons/base/res/res_partner.py
138
40908
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
jerrylei98/Dailydos
venv/lib/python2.7/site-packages/pip/req/req_install.py
180
43096
from __future__ import absolute_import import logging import os import re import shutil import sys import tempfile import warnings import zipfile from distutils.util import change_root from distutils import sysconfig from email.parser import FeedParser from pip._vendor import pkg_resources, six from pip._vendor.dist...
mit
qrkourier/ansible
lib/ansible/modules/commands/shell.py
44
5468
# Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # There is no actual shell module source, when you use 'shell' in ansible, # it runs the 'command' module with special arguments and it behaves differently. # See the command source and the comme...
gpl-3.0
dataewan/deep-learning
face_generation/problem_unittests.py
159
6094
from copy import deepcopy from unittest import mock import tensorflow as tf def test_safe(func): """ Isolate tests """ def func_wrapper(*args): with tf.Graph().as_default(): result = func(*args) print('Tests Passed') return result return func_wrapper def _ass...
mit
rpm-software-management/dnf
tests/api/test_dnf_callback.py
1
6107
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import dnf from .common import TestCase class DnfCallbackApiTest(TestCase): def test_pkg_downgrade(self): # dnf.callback.PKG_DOWNGRADE self.assertHasAttr(dnf.callback, "PKG_DOWNGRADE") ...
gpl-2.0
wangxuan007/flasky
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
762
3532
import hashlib import os from pip._vendor.lockfile import LockFile from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile from ..cache import BaseCache from ..controller import CacheController def _secure_open_write(filename, fmode): # We only want to write to this file, so open it in write only mode ...
gpl-3.0
suiyuan2009/tensorflow
tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py
5
50818
# 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
Garygunn94/wavenet
wavenet/model.py
1
31644
import numpy as np import tensorflow as tf from ops import causal_conv, mu_law_encode def create_variable(name, shape): '''Create a convolution filter variable with the specified name and shape, and initialize it using Xavier initialition.''' initializer = tf.contrib.layers.xavier_initializer_conv2d() ...
mit
akurtakov/Pydev
plugins/org.python.pydev.core/pysrc/pycompletionserver.py
28
13437
''' Entry-point module to start the code-completion server for PyDev. @author Fabio Zadrozny ''' import sys IS_PYTHON_3_ONWARDS = sys.version_info[0] >= 3 if not IS_PYTHON_3_ONWARDS: import __builtin__ else: import builtins as __builtin__ # Python 3.0 from _pydevd_bundle.pydevd_constants import IS_JYTHON i...
epl-1.0
mtlchun/edx
openedx/core/djangoapps/user_api/helpers.py
1
17270
""" Helper functions for the account/profile Python APIs. This is NOT part of the public API. """ from collections import defaultdict from functools import wraps import logging import json from django.http import HttpResponseBadRequest LOGGER = logging.getLogger(__name__) def intercept_errors(api_error, ignore_erro...
agpl-3.0
wragge/faceapi
api.py
1
2926
from flask import Flask, request, render_template from flask_restful import Resource, Api from pymongo import MongoClient from flask_restful import fields, marshal_with, reqparse import random from bson.son import SON import os MONGOLAB_URL = os.environ['MONGOLAB_URL'] image_url = 'http://facedepot.s3.amazonaws.com/{...
cc0-1.0
keyurpatel076/MissionPlannerGit
packages/IronPython.StdLib.2.7.4/content/Lib/encodings/mac_latin2.py
647
8565
""" Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,erro...
gpl-3.0
Affix/CouchPotatoServer
libs/requests/cookies.py
821
16686
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import time import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading # grr, pyflakes: this fixes...
gpl-3.0
kdheepak89/pypdevs
pypdevs/templates/allocator.py
1
2033
# Copyright 2014 Modelling, Simulation and Design Lab (MSDL) at # McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/) # # 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...
apache-2.0
CodigoSur/cyclope
cyclope/apps/contacts/migrations/0007_auto__add_field_contact_show_author.py
2
14103
# -*- 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 field 'Contact.show_author' db.add_column('contacts_contact', 'show_author', ...
gpl-3.0
barnsnake351/nova
nova/tests/unit/api/openstack/compute/test_microversions.py
42
15815
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
hyrole/scrapy
scrapy/core/downloader/middleware.py
30
3117
""" Downloader Middleware manager See documentation in docs/topics/downloader-middleware.rst """ import six from scrapy.http import Request, Response from scrapy.middleware import MiddlewareManager from scrapy.utils.defer import mustbe_deferred from scrapy.utils.conf import build_component_list class DownloaderMiddle...
bsd-3-clause
meren/anvio
anvio/tables/codonfrequencies.py
1
2270
# -*- coding: utf-8 # pylint: disable=line-too-long import anvio import anvio.db as db import anvio.tables as t import anvio.utils as utils import anvio.terminal as terminal from anvio.tables.tableops import Table __author__ = "Developers of anvi'o (see AUTHORS.txt)" __copyright__ = "Copyleft 2015-2018, the Meren L...
gpl-3.0
dlstadther/luigi
test/config_env_test.py
7
3122
# -*- coding: utf-8 -*- # # Copyright 2018 Vote 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 ag...
apache-2.0
ArseniyK/Sunflower
application/gui/preferences/commands.py
7
4687
import gtk from widgets.settings_page import SettingsPage class Column: TITLE = 0 COMMAND = 1 class CommandsOptions(SettingsPage): """Commands options extension class""" def __init__(self, parent, application): SettingsPage.__init__(self, parent, application, 'commands', _('Commands')) # create list box ...
gpl-3.0
BTCDDev/bitcoin
qa/rpc-tests/httpbasics.py
106
4853
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test rpc http basics # from test_framework.test_framework import BitcoinTestFramework from test_fram...
mit
balazssimon/ml-playground
udemy/lazyprogrammer/ab-testing-python/client.py
1
1312
# From the course: Bayesin Machine Learning in Python: A/B Testing # https://deeplearningcourses.com/c/bayesian-machine-learning-in-python-ab-testing # https://www.udemy.com/bayesian-machine-learning-in-python-ab-testing from __future__ import print_function, division from builtins import range # Note: you may need to ...
apache-2.0
karlnewell/net-virt-platform
sdncon/stats/utils.py
4
2937
# # Copyright (c) 2013 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html # # Unless required by applicable l...
epl-1.0
lsdr/ptstemmer
Python/src/ptstemmer/support/datastructures/LRUCache.py
1
1884
''' * PTStemmer - A Stemming toolkit for the Portuguese language (C) 2008-2010 Pedro Oliveira * * This file is part of PTStemmer. * PTStemmer 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,...
lgpl-3.0
CalebSLane/openelisglobal-core
liquibase/HaitiMassive/scripts/sampleTypePanel.py
6
1230
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path import glob import os import sys import string import shutil import stat import time from time import gmtime, strftime from random import Random type = [] panel = [] done_combos = [] type_file = open('sampleType.txt','r') panel_file = open...
mpl-2.0
sjfloat/youtube-dl
youtube_dl/extractor/nhl.py
85
8478
from __future__ import unicode_literals import re import json import os from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_urllib_parse, compat_urllib_parse_urlparse ) from ..utils import ( unified_strdate, ) class NHLBaseInfoExtractor(InfoExtractor): @staticmethod ...
unlicense
maxdm07/node-gyp
gyp/test/cxxflags/gyptest-cxxflags.py
74
1575
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the g...
mit
HunterLarco/sealed
server/api/lib/users/AbstractUser.py
1
5848
""" ' Common Package Imports """ from google.appengine.ext import ndb import sessions def smarthash(string): from hashlib import sha256, md5 string = md5(string+'*t7)_(@&63)').hexdigest() string = sha256(string).hexdigest() return string class UserMetaData(ndb.Model): password = n...
apache-2.0
andela-bojengwa/talk
venv/lib/python2.7/site-packages/django/core/mail/__init__.py
230
4701
""" Tools for sending email. """ from __future__ import unicode_literals from django.conf import settings from django.utils.module_loading import import_string # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the introduction o...
mit
NikNitro/Python-iBeacon-Scan
sympy/polys/tests/test_orthopolys.py
124
5176
"""Tests for efficient functions for generating orthogonal polynomials. """ from sympy import Poly, S, Rational as Q from sympy.utilities.pytest import raises from sympy.polys.orthopolys import ( jacobi_poly, gegenbauer_poly, chebyshevt_poly, chebyshevu_poly, hermite_poly, legendre_poly, l...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/tensorflow/contrib/distributions/python/ops/bijectors/invert.py
85
1138
# 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...
mit
ecosoft-odoo/odoo
addons/account_followup/tests/__init__.py
261
1088
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
postvakje/sympy
sympy/vector/orienters.py
21
11763
from sympy.core.basic import Basic from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2, rot_axis3, ImmutableMatrix as Matrix, Symbol) from sympy.core.cache import cacheit import sympy.vector class Orienter(Basic): """ Super-class for all orienter classes. """ def rotati...
bsd-3-clause
pluser/nikola
nikola/plugins/task/pages.py
9
2614
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights t...
mit
georgetown-analytics/wrangle
wrangle/models.py
1
3993
# wrangle.models # SQLAlchemy models using the declarative extenstion # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Mon Mar 31 22:54:08 2014 -0400 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: models.py [] benjamin@bengfort.com $ """ SQLAlchemy models usin...
apache-2.0
cryptobanana/ansible
test/units/modules/remote_management/oneview/test_oneview_datacenter_facts.py
102
2754
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import pytest from oneview_module_loader import OneViewModuleBase from ansible.modules.remote_management.oneview.oneview_datacenter_facts import DatacenterFa...
gpl-3.0
mythmon/airmozilla
airmozilla/manage/tweeter.py
6
7934
import datetime import time import os import stat import logging import urlparse import twython from funfactory.urlresolvers import reverse from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.utils import timezone from django.contrib.sites.models import...
bsd-3-clause
ds-hwang/chromium-crosswalk
tools/perf/page_sets/key_mobile_sites_smooth.py
10
10804
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story from page_sets import key_mobile_site...
bsd-3-clause
geneontology/go-site
scripts/datasets.py
1
3549
#!/usr/bin/env python3 import click import yaml import glob import os import collections from typing import List, Dict Dataset = collections.namedtuple("Dataset", ["group", "dataset", "url", "type", "compression"]) @click.group() def cli(): pass @cli.command() @click.option("--datasets", "-d", "datasets_dir",...
bsd-3-clause
Coread/channels
channels/exceptions.py
2
2067
from __future__ import unicode_literals import six class ConsumeLater(Exception): """ Exception that says that the current message should be re-queued back onto its channel as it's not ready to be consumed yet (e.g. global order is being enforced) """ pass class ResponseLater(Exception): ...
bsd-3-clause
pigeonflight/strider-plone
docker/appengine/lib/django-1.5/django/contrib/humanize/tests.py
100
9960
from __future__ import unicode_literals import datetime try: import pytz except ImportError: pytz = None from django.conf import settings from django.contrib.humanize.templatetags import humanize from django.template import Template, Context, defaultfilters from django.test import TestCase from django.test.ut...
mit
MiLk/ansible
lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py
13
11112
#!/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...
gpl-3.0
olivierdalang/QGIS
python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py
31
11770
# -*- coding: utf-8 -*- """ *************************************************************************** ModelerParameterDefinitionDialog.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ******...
gpl-2.0
yangbowen/ECLDbg
scintilla/scripts/LexGen.py
16
5756
#!/usr/bin/env python # LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org # Released to the public domain. # Regenerate the Scintilla source files that list all the lexers. # Should be run whenever a new lexer is added or removed. # Requires Python 2.5 or later # Files are regenerated in place with temp...
mit
andela-ifageyinbo/django
tests/check_framework/tests_1_8_compatibility.py
138
1113
from django.core.checks.compatibility.django_1_8_0 import \ check_duplicate_template_settings from django.test import SimpleTestCase from django.test.utils import override_settings class CheckDuplicateTemplateSettingsTest(SimpleTestCase): def test_not_raised_if_no_templates_setting(self): self.assert...
bsd-3-clause
adarshp/ExoticHiggs
root_analysis/cut_n_count_analysis.py
1
2532
from math import sqrt import pandas as pd import subprocess as sp df = pd.DataFrame() for p in ['Signal', 'tt_fully_leptonic_including_taus', 'tt_semileptonic_including_taus', 'tttautau']: df_temp = pd.read_table(p+'/cuts.txt') df['Cut Name'] = df_temp['Cut Name'] df[p+ ' MC Events'] = df_temp['MC Even...
gpl-3.0
ilya-epifanov/ansible
lib/ansible/cli/playbook.py
12
7742
#!/usr/bin/env python # (c) 2012, 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 # (...
gpl-3.0
rs2/pandas
pandas/tests/series/methods/test_reset_index.py
1
4636
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, RangeIndex, Series import pandas._testing as tm class TestResetIndex: def test_reset_index(self): df = tm.makeDataFrame()[:5] ser = df.stack() ser.index.names = ["hash", "category"] ...
bsd-3-clause
jabesq/home-assistant
homeassistant/util/ruamel_yaml.py
12
4599
"""ruamel.yaml utility functions.""" import logging import os from os import O_CREAT, O_TRUNC, O_WRONLY, stat_result from collections import OrderedDict from typing import Union, List, Dict import ruamel.yaml from ruamel.yaml import YAML from ruamel.yaml.constructor import SafeConstructor from ruamel.yaml.error import...
apache-2.0
sshnaidm/ru
plugin.video.pokerstars.tv/bs4/builder/__init__.py
97
11088
from collections import defaultdict import itertools import sys from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, whitespace_re ) __all__ = [ 'HTMLTreeBuilder', 'SAXTreeBuilder', 'TreeBuilder', 'TreeBuilderRegistry', ] # Some useful features for a Tree...
gpl-2.0
zadgroup/edx-platform
common/djangoapps/track/tracker.py
239
2374
""" Module that tracks analytics events by sending them to different configurable backends. The backends can be configured using Django settings as the example below:: TRACKING_BACKENDS = { 'tracker_name': { 'ENGINE': 'class.name.for.backend', 'OPTIONS': { 'host': ... , ...
agpl-3.0
adelinesharla/CtrlVET
cadastro/views.py
1
26843
# -*- encoding: utf-8 -*- from django.shortcuts import render from django.conf.urls import url """Classes de views genericas utilizadas""" from django.views.generic import View, TemplateView, DetailView, UpdateView, DeleteView, ListView, FormView, RedirectView from django.views.generic.detail import SingleObjectMixin ...
gpl-3.0
TheMOOCAgency/edx-platform
lms/djangoapps/atp_task/tasks_helper.py
1
9556
import json import logging from StringIO import StringIO from collections import OrderedDict from datetime import datetime from itertools import chain from time import time import dogstats_wrapper as dog_stats_api import re import unicodecsv from celery import Task, current_task from celery.states import S...
agpl-3.0
minihays/AndisBookClub
lib/werkzeug/testapp.py
303
9398
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
apache-2.0
rebstar6/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/response.py
25
15877
from collections import OrderedDict from datetime import datetime, timedelta import Cookie import json import types import uuid import socket from constants import response_codes from logger import get_logger missing = object() class Response(object): """Object representing the response to a HTTP request :p...
mpl-2.0
Velociraptor85/pyload
module/plugins/hoster/BezvadataCz.py
8
2797
# -*- coding: utf-8 -*- import re from ..internal.SimpleHoster import SimpleHoster class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __version__ = "0.35" __status__ = "testing" __pattern__ = r'http://(?:www\.)?bezvadata\.cz/stahnout/.+' __config__ = [("activated...
gpl-3.0
jettang/googletest
scripts/common.py
1180
2919
# Copyright 2013 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 foll...
bsd-3-clause
thfield/sf-base-election-data
venv/lib/python3.4/site-packages/pip/vcs/__init__.py
87
10798
"""Handles all VCS (version control) support""" from __future__ import absolute_import import logging import os import shutil from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.exceptions import BadCommand from pip.utils import (display_path, backup_dir, find_command, rmtr...
bsd-3-clause
levkar/odoo
addons/website_forum/tests/test_forum.py
34
12014
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from .common import KARMA, TestForumCommon from ..models.forum import KarmaError from odoo.exceptions import UserError, AccessError from odoo.tools import mute_logger class TestForum(TestForumCommon): @mute_logger...
agpl-3.0
yotchang4s/cafebabepy
src/main/python/distutils/text_file.py
55
12483
"""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" import sys, io class TextFile: """Provides a file-like object that takes care of all the things you commonly wa...
bsd-3-clause
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/bsddb/test/test_db.py
72
5796
import unittest import os, glob from test_all import db, test_support, get_new_environment_path, \ get_new_database_path #---------------------------------------------------------------------- class DB(unittest.TestCase): def setUp(self): self.path = get_new_database_path() self.db = db.D...
gpl-3.0
joyeshmishra/spark-tk
python/sparktk/tkcontext.py
5
19167
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
myarjunar/QGIS
python/plugins/MetaSearch/pavement.py
6
7465
from future import standard_library standard_library.install_aliases() from builtins import str # -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com) # # This source is free software; you can redistribute it an...
gpl-2.0
Levis0045/MetaLex
build/lib.linux-x86_64-2.7/metalex/plugins/ocropy/ocrolib/morph.py
4
10555
################################################################ ### various add-ons to the SciPy morphology package ################################################################ from __future__ import print_function from numpy import * import pylab from pylab import * from scipy.ndimage import morphology,measurem...
agpl-3.0
SamYaple/neutron
neutron/agent/metadata/namespace_proxy.py
18
7068
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
eonpatapon/neutron
neutron/tests/functional/agent/linux/test_ebtables_driver.py
14
5371
# Copyright (c) 2015 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
telerik/cloudbase-init
cloudbaseinit/tests/plugins/windows/test_sethostname.py
1
2266
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions Srl # # 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/LICEN...
apache-2.0
vybstat/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
276
3790
# Authors: Lars Buitinck <L.J.Buitinck@uva.nl> # Dan Blanchard <dblanchard@ets.org> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from numpy.testing import assert_array_equal from sklearn.utils.testing import (assert_equal, assert_in, ...
bsd-3-clause
mbolivar/zephyr
scripts/sanity_chk/harness.py
2
2565
import re from collections import OrderedDict class Harness: def __init__(self): self.state = None self.type = None self.regex = [] self.matches = OrderedDict() self.ordered = True self.repeat = 1 self.tests = {} self.id = None self.fail_on_fa...
apache-2.0
daitangio/pyblosxom
Pyblosxom/plugins/readmore.py
2
6023
####################################################################### # This file is part of Pyblosxom. # # Copyright (c) 2010 Menno Smits # Copyright (c) 2011 Will Kahn-Greene # # Pyblosxom is distributed under the MIT license. See the file # LICENSE for distribution details. #######################################...
mit
rbreitenmoser/snapcraft
snapcraft/tests/test_commands_strip.py
1
6703
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
sitsbeyou/Misago
misago/core/tests/test_testmailsetup.py
8
1526
from django.core import mail from django.test import TestCase from django.utils.six import StringIO from misago.core.management.commands import testemailsetup class TestEmailSetupTests(TestCase): def test_email_setup(self): """command sets test email in outbox""" command = testemailsetup.Command(...
gpl-2.0
PRIMEDesigner15/PRIMEDesigner15
dependencies/Lib/test/unittests/inspect_fodder2.py
179
1419
# line 1 def wrap(foo=None): def wrapper(func): return func return wrapper # line 7 def replace(func): def insteadfunc(): print('hello') return insteadfunc # line 13 @wrap() @wrap(wrap) def wrapped(): pass # line 19 @replace def gone(): pass # line 24 oll = lambda m: m # lin...
bsd-3-clause
molobrakos/home-assistant
homeassistant/components/qbittorrent/sensor.py
7
4234
"""Support for monitoring the qBittorrent API.""" import logging import voluptuous as vol from requests.exceptions import RequestException from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, CONF_PASSWORD, CONF_URL, CONF_USERNAME, STATE_IDLE) from homeassistan...
apache-2.0
trondhindenes/ansible-modules-core
network/netvisor/pn_show.py
30
5302
#!/usr/bin/python """ PN CLI show commands """ # # 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 ver...
gpl-3.0
eLBati/l10n-switzerland
__unported__/l10n_ch_credit_control_payment_slip_report/account.py
4
1477
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
JeremyGrosser/scrobbleshark
scrobbleshark.py
1
2564
from time import time, mktime from hashlib import md5 from urllib import urlopen, urlencode import simplejson as json import feedparser import sys class APIException(Exception): pass class LastFM(object): def __init__(self, username, password): self.session = None self.nowplaying = None se...
bsd-3-clause
martinwicke/tensorflow
tensorflow/python/util/net_lib_test.py
23
1298
# 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
Araneidae/cothread
context/tests/bigtest.py
3
1433
from __future__ import print_function import time import sys, os sys.path.append( os.path.join(os.path.dirname(__file__), '../..')) from cothread.catools import * version_pvs = [ 'VERSION', 'BUILD', 'EPICS', 'COMPILER', 'LIBRARY', # These are extracted from environment variables 'ABI...
gpl-2.0
Beauhurst/django
django/core/serializers/python.py
7
7474
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from collections import OrderedDict from django.apps import apps from django.core.serializers import base from django.db import ...
bsd-3-clause
eduNEXT/edx-platform
openedx/core/djangoapps/oauth_dispatch/views.py
4
4657
""" Views that dispatch processing of OAuth requests to django-oauth2-provider or django-oauth-toolkit as appropriate. """ import json from django.conf import settings from django.utils.decorators import method_decorator from django.views.generic import View from edx_django_utils import monitoring as monitoring_util...
agpl-3.0
vmindru/ansible
lib/ansible/modules/cloud/pubnub/pubnub_blocks.py
47
23812
#!/usr/bin/python # # PubNub Real-time Cloud-Hosted Push API and Push Notification Client # Frameworks # Copyright (C) 2016 PubNub Inc. # http://www.pubnub.com/ # http://www.pubnub.com/terms # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_i...
gpl-3.0
ondra-novak/chromium.src
chrome/common/extensions/docs/server2/api_list_data_source.py
7
4936
# 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. from data_source import DataSource from future import Future from operator import itemgetter from platform_util import GetPlatforms from docs_server_uti...
bsd-3-clause
nonemaw/pynet
pyth_ans_ecourse/class8/ex7_processes_show_ver.py
3
1524
#!/usr/bin/env python ''' Use processes and Netmiko to connect to each of the devices in the database. Execute 'show version' on each device. Record the amount of time required to do this. ''' from netmiko import ConnectHandler from datetime import datetime from net_system.models import NetworkDevice import django f...
gpl-2.0
64studio/smart
smart/util/elementtree/SgmlopXMLTreeBuilder.py
107
3209
# # ElementTree # $Id$ # # A simple XML tree builder, based on the sgmlop library. # # Note that this version does not support namespaces. This may be # changed in future versions. # # history: # 2004-03-28 fl created # # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # ht...
gpl-2.0
dotbot-io/webapp
app/api_1_0/compile.py
1
1355
from . import api from ..models import Node from compiler import Compiler from flask_json import JsonError, json_response from flask import Response, request from flask_json import JsonError, json_response, as_json comp = Compiler(); @api.route('/catkin') def catkin(): comp.catkin() return Response(comp.read_buid...
gpl-2.0
pepincho/HackBulgaria
Algo-1/week1/5-Sorting-Python/quick_sort.py
2
2259
# Quicksort (sometimes called partition-exchange sort) # is an efficient sorting algorithm # When implemented well, it can be about two or three times faster # than its main competitors, merge sort and heapsort. # Quicksort is a comparison sort, meaning that it can sort items of any type # for which a "less-than" rel...
mit
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/stat/cluster/clusterinstance_stats.py
1
5548
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
lirokoa/android_kernel_samsung_smdk4412
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
wechasing/tornado
tornado/iostream.py
48
64906
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
xbmcmegapack/plugin.video.megapack.dev
resources/lib/menus/home_countries_macao.py
1
1107
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.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 Softwar...
gpl-3.0
LarsFronius/ansible
lib/ansible/modules/cloud/google/gce_mig.py
43
30528
#!/usr/bin/python # Copyright 2016 Google Inc. # # 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 vers...
gpl-3.0