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 |
|---|---|---|---|---|---|
kholidfu/django | tests/template_tests/filter_tests/test_addslashes.py | 473 | 1202 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
derDavidT/sympy | sympy/series/series_class.py | 89 | 3031 | """
Contains the base class for series
Made using sequences in mind
"""
from __future__ import print_function, division
from sympy.core.expr import Expr
from sympy.core.singleton import S
from sympy.core.cache import cacheit
from sympy.core.compatibility import integer_types
class SeriesBase(Expr):
"""Base Clas... | bsd-3-clause |
kastnerkyle/protobuf-py3 | python/google/protobuf/descriptor.py | 228 | 26625 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
mic4ael/indico | indico/modules/events/roles/forms.py | 1 | 2102 | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from wtforms.fields.core import BooleanField, StringField
from wt... | mit |
shahar-stratoscale/nova | nova/tests/test_instance_types_extra_specs.py | 20 | 5676 | # Copyright 2011 University of Southern California
# 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 appl... | apache-2.0 |
ovnicraft/server-tools | server_environment/serv_config.py | 2 | 8696 | # -*- coding: utf-8 -*-
##############################################################################
#
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
# Based on Florent Xicluna original code. Copyright Wingo SA
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
play113/swer | opencamlib-read-only/scripts/waterline/waterline_1_tux.py | 7 | 2586 | import ocl
import camvtk
import time
import vtk
import datetime
import math
if __name__ == "__main__":
print ocl.revision()
myscreen = camvtk.VTKScreen()
#stl = camvtk.STLSurf("../../stl/demo.stl")
stl = camvtk.STLSurf("../../stl/gnu_tux_mod.stl")
myscreen.addActor(stl)
stl.SetWirefra... | mit |
hip-odoo/odoo | addons/mail/models/mail_alias.py | 22 | 12189 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import unicodedata
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools import ustr
from odoo.tools.safe_eval import safe_eval
_logger = logging.g... | agpl-3.0 |
Salat-Cx65/python-for-android | python3-alpha/python3-src/Tools/scripts/ftpmirror.py | 49 | 13088 | #! /usr/bin/env python3
"""Mirror a remote ftp subtree into a local directory tree.
usage: ftpmirror [-v] [-q] [-i] [-m] [-n] [-r] [-s pat]
[-l username [-p passwd [-a account]]]
hostname[:port] [remotedir [localdir]]
-v: verbose
-q: quiet
-i: interactive mode
-m: macintosh server (N... | apache-2.0 |
howthebodyworks/pelican-plugins | bootstrap-rst/directives.py | 17 | 16715 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Bootstrap RST
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
from ... | agpl-3.0 |
openstack/poppy | scripts/providers/akamai/list_edgehostnames.py | 3 | 3268 | # Copyright (c) 2014 Rackspace, 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 wr... | apache-2.0 |
gabriel-laet/graphql-py | tests/core_starwars/test_validation.py | 6 | 2221 | from graphql.core.language.source import Source
from graphql.core.language.parser import parse
from graphql.core.validation import validate
from starwars_schema import StarWarsSchema
def validation_errors(query):
source = Source(query, 'StarWars.graphql')
ast = parse(source)
return validate(StarWarsSchema... | mit |
HiDevLab/shopifier | shopifier/admin/migrations/0003_auto_20161221_1920.py | 2 | 2557 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-12-21 13:20
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import shopifier.admin.models
class Migration(migrations.Migration):
dependencies ... | bsd-3-clause |
LumaPictures/rez | src/rez/vendor/unittest2/__init__.py | 9 | 2494 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... | lgpl-3.0 |
thiagomagero/namebench | libnamebench/config_test.py | 173 | 2083 | #!/usr/bin/env 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... | apache-2.0 |
pabulumm/neighbors | lib/python3.4/site-packages/django/core/management/commands/runserver.py | 203 | 7383 | from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp i... | bsd-3-clause |
GbalsaC/bitnamiP | pyfs/fs/remote.py | 7 | 26814 | """
fs.remote
=========
Utilities for interfacing with remote filesystems
This module provides reusable utility functions that can be used to construct
FS subclasses interfacing with a remote filesystem. These include:
* RemoteFileBuffer: a file-like object that locally buffers the contents of
... | agpl-3.0 |
grap/account-financial-tools | __unported__/account_partner_required/__init__.py | 46 | 1056 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account partner required module for OpenERP
# Copyright (C) 2014 Acsone (http://acsone.eu).
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can redistribu... | agpl-3.0 |
crepererum/invenio-demosite | invenio_demosite/testsuite/web/test_websearch.py | 7 | 1551 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2011, 2012 CERN.
#
# Invenio Demosite 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
# License, or (a... | gpl-2.0 |
UCL/sfdata_collector | sfdata_collector/sfdata_collector.py | 1 | 6933 | __author__ = "Gregory D. Erhardt"
__copyright__ = "Copyright 2013 SFCTA"
__license__ = """
This file is part of sfdata_collector.
sfdata_collector 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 Fo... | gpl-3.0 |
jordanemedlock/psychtruths | temboo/core/Library/Facebook/Deleting/DeleteStatus.py | 5 | 3261 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeleteStatus
# Deletes a specified status message from the authenticated user's feed.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | apache-2.0 |
patrickhartling/protobuf | python/google/protobuf/reflection.py | 223 | 6594 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
sholtebeck/knarflog | lib/jinja2/filters.py | 89 | 36528 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
import random
import warnings
from itertools import groupby, chain
from collections import namedtuple
fro... | apache-2.0 |
3dfxmadscientist/odoo_vi | addons/account/account_cash_statement.py | 44 | 15402 | # encoding: utf-8
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
hickford/youtube-dl | youtube_dl/extractor/internetvideoarchive.py | 146 | 3475 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse,
)
from ..utils import (
xpath_with_ns,
)
class InternetVideoArchiveIE(InfoExtractor):
_VALID_URL = r'https?://video\.internetvideoarchive\.net/flash/player... | unlicense |
lekum/ansible | v1/ansible/module_common.py | 83 | 8039 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
johnchase/scikit-bio | skbio/diversity/alpha/_base.py | 3 | 21609 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
omab/django-tcms | example/tcms_pages/testpage/__init__.py | 1 | 1550 | from tcms.data_types import BigText, Text, Image
from tcms.tpl import Page, Several, Section, Single, Value
class SimpleText(Section):
NAME = 'Simple text'
DESCRIPTION = 'Single line text, useful for titles'
template = 'tcms/simple.html'
def set_fields(self, template=None):
self['text'] = Sin... | bsd-3-clause |
zetalog/linux | tools/testing/kunit/kunit.py | 181 | 11437 | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
#
# A thin wrapper on top of the KUnit Kernel
#
# Copyright (C) 2019, Google LLC.
# Author: Felix Guo <felixguoxiuping@gmail.com>
# Author: Brendan Higgins <brendanhiggins@google.com>
import argparse
import sys
import os
import time
from collections import nam... | gpl-2.0 |
yangming85/lettuce | tests/integration/lib/Django-1.2.5/django/http/__init__.py | 50 | 17449 | import os
import re
from Cookie import BaseCookie, SimpleCookie, CookieError
from pprint import pformat
from urllib import urlencode
from urlparse import urljoin
try:
# The mod_python version is more efficient, so try importing it first.
from mod_python.util import parse_qsl
except ImportError:
from cgi imp... | gpl-3.0 |
wagnerand/addons-server | src/olympia/amo/tests/test_pagination.py | 4 | 5085 | from django.core.paginator import EmptyPage, InvalidPage, PageNotAnInteger, Paginator
import pytest
from unittest.mock import MagicMock, Mock
from olympia.addons.models import Addon
from olympia.amo.pagination import ESPaginator
from olympia.amo.templatetags.jinja_helpers import PaginationRenderer
from olympia.amo.t... | bsd-3-clause |
nitzmahone/ansible | contrib/inventory/packet_net.py | 27 | 18109 | #!/usr/bin/env python
'''
Packet.net external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
Packet.net using the Packet library.
NOTE: This script assumes Ansible is being executed where the environment
variable needed for Packet API Token... | gpl-3.0 |
wazeerzulfikar/scikit-learn | sklearn/mixture/tests/test_bayesian_mixture.py | 84 | 17929 | # Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy.special import gammaln
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_almost_equal
from sklearn.mixture.bayesian... | bsd-3-clause |
OpenAcademy-OpenStack/nova-scheduler | tools/config/analyze_opts.py | 41 | 2794 | #!/usr/bin/env python
# Copyright (c) 2012, Cloudscaling
# 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... | apache-2.0 |
openstack/smaug | karbor/services/protection/protection_plugin.py | 1 | 5350 | # 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
# distrib... | apache-2.0 |
NUKnightLab/cityhallmonitor | cityhallmonitor/admin.py | 1 | 3207 | from django.contrib import admin
from django.db.models import F
from cityhallmonitor.models import \
Person, BodyType, Body, \
MatterAttachment, MatterStatus, MatterType, Matter, \
MatterSponsor, Subscription, Document
class DirtyFieldsAdmin(admin.ModelAdmin):
readonly_fields = ('created_at', 'upd... | mit |
thechampanurag/django-oscar | src/oscar/management/commands/create_demo_products.py | 39 | 1272 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from oscar.apps.partner.importers import DemoSiteImporter
class Command(BaseCommand):
args = '/path/to/file1.csv /path/to/file2.csv ...'
help = 'For creating product catalogues based on a CSV fi... | bsd-3-clause |
StealthMicro/OctoPi-Makerbot | env/Lib/site-packages/werkzeug/test.py | 77 | 32616 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import urlparse
import mimetypes
from time ... | agpl-3.0 |
eunchong/build | third_party/jinja2/jinja2/optimizer.py | 1401 | 2302 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... | bsd-3-clause |
Reflexe/doc_to_pdf | Windows/program/python-core-3.5.0/lib/_compression.py | 54 | 5340 | """Internal classes used by the gzip, lzma and bz2 modules"""
import io
BUFFER_SIZE = io.DEFAULT_BUFFER_SIZE # Compressed data read chunk size
class BaseStream(io.BufferedIOBase):
"""Mode-checking helper functions."""
def _check_not_closed(self):
if self.closed:
raise ValueError("I/O ... | mpl-2.0 |
ChenJunor/hue | desktop/core/ext-py/boto-2.38.0/boto/glacier/layer1.py | 121 | 60796 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal ... | apache-2.0 |
NeilBryant/check_mk | livestatus/api/python/make_nagvis_map.py | 6 | 3599 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
mbauskar/Das_Erpnext | erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py | 87 | 8747 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
"""
Import chart of accounts from OpenERP sources
"""
from __future__ import unicode_literals
import os, json
import ast
from xml.etree import ElementTree as ET
from frappe.utils.csvutils imp... | agpl-3.0 |
sathieu/samba | buildtools/wafsamba/symbols.py | 11 | 22082 | # a waf tool to extract symbols from object files or libraries
# using nm, producing a set of exposed defined/undefined symbols
import os, re, subprocess
import Utils, Build, Options, Logs
from Logs import debug
from samba_utils import TO_LIST, LOCAL_CACHE, get_tgt_list, os_path_relpath
# these are the data structure... | gpl-3.0 |
antar2801/namebench | tools/add_linkcount_and_version_to_csv.py | 174 | 1351 | #!/usr/bin/env 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... | apache-2.0 |
108coin/108coin | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
gc3-uzh-ch/elasticluster | elasticluster/__main__.py | 1 | 8515 | #! /usr/bin/env python
#
# Copyright (C) 2013-2019 University of Zurich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/vimeo.py | 3 | 43282 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
InAdvancePagedList,
int_or_none,
... | gpl-3.0 |
jesramirez/odoo | addons/base_import/__openerp__.py | 317 | 1227 | {
'name': 'Base import',
'description': """
New extensible file import for OpenERP
======================================
Re-implement openerp's file import system:
* Server side, the previous system forces most of the logic into the
client which duplicates the effort (between clients), makes the
import s... | agpl-3.0 |
maxsocl/django | tests/template_tests/filter_tests/test_make_list.py | 345 | 1611 | from django.template.defaultfilters import make_list
from django.test import SimpleTestCase
from django.test.utils import str_prefix
from django.utils.safestring import mark_safe
from ..utils import setup
class MakeListTests(SimpleTestCase):
"""
The make_list filter can destroy existing escaping, so the resu... | bsd-3-clause |
akashsinghal/Speech-Memorization-App | speech/Swift/Speech-gRPC-Streaming/env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 1778 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# 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.1 of the License, or (at your option) any later ve... | apache-2.0 |
brack3t/django-heythere | heythere/models.py | 1 | 5353 | from __future__ import absolute_import
import ast
from django.conf import settings as django_settings
from django.core.mail import send_mail, send_mass_mail
from django.db import models
from django.utils.functional import lazy
from django.utils.timezone import now
from .settings import get_notifications
from .utils ... | bsd-3-clause |
ver007/stem-1.4.1 | stem/interpreter/autocomplete.py | 13 | 3024 | # Copyright 2014-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Tab completion for our interpreter prompt.
"""
from stem.interpreter import uses_settings
try:
# added in python 3.2
from functools import lru_cache
except ImportError:
from stem.util.lru_cache import lru_cach... | lgpl-3.0 |
lulandco/SickRage | lib/mako/filters.py | 39 | 6003 | # mako/filters.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import re
import codecs
from mako.compat import quote_plus, unquote_plus, codepoint2name, \
... | gpl-3.0 |
nicescale/scripts | lib/cros_build_lib_unittest.py | 17 | 4674 | #!/usr/bin/python
#
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for cros_build_lib."""
import mox
import os
import tempfile
import unittest
import cros_build_lib
class CrosBuild... | bsd-3-clause |
armada-ai/esp-idf | tools/tiny-test-fw/TestCase.py | 9 | 1984 | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# 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 |
annarev/tensorflow | tensorflow/python/tpu/session_support.py | 10 | 15206 | # 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 |
pkoutsias/SickRage | lib/github/IssueComment.py | 72 | 5924 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
hamiltont/CouchPotatoServer | couchpotato/core/providers/torrent/thepiratebay/main.py | 7 | 4532 | from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentMagnetProvider
import re
import traceback
log = CPLog(__name__)
... | gpl-3.0 |
knowsWhereHisTowelIs/pi-pyth-serv-socketio | lib/python3.5/site-packages/pip/_vendor/requests/adapters.py | 356 | 19740 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib... | mit |
nikhilprathapani/python-for-android | python3-alpha/python3-src/Lib/test/test_platform.py | 54 | 9918 | import sys
import os
import unittest
import platform
import subprocess
from test import support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
@support.skip_unless_symlink
def test_architecture_via_symlink(self): # issue3762
# On Windows,... | apache-2.0 |
endlessm/chromium-browser | third_party/llvm/lldb/test/API/functionalities/memory/find/TestMemoryFind.py | 8 | 2205 | """
Test the 'memory find' command.
"""
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.decorators import *
class MemoryFindTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
... | bsd-3-clause |
factorlibre/OCB | addons/hw_proxy/__init__.py | 1894 | 1075 | # -*- 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... | agpl-3.0 |
kemalakyol48/python-for-android | python3-alpha/python3-src/Lib/test/test_richcmp.py | 57 | 11070 | # Tests for rich comparisons
import unittest
from test import support
import operator
class Number:
def __init__(self, x):
self.x = x
def __lt__(self, other):
return self.x < other
def __le__(self, other):
return self.x <= other
def __eq__(self, other):
return self... | apache-2.0 |
davnym-4/Survive | SurviveEvolve.py | 1 | 2618 | import SurviveActions, SurviveAuto, SurviveGame
import copy, random, threading
mutation_chance = 0.05
population = 100
generations = 30
tries = 10
class Individual(object):
def __init__(self, generation=0):
self.hiscore = (0, 0)
self.generation = generation
self.DNA = []
... | mit |
Russell-IO/ansible | test/runner/lib/sanity/ansible_doc.py | 14 | 3496 | """Sanity test for ansible-doc."""
from __future__ import absolute_import, print_function
import re
from lib.sanity import (
SanityMultipleVersion,
SanityFailure,
SanitySuccess,
SanitySkipped,
SanityMessage,
)
from lib.util import (
SubprocessError,
display,
intercept_command,
)
from... | gpl-3.0 |
secdev/scapy | scapy/contrib/modbus.py | 2 | 35200 | # coding: utf8
# This file is part of Scapy
# Scapy 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 License, or
# any later version.
#
# Scapy is distributed in the hope that it will b... | gpl-2.0 |
zstackio/zstack-woodpecker | integrationtest/vm/multihosts/local_shared/test_local_shared_vm_ha.py | 2 | 3258 | '''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import os
import zstackwoodpecker.operations.primarystorage_operations as ps_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import... | apache-2.0 |
pjreed/catkin_tools | catkin_tools/verbs/catkin_locate/cli.py | 5 | 5481 | # Copyright 2015 Open Source Robotics Foundation, 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... | apache-2.0 |
Flourish-Team/Flourish | 3rdParty/googletest/test/gtest_xml_test_utils.py | 15 | 9217 | # Copyright 2006, 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... | mit |
helldorado/ansible | lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py | 5 | 18016 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
adaxi/couchpotato | libs/suds/reader.py | 202 | 5243 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
wiki05/youtube-dl | youtube_dl/extractor/rtbf.py | 92 | 1976 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
unescapeHTML,
)
class RTBFIE(InfoExtractor):
_VALID_URL = r'https?://www.rtbf.be/video/[^\?]+\?id=(?P<id>\d+)'
_TEST = {
'url': 'https://www.rtbf.be/video/detail_les-di... | unlicense |
sohonetlabs/python-swiftclient | tests/unit/test_service.py | 1 | 118184 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 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 appl... | apache-2.0 |
40223226/W17test2 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_loader.py | 738 | 49593 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | gpl-3.0 |
parheliamm/i939u2 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
Syfaro/MinecraftSession | minecraftsession.py | 1 | 3127 | import urllib2
import json
class MinecraftSession:
username = None
access_token = None
profile_id = None
client_token = None
def login(self, username, password, clientToken = False):
"""Logs into the Mojang auth servers.
Set clientToken if you want to be able to refresh the session.
"""
da... | gpl-2.0 |
sebastien-forestier/explaupoppydiva | scripts/arm_diva/test_analysis.py | 1 | 7661 | import cPickle
import matplotlib.pyplot as plt
from numpy import array, mean, std, sqrt
import os
import sys
from explaupoppydiva.drawer import Drawer
logs = os.getenv('HOME') + '/scm/Flowers/explaupoppydiva/logs/'
log_dirs = [
'2015-05-27_11-51-43-ARM-DIVA',
#'2015-05-26_20-59-31-ARM-DIVA',
]
conditions... | gpl-3.0 |
ghostsp15/Fort-Nitta | backend/api/game_info.py | 2 | 1647 | ## @package game_info.py
# Used to bundle together information about a specific game
from flask import request, jsonify
from flask.views import MethodView
from sqlalchemy import and_
from flask.ext.login import current_user
from backend.api.sessionauth import current_user_props
from backend import db, app
fro... | mit |
samrussell/ryu | ryu/lib/packet/ethernet.py | 1 | 1964 | # Copyright (C) 2012 Nippon Telegraph and Telephone 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 required by appli... | apache-2.0 |
harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gcutil/lib/python_gflags/gflags_validators.py | 24 | 6927 | #!/usr/bin/env python
# Copyright (c) 2010, 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 l... | gpl-3.0 |
pradyu1993/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 5 | 1781 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print __doc__
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn im... | bsd-3-clause |
salivatears/ansible | lib/ansible/playbook/role/include.py | 97 | 1891 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
forseti-security/forseti-security | google/cloud/forseti/scanner/scanners/config_validator_util/validator_pb2_grpc.py | 1 | 7042 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import validator_pb2 as validator__pb2
class ValidatorStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__... | apache-2.0 |
patrickrolanddg/jaikuengine | common/test/user.py | 30 | 2821 | # Copyright 2010 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 agreed to in writing, ... | apache-2.0 |
CaptFrank/firewalld | src/firewall/core/io/io_object.py | 3 | 10963 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2012 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@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 Foundation; either version 2 of the Li... | gpl-2.0 |
pombredanne/0install | zeroinstall/gtkui/gtkutils.py | 7 | 5663 | """Useful utility methods for GTK."""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import gtk
import sys
from zeroinstall.support import tasks
from zeroinstall import _
class Template(object):
"""Wrapper for GtkBuilder widget tree that throws a sensible excep... | lgpl-2.1 |
ity/pants | tests/python/pants_test/util/test_argutil.py | 15 | 1850 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
fro... | apache-2.0 |
atyenoria/vitess | py/vtdb/keyrange.py | 13 | 2142 | # Copyright 2013, 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.
"""Contains the definition of the KeyRange object.
"""
from bson import codec
from vtdb import dbexceptions
from vtdb import keyrange_constants
class KeyRange(code... | bsd-3-clause |
persandstrom/home-assistant | homeassistant/components/switch/switchbot.py | 3 | 1989 | """
Support for Switchbot.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.switchbot
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.switch import SwitchDevice, PLATFO... | apache-2.0 |
Lh4cKg/brython | www/src/Lib/sre_compile.py | 630 | 16898 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import sys
import _sre
import sre_parse
from sre_constan... | bsd-3-clause |
python-hospital/hospital | tests/assertions/networking.py | 1 | 1275 | # -*- coding: utf-8 -*-
"""Unit tests around :mod:`hospital.assertions.networking`."""
import unittest
from hospital.assertions import networking
class AssertPingTestCase(unittest.TestCase):
"""Tests around :func:`hospital.assertions.networking.assert_ping`."""
def test_timeout_error(self):
"""assert... | bsd-3-clause |
gwAdvNet2015/adv-net-samples | sdn/pox/pox/openflow/__init__.py | 32 | 10749 | # Copyright 2011 James McCauley
#
# 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... | mit |
Erotemic/hotspotter | hstpl/extern_feat/graveyard_extern_feat.py | 2 | 20011 | from __future__ import division, print_function
import subprocess
import numpy as np
import os, sys
from os.path import dirname, realpath, join
from PIL import Image
from numpy import uint8, float32
#import threading
#__hesaff_lock = threading.Lock()
def reload_module():
import imp
import sys
imp.reload(sy... | apache-2.0 |
F5Networks/f5-common-python | f5/bigip/tm/asm/attack_types.py | 1 | 2238 | # coding=utf-8
#
# Copyright 2015-2016 F5 Networks 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... | apache-2.0 |
XiaosongWei/crosswalk-test-suite | webapi/tct-webdatabase-w3c-tests/inst.wgt.py | 372 | 6809 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
ashhher3/pattern | pattern/web/pdf/pdfdevice.py | 56 | 5319 | #!/usr/bin/env python2
import sys
from utils import mult_matrix, translate_matrix
from utils import enc, bbox2str
from pdffont import PDFUnicodeNotDefined
## PDFDevice
##
class PDFDevice(object):
debug = 0
def __init__(self, rsrcmgr):
self.rsrcmgr = rsrcmgr
self.ctm = None
return
... | bsd-3-clause |
wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/.install/.backup/lib/googlecloudsdk/core/util/platforms_install.py | 4 | 9371 | # Copyright 2015 Google Inc. All Rights Reserved.
"""Utilities for configuring platform specific installation."""
import os
import re
import shutil
from googlecloudsdk.core.util import platforms
from googlecloudsdk.core.console import console_io
from googlecloudsdk.core.credentials import gce as c_gce
# pylint:dis... | apache-2.0 |
ychen820/microblog | flask/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py | 25 | 17884 | # engine/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
The engine pa... | bsd-3-clause |
GreatFruitOmsk/snakefood | test/test_double.py | 2 | 1294 | """
Test using two dots in import syntax
Reporter: Dan Fayette (fayetted at gmail), on 2012-07-26
>>> Anyway, I found a problem where sfood-imports would choke on a
>>> unittest file (not named with a .py extension).
>>>
>>> in find.py I added this at line 93:
>>> if ast is None:
>>> return
>>>
>>> And t... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.