repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jtpereyda/sulley | refs/heads/develop | sulley/ifuzz_logger.py | 1 | import abc
class IFuzzLogger(object):
"""
Abstract class for logging fuzz data.
Usage while testing:
1. Open test case.
2. Open test step.
3. Use other log methods.
IFuzzLogger provides the logging interface for the Sulley framework and
test writers.
The methods provided are ... |
bigswitch/tempest | refs/heads/master | tempest/cmd/init.py | 1 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... |
bcorbet/SickRage | refs/heads/master | lib/hachoir_parser/common/__init__.py | 12133432 | |
rvs/gpdb | refs/heads/master | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/crashrecovery/commit_create_tests/trigger_sql/__init__.py | 12133432 | |
erikr/django | refs/heads/master | tests/bash_completion/management/commands/__init__.py | 12133432 | |
i02sopop/Kirinki | refs/heads/master | __init__.py | 12133432 | |
anant-dev/django | refs/heads/master | django/contrib/gis/geos/io.py | 588 | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import (
WKBWriter, WKTWriter, _WKBReade... |
DigitalCampus/django-oppia | refs/heads/master | settings/migrations/0016_setting_descriptions.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.utils.translation import ugettext_lazy as _
from settings import constants
def add_setting_descriptions(apps, schema_editor):
props = apps.get_model("settings", "SettingProperties")
setting_oppia_dat... |
aubreystarktoller/lite-boolean-formulae | refs/heads/master | tests/test_equivalence.py | 1 | from lite_boolean_formulae import L
def test_reflexive():
assert L("x") == L("x")
def test_conjunction_with_negation():
assert ((L("x") & (~L("x"))) is False)
def test_disjunction_with_negation():
assert ((L("x") | (~L("x"))) is True)
def test_and_commutative():
assert (L("x") & L("y") & L("z"))... |
seanxwzhang/LeetCode | refs/heads/master | 300 Longest Increasing Subsequence/solution.py | 1 | # Given an unsorted array of integers, find the length of longest increasing subsequence.
# For example,
# Given [10, 9, 2, 5, 3, 7, 101, 18],
# The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than one LIS combination, it is only necessary for you to return ... |
sssllliang/edx-analytics-pipeline | refs/heads/master | edx/analytics/tasks/reports/finance_reports.py | 1 | """Provide entry-point for generating finance reports."""
import luigi
from edx.analytics.tasks.reports.reconcile import (
TransactionReportTask, LoadInternalReportingOrderTransactionsToWarehouse
)
from edx.analytics.tasks.reports.ed_services_financial_report import (
LoadInternalReportingEdServicesReportToWar... |
yavalvas/yav_com | refs/heads/master | build/matplotlib/lib/matplotlib/tests/test_simplification.py | 1 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
import matplotlib
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup
import matplotlib.pyplot as plt
from pylab import *
import numpy as np
from ... |
huang4fstudio/django | refs/heads/master | django/core/cache/backends/locmem.py | 586 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... |
campenberger/albackup | refs/heads/master | albackup/compare.py | 1 | from __future__ import print_function
import logging
import json
import os
from jinja2 import Environment,FileSystemLoader
from tempfile import NamedTemporaryFile
import sh
from albackup import loggerFactory
_getLogger=loggerFactory('compare')
_jina_env=Environment(loader=FileSystemLoader('templates'))
class DbComp... |
chuckchen/spark | refs/heads/master | python/pyspark/tests/test_serializers.py | 8 | #
# 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... |
GauriGNaik/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/__init__.py | 329 | from server import WebTestHttpd, WebTestServer, Router
from request import Request
from response import Response
|
pombredanne/django-url-filter | refs/heads/master | test_project/many_to_many/alchemy.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import backref, relationship
from sqlalchemy.schema import ForeignKey, Table
from ..alchemy import Base
class Publication(Base):
__tablename__ = 'ma... |
GageGaskins/osf.io | refs/heads/develop | scripts/analytics/comments.py | 35 | # -*- coding: utf-8 -*-
import os
import matplotlib.pyplot as plt
from framework.mongo import database
from website import settings
from utils import plot_dates, mkdirp
comment_collection = database['comment']
FIG_PATH = os.path.join(settings.ANALYTICS_PATH, 'figs', 'features')
mkdirp(FIG_PATH)
def main():
... |
sassoftware/rbuild | refs/heads/master | scripts/news.py | 1 | #!/usr/bin/python
#
# 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... |
schets/scikit-learn | refs/heads/master | examples/cluster/plot_color_quantization.py | 297 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... |
arannasousa/pagseguro_xml | refs/heads/master | pagseguro_xml/assinatura/__init__.py | 2 | # coding=utf-8
# ---------------------------------------------------------------
# Desenvolvedor: Arannã Sousa Santos
# Mês: 12
# Ano: 2015
# Projeto: pagseguro_xml
# e-mail: asousas@live.com
# ---------------------------------------------------------------
from .v2 impo... |
cbanta/pjproject | refs/heads/master | pjsip-apps/src/confbot/confbot.py | 33 | # $Id$
#
# SIP Conference Bot
#
# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
#
# 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 optio... |
Andrew-Katcha/storyteller | refs/heads/master | env/lib/python3.4/site-packages/pip/_vendor/progress/counter.py | 510 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... |
acrsilva/animated-zZz-machine | refs/heads/master | lib/tablaDistancias.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
sys.path.insert(0, '../lib')
from pyqtgraph.Qt import QtGui
from PyQt4.QtGui import *
import colores
class TablaDistancias(QTableWidget):
def __init__(self, data, *args):
QTableWidget.__init__(self, *args)
self.data = dat... |
CivilHub/CivilHub | refs/heads/master | staticpages/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
dr-nate/msmbuilder | refs/heads/master | msmbuilder/io/gather_metadata.py | 9 | # Author: Matthew Harrigan <matthew.harrigan@outlook.com>
# Contributors:
# Copyright (c) 2016, Stanford University
# All rights reserved.
import glob
import os
import re
import warnings
import mdtraj as md
import pandas as pd
class ParseWarning(UserWarning):
pass
class _Parser(object):
def parse_fn(self... |
open-mmlab/mmdetection | refs/heads/master | configs/hrnet/faster_rcnn_hrnetv2p_w40_2x_coco.py | 1 | _base_ = './faster_rcnn_hrnetv2p_w40_1x_coco.py'
# learning policy
lr_config = dict(step=[16, 22])
runner = dict(type='EpochBasedRunner', max_epochs=24)
|
eenchev/idea-note-taking-app | refs/heads/master | env/lib/python2.7/site-packages/jinja2/meta.py | 222 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2017 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... |
windedge/odoo | refs/heads/8.0 | addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 374 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
cs-hse-projects/DataSpider_Dubov | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
setup(
name = "TennisSpider",
version = "0.31",
packages = ['TennisSpider'],
author = "Dmitry Dubov",
author_email = "dmitry.s.dubov@gmail.com",
description = "Package for parsing info about tennis results and stats.",
license = "PSF",
keyword... |
hefen1/chromium | refs/heads/master | tools/telemetry/telemetry/core/platform/ios_device.py | 3 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import subprocess
from telemetry.core import platform
from telemetry.core.platform import device
class IOSDevice(device.Device):
def __init__(... |
hchen1202/django-react | refs/heads/master | virtualenv/lib/python3.6/site-packages/django/db/backends/mysql/compiler.py | 691 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_subquery_condition(self, alias, columns, compiler):
qn = compiler.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
sql, params = self.as_sql()
return '(%s) IN (%s)' % (', '.join('%... |
skybet/jenkins-job-wrecker | refs/heads/master | jenkins_job_wrecker/modules/handlers.py | 1 | import jenkins_job_wrecker.modules.base
from jenkins_job_wrecker.registry import Registry
class Handlers(jenkins_job_wrecker.modules.base.Base):
component = 'handlers'
def gen_yml(self, yml_parent, data):
for child in data:
handler_name = child.tag.lower()
settings = []
... |
RoelAdriaans-B-informed/website | refs/heads/10.0 | website_sale_order_company/models/__init__.py | 33 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Django-1.2.3/django/contrib/localflavor/uk/forms.py | 313 | """
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... |
SurajShah525/pythonprogramming | refs/heads/master | problems/recursion/RecursiveFibonnaci.py | 1 | import sys
sys.setrecursionlimit(1500)
def fib(n):
if n < 2:
return n
return fib(n-2) + fib(n-1)
print map(fib, range(0,10))
|
mavit/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_guest.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
# 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... |
uxebu/tddbin-backend | refs/heads/master | src/core/admin.py | 1 | from django.contrib import admin
from models import Session
from models import Spec
class SessionAdmin(admin.ModelAdmin):
list_display = ['name', 'user', 'started_at']
class SpecAdmin(admin.ModelAdmin):
list_display = ['code', 'session', 'author', 'saved_at']
admin.site.register(Session, SessionAdmin)
admin... |
Softmotions/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/rendering/core.py | 208 | """
This module is indended to provide a pluggable way to add assertions about
the rendered content of XBlocks.
For each view on the XBlock, this module defines a @singledispatch function
that can be used to test the contents of the rendered html.
The functions are of the form:
@singledispatch
def assert_stu... |
alexmerser/ops | refs/heads/master | buedafab/deploy/utils.py | 4 | """General deployment utilities (not Fabric commands)."""
from fabric.api import cd, require, local, env
from buedafab import deploy
def make_archive():
"""Create a compressed archive of the project's repository, complete with
submodules.
TODO We used to used git-archive-all to archive the submodules as ... |
guijomatos/SickRage | refs/heads/master | lib/sqlalchemy/testing/util.py | 79 | # testing/util.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
from ..util import jython, pypy, defaultdict, decorator, py2k
import decimal
import gc... |
akozumpl/anaconda | refs/heads/master | pyanaconda/ui/tui/tools/run-text-spoke.py | 9 | #!/usr/bin/python
import sys, os
import os.path
# Check command line arguments
if len(sys.argv)<2:
print "Usage: $0 <spoke module name> [<spoke widget class>]"
sys.exit(1)
# Logging always needs to be set up first thing, or there'll be tracebacks.
from pyanaconda import anaconda_log
anaconda_log.init()
from... |
TomAugspurger/pandas | refs/heads/master | pandas/tests/io/parser/test_common.py | 1 | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
import codecs
import csv
from datetime import datetime
from io import StringIO
import os
import platform
from urllib.error import URLError
import numpy as np
import pytest
from pandas._libs.... |
mjfarmer/scada_py | refs/heads/master | env/lib/python2.7/site-packages/pycparser/plyparser.py | 79 | #-----------------------------------------------------------------
# plyparser.py
#
# PLYParser class and other utilites for simplifying programming
# parsers with PLY
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#-----------------------------------------------------------------
class Coord(object):
... |
nikolay-fedotov/tempest | refs/heads/master | tempest/openstack/common/local.py | 378 | # Copyright 2011 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 req... |
hflynn/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/src/omero/util/concurrency.py | 4 | #!/usr/bin/env python
#
# OMERO Concurrency Utilities
#
# Copyright 2009 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import os
import sys
import time
import atexit
import logging
import threading
import omero.util
import exceptions
import logging.handlers
... |
anupsabraham/store_tv_player | refs/heads/master | django_project/store_cms/settings/__init__.py | 12133432 | |
sfu-fas/coursys | refs/heads/master | outreach/__init__.py | 12133432 | |
muraliselva10/cloudkitty | refs/heads/master | cloudkitty/cli/__init__.py | 12133432 | |
victims/victims-db-builder | refs/heads/master | victims_db_builder/library.py | 1 | import itertools
import string
import urllib.request as urllib2
from decimal import *
from distutils.version import LooseVersion
from version import Version
class BaseLibrary(object):
def __init__(self, versionRanges):
# For soup/direct maven index:
self.versions = []
if not isinstance(ve... |
skilstak/dk-help-your-kids-with-computer-coding | refs/heads/master | bubble-blaster/04.py | 1 | # despite what the book says it's actually bad practice to use either:
#from tkinter import *
#from tkinter import Tk
import tkinter
HEIGHT = 500
WIDTH = 800
window = tkinter.Tk()
window.title('Bubble Blaster')
c = tkinter.Canvas(window, width=WIDTH, height=HEIGHT, bg='darkblue')
c.pack()
ship_id = c.create_polygon... |
prds21/barrial-movie | refs/heads/master | lib/mechanize/_markupbase.py | 134 | # Taken from Python 2.6.4 for use by _sgmllib.py
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the HTMLParser and sgmllib
modules (indirectly, for htmllib as well). It has no documented
public API and should not be used directly.
"""
import re
... |
nsrchemie/code_guild | refs/heads/master | wk2/extras/linked_lists/linked_list/test_linked_list.py | 6 | from nose.tools import assert_equal
class TestLinkedList(object):
def test_insert_to_front(self):
print('Test: insert_to_front on an empty list')
linked_list = LinkedList(None)
linked_list.insert_to_front(10)
assert_equal(linked_list.get_all_data(), [10])
print('Test: ins... |
mhnatiuk/phd_sociology_of_religion | refs/heads/master | scrapper/lib/python2.7/site-packages/twisted/test/test_process.py | 26 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test running processes.
"""
import gzip
import os
import sys
import signal
import StringIO
import errno
import gc
import stat
import operator
try:
import fcntl
except ImportError:
fcntl = process = None
else:
from twisted.internet... |
XiaodunServerGroup/xiaodun-platform | refs/heads/master | common/test/acceptance/pages/studio/overview.py | 6 | """
Course Outline page in Studio.
"""
from bok_choy.page_object import PageObject
from bok_choy.query import SubQuery
from bok_choy.promise import EmptyPromise, fulfill
from .course_page import CoursePage
from .unit import UnitPage
class CourseOutlineContainer(object):
"""
A mixin to a CourseOutline page obj... |
mjirayu/sit_academy | refs/heads/master | common/lib/xmodule/xmodule/static_content.py | 70 | # /usr/bin/env python
"""
This module has utility functions for gathering up the static content
that is defined by XModules and XModuleDescriptors (javascript and css)
"""
import logging
import hashlib
import os
import errno
import sys
from collections import defaultdict
from docopt import docopt
from path import path... |
memtoko/django | refs/heads/master | tests/utils_tests/test_no_submodule.py | 737 | # Used to test for modules which don't have submodules.
|
cuongnv23/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_scaling_policy.py | 19 | #!/usr/bin/python
# 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... |
andyraib/data-storage | refs/heads/master | python_scripts/env/lib/python3.6/site-packages/matplotlib/_version.py | 6 |
# This file was generated by 'versioneer.py' (0.15) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
import json
import sys
version_json = '''
{
"dirty": false,
"error": null,
"full-revisionid... |
tornadozou/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/utils/gc.py | 45 | # 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... |
rkn2/generate3DEC | refs/heads/master | low_poly_wrl.py | 1 | #works, suppresses dialog box
import rhinoscriptsyntax as rs
# iterates through layers
layers = rs.LayerNames()
for layer in layers:
if layer != 'concrete': #can be altered to exclude anything in deformablekeys!
# select layer
rs.Command("-_SelLayer " + layer)
rs.Comman... |
bottompawn/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_email/test__header_value_parser.py | 68 | import string
import unittest
from email import _header_value_parser as parser
from email import errors
from email import policy
from test.test_email import TestEmailBase, parameterize
class TestTokens(TestEmailBase):
# EWWhiteSpaceTerminal
def test_EWWhiteSpaceTerminal(self):
x = parser.EWWhiteSpace... |
robclewley/fovea | refs/heads/master | tests/track_text_test.py | 1 | """
Tests for prototype code to track variable values with callbacks
"""
from __future__ import division
import PyDSTool as dst
from PyDSTool.Toolbox import phaseplane as pp
import numpy as np
from matplotlib import pyplot as plt
import fovea
import fovea.graphics as gx
from fovea.graphics import tracker_manager
trac... |
UCL-InfoSec/loopix | refs/heads/master | loopix/loopix_provider.py | 1 | import os
import random
import itertools
import petlib.pack
from loopix_mixnode import LoopixMixNode
from provider_core import ProviderCore
from core import generate_random_string
from json_reader import JSONReader
class LoopixProvider(LoopixMixNode):
jsonReader = JSONReader(os.path.join(os.path.dirname(__file__),... |
cuboxi/android_external_chromium_org | refs/heads/kitkat | tools/valgrind/unused_suppressions.py | 187 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import urllib2
import suppressions
def main():
supp = suppressions.GetSuppressions()
all_supps = []
for supps ... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/deed/vehicle_deed/speeder_stap_deed.py | 2 | import sys
def setup(core, object):
object.setAttachment('radial_filename', 'deeds/vehicleDeed')
return
def use(core, actor, object):
core.mountService.generateVehicle(actor, object, 'object/mobile/vehicle/shared_stap_speeder.iff', 'object/intangible/vehicle/shared_stap_speeder_pcd.iff')
return |
KMK73/gradesavers | refs/heads/master | node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1558 | # Copyright (c) 2011 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 re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/completion/mockPatchObject2Py2/lib/mock/__init__.py | 72 | from mock.mock import * |
alsoicode/cmsplugin-filer | refs/heads/develop | cmsplugin_filer_video/cms_plugins.py | 6 | from __future__ import unicode_literals
import os
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.utils.translation import ugettext_lazy as _
from cmsplugin_filer_video import settings
from cmsplugin_filer_video.models import FilerVideo
from cmsplugin_filer_video.forms imp... |
sgraham/nope | refs/heads/master | third_party/closure_linter/closure_linter/ecmalintrules.py | 82 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... |
bmannix/selenium | refs/heads/master | py/selenium/webdriver/safari/__init__.py | 2454 | # 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
# "License"); you may not... |
kbauskar/mysql-server | refs/heads/5.7 | storage/ndb/memcache/extra/memcached/testsuite/breakdancer/breakdancer.py | 201 | #!/usr/bin/env python
import itertools
class Condition(object):
"""Something asserted to be true during the test.
A given condition may be used as a precondition or a
postcondition."""
def __call__(self, k, state):
"""Called with a key and a state. True if the condition is met."""
r... |
eob/synckit-research | refs/heads/master | perf/usage_generator_2010_02_01.py | 1 | # Site Model
import networkx as nx
from gen_model import *
from random import *
import datetime
import pickle
import datetime
import os
BLOG_TEST = 1
WIKI_TEST = 0
if BLOG_TEST:
VISIT_RATE = 4
VISIT_UNIT = "days"
NUM_USERS = 20
PERCENT_NEW = 0.3
FROM_DATE = datetime.datetime(2010, 05, 01)
... |
dirkcuys/save4life | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# save4life-api documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 22 09:07:50 2015.
#
# 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 file.... |
huangyh09/brie | refs/heads/master | brie/models/__init__.py | 1 | from .model_TFProb import BRIE2
from .model_wrap import fit_BRIE_matrix, fitBRIE
from .base_model import get_CI95, BRIE_base_lik, LogitNormal |
vegitron/pyodbc | refs/heads/master | tests2/mysqltests.py | 22 | #!/usr/bin/python
# -*- coding: latin-1 -*-
usage = """\
usage: %prog [options] connection_string
Unit tests for MySQL. To use, pass a connection string as the parameter. The tests will create and drop tables t1 and
t2 as necessary. The default installation of mysql allows you to connect locally with no password a... |
kevthehermit/YaraManager | refs/heads/master | rule_manager/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
EpicCM/SPH-D700-Kernel | refs/heads/SPH-D700 | external/webkit/WebKitTools/Scripts/webkitpy/style/checker.py | 3 | # Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# 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... |
jaseg/python-prompt-toolkit | refs/heads/master | prompt_toolkit/application.py | 2 | from __future__ import unicode_literals
from .buffer import Buffer, AcceptAction
from .clipboard import Clipboard, InMemoryClipboard
from .filters import CLIFilter, Never, to_cli_filter
from .key_binding.bindings.basic import load_basic_bindings
from .key_binding.bindings.emacs import load_emacs_bindings
from .key_bin... |
WangDequan/fast-rcnn | refs/heads/master | lib/datasets/pascal_voc.py | 45 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import datasets
import datasets.pascal_voc
import os
import datasets.im... |
jasonwzhy/django | refs/heads/master | tests/generic_relations_regress/models.py | 269 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.deletion import ProtectedError
from django.utils.encoding import python_2_unicode_compatible
__all__ = ('Link', 'Place... |
MikeAmy/django | refs/heads/master | tests/migrations/test_add_many_to_many_field_initial/0002_initial.py | 65 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.AddField(
model_name='task',
name='projects',
... |
eleonrk/SickRage | refs/heads/master | lib/future/backports/misc.py | 36 | """
Miscellaneous function (re)definitions from the Py3.4+ standard library
for Python 2.6/2.7.
- math.ceil (for Python 2.7)
- collections.OrderedDict (for Python 2.6)
- collections.Counter (for Python 2.6)
- collections.ChainMap (for all versions prior to Python 3.3)
- itertools.count ... |
alheinecke/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/learn/python/learn/learn_io/dask_io.py | 138 | # 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... |
rpappalax/jenkins-job-manager | refs/heads/dev | manager/jenkins.py | 1 | import os
import ast
from manager import (
DIR_CACHE
)
from manager.utils import read_file
def job_list():
jobs_list = read_file(DIR_CACHE, 'jobs_list.txt')
return ast.literal_eval(jobs_list)
|
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/django/utils/jslex.py | 251 | """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... |
laiqiqi886/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/idlelib/idle_test/test_pathbrowser.py | 117 | import unittest
import idlelib.PathBrowser as PathBrowser
class PathBrowserTest(unittest.TestCase):
def test_DirBrowserTreeItem(self):
# Issue16226 - make sure that getting a sublist works
d = PathBrowser.DirBrowserTreeItem('')
d.GetSubList()
if __name__ == '__main__':
unittest.main(v... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/271_test_peepholer.py | 6 | import dis
import sys
from cStringIO import StringIO
import unittest
def disassemble(func):
f = StringIO()
tmp = sys.stdout
sys.stdout = f
dis.dis(func)
sys.stdout = tmp
result = f.getvalue()
f.close()
return result
def dis_single(line):
return disassemble(compile(line, '', 'single... |
yunojuno/django-test | refs/heads/master | test_app/signals.py | 2 | # # -*- coding: utf-8 -*-
import logging
from os import path, listdir
from django.conf import settings
from django.dispatch import receiver
from trello_webhooks.signals import callback_received
from test_app.hipchat import send_to_hipchat
logger = logging.getLogger(__name__)
def get_supported_events():
"""Ret... |
jkorell/PTVS | refs/heads/master | Python/Tests/TestData/RemoveImport/ImportDup.py | 25 | import oar, oar |
gangadhar-kadam/powapp | refs/heads/master | setup/doctype/jobs_email_settings/jobs_email_settings.py | 60 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes import _
from webnotes.utils import cint
class DocType:
def __init... |
eduNEXT/edunext-platform | refs/heads/master | openedx/core/djangoapps/ace_common/settings/devstack.py | 9 | """
Settings for edX ACE on devstack.
"""
from openedx.core.djangoapps.ace_common.settings import common
def plugin_settings(settings):
"""
Override common settings and use `file_email` for better debugging.
"""
common.plugin_settings(settings)
settings.ACE_ENABLED_CHANNELS = [
'file_em... |
open-craft/xblock-group-project-v2 | refs/heads/master | group_project_v2/stage_components.py | 1 | import json
import logging
from collections import namedtuple
from datetime import date
from xml.etree import ElementTree
import webob
from django.conf import settings
from django.core.exceptions import ValidationError
from django.utils import html
from lazy.lazy import lazy
from upload_validator import FileTypeValida... |
ianunruh/hvac | refs/heads/master | hvac/constants/identity.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Constants related to the Identity secrets engine."""
ALLOWED_GROUP_TYPES = [
'internal',
'external',
]
|
linuxwhatelse/plugin.audio.linuxwhatelse.gmusic | refs/heads/master | resources/libs/lib/google/protobuf/internal/_parameterized.py | 87 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... |
ruibarreira/linuxtrail | refs/heads/master | usr/lib/python2.7/dist-packages/docutils/transforms/references.py | 113 | # $Id: references.py 7624 2013-03-07 14:10:26Z milde $
# 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.trans... |
blazek/QGIS | refs/heads/master | tests/src/python/test_qgsnullsymbolrenderer.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgsnullsymbolrenderer.py
-----------------------------
Date : April 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot ... |
tarzan0820/odoo | refs/heads/8.0 | addons/mrp_repair/wizard/__init__.py | 445 | # -*- 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... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-google-auth-oauthlib/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyGoogleAuthOauthlib(PythonPackage):
"""This library provides oauthlib integration with google-auth."""
ho... |
tqtran7/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/helpers.py | 43 | # 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 under the Li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.