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
panosl/django-attachments
attachments/views.py
2
2106
from django.shortcuts import render_to_response, get_object_or_404 from django.views.decorators.http import require_POST from django.http import HttpResponseRedirect from django.db.models.loading import get_model from django.core.urlresolvers import reverse from django.utils.translation import ugettext, ugettext_lazy a...
bsd-3-clause
Lujeni/ansible
lib/ansible/modules/identity/onepassword_info.py
19
17168
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Ryan Conway (@rylon) # (c) 2018, Scott Buchanan <sbuchanan@ri.pn> (onepassword.py used as starting point) # (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_im...
gpl-3.0
petry/kanboard
apps/core/migrations/0001_initial.py
1
1775
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Board' db.create_table(u'core_board', ( (u'id...
apache-2.0
thnee/ansible
lib/ansible/modules/cloud/google/gcp_resourcemanager_project_info.py
13
7036
#!/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
shaufi/odoo
openerp/addons/base/ir/ir_http.py
162
8628
#---------------------------------------------------------- # ir_http modular http routing #---------------------------------------------------------- import datetime import hashlib import logging import mimetypes import re import sys import werkzeug import werkzeug.exceptions import werkzeug.routing import werkzeug.u...
agpl-3.0
glmcdona/meddle
examples/base/Lib/email/header.py
255
22243
# Copyright (C) 2002-2006 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org """Header encoding and decoding functionality.""" __all__ = [ 'Header', 'decode_header', 'make_header', ] import re import binascii import email.quoprimime import email.base64m...
mit
Ricyteach/parmatter
src/parmatter/parmatter.py
1
6022
import string import parse as _parse # avoid potential name conflicts with parse methods # NOTE: All the Formatter docstrings mostly copied from the string docs page (Formatter does # not have its own docstrings... <sad_face>). class Formatter(): '''Re-implementation of `string.Formatter` (using the composition p...
bsd-2-clause
nemomobile-graveyard/mcompositor
tests/functional/test25.py
2
3087
#!/usr/bin/python # Some tests for the splash screen. #* Test steps # * show an unmapped application window # * show a splash screen for it # * check that the splash screen appeared # * map the application window # * check that the splash screen disappeared # * show a new splash screen with a bogus PID # * che...
lgpl-2.1
aabadie/scikit-learn
examples/mixture/plot_gmm_selection.py
95
3310
""" ================================ Gaussian Mixture Model Selection ================================ This example shows that model selection can be performed with Gaussian Mixture Models using information-theoretic criteria (BIC). Model selection concerns both the covariance type and the number of components in the ...
bsd-3-clause
normtown/SickRage
lib/requests/adapters.py
573
16810
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
gpl-3.0
skavulya/spark-tk
python/sparktk/frame/constructors/import_hive.py
13
2715
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
Antiun/connector-ecommerce
connector_ecommerce/invoice.py
4
1863
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joel Grand-Guillaume # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
agpl-3.0
Ms2ger/presto-testo
core/standards/scripts/jstest-futhark/demos/inspector/inspector.py
8
4489
#!/usr/local/bin/python from httplib import HTTP from sys import argv, exit from os import tmpnam, execl, fork, wait, remove from re import compile import cgi form = cgi.FieldStorage() if not form.has_key("url"): print "Content-Type: text/html" print print "<html><body><form method='GET' action='inspecto...
bsd-3-clause
peterfpeterson/mantid
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLConvertToQ.py
3
12919
# -*- coding: utf-8 -*-# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Ident...
gpl-3.0
christisall/TeamTalk
win-client/3rdParty/src/json/devtools/antglob.py
247
7750
#!/usr/bin/env python # encoding: utf-8 # Baptiste Lepilleur, 2009 from dircache import listdir import re import fnmatch import os.path # These fnmatch expressions are used by default to prune the directory tree # while doing the recursive traversal in the glob_impl method of glob function. prune_dirs = '.git .bzr ....
apache-2.0
SeanHayes/python-social-auth
social/tests/actions/test_login.py
79
2639
from social.tests.models import User from social.tests.actions.actions import BaseActionTest class LoginActionTest(BaseActionTest): def test_login(self): self.do_login() def test_login_with_partial_pipeline(self): self.do_login_with_partial_pipeline() def test_fields_stored_in_session(se...
bsd-3-clause
Vegasvikk/django-cms
cms/test_utils/project/mti_pluginapp/south_migrations/0001_initial.py
46
4071
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TestPluginAlphaModel' db.create_table(u'mti_pluginapp_tes...
bsd-3-clause
izapolsk/integration_tests
cfme/roles.py
1
28996
from cfme.utils.log import logger def _remove_page(roles, group, pages): if group in roles: for page in pages: if page in roles[group]: roles[group].remove(page) else: logger.info("Page %s attempted to be removed from role %s, " ...
gpl-2.0
hujiajie/chromium-crosswalk
tools/telemetry/telemetry/internal/actions/play.py
32
2187
# 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. """A Telemetry page_action that performs the "play" action on media elements. Media elements can be specified by a selector argument. If no selector is defi...
bsd-3-clause
pixelrebel/st2
st2api/tests/unit/controllers/v1/test_pack_config_schema.py
3
2064
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
glaubitz/fs-uae-debian
launcher/OpenGL/raw/GL/EXT/bindable_uniform.py
9
1275
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
gpl-2.0
mpapierski/protobuf
python/google/protobuf/internal/message_test.py
224
22295
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
gannetson/django
tests/template_tests/utils.py
214
4372
# coding: utf-8 from __future__ import unicode_literals import functools import os from django.template.engine import Engine from django.test.utils import override_settings from django.utils._os import upath from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe ...
bsd-3-clause
rubikloud/gpdb
src/test/unit/mock/mocker.py
13
10666
#!/usr/bin/env python import logging import optparse import os import re import subprocess import sys import special class CFile(object): # multi-line comment m_comment_pat = re.compile(r'/\*.*?\*/', re.DOTALL) # single-line comment (avoid http:// or postgres://) s_comment_pat = re.compile(r'(?<!:)/...
apache-2.0
vadimtk/chrome4sdp
tools/perf/page_sets/tough_canvas_cases.py
13
4031
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry import story class ToughCanvasCasesPage(page_module.Page): def __init__(self, url, page_set...
bsd-3-clause
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/components/test/data/autofill/merge/tools/reserialize_profiles_from_query.py
162
1177
#!/usr/bin/env python # 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. import sys from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType def main(): """Serializes the output of the ...
apache-2.0
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/Examples/Catalyst/PythonDolfinExample/simulation-catalyst-step6.py
1
8271
"""This demo program solves the incompressible Navier-Stokes equations on an L-shaped domain using Chorin's splitting method.""" # Copyright (C) 2010-2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Publi...
gpl-3.0
Batterfii/django
django/contrib/admin/templatetags/admin_urls.py
553
1812
from django import template from django.contrib.admin.utils import quote from django.core.urlresolvers import Resolver404, get_script_prefix, resolve from django.utils.http import urlencode from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse register = template.Library() @register.filter ...
bsd-3-clause
delhivery/django
tests/admin_custom_urls/models.py
288
2513
from functools import update_wrapper from django.contrib import admin from django.core.urlresolvers import reverse from django.db import models from django.http import HttpResponseRedirect from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Action(models.Model): name ...
bsd-3-clause
diofeher/django-nfa
django/contrib/auth/__init__.py
14
2883
import datetime from django.core.exceptions import ImproperlyConfigured SESSION_KEY = '_auth_user_id' BACKEND_SESSION_KEY = '_auth_user_backend' REDIRECT_FIELD_NAME = 'next' def load_backend(path): i = path.rfind('.') module, attr = path[:i], path[i+1:] try: mod = __import__(module, {}, {}, [attr]...
bsd-3-clause
progdupeupl/pdp_website
pdp/forum/migrations/0001_initial.py
1
5896
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ m...
agpl-3.0
emidln/django_roa
env/lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py
505
3578
from django.db.models.manager import Manager from django.contrib.gis.db.models.query import GeoQuerySet class GeoManager(Manager): "Overrides Manager to return Geographic QuerySets." # This manager should be used for queries on related fields # so that geometry columns on Oracle and MySQL are selected ...
bsd-3-clause
trabucayre/gnuradio
gr-digital/python/digital/qa_correlate_access_code_tag.py
4
3241
#!/usr/bin/env python # # Copyright 2006,2007,2010,2011,2013,2017 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, digital, blocks default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC' def string_to_1_0_list(...
gpl-3.0
racmariano/skidom
backend/resorts/models/conditions.py
1
2431
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .resort import Resort from django.db import models from django.contrib.postgres.fields import ArrayField from dynamic_scraper.models import Scraper, SchedulerRuntime from scrapy_djangoitem import DjangoItem import datetime # Past and...
mit
dardevelin/rhythmbox-gnome-fork
plugins/magnatune/MagnatuneSource.py
3
17929
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright (C) 2006 Adam Zimmerman <adam_zimmerman@sfu.ca> # Copyright (C) 2006 James Livingston <doclivingston@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-2.0
kubernetes-client/python
kubernetes/client/models/v1alpha1_pod_preset_spec.py
1
7114
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.18 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
apache-2.0
Krupamani/Shodana
django-admin-sortable/setup.py
5
1054
from setuptools import setup, find_packages try: README = open('README').read() except: README = None setup( name='django-admin-sortable', version=__import__('adminsortable').__version__, description='Drag and drop sorting for models and inline models in Django admin.', long_descrip...
agpl-3.0
artursmet/django-registration
setup.py
27
1877
from distutils.core import setup import os from registration import get_version # Compile the list of packages available, because distutils doesn't have # an easy way to do this. packages, data_files = [], [] root_dir = os.path.dirname(__file__) if root_dir: os.chdir(root_dir) for dirpath, dirnames, filenames i...
bsd-3-clause
gechr/ansible-modules-extras
system/make.py
44
3395
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # # This file is part of Ansible # # This module 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 ...
gpl-3.0
justinmeister/spaceinvaders-spyral
game/level.py
1
1501
import os import spyral from .sprites import sprite from . import collision WIDTH = 1200 HEIGHT = 900 WHITE = (255, 255, 255) SIZE = (WIDTH, HEIGHT) GREEN = (60, 179, 113) RED = (255, 0, 0) BLACKBLUE = (19, 15, 48) BG_COLOR = BLACKBLUE ENEMYGAP = 30 XMARGIN = 175 YMARGIN = 100 MOVEX = 15 MOVEY = 20 ENEMYSIDE = 50 BA...
mit
nakamura-akifumi/kassis_orange
app_search/helpers/paginate_helper.py
1
1579
import math class Paginate: def __init__(self, pagetab_count = 5, per_page = 10): pass self.pagetab_count = pagetab_count self.per_page = per_page def paginate(self, result_count, current_page): paginate_list = [] pagetab_count = self.pagetab_count per_page = se...
mit
harryliang/iScript
unzip.py
22
1752
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import os import sys import zipfile import argparse s = '\x1b[%d;%dm%s\x1b[0m' # terminual color template def unzip(path): file = zipfile.ZipFile(path,"r") if args.secret: file.setpassword(args.secret) for name in file.namelist(): try...
mit
kisonecat/sequences-and-series
quizzes/quizzes.py
3
12168
from sage.all import * from questions import * import time ################################################################ class Quiz: """Base class for all quizzes""" question_classes = [] title = 'Quiz' preamble = '' def __init__(self): self.questions = [question_class() for question_c...
gpl-3.0
taigaio/taiga-ncurses
taiga_ncurses/ui/widgets/wiki.py
3
2116
# -*- coding: utf-8 -*- """ taiga_ncurses.ui.widgets.wiki ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import urwid from taiga_ncurses import data from . import generic class WikiPage(urwid.WidgetWrap): on_wiki_page_change = None def __init__(self, project): self.project = project self.widget = urw...
apache-2.0
we350z/googlePythonClassSolutions
babynames/babynames.py
112
1886
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re """Baby Names exercise Define the extract_names() function below and c...
apache-2.0
gauribhoite/personfinder
env/google_appengine/lib/django-1.4/django/contrib/auth/management/commands/changepassword.py
97
1881
import getpass from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.db import DEFAULT_DB_ALIAS class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--database', action='stor...
apache-2.0
AuyaJackie/odoo
addons/crm/wizard/__init__.py
377
1169
# -*- 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
willemt/docopt2ragel
setup.py
1
1202
from setuptools import setup, find_packages import codecs from os import path here = path.abspath(path.dirname(__file__)) def long_description(): with codecs.open('README.rst', encoding='utf8') as f: return f.read() setup( name='docopt2ragel', version='0.1.3', description='Convert your doco...
bsd-3-clause
ttglennhall/DjangoGirlsTutorial
myvenv/lib/python3.4/site-packages/django/db/models/options.py
30
35264
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import AutoFiel...
mit
mm1ke/portage
pym/_emerge/actions.py
1
108119
# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import division, print_function, unicode_literals import errno import logging import operator import platform import pwd import random import re import signal import socket import stat import sub...
gpl-2.0
kawamon/hue
desktop/core/ext-py/docutils-0.14/docutils/languages/cs.py
148
1928
# $Id: cs.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Marek Blaha <mb@dat.cz> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each l...
apache-2.0
cloudera/hue
desktop/core/ext-py/Django-1.11.29/django/contrib/auth/management/commands/changepassword.py
51
2677
from __future__ import unicode_literals import getpass from django.contrib.auth import get_user_model from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT...
apache-2.0
cpennington/edx-platform
openedx/core/djangoapps/verified_track_content/views.py
4
1417
""" View methods for verified track content. """ from django.contrib.auth.decorators import login_required from opaque_keys.edx.keys import CourseKey from lms.djangoapps.courseware.courses import get_course_with_access from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackCohortedCourse from...
agpl-3.0
wwj718/murp-edx
lms/djangoapps/instructor/views/legacy.py
2
82681
""" Instructor Views """ ## NOTE: This is the code for the legacy instructor dashboard ## We are no longer supporting this file or accepting changes into it. from contextlib import contextmanager import csv import json import logging import os import re import requests from collections import defaultdict, OrderedDict...
agpl-3.0
ABaldwinHunter/django-clone
django/conf/locale/az/formats.py
1059
1267
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y г.' TIME_FORMAT = 'G:i' DAT...
bsd-3-clause
sclabs/sccms-nonrel
django/utils/crypto.py
245
1443
""" Django's standard crypto functions and utilities. """ import hmac from django.conf import settings from django.utils.hashcompat import sha_constructor, sha_hmac def salted_hmac(key_salt, value, secret=None): """ Returns the HMAC-SHA1 of 'value', using a key generated from key_salt and a secret (which...
bsd-3-clause
arbrandes/edx-platform
cms/djangoapps/api/v1/tests/test_views/test_course_runs.py
4
17096
"""Tests for Course run views""" import datetime from unittest.mock import patch # lint-amnesty, pylint: disable=unused-import import ddt import pytz from django.core.files.uploadedfile import SimpleUploadedFile from django.test import RequestFactory, override_settings from django.urls import reverse from opaque_ke...
agpl-3.0
frappe/erpnext
erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
2
18491
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe import _ from frappe.utils import flt, cstr from frappe.model.meta import get_field_precision from frappe.utils.xlsxu...
gpl-3.0
sinkuri256/python-for-android
python3-alpha/extra_modules/atom/mock_http.py
48
4452
#!/usr/bin/python # # Copyright (C) 2008 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 ...
apache-2.0
equialgo/scikit-learn
examples/cluster/plot_color_quantization.py
61
3444
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
andreaazzara/pyot
contiki-tres/cpu/cc2430/bank-alloc.py
9
7895
#!/usr/bin/env python # Copyright (c) 2010, Loughborough University - Computer Science # 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 ...
gpl-3.0
collinprice/titanium_mobile
node_modules/ioslib/node_modules/node-ios-device/node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
apache-2.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/scipy/optimize/nnls.py
116
1423
from __future__ import division, print_function, absolute_import from . import _nnls from numpy import asarray_chkfinite, zeros, double __all__ = ['nnls'] def nnls(A, b): """ Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper for a FORTAN non-negative least squares solver. Parameters...
agpl-3.0
pythonitalia/assopy
assopy/auth_backends.py
5
5285
# -*- coding: UTF-8 -*- from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User from django.db import transaction from assopy import models from assopy import settings if settings.GENRO_BACKEND: from assopy.clients import genro import logging log = logging.getLogger('ass...
bsd-2-clause
joram/sickbeard-orange
lib/unidecode/x021.py
82
3963
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
gpl-3.0
StrellaGroup/frappe
frappe/integrations/oauth2_logins.py
10
1068
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token import json @frappe.whitelist(allow_guest=True) def login_via_google(...
mit
Versent/ansible
lib/ansible/plugins/lookup/dnstxt.py
69
2188
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
KamLii/Databaes
Databaes/urls.py
1
1369
"""Databaes URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
kennedyshead/home-assistant
homeassistant/components/ipp/__init__.py
2
4560
"""The Internet Printing Protocol (IPP) integration.""" from __future__ import annotations from datetime import timedelta import logging from pyipp import IPP, IPPError, Printer as IPPPrinter from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.config_entries import ConfigEntry from...
apache-2.0
santhoshtr/mlmorph
tests/mlmorph-test.py
1
2470
import json import unittest import sys import os import re from mlmorph import Generator, Analyser CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) class Struct: def __init__(self, entries): self.__dict__.update(**entries) class AnalyserGeneratorTests(unittest.TestCase): gene...
gpl-3.0
vbillardm/vbillardm-webp2018-SI201704-la-truelle
wordpress/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
1835
12124
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
mit
prasaianooz/pip
tests/functional/test_uninstall_user.py
36
3417
""" tests specific to uninstalling --user installs """ import pytest from os.path import isdir, isfile from tests.lib import pyversion, assert_all_changes from tests.functional.test_install_user import _patch_dist_in_site_packages class Tests_UninstallUserSite: @pytest.mark.network def test_uninstall_from_u...
mit
ArcherSys/ArcherSys
Lib/site-packages/cms/tests/forms.py
8
6098
# -*- coding: utf-8 -*- from __future__ import with_statement from django.contrib.sites.models import Site from django.core.cache import cache from cms.admin import forms from cms.admin.forms import PageUserForm from cms.api import create_page, create_page_user from cms.forms.fields import PageSelectFormField, SuperL...
mit
Chilledheart/vbox
src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py
1
18147
# -*- coding: utf-8 -*- # $Id$ """ Test Manager WUI - TestBox. """ __copyright__ = \ """ Copyright (C) 2012-2014 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the te...
gpl-2.0
Makki1/old-svn
avr/sketchbook/GiraRM_Debug/freebus/freebus_ets/software/freebus-ets/src/GUI/FB_ProgramFrame.py
1
10920
#!/usr/bin/ #-*- coding: iso-8859-1 -*- #=============================================================================== # __________ ________________ __ _______ # / ____/ __ \/ ____/ ____/ __ )/ / / / ___/ # / /_ / /_/ / __/ / __/ / __ / / / /\__ \ # / __/ / _, _/ /___/ /___/ /_/ / /_/ /___/ /...
gpl-3.0
yury-s/v8-inspector
Source/chrome/tools/telemetry/telemetry/core/platform/tracing_category_filter_unittest.py
54
5954
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.core.platform import tracing_category_filter class TracingCategoryFilterTests(unittest.TestCase): def testBasic(self): ...
bsd-3-clause
lombritz/odoo
addons/sale_margin/__init__.py
441
1042
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
gsmaxwell/phase_offset_rx
gnuradio-core/src/examples/pfb/fmtest.py
17
7785
#!/usr/bin/env python # # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
iTagir/kubernetes
translations/extract.py
65
2987
#!/usr/bin/env python # Copyright 2017 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
cristiana214/cristianachavez214-cristianachavez
python/src/Lib/test/test_binhex.py
192
1027
#! /usr/bin/env python """Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. """ import binhex import os import unittest from test import test_support class BinHexTestCase(unittest.TestCase): def setUp(self): self.fname1 ...
apache-2.0
CristianBB/SickRage
lib/unidecode/x084.py
252
4646
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
gpl-3.0
scotthartbti/android_external_chromium_org
build/android/pylib/gtest/test_runner.py
28
7552
# 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. import logging import os import re from pylib import android_commands from pylib import constants from pylib import pexpect from pylib.base import base_...
bsd-3-clause
rapidpro/chatpro
chatpro/profiles/models.py
1
4753
from __future__ import absolute_import, unicode_literals from chatpro.rooms.models import Room from dash.orgs.models import Org from dash.utils import intersection from dash.utils.sync import ChangeType from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugette...
bsd-3-clause
kaiix/depot_tools
third_party/logilab/common/date.py
89
11230
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
bsd-3-clause
popazerty/e2_sh4
tests/test_timer.py
78
2469
import time import enigma import tests #enigma.reset() def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7): import NavigationInstance at = time.time() t = NavigationInstance.instance.RecordTimer print t print "old mwt:", t.MaxWaitTime t.MaxWaitTime = 86400 * 1000 t....
gpl-2.0
AlandSailingRobots/sailingrobot
update_config.py
1
1807
#!/usr/bin/python3 # Updates the configuration in the json to the database # Can run without argument for using standard file # Or specify the file by passing it as a argument import json import sqlite3 import sys if len(sys.argv) > 1: if str(sys.argv[1]) == 'ASPire': filename = 'config_ASPire.json' ...
gpl-2.0
benoitsteiner/tensorflow-opencl
tensorflow/python/grappler/memory_optimizer_test.py
9
9038
# 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
pepetreshere/odoo
doc/_extensions/autojsdoc/parser/tests/support.py
33
1767
# -*- coding: utf-8 -*- import operator import pyjsparser from autojsdoc.parser import jsdoc, parser params = operator.attrgetter('name', 'type', 'doc') def parse(s, source=None): tree = pyjsparser.parse(s) mods = parser.ModuleMatcher(source).visit(tree) post(mods) return mods def post(mods): ...
agpl-3.0
junfeng-hu/blog
blog/handlers.py
3
1071
#!/usr/bin/env python #---coding=utf8--- from HomeHandler import HomeHandler from LoginHandler import LoginHandler from LogoutHandler import LogoutHandler from ArchivesHandler import ArchivesHandler from CategoryHandler import CategoryHandler from TagHandler import TagHandler from PageHandler import PageHandler from Se...
mit
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/scipy/io/wavfile.py
19
12587
""" Module to read / write wav files using numpy arrays Functions --------- `read`: Return the sample rate (in samples/sec) and data from a WAV file. `write`: Write a numpy array as a WAV file. """ from __future__ import division, print_function, absolute_import import sys import numpy import struct import warnings...
mit
gnemoug/scrapy
scrapy/tests/test_link.py
27
1978
import unittest import warnings from scrapy.link import Link class LinkTest(unittest.TestCase): def _assert_same_links(self, link1, link2): self.assertEqual(link1, link2) self.assertEqual(hash(link1), hash(link2)) def _assert_different_links(self, link1, link2): self.assertNotEqual(l...
bsd-3-clause
xu6148152/Binea_Python_Project
PythonCookbook/text_str/strs_and_text.py
1
7706
# !python3 import re def test_re_split(): line = 'asdf fjdk; dfjkaf, fdjksf, jdksf, foo' print(re.split(r'[;,\s]\s*', line)) fields = re.split(r'(;|,|\s)\s*', line) print(fields) values = fields[::2] print(values) delimiter = fields[1::2] + [''] print(delimiter) print(re.split(...
mit
admire93/youtube-dl
youtube_dl/extractor/facebook.py
74
7339
from __future__ import unicode_literals import json import re import socket from .common import InfoExtractor from ..compat import ( compat_http_client, compat_str, compat_urllib_error, compat_urllib_parse_unquote, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none,...
unlicense
trishnaguha/pkgdb2
tests/test_package_listing.py
4
11765
# -*- coding: utf-8 -*- # # Copyright © 2013-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed...
gpl-2.0
irwinlove/scrapy
scrapy/spidermiddlewares/offsite.py
56
2119
""" Offsite Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import re import logging from scrapy import signals from scrapy.http import Request from scrapy.utils.httpobj import urlparse_cached logger = logging.getLogger(__name__) class OffsiteMiddleware(object): def __init__(self,...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/pip/_vendor/distlib/util.py
24
59494
# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl ...
gpl-3.0
microsoft/EconML
econml/drlearner.py
1
1068
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import econml.dr as dr from .utilities import deprecated @deprecated("The econml.drlearner.DRLearner class has been moved to econml.dr.DRLearner; " "an upcoming release will remove support for the old name") cla...
mit
andrewderekjackson/python_lcd_menu
lcd_menu/menu.py
1
4202
import os class MenuItem(object): '''A single menu item which can contain child menu items''' def __init__(self, title, items=None, refresh_callback=None, refresh_callback_args = None): self._title = title self._items = items self._refresh_callback = refresh_callback self._refr...
mit
smblance/ggplot
ggplot/tests/__init__.py
8
10135
from __future__ import (absolute_import, division, print_function, unicode_literals) import matplotlib as mpl import matplotlib.pyplot as plt from nose.tools import with_setup, make_decorator, assert_true import warnings figsize_orig = mpl.rcParams["figure.figsize"] def setup_package(): m...
bsd-2-clause
xiangel/hue
apps/beeswax/src/beeswax/migrations/0009_auto__chg_field_queryhistory_server_port.py
35
9498
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'QueryHistory.server_port' db.alter_column('beeswax_queryhistory', 'server_port', self.gf(...
apache-2.0