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 |
|---|---|---|---|---|---|
valtech-mooc/edx-platform | common/lib/xmodule/xmodule/tests/test_textannotation.py | 92 | 2829 | # -*- coding: utf-8 -*-
"Test for Annotation Xmodule functional logic."
import unittest
from mock import Mock
from lxml import etree
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.textannotation_module import TextAnnotationModule
from . import get_test_system
class Tex... | agpl-3.0 |
andrewleech/SickRage | lib/sqlalchemy/pool.py | 75 | 43619 | # sqlalchemy/pool.py
# Copyright (C) 2005-2014 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
"""Connection pooling for DB-API connections.
Provides a number of connection poo... | gpl-3.0 |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/pip/commands/search.py | 27 | 4605 | from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.download import PipXmlrpcTransport
from pip.models import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from pip.exceptions import CommandError... | mit |
JoeGlancy/linux | scripts/analyze_suspend.py | 1537 | 120394 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | gpl-2.0 |
alikins/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_tags.py | 25 | 9319 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | gpl-3.0 |
tux-00/ansible | lib/ansible/parsing/utils/jsonify.py | 117 | 1292 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
bssrdf/zulip | api/integrations/trac/zulip_trac.py | 114 | 5142 | # -*- coding: utf-8 -*-
# Copyright © 2012 Zulip, 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, ... | apache-2.0 |
harisbal/pandas | pandas/tests/series/test_missing.py | 1 | 51950 | # coding=utf-8
# pylint: disable-msg=E1101,W0612
from datetime import datetime, timedelta
from distutils.version import LooseVersion
import numpy as np
from numpy import nan
import pytest
import pytz
from pandas._libs.tslib import iNaT
from pandas.compat import range
from pandas.errors import PerformanceWarning
impo... | bsd-3-clause |
yakovenkodenis/rethinkdb | external/v8_3.30.33.16/build/gyp/test/additional-targets/gyptest-additional.py | 139 | 1530 | #!/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.
"""
Verifies simple actions when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('all.g... | agpl-3.0 |
Mazecreator/tensorflow | tensorflow/python/kernel_tests/sparse_tensor_dense_matmul_grad_test.py | 99 | 3581 | # 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 |
jhseu/tensorflow | tensorflow/python/client/device_lib.py | 16 | 1562 | # 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 |
abhiii5459/sympy | sympy/printing/latex.py | 15 | 71982 | """
A Printer which converts an expression into its LaTeX equivalent.
"""
from __future__ import print_function, division
from sympy.core import S, Add, Symbol
from sympy.core.function import _coeff_isneg
from sympy.core.sympify import SympifyError
from sympy.core.alphabets import greeks
from sympy.core.operations im... | bsd-3-clause |
eblossom/gnuradio | gr-analog/python/analog/qa_ctcss_squelch.py | 47 | 3066 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | gpl-3.0 |
miles0411/pm | venv/lib/python2.7/site-packages/pip/_vendor/lockfile/pidlockfile.py | 488 | 6221 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... | apache-2.0 |
roadmapper/ansible | test/units/modules/network/onyx/test_onyx_snmp.py | 9 | 6192 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... | gpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dnslib/ranges.py | 19 | 4067 | # -*- coding: utf-8 -*-
"""
Wrapper around property builtin to restrict attribute to defined
integer value range (throws ValueError).
Intended to ensure that values packed with struct are in the
correct range
>>> class T(object):
... a = range_property('a',-100,100)
... b = B('b... | gpl-3.0 |
msebire/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_intern.py | 315 | 1405 | # Copyright 2006 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for intern().
intern(s) -> sys.intern(s)"""
# Local imports
from .. import pytree
from .. import fixer_base
from ..fixer_util import Name, Attr, touch_import
class FixIntern(fixer_base.BaseFix):
BM_compatible = True
or... | apache-2.0 |
SiLab-Bonn/basil | basil/utils/sim/BasilBusDriver.py | 1 | 4344 | #
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
# Initial version by Chris Higgs <chris.higgs@potentialventures.com>
#
# pylint: disable=pointless-stat... | bsd-3-clause |
Alzon/senlin | senlin/db/sqlalchemy/models.py | 1 | 14127 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | apache-2.0 |
muckrack/python-goose | tests/extractors/base.py | 13 | 6777 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
jmesteve/saas3 | openerp/addons/website/models/test_models.py | 56 | 1285 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_converter(orm.Model):
_name = 'website.converter.test'
_columns = {
'char': fields.char(),
'integer': fields.integer(),
'float': fields.float(),
'numeric': fields.float(digits=(16, 2)),
'many2one': f... | agpl-3.0 |
ktok07b6/polyphony | tests/module/nesting03.py | 1 | 1185 | from polyphony import module
from polyphony import testbench
from polyphony import is_worker_running
from polyphony.io import Port
from polyphony.typing import int8
from polyphony.timing import clksleep, wait_value
@module
class Submodule:
def __init__(self, param):
self.i = Port(int8, 'in')
self.... | mit |
dreal/dreal-next | benchmarks/drh/network/airplane/gen.py | 55 | 1248 |
flow_var = {}
flow_dec = {}
state_dec = {}
state_val = {}
cont_cond = {}
jump_cond = {}
def getHdr(n):
res = []
for i in range(n):
getHdr.counter += 1
res.append(getHdr.counter)
return res
getHdr.counter = 0
######################
# Formula generation #
######################
def pri... | gpl-3.0 |
NCAR/icar | helpers/erai/config.py | 2 | 4707 | import datetime,os
import argparse
import numpy as np
from bunch import Bunch
import mygis
import io_routines as io
version="1.1"
def set_bounds(info):
atm_file=info.atmdir+info.atmfile
erai_file=atm_file.replace("_Y_","2000").replace("_M_","01").replace("_D_","01").replace("_h_","00")
varlist=["g4_lat... | gpl-2.0 |
alu0100207385/dsi_3Django | django/db/models/sql/datastructures.py | 114 | 1853 | """
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
... | bsd-3-clause |
paulodiogo/foursquared.eclair | util/oget.py | 262 | 3416 | #!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | apache-2.0 |
tvenkat/askbot-devel | askbot/management/commands/junk.py | 10 | 1145 | import os
import sys
import tempfile
import threading
from django.core.management.base import NoArgsCommand
from django.core import management
class SEImporterThread(threading.Thread):
def __init__(self, stdout = None):
self.stdout = stdout
super(SEImporterThread, self).__init__()
def run(self... | gpl-3.0 |
pedrobaeza/account-financial-tools | currency_rate_date_check/__openerp__.py | 4 | 2030 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Currency rate date check module for Odoo
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you... | agpl-3.0 |
moreati/gatspy | gatspy/periodic/modeler.py | 1 | 9034 | from __future__ import division, print_function
import numpy as np
from .optimizer import LinearScanOptimizer
class PeriodicModeler(object):
"""Base class for periodic modeling"""
def __init__(self, optimizer=None, fit_period=False,
optimizer_kwds=None, *args, **kwargs):
if optimize... | bsd-2-clause |
bionomicron/Redirector | util/FlatFileParser.py | 1 | 14961 | #!/usr/bin/env python
'''
@author: Graham Rockwell
@organization: Church Lab Harvard Genetics
@version: 03/04/2013
--Rename to metabolic-model parser
'''
import string, sets, re
from util.Report import Report
class TagedElement(dict):
def __init__(self):
self.annotation = {}
def __str__... | mit |
ofekd/servo | tests/wpt/css-tests/tools/pywebsocket/src/example/echo_noext_wsh.py | 465 | 2404 | # Copyright 2013, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
hfp/tensorflow-xsmm | tensorflow/python/debug/examples/debug_keras.py | 13 | 3110 | # 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 |
hcmlab/nova | bin/cml/models/templates/continuous/video/tensorflow/interface.py | 1 | 9317 |
import sys
import importlib
if not hasattr(sys, 'argv'):
sys.argv = ['']
#import tensorflow as tf
import numpy as np
import random
#import time
from xml.dom import minidom
import os
import shutil
import site
import pprint
import h5py
import imageio
from skimage.transform import resize
import site as s
s.getusersite... | gpl-3.0 |
viniciusgama/blog_gae | django/contrib/gis/geos/prototypes/topology.py | 311 | 2226 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',
'geos_difference', 'geos_envelope', 'geos_intersection',
'geos_linemerge', 'geos_pointonsurface', 'geos_pre... | bsd-3-clause |
kdmurray91/ooni-probe | ooni/tests/test_nettest.py | 5 | 11006 | import os
from tempfile import mkstemp
from twisted.trial import unittest
from twisted.internet import defer, reactor
from twisted.python.usage import UsageError
from ooni.settings import config
from ooni.errors import MissingRequiredOption, OONIUsageError, IncoherentOptions
from ooni.nettest import NetTest, NetTestL... | bsd-2-clause |
chirilo/mozillians | vendor-local/lib/python/unidecode/x05d.py | 252 | 4670 | data = (
'Lang ', # 0x00
'Kan ', # 0x01
'Lao ', # 0x02
'Lai ', # 0x03
'Xian ', # 0x04
'Que ', # 0x05
'Kong ', # 0x06
'Chong ', # 0x07
'Chong ', # 0x08
'Ta ', # 0x09
'Lin ', # 0x0a
'Hua ', # 0x0b
'Ju ', # 0x0c
'Lai ', # 0x0d
'Qi ', # 0x0e
'Min ', # 0x0f
'Kun ', # 0x10
'... | bsd-3-clause |
haxwithaxe/qutebrowser | tests/unit/misc/test_msgbox.py | 4 | 2768 | # Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# This file is part of qutebrowser.
#
# qutebrowser 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 Sof... | gpl-3.0 |
Daniel-CA/odoo | addons/l10n_be_intrastat/wizard/xml_decl.py | 32 | 17798 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
Ahmad31/Web_Flask_Cassandra | flask/lib/python2.7/site-packages/pony/orm/tests/test_lazy.py | 2 | 2091 | from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
class TestLazy(unittest.TestCase):
def setUp(self):
self.db = Database('sqlite', ':memory:')
class X(self.db.Entity):
a = Required(int)
b = Required(unic... | apache-2.0 |
Bolton-and-Menk-GIS/restapi | restapi/admin/utils.py | 1 | 14423 | from __future__ import print_function
from .. import admin, has_arcpy, munch
from ..rest_utils import JsonGetter, NameEncoder
import os
import json
from six.moves import range
__all__ = ['ServerAdministrator']
if has_arcpy:
import arcpy
mapping = getattr(arcpy, 'mapping' if hasattr(arcpy, 'mappi... | gpl-2.0 |
zhexiao/estory | vendor/bower-asset/bootstrap/test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | apache-2.0 |
libos-nuse/net-next-nuse | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
dropbox/changes | tests/changes/api/test_plan_options.py | 1 | 1754 | from changes.config import db
from changes.models.option import ItemOption
from changes.testutils import APITestCase
class PlanOptionsListTest(APITestCase):
def test_simple(self):
project = self.create_project()
plan = self.create_plan(project)
path = '/api/0/plans/{0}/options/'.format(pl... | apache-2.0 |
kevinthesun/mxnet | example/neural-style/end_to_end/model_vgg19.py | 43 | 6553 | # 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 |
endlessm/chromium-browser | third_party/llvm/llvm/utils/extract_vplan.py | 29 | 1614 | #!/usr/bin/env python
# This script extracts the VPlan digraphs from the vectoriser debug messages
# and saves them in individual dot files (one for each plan). Optionally, and
# providing 'dot' is installed, it can also render the dot into a PNG file.
from __future__ import print_function
import sys
import re
impor... | bsd-3-clause |
yury-s/v8-inspector | Source/chrome/tools/telemetry/telemetry/core/platform/android_platform_backend.py | 2 | 27874 | # 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 logging
import os
import re
import shutil
import subprocess
import tempfile
from telemetry.core.backends import adb_commands
from telemetry.core impo... | bsd-3-clause |
rahulunair/nova | nova/compute/build_results.py | 96 | 1039 | # Copyright 2014 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 requ... | apache-2.0 |
sassoftware/mirrorball | updatebot/lib/util.py | 1 | 7770 | #
# Copyright (c) SAS Institute, 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 agreed to in ... | apache-2.0 |
kmARC/Cloud99 | runners/baseRunner.py | 1 | 1077 | import ha_engine.ha_infra as common
LOG = common.ha_logging(__name__)
class BaseRunner(object):
def __init__(self, input_args):
self.ha_report = []
self.input_args = {}
if input_args:
self.set_input_arguments(input_args)
def set_input_arguments(self, input_args):
... | apache-2.0 |
lamby/python-social-auth | social/strategies/cherrypy_strategy.py | 77 | 1924 | import six
import cherrypy
from social.strategies.base import BaseStrategy, BaseTemplateStrategy
class CherryPyJinja2TemplateStrategy(BaseTemplateStrategy):
def __init__(self, strategy):
self.strategy = strategy
self.env = cherrypy.tools.jinja2env
def render_template(self, tpl, context):
... | bsd-3-clause |
jiangwei1221/django-virtualenv-demo | env/lib/python2.7/site-packages/debug_toolbar/panels/headers.py | 30 | 2025 | from __future__ import absolute_import, unicode_literals
try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import Panel
class HeadersPanel(Panel):
... | unlicense |
dharmabumstead/ansible | lib/ansible/modules/remote_management/hpilo/hpilo_facts.py | 46 | 7753 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tommyip/zulip | zerver/migrations/0221_subscription_notifications_data_migration.py | 3 | 2687 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-13 20:13
from __future__ import unicode_literals
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
RECIPIENT_STREAM = 2
SETTINGS_MAP = {
'... | apache-2.0 |
davisein/jitsudone | django/django/contrib/gis/db/backends/postgis/creation.py | 99 | 2854 | from django.conf import settings
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_opts = 'GIST_GEOMETRY_OPS'
def sql_indexes_for_field(self, model, f, style):
"Return any spatial index creation... | bsd-3-clause |
Chilledheart/chromium | tools/telemetry/telemetry/internal/util/command_line_unittest.py | 17 | 1373 | # Copyright 2015 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 unittest
from telemetry.internal.util import command_line
class BenchmarkFoo(object):
""" Benchmark Foo for testing."""
@classmethod
def Name... | bsd-3-clause |
alangwansui/mtl_ordercenter | openerp/addons/audittrail/audittrail.py | 29 | 29115 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
abdoosh00/edx-platform | lms/djangoapps/psychometrics/management/commands/init_psychometrics.py | 22 | 2391 | #!/usr/bin/python
#
# generate pyschometrics data from tracking logs and student module data
import json
from courseware.models import StudentModule
from track.models import TrackingLog
from psychometrics.models import PsychometricData
from django.conf import settings
from django.core.management.base import BaseComm... | agpl-3.0 |
wojla/kozaczko | biblio/settings.py | 1 | 2066 | # """
# Django settings for biblio project.
#
# For more information on this file, see
# https://docs.djangoproject.com/en/1.7/topics/settings/
#
# For the full list of settings and their values, see
# https://docs.djangoproject.com/en/1.7/ref/settings/
# """
# Build paths inside the project like this: os.path.join(B... | mit |
losnikitos/googleads-python-lib | examples/dfp/v201411/forecast_service/get_forecast.py | 4 | 3292 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
Idematica/django-oscar | oscar/apps/offer/migrations/0027_add_rangeproduct.py | 11 | 17664 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
""" Manually written migration to add the priority parameter to
Range.included_products.
South suggested to drop original table and create a new table.
It would be painful for existi... | bsd-3-clause |
Godiyos/python-for-android | python3-alpha/extra_modules/gdata/Crypto/PublicKey/qNEW.py | 45 | 5540 | #
# qNEW.py : The q-NEW signature algorithm.
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness fo... | apache-2.0 |
ubuntuvim/GoAgent | local/gevent-1.0rc2/greentest/test__examples.py | 2 | 1359 | import sys
import os
import glob
import time
import util
cwd = '../examples/'
ignore = ['wsgiserver.py', 'wsgiserver_ssl.py', 'webproxy.py', 'webpy.py']
if sys.platform == 'win32':
ignore += ['geventsendfile.py', 'psycopg2_pool.py']
ignore += [x[14:] for x in glob.glob('test__example_*.py')]
default_time_range =... | mit |
dwaynebailey/translate | translate/lang/tr.py | 3 | 1065 | # -*- coding: utf-8 -*-
#
# Copyright 2009,2013 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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... | gpl-2.0 |
beingzy/user_recommender_framework | network_simulator/GuidedUserClickSimulator.py | 1 | 1477 | """ objective introduction
Author: Yi Zhang <beingzy@gmail.com>
Date: 2016/05/09
"""
from .UserClickSimulator import UserClickSimulatorMixin
def convert_pair_dictionary(user_connections):
""" translate user pairs into user-wise dictionary
"""
user_conn_dict = {}
for ii, (uid_a, uid_b) in enumerate(us... | gpl-3.0 |
geoenvo/geonode | geonode/contrib/geosites/post_settings.py | 21 | 3197 | # flake8: noqa
##### Settings to be included last
###############################################
# Master Geosite settings
# These settings are called at/near the end of a GeoSite settings
# to finalize some derived settings
###############################################
# geonode local_settings
try:
# load in ... | gpl-3.0 |
tumf/p2pool | p2pool/bitcoin/height_tracker.py | 227 | 4678 | from twisted.internet import defer
from twisted.python import log
import p2pool
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, forest, jsonrpc, variable
class HeaderWrapper(object):
__slots__ = 'hash previous_hash'.split(' ')
@classmethod
def from_header(cls, header... | gpl-3.0 |
a-b/PopClip-Extensions | source/OneNote/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## 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 |
yeldartoktasynov/app-landing-page | vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/styles/pastie.py | 135 | 2473 | # -*- coding: utf-8 -*-
"""
pygments.styles.pastie
~~~~~~~~~~~~~~~~~~~~~~
Style similar to the `pastie`_ default style.
.. _pastie: http://pastie.caboo.se/
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style impor... | mit |
ask/python-github2 | github2/teams.py | 1 | 3026 | # Copyright (C) 2011-2012 James Rowe <jnrowe@gmail.com>
# Patryk Zawadzki <patrys@pld-linux.org>
#
# This file is part of python-github2, and is made available under the 3-clause
# BSD license. See LICENSE for the full details.
from github2.core import BaseData, GithubCommand, Attribute, requi... | bsd-3-clause |
windyuuy/opera | chromium/src/tools/telemetry/telemetry/page/page.py | 3 | 4481 | # 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.
import os
import re
import time
import urlparse
from telemetry.core import util
def _UrlPathJoin(*args):
"""Joins each path in |args| for insertion in... | bsd-3-clause |
emidln/django_roa | env/lib/python2.7/site-packages/PIL/FitsStubImagePlugin.py | 40 | 1643 | #
# The Python Imaging Library
# $Id$
#
# FITS stub adapter
#
# Copyright (c) 1998-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
import Image, ImageFile
_handler = None
##
# Install application-specific FITS image handler.
#
# @param handler Handler object.
def registe... | bsd-3-clause |
acutesoftware/AIKIF | aikif/.z_prototype/tools.py | 1 | 4110 | # coding: utf-8
# tools.py written by Duncan Murray 20/3/2014 (C) Acute Software
# Script to configure the functional toolbox of AIKIF
import os
import sys
import time
from random import randint
import aikif.toolbox.Toolbox as mod_tool
import aikif.config as mod_cfg
aikif_dir = mod_cfg.core_folder # os.path.dirname(o... | gpl-3.0 |
michalochman/complex-networks | code/calc-users-topics-count.py | 1 | 1552 | from collections import OrderedDict
import os
from multiprocessing import Process, Queue, JoinableQueue, cpu_count
import math
import MySQLdb
from MySQLdb.cursors import SSDictCursor
from scur_mgr import DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_TABLE_RELATIONSHIPS
__DIR__ = os.path.dirname(os.path.abspath(__file__))
i... | mit |
Hokutosei/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/setup.py | 213 | 1409 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
soundcloud/selenium | py/selenium/webdriver/firefox/webdriver.py | 5 | 2988 | #!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | apache-2.0 |
IDMIPPM/reliability-aware-resynthesis | resynthesis/resynthesis_create_subckts.py | 1 | 39197 | # coding: utf-8
__author__ = 'IDM.IPPM (Roman Solovyev)'
import os
import subprocess
import re
import random
from resynthesis.resynthesis_external_stats import get_project_directory
import resynthesis as sa
# Получает список уникальных имен узлов из структуры merge
def getUniqueNames(m):
lst = []
for o in m:
... | apache-2.0 |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.2.5/django/contrib/localflavor/uk/forms.py | 313 | 1943 | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | gpl-3.0 |
richardcs/ansible | lib/ansible/modules/network/onyx/onyx_ptp_interface.py | 59 | 8135 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
rduivenvoorde/QGIS | tests/src/python/test_qgsmapboxglconverter.py | 10 | 30272 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapBoxGlStyleConverter.
.. 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 License, or
(at your option) any later vers... | gpl-2.0 |
elkingtonmcb/shogun | examples/undocumented/python_modular/structure_discrete_hmsvm_bmrm.py | 15 | 1113 | #!/usr/bin/env python
import numpy
import scipy
from scipy import io
data_dict = scipy.io.loadmat('../data/hmsvm_data_large_integer.mat', struct_as_record=False)
parameter_list=[[data_dict]]
def structure_discrete_hmsvm_bmrm (m_data_dict=data_dict):
from modshogun import RealMatrixFeatures, SequenceLabels, HMSVMMo... | gpl-3.0 |
beezee/GAE-Django-base-app | django/contrib/gis/maps/google/zoom.py | 327 | 6628 | from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from math import pi, sin, cos, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 180.
RTOD = 180. / pi
class GoogleZoom(object):
... | bsd-3-clause |
ambikeshwar1991/sandhi-2 | module/gr36/gr-howto-write-a-block/docs/doxygen/doxyxml/base.py | 333 | 6794 | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | gpl-3.0 |
michalliu/watchman | tests/integration/WatchmanTapTests.py | 18 | 4275 | import unittest
import os
import os.path
import subprocess
import glob
import re
import WatchmanInstance
import signal
import Interrupt
import tempfile
class TapExeTestCase(unittest.TestCase):
def __init__(self, executable):
super(TapExeTestCase, self).__init__()
self.executable = executable
... | apache-2.0 |
Smart-Torvy/torvy-home-assistant | homeassistant/components/scene/homeassistant.py | 23 | 2523 | """
Allow users to set and activate scenes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/scene/
"""
from collections import namedtuple
from homeassistant.components.scene import Scene
from homeassistant.const import (
ATTR_ENTITY_ID, STATE_OFF, S... | mit |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/models/object_detection/matchers/argmax_matcher_test.py | 21 | 9704 | # 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... | bsd-2-clause |
Attorney-Fee/django-wiki | wiki/conf/settings.py | 1 | 6506 | # -*- coding: utf-8 -*-
from django.conf import settings as django_settings
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
# Should urls be case sensitive?
URL_CASE_SENSITIVE = getattr( django_settings, 'WIKI_URL_CASE_SENSITIVE', False )
# Non-configurable (at the... | gpl-3.0 |
Yukarumya/Yukarum-Redfoxes | python/mozbuild/mozbuild/frontend/emitter.py | 1 | 61700 | # 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/.
from __future__ import absolute_import, unicode_literals
import itertools
import logging
import os
import traceback
imp... | mpl-2.0 |
Zentyal/openchange | mapiproxy/services/ocsmanager/ocsmanager/config/middleware.py | 12 | 3101 | """Pylons middleware initialization"""
from beaker.middleware import SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.deploy.converters import asbool
from pylons.middleware import ErrorHandler, StatusCodeRedirect
from ... | gpl-3.0 |
tempbottle/grpc | src/python/grpcio_test/grpc_test/_adapter/_future_invocation_asynchronous_event_service_test.py | 14 | 2007 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
aptrishu/coala | tests/results/SourceRangeTest.py | 21 | 5938 | import unittest
from collections import namedtuple
from os.path import abspath
from coalib.results.SourcePosition import SourcePosition
from coalib.results.SourceRange import SourceRange
from coalib.results.AbsolutePosition import AbsolutePosition
from coalib.results.Diff import Diff
class SourceRangeTest(unittest.T... | agpl-3.0 |
fumen/gae-fumen | lib/click/utils.py | 201 | 14916 | import os
import sys
from .globals import resolve_color_default
from ._compat import text_type, open_stream, get_filesystem_encoding, \
get_streerror, string_types, PY2, binary_streams, text_streams, \
filename_to_ui, auto_wrap_for_ansi, strip_ansi, should_strip_ansi, \
_default_text_stdout, _default_text... | bsd-3-clause |
fgesora/odoo | addons/account_budget/wizard/account_budget_crossovered_summary_report.py | 373 | 2191 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
SanchayanMaity/gem5 | tests/testing/tests.py | 8 | 12237 | #!/usr/bin/env python
#
# Copyright (c) 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementatio... | bsd-3-clause |
protochron/aurora | 3rdparty/javascript/scheduler/assets/bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | apache-2.0 |
Evervolv/android_external_chromium_org | chrome/common/extensions/docs/server2/instance_servlet.py | 24 | 3697 | # 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.
from appengine_wrappers import IsDevServer
from branch_utility import BranchUtility
from compiled_file_system import CompiledFileSystem
from empty_dir_file_s... | bsd-3-clause |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Doc/includes/mp_benchmarks.py | 57 | 5535 | #
# Simple benchmarks for the multiprocessing package
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
import time, sys, multiprocessing, threading, Queue, gc
if sys.platform == 'win32':
_timer = time.clock
else:
_timer = time.time
delta = 1
#### TEST_QUEUESPEED
def queuespeed_func(q, c, it... | gpl-3.0 |
mbareta/edx-platform-ft | lms/djangoapps/certificates/queue.py | 8 | 21616 | """Interface for adding certificate generation tasks to the XQueue. """
import json
import random
import logging
import lxml.html
from lxml.etree import XMLSyntaxError, ParserError
from uuid import uuid4
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import... | agpl-3.0 |
sarutobi/Rynda | rynda/users/migrations/0001_initial.py | 3 | 1629 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | mit |
tsli/test | swift/common/middleware/name_check.py | 9 | 4941 | # Copyright (c) 2012 OpenStack, 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 agreed to in wr... | apache-2.0 |
cstavr/synnefo | snf-django-lib/snf_django/lib/db/fields.py | 9 | 2414 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.