repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
AthinaB/synnefo | snf-astakos-app/astakos/im/migrations/0030_auto__del_field_astakosuser_provider__del_field_astakosuser_third_part.py | 10 | 27531 | # 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):
# Deleting field 'AstakosUser.provider'
db.delete_column('im_astakosuser', 'provider')
# Deleting... | gpl-3.0 |
themagpimag/magpi-api | flaskstuff/werkzeug/testsuite/__init__.py | 76 | 4086 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite
~~~~~~~~~~~~~~~~~~
Contains all test Werkzeug tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import unittest
from werkzeug.utils import import_string, find_module... | mit |
jeasoft/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py | 384 | 2324 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
JuezUN/INGInious | inginious/frontend/plugins/analytics/__init__.py | 1 | 1875 | import os
from inginious.frontend.plugins.utils import create_static_resource_page
from .api.stacked_bar_plot_api import StackedBarPlotAPI
from .pages.analytics import AnalyticsPage
from .api.analytics import AnalyticsAPI
from .api.calendar_plot_api import CalendarPlotAPI
from .api.time_series_plot_api import TimeSeri... | agpl-3.0 |
sabi0/intellij-community | python/lib/Lib/trace.py | 90 | 29112 | #!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | apache-2.0 |
msarahan/bokeh | scripts/test_matrix.py | 34 | 7005 | from __future__ import print_function
import argparse
import os
import shutil
import subprocess
import textwrap
def get_parser():
"""Create the parser that will be used to add arguments to the script.
"""
parser = argparse.ArgumentParser(description=textwrap.dedent("""
Creates conda ... | bsd-3-clause |
jroltgen/aqua-gesture-framework | samples/SampleGesture/scons-local-1.3.0/SCons/Tool/MSCommon/netframework.py | 5 | 2844 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | gpl-3.0 |
atdaemon/pip | pip/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | mit |
40023154/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-2.0 |
morreene/tradenews | venv/Lib/site-packages/sqlalchemy/dialects/mssql/mxodbc.py | 36 | 3856 | # mssql/mxodbc.py
# Copyright (C) 2005-2016 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
"""
.. dialect:: mssql+mxodbc
:name: mxODBC
:dbapi: mxodbc
:connectstrin... | bsd-3-clause |
chase-qi/workload-automation | wlauto/core/entry_point.py | 5 | 3530 | # Copyright 2013-2015 ARM Limited
#
# 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 w... | apache-2.0 |
raymondxyang/tensorflow | tensorflow/examples/get_started/regression/linear_regression.py | 8 | 3291 | # 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 |
bksim/chinese-translation | nltk/classify/megam.py | 5 | 6265 | # Natural Language Toolkit: Interface to Megam Classifier
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A set of functions used to interface with the external megam_ maxent
optimization packa... | apache-2.0 |
proekt-po-python/Snooker-master-proekt-po-python | settings.py | 1 | 1813 | """Настройки на топките"""
WHITE = (255, 255, 255)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
GREEN = (0, 128, 0)
BROWN = (139, 69, 19)
BLUE = (0, 0, 250)
PINK = (250, 20, 147)
BLACK = (0, 0, 0)
POS_RED1 = (320, 287)
POS_RED2 = (306, 279)
POS_RED3 = (306, 296)
POS_RED4 = (292, 271)
POS_RED5 = (292, 288)
POS_RED6 = (292, ... | gpl-3.0 |
kakkojc/DIE | DIE/Lib/IDAConnector.py | 9 | 7909 | import sark
import idc
import idaapi
import idautils
import re
from sark.debug import Registers
################################################################
#
# IDA Connector is a utility the wraps around IDA SDK.
# It publishes convenience functions used to query and edit data
# from IDA.
#
#########... | mit |
nave91/dbt | dbt/task/serve.py | 1 | 1050 | import shutil
import os
import webbrowser
from socketserver import TCPServer
from dbt.include import DOCS_INDEX_FILE_PATH
from dbt.compat import SimpleHTTPRequestHandler
from dbt.logger import GLOBAL_LOGGER as logger
from dbt.task.base_task import RunnableTask
class ServeTask(RunnableTask):
def run(self):
... | apache-2.0 |
Naereen/notebooks | Py_Pi_Day_2017.py | 1 | 42588 |
# coding: utf-8
# # Table of Contents
# <p><div class="lev1 toc-item"><a href="#Python-Pi-Day-2017" data-toc-modified-id="Python-Pi-Day-2017-1"><span class="toc-item-num">1 </span>Python Pi Day 2017</a></div><div class="lev1 toc-item"><a href="#Computing-a-lot-of-digits-of-$\pi$?" data-toc-modified-id="Co... | mit |
electrolinux/pootle | tests/fixtures/models/translation_project.py | 5 | 2021 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
def _r... | gpl-3.0 |
vybstat/scikit-learn | examples/linear_model/plot_ard.py | 248 | 2622 | """
==================================================
Automatic Relevance Determination Regression (ARD)
==================================================
Fit regression model with Bayesian Ridge Regression.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary l... | bsd-3-clause |
sagaruprety/Stopwatch | stopwatch.py | 1 | 2634 | #!usr/bin/python
# Created by Sagar Uprety at Bengaluru, India on May 14th, 2016.
# This is a simple stopwatch utility implemented as shell. Can be used in absence of a smartphone/smartwatch.
# Run this file using the python command and then see the list of commands to proceed.
# Any comments/suggestions/feedback is w... | mit |
figment/falloutsnip | Vendor/IronPython/Lib/distutils/text_file.py | 204 | 12410 | """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."""
__revision__ = "$Id$"
import sys
class TextFile:
"""Provides a file-like object that takes care of all the things yo... | gpl-3.0 |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## 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 ... | gpl-2.0 |
sathieu/samba | buildtools/wafsamba/samba_install.py | 10 | 8530 | ###########################
# this handles the magic we need to do for installing
# with all the configure options that affect rpath and shared
# library use
import os
import Utils
from TaskGen import feature, before, after
from samba_utils import LIB_PATH, MODE_755, install_rpath, build_rpath
@feature('install_bin')... | gpl-3.0 |
jgcobb3/growth-yield-batch | scripts/build_keys.py | 2 | 6669 | #!/usr/bin/env python
"""build_keys.py
Construct key files from project directory containing Rx and Condition data.
See https://github.com/Ecotrust/growth-yield-batch#building-the-batch-directory-structure-from-base-data
for details on how to set up your project directory (example below)
project_directory
|-- config... | bsd-3-clause |
delighted/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py | 115 | 26224 | # Copyright (C) 2009 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 |
superdesk/superdesk-ntb | server/ntb/io/feed_parsers/ntb_newsml.py | 3 | 1341 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2018 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superdesk.io.... | agpl-3.0 |
AudreyFrancisco/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/base/ResultDataBuilder.py | 41 | 1799 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
edmond-chhung/linkchecker | linkcheck/checker/urlbase.py | 9 | 30871 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2014 Bastian Kleineidam
#
# 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 License, or
# (at your option) any later versi... | gpl-2.0 |
singhkay/azure-quickstart-templates | splunk-on-ubuntu/scripts/config.py | 119 | 1408 | # The MIT License (MIT)
#
# Copyright (c) 2016 Microsoft. 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
# in the Software without restriction, including withou... | mit |
FATSLiM/fatslim | fatslimlib/test/test_03_apl.py | 1 | 12484 | # -*- coding: utf-8; Mode: python; tab-width: 4; indent-tabs-mode:nil; -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2016 Sébastien Buchoux <sebastien.buchoux@gmail.com>
#
# This file is part of FATSLiM.
#
# FATSLiM is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
tareqalayan/ansible | lib/ansible/modules/cloud/openstack/os_image.py | 25 | 6182 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# 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
# TO... | gpl-3.0 |
pasqualguerrero/django-oscar | tests/integration/catalogue/product_tests.py | 48 | 6008 | # coding=utf-8
from django.db import IntegrityError
from django.test import TestCase
from django.core.exceptions import ValidationError
from oscar.apps.catalogue.models import (Product, ProductClass,
ProductAttribute,
AttributeOption)
fr... | bsd-3-clause |
Southpaw-TACTIC/Team | src/python/Lib/optparse.py | 5 | 62547 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionPa... | epl-1.0 |
vrenaville/OCB | openerp/workflow/instance.py | 314 | 5594 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 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 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/test/test_index.py | 98 | 8567 | import unittest
from test import support
import operator
maxsize = support.MAX_Py_ssize_t
class newstyle:
def __index__(self):
return self.ind
class TrapInt(int):
def __index__(self):
return int(self)
class BaseTestCase(unittest.TestCase):
def setUp(self):
self.o = newstyle()
... | lgpl-3.0 |
JavierDelgadoFernandez/invenio-previewer | invenio_previewer/views.py | 1 | 3942 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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 (at your option) any later... | gpl-2.0 |
wangmiao1981/spark | python/pyspark/sql/tests/test_pandas_cogrouped_map.py | 20 | 9306 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
Qbicz/multi-secret-sharing | python/tests/test_MultiSecretCommon.py | 1 | 2841 | from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools import assert_raises
from multisecret.MultiSecretRoyAdhikari import Dealer
import multisecret.MultiSecretCommon as common
""" Declare basic params used to initialize Dealer in test cases """
# large prime from NIST P-256 ellipt... | mit |
gaddman/ansible | test/units/modules/network/netscaler/test_netscaler_servicegroup.py | 68 | 23150 |
# Copyright (c) 2017 Citrix Systems
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/amqp-2.4.1/amqp/platform.py | 3 | 2484 | """Platform compatibility."""
from __future__ import absolute_import, unicode_literals
import platform
import re
import struct
import sys
# Jython does not have this attribute
try:
from socket import SOL_TCP
except ImportError: # pragma: no cover
from socket import IPPROTO_TCP as SOL_TCP # noqa
RE_NUM = r... | apache-2.0 |
ayepezv/GAD_ERP | addons/hw_escpos/escpos/exceptions.py | 67 | 2868 | """ ESC/POS Exceptions classes """
class Error(Exception):
""" Base class for ESC/POS errors """
def __init__(self, msg, status=None):
Exception.__init__(self)
self.msg = msg
self.resultcode = 1
if status is not None:
self.resultcode = status
def __str__(self):... | gpl-3.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/nbformat/v3/tests/formattest.py | 28 | 1496 | # -*- coding: utf8 -*-
import io
import os
import shutil
import tempfile
pjoin = os.path.join
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_worksheet, new_notebook
)
from ..nbpy import reads, writes, read, write
from .nbexamples import nb0, nb0_py
def open_utf8(fname, mode):
re... | bsd-2-clause |
caseylucas/ansible-modules-core | windows/win_ping.py | 208 | 1376 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | gpl-3.0 |
eeshangarg/oh-mainline | vendor/packages/Django/django/db/models/query.py | 63 | 74029 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import itertools
import sys
import warnings
from django.core import exceptions
from django.db import connections, router, transaction, IntegrityError
from django.db.models.constants import LOOKUP_SEP
from django.db.models.... | agpl-3.0 |
w1ll1am23/home-assistant | tests/components/homekit_controller/test_device_trigger.py | 5 | 9761 | """Test homekit_controller stateless triggers."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.homekit_controller.const import DOMAIN
from homeas... | apache-2.0 |
jelmer/samba | python/samba/tests/samba_tool/base.py | 36 | 4702 | # Unix SMB/CIFS implementation.
# Copyright (C) Sean Dague <sdague@linux.vnet.ibm.com> 2011
#
# 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 optio... | gpl-3.0 |
ishanic/scikit-learn | sklearn/feature_extraction/hashing.py | 183 | 6155 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: BSD 3 clause
import numbers
import numpy as np
import scipy.sparse as sp
from . import _hashing
from ..base import BaseEstimator, TransformerMixin
def _iteritems(d):
"""Like d.iteritems, but accepts any collections.Mapping."""
return d.iteritems() if... | bsd-3-clause |
rlugojr/rekall | rekall-core/rekall/plugins/tools/mspdb.py | 2 | 45023 | # Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# 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 License, or (at
# your option) any later ver... | gpl-2.0 |
AloneRoad/Inforlearn | vendor/simplejson/tests/test_pass1.py | 259 | 1903 | from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -... | apache-2.0 |
rupak0577/ginga | ginga/util/io_fits.py | 1 | 11092 | #
# io_fits.py -- Module wrapper for loading FITS files.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
There are two possible choices for a python FITS file reading package
compatible with Ginga: astropy/pyfits and fitsio. Both are based on
the CFIT... | bsd-3-clause |
mindnervestech/mnrp | addons/mail/mail_alias.py | 72 | 15479 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
xaedes/canopen_301_402 | src/canopen_301_402_old/utils.py | 1 | 3131 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import can
def set_timeout(timeout,callback):
'''
@summary: calls a function after a specified number of seconds
@param timeout: number of seconds
@param callback: function be called
@result:
'''
pass # TODO
def collect_all_leaf_subclasses(... | mit |
GaetanCambier/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/mgoon.py | 177 | 2695 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
qualities,
unified_strdate,
)
class MgoonIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:(:?m\.)?mgoon\.com/(?:ch/(?:.+)/v|play/view)|
... | gpl-3.0 |
mxrrow/zaicoin | src/deps/boost/libs/python/pyste/tests/test_all.py | 54 | 4106 | #!/usr/bin/python
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import glob
import shutil
import sys
import time
#===========... | mit |
mtanski/samba | python/samba/netcmd/spn.py | 46 | 7603 | # spn management
#
# Copyright Matthieu Patou mat@samba.org 2010
#
# 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 later version.
#
# T... | gpl-3.0 |
dirk-dhu/freetz | make/hplip/hplip-config-update.py | 4 | 3297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv, stdout, stderr, exit
import re
from collections import defaultdict
# To ease search in menuconfig, the printers are split into these classes
# mind the order (e.g. color_laserjet before laserjet)
# format: (substring of section name in models.dat, st... | gpl-2.0 |
akhilaananthram/nupic.fluent | fluent/utils/text_preprocess.py | 1 | 10244 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
rjcorrig/FreeRDP | resources/conv_to_ewm_prop.py | 80 | 1430 | #!/usr/bin/python
# Copyright 2011 Anthony Tong <atong@trustedcs.com>
# 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 |
sbalde/edx-platform | lms/djangoapps/instructor/tests/test_api.py | 12 | 201659 | # -*- coding: utf-8 -*-
"""
Unit tests for instructor.api methods.
"""
import datetime
import ddt
import random
import pytz
import io
import json
import requests
import shutil
import tempfile
from urllib import quote
from django.conf import settings
from django.contrib.auth.models import User
from django.core import m... | agpl-3.0 |
TerraFERMA/TerraFERMA | buckettools/python/buckettools/diagnostics/filehandling.py | 1 | 6629 | # 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 version.
#
# This library is distributed in the hope that it will be us... | lgpl-3.0 |
cuboxi/android_external_chromium_org | tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py | 23 | 1228 | # Copyright 2013 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.
"""Android-specific, downloads and installs pre-built profilers.
These pre-built binaries are stored in Cloud Storage, and they were
built from AOSP source.... | bsd-3-clause |
bulax41/Commands | scripts/telegram_bot.py | 1 | 8020 | #!/usr/bin/env python
import subprocess
import select
import sys
import datetime
import time
import re
import json
import socket
import logging
import telegram
from contextlib import closing
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
savefile = "chatlist.json"
user_token = "8c6d20cee783... | gpl-3.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/python/profiler/internal/run_metadata_test.py | 3 | 6803 | # 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 |
Fat-Zer/FreeCAD_sf_master | src/Mod/Web/InitGui.py | 13 | 2410 | #***************************************************************************
#* Copyright (c) 2002,2003 Jürgen Riegel <juergen.riegel@web.de> *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* ... | lgpl-2.1 |
foxwill/ol-api-tester | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py | 1004 | 9544 | # The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# urllib3
_Default = object()
def current... | gpl-2.0 |
SectorLabs/django-postgres-extra | psqlextra/models/view.py | 1 | 4455 | from typing import Callable, Optional, Union
from django.core.exceptions import ImproperlyConfigured
from django.db import connections
from django.db.models import Model
from django.db.models.base import ModelBase
from django.db.models.query import QuerySet
from psqlextra.type_assertions import is_query_set, is_sql, ... | mit |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/pywin32-219-py2.7-win32.egg/mmsystem.py | 24 | 30521 | # Generated by h2py from d:/msdev/include/mmsystem.h
MAXPNAMELEN = 32
MAXERRORLENGTH = 256
MAX_JOYSTICKOEMVXDNAME = 260
MM_MICROSOFT = 1
MM_MIDI_MAPPER = 1
MM_WAVE_MAPPER = 2
MM_SNDBLST_MIDIOUT = 3
MM_SNDBLST_MIDIIN = 4
MM_SNDBLST_SYNTH = 5
MM_SNDBLST_WAVEOUT = 6
MM_SNDBLST_WAVEIN = 7
MM_ADLIB = 9
MM_MPU401_MIDIOUT = 1... | mit |
filippog/pysnmp | examples/v3arch/asyncore/manager/ntfrcv/regexp-community-name.py | 1 | 3156 | """
Serve SNMP Community names defined by regexp
++++++++++++++++++++++++++++++++++++++++++++
Receive SNMP TRAP/INFORM messages with the following options:
* SNMPv1/SNMPv2c
* with any SNMP community matching regexp '.*love.*'
* over IPv4/UDP, listening at 127.0.0.1:162
* print received data on stdout
Either of the f... | bsd-3-clause |
yangrongwei/gyp | test/generator-output/gyptest-actions.py | 198 | 2019 | #!/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 --generator-output= behavior when using actions.
"""
import TestGyp
# Android doesn't support --generator-output.
test = Test... | bsd-3-clause |
mahak/cinder | cinder/tests/unit/volume/drivers/dell_emc/powerstore/test_volume_group_create_from_source.py | 2 | 4981 | # Copyright (c) 2021 Dell Inc. or its subsidiaries.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
romankagan/DDBWorkbench | plugins/hg4idea/testData/bin/mercurial/lsprofcalltree.py | 100 | 2760 | """
lsprofcalltree.py - lsprof output which is readable by kcachegrind
Authors:
* David Allouche <david <at> allouche.net>
* Jp Calderone & Itamar Shtull-Trauring
* Johan Dahlin
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by refer... | apache-2.0 |
vivekananda/fbeats | django/db/backends/sqlite3/introspection.py | 84 | 7764 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL types t... | bsd-3-clause |
simontakite/sysadmin | pythonscripts/learningPython/setsubclass.py | 1 | 1331 | from __future__ import print_function # 2.X compatibility
class Set(list):
def __init__(self, value = []): # Constructor
list.__init__([]) # Customizes list
self.concat(value) # Copies mutable defaults
def intersect(self, other): # other is ... | gpl-2.0 |
richrd/nxt-python | nxt/locator.py | 17 | 8272 | # nxt.locator module -- Locate LEGO Minstorms NXT bricks via USB or Bluetooth
# Copyright (C) 2006, 2007 Douglas P Lau
# Copyright (C) 2009 Marcus Wanner
# Copyright (C) 2013 Dave Churchill, Marcus Wanner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... | gpl-3.0 |
rwarren14/robotframework | src/robot/jarrunner.py | 23 | 2370 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 |
40223240/2015cdb_g3_40223240 | static/Brython3.1.1-20150328-091302/Lib/platform.py | 620 | 51006 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-3.0 |
anjuncc/portia | slyd/slyd/splash/css_utils.py | 9 | 1730 | import re
import urllib
from scrapy.utils.url import urljoin_rfc
from six.moves.urllib_parse import urlparse
CSS_IMPORT = re.compile(r'''@import\s*["']([^"']+)["']''')
CSS_URL = re.compile(r'''\burl\(("[^"]+"|'[^']+'|[^"')][^)]+)\)''')
BAD_CSS = re.compile(r'''(-moz-binding|expression\s*\(|javascript\s*:)''', re.I)
... | bsd-3-clause |
segwitcoin/SegwitCoin | test/functional/test_framework/mininode.py | 7 | 57589 | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-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.
"""Bitcoin P2P ... | mit |
landlab/landlab | tests/graph/hex/test_hex.py | 3 | 8573 | import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from pytest import approx
from landlab.graph import TriGraph
from landlab.graph.hex.hex import (
HorizontalHexTriGraph,
HorizontalRectTriGraph,
VerticalHexTriGraph,
VerticalRectTriGraph,
)
def tes... | mit |
ericdill/bokeh | examples/glyphs/dateaxis.py | 43 | 1231 | from __future__ import print_function
from numpy import pi, arange, sin
import numpy as np
import time
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, DatetimeAxis,
Colu... | bsd-3-clause |
davidsims9t/itis-graphql | venv/lib/python3.4/site-packages/setuptools/command/develop.py | 106 | 7384 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
import io
from setuptools.extern import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_in... | gpl-3.0 |
xydinesh/youtube-dl | youtube_dl/extractor/rtve.py | 58 | 7807 | # encoding: utf-8
from __future__ import unicode_literals
import base64
import re
import time
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
float_or_none,
remove_end,
std_headers,
struct_unpack,
)
def _decrypt_url(png):
encrypted... | unlicense |
craigcitro/pydatalab | google/datalab/stackdriver/monitoring/_query.py | 5 | 2818 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 |
p0cisk/Quantum-GIS | tests/src/python/test_qgscomposerlabel.py | 5 | 3977 | # -*- coding: utf-8 -*-
'''
test_qgscomposerlabel.py
--------------------------------------
Date : Oct 2012
Copyright : (C) 2012 by Dr. Hugo Mercier
email : hugo dot mercier at oslandia dot com
*****************... | gpl-2.0 |
sebi-hgdata/ansible | v2/test/parsing/yaml/test_data_loader.py | 11 | 2224 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
KimNorgaard/ansible-modules-extras | cloud/profitbricks/profitbricks.py | 112 | 20794 | #!/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 |
santosh0705/cobbler | cobbler/web/templatetags/site.py | 12 | 11715 | from django import template
from django.utils.datastructures import SortedDict
register = template.Library()
# ==========================
# -*- coding: utf-8 -*-
'''
A smarter {% if %} tag for django templates.
While retaining current Django functionality, it also handles equality,
greater than and less than operat... | gpl-2.0 |
ghber/My-Django-Nonrel | django/conf/locale/mk/formats.py | 251 | 1758 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | bsd-3-clause |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/lines_bars_and_markers/simple_plot.py | 1 | 1292 | """
===========
Simple Plot
===========
Create a simple plot.
"""
import matplotlib.pyplot as plt
import numpy as np
# nodebox section
if __name__ == '__builtin__':
# were in nodebox
import os
import tempfile
W = 800
inset = 20
size(W, 600)
plt.cla()
plt.clf()
plt.close('all')
... | mit |
ntonjeta/iidea-Docker | examples/sobel/src/boost_1_63_0/tools/build/test/preprocessor.py | 58 | 1070 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test the C/C++ preprocessor.
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.... | agpl-3.0 |
sciCloud/OLiMS | lims/content/samplepartition.py | 2 | 9978 | from dependencies.dependency import ClassSecurityInfo
from lims.browser.fields import DurationField
from lims.config import PROJECTNAME
from lims.content.bikaschema import BikaSchema
from lims.interfaces import ISamplePartition
from lims.workflow import doActionFor
from lims.workflow import skip
from dependencie... | agpl-3.0 |
AltSchool/django | tests/template_tests/filter_tests/test_striptags.py | 197 | 1632 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
... | bsd-3-clause |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/werkzeug/contrib/profiler.py | 362 | 5151 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.profiler
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the :mod:`profile` or
:mod:`cProfile` module to do the profiling and writes the stats to the
stream provide... | gpl-3.0 |
mmnelemane/nova | nova/tests/unit/compute/test_compute_utils.py | 20 | 35630 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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... | apache-2.0 |
ToyamaTetsuji/hello-world | lib/build_pack_utils/cloudfoundry.py | 12 | 9633 | import os
import sys
import json
import tempfile
import shutil
import utils
import logging
from urlparse import urlparse
from zips import UnzipUtil
from hashes import HashUtil
from cache import DirectoryCacheManager
from downloads import Downloader
from downloads import CurlDownloader
from utils import safe_makedirs
... | apache-2.0 |
yangchaogit/boto | boto/__init__.py | 87 | 41904 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... | mit |
junhuac/MQUIC | depot_tools/ENV/lib/python2.7/site-packages/google/protobuf/message.py | 57 | 10262 | # 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... | mit |
kreisl/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/__init__.py | 369 | 1063 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
stevekuznetsov/ansible | test/units/modules/network/junos/test_junos_command.py | 15 | 4221 | # (c) 2016 Red Hat 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 version.
#
# Ansible is dis... | gpl-3.0 |
hujiajie/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/httpproxy_test.py | 19 | 6296 | #!/usr/bin/env python
# Copyright 2015 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... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.