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 |
|---|---|---|---|---|---|
maellak/invenio | modules/bibedit/lib/bibeditmulti_webinterface.py | 17 | 12941 | ## This file is part of Invenio.
## Copyright (C) 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 option) any later versio... | gpl-2.0 |
wolfskaempf/ga_statistics | lib/python2.7/site-packages/django/contrib/gis/gdal/raster/band.py | 99 | 1860 | from ctypes import byref, c_int
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.prototypes import raster as capi
from django.utils.encoding import force_text
from .const import GDAL_PIXEL_TYPES
class GDALBand(GDALBase):
"""
Wraps a GDAL raster band, needs to be obtained from a... | mit |
krast/suse_xen | tools/python/xen/xend/sxp.py | 40 | 19230 | #!/usr/bin/env python
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is dist... | gpl-2.0 |
yqm/sl4a | python-build/python-libs/gdata/tests/all_tests_clear_cache.py | 128 | 1057 | #!/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... | apache-2.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/GardeningServer/internal_alerts.py | 9 | 1590 | # 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 datetime
import alerts
import json
import webapp2
from google.appengine.api import users
class InternalAlertsHandler(alerts.AlertsHandler):
MEM... | bsd-3-clause |
thaim/ansible | lib/ansible/plugins/lookup/cyberarkpassword.py | 14 | 6181 | # (c) 2017, Edward Nunez <edward.nunez@cyberark.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)
__metaclass__ = type
DOCUMENTATION = """
lookup: cyberarkpassword
versi... | mit |
kotobank/Python-Examples | folder_file_counter.py | 1 | 1526 | __author__ = 'Shawn Daniel'
"""
Initially decided to write this for some server software although, it is a good example
for python beginners and can be generally useful when more capabilities added.
"""
import os
from sys import argv
import time
# path = "C:\\test"
script, path = argv
folders = {key: 0 for key in os.... | gpl-2.0 |
sorenk/ansible | lib/ansible/modules/remote_management/hpilo/hpilo_facts.py | 46 | 7753 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
MobinRanjbar/hue | desktop/libs/notebook/src/notebook/connectors/tests/tests_spark.py | 8 | 14845 | #!/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 |
vrsource/mapproxy | mapproxy/test/unit/test_cache_riak.py | 2 | 2456 | # This file is part of the MapProxy project.
# Copyright (C) 2013 Omniscale <http://omniscale.de>
#
# 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 |
litchfield/django | django/utils/http.py | 285 | 9978 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | bsd-3-clause |
cnvogelg/fs-uae | dist/macosx/standalone.py | 4 | 2141 | #!/usr/bin/env python3
import os
import sys
import shutil
import subprocess
def fix_binary(path, frameworks_dir):
print("fixing", path)
changes = 0
if not os.path.exists(path):
raise Exception("could not find " + repr(path))
args = ["otool", "-L", path]
p = subprocess.Popen(args, stdout=su... | gpl-2.0 |
Bogon/httpie | tests/test_unicode.py | 49 | 3276 | # coding=utf-8
"""
Various unicode handling related tests.
"""
from utils import http, HTTP_OK
from fixtures import UNICODE
class TestUnicode:
def test_unicode_headers(self, httpbin):
# httpbin doesn't interpret utf8 headers
r = http(httpbin.url + '/headers', u'Test:%s' % UNICODE)
assert... | bsd-3-clause |
tectronics/prometeo-erp | core/widgets/signals.py | 3 | 1913 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 License, or (at your
option... | lgpl-3.0 |
otherness-space/myProject | my_project_001/lib/python2.7/site-packages/django/contrib/localflavor/fi/forms.py | 109 | 1907 | """
FI-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.fi.fi_municipalities import MUNICIPALITY_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexFie... | mit |
andrew-szymanski/gae_django | django/conf/locale/pt/formats.py | 232 | 1532 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y à... | bsd-3-clause |
n-west/gnuradio-volk | gnuradio-runtime/python/gnuradio/ctrlport/monitor.py | 17 | 2677 | #!/usr/bin/env python
#
# Copyright 2012 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 |
jjkoletar/panda3d | contrib/src/sceneeditor/seFileSaver.py | 8 | 62628 | ####################################################################################################################################################
# File Saving
# This code saves the scene out as python code... the scene is stored in the various dictionaries in "dataHolder.py" ...the class "AllScene"
#
########... | bsd-3-clause |
lyft/graphite-web | webapp/graphite/metrics/views.py | 23 | 9657 | """Copyright 2009 Chris Davis
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
dist... | apache-2.0 |
chipx86/reviewboard | reviewboard/reviews/tests/test_counters.py | 2 | 36716 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from kgb import SpyAgency
from reviewboard.accounts.models import Profile, LocalSiteProfile
from reviewboard.reviews.errors import NotModifiedError
from reviewboard.reviews.models import (Group, ReviewRequest,
... | mit |
tombstone/models | research/attention_ocr/python/model_export.py | 1 | 7063 | # Lint as: python3
# Copyright 2020 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 ... | apache-2.0 |
haoxli/web-testing-service | tools/pywebsocket/src/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py | 499 | 1854 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
dwightgunning/django | tests/template_tests/filter_tests/test_floatformat.py | 345 | 4480 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal, localcontext
from unittest import expectedFailure
from django.template.defaultfilters import floatformat
from django.test import SimpleTestCase
from django.utils import six
from django.utils.safestring import mark_safe
from ... | bsd-3-clause |
joshimoo/Algorithm-Implementations | Average/Python/wasi0013/Average.py | 25 | 2303 | from math import log
"""
-- Various average (means) algorithms implementation
-- See: http://en.wikipedia.org/wiki/Average
-- Returns the sum of a sequence of values
"""
#Calculates the arithmetic mean of the list numbers and returns the result
def arithmetic_mean(numbers): return float(sum(numbers))/len(numbers)
... | mit |
nhalloran/three.js | utils/exporters/blender/addons/io_three/exporter/object.py | 19 | 6762 | from .. import constants, logger
from . import base_classes, api
class Object(base_classes.BaseNode):
"""Class that wraps an object node"""
def __init__(self, node, parent=None, type=None):
logger.debug("Object().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent=parent, ty... | mit |
roadmapper/ansible | lib/ansible/module_utils/gitlab.py | 10 | 3807 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2018, Marcus Watkins <marwatk@marcuswatkins.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import
import json
from distutils.version... | gpl-3.0 |
wangjun/BT-Share | web/test/base.py | 2 | 1917 | #!/usr/bin/env python
# encoding: utf-8
import traceback
from tornado.web import RequestHandler
from tornado.options import options
class BaseHandler(RequestHandler):
def render_string(self, template_name, **kwargs):
kwargs["options"] = options
return super(BaseHandler, self).render_string(templ... | mit |
indictranstech/internal-erpnext | erpnext/buying/doctype/purchase_common/purchase_common.py | 6 | 5128 | # 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
from frappe.utils import flt
from frappe import _
from erpnext.stock.doctype.item.item import get_last_purchase_details
from erpnext.cont... | agpl-3.0 |
sinbazhou/odoo | addons/website_forum/models/forum.py | 233 | 38491 | # -*- coding: utf-8 -*-
from datetime import datetime
import uuid
from werkzeug.exceptions import Forbidden
import logging
import openerp
from openerp import api, tools
from openerp import SUPERUSER_ID
from openerp.addons.website.models.website import slug
from openerp.exceptions import Warning
from openerp.osv impo... | agpl-3.0 |
jonandergomez/machine_learning_for_students | hmm/Transitions.py | 1 | 6216 | """
Author: Jon Ander Gomez Adrian (jon@dsic.upv.es, http://personales.upv.es/jon)
Version: 2.0
Date: September 2016
Universitat Politecnica de Valencia
Technical University of Valencia TU.VLC
"""
import numpy
from .Constants import Constants
class Transitions:
"""
"""
PROB_TRANSITION... | mit |
andmos/ansible | lib/ansible/module_utils/facts/other/facter.py | 232 | 2985 | # 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 in the hope that ... | gpl-3.0 |
qenter/vlc-android | toolchains/arm/lib/python2.7/lib2to3/fixes/fix_except.py | 326 | 3352 | """Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
... | gpl-2.0 |
motion3/dino_rumble | pygame/tests/surflock_test.py | 6 | 5186 | if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.inser... | mit |
jjdmol/LOFAR | LTA/ltastorageoverview/test/test_lso_webservice.py | 1 | 4571 | #!/usr/bin/python
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU Genera... | gpl-3.0 |
eckucukoglu/arm-linux-gnueabihf | arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_descr.py | 36 | 160313 | import __builtin__
import gc
import sys
import types
import unittest
import weakref
from copy import deepcopy
from test import test_support
class OperatorsTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
self.binops = {
'... | gpl-2.0 |
DazWorrall/ansible | lib/ansible/modules/network/avi/avi_alertsyslogconfig.py | 27 | 3648 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | gpl-3.0 |
jbooth/flotilla | Godeps/_workspace/src/github.com/ugorji/go/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | bsd-2-clause |
shabab12/edx-platform | pavelib/paver_tests/test_utils.py | 27 | 1437 | """
Tests for pavelib/utils/test/utils
"""
from pavelib.utils.test.utils import check_firefox_version, MINIMUM_FIREFOX_VERSION
import unittest
from mock import patch
class TestUtils(unittest.TestCase):
"""
Test utils.py under pavelib/utils/test
"""
@patch('subprocess.check_output')
def test_fire... | agpl-3.0 |
jseabold/scipy | scipy/signal/__init__.py | 20 | 11295 | """
=======================================
Signal processing (:mod:`scipy.signal`)
=======================================
Convolution
===========
.. autosummary::
:toctree: generated/
convolve -- N-dimensional convolution.
correlate -- N-dimensional correlation.
fftconvolve -- N-dimensional convol... | bsd-3-clause |
donnydevito/py-academicstoday | academicstoday_project/teacher/views/overview.py | 3 | 8340 | from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.conf import settings
import json
impo... | apache-2.0 |
ifduyue/sentry | src/sentry/middleware/superuser.py | 3 | 1390 | from __future__ import absolute_import
from django.conf import settings
from sentry.auth.superuser import logger, Superuser
class SuperuserMiddleware(object):
def process_request(self, request):
# This avoids touching user session, which means we avoid
# setting `Vary: Cookie` as a response head... | bsd-3-clause |
rvalera01/platalist | default.py | 1 | 96089 | # -*- coding: utf-8 -*-
import urllib
import urllib2
import datetime
import re
import os
import xbmcplugin
import xbmcgui
import xbmcaddon
import xbmcvfs
import traceback
import cookielib
from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup, BeautifulSOAP
try:
import json
except:
import simplejson as jso... | gpl-2.0 |
prabhu-k/three.js | utils/exporters/blender/addons/io_three/dialogs.py | 299 | 2487 | from bpy import context
CONTEXT = {
0: {
'title': "Error Message",
'icon': 'CANCEL'
},
1: {
'title': "Warning Message",
'icon': 'ERROR' # I prefer this icon for warnings
},
2: {
'title': "Message",
'icon': 'NONE'
},
3: {
'title': "Ques... | mit |
RamaraoDonta/ramarao-clone | py/selenium/webdriver/common/alert.py | 43 | 2320 | #Copyright 2007-2009 WebDriver committers
#Copyright 2007-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 b... | apache-2.0 |
leapp-to/prototype | docs/source/autosectionlabelext.py | 2 | 1981 | # -*- coding: utf-8 -*-
"""
sphinx.ext.autosectionlabel
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allow reference sections by :ref: role using its title.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from docutils import nodes
# from sphinx.locale... | lgpl-2.1 |
yongshengwang/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/utils/ogrinfo.py | 236 | 1982 | """
This module includes some utility functions for inspecting the layout
of a GDAL data source -- the functionality is analogous to the output
produced by the `ogrinfo` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.geometries import GEO_CLASSES
def ogrinfo(data_source, num_... | apache-2.0 |
jaddison/ansible-modules-core | cloud/openstack/_nova_keypair.py | 149 | 5478 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
# (c) 2013, John Dewey <john@dewey.ws>
#
# 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 the Li... | gpl-3.0 |
Pakoach/Sick-Beard | sickbeard/providers/tvtorrents.py | 38 | 3011 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
nitin-cherian/Webapps | TalkPython/P4E/my_web_app/.env/lib/python3.5/site-packages/pip/_vendor/progress/spinner.py | 510 | 1314 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | mit |
rohitwaghchaure/digitales_erpnext | erpnext/controllers/stock_controller.py | 14 | 10939 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, flt, cstr
from frappe import msgprint, _
import frappe.defaults
from erpnext.controllers.accounts_contr... | agpl-3.0 |
chylli/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/cpp.py | 113 | 165357 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009, 2010, 2012 Google Inc. All rights reserved.
# Copyright (C) 2009 Torch Mobile Inc.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modi... | bsd-3-clause |
pansapiens/mytardis-seqfac | sequencing_facility/api.py | 1 | 7021 | from tastypie.contrib.contenttypes.fields import GenericForeignKeyField
from tastypie.exceptions import Unauthorized
from tardis.tardis_portal import api as tardis_api
from tardis.tardis_portal.models.experiment import Experiment
from tardis.tardis_portal.models.parameters import ParameterName
from tardis.tardis_port... | apache-2.0 |
Peddle/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/describe_form.py | 35 | 2526 | from django.core.management.base import LabelCommand, CommandError
from django_extensions.management.utils import signalcommand
try:
from django.utils.encoding import force_text
except:
from django.utils.encoding import force_unicode as force_text
class Command(LabelCommand):
help = "Outputs the specifie... | apache-2.0 |
DanielNeugebauer/adhocracy | src/adhocracy/lib/helpers/text_helper.py | 4 | 1238 | from adhocracy import config
from adhocracy.lib import cache
from adhocracy.lib.helpers import url as _url
from adhocracy.lib.text.truncate import truncate
@cache.memoize('text_url')
def url(text, **kwargs):
import page_helper as page
if text is None:
return ''
in_context = (text == text.page.vari... | agpl-3.0 |
hagar006/android_kernel_sony_apq8064 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
noironetworks/horizon | openstack_dashboard/dashboards/project/networks/ports/tabs.py | 7 | 1959 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
Manojkumar91/odoo_inresto | addons/mrp/procurement.py | 8 | 7253 | # -*- 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 |
diegueus9/django-rest-framework-jwt | rest_framework_jwt/serializers.py | 13 | 5320 | import jwt
from calendar import timegm
from datetime import datetime, timedelta
from django.contrib.auth import authenticate
from django.utils.translation import ugettext as _
from rest_framework import serializers
from .compat import Serializer
from rest_framework_jwt.settings import api_settings
from rest_framewor... | mit |
xxsergzzxx/python-for-android | python3-alpha/extra_modules/gdata/tlslite/integration/XMLRPCTransport.py | 48 | 5828 | """TLS Lite + xmlrpclib."""
import xmlrpc.client
import http.client
from gdata.tlslite.integration.HTTPTLSConnection import HTTPTLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class XMLRPCTransport(xmlrpc.client.Transport, ClientHelper):
"""Handles an HTTPS transaction to an XML-RPC... | apache-2.0 |
tealover/nova | nova/tests/unit/api/openstack/compute/contrib/test_multiple_create.py | 13 | 22783 | # Copyright 2013 IBM 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
ravindrapanda/tensorflow | tensorflow/python/eager/graph_callable.py | 5 | 16481 | # 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 |
underwriteme/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py | 261 | 9573 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/encodings/email/test/test_email.py | 22 | 131866 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
# email package unit tests
import os
import sys
import time
import base64
import difflib
import unittest
import warnings
import textwrap
from cStringIO import StringIO
from random import choice
import email
from email.Charset import... | gpl-3.0 |
Titan-C/sympy | sympy/utilities/iterables.py | 13 | 65726 | from __future__ import print_function, division
from collections import defaultdict
from itertools import (
combinations, combinations_with_replacement, permutations,
product, product as cartes
)
import random
from operator import gt
from sympy.core import Basic
# this is the logical location of these functi... | bsd-3-clause |
msotov/SPECIES | Atmos.py | 1 | 54873 | from __future__ import division
from builtins import range
import os
import math
import re
from dataclasses import dataclass
from past.utils import old_div
import numpy as np
from astropy.stats import sigma_clip
from astropy.io import ascii
from scipy.stats import sigmaclip, linregress
import scipy.odr as ODR
#from int... | mit |
molejar/pyOCD | pyOCD/target/target_lpc1768.py | 5 | 1657 | """
mbed CMSIS-DAP debugger
Copyright (c) 2006-2015 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | apache-2.0 |
jaor/python | bigml/tests/my_ensemble/model_59db76eb9b356c2c97004802.py | 3 | 4091 |
# -*- coding: utf-8 -*-
def predict_final(prefix=None,
assignment=None,
tutorial=None,
midterm=None,
takehome=None,
final=None):
""" Predictor for Final from model/59db76eb9b356c2c97004802
Predictive model by BigML -... | apache-2.0 |
py-geek/City-Air | venv/lib/python2.7/site-packages/pymysql/_socketio.py | 53 | 4049 | """
SocketIO imported from socket module in Python 3.
Copyright (c) 2001-2013 Python Software Foundation; All Rights Reserved.
"""
from socket import *
import io
import errno
__all__ = ['SocketIO']
EINTR = errno.EINTR
_blocking_errnos = (errno.EAGAIN, errno.EWOULDBLOCK)
class SocketIO(io.RawIOBase):
"""Raw I/... | mit |
pwhelan/djshouts | django/core/mail/message.py | 151 | 12967 | import mimetypes
import os
import random
import time
from email import Charset, Encoders
try:
from email.generator import Generator
except ImportError:
from email.Generator import Generator # TODO: Remove when remove Python 2.4 support
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMult... | bsd-3-clause |
dajohnso/cfme_tests | cfme/intelligence/reports/widgets/__init__.py | 1 | 7140 | # -*- coding: utf-8 -*-
"""Page model for Cloud Intel / Reports / Dashboard Widgets"""
from utils.wait import wait_for
from utils.pretty import Pretty
from utils.update import Updateable
from utils.appliance import Navigatable
from utils.appliance.implementations.ui import CFMENavigateStep, navigator, navigate_to
from ... | gpl-2.0 |
chandlercr/aima-python | submissions/Anderson/puzzle-submissions.py | 19 | 4205 | import agents as ag
# import envgui as gui
import importlib
import traceback
import search
from utils import(isnumber, memoize)
from math import(inf)
class MyException(Exception):
pass
roster = ['Anderson', 'Ban','Becker','Blue','Capps','Conklin','Dickenson',
'Fritz','Haller','Hawley','Hess','Johnson','... | mit |
163gal/Time-Line | libs_arm/wx/py/editwindow.py | 2 | 10670 | """EditWindow class."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
import wx
from wx import stc
import keyword
import os
import sys
import time
import dispatcher
from version import VERSION
if 'wxMSW' in wx.PlatformInfo:
FACES = { 'times' ... | gpl-3.0 |
jaymiejones86/jaymiejones.com | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_phpbuiltins.py | 274 | 122046 | # -*- coding: utf-8 -*-
"""
pygments.lexers._phpbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... | mit |
nitely/http-lazy-headers | tests/tests_fields_/tests_content_language.py | 1 | 2107 | # -*- coding: utf-8 -*-
import http_lazy_headers as hlh
from . import utils
class ContentLanguageTest(utils.FieldTestCase):
field = hlh.ContentLanguage
def test_raw_values(self):
self.assertFieldRawEqual(
['mi, da', 'en'],
(('mi', (), None, None, (), (), (), None),
... | mit |
martynovp/edx-platform | lms/djangoapps/courseware/tests/test_masquerade.py | 24 | 9401 | """
Unit tests for masquerade.
"""
import json
from mock import patch
from nose.plugins.attrib import attr
from datetime import datetime
from django.core.urlresolvers import reverse
from django.utils.timezone import UTC
from capa.tests.response_xml_factory import OptionResponseXMLFactory
from courseware.masquerade im... | agpl-3.0 |
alikins/ansible | lib/ansible/modules/cloud/amazon/sts_assume_role.py | 12 | 6436 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
XiaosongWei/chromium-crosswalk | tools/telemetry/third_party/modulegraph/modulegraph/__main__.py | 25 | 2305 | from __future__ import print_function
import sys
import os
import optparse
import textwrap
from .modulegraph import ModuleGraph
def main():
# Parse command line
usage = textwrap.dedent('''\
Usage:
modulegraph [options] scriptfile ...
Valid options:
* -d: Increase debug leve... | bsd-3-clause |
ZazieTheBeast/oscar | oscar/lib/python2.7/site-packages/wheel/metadata.py | 230 | 11050 | """
Tools for converting old- to new-style metadata.
"""
from collections import namedtuple
from .pkginfo import read_pkg_info
from .util import OrderedDefaultDict
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
import re
import os.path
import textwrap
import pkg_resources
impo... | bsd-3-clause |
funkyfuture/docker-py | docker/api/network.py | 1 | 10427 | from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt
from .. import utils
class NetworkApiMixin(object):
def networks(self, names=None, ids=None, filters=None):
"""
List networks. Similar to the ``docker network ls`` command.
... | apache-2.0 |
alxgu/ansible | lib/ansible/modules/network/system/net_logging.py | 26 | 2394 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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 |
dreispt/project-service | project_classification/__openerp__.py | 10 | 1697 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-guillaume (Camptocamp)
# Copyright 2011 Camptocamp SA
#
# 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 |
nooperpudd/pulsar | pulsar/utils/system/winservice.py | 7 | 2689 | import os
import sys
import logging
import time
import pythoncom # noqa
import win32serviceutil
import win32service
import win32event
import win32api
import servicemanager
import pulsar
from pulsar.utils.importer import import_module
import multiprocessing # noqa
class ServiceManagerLogHandler(logg... | bsd-3-clause |
mkaluza/external_chromium_org | tools/checkdeps/rules.py | 26 | 6698 | # Copyright 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.
"""Base classes to represent dependency rules, used by checkdeps.py"""
import os
import re
class Rule(object):
"""Specifies a single rule for an includ... | bsd-3-clause |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/fnmatch.py | 324 | 3239 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | gpl-2.0 |
rekbun/browserscope | categories/selectors/test_set.py | 9 | 3635 | #!/usr/bin/python2.5
#
# Copyright 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 law or ... | apache-2.0 |
Jozhogg/iris | docs/iris/example_tests/test_cross_section.py | 1 | 1274 | # (C) British Crown Copyright 2010 - 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 License, or
# (at your option) any l... | lgpl-3.0 |
Capitains/MyCapytain | tests/resources/texts/local/test_capitains_xml_notObjectified.py | 1 | 4473 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from io import open
import xmlunittest
from lxml import etree
import MyCapytain.common.reference
import MyCapytain.common.reference._capitains_cts
import MyCapytain.errors
import MyCapytain.resources.texts.base.tei
import MyCapytain.reso... | mpl-2.0 |
XiMuYouZi/PythonDemo | Web/zhihu/user/view.py | 1 | 1047 | from . import user
from flask import jsonify, request
import json
import pymongo
from bson import BSON, json_util
user_data = [
{
'id': 1,
'name': '张三',
'age': 23
},
{
'id': 2,
'name': '李四',
'age': 24
}
]
MONGO_URI = 'localhost'
MONGO_DATABASE = 'zhihu'
... | mit |
lkc9015/freestyle_project | app/NLP_LDA.py | 1 | 4348 | import csv
import sklearn.feature_extraction.text as text
import numpy as np
from sklearn.decomposition import LatentDirichletAllocation
import matplotlib.pyplot as plt
### customize function ###
def read_letter_from_file(csv_file_path):
letters = []
with open(csv_file_path, "r") as csv_file:
reader =... | mit |
terbolous/SickRage | sickbeard/providers/binsearch.py | 3 | 4122 | # coding=utf-8
# Author: moparisthebest <admin@moparisthebest.com>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 ver... | gpl-3.0 |
40123237/w17test | static/Brython3.1.0-20150301-090019/Lib/xml/dom/minicompat.py | 781 | 3228 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... | gpl-3.0 |
parksandwildlife/wastd | taxonomy/migrations/0009_auto_20181129_1818.py | 1 | 3205 | # Generated by Django 2.0.8 on 2018-11-29 10:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taxonomy', '0008_auto_20181129_1813'),
]
operations = [
migrations.AlterField(
model_name='hbvfamily',
name='class_n... | mit |
mantidproject/mantid | Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py | 3 | 14425 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 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 - Identifier: GPL - 3.0 +
#pyl... | gpl-3.0 |
sajeeshcs/nested_quota_final | nova/tests/unit/keymgr/test_conf_key_mgr.py | 71 | 2034 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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 |
Jorge-Rodriguez/ansible-modules-core | cloud/amazon/ec2_group.py | 10 | 18019 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
eadgarchen/tensorflow | tensorflow/contrib/kfac/python/ops/layer_collection.py | 6 | 29767 | # 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 |
Gadal/sympy | sympy/polys/domains/expressiondomain.py | 81 | 5978 | """Implementation of :class:`ExpressionDomain` class. """
from __future__ import print_function, division
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.core import sympify, Sympify... | bsd-3-clause |
frankiecjunle/yunblog | venv/lib/python2.7/site-packages/werkzeug/__init__.py | 36 | 6920 | # -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... | mit |
ChrisGoedhart/Uforia | source/django/contrib/flatpages/views.py | 94 | 2859 | from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from dja... | gpl-2.0 |
hgl888/chromium-crosswalk-efl | build/android/pylib/utils/parallelizer.py | 29 | 7116 | # 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.
""" Wrapper that allows method execution in parallel.
This class wraps a list of objects of the same type, emulates their
interface, and executes any functi... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.