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 |
|---|---|---|---|---|---|
MarcJoan/django | django/utils/jslex.py | 335 | 7778 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... | bsd-3-clause |
patrickstocklin/chattR | lib/python2.7/site-packages/nltk/corpus/europarl_raw.py | 10 | 1581 | # Natural Language Toolkit: Europarl Corpus Readers
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Nitin Madnani <nmadnani@umiacs.umd.edu>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
import re
from nltk.corpus.util import LazyCorpusLoader
from nltk.corpus.reader import *
# Create a new c... | gpl-2.0 |
hsaito/linux | tools/perf/util/setup.py | 766 | 1540 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
Adel-Magebinary/odoo | addons/product_visible_discount/__openerp__.py | 260 | 2082 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
flavour/RedHat | modules/tropo.py | 33 | 22336 | """
The TropoPython module. This module implements a set of classes and methods for manipulating the Voxeo Tropo WebAPI.
Usage:
----
from tropo import Tropo
tropo = Tropo()
tropo.say("Hello, World")
json = tropo.RenderJson()
----
You can write this JSON back to standard output to get Tropo to perform
the action. Fo... | mit |
SaschaMester/delicium | tools/telemetry/telemetry/timeline/event.py | 39 | 1870 | # 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.
class TimelineEvent(object):
"""Represents a timeline event.
thread_start, thread_duration and thread_end are the start time, duration
and end time of... | bsd-3-clause |
SlimRoms/android_external_chromium_org | tools/perf/measurements/loading_measurement_analyzer_unittest.py | 44 | 1339 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import StringIO
import unittest
from measurements import loading_measurement_analyzer
from telemetry.core import util
class LoadingMeasurementAnal... | bsd-3-clause |
leiferikb/bitpop | build/third_party/buildbot_slave_8_4/buildslave/commands/utils.py | 4 | 3836 | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-3.0 |
gengue/django | django/contrib/humanize/templatetags/humanize.py | 526 | 9442 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... | bsd-3-clause |
daviddoria/itkHoughTransform | Wrapping/WrapITK/Languages/SwigInterface/idx.py | 13 | 1236 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
sys.path.append(sys.path[0]+os.sep+'pygccxml-1.0.0')
import pygccxml, sys, cStringIO
# the output file
outputFile = cStringIO.StringIO()
# init the pygccxml stuff
pygccxml.declarations.scopedef_t.RECURSIVE_DEFAULT = False
pygccxml.declarations.scopedef_t.A... | apache-2.0 |
nicolas-shupe/flavorgator | public/map_app/multiply.py | 1 | 1150 | from numpy import *
s = [[2407,1860]]
p =.25
def rekt ():
for n in range(0,len(s)):
for m in range (len(s[n])):
s[n][m] = round((s[n][m] * p),2)
return s
"""
[[343.35, 137.38, 342.74, 150.59, 222.25, 153.91, 222.25, 141.05],
[402.5, 0.88, 430.24, 1.14, 430.59, 42.61, ... | mit |
barbarubra/Don-t-know-What-i-m-doing. | python/src/PC/VC6/build_tkinter.py | 91 | 2060 | import os
import sys
import subprocess
TCL_MAJOR = 8
TCL_MINOR = 5
TCL_PATCH = 2
TIX_MAJOR = 8
TIX_MINOR = 4
TIX_PATCH = 3
def abspath(name):
par = os.path.pardir
return os.path.abspath(os.path.join(__file__, par, par, par, par, name))
TCL_DIR = abspath("tcl%d.%d.%d" % (TCL_MAJOR, TCL_MINOR, TCL_PATCH))
TK_... | apache-2.0 |
murrown/cyder | cyder/cydhcp/site/models.py | 2 | 4165 | from django.db import models
from django.db.models.loading import get_model
from django.core.validators import RegexValidator
from cyder.base.eav.constants import ATTRIBUTE_INVENTORY
from cyder.base.eav.fields import EAVAttributeField
from cyder.base.eav.models import Attribute, EAVBase
from cyder.base.mixins import O... | bsd-3-clause |
tylerclair/py3canvas | py3canvas/apis/user_observees.py | 1 | 5486 | """UserObservees API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
class UserObserveesAPI(BaseCanvasAPI):
"""UserObservees API Version 1.0."""
def __init__(sel... | mit |
cryptickp/heat | heat/engine/resources/openstack/heat/software_config.py | 4 | 6711 | #
# 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 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/uic/Compiler/indenter.py | 27 | 2742 | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as fol... | gpl-3.0 |
marksuarez/wfinancial | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | mit |
gnuradio/gnuradio | gr-digital/python/digital/__init__.py | 3 | 1150 | # Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
'''
Blocks and utilities for digital modulation and demodulation.
'''
# The presence of this file turns this directory into a Python package
import os
try:
from .digital_pyt... | gpl-3.0 |
jonparrott/google-cloud-python | speech/tests/unit/gapic/v1p1beta1/test_speech_client_v1p1beta1.py | 2 | 8509 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
garlandkr/ansible | plugins/inventory/vagrant.py | 72 | 3659 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | gpl-3.0 |
alikins/ansible | lib/ansible/module_utils/network/common/utils.py | 11 | 17265 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
LarryHillyer/PoolHost | PoolHost/env/Lib/site-packages/django/core/files/uploadedfile.py | 48 | 4318 | """
Classes representing uploaded files.
"""
import errno
import os
from io import BytesIO
from django.conf import settings
from django.core.files import temp as tempfile
from django.core.files.base import File
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU... | gpl-3.0 |
o5k/openerp-oemedical-v0.1 | openerp/addons/base/res/wizard/change_password_wizard.py | 37 | 3452 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
caoziyao/weibo | models/messageCopy.py | 1 | 1245 | import hashlib
import os
from . import ModelMixin
from . import db
from utils import timestamp
from utils import log
from utils import sh1hexdigest
class MessageCopy(db.Model, ModelMixin):
__tablename__ = 'messageCopys'
Cid = db.Column(db.Integer, primary_key=True) # 转发编号
# Ccontent = db.Column(db.Str... | mit |
djangorussia/django-1.3-branch | tests/regressiontests/admin_views/customadmin.py | 52 | 1279 | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from django.conf.urls.defaults import patterns
from django.contrib import admin
from django.http import HttpResponse
import models, forms
class Admin2(admin.AdminSite):
login_form = forms.CustomAdminAuthenticationForm
login_template = 'cust... | bsd-3-clause |
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/gslib/commands/config.py | 12 | 49320 | # -*- coding: utf-8 -*-
# Copyright 2011 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 require... | bsd-3-clause |
ArcherSys/ArcherSys | node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 1 | 24104 | <<<<<<< HEAD
<<<<<<< HEAD
#!/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... | mit |
google/graphicsfuzz | gfauto/gfauto/run_bin.py | 1 | 2346 | # -*- coding: utf-8 -*-
# Copyright 2019 The GraphicsFuzz Project 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
alphafoobar/intellij-community | python/helpers/docutils/transforms/references.py | 57 | 36103 | # $Id: references.py 6167 2009-10-11 14:51:42Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms for resolving references.
"""
__docformat__ = 'reStructuredText'
import sys
import re
from docutils import nodes, utils
from docutils.tra... | apache-2.0 |
yongshengwang/builthue | desktop/core/ext-py/Django-1.4.5/tests/regressiontests/csrf_tests/tests.py | 10 | 13714 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.conf import settings
from django.core.context_processors import csrf
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfViewMiddleware, CSRF_KEY_LENGTH
from django.template import RequestContext, Template
fr... | apache-2.0 |
thientu/scikit-learn | sklearn/metrics/scorer.py | 211 | 13141 | """
The :mod:`sklearn.metrics.scorer` submodule implements a flexible
interface for model selection and evaluation using
arbitrary score functions.
A scorer object is a callable that can be passed to
:class:`sklearn.grid_search.GridSearchCV` or
:func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame... | bsd-3-clause |
masayuko/nikola | nikola/post.py | 1 | 47243 | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | mit |
jangeador/restless | tests/test_dj.py | 4 | 11425 | import unittest
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
# Ugh. Settings for Django.
from django.conf import settings
settings.configure(DEBUG=True)
from restless.dj import DjangoResource
from restless.exceptions import Unauthorized
from restless.preparers import FieldsPr... | bsd-3-clause |
wlerin/streamlink | tests/test_utils.py | 3 | 6379 | import base64
import os.path
import sys
import unittest
import xml.etree.ElementTree as ET
from streamlink.exceptions import PluginError
from streamlink.plugin.api.validate import xml_element, text
from streamlink.plugin.api import validate
from streamlink.utils import (
absolute_url,
load_module,
parse_js... | bsd-2-clause |
shanemcd/ansible | test/units/plugins/lookup/test_password.py | 71 | 18937 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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
# (a... | gpl-3.0 |
datanel/navitia | source/tyr/tyr/helper.py | 8 | 6227 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | agpl-3.0 |
GETLIMS/LIMS-Backend | lims/inventory/migrations/0001_initial.py | 1 | 6145 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import mptt.fields
import gm2m.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('con... | mit |
kifcaliph/odoo | addons/hr_evaluation/__openerp__.py | 267 | 3155 | # -*- encoding: 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 G... | agpl-3.0 |
fbradyirl/home-assistant | homeassistant/components/tuya/switch.py | 7 | 1134 | """Support for Tuya switches."""
from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice
from . import DATA_TUYA, TuyaDevice
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Tuya Switch device."""
if discovery_info is None:
return
tuya = hass.data[... | apache-2.0 |
frallain/MSFileReader-Python-bindings | tests/fixtures/chroData.py | 2 | 24438 | chrodata = ((0.005666666666666667, 0.0285, 0.0515, 0.0745, 0.09733333333333333, 0.12033333333333333, 0.14333333333333334, 0.16633333333333333, 0.18916666666666668, 0.21216666666666667, 0.23516666666666666, 0.258, 0.28099999999999997, 0.304, 0.3268333333333333, 0.34983333333333333, 0.37283333333333335, 0.395666666666666... | mit |
soarpenguin/ansible | lib/ansible/parsing/vault/__init__.py | 2 | 47340 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
# (c) 2016, Adrian Likins <alikins@redhat.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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, eith... | gpl-3.0 |
bfontaine/web-pp | pp/unidecode/x023.py | 174 | 4346 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]'... | mit |
MKaptein/streamingbandit | app/handlers/adminhandlers.py | 1 | 19180 | # -* coding: utf-8 -*-
import tornado.escape
import tornado.ioloop
import tornado.web
import json
import random
import os
from handlers.basehandler import BaseHandler, ExceptionHandler
from core.experiment import Experiment
from db.database import Database
from db.mongolog import MongoLog
from db.users import Users
... | mit |
madhav-datt/spell-check | pdf_text/pdf2txt.py | 1 | 4620 | #
# pdf2txt.py from the FOSS python PDFMiner package
# http://euske.github.io/pdfminer/index.html#pdf2txt
# Extract text from PDF to text files
#
# Has to be run separately with python2.X (not compatible with python3.X)
#
import sys
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfparser import PDFParser
... | gpl-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/skimage/_shared/version_requirements.py | 17 | 4443 | from distutils.version import LooseVersion
import functools
import re
import sys
def _check_version(actver, version, cmp_op):
"""
Check version string of an active module against a required version.
If dev/prerelease tags result in TypeError for string-number comparison,
it is assumed that the depend... | gpl-3.0 |
ImageEngine/gaffer | python/GafferCortexUI/ObjectWriterUI.py | 10 | 3123 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | bsd-3-clause |
cordis/cloudapp-mp2 | internal_use/submit.py | 61 | 1944 | #! /usr/bin/env python -u
# coding=utf-8
import os
__author__ = 'Sayed Hadi Hashemi'
import json
from CourseraSubmission import CourseraSubmission
class MP1(CourseraSubmission):
def __init__(self):
super(CourseraSubmission, self).__init__()
dev = False
self.part_ids = ['mp1-part-a', 'mp1... | apache-2.0 |
skycucumber/xuemc | python/venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py | 21 | 25156 | # postgresql/psycopg2.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg2... | gpl-2.0 |
abhishek-ch/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/nl/formats.py | 141 | 3590 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 ja... | apache-2.0 |
cedadev/ndg_security_common | setup.py | 1 | 2632 | #!/usr/bin/env python
"""Distribution Utilities setup program for NDG Security Package
NERC Data Grid Project
"""
__author__ = "P J Kershaw"
__date__ = "24/04/06"
__copyright__ = "(C) 2009 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Ke... | bsd-3-clause |
maratonato/slides | node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/test/test_frozen.py | 55 | 2223 | # Test the frozen module defined in frozen.c.
from test.support import captured_stdout, run_unittest
import unittest
import sys
class FrozenTests(unittest.TestCase):
def test_frozen(self):
with captured_stdout() as stdout:
try:
import __hello__
except ImportError as... | apache-2.0 |
wagigi/fabtools-python | fabtools/nodejs.py | 9 | 5311 | """
Node.js
=======
This module provides tools for installing `Node.js`_ and managing
packages using `npm`_.
.. note: the ``simplejson`` module is required on Python 2.5
.. _Node.js: http://nodejs.org/
.. _npm: http://npmjs.org/
"""
try:
import json
except ImportError:
import simplejson as json
from fabri... | bsd-2-clause |
patrickdw123/ParanoiDF | html.py | 1 | 10764 | # ParanoiDF. A combination of several PDF analysis/manipulation tools to
# produce one of the most technically useful PDF analysis tools.
#
# Idea proposed by Julio Hernandez-Castro, University of Kent, UK.
# By Patrick Wragg
# University of Kent
# 21/07/2014
#
# With thanks to:
# Julio... | gpl-3.0 |
broferek/ansible | lib/ansible/modules/network/f5/bigip_dns_cache_resolver.py | 38 | 16802 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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 |
mbauskar/sapphire-erpnext | erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py | 18 | 2882 | # 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 _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
if... | agpl-3.0 |
D2005-devs/android_kernel_sony_msm8610 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
ByteInternet/libcloud | libcloud/compute/drivers/openstack.py | 1 | 143549 | # 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 use ... | apache-2.0 |
tlakshman26/cinder-bug-fix-volume-conversion-full | cinder/tests/unit/test_hitachi_hbsd_snm2_iscsi.py | 20 | 28607 | # Copyright (C) 2014, Hitachi, Ltd.
#
# 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 |
ruuk/script.web.viewer2 | lib/webviewer/mechanize/_pullparser.py | 134 | 14352 | """A simple "pull API" for HTML parsing, after Perl's HTML::TokeParser.
Examples
This program extracts all links from a document. It will print one
line for each link, containing the URL and the textual description
between the <A>...</A> tags:
import pullparser, sys
f = file(sys.argv[1])
p = pullparser.PullParser(f... | gpl-2.0 |
patchew-project/patchew | api/migrations/0029_populate_testing_results.py | 2 | 9152 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from api.migrations import (
get_property,
get_property_raw,
load_property,
set_property,
delete_property_blob,
)
import abc
from collections import defaultdict
from copy import copy
import datetime
im... | mit |
droidlabour/git_intgrtn_aws_s3 | CreateSSHKey/cfnresponse.py | 3 | 1734 | # Copyright 2016 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
# This file is licensed to you under the AWS Customer Agreement (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at http://aws.amazon.com/agreement/ .
# This file... | mit |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/bin/bootstrapping/setup.py | 10 | 1629 | # Copyright 2013 Google Inc. All Rights Reserved.
"""Does some initial setup and checks for all the bootstrapping scripts."""
import os
import sys
# If we're in a virtualenv, always import site packages. Also, upon request.
import_site_packages = (os.environ.get('CLOUDSDK_PYTHON_SITEPACKAGES') or
... | bsd-3-clause |
vitorio/NaNoGenMo2013 | ficly-scrape/html5lib/constants.py | 249 | 86469 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | cc0-1.0 |
TheTimmy/spack | var/spack/repos/builtin/packages/r-randomforest/package.py | 3 | 1593 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
drtuxwang/system-config | bin/tocapital.py | 1 | 2244 | #!/usr/bin/env python3
"""
Print arguments with first letter in upper case (camel case).
"""
import argparse
import glob
import os
import signal
import sys
from typing import List
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
s... | gpl-2.0 |
marrybird/sqlalchemy-utils | sqlalchemy_utils/types/encrypted.py | 4 | 9564 | # -*- coding: utf-8 -*-
import base64
import datetime
import six
from sqlalchemy.types import Binary, String, TypeDecorator
from sqlalchemy_utils.exceptions import ImproperlyConfigured
from .scalar_coercible import ScalarCoercible
cryptography = None
try:
import cryptography
from cryptography.hazmat.backend... | bsd-3-clause |
MobinRanjbar/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_Path.py | 37 | 26034 | #._cv_part guppy.heapy.test.test_Path
from guppy.heapy.test import support
import sys, unittest
class TestCase(support.TestCase):
def setUp(self):
support.TestCase.setUp(self)
self.Path = self.heapy.Path
def chkrel(self, src, dst, relstr=None, clas=None):
rel = self.relation(src, dst)
if clas is not None... | apache-2.0 |
staugur/SwarmOps | src/config.py | 1 | 3033 | # -*- coding: utf-8 -*-
"""
SwarmOps.config
~~~~~~~~~~~~~~
The program configuration file, the preferred configuration item, reads the system environment variable first.
:copyright: (c) 2018 by staugur.
:license: MIT, see LICENSE for more details.
"""
from os import getenv
GLOBAL = {
"Proce... | bsd-3-clause |
pombredanne/guessit | guessit/transfo/guess_language.py | 10 | 7372 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | lgpl-3.0 |
imsparsh/python-for-android | python-modules/zope/zope/interface/common/idatetime.py | 50 | 20112 | ##############################################################################
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | apache-2.0 |
richardingham/octopus | octopus/notifier/sms.py | 1 | 1629 | # Twisted Imports
from twisted.internet import reactor, protocol, defer
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
from twisted.internet.ssl import ClientContextFactory
from twisted.python import log
# System Imports
try:
from urllib.parse import urlencode
except ImportError:
f... | mit |
mo-g/iris | lib/iris/tests/test_util.py | 7 | 13750 | # (C) British Crown Copyright 2010 - 2015, 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... | gpl-3.0 |
OpenClovis/SAFplus-Availability-Scalability-Platform | doc/doclayout/jsclassindexpage.py | 1 | 1381 | """<module>
This module generates an html page that lists all classes
"""
import pdb
from PyHtmlGen.gen import *
from PyHtmlGen.document import *
from PyHtmlGen.htmldoc import *
from PyHtmlGen.bar import *
# from layoutstyle import *
from PyHtmlGen.layouttable import *
from PyHtmlGen.table import *
from PyHtmlGen.imag... | gpl-2.0 |
amir343/ansible-modules-extras | database/postgresql/postgresql_ext.py | 81 | 5801 | #!/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 |
jcsp/manila | manila_tempest_tests/plugin.py | 1 | 1495 | # Copyright 2015 Deutsche Telekom AG
# 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 requi... | apache-2.0 |
MSOpenTech/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_libraries.py | 17 | 7396 | # -*- coding: utf-8 -*-
"""
Basic unit tests related to content libraries.
Higher-level tests are in `cms/djangoapps/contentstore`.
"""
import ddt
from bson.objectid import ObjectId
from opaque_keys.edx.locator import LibraryLocator
from xmodule.modulestore.exceptions import DuplicateCourseError
from xmodule.module... | agpl-3.0 |
jj4jj/sdv | ws_server.py | 1 | 2339 | #-*-coding:utf8-*-
from threading import Thread
import tornado.ioloop
import tornado.web
import tornado.websocket
import json
import log
import config
try:
# py2
from urllib.parse import urlparse
except ImportError:
# py3
from urlparse import urlparse
class WebSocketMsgHandler():
def __init__(sel... | mit |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/sitemaps/kml.py | 121 | 2480 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
from django.contrib.gis.db.models.fields import GeometryField
from django.db import models
class KMLSitemap(Sitemap):
"""
A minimal hook to produce KML sitemaps.
"""
geo_format = 'kml'
def __init__(self, locations=Non... | apache-2.0 |
makacodewalker/etsgh | django/contrib/admin/templatetags/admin_list.py | 154 | 13963 | import datetime
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_VALUE,
ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
from django.core.exceptions import ObjectDoesNotExis... | bsd-3-clause |
SamHames/scikit-image | skimage/util/tests/test_arraypad.py | 2 | 26396 | """Tests for the pad functions.
"""
from __future__ import division, absolute_import, print_function
from numpy.testing import TestCase, run_module_suite, assert_array_equal
from numpy.testing import assert_raises, assert_array_almost_equal
import numpy as np
from skimage.util import pad
class TestStatistic(TestCas... | bsd-3-clause |
legacysurvey/pipeline | py/obiwan/decals_sim_randoms.py | 2 | 11774 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
def add_scatter(ax,x,y,c='b',m='o',lab='',s=80,drawln=False,alpha=1):
ax.scatter(x,y, s=s, lw=2.,facecolors='none',edgecolors=c, marker=m,label=lab,alpha=alpha)
if drawln: ax.plot(x,y, c=c,ls='-'... | gpl-2.0 |
xplv/qtile | libqtile/widget/mpris2widget.py | 10 | 6484 | # Copyright (c) 2014 Sebastian Kricner
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Adi Sieker
# Copyright (c) 2014 Tycho Andersen
#
# 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 with... | mit |
mdaif/olympia | apps/users/notifications.py | 19 | 4952 | from inspect import isclass
from celery.datastructures import AttributeDict
from tower import ugettext_lazy as _
class _NOTIFICATION(object):
pass
class thanks(_NOTIFICATION):
id = 2
group = 'user'
short = 'dev_thanks'
label = _('an add-on developer thanks me for a contribution')
mandatory ... | bsd-3-clause |
maxadamski/swift-corelibs-foundation | lib/script.py | 2 | 10156 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... | apache-2.0 |
dzolnierz/mysql-utilities | mysql/utilities/__init__.py | 1 | 2324 | #
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
#
# 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 of the License.
#
# This program is distributed in th... | gpl-2.0 |
feigames/Odoo | addons/stock_picking_wave/wizard/picking_to_wave.py | 382 | 1624 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
beniz/root | interpreter/llvm/src/tools/clang/docs/analyzer/conf.py | 20 | 8070 | # -*- coding: utf-8 -*-
#
# Clang Static Analyzer documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 2 15:54:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | lgpl-2.1 |
sachintyagi22/spark | examples/src/main/python/mllib/gradient_boosting_classification_example.py | 106 | 2485 | #
# 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 us... | apache-2.0 |
delete/spymanager | tests/test_subscriptions.py | 1 | 1195 | import sys
sys.path.insert(0, '../spymanager')
sys.path.insert(0, '../')
from tests import create_database_collection
from src.subscriptions import SubscriptionsManager
# Database settings
DATABASE_NAME = 'spies_database'
COLLECTION_NAME = 'subscriptions'
subscriptions_collection = create_database_collection(DATABAS... | mit |
lundjordan/build-relengapi | relengapi/blueprints/slaveloan/model.py | 3 | 5114 | # 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/.
import sqlalchemy as sa
from relengapi.lib import db
from relengapi.util import tz
from sqlalchemy.orm import relations... | mpl-2.0 |
Versent/ansible | lib/ansible/plugins/lookup/password.py | 60 | 5339 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.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... | gpl-3.0 |
syagev/kaggle_dsb | luna16/src/deep/unet/unet.py | 1 | 7592 | import theano
import theano.tensor as T
import lasagne
from lasagne.layers import InputLayer, Conv2DLayer, MaxPool2DLayer, batch_norm, DropoutLayer, GaussianNoiseLayer
from lasagne.init import HeNormal
from lasagne import nonlinearities
from lasagne.layers import ConcatLayer, Upscale2DLayer
from lasagne.regularization ... | apache-2.0 |
firerszd/kbengine | kbe/res/scripts/common/Lib/hashlib.py | 82 | 7983 | #. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, data=b'') - returns a new hash object implementing the
given hash function; initializing the has... | lgpl-3.0 |
ashellwig/Ethereum-Mutual-Fund | tests/scenarios/dthpool/run.py | 3 | 1183 | import random
scenario_description = (
"This scenario alternates various createProposal, vote, transfer,"
" setDelegate in various tokenHolders/delegates."
" It checks that all the votes are counted in the correct way after each"
" action."
)
def run(ctx):
ctx.assert_scenario_ran('fuel_predictive... | lgpl-3.0 |
smartdata-x/robots | pylib/Twisted/twisted/mail/topfiles/setup.py | 22 | 1798 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
try:
from twisted.python import dist
except ImportError:
raise SystemExit("twisted.python.dist module not found. Make sure you "
"have installed the Twisted core package before "
"attempting to in... | apache-2.0 |
RuudBurger/CouchPotatoServer | libs/git/exceptions.py | 122 | 2527 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
GrimRanger/GeneticAlgorithm | helps/deap/deap-master/examples/es/cma_1+l_minfct.py | 11 | 2038 | # This file is part of DEAP.
#
# DEAP 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 later version.
#
# DEAP is distributed ... | mit |
dangillet/cocos | test/test_flip_y.py | 6 | 1180 | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1, s, t 2, s, t 3, s, t 4.1, s, t 4.2, s, q"
tags = "FlipY"
import cocos... | bsd-3-clause |
mlorbetske/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/linecache.py | 80 | 4099 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globals=N... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.