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 |
|---|---|---|---|---|---|
playm2mboy/edx-platform | lms/lib/courseware_search/lms_result_processor.py | 61 | 2677 | """
This file contains implementation override of SearchResultProcessor which will allow
* Blends in "location" property
* Confirms user access to object
"""
from django.core.urlresolvers import reverse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from search.result_processor import SearchResu... | agpl-3.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/unidecode/x07a.py | 252 | 4669 | data = (
'Xi ', # 0x00
'Kao ', # 0x01
'Lang ', # 0x02
'Fu ', # 0x03
'Ze ', # 0x04
'Shui ', # 0x05
'Lu ', # 0x06
'Kun ', # 0x07
'Gan ', # 0x08
'Geng ', # 0x09
'Ti ', # 0x0a
'Cheng ', # 0x0b
'Tu ', # 0x0c
'Shao ', # 0x0d
'Shui ', # 0x0e
'Ya ', # 0x0f
'Lun ', # 0x10
'Lu '... | apache-2.0 |
devops2014/djangosite | tests/template_tests/syntax_tests/test_now.py | 443 | 2037 | from datetime import datetime
from django.test import SimpleTestCase
from django.utils.formats import date_format
from ..utils import setup
class NowTagTests(SimpleTestCase):
@setup({'now01': '{% now "j n Y" %}'})
def test_now01(self):
"""
Simple case
"""
output = self.engin... | bsd-3-clause |
palerdot/calibre | src/calibre/ebooks/unihandecode/krcodepoints.py | 26 | 406322 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>'
__docformat__ = 'restructuredtext en'
'''
Unicode code point dictionary.
Based on Unicode.org Unihan database.
'''
CODEPOINTS = {
'x34':[
'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','... | gpl-3.0 |
lordmuffin/aws-cfn-plex | functions/credstash/botocore/vendored/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | mit |
jdugge/QGIS | tests/src/python/test_qgsprojectmetadata.py | 33 | 12263 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsProjectMetadata.
Run with: ctest -V -R PyQgsProjectMetadata
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the Licens... | gpl-2.0 |
simone/django-gb | django/contrib/flatpages/tests/test_csrf.py | 56 | 3486 | import os
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase, Client
from django.test import override_settings
@override_settings(
LOGIN_URL='/accounts/login/',
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonM... | bsd-3-clause |
lanyuwen/openthread | tests/scripts/thread-cert/test_diag.py | 2 | 4155 | #!/usr/bin/env python3
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
fighterlyt/bite-project | deps/gdata-python-client/src/atom/http.py | 56 | 12799 | #!/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 |
matk86/pymatgen | pymatgen/transformations/standard_transformations.py | 5 | 23008 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import logging
from pymatgen.analysis.bond_valence import BVAnalyzer
from pymatgen.analysis.ewald import EwaldSummation, EwaldMinimizer
from pymatgen.analysis.... | mit |
HyperBaton/ansible | test/units/modules/network/fortios/test_fortios_firewall_shaper_per_ip_shaper.py | 21 | 10515 | # Copyright 2019 Fortinet, 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
kyilmaz80/mta | paramiko-master/paramiko/kex_gex.py | 36 | 9740 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 (a... | gpl-2.0 |
Gitlab11/odoo | openerp/addons/base/module/wizard/__init__.py | 365 | 1250 | # -*- 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 GNU... | agpl-3.0 |
h3biomed/ansible | lib/ansible/module_utils/network/ironware/ironware.py | 38 | 3502 | #
# Copyright (c) 2017, Paul Baker <paul@paulbaker.id.au>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
ahb0327/intellij-community | python/lib/Lib/site-packages/django/templatetags/l10n.py | 247 | 1845 | from django.conf import settings
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import formats
from django.utils.encoding import force_unicode
register = Library()
def localize(value):
"""
Forces a value to be rendered as a localized value,
reg... | apache-2.0 |
franekp/ankidict | ankidict/thirdparty/BaseHTTPServer.py | 24 | 22747 | """HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: ... | agpl-3.0 |
ak2703/edx-platform | common/test/acceptance/fixtures/certificates.py | 80 | 1221 | """
Tools for creating certificates config fixture data.
"""
import json
from . import STUDIO_BASE_URL
from .base import StudioApiFixture
class CertificateConfigFixtureError(Exception):
"""
Error occurred while installing certificate config fixture.
"""
pass
class CertificateConfigFixture(StudioAp... | agpl-3.0 |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/json/decoder.py | 51 | 13882 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF800000000... | gpl-2.0 |
GdZ/scriptfile | software/googleAppEngine/lib/grizzled/grizzled/db/dummydb.py | 19 | 1861 | # $Id: 5e4fe45ea4436e0dc7d3743bff9679e052071746 $
# ---------------------------------------------------------------------------
"""
A dummy database driver, useful for testing.
"""
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# -------... | mit |
lordmuffin/aws-cfn-plex | functions/credstash/docutils/parsers/rst/directives/html.py | 128 | 3098 | # $Id: html.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for typically HTML-specific constructs.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes, utils
from docutils.parsers... | mit |
bailabs/bench-v7 | install.py | 1 | 10678 | # wget setup_frappe.py | python
import os, sys, subprocess, getpass, json, multiprocessing, shutil, platform
from distutils.spawn import find_executable
tmp_bench_repo = '/tmp/bench-v7'
def install_bench(args):
check_distribution_compatibility()
check_brew_installed()
# pre-requisites for bench repo cloning
insta... | gpl-3.0 |
diN0bot/ProcrasDonate | adwords/views/main.py | 1 | 2790 | import settings
from lib.view_utils import render_response, render_string, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import user_passes_test
from adwords.models import *
def adword_page(request, group):
page = "landing"
return render_response(reque... | agpl-3.0 |
dennerlager/sepibrews | sepibrews/command.py | 1 | 2978 | import sys
import unittest
class Command():
"""Use factory method 'create(command_name)' to instantiate"""
def __init__(self, arguments, executionEngine):
self.arguments = arguments
self.executionEngine = executionEngine
def execute(self):
raise NotImplementedError()
class StartC... | gpl-3.0 |
odahoda/noisicaa | noisicaa/ui/graph/base_node.py | 1 | 34059 | #!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at y... | gpl-2.0 |
pdellaert/ansible | lib/ansible/modules/cloud/ovirt/ovirt_job.py | 18 | 7379 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
tupolev/plugin.video.mitele | lib/youtube_dl/extractor/vbox7.py | 13 | 2263 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
)
class Vbox7IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vbox7\.com/play:(?P<id>[^/]+)... | gpl-3.0 |
GuessWhoSamFoo/pandas | pandas/tests/tseries/test_frequencies.py | 1 | 29684 | from datetime import datetime, timedelta
import numpy as np
import pytest
from pandas._libs.tslibs import frequencies as libfrequencies, resolution
from pandas._libs.tslibs.ccalendar import MONTHS
from pandas._libs.tslibs.frequencies import (
INVALID_FREQ_ERR_MSG, FreqGroup, _period_code_map, get_freq, get_freq_c... | bsd-3-clause |
rockyzhang/zhangyanhit-python-for-android-mips | python-modules/twisted/twisted/conch/client/agent.py | 60 | 1740 | # -*- test-case-name: twisted.conch.test.test_default -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Accesses the key agent for user authentication.
Maintainer: Paul Swartz
"""
import os
from twisted.conch.ssh import agent, channel, keys
from twisted.internet import protoc... | apache-2.0 |
gtara/or-tools | examples/python/bacp.py | 32 | 2844 | # Copyright 2010 Pierre Schaus pschaus@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
joopert/home-assistant | homeassistant/components/mpd/media_player.py | 3 | 10530 | """Support to interact with a Music Player Daemon."""
from datetime import timedelta
import logging
import os
import mpd
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MED... | apache-2.0 |
chromium/chromium | tools/android/modularization/convenience/build_gn_editor.py | 6 | 10119 | # Lint as: python3
# Copyright 2021 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.
r'''Helper code to handle editing BUILD.gn files.'''
from __future__ import annotations
import difflib
import pathlib
import re
import su... | bsd-3-clause |
qedsoftware/commcare-hq | corehq/apps/hqmedia/views.py | 1 | 22884 | from StringIO import StringIO
from mimetypes import guess_all_extensions, guess_type
import uuid
import zipfile
import logging
import os
from django.contrib.auth.decorators import login_required
import json
import itertools
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.... | bsd-3-clause |
IntersectAustralia/asvo-tao | core/PerformanceCode/WallTimeResultsMerge.py | 1 | 2770 | import pickle, os, logging,string
import pg
import locale
import time
from datetime import date
import logging
import settingReader
class DBInterface(object):
def __init__(self,Options):
self.Options=Options
self.InitDBConnection(self.Options)
self.IsOpen=Fal... | gpl-3.0 |
switchboardOp/ansible | lib/ansible/modules/network/avi/avi_healthmonitor.py | 43 | 6595 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
atuljain/odoo | openerp/report/render/odt2odt/__init__.py | 381 | 1085 | # -*- 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 |
simone-campagna/py-structparser | examples/versioning/model/model_r1.py | 1 | 3830 | #
# Copyright 2013 Simone Campagna
#
# 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 wri... | apache-2.0 |
joshuahoman/vivisect | vivisect/vector.py | 7 | 6636 |
"""
A module full of utils for vectored input tracking and code
flow analysis. (when a scalpel finds something you need to be
able to figgure out how to get to it right?)
"""
import vivisect.exc as viv_exc
import vivisect.tools.graphutil as v_graphutil
import vivisect.impemu.monitor as viv_imp_monitor
import visgrap... | apache-2.0 |
endlessm/chromium-browser | components/policy/tools/template_writers/writers/admx_writer_unittest.py | 3 | 25665 | #!/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.
"""Unittests for writers.admx_writer."""
import os
import sys
import unittest
if __name__ == '__main__':
sys.path.append(os.path.... | bsd-3-clause |
RyanChinSang/ECNG3020-ORSS4SCVI | BETA/TestCode/Tensorflow/Test/object_detection/utils/learning_schedules.py | 21 | 4588 | # 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... | gpl-3.0 |
TripleDogDare/RadioWCSpy | backend/env/lib/python2.7/site-packages/pip/req/req_file.py | 85 | 5511 | from __future__ import absolute_import
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.download import get_file_content
from pip.req.req_install import InstallRequirement
from pip.utils import normalize_name
_scheme_re = re.compile(r'^(http|https|file):', re.I)
def pars... | mit |
jkoelker/quark | quark/tests/plugin_modules/test_subnets.py | 1 | 36379 | # Copyright 2013 Openstack Foundation
# 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 applicab... | apache-2.0 |
mattdesl/electron | script/build.py | 155 | 1166 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.util import atom_gyp
CONFIGURATIONS = ['Release', 'Debug']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
... | mit |
goir/graphite-web | webapp/graphite/dashboard/urls.py | 36 | 1457 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns(
'',
url('^save/(?P<name>[^/]+)', views.save, name='dashboard_save'),
url('^save_template/(?P<name>[^/]+)/(?P<key>[^/]+)',
views.save_template, name='dashboard_save_template'),
url('^load/(?P<name>[^/]+)', vie... | apache-2.0 |
sje397/p2pool | p2pool/graphs.py | 2 | 8856 | import hashlib
import os
import tempfile
from twisted.web import resource
try:
import rrdtool
except ImportError:
class Resource(resource.Resource):
def __init__(self):
resource.Resource.__init__(self)
self.putChild('', self)
def render_GET(self, r... | gpl-3.0 |
frank10704/DF_GCS_W | MissionPlanner-master/Lib/encodings/tis_620.py | 93 | 12863 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-3.0 |
SDSG-Invenio/invenio | invenio/ext/debug_toolbar/__init__.py | 22 | 2436 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 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 optio... | gpl-2.0 |
drawks/ansible | lib/ansible/modules/cloud/cloudstack/cs_resourcelimit.py | 25 | 5486 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, René Moser <mail@renemoser.net>
# 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': ['stableinterface'],
'supported... | gpl-3.0 |
Mariaanisimova/pythonintask | IVTa/2014/EGOROV_V_I/task_8_8.py | 1 | 2933 | # Задача 8. Вариант 8
'''
Доработайте игру "Анаграммы" (см. М.Доусон
Программируем на Python. Гл.4) так, чтобы к
каждому слову полагалась подсказка. Игрок должен
получать право на подсказку в том случае, если
у него нет никаких предположений. Разработайте
систему начисления очков, по которой бы игроки,
отгадавшие слово... | apache-2.0 |
JioCloud/nova | nova/rpc.py | 63 | 4328 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
alexmorozov/django | tests/forms_tests/widget_tests/test_passwordinput.py | 247 | 1052 | from django.forms import PasswordInput
from .base import WidgetTest
class PasswordInputTest(WidgetTest):
widget = PasswordInput()
def test_render(self):
self.check_html(self.widget, 'password', '', html='<input type="password" name="password" />')
def test_render_ignore_value(self):
sel... | bsd-3-clause |
pwoodworth/intellij-community | python/lib/Lib/encodings/cp1256.py | 593 | 13070 | """ Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | apache-2.0 |
dasseclab/dasseclab | clones/routersploit/tests/payloads/x64/test_reverse_tcp.py | 1 | 1678 | from routersploit.modules.payloads.x64.reverse_tcp import Payload
# reverse tcp with lhost=192.168.1.4 lport=4321
reverse_tcp = (
b"\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01\x5e\x0f\x05\x48\x97\x48"
b"\xb9\x02\x00\x10\xe1\xc0\xa8\x01\x04\x51\x48\x89\xe6\x6a\x10"
b"\x5a\x6a\x2a\x58\x0f\x05\x6a\x03\x5e\x48\xff\... | gpl-2.0 |
flavoi/diventi | diventi/ebooks/migrations/0110_auto_20200830_1750.py | 1 | 3345 | # Generated by Django 2.2.13 on 2020-08-30 15:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ebooks', '0109_auto_20200821_1049'),
]
operations = [
migrations.AlterField(
model_name='book',
name='color',
... | apache-2.0 |
AdvancedTopicsOfSE/aatserver | lib/flask/sessions.py | 348 | 12882 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from datetime import datetime
from werkzeug.http import http_date, ... | apache-2.0 |
2ndQuadrant/ansible | test/units/module_utils/xenserver/test_wait_for_functions.py | 15 | 7943 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from .FakeAnsibleModule import FakeAn... | gpl-3.0 |
attilammagyar/typesafety | typesafety/tests/externalmodule.py | 3 | 1042 | #
# Copyright (c) 2013-2018 Balabit
# 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 distrib... | lgpl-2.1 |
ncliam/serverpos | openerp/modules/graph.py | 260 | 7763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/protocols/haproxy/_exceptions.py | 16 | 1085 | # -*- test-case-name: twisted.protocols.haproxy.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HAProxy specific exceptions.
"""
import contextlib
import sys
from twisted.python import compat
class InvalidProxyHeader(Exception):
"""
The provided PROXY protocol header is... | gpl-2.0 |
reyha/zulip | zerver/tests/test_tutorial.py | 32 | 2671 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from typing import Any, Dict
from zerver.lib.test_helpers import (
get_user_profile_by_email,
most_recent_message,
)
from zerver.lib.test_classes import (
ZulipTestCase,
)
from zerver.models import (
... | apache-2.0 |
darktears/chromium-crosswalk | infra/scripts/legacy/scripts/common/chromium_utils.py | 30 | 2152 | # 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.
""" Set of basic operations/utilities that are used by the build. """
from contextlib import contextmanager
import ast
import cStringIO
import copy
impo... | bsd-3-clause |
Malphaet/vkyweb | generator/file_parser.py | 1 | 6822 | # Copyleft (c) 2016 Cocobug All Rights Reserved.
# -*- coding: utf_8 -*-
import os,sys,codecs
import re
import traceback
class WebPage(object):
"A webpage object, with some variables and all localisations"
def __init__(self,path):
self.path=path
self.name=os.path.split(path)[-1]
self.v... | unlicense |
jimmyoic/floodlight-qosmanager | apps/qos/qospath2.py | 5 | 8109 | #! /usr/bin/python
"""
QoSPath.py v2---------------------------------------------------------------------------------------------------
Developed By: Ryan Wallner (ryan.wallner1@marist.edu)
Add QoS to a specific path in the network. Utilized circuit pusher developed by KC Wang
[Note]
*the circuitpusher.py is needed in... | apache-2.0 |
jjmleiro/hue | desktop/core/ext-py/django-axes-1.5.0/examples/example/foo/management/commands/axes_create_test_data.py | 25 | 1064 | from __future__ import print_function
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
def create_admin_user(username, password):
"""
Create a user for testing the admin.
:param string username:
:param strring password:
"""
u = User()
u.user... | apache-2.0 |
hoosteeno/kuma | kuma/users/providers/github/views.py | 13 | 1712 | import requests
from allauth.account.utils import get_next_redirect_url
from allauth.socialaccount.providers.oauth2.views import (OAuth2LoginView,
OAuth2CallbackView)
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from kuma.core.u... | mpl-2.0 |
sgmap/openfisca-parsers | openfisca_parsers/scripts/datatrees_to_json.py | 2 | 1776 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redist... | agpl-3.0 |
sindhus/hasjob | hasjob/models/__init__.py | 1 | 2623 | # -*- coding: utf-8 -*-
# flake8: noqa
from datetime import timedelta
from coaster import LabeledEnum
from coaster.db import db
from coaster.sqlalchemy import (BaseMixin, BaseNameMixin, TimestampMixin, BaseScopedIdMixin,
BaseScopedNameMixin, CoordinatesMixin, make_timestamp_columns)
from .. import app
agelimit = ... | agpl-3.0 |
fossilet/ansible | contrib/inventory/cloudstack.py | 111 | 8221 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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... | gpl-3.0 |
sbbic/core | solenv/gdb/libreoffice/basegfx.py | 11 | 5883 | # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
... | gpl-3.0 |
egoid/baytree | lib/python2.7/site-packages/django/contrib/gis/db/models/sql/conversion.py | 123 | 2475 | """
This module holds simple classes to convert geospatial values from the
database.
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.contrib.gis.db.models.fields import GeoSelectFormatMixin
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure imp... | mit |
tecwebjoao/TecWeb-TF-2T-B-SI | venv/Lib/site-packages/setuptools/msvc.py | 76 | 40884 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Windows SDK 7.0 (x86, x64, ia64)
Microsoft Visual C++ 10.0... | apache-2.0 |
jonhadfield/ansible | contrib/inventory/windows_azure.py | 119 | 11306 | #!/usr/bin/env python
'''
Windows Azure external inventory script
=======================================
Generates inventory that Ansible can understand by making API request to
Windows Azure using the azure python library.
NOTE: This script assumes Ansible is being executed where azure is already
installed.
p... | gpl-3.0 |
eugenehp/bootstrap | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 1752 | 8019 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | mit |
alberthdev/dummymp | dummymp/__init__.py | 2 | 1194 | #!/usr/bin/env python
# DummyMP - Multiprocessing Library for Dummies!
# Copyright 2014 Albert Huang.
#
# 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/LI... | apache-2.0 |
jrutila/django-scheduler | schedule/migrations/0001_initial.py | 6 | 6378 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | bsd-3-clause |
ampax/edx-platform | cms/djangoapps/contentstore/views/certificates.py | 35 | 21931 | """
Certificates Data Model:
course.certificates: {
'certificates': [
{
'version': 1, // data contract version
'id': 12345, // autogenerated identifier
'name': 'Certificate 1',
'description': 'Certificate 1 Description',
'course_title': 'course ti... | agpl-3.0 |
hendradarwin/VTK | ThirdParty/Twisted/twisted/conch/interfaces.py | 23 | 13038 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module contains interfaces defined for the L{twisted.conch} package.
"""
from zope.interface import Interface, Attribute
class IConchUser(Interface):
"""
A user who has been authenticated to Cred through Conch. This is
the ... | bsd-3-clause |
jiangzhixiao/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py | 293 | 10562 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
jcrudy/sklearntools | sklearntools/test/test_transformers.py | 1 | 3613 | from sklearntools.transformers import Constant, VariableTransformer, Identity,\
Censor, NanMap, Log
import numpy as np
import pandas
from numpy.testing.utils import assert_array_almost_equal
from sklearn.datasets.base import load_boston
from pyearth.earth import Earth
from sklearntools.calibration import ResponseTr... | bsd-3-clause |
leogregianin/pychess | lib/pychess/Players/CECPEngine.py | 1 | 39654 |
import asyncio
import itertools
import re
from gi.repository import Gtk, GObject
from pychess.compat import create_task
from pychess.Utils import wait_signal
from pychess.System import conf
from pychess.System.Log import log
from pychess.widgets import mainwindow
from pychess.Utils.Move import Move
from pychess.Uti... | gpl-3.0 |
SnappleCap/oh-mainline | vendor/packages/Django/tests/modeltests/many_to_many/tests.py | 109 | 17906 | from __future__ import absolute_import
from django.test import TestCase
from django.utils import six
from .models import Article, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
self.p1 = Publication.objects.create(id=None, title='The Python Jour... | agpl-3.0 |
grigorisg9gr/menpo3d | menpo3d/io/test/io_export_test.py | 3 | 2647 | import contextlib
import os
import tempfile
from mock import patch, PropertyMock, MagicMock
import menpo3d.io as mio
test_obj = mio.import_builtin_asset('james.obj')
test_lg = mio.import_landmark_file(mio.data_path_to('bunny.ljson'))
@contextlib.contextmanager
def _temporary_path(extension):
# Create a temporar... | bsd-3-clause |
dfunckt/django | tests/view_tests/tests/test_static.py | 7 | 5610 | from __future__ import unicode_literals
import mimetypes
import unittest
from os import path
from django.conf.urls.static import static
from django.http import FileResponse, HttpResponseNotModified
from django.test import SimpleTestCase, override_settings
from django.utils.http import http_date
from django.views.stat... | bsd-3-clause |
mate-desktop/pluma | tools/preprocessor.py | 1 | 5353 | # -*- coding: utf-8 -*-
# preprocessor.py - simple preprocessor for plugin template files
# This file is part of pluma
#
# Copyright (C) 2006 - Steve Frécinaux
# Copyright (C) 2012-2021 MATE Developers
#
# pluma is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | gpl-2.0 |
feedhq/feedhq | feedhq/feeds/tasks.py | 1 | 8652 | from collections import defaultdict
from datetime import timedelta
import requests
import structlog
from django.conf import settings
from django.utils import timezone
from django_push.subscriber.models import Subscription, SubscriptionError
from rache import schedule_job
from requests.exceptions import MissingSchema
f... | bsd-3-clause |
petteyg/intellij-community | python/lib/Lib/site-packages/django/core/validators.py | 158 | 6583 | import re
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})
try:
from django... | apache-2.0 |
PeterWangIntel/blink-crosswalk | Tools/Scripts/webkitpy/thirdparty/coverage/__init__.py | 64 | 3417 | """Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
__version__ = "3.5.1" # see detailed history in CHANGES.txt
__url__ = "http://nedbatchelder.com/code/coverage"
if max(__version__).isalpha():
# For pre-releases, use a version-specific URL.
__url__ += "/" ... | bsd-3-clause |
apuckey/thrift-0.9.1 | lib/py/src/TSCons.py | 237 | 1267 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
benedeku/HolaMundo | androguard/core/bytecodes/api_permissions.py | 14 | 332065 | DVM_PERMISSIONS_BY_PERMISSION = {
"BIND_DEVICE_ADMIN": {
"Landroid/app/admin/DeviceAdminReceiver;": [
("C", "ACTION_DEVICE_ADMIN_ENABLED", "Ljava/lang/String;"),
],
"Landroid/app/admin/DevicePolicyManager;": [
("F", "getRemoveWarning",
"(Landroid/content/... | apache-2.0 |
zmsch27/Python | PythonBase/Python_SQL.py | 1 | 5850 | #以下来自廖雪峰的Python学习之Python数据库
#SQLite////////////////////////////////////////////////////
#SQLite是一种嵌入式数据库,它的数据库就是一个文件。由于SQLite本身是C写的,而且体积很小
#所以,经常被集成到各种应用程序中,甚至在iOS和Android的App中都可以集成。
#Python就内置了SQLite3,所以,在Python中使用SQLite,不需要安装任何东西,直接使用。
# 导入SQLite驱动:
import sqlite3
# 连接到SQLite数据库
# 数据库文件是test.db
# 如果文件不存在,会自动在当前目录创建... | apache-2.0 |
vnbrs/project-euler | problem-13.py | 1 | 5266 | n_list = [37107287533902102798797998220837590246510135740250,
46376937677490009712648124896970078050417018260538,
74324986199524741059474233309513058123726617309629,
91942213363574161572522430563301811072406154908250,
23067588207539346171171980310421047513778063246676,
89261670696623633820136378418383684178734361726757... | mit |
GoogleChromeLabs/chromeos_smart_card_connector | third_party/webports/src/src/ports/libgit2-demo/httpd.py | 3 | 4667 | #!/usr/bin/env python
# Copyright 2015 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
An example HTTP server that returns the correct CORS headers for using with the
libgit2 URL transport scheme.
The libgit2-dem... | apache-2.0 |
apprentice3d/Wox | PythonHome/Lib/site-packages/setuptools/command/install_egg_info.py | 423 | 4001 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | mit |
malelew/UCLA_Dining_Web_App | ENV/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## 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... | mit |
udo-tech-team/shadowsocks-1 | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
EttusResearch/gnuradio | gnuradio-runtime/python/gnuradio/gru/gnuplot_freqz.py | 59 | 4137 | #!/usr/bin/env python
#
# Copyright 2005,2007 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 optio... | gpl-3.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/jupyter_core/paths.py | 5 | 4762 | # encoding: utf-8
"""Path utility functions."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Derived from IPython.utils.path, which is
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import sys
... | mit |
herow/planning_qgis | python/plugins/processing/algs/qgis/BasicStatisticsStrings.py | 6 | 5524 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BasicStatisticsStrings.py
---------------------
Date : September 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************... | gpl-2.0 |
pmorie/origin | cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | 31 | 32680 | #!/usr/bin/env python
# Copyright 2015 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 |
Synss/pyhard2 | pyhard2/ctrlr/deltaelektronika.py | 1 | 1159 | """Graphical user interface to Delta-Elektronika SM-700 Series
controllers."""
import sys
import pyhard2.driver as drv
import pyhard2.driver.virtual as virtual
import pyhard2.driver.deltaelektronika as delta
import pyhard2.ctrlr as ctrlr
def createController():
"""Initialize controller."""
config = ctrlr.Co... | mit |
PolicyStat/django | django/contrib/messages/storage/base.py | 113 | 6286 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an a... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.