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 |
|---|---|---|---|---|---|
MassStash/htc_m9_kernel_sense_5.0.2 | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
Yury191/brownstonetutors | allauth/socialaccount/forms.py | 62 | 2703 | from __future__ import absolute_import
from django import forms
from django.utils.translation import ugettext_lazy as _
from allauth.account.forms import BaseSignupForm
from allauth.account.utils import (user_username, user_email,
user_field)
from .models import SocialAccount
from ... | unlicense |
silentfuzzle/calibre | src/calibre/ebooks/pdf/render/links.py | 11 | 5627 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
protatremy/buildbot | master/buildbot/test/unit/test_schedulers_timed_NightlyBase.py | 10 | 15578 | # 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-2.0 |
GyrosOfWar/servo | tests/wpt/css-tests/tools/webdriver/webdriver/driver.py | 158 | 6732 | """Entry point for WebDriver."""
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
"""Controls a web browser."""
def __init__(self, host, required, desired, mode='strict'):
args = { 'desiredCapabilities': desired }
... | mpl-2.0 |
matrix-org/synapse | synapse/config/voip.py | 1 | 2161 | # Copyright 2014-2016 OpenMarket 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 agreed to in w... | apache-2.0 |
fabiocerqueira/django-allauth | allauth/socialaccount/migrations/0001_initial.py | 60 | 3746 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import allauth.socialaccount.fields
from allauth.socialaccount.providers import registry
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initi... | mit |
NoumirPoutipou/oanq | conftest.py | 1 | 1596 | import pytest
from django.test import signals
from django.test.client import Client
from django.contrib.auth.models import User, Permission
from jinja2 import Template as Jinja2Template
## Wait for https://code.djangoproject.com/ticket/24622
ORIGINAL_JINJA2_RENDERER = Jinja2Template.render
def instrumented_render... | bsd-3-clause |
yipenggao/moose | python/chigger/base/ChiggerResult.py | 6 | 6289 | #pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #
# (c) 2010... | lgpl-2.1 |
initNirvana/Easyphotos | env/lib/python3.4/site-packages/gunicorn/_compat.py | 35 | 6067 | import sys
from gunicorn import six
PY33 = (sys.version_info >= (3, 3))
def _check_if_pyc(fname):
"""Return True if the extension is .pyc, False if .py
and None if otherwise"""
from imp import find_module
from os.path import realpath, dirname, basename, splitext
# Normalize the file-path for th... | mit |
PythonCharmers/bokeh | bokeh/models/sources.py | 13 | 10604 | from __future__ import absolute_import
from ..plot_object import PlotObject
from ..properties import HasProps
from ..properties import Any, Int, String, Instance, List, Dict, Either, Bool, Enum
from ..validation.errors import COLUMN_LENGTHS
from .. import validation
from ..util.serialization import transform_column_so... | bsd-3-clause |
HiroIshikawa/21playground | microblog/flask/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | 765 | 26958 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Access to Python's configuration information."""
import codecs
import os
import re
import sys
from os.path import pardir, realpath
try:
import configparser
except ImportError:
import Conf... | mit |
tomchristie/django | tests/managers_regress/tests.py | 43 | 10902 | from django.db import models
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.test.utils import isolate_apps
from .models import (
AbstractBase1, AbstractBase2, AbstractBase3, Child1, Child2, Child3,
Child4, Child5, Child6, Child7, RelatedModel, Rela... | bsd-3-clause |
zicklag/godot | platform/javascript/detect.py | 4 | 3849 | import os
import string
import sys
def is_active():
return True
def get_name():
return "JavaScript"
def can_build():
return ("EMSCRIPTEN_ROOT" in os.environ or "EMSCRIPTEN" in os.environ)
def get_opts():
from SCons.Variables import BoolVariable
return [
BoolVariable('wasm', 'Compile... | mit |
j0nathan33/CouchPotatoServer | couchpotato/core/notifications/xmpp_.py | 96 | 2910 | from time import sleep
import traceback
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import xmpp
log = CPLog(__name__)
autoload = 'Xmpp'
class Xmpp(Notification):
def notify(self, message = '', data = None, listener = None):
if not data: data ... | gpl-3.0 |
srsman/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertBracesToField.py | 384 | 12556 | #########################################################################
#
# 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 |
IronLanguages/ironpython3 | Src/StdLib/Lib/_dummy_thread.py | 106 | 4872 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | apache-2.0 |
mrquim/repository.mrquim | script.module.liveresolver/lib/js2py/utils/injector.py | 34 | 5447 | __all__ = ['fix_js_args']
import types
import opcode
# Opcode constants used for comparison and replacecment
LOAD_FAST = opcode.opmap['LOAD_FAST']
LOAD_GLOBAL = opcode.opmap['LOAD_GLOBAL']
STORE_FAST = opcode.opmap['STORE_FAST']
def fix_js_args(func):
'''Use this function when unsure whether func takes this and ... | gpl-2.0 |
htwenhe/DJOA | env/Lib/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
Lagovas/themis | src/wrappers/themis/python/pythemis/scomparator.py | 3 | 4433 | #!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2015 Cossack Labs 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 req... | apache-2.0 |
PaulFranklin/python_koans | python2/contemplate_koans.py | 86 | 1295 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Acknowledgment:
#
# Python Koans is a port of Ruby Koans originally written by Jim Weirich
# and Joe O'brien of Edgecase. There are some differences and tweaks specific
# to the Python language, but a great deal of it has been copied wholesale.
# So thank guys!
#
impo... | mit |
zozo123/buildbot | master/buildbot/status/client.py | 1 | 1078 | # 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 |
Aquafina-water-bottle/Command-Compiler-Unlimited | test_fena/v1_13/test_teams.py | 1 | 1532 | from test_fena.test_common import test_cmd
def test_teams():
test_cmd("team add _team team_test", "team add fena.team team_test")
test_cmd("team add _team team test", "team add fena.team team test")
test_cmd("team empty _team", "team empty fena.team")
test_cmd("team _team + @a", "team ... | mit |
nmercier/linux-cross-gcc | linux/lib/python2.7/hotshot/log.py | 175 | 6239 | import _hotshot
import os.path
import parser
import symbol
from _hotshot import \
WHAT_ENTER, \
WHAT_EXIT, \
WHAT_LINENO, \
WHAT_DEFINE_FILE, \
WHAT_DEFINE_FUNC, \
WHAT_ADD_INFO
__all__ = ["LogReader", "ENTER", "EXIT", "LINE"]
ENTER = WHAT_ENTER
EXIT = WHAT_EXIT
LINE = WHAT_LINENO
... | bsd-3-clause |
appleseedhq/gaffer | python/GafferArnoldTest/__init__.py | 1 | 2815 | ##########################################################################
#
# Copyright (c) 2012, John Haddon. 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 so... | bsd-3-clause |
yqm/sl4a | python-build/python-libs/gdata/samples/finance/test_finance.py | 128 | 10785 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... | apache-2.0 |
KokareIITP/django | django/contrib/postgres/aggregates/statistics.py | 493 | 2033 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... | bsd-3-clause |
ColorFuzzy/tornado | tornado/test/httpclient_test.py | 3 | 26307 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import copy
import functools
import sys
import threading
import datetime
from io import BytesIO
from tornado.escape import utf8
from tornado import gen
f... | apache-2.0 |
cognitivefashion/cf-sdk-python | dominant_colors_product.py | 1 | 1998 | #------------------------------------------------------------------------------
# Get the dominant colors for an image in the catalog.
# GET /v1/catalog/{catalog_name}/dominant_colors/{id}/{image_id}
#------------------------------------------------------------------------------
import os
import json
import requests
f... | apache-2.0 |
PatKayongo/patkayongo.github.io | node_modules/pygmentize-bundled/vendor/pygments/pygments/__init__.py | 269 | 2974 | # -*- coding: utf-8 -*-
"""
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Highlights are:
* a ... | mit |
cxxgtxy/tensorflow | tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py | 4 | 6999 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
campbe13/openhatch | vendor/packages/kombu/kombu/async/timer.py | 27 | 6546 | # -*- coding: utf-8 -*-
"""
kombu.async.timer
=================
Timer scheduling Python callbacks.
"""
from __future__ import absolute_import
import heapq
import sys
from collections import namedtuple
from datetime import datetime
from functools import wraps
from time import time
from weakref import proxy as weakre... | agpl-3.0 |
oppia/oppia | core/controllers/subscriptions.py | 4 | 1781 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
bhaugen/foodnetwork | django_extensions/admin/widgets.py | 25 | 3014 | from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.text import truncate_words
from django.template.loader import render_to_string
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
class ForeignKeySearchInput(ForeignKeyRawIdWidget):
... | mit |
esthermm/enco | enco_category/models/purchase_report.py | 1 | 4459 | # -*- coding: utf-8 -*-
# © 2017 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models
from openerp import tools
class PurchaseReport(models.Model):
_inherit = 'purchase.report'
purchase_categ_id = fields.Many2one(
comodel_name=... | gpl-3.0 |
DailyActie/Surrogate-Model | 01-codes/scipy-master/scipy/linalg/tests/test_matfuncs.py | 1 | 33360 | #!/usr/bin/env python
#
# Created by: Pearu Peterson, March 2002
#
""" Test functions for linalg.matfuncs module
"""
from __future__ import division, print_function, absolute_import
import functools
import random
import warnings
import numpy as np
import scipy.linalg
import scipy.linalg._expm_frechet
from numpy impo... | mit |
oubiwann/myriad-worlds | myriad/story.py | 1 | 3923 | import yaml
from myriad.character import Player
from myriad.world import Map, World
from myriad.item import Item, OpenableItem, OpenableReadableItem, ReadableItem
# XXX maybe the story object should have a map attribute assigned based on
# story type... e.g., provided ASCII map, procedurally generated map, etc.
clas... | mit |
t0mm0/youtube-dl | youtube_dl/extractor/nerdcubed.py | 124 | 1131 | # coding: utf-8
from __future__ import unicode_literals
import datetime
from .common import InfoExtractor
class NerdCubedFeedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?nerdcubed\.co\.uk/feed\.json'
_TEST = {
'url': 'http://www.nerdcubed.co.uk/feed.json',
'info_dict': {
... | unlicense |
xflows/clowdflows-backend | workflows/api/serializers.py | 1 | 14887 | import json
from django.contrib.auth.models import User
from django.db.models import Prefetch
from django.template.loader import render_to_string
from rest_framework import serializers
from rest_framework.reverse import reverse
from mothra.settings import STATIC_URL, MEDIA_URL
from streams.models import Stream
from w... | mit |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/distutils/command/install_egg_info.py | 438 | 2587 | """distutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""
from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re
class install_egg_info(Command):
"""Install an .egg-info file for the package"""
... | gpl-2.0 |
knabar/openmicroscopy | components/tools/OmeroWeb/test/integration/test_metadata.py | 3 | 2890 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Glencoe Software, Inc.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | gpl-2.0 |
jlopezmalla/spark | python/pyspark/streaming/dstream.py | 85 | 27812 | #
# 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 |
8l/beri | cheritest/trunk/tests/fpu/test_raw_fpu_mov_gpr.py | 1 | 2722 | #-
# Copyright (c) 2012 Ben Thorner
# Copyright (c) 2013 Colin Rothwell
# All rights reserved.
#
# This software was developed by Ben Thorner as part of his summer internship
# and Colin Rothwell as part of his final year undergraduate project.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (... | apache-2.0 |
chaen/DIRAC | ProductionSystem/Service/ProductionManagerHandler.py | 2 | 5720 | """ DISET request handler base class for the ProductionDB.
"""
__RCSID__ = "$Id$"
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.ProductionSystem.DB.ProductionDB import ProductionDB
prodTypes = [basestring, int]
transTypes = [basestring, int, list]
cl... | gpl-3.0 |
avatarnewyork/daily_harvest | packages/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
google-code-export/los-cocos | cocos/collision_model.py | 3 | 27719 | # ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# Copyright (c) 2009-2014 Richard Jones, Claudio Canepa
# All rights reserved.
#
# Redistribution and use in source and binary forms, with o... | bsd-3-clause |
ai-se/george | Models/usp05.py | 1 | 7552 | """
# The USP05 Data Set
Standard header:
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
"""
@attribute ObjType {FT,PJ,RQ}
@attribute IntComplx {5.0,2.0,1.0,4.0,3.0,3.5,2.5,4.5,NULL}
@attribute DataFile {18.0,9.0,7.0,12.0,2.0,5.0,4.0,3.0,1.0,11.0,0.0,75... | mit |
keimlink/django-cms | cms/views.py | 2 | 7752 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.views import redirect_to_login
from django.core.urlresolvers import resolve, Resolver404, reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.http import urlquote
from django.utils.translation import get_l... | bsd-3-clause |
V-FEXrt/Pokemon-Spoof-Plus | CableClub/cable_club_trade_center.py | 1 | 1950 | from AI.team_manager import TeamManager
from cable_club_constants import TradeCenterState, Com
def reset():
global tradeCenterState, counter, eat_byte, ate_byte, choice_byte
tradeCenterState = TradeCenterState.CHOOSING_TRADE
counter = 416
eat_byte = False
ate_byte = 0x0
choice_byte = 0
reset()... | mit |
mateor/pants | tests/python/pants_test/help/test_scope_info_iterator.py | 11 | 2502 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
fro... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/staticgenerator/staticgenerator/__init__.py | 17 | 7869 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Static file generator for Django."""
import stat
from django.utils.functional import Promise
from filesystem import FileSystem
from handlers import DummyHandler
class StaticGeneratorException(Exception):
pass
class StaticGenerator(object):
"""
The StaticG... | agpl-3.0 |
srikk595/Multilingual-Search-System-for-tweets | partA/venv/lib/python2.7/site-packages/pip/vcs/bazaar.py | 280 | 4427 | from __future__ import absolute_import
import logging
import os
import tempfile
import re
# TODO: Get this into six.moves.urllib.parse
try:
from urllib import parse as urllib_parse
except ImportError:
import urlparse as urllib_parse
from pip.utils import rmtree, display_path
from pip.vcs import vcs, VersionC... | gpl-2.0 |
frdb194/django | tests/utils_tests/test_lazyobject.py | 268 | 8629 | from __future__ import unicode_literals
import copy
import pickle
import sys
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
class Foo(object):
"""
A simple class with just one attribute.
"""
foo = 'bar'
def __eq... | bsd-3-clause |
jcpowermac/ansible | lib/ansible/modules/cloud/ovirt/ovirt_group_facts.py | 74 | 3548 | #!/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 |
jorgebodega/PDL | library/test/yacc_badrule.py | 174 | 1525 | # -----------------------------------------------------------------------------
# yacc_badrule.py
#
# Syntax problems in the rule strings
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex imp... | gpl-3.0 |
axilleas/ansible-modules-core | utilities/helper/accelerate.py | 64 | 26967 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Cammarata <jcammarata@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 ... | gpl-3.0 |
mediawiki-utilities/python-mwcites | mwcites/extractors/tests/test_arxiv.py | 3 | 1419 | import pprint
from nose.tools import eq_
from .. import arxiv
from ...identifier import Identifier
INPUT_TEXT = """
This is a doi randomly placed in the text 10.0000/m1
Here's a typo that might be construed as a doi 10.60 people were there.
{{cite|...|arxiv=0706.0001v1|pmid=10559875}}
<ref>Halfaker, A., Geiger, R. S... | mit |
crosswalk-project/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_none_script-manual.py | 30 | 2381 | def main(request, response):
response.headers.set("Content-Security-Policy", "default-src 'none'")
response.headers.set("X-Content-Security-Policy", "default-src 'none'")
response.headers.set("X-WebKit-CSP", "default-src 'none'")
return """<!DOCTYPE html>
<!--
Copyright (c) 2013 Intel Corporation.
Redi... | bsd-3-clause |
lzw120/django | build/lib/django/db/models/sql/subqueries.py | 87 | 8259 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models... | bsd-3-clause |
crs4/omero.biobank | test/kb/test_individual.py | 1 | 2096 | # BEGIN_COPYRIGHT
# END_COPYRIGHT
import os, unittest, logging
logging.basicConfig(level=logging.ERROR)
from bl.vl.kb import KnowledgeBase as KB
from kb_object_creator import KBObjectCreator
OME_HOST = os.getenv("OME_HOST", "localhost")
OME_USER = os.getenv("OME_USER", "root")
OME_PASS = os.getenv("OME_PASS", "rome... | gpl-2.0 |
adityacs/ansible | lib/ansible/plugins/action/pause.py | 79 | 7055 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
wger-project/wger | wger/exercises/tests/test_categories.py | 1 | 3817 | # This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... | agpl-3.0 |
rgayon/plaso | plaso/winnt/known_folder_ids.py | 1 | 17463 | # -*- coding: utf-8 -*-
"""This file contains the Windows NT Known Folder identifier definitions."""
from __future__ import unicode_literals
# For now ignore the line too long errors.
# pylint: disable=line-too-long
# For now copied from:
# https://code.google.com/p/libfwsi/wiki/KnownFolderIdentifiers
# TODO: stor... | apache-2.0 |
ke4roh/RPiNWR | tests/test_cache.py | 1 | 16156 | # -*- coding: utf-8 -*-
__author__ = 'ke4roh'
# Copyright © 2016 James E. Scarborough
#
# 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... | gpl-3.0 |
Ttl/scikit-rf | skrf/media/tests/test_media.py | 6 | 3363 | import unittest
import os
import numpy as npy
from skrf.media import DefinedGammaZ0, Media
from skrf.network import Network
from skrf.frequency import Frequency
import skrf
class DefinedGammaZ0TestCase(unittest.TestCase):
def setUp(self):
self.files_dir = os.path.join(
os.path.dirname(os.pat... | bsd-3-clause |
ondrokrc/gramps | gramps/plugins/lib/libhtmlconst.py | 2 | 4656 | # -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com>
# Copyright (C) 2007 Gary Burton <gary.burton@zen.co.uk>
# Copyright (C) 2007-2009 Stephane Charette <... | gpl-2.0 |
kamcpp/tensorflow | tensorflow/contrib/learn/python/learn/estimators/head_test.py | 3 | 7722 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
soldag/home-assistant | homeassistant/components/http/ban.py | 5 | 6691 | """Ban logic for HTTP component."""
from collections import defaultdict
from datetime import datetime
from ipaddress import ip_address
import logging
from socket import gethostbyaddr, herror
from typing import List, Optional
from aiohttp.web import middleware
from aiohttp.web_exceptions import HTTPForbidden, HTTPUnaut... | apache-2.0 |
johnkit/vtk-dev | ThirdParty/Twisted/twisted/test/test_sip.py | 39 | 34356 | # -*- test-case-name: twisted.test.test_sip -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Session Initialization Protocol tests."""
from twisted.trial import unittest, util
from twisted.protocols import sip
from twisted.internet import defer, reactor, utils
from twisted.python.versio... | bsd-3-clause |
RavenB/opensim | OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeServer.py | 44 | 5053 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) Contributors, http://opensimulator.org/
# See CONTRIBUTORS.TXT for a full list of copyright holders.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# ... | bsd-3-clause |
zhangkun456/TeamTalk | win-client/3rdParty/src/json/devtools/licenseupdater.py | 177 | 3924 | """Updates the license text in source file.
"""
# An existing license is found if the file starts with the string below,
# and ends with the first blank line.
LICENSE_BEGIN = "// Copyright "
BRIEF_LICENSE = LICENSE_BEGIN + """2007-2010 Baptiste Lepilleur
// Distributed under MIT license, or public domain if desired a... | apache-2.0 |
philanthropy-u/edx-platform | pavelib/prereqs.py | 1 | 11951 | """
Install Python and Node prerequisites.
"""
from __future__ import print_function
import hashlib
import os
import re
import sys
import subprocess
import io
from distutils import sysconfig
from paver.easy import BuildFailure, sh, task
from .utils.envs import Env
from .utils.timer import timed
PREREQS_STATE_DIR = ... | agpl-3.0 |
exploreodoo/datStruct | odoo/addons/purchase_analytic_plans/__openerp__.py | 260 | 1725 | # -*- 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... | gpl-2.0 |
shirishgoyal/rational_crowd | config/urls.py | 1 | 1607 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from r... | mit |
LinusU/ansible | lib/ansible/plugins/filter/ipaddr.py | 149 | 18795 | # (c) 2014, Maciej Delmanowski <drybjed@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
tomjelinek/pcs | pcs/cli/routing/qdevice.py | 3 | 1098 | from pcs import (
qdevice,
usage,
)
from pcs.cli.common.routing import create_router
qdevice_cmd = create_router(
{
"help": lambda lib, argv, modifiers: usage.qdevice(argv),
"status": qdevice.qdevice_status_cmd,
"setup": qdevice.qdevice_setup_cmd,
"destroy": qdevice.qdevice... | gpl-2.0 |
kvar/ansible | test/units/modules/net_tools/nios/test_nios_ptr_record.py | 19 | 7158 | # 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 |
MWisBest/PyBot | Modules/requests/packages/idna/intranges.py | 154 | 1521 | """
Given a list of integers, made up of (hopefully) a small number of long runs
of consecutive integers, compute a representation of the form
((start1, end1), (start2, end2) ...). Then answer the question "was x present
in the original list?" in time O(log(# runs)).
"""
import bisect
def intranges_from_list(list_):
... | gpl-3.0 |
gamecredits-project/electrum-client | setup-release.py | 20 | 2827 | """
py2app/py2exe build script for Electrum
Usage (Mac OS X):
python setup.py py2app
Usage (Windows):
python setup.py py2exe
"""
from setuptools import setup
import os
import re
import shutil
import sys
from lib.util import print_error
from lib.version import ELECTRUM_VERSION as version
name = "Electrum... | gpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/extra_modules/gdata/apps/adminsettings/service.py | 48 | 13680 | #!/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 |
ortylp/scipy | scipy/sparse/csgraph/tests/test_reordering.py | 93 | 3457 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal
from scipy.sparse.csgraph import reverse_cuthill_mckee,\
maximum_bipartite_matching
from scipy.sparse import diags, csr_matrix, coo_matrix
def test_graph_reverse_cuthill_mckee():
A = ... | bsd-3-clause |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/htmllib.py | 312 | 12869 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from warnings import warnpy3k
warnpy3k("the htmllib module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
import sgmllib
from formatter import AS_IS
__all__ = ["HTMLPars... | mit |
derekjchow/models | research/learned_optimizer/problems/datasets.py | 7 | 7404 | # Copyright 2017 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
mbbill/shadowsocks | shadowsocks/server.py | 273 | 4627 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 requir... | apache-2.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/idlelib/CodeContext.py | 128 | 8353 | """CodeContext - Extension to display the block context above the edit window
Once code has scrolled off the top of a window, it can be difficult to
determine which block you are in. This extension implements a pane at the top
of each IDLE edit window which provides block structure hints. These hints are
the lines w... | lgpl-3.0 |
krast/suse_xen | tools/tests/utests/ut_xend/ut_XendConfig.py | 42 | 4443 | #===========================================================================
# 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 distributed in the hope tha... | gpl-2.0 |
RedHatQE/cfme_tests | cfme/automate/dialogs/dialog_tab.py | 1 | 2309 | import attr
from navmazing import NavigateToAttribute
from widgetastic.widget import Text
from . import AddTabView
from . import TabForm
from .dialog_box import BoxCollection
from cfme.modeling.base import BaseCollection
from cfme.modeling.base import BaseEntity
from cfme.modeling.base import parent_of_type
from cfme.... | gpl-2.0 |
felliott/osf.io | scripts/migration/migrate_share_registration_data.py | 6 | 1325 | # TODO: Consider rewriting as management command
import logging
import sys
import django
from django.db import transaction
django.setup()
from osf.models import Registration
from scripts import utils as script_utils
from website import settings
from website.app import init_app
from api.share.utils import update_share
... | apache-2.0 |
Codefans-fan/odoo | openerp/addons/base/res/res_currency.py | 15 | 14571 | # -*- 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 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Google/Drive/Parents/Delete.py | 5 | 4626 | # -*- coding: utf-8 -*-
###############################################################################
#
# Delete
# Removes a parent from a file.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | gpl-2.0 |
markrawlingson/SickRage | autoProcessTV/lib/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
tiborsimko/invenio-records-rest | invenio_records_rest/sorter.py | 3 | 4470 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
r"""Sorter factories for REST API.
The default sorter factory allows you to define p... | mit |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/django/contrib/comments/models.py | 125 | 7754 | from django.conf import settings
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from djan... | mit |
lochiiconnectivity/boto | tests/integration/gs/test_resumable_downloads.py | 110 | 16174 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | mit |
jquacinella/flask-social | flask_social/providers/facebook.py | 3 | 1895 | # -*- coding: utf-8 -*-
"""
flask.ext.social.providers.facebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains the Flask-Social facebook code
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import
import facebook
co... | mit |
pyspace/test | pySPACE/missions/nodes/meta/same_input_layer.py | 1 | 22715 | """ Combine several other nodes together in parallel
This is useful to be combined with the
:class:`~pySPACE.missions.nodes.meta.flow_node.FlowNode`.
"""
import numpy
from pySPACE.environments.chains.node_chain import NodeChainFactory
from pySPACE.missions.nodes.base_node import BaseNode
from pySPACE.resources.data_... | gpl-3.0 |
googleapis/python-game-servers | google/cloud/gaming_v1/services/realms_service/async_client.py | 1 | 28046 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
Antiun/c2c-rd-addons | chricar_top/report/__init__.py | 4 | 1230 | # -*- coding: utf-8 -*-
# ChriCar Beteiligungs- und Beratungs- GmbH
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-t... | agpl-3.0 |
dgzzhb/GAOthello | board.py | 1 | 10425 | #!/usr/bin/env python
""" game.py Humberto Henrique Campos Pinheiro
Game logic.
"""
from config import WHITE, BLACK, EMPTY
from copy import deepcopy
class Board:
""" Rules of the game """
def __init__ ( self ):
self.board = [ [0,0,0,0,0,0,0,0], \
[0,0,0,0... | mit |
sbg/Mitty | mitty/simulation/sequencing/syntheticsequencer.py | 1 | 1955 | """A fully synthetic read model that allows us to produce single end or paired end reads with arbitrary
read and template lengths. It's read model format is as follows
{
'model_class': 'illumina',
'model_description': '',
'paired': True/False,
'read_length': 100,
'mean_template_length': 300,
'std_template_... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.