repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
pk400/catering
catering/migrations/0001_initial.py
1
1048
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-01-22 21:44 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depende...
mit
sinbazhou/odoo
addons/crm_profiling/crm_profiling.py
333
10527
# -*- 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
alfayez/gnuradio
gr-digital/python/qa_lms_equalizer.py
16
1728
#!/usr/bin/env python # # Copyright 2006,2007,2010,2011 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 (a...
gpl-3.0
ChonchoFronto/sarah
lambda/numpy/tests/test_ctypeslib.py
87
4097
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.ctypeslib import ndpointer, load_library from numpy.distutils.misc_util import get_shared_lib_extension from numpy.testing import TestCase, run_module_suite, dec try: cdll = load_library('multiarray', np.cor...
mit
fusionbox/satchless
satchless/order/forms.py
1
2605
from django import forms from django.forms.models import modelformset_factory from django.utils.translation import ugettext_lazy as _ from . import handler from . import models class DeliveryMethodForm(forms.ModelForm): delivery_type = forms.ChoiceField(label=_('Delivery method'), choices=[]) class Meta: ...
bsd-3-clause
Antiun/odoo
addons/mrp/wizard/change_production_qty.py
245
4852
# -*- 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
adoosii/edx-platform
lms/djangoapps/dashboard/views.py
131
3337
"""View functions for the LMS Student dashboard""" from django.http import Http404 from edxmako.shortcuts import render_to_response from django.db import connection from student.models import CourseEnrollment from django.contrib.auth.models import User def dictfetchall(cursor): '''Returns a list of all rows from...
agpl-3.0
lerouxb/ni
core/tokenizer.py
1
7558
import os import bisect from pygments.token import Token from pygments.lexers import get_lexer_by_name, get_lexer_for_filename, \ ClassNotFound # TODO: these really have to be moved to another file and it should be made # to be pluggable def isbacktracetoken_default(ttype, tvalue): return not ttype in Token....
mit
mozilla/kuma
kuma/api/management/commands/unpublish.py
1
1264
""" Manually schedule the removal of one or more documents from the document API. """ from collections import namedtuple from django.core.management.base import BaseCommand, CommandError from kuma.api.tasks import unpublish class Command(BaseCommand): args = '<document_path document_path ...>' help = 'Rem...
mpl-2.0
landism/pants
tests/python/pants_test/backend/python/test_interpreter_cache.py
5
5652
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from conte...
apache-2.0
roessland/PRST
setup.py
1
1197
# -*- coding: utf-8 -*- import os from setuptools import setup, Command, find_packages class CleanCommand(Command): """Custom clean command to tidy up project root.""" # http://stackoverflow.com/questions/3779915/ user_options = [] def initialize_options(self): pass def finalize_options(sel...
gpl-3.0
ritchyteam/odoo
addons/account_test/account_test.py
342
2169
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. # # $Id: product_expiry.py 4304 2006-10-25 09:54:51Z ged $ # # WARNING: This program as such is intended to be used by professional # prog...
agpl-3.0
mars-knowsnothing/amos-bot
src/Lib/site-packages/pip/_vendor/requests/api.py
362
5794
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :para...
gpl-3.0
rdeheele/odoo
addons/account_followup/account_followup.py
93
28777
# -*- 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
alu042/edx-platform
openedx/core/djangoapps/content/course_overviews/management/commands/generate_course_overview.py
7
1608
""" Command to load course overviews. """ import logging from optparse import make_option from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from openedx.core.djangoapps...
agpl-3.0
woobe/h2o
py/test_junit.py
2
1458
import unittest, time, sys import h2o class TestJUnit(unittest.TestCase): def test_A_all_junit(self): try: h2o.build_cloud(node_count=2, java_heap_GB=3) # we don't have the port or ip configuration here # that util/h2o.py does? Keep this in synch with spawn_h2o there. ...
apache-2.0
MoritzS/django
tests/auth_tests/client.py
85
1414
import re from django.contrib.auth.views import ( INTERNAL_RESET_SESSION_TOKEN, INTERNAL_RESET_URL_TOKEN, ) from django.test import Client def extract_token_from_url(url): token_search = re.search(r'/reset/.*/(.+?)/', url) if token_search: return token_search.group(1) class PasswordResetConfirm...
bsd-3-clause
TangHao1987/intellij-community
python/lib/Lib/quopri.py
424
6969
#! /usr/bin/env python """Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = '=' MAXLINESIZE = 76 HEX = '0123456789ABCDEF' EMPTYSTRING = '' try: from binascii import a2b_qp, b2a_qp except Impo...
apache-2.0
samfoo/servo
tests/wpt/css-tests/tools/wptserve/wptserve/pipes.py
180
13830
from cgi import escape import gzip as gzip_module import re import time import types import uuid from cStringIO import StringIO def resolve_content(response): rv = "".join(item for item in response.iter_content()) if type(rv) == unicode: rv = rv.encode(response.encoding) return rv class Pipeline...
mpl-2.0
alexrao/YouCompleteMe
third_party/ycmd/third_party/requests/requests/packages/urllib3/contrib/ntlmpool.py
1010
4507
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ try: from http.client import HTTPSConnection except ImportError: from httplib import HTTPSConnection from logging import getLogger from ntlm import ntlm from urllib3 import HTT...
gpl-3.0
benanne/theano-tutorial
3_logistic_regression.py
2
1394
import theano import theano.tensor as T import numpy as np import matplotlib.pyplot as plt plt.ion() import load # load data x_train, t_train, x_test, t_test = load.cifar10(dtype=theano.config.floatX) labels_test = np.argmax(t_test, axis=1) # visualize data plt.imshow(x_train[0].reshape(32, 32), cmap=plt.cm.gray) ...
mit
ateoto/django-recipebook
recipebook/admin.py
1
1161
from django.contrib import admin from django.contrib.contenttypes.models import ContentType from recipebook.models import ( Ingredient, Recipe, RecipeIngredient, IngredientLine ) class IngredientLineInline(admin.TabularInline): model = IngredientLine def get_formset(self, request, obj=None, **kwargs): ...
mit
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/saved_model/python/saved_model/signature_def_utils.py
113
1664
# 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
henryfjordan/django
django/contrib/flatpages/models.py
318
1556
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.core.urlresolvers import get_script_prefix from django.db import models from django.utils.encoding import iri_to_uri, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_...
bsd-3-clause
sanchezfauste/bPortal
portal/module_definitions/calls.py
1
1413
####################################################################### # bPortal is a SuiteCRM portal written using django project. # Copyright (C) 2017-2018 BTACTIC, SCCL # Copyright (C) 2017-2018 Marc Sanchez Fauste # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
pvagner/orca
src/orca/scripts/apps/notify-osd/script.py
4
3108
# Orca # # Copyright 2009 Eitan Isaacson # # 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 ...
lgpl-2.1
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/Week_3/playground/env/Lib/site-packages/pip/index.py
336
39950
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
apache-2.0
joebowen/LogMyRocket_API
LogMyRocket/libraries/sys_packages/requests/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
hungtt57/matchmaker
lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2360
3778
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
mit
rpatel3001/RU-Interested
serve.py
1
6781
from flask import * from flask_wtf import FlaskForm from flask_bootstrap import Bootstrap from wtforms import validators, TextField, IntegerField, SubmitField, SelectField, SelectMultipleField from datetime import datetime import psycopg2 import os import urllib.parse as urlparse import subprocess import time from math...
mit
simongoffin/website_version
openerp/report/printscreen/__init__.py
381
1203
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
epssy/hue
apps/filebrowser/src/filebrowser/lib/xxd_test.py
29
2104
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
Andypsamp/CODjunit
beetsplug/filefilter.py
25
2794
# This file is part of beets. # Copyright 2015, Malte Ried. # # 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 to use, copy, modi...
mit
mozilla/inventory
vendor-local/src/django-tastytools/tastytools/test/definitions/fields.py
5
8851
""" Defines the generator function for field test cases """ from django.test import TestCase from tastytools.test.client import Client, MultiTestCase, create_multi_meta from datetime import datetime from helpers import prepare_test_post_data import random class FieldNotSupportedException(Exception): pass def g...
bsd-3-clause
hail-is/hail
hail/python/hailtop/hailctl/dataproc/resources/init_notebook.py
1
6766
#!/opt/conda/default/bin/python3 import json import os import subprocess as sp import sys import errno from subprocess import check_output assert sys.version_info > (3, 0), sys.version_info if sys.version_info >= (3, 7): def safe_call(*args, **kwargs): sp.run(args, capture_output=True, check=True, **kwarg...
mit
GoogleCloudPlatform/training-data-analyst
courses/machine_learning/deepdive/08_image/flowersmodeltpu/trainer/preprocess.py
4
8254
# Copyright 2018 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 a...
apache-2.0
pedro2d10/SickRage-FR
lib/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
simobasso/ansible
lib/ansible/inventory/group.py
66
4669
# (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
p4datasystems/CarnotKEdist
dist/Lib/ensurepip/__init__.py
7
6655
#!/usr/bin/env python2 from __future__ import print_function import os import os.path import pkgutil import shutil import sys import tempfile __all__ = ["version", "bootstrap"] _SETUPTOOLS_VERSION = "18.4" _PIP_VERSION = "7.1.2" # pip currently requires ssl support, so we try to provide a nicer # error message w...
apache-2.0
cfriedt/gnuradio
gr-digital/python/digital/qa_map.py
57
1778
#!/usr/bin/env python # # Copyright 2012,2013 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 opt...
gpl-3.0
tovmeod/anaf
anaf/sales/api/urls.py
1
2683
# -*- coding: utf-8 -*- from anaf.sales.api import handlers from django.conf.urls import url, patterns from anaf.core.api.auth import auth_engine from anaf.core.api.doc import documentation_view from anaf.core.api.resource import CsrfExemptResource ad = {'authentication': auth_engine} # sales resources saleStatusRes...
bsd-3-clause
amanharitsh123/zulip
zerver/webhooks/airbrake/view.py
3
1508
# Webhooks for external integrations. from typing import Dict, Any, Text from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_stream_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ...
apache-2.0
marc-sensenich/ansible
test/units/module_utils/basic/test_filesystem.py
113
5190
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (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 ...
gpl-3.0
jpabferreira/linux-pcsws
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
mattvonrocketstein/ymir
docs/fabfile.py
1
4347
# -*- coding: utf-8 -*- from fabric import api import os import shutil from fabric import colors PORT = 8000 PROJECT_NAME = 'ymir' DOC_ROOT = os.path.dirname(__file__) SRC_ROOT = os.path.dirname(DOC_ROOT) GEN_PATH = os.path.join(DOC_ROOT, 'ymir') DEPLOY_PATH = "~/code/ghio/{0}".format(PROJECT_NAME) DEPLOY_PATH = os.pa...
mit
ycaihua/scikit-learn
sklearn/tests/test_pipeline.py
17
12512
""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from skle...
bsd-3-clause
raajitr/django_hangman
env/lib/python2.7/site-packages/requests/packages/urllib3/util/selectors.py
86
18836
# Backport of selectors.py from Python 3.5+ to support Python < 3.4 # Also has the behavior specified in PEP 475 which is to retry syscalls # in the case of an EINTR error. This module is required because selectors34 # does not follow this behavior and instead returns that no dile descriptor # events have occurred rath...
mit
calfonso/ansible
lib/ansible/modules/windows/win_file_version.py
22
1738
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Sam Liu <sam.liu@activenetwork.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by'...
gpl-3.0
superstack/nova
nova/api/openstack/server_metadata.py
3
3648
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
amisrs/angular-flask
angular_flask/lib/python2.7/site-packages/MySQLdb/__init__.py
76
3229
"""MySQLdb - A DB API v2.0 compatible interface to MySQL. This package is a wrapper around _mysql, which mostly implements the MySQL C API. connect() -- connects to server See the C API specification and the MySQL documentation for more info on other items. For information on how MySQLdb handles type conv...
mit
longmen21/edx-platform
lms/djangoapps/teams/models.py
48
10408
"""Django models related to teams functionality.""" from datetime import datetime from uuid import uuid4 import pytz from model_utils import FieldTracker from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from django.db import models from django.dispatch import receiver ...
agpl-3.0
Kalamatee/dhewm3
neo/sys/linux/runner/runner_lib.py
19
6735
# run doom process on a series of maps # can be used for regression testing, or to fetch media # keeps a log of each run ( see getLogfile ) # currently uses a basic stdout activity timeout to decide when to move on # using a periodic check of /proc/<pid>/status SleepAVG # when the sleep average is reaching 0, issue a ...
gpl-3.0
BoPeng/simuPOP
src/simuPOP_op.py
1
409827
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (3, 0, 0): new_instanc...
gpl-2.0
HPCGISLab/STDataViz
WorkingVersion/LibTry/Traits/traits_fileDialog.py
1
1490
#-- Imports -------------------------------------------------------------------- from traits.api \ import HasTraits, File, Button from traitsui.api \ import View, HGroup, Item from traitsui.file_dialog \ import open_file, FileInfo, TextInfo, ImageInfo #-- FileDialogDemo Class --------------------------...
bsd-3-clause
zero-ui/miniblink49
third_party/WebKit/Source/devtools/scripts/concatenate_application_code.py
22
11385
#!/usr/bin/env python # # 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. """ Release: - Concatenates autostart modules, application modules' module.json descriptors, and the application loader into a ...
gpl-3.0
dtroyer/python-openstacksdk
openstack/identity/v3/policy.py
1
1426
# 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
d-k-b/udacity-deep-learning
seq2seq/helper.py
1
1420
import os def load_data(path): input_file = os.path.join(path) with open(input_file, "r", encoding='utf-8', errors='ignore') as f: data = f.read() return data def extract_vocab(data): special_words = ['<pad>', '<unk>', '<s>', '<\s>'] set_words = set([word for line in dat...
mit
tinchoss/Python_Android
python-build/python-libs/gdata/src/atom/data.py
136
8060
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
apache-2.0
bswartz/cinder
cinder/volume/drivers/nexenta/nfs.py
1
33897
# Copyright 2016 Nexenta Systems, 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 req...
apache-2.0
mhild/Sick-Beard
lib/hachoir_parser/misc/pifv.py
90
8492
""" EFI Platform Initialization Firmware Volume parser. Author: Alexandre Boeglin Creation date: 08 jul 2007 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt8, UInt16, UInt24, UInt32, UInt64, Enum, CString, String, PaddingBytes, RawBytes, NullBytes) from lib.hachoir...
gpl-3.0
Chenmxs/scrapy
tests/test_linkextractors_deprecated.py
55
9518
import unittest from scrapy.linkextractors.regex import RegexLinkExtractor from scrapy.http import HtmlResponse from scrapy.link import Link from scrapy.linkextractors.htmlparser import HtmlParserLinkExtractor from scrapy.linkextractors.sgml import SgmlLinkExtractor, BaseSgmlLinkExtractor from tests import get_testdata...
bsd-3-clause
abadger/Bento
bento/private/_yaku/examples/fortran/conf_fortran.py
3
1061
import sys from yaku.scheduler \ import \ run_tasks from yaku.context \ import \ get_bld, get_cfg from yaku.conftests.fconftests \ import \ check_fcompiler, check_fortran_verbose_flag, \ check_fortran_runtime_flags, check_fortran_dummy_main, \ check_fortran_mangling...
bsd-3-clause
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/django/contrib/auth/models.py
104
17967
from __future__ import unicode_literals from django.contrib import auth from django.contrib.auth.hashers import ( check_password, is_password_usable, make_password, ) from django.contrib.auth.signals import user_logged_in from django.contrib.contenttypes.models import ContentType from django.core import validators...
bsd-3-clause
markoshorro/gem5
src/mem/MemChecker.py
42
2752
# Copyright (c) 2014 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
biolab/orange
Orange/testing/regression/tests_20/reference_domain2.py
6
1700
# Description: Shows how to use orange.Domain for example conversion. Also shows how to add meta-attributes to domain descriptors and use them. # Category: basic classes, meta-attributes # Classes: Domain # Uses: monk1 # Referenced: Domain.htm import orange data = orange.ExampleTable("monk1") d2 = ora...
gpl-3.0
RobotGarden/foscam-driver
camscheduler.py
1
4301
#!/usr/bin/env python """ Camera action scheduler. """ __author__ = "Daniel Casner <www.danielcasner.org>" import time import scheduler import control SEEK_TIME = 20.0 class CameraAction: """A general class for camera actions to queue""" def __init__(self, foscam, expire=None): """Store basic ac...
bsd-2-clause
3dfxsoftware/cbss-addons
crm_claim_rma/stock.py
1
3021
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 Camptocamp # Copyright 2009-2013 Akretion, # Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, # Benoît Guillot, Joel Grand-Guillaume # # This program is free software: y...
gpl-2.0
spatial-ucsb/ConceptsOfSpatialInformation
CoreConceptsPy/Astronomic_Spaces/tests/networktest.py
2
2411
""" Tests for network implementation :author: Fenja Kollasch, 06/2017 """ import sys sys.path.append('../') import networks as n import objects as o # Model the big dipper as unordered graph... because you can observe a constellation only from left to right... or so big_dipper = n.AstroNetwork("big dipper") alkaid = ...
apache-2.0
xenserver/xsconsole
plugins-base/XSFeatureLogInOut.py
4
2299
# Copyright (c) 2008-2009 Citrix Systems Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ...
gpl-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.2/django/contrib/flatpages/tests/csrf.py
47
3425
import os from django.conf import settings from django.test import TestCase, Client class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.client = Client(enforce_csrf_checks=True) self.old_MIDDLEWARE_CLASSES = ...
mit
rdo-management/heat
heat/tests/test_api_aws.py
7
10180
# # 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
lmazuel/azure-sdk-for-python
azure-mgmt-servermanager/azure/mgmt/servermanager/models/node_resource.py
4
2535
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
utecuy/edx-platform
cms/djangoapps/contentstore/management/commands/import.py
64
2065
""" Script for importing courseware from XML format """ from django.core.management.base import BaseCommand, CommandError, make_option from django_comment_common.utils import (seed_permissions_roles, are_permissions_roles_seeded) from xmodule.modulestore.xml_importer import imp...
agpl-3.0
alexholcombe/twoWords
oldData/Alex_16Mar2015_12-04.py
1
48426
#Alex Holcombe alex.holcombe@sydney.edu.au #See the github repository for more information: https://github.com/alexholcombe/twoWords from __future__ import print_function from psychopy import monitors, visual, event, data, logging, core, sound, gui import psychopy.info import numpy as np from math import atan, log, cei...
mit
cyberden/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/restudy.py
146
1155
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class RestudyIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)' _TEST = { 'url': 'https://www.restudy.dk/video/play/id/1637', 'info_dict': { 'id': ...
gpl-3.0
frankiecjunle/yunblog
venv/lib/python2.7/site-packages/werkzeug/exceptions.py
176
18733
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
mit
wolfmanstout/dragonfly
dragonfly/test/test_engine_sapi5.py
2
6568
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly 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 3 of the ...
lgpl-3.0
ench0/hlte-kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
agrista/odoo-saas
addons/crm_claim/report/__init__.py
446
1080
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
Kilhog/odoo
addons/email_template/ir_actions.py
281
3520
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
h2oai/h2o-2
scripts/dontrun_r_examples.py
9
5399
#!/usr/bin/python # # This tool goes through every file in the 'man' directory and automatically makes the example \dontrun. # import sys import os import re import shutil STATE_NONE = 1 STATE_IN_EXAMPLES = 2 STATE_IN_CRAN_EXAMPLES = 3 STATE_IN_DONTRUN = 4 class Example: def __init__(self, dir_name, file_name...
apache-2.0
francisco-dlp/hyperspy
hyperspy/samfire_utils/segmenters/histogram.py
6
3203
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
t794104/ansible
lib/ansible/modules/network/f5/bigip_profile_udp.py
38
14130
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
glogiotatidis/bedrock
tests/redirects/base.py
9
6982
import re from urlparse import urlparse, parse_qs from braceexpand import braceexpand import requests def get_abs_url(url, base_url): try: if url.pattern.startswith('/'): # url is a compiled regular expression pattern return re.compile(''.join([re.escape(base_url), url.pattern])) ...
mpl-2.0
feist/pcs
pcs/lib/cib/resource/primitive.py
1
8042
from lxml import etree from pcs.common import report_codes from pcs.lib import reports from pcs.lib.cib.nvpair import ( append_new_instance_attributes, append_new_meta_attributes, get_value, get_nvset_as_dict, ) from pcs.lib.cib.resource.operations import( prepare as prepare_operations, create_...
gpl-2.0
cesargtz/YecoraOdoo
addons/l10n_pa/__openerp__.py
260
1737
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
shams169/pythonProject
ContactsDir/env/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
teije01/Doris-StaMPS-int
Sentinel/BperpDate.py
1
7306
#!/usr/bin/env python import numpy as np import sys import numpy.polynomial.polynomial as poly from scipy import interpolate from scipy.optimize import fmin arg = sys.argv; #print arg def readorb(filename): with open(filename, "r") as ins: array = [] mode = "search" for line in ins: ...
mit
ARM-software/bob-build
config_system/tests/run_tests_formatter.py
1
2381
#!/usr/bin/env python # Copyright 2019 Arm Limited. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
apache-2.0
PinguinoIDE/pinguino-ide
pinguino/qtgui/ide/methods/timed_methods.py
1
10604
#!/usr/bin/env python #-*- coding: utf-8 -*- import os import codecs from PySide2 import QtGui from .core_threads import UpdateAutocompleter from ..methods.decorators import Decorator # from ..tools.code_navigator import self from ..methods.dialogs import Dialogs ####################################################...
gpl-2.0
adw0rd/lettuce
tests/integration/lib/Django-1.3/django/contrib/sessions/backends/base.py
245
10286
import base64 import os import random import sys import time from datetime import datetime, timedelta try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.hashcompat import md5_constructor from ...
gpl-3.0
hickey/amforth
core/devices/at90can64/device.py
5
9972
# Partname: AT90CAN64 # generated automatically, do not edit MCUREGS = { 'PORTA': '&34', 'DDRA': '&33', 'PINA': '&32', 'PORTB': '&37', 'DDRB': '&36', 'PINB': '&35', 'PORTC': '&40', 'DDRC': '&39', 'PINC': '&38', 'PORTD': '&43', 'DDRD': '&42', 'PIND': '&41', 'PORTE': '&46', 'DDRE': '&45', 'PINE': '&44', ...
gpl-2.0
ct-23/home-assistant
homeassistant/components/sensor/google_travel_time.py
3
9936
""" Support for Google travel time sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.google_travel_time/ """ from datetime import datetime from datetime import timedelta import logging import voluptuous as vol from homeassistant.components...
apache-2.0
fbradyirl/home-assistant
script/hassfest/__main__.py
1
2256
"""Validate manifests.""" import pathlib import sys from .model import Integration, Config from . import codeowners, config_flow, dependencies, manifest, services, ssdp, zeroconf PLUGINS = [codeowners, config_flow, dependencies, manifest, services, ssdp, zeroconf] def get_config() -> Config: """Return config.""...
apache-2.0
nikhilprathapani/python-for-android
python3-alpha/python3-src/Lib/test/test_tempfile.py
46
35200
# tempfile.py unit tests. import tempfile import os import sys import re import warnings import unittest from test import support if hasattr(os, 'stat'): import stat has_stat = 1 else: has_stat = 0 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags) has_spawnl = hasattr(os, 'spawnl') #...
apache-2.0
fredyangliu/linux-2.6-imx
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
dwfreed/mitmproxy
test/pathod/tservers.py
4
3497
import tempfile import re import shutil import requests import io import urllib from mitmproxy.net import tcp from mitmproxy.test import tutils from pathod import language from pathod import pathoc from pathod import pathod from pathod import test def treader(bytes): """ Construct a tcp.Read object fro...
mit
Yuriy-Leonov/nova
nova/api/openstack/compute/contrib/extended_floating_ips.py
15
1055
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
apache-2.0
ROMFactory/android_external_chromium_org
build/protoc_java.py
90
1317
#!/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. """Generate java source files from protobufs Usage: protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}...
bsd-3-clause
kambysese/mne-python
examples/preprocessing/plot_virtual_evoked.py
10
1912
""" ======================= Remap MEG channel types ======================= In this example, MEG data are remapped from one channel type to another. This is useful to: - visualize combined magnetometers and gradiometers as magnetometers or gradiometers. - run statistics from both magnetometers and gradi...
bsd-3-clause