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 |
|---|---|---|---|---|---|
miptliot/edx-platform | openedx/core/djangoapps/cache_toolbox/relation.py | 6 | 3965 | """
Caching instances via ``related_name``
--------------------------------------
``cache_relation`` adds utility methods to a model to obtain ``related_name``
instances via the cache.
Usage
~~~~~
::
from django.db import models
from django.contrib.auth.models import User
class Foo(models.Model):
... | agpl-3.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/test/test_baseexception.py | 4 | 7029 | import unittest
import builtins
import os
from platform import system as platform_system
class ExceptionClassTests(unittest.TestCase):
"""Tests for anything relating to exception objects themselves (e.g.,
inheritance hierarchy)"""
def test_builtins_new_style(self):
self.assertTrue(issubclass(Exc... | mit |
markwal/OctoPrint | src/octoprint/server/api/__init__.py | 2 | 7628 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import netadd... | agpl-3.0 |
benjaminjkraft/django | django/contrib/gis/gdal/prototypes/srs.py | 471 | 3513 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... | bsd-3-clause |
michaelkirk/QGIS | python/ext-libs/pygments/util.py | 269 | 8396 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... | gpl-2.0 |
diego-d5000/MisValesMd | env/lib/_abcoll.py | 58 | 18496 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | mit |
brandon-rhodes/numpy | numpy/f2py/setup.py | 6 | 4112 | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | bsd-3-clause |
megaumi/django | tests/gis_tests/gdal_tests/test_srs.py | 304 | 11694 | import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import SpatialReference, CoordTransform, GDALException, SRSException
class TestSRS:
def __init__(self, wkt, **kwargs):
self.wkt = wkt
for key, value in kwarg... | bsd-3-clause |
kailIII/emaresa | trunk.cl/client_lock_unlock/__openerp__.py | 1 | 1969 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: OpenDrive Ltda
# Copyright (c) 2013 Opendrive Ltda
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# cons... | agpl-3.0 |
chrisndodge/edx-platform | common/djangoapps/header_control/tests/test_decorators.py | 22 | 1070 | """Tests for remove_headers and force_header decorator. """
from django.http import HttpResponse, HttpRequest
from django.test import TestCase
from header_control.decorators import remove_headers, force_header
def fake_view(_request):
"""Fake view that returns an empty response."""
return HttpResponse()
cla... | agpl-3.0 |
RaghavPro/Runescape-Hiscores | hiscores/forms.py | 1 | 2377 | from django import forms
from django.core.exceptions import FieldError
from .models import Skills
class SearchForm(forms.Form):
search = forms.CharField(
widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Username', 'required': ''}),
max_length=12, label=False)
def clean_s... | gpl-2.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/PIL/PcxImagePlugin.py | 16 | 5267 | #
# The Python Imaging Library.
# $Id$
#
# PCX file handling
#
# This format was originally used by ZSoft's popular PaintBrush
# program for the IBM PC. It is also supported by many MS-DOS and
# Windows applications, including the Windows PaintBrush program in
# Windows 3.
#
# history:
# 1995-09-01 fl Created
# 1996... | mit |
CouchPotato/CouchPotatoV1 | library/pynmwp/pynmwp.py | 8 | 4572 | #!/usr/bin/python
from xml.dom.minidom import parseString
from httplib import HTTPSConnection
from urllib import urlencode
__version__ = "0.1"
API_SERVER = 'notifymywindowsphone.com'
ADD_PATH = '/publicapi/notify'
USER_AGENT="PyNMWP/v%s"%__version__
def uniq_preserve(seq): # Dave Kirby
# Order preserving
... | gpl-3.0 |
clkao/grano | alembic/versions/4f21a77e91be_init.py | 5 | 5649 | """init
Revision ID: 4f21a77e91be
Revises: None
Create Date: 2014-02-13 17:05:34.953371
"""
# revision identifiers, used by Alembic.
revision = '4f21a77e91be'
down_revision = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
op.create_table('account',... | mit |
twatteyne/dustlink_academy | views/web/dustWeb/web/wsgiserver/ssl_pyopenssl.py | 177 | 9605 | """A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from http://pyopenssl.sourceforge.net/
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One
----------
* ``s... | bsd-3-clause |
RomanZWang/osf.io | tests/test_registrations/base.py | 26 | 2371 | import datetime as dt
from modularodm import Q
from framework.auth import Auth
from website.util import permissions
from website.models import MetaSchema
from website.project.model import ensure_schemas
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory, ProjectFactory, DraftRegistration... | apache-2.0 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/kombu/transport/beanstalk.py | 1 | 3295 | """
kombu.transport.beanstalk
=========================
Beanstalk transport.
:copyright: (c) 2010 - 2012 by David Ziegler.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import socket
from Queue import Empty
from anyjson import loads, dumps
from beanstalkc import Connectio... | mit |
showell/zulip | zerver/tests/test_bots.py | 2 | 65093 | import filecmp
import os
from typing import Any, Dict, List, Mapping, Optional
from unittest.mock import MagicMock, patch
import orjson
from django.core import mail
from django.test import override_settings
from zulip_bots.custom_exceptions import ConfigValidationError
from zerver.lib.actions import (
do_change_s... | apache-2.0 |
willingc/oh-mainline | vendor/packages/python-dateutil/dateutil/parser.py | 278 | 32464 | # -*- coding:iso-8859-1 -*-
"""
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
import string
import time
import sys
import... | agpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/boto/boto/directconnect/layer1.py | 148 | 23592 | # Copyright (c) 2013 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 in the Software without restriction, including
# without limitation the rights ... | apache-2.0 |
cycotech/WAR-app | env/lib/python3.5/site-packages/django/views/decorators/debug.py | 712 | 2627 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... | mit |
zardus/z3 | src/api/python/z3num.py | 26 | 16124 | ############################################
# Copyright (c) 2012 Microsoft Corporation
#
# Z3 Python interface for Z3 numerals
#
# Author: Leonardo de Moura (leonardo)
############################################
from z3 import *
from z3core import *
from z3printer import *
from fractions import Fraction
def _to_num... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/distutils/command/install.py | 96 | 26263 | """distutils.command.install
Implements the Distutils 'install' command."""
from distutils import log
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string
from types import *
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.sysconf... | gpl-2.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/requests/packages/urllib3/request.py | 290 | 5946 | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.con... | mit |
10clouds/edx-platform | lms/djangoapps/lms_xblock/test/test_runtime.py | 18 | 12041 | """
Tests of the LMS XBlock Runtime and associated utilities
"""
from django.conf import settings
from ddt import ddt, data
from django.test import TestCase
from mock import Mock, patch
from urlparse import urlparse
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import BlockUsageLocator, Co... | agpl-3.0 |
noba3/KoTos | addons/script.module.youtube.dl/lib/youtube_dl/postprocessor/ffmpeg.py | 11 | 20880 | from __future__ import unicode_literals
import io
import os
import subprocess
import time
from .common import AudioConversionError, PostProcessor
from ..compat import (
compat_subprocess_get_DEVNULL,
)
from ..utils import (
encodeArgument,
encodeFilename,
get_exe_version,
is_outdated_version,
... | gpl-2.0 |
wuzhy/autotest | frontend/apache_auth.py | 4 | 2962 | from django.contrib.auth.models import User, Group, check_password
from django.contrib.auth import backends
from django.contrib import auth
from django import http
from autotest_lib.frontend import thread_local
from autotest_lib.frontend.afe import models, management
DEBUG_USER = 'debug_user'
class SimpleAuthBackend... | gpl-2.0 |
atlefren/beerdatabase | breweryname_compare.py | 1 | 1755 | # -*- coding: utf-8 -*-
import json
from beertools import BreweryNameMatcher
def read_json(filename):
with open(filename, 'r') as infile:
return json.loads(infile.read())
def get_breweries_polet():
with open('data/polet.json', 'r') as infile:
data = json.loads(infile.read())
breweri... | mit |
ingokegel/intellij-community | python/helpers/py3only/docutils/transforms/frontmatter.py | 44 | 19348 | # $Id: frontmatter.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger, Ueli Schlaepfer <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to tra... | apache-2.0 |
noironetworks/heat | heat/common/config.py | 1 | 25507 | #
# 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
# ... | apache-2.0 |
ddico/odoo | addons/mrp/models/mrp_workorder.py | 1 | 39609 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from collections import defaultdict
import json
from odoo import api, fields, models, _, SUPERUSER_ID
from odoo.exceptions import... | agpl-3.0 |
ralphbean/ansible | v2/ansible/executor/stats.py | 251 | 1716 | # (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 |
billybob2435/pythonstuff | test2.py | 2 | 2008 | from tkinter import *
from tkinter import filedialog
import pygame
import time
import os
fields = ('hours', 'mins', 'sec',)
Ch = ('choice')
def timer(ti,entries):
ch = ""
if (ch == ""):#default sound
wtime(ti,"/home/laptop/git/pythonstuff/sounds/frog.mp3")
else:#sets the sound to what the user whants
os.c... | mit |
jaracil/esp-idf | components/idf_test/integration_test/TestCaseScript/TCPStress/TCPSTAsendrecv.py | 15 | 7631 | from TCAction import TCActionBase
from NativeLog import NativeLog
import time
import random
import string
class TestCase(TCActionBase.CommonTCActionBase):
def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH):
TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env... | apache-2.0 |
juliotrigo/juliotrigo | juliotrigo/wsgi.py | 1 | 1431 | """
WSGI config for juliotrigo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | bsd-3-clause |
ZhangXinNan/tensorflow | tensorflow/python/debug/cli/evaluator.py | 80 | 5731 | # 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 |
40223227/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/test/support.py | 770 | 3379 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... | gpl-3.0 |
tjsavage/djangononrel-starter | django/contrib/gis/geos/point.py | 403 | 4253 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... | bsd-3-clause |
blakev/suds | suds/__init__.py | 1 | 4404 | # 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 ... | lgpl-3.0 |
caseyrygt/osf.io | website/addons/osfstorage/utils.py | 37 | 3726 | # -*- coding: utf-8 -*-
import os
import httplib
import logging
import functools
from modularodm.exceptions import ValidationValueError
from framework.exceptions import HTTPError
from framework.analytics import update_counter
from website.addons.osfstorage import settings
logger = logging.getLogger(__name__)
LOCA... | apache-2.0 |
adelina-t/nova | nova/api/openstack/compute/contrib/server_external_events.py | 2 | 5625 | # Copyright 2014 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/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
GPGPackageHandler/gpgpackagehandler | gpg_package_handler.py | 1 | 37509 |
#Use the included script run.sh to execute gpg_package_handler - execute run using ./run.sh
#the options available to run.sh are shown below
# debugFlag - If value is 1 print error/descriptive messages.
# pathToScript - The path leading to the folder containing this script.
# (Used if run.sh is launched outs... | lgpl-3.0 |
meprogrammerguy/pyMadness | scrape_stats.py | 1 | 2098 | #!/usr/bin/env python3
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd
import html5lib
import pdb
from collections import OrderedDict
import json
import csv
import contextlib
url = "https://kenpom.com/index.php"
#url = "https://kenpom.com/index.php?y=2017" #past year testing over... | mit |
denisenkom/django | django/utils/archive.py | 229 | 6935 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... | bsd-3-clause |
sonium0/pymatgen | pymatgen/command_line/tests/test_gulp_caller.py | 11 | 11804 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
Created on Jan 22, 2013
@author: Bharat Medasani
"""
import unittest
from pymatgen.command_line.gulp_caller import *
from pymatgen.core.structure import Structure
... | mit |
shizhai/wprobe | staging_dir/host/lib/scons-2.1.0/SCons/Tool/packaging/tarbz2.py | 21 | 1809 | """SCons.Tool.Packaging.tarbz2
The tarbz2 SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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")... | gpl-2.0 |
berkeley-stat159/project-alpha | code/utils/scripts/glm_script.py | 1 | 3957 | """ Script for GLM functions.
Run with:
python glm_script.py
"""
# Loading modules.
from __future__ import absolute_import, division, print_function
import numpy as np
import matplotlib.pyplot as plt
import nibabel as nib
import os
import sys
# Relative paths to subject 1 data.
project_path = "../../..... | bsd-3-clause |
wang1352083/pythontool | python-2.7.12-lib/bsddb/test/test_join.py | 111 | 3168 | """TestCases for using the DB.join and DBCursor.join_item methods.
"""
import os
import unittest
from test_all import db, dbshelve, test_support, verbose, \
get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
ProductIndex = [
('apple',... | mit |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudhsm/__init__.py | 111 | 1654 | # Copyright (c) 2015 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 in the Software without restriction, including
# without limitation the rights... | apache-2.0 |
alxgu/ansible | test/units/module_utils/basic/test__log_invocation.py | 169 | 1797 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
# (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
ARGS = dict(foo=False, bar=... | gpl-3.0 |
gallifrey17/eden | modules/tests/inv/send_item.py | 25 | 3148 | """ Sahana Eden Module Automated Tests - INV001 Send Items
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 w... | mit |
dresden-weekly/ansible | lib/ansible/runner/action_plugins/add_host.py | 107 | 4364 | # Copyright 2012, Seth Vidal <skvidal@fedoraproject.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
VisheshHanda/production_backup | erpnext/schools/utils.py | 19 | 1848 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For lice
from __future__ import unicode_literals
import frappe
from frappe import _
class OverlapError(frappe.ValidationError): pass
def validate_overlap_for(doc, doctype, fieldname, value=None):
"""Checks overlap for specified fie... | gpl-3.0 |
MatthewWilkes/django-oscar | tests/unit/checkout/forms_tests.py | 48 | 2493 | # coding=utf-8
from django.test import TestCase
from oscar.apps.address.models import Country
from oscar.apps.checkout.forms import ShippingAddressForm
from oscar.test.factories import CountryFactory
class TestShippingAddressForm(TestCase):
minimal_data = {
'first_name': 'Bärry',
'last_name': 'Ch... | bsd-3-clause |
haveal/googleads-dfa-reporting-samples | python/v2.1/get_userprofiles.py | 3 | 1582 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
eshijia/SUR | magnum/common/context.py | 7 | 4413 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
Baastyr/semc-es209ra-kernel | scripts/rt-tester/rt-tester.py | 904 | 5366 | #!/usr/bin/env python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
impor... | gpl-2.0 |
bionoid/kivy | kivy/input/providers/tuio.py | 6 | 12039 | '''
TUIO Input Provider
===================
TUIO is the de facto standard network protocol for the transmission of
touch and fiducial information between a server and a client. To learn
more about TUIO (which is itself based on the OSC protocol), please
refer to http://tuio.org -- The specification should be of specia... | mit |
manufactured-solutions/analytical | navier_stokes/NS_Power_law_transient_scalar_sympy/sympy/NS_PowerLaw_scalar_transient_3d_phi_codes.py | 1 | 1413 |
# Writing Q_phi into a C code ------------------------------------------
#Q_phi_time=Q2n
#Q_phi_convection=Q1n
#Q_phi_diffusion=Q3n
#unassigning variables Q_phi_time and Q_phi_convection in order to write a more readable C code
var('Q_phi_time, Q_phi_convection, Q_phi_diffusion')
Q_phi=Q_phi_time+Q_phi_convection+... | lgpl-2.1 |
Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/Cryptodome/Util/__init__.py | 7 | 1951 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | gpl-2.0 |
jiangzhixiao/odoo | addons/hr_expense/report/__init__.py | 380 | 1071 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
gmalmquist/pants | contrib/go/tests/python/pants_test/contrib/go/subsystems/test_fetchers.py | 2 | 1841 | # coding=utf-8
# Copyright 2015 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)
from contextlib impo... | apache-2.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/autobahn/wamp/test/test_runner.py | 2 | 9287 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | gpl-3.0 |
TRESCLOUD/odoopub | addons/portal/wizard/share_wizard.py | 158 | 9630 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ban4jp/mbed | workspace_tools/export/gccarm.py | 3 | 3520 | """
mbed SDK
Copyright (c) 2011-2013 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 wr... | apache-2.0 |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/utils/termcolors.py | 76 | 7612 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... | artistic-2.0 |
h3biomed/ansible-modules-extras | cloud/amazon/ecs_service.py | 16 | 16540 | #!/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 |
gyang/horizon | horizon/dashboards/syspanel/flavors/views.py | 4 | 2440 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
googleapis/googleapis-gen | google/cloud/aiplatform/v1/aiplatform-v1-py/scripts/fixup_params_v1_keywords.py | 6 | 5898 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
mafiya69/sympy | sympy/tensor/indexed.py | 12 | 17230 | """Module that defines indexed objects
The classes IndexedBase, Indexed and Idx would represent a matrix element
M[i, j] as in the following graph::
1) The Indexed class represents the entire indexed object.
|
___|___
' '
M[i, j]
... | bsd-3-clause |
dbatalov/ri-optimizer | example_main.py | 1 | 9032 | """
This is the main example script to execute, it is meant as an example
of how the riptimize.py module is to be used, and effectivey acts as
the driver of the module with rudimentary console UI + CSV report
generation and S3 upload. It's job is to demonstrate the functionality
of riptimize and it is not meant to... | bsd-2-clause |
EKiefer/edge-starter | py34env/Scripts/enhancer.py | 1 | 1558 | #!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script creates four windows containing an image and a slider.
# drag the slider to modify the image.
#
try:
from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL
except ImportError:... | mit |
jundongl/scikit-feature | skfeature/function/sparse_learning_based/NDFS.py | 3 | 4908 | import numpy as np
import sys
import math
import sklearn.cluster
from skfeature.utility.construct_W import construct_W
def ndfs(X, **kwargs):
"""
This function implement unsupervised feature selection using nonnegative spectral analysis, i.e.,
min_{F,W} Tr(F^T L F) + alpha*(||XW-F||_F^2 + beta*||W||_{2,1}... | gpl-2.0 |
naparuba/kunai | data/global-configuration/packs/raspberry-pi/collectors/collector_raspberry_pi.py | 2 | 2465 | import os
from opsbro.collector import Collector
# deferred : Stuck mails (that will be retried later)
# active : Mails being delivered (should be small)
# maildrop : Localy posted mail
# incoming : Processed local mail and received from network
# corrupt : Messages found to not be in correct format (shold be 0)
# ho... | mit |
xq262144/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/opendocument.py | 62 | 25947 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
#
# 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 you... | apache-2.0 |
leilihh/novaha | nova/tests/virt/vmwareapi/test_vm_util.py | 4 | 28638 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical Corp.
# 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
#
# htt... | apache-2.0 |
svn2github/vbox | src/VBox/GuestHost/OpenGL/packer/pack_swap.py | 22 | 3196 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys, string
sys.path.append( "../glapi_parser" )
import apiutil
if len(sys.argv) != 2:
print >> sys.stderr, "Usage: %s <filename>" % sys.argv[0]
sys.exit(-1)
... | gpl-2.0 |
kasioumis/invenio | invenio/modules/upgrader/upgrades/invenio_2012_12_06_new_citation_dict_table.py | 20 | 2268 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012 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 |
kasioumis/invenio | invenio/legacy/websubmit/functions/Second_Report_Number_Generation.py | 13 | 18010 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011 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 ... | gpl-2.0 |
haoxli/web-testing-service | wts/tests/csp/csp_default-src_self_object_allowed-manual.py | 30 | 2448 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self'")
response.headers.set("X... | bsd-3-clause |
oskar456/youtube-dl | youtube_dl/extractor/veoh.py | 18 | 4799 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
int_or_none,
ExtractorError,
sanitized_Request,
)
class VeohIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?veoh\.com/(?:watch|iphone/#_Watch)/(?P<id>(?:v|e|yapi-)[\da-zA-Z]+)'
... | unlicense |
glaubitz/fs-uae-debian | launcher/fsbc/task.py | 2 | 2828 | import threading
import traceback
from .signal import Signal
local_tasks = threading.local()
class TaskFailure(Exception):
def __init__(self, message):
Exception.__init__(self, message)
self.message = message
class TaskStopped(Exception):
def __init__(self):
Exception.__init__(self... | gpl-2.0 |
kjc88/sl4a | python/src/Lib/xml/dom/minidom.py | 60 | 66134 | """\
minidom.py -- a lightweight DOM implementation.
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
interface
* SAX 2 namespaces
"""
import xml.dom... | apache-2.0 |
maciek263/django2 | myvenv/Lib/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
ystk/debian-wpa | wpa_supplicant/examples/wpas-dbus-new.py | 114 | 4272 | #!/usr/bin/python
import dbus
import sys, os
import time
import gobject
from dbus.mainloop.glib import DBusGMainLoop
WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface"
... | gpl-2.0 |
prasannav7/ggrc-core | test/integration/ggrc/models/factories.py | 1 | 4323 | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: urban@reciprocitylabs.com
"""Factories for models"""
import random
import factory
from ggrc import db
f... | apache-2.0 |
mira67/DL4RS | MPFprj/prjutil.py | 1 | 1728 | """
utils
configure file parser
Author: Qi Liu, 11/2016
"""
import ConfigParser
def cfgmap(cfg,section):
dict1 = {}
options = cfg.options(section)
for option in options:
try:
dict1[option] = cfg.get(section, option)
if dict1[option] == -1:
DebugPrint("skip: ... | gpl-3.0 |
k0001/meaningtoolws | meaningtoolws/ct.py | 1 | 4944 | # -*- coding: utf-8 -*-
# Copyright (c) 2009, Popego Corporation <contact [at] popego [dot] com>
# All rights reserved.
#
# This file is part of the Meaningtool Web Services Python Client project
#
# See the COPYING file distributed with this project for its licensing terms.
"""
Meaningtool Category Tree REST API v0.... | bsd-3-clause |
AICP/external_chromium_org | testing/test_env.py | 96 | 3084 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sets environment variables needed to run a chromium unit test."""
import os
import stat
import subprocess
import sys
# This is... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/gdata/src/gdata/calendar/service.py | 95 | 23020 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | agpl-3.0 |
invisiblek/android_kernel_lge_g3 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/numpy/distutils/misc_util.py | 6 | 85331 | import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
import distutils
from distutils.errors import DistutilsError
try:
set
except NameError:
from sets import Set as set
from numpy.distutils.compat import get_exception
__all__ = ['Con... | agpl-3.0 |
hiepgia/android_kernel_lge_geeb | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
jcftang/ansible | lib/ansible/modules/files/tempfile.py | 30 | 3459 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2016 Krzysztof Magosa <krzysztof@magosa.pl>
#
# 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 Lice... | gpl-3.0 |
stanik137/xtreemfs | cpp/thirdparty/protobuf-2.5.0/python/ez_setup.py | 454 | 10334 | #!python
# This file was obtained from:
# http://peak.telecommunity.com/dist/ez_setup.py
# on 2011/1/21.
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup... | bsd-3-clause |
watspidererik/testenv | flask/lib/python2.7/site-packages/whoosh/classify.py | 95 | 11727 | # Copyright 2008 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | mit |
proversity-org/edx-platform | lms/djangoapps/student_account/talenetic.py | 1 | 7807 | from six.moves.urllib_parse import urlencode, unquote
import jwt
import json
from django.conf import settings
from student.models import Registration, UserProfile
from social_core.backends.oauth import BaseOAuth2
from django.contrib.auth.models import User
import uuid
import logging
import social_django
log... | agpl-3.0 |
Invoca/graphite-web | webapp/graphite/account/models.py | 39 | 1567 | """Copyright 2008 Orbitz WorldWide
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... | apache-2.0 |
rahul003/mxnet | python/mxnet/operator.py | 8 | 51071 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
iuliat/nova | nova/tests/unit/api/openstack/compute/contrib/test_migrate_server.py | 26 | 14336 | # Copyright 2011 OpenStack Foundation
# Copyright 2013 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.