repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Ashaba/rms | refs/heads/master | rmslocalenv/lib/python2.7/site-packages/django/template/defaulttags.py | 31 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import os
import re
import sys
import warnings
from datetime import datetime
from itertools import cycle as itertools_cycle, groupby
from django.conf import settings
from django.utils import six, timezo... |
hlzz/dotfiles | refs/heads/master | graphics/VTK-7.0.0/Filters/General/Testing/Python/cursor2D.py | 2 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create four cursors configured differently
cursor = vtk.vtkCursor2D()
cursor.SetModelBounds(15, 45, 15, 45, 0, 0)
cursor.SetFocalPoint(30, 30, 0)
cursor.AllOff()
cursor... |
Dino0631/RedRain-Bot | refs/heads/develop | cogs/lib/youtube_dl/extractor/fivemin.py | 79 | from __future__ import unicode_literals
from .common import InfoExtractor
class FiveMinIE(InfoExtractor):
IE_NAME = '5min'
_VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)'
_TESTS = [
{
... |
christi3k/zulip | refs/heads/master | zerver/management/commands/import.py | 6 | from __future__ import absolute_import
from __future__ import print_function
from optparse import make_option
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandParser
from django.db import connection
from django.conf import settings
from zerver.models import ... |
erickt/hue | refs/heads/master | desktop/core/ext-py/simplejson/simplejson/tool.py | 291 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m simplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
import sys
import simplejson
def main():
if len(... |
beastbikes/django-adminlte | refs/heads/master | setup.py | 1 | import os
from setuptools import find_packages, setup
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-adminlte-admin',
version='0.6.1',
packages=find_packages(),
include_package_data=True,
license='MIT Lice... |
BeDjango/intef-openedx | refs/heads/master | common/lib/xmodule/xmodule/modulestore/tests/test_store_utilities.py | 194 | """
Tests for store_utilities.py
"""
import unittest
from mock import Mock
import ddt
from xmodule.modulestore.store_utilities import (
get_draft_subtree_roots, draft_node_constructor
)
@ddt.ddt
class TestUtils(unittest.TestCase):
"""
Tests for store_utilities
ASCII trees for ONLY_ROOTS and SOME_TRE... |
azunite/chrome_build | refs/heads/master | third_party/boto/s3/website.py | 51 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
sociogenetics/xendor | refs/heads/master | xendor/adminx.py | 1 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.conf import settings
import xadmin
from xendor.forms import PageAdminForm
from xendor.tree_admin import XDP17TreeModelAdmin
from xendor.models import Page, Fragment, Setting
class PageAdmin(object):
admin_label = u'Управление контентом'
f... |
endlessm/chromium-browser | refs/heads/master | native_client/build/package_version/package_locations.py | 2 | #!/usr/bin/python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This library keeps track of all the standard locations for package files"""
import os
import posixpath
import sys
SHARED_FOLD... |
20tab/upy | refs/heads/master | upy/bin/upy_project_set/project/project/django_wsgi.py | 1 | import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
|
SBRG/ome | refs/heads/master | cobradb/model_dumping.py | 2 | # -*- coding: utf-8 -*-
from cobradb.models import *
from cobradb.util import increment_id, make_reaction_copy_id, timing
from sqlalchemy import and_
import cobra.core
import logging
from itertools import repeat
from collections import defaultdict
from copy import copy
import six
try:
from ipy_progressbar import... |
munk/pywumpus | refs/heads/master | test_player.py | 2 | from player import Player
def test_create_player():
p = Player()
assert p.ammo == 5
assert p.location == 0
|
jsilter/scipy | refs/heads/master | scipy/io/matlab/benchmarks/bench_structarr.py | 21 | from __future__ import division, print_function, absolute_import
from numpy.testing import *
from io import BytesIO
import numpy as np
import scipy.io as sio
def make_structarr(n_vars, n_fields, n_structs):
var_dict = {}
for vno in range(n_vars):
vname = 'var%00d' % vno
end_dtype = [('f%d' ... |
luchesar/emibg | refs/heads/master | node_modules/pangyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | #!/usr/bin/env python
# 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... |
errx/django | refs/heads/master | tests/inline_formsets/models.py | 19 | # coding: utf-8
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class School(models.Model):
name = models.CharField(max_length=100)
class Parent(models.Model):
name = models.CharField(max_length=100)
class Child(models.Model):
mother = models.ForeignKey(Paren... |
fergalbyrne/nupic | refs/heads/master | tests/integration/nupic/engine/network_twonode_test.py | 35 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
40223245/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/browser/ajax.py | 735 | from _ajax import * |
romanpitak/torrentsearch | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='torrentsearch',
version='0.0.0',
description='Torrent search library.',
long_description=readme(),
url='https://github.com/romanpitak/torrentsearch',
auth... |
enitihas/SAC-Website | refs/heads/master | helpers.py | 1 | from glob import glob
from binascii import hexlify, unhexlify
societies = {
"res": "Research Society",
"spo": "Sports Society",
"lit": "Literary Society",
"tec": "Technical Society",
"cul": "Cultural Society",
"aca": "Academic Society",
"gen": "SAC",
"nss": "NSS IIT-Mandi",
}
mont... |
khushboo9293/mailman3 | refs/heads/develop | src/mailman/model/listmanager.py | 4 | # Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
joney000/Online-Code-Checker-and-Compiler-in-Java-CodeOj-codeoj.com- | refs/heads/master | build/web/env/Main1156/Main1156.py | 192 | while True:
n=input()
if(n == 42):
break
else:
print n
|
Taapat/enigma2-openpli-fulan | refs/heads/master | lib/python/Components/Ipkg.py | 1 | import os
from enigma import eConsoleAppContainer
from Components.Harddisk import harddiskmanager
opkgDestinations = []
opkgStatusPath = ''
def opkgExtraDestinations():
global opkgDestinations
return ''.join([" --dest %s:%s" % (i,i) for i in opkgDestinations])
def opkgAddDestination(mountpoint):
pass
#global opk... |
JerzySpendel/python-social-auth | refs/heads/master | social/backends/wunderlist.py | 72 | from social.backends.oauth import BaseOAuth2
class WunderlistOAuth2(BaseOAuth2):
"""Wunderlist OAuth2 authentication backend"""
name = 'wunderlist'
AUTHORIZATION_URL = 'https://www.wunderlist.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.wunderlist.com/oauth/access_token'
ACCESS_TOKEN_METHO... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/modules/network/check_point/cp_mgmt_service_sctp.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... |
blondegeek/pymatgen | refs/heads/master | pymatgen/symmetry/tests/__init__.py | 161 | # coding=utf-8 |
atandon/Ghost | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/jvm.py | 193 | # -*- coding: utf-8 -*-
"""
pygments.lexers.jvm
~~~~~~~~~~~~~~~~~~~
Pygments lexers for JVM languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, ... |
aehlke/manabi | refs/heads/master | manabi/apps/flashcards/migrations/0046_drop_deck_priorities.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11a1 on 2017-02-10 02:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('flashcards', '0045_manabi_4k_deck_creation_migration'),
]
operations = [
migrations.RemoveField(
model_name='d... |
blueboxgroup/horizon | refs/heads/master | openstack_dashboard/dashboards/identity/projects/panel.py | 44 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
OCA/social | refs/heads/12.0 | mass_mailing_partner/models/__init__.py | 1 | # Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Javier Iniesta <javieria@antiun.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import mail_mass_mailing_contact
from . import res_partner
fro... |
sysbot/trigger | refs/heads/master | tests/acceptance/trigger_acceptance_tests.py | 13 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tests/trigger_acceptance_test.py - Acceptance test suite that verifies trigger functionality
in very brief
"""
from trigger.netdevices import NetDevices
netdevices = NetDevices(with_acls=False)
nd=NetDevices(with_acls=False)
print nd.values()
__author__ = 'Murat Ezbid... |
mdietrichc2c/OCB | refs/heads/8.0 | addons/crm_mass_mailing/__init__.py | 333 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
mattuuh7/incubator-airflow | refs/heads/master | tests/contrib/sensors/test_emr_job_flow_sensor.py | 56 | # -*- coding: utf-8 -*-
#
# 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
... |
mseaborn/rowhammer-test | refs/heads/master | dram_physaddr_mapping/analyse_addrs.py | 6 | # Copyright 2015, 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 or agreed to in writing... |
dudepare/django | refs/heads/master | tests/contenttypes_tests/models.py | 172 | from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.http import urlquote... |
Gaia3D/QGIS | refs/heads/master | python/ext-libs/pygments/style.py | 270 | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
class StyleMeta(type):
def __new__(mcs, name, bases,... |
orekyuu/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/Parameter.before.py | 83 | def foo(a):
<selection>print(a)</selection>
|
paksu/pytelegraf | refs/heads/master | telegraf/protocol.py | 1 | from telegraf.utils import format_string, format_value
class Line(object):
def __init__(self, measurement, values, tags=None, timestamp=None):
assert measurement, "Must have measurement"
assert values not in (None, {}), "Must have values"
# Name of the actual measurement
self.meas... |
dNG-git/pas_upnp | refs/heads/master | src/dNG/net/upnp/ssdp_listener_ipv4_multicast.py | 1 | # -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... |
CentechMTL/TableauDeBord | refs/heads/master | app/valuePropositionCanvas/models.py | 2 | # coding: utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse_lazy
from app.company.models import Company
from django.utils import timezone
# TODO Delete foreign key
VALUE_PROPOSITION_CANVAS_TYPE_CHOICES = (
('Gain', 'Gain'),
... |
cristian-frincu/twitter-bot | refs/heads/master | twitter_follow_bot.py | 1 | # -*- coding: utf-8 -*-
from twitter import Twitter, OAuth, TwitterHTTPError
import os
import random
import time
from creditentials import (
OAUTH_TOKEN,
OAUTH_SECRET,
CONSUMER_KEY,
CONSUMER_SECRET,
TWITTER_HANDLE,
)
# list in the full path and file name of the file you want to store your "already followed"
AL... |
gurneyalex/purchase-workflow | refs/heads/8.0 | purchase_discount/__init__.py | 29 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
bvamanan/ns3 | refs/heads/master | src/topology-read/bindings/modulegen__gcc_LP64.py | 22 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
nathangeffen/tbonline-old | refs/heads/master | tbonlineproject/tweets/templatetags/recover_tweets.py | 2 | from django import template
from django.template import Context
from django.template.loaders.app_directories import load_template_source
import tweepy
import settings
from tweets.models import TwitterUsername
register = template.Library()
def do_recover_tweets(parser, token):
try:
tag_name = token.split... |
MonamAgarwal/final | refs/heads/master | GTG/gtk/backends_dialog/addpanel.py | 3 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... |
nwchandler/ansible | refs/heads/devel | lib/ansible/modules/network/aos/aos_logical_device_map.py | 78 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... |
ivanbusthomi/inasafe | refs/heads/develop | safe/definitions/styles.py | 2 | # coding=utf-8
"""Styles and colors which are used in InaSAFE."""
from PyQt4.QtGui import QColor
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = '$Format:%H$'
transparent = QColor(0, 0, 0, 0)
# Hazard classes as specified in reporting... |
awduda/awduda.github.io | refs/heads/master | venv/lib/python2.7/site-packages/wheel/test/test_tool.py | 327 | from .. import tool
def test_keygen():
def get_keyring():
WheelKeys, keyring = tool.get_keyring()
class WheelKeysTest(WheelKeys):
def save(self):
pass
class keyringTest:
@classmethod
def get_keyring(cls):
class keyringTes... |
shipci/sympy | refs/heads/master | sympy/utilities/tests/test_enumerative.py | 20 | from sympy.core.compatibility import xrange, zip_longest
from sympy.utilities.enumerative import (
factoring_visitor,
list_visitor,
MultisetPartitionTraverser,
multiset_partitions_taocp,
PartComponent,
part_key
)
from sympy.utilities.iterables import multiset_partitions, _set_partitions
fro... |
lamblin/pylearn2 | refs/heads/master | pylearn2/models/tests/test_maxout.py | 44 | """
Tests of the maxout functionality.
So far these don't test correctness, just that you can
run the objects.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import numpy as np
import ... |
tomtor/QGIS | refs/heads/master | python/plugins/MetaSearch/dialogs/xmldialog.py | 30 | # -*- coding: utf-8 -*-
###############################################################################
#
# CSW Client
# ---------------------------------------------------------
# QGIS Catalog Service client.
#
# Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com)
#
# This source is free software; you can redistri... |
cloudera/hue | refs/heads/master | desktop/libs/liboauth/src/liboauth/views.py | 2 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/contrib/losses/python/losses/__init__.py | 94 | # Copyright 2015 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... |
Administrate/surveymonkey | refs/heads/master | surveymonkey/tests/mocks/utils.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import math
from datetime import datetime
from random import randint
from furl import furl
from delorean import Delorean
def create_quota_headers(qpd=None, qps=None, reset=datetime.now()):
qpd_allotted, qpd_current = qpd if qpd else (10000... |
BhallaLab/moose | refs/heads/master | moose-examples/traub_2005/py/testutils.py | 2 | # test_utils.py ---
#
# Filename: test_utils.py
# Description:
# Author:
# Maintainer:
# Created: Sat May 26 10:41:37 2012 (+0530)
# Version:
# Last-Updated: Sat Aug 6 15:45:51 2016 (-0400)
# By: subha
# Update #: 414
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
#
# Chang... |
Grirrane/odoo | refs/heads/master | addons/report_webkit/__init__.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... |
rhelmer/socorro | refs/heads/master | socorro/external/postgresql/crash_data.py | 15 | # 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 socorro.external.crash_data_base import CrashDataBase
class CrashData(CrashDataBase):
"""
Implement the /... |
fotinakis/sentry | refs/heads/master | src/sentry/nodestore/multi/backend.py | 23 | """
sentry.nodestore.multi.backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import random
import six
from sentry.nodestore.base import NodeStorage
from sentry.ut... |
priyatransbit/linux | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
OptiPop/external_chromium_org | refs/heads/opti-5.1 | tools/perf/page_sets/__init__.py | 63 | # 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 inspect
import os
import sys
from telemetry.core import discover
from telemetry.page import page_set
# Import all submodules' PageSet classes.
star... |
bgroff/kala-app | refs/heads/master | django_kala/organizations/tasks/delete_organization.py | 1 | from celery.task import Task
from django.conf import settings
from django.contrib.auth import get_user_model
from organizations.models import Organization
User = get_user_model()
class DeleteOrganizationTask(Task):
def run(self, *args, **kwargs):
self.organization = Organization.objects.get(pk=args[0])... |
psawaya/Mental-Ginger | refs/heads/master | django/contrib/localflavor/au/au_states.py | 544 | """
An alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('ACT', 'Australian Capital Territory'),
('NSW', 'New South Wales'),
('NT', 'Northern Territory'),
('QLD', 'Q... |
KureFM/Xenon | refs/heads/master | src/packages/bs4/builder/_htmlparser.py | 412 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to s... |
Si-elegans/Web-based_GUI_Tools | refs/heads/master | wiki/core/permissions.py | 5 | from wiki.conf import settings
###############################
# ARTICLE PERMISSION HANDLING #
###############################
#
# All functions are:
# can_something(article, user)
# => True/False
#
# All functions can be replaced by pointing their relevant
# settings variable in wiki.conf.settings to a callabl... |
Bleno/teste_api | refs/heads/master | meu_ambiente/lib/python2.7/ntpath.py | 4 | /usr/lib/python2.7/ntpath.py |
delving/nave | refs/heads/develop | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup for the nave-public Django Application."""
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need f... |
emedinaa/contentbox | refs/heads/master | third_party/django/contrib/messages/tests/base.py | 104 | from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import M... |
andras-tim/sqlalchemy-migrate | refs/heads/master | migrate/tests/changeset/test_constraint.py | 46 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sqlalchemy import *
from sqlalchemy.util import *
from sqlalchemy.exc import *
from migrate.changeset.util import fk_column_names
from migrate.exceptions import *
from migrate.changeset import *
from migrate.tests import fixture
class CommonTestConstraint(fixture.... |
UManPychron/pychron | refs/heads/develop | pychron/mdd/tasks/mdd_figure_editor.py | 2 | # ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... |
xsteadfastx/pelican-plugins | refs/heads/master | md_inline_extension/inline.py | 17 | # -*- coding: utf-8 -*-
"""
Markdown Inline Extension For Pelican
=====================================
Extends Pelican's Markdown module
and allows for customized inline HTML
"""
import os
import sys
from pelican import signals
try:
from . pelican_inline_markdown_extension import PelicanInlineMarkdownExtension
... |
mesonbuild/meson | refs/heads/master | mesonbuild/munstable_coredata.py | 2 | # Copyright 2019 The Meson development team
# 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 ... |
falkolab/titanium_mobile | refs/heads/master | node_modules/node-ios-device/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
turbokongen/home-assistant | refs/heads/dev | tests/components/pushbullet/__init__.py | 36 | """Tests for the pushbullet component."""
|
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_sort.py | 9 | from test import support
import random
import sys
import unittest
verbose = support.verbose
nerrors = 0
def CmpToKey(mycmp):
'Convert a cmp= function into a key= function'
class K(object):
def __init__(self, obj):
self.obj = obj
def __lt__(self, other):
return mycmp(sel... |
unistra/django-rest-framework-fine-permissions | refs/heads/master | tests/urls.py | 1 | from django.conf.urls import include, url
from django.contrib import admin
from rest_framework_fine_permissions.urls import urlpatterns as drffp_urls
urlpatterns = drffp_urls
urlpatterns += [
url(r'^admin/', admin.site.urls),
]
|
google/llvm-propeller | refs/heads/bb-clusters | lldb/test/API/python_api/default-constructor/sb_communication.py | 13 | """
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import lldb
def fuzz_obj(obj):
broadcaster = obj.GetBroadcaster()
# Do fuzz testing on the broadcaster obj, it should not crash lldb.
import sb_broadcaster
sb_broadcaster.fuzz_obj(broadcaster)
obj.Ado... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-1.4/django/db/backends/oracle/creation.py | 29 | import sys
import time
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated Oracle column
# types, as strings. Column-type strings can cont... |
nicholasserra/sentry | refs/heads/master | src/sentry/models/groupsnooze.py | 4 | from __future__ import absolute_import
from django.db import models
from sentry.db.models import Model, FlexibleForeignKey, sane_repr
class GroupSnooze(Model):
__core__ = False
group = FlexibleForeignKey('sentry.Group', unique=True)
until = models.DateTimeField()
class Meta:
db_table = 'sen... |
CiscoSystems/horizon | refs/heads/master | horizon/test/test_dashboards/cats/kittens/panel.py | 102 | # 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 t... |
catapult-project/catapult-csm | refs/heads/master | tracing/tracing/value/convert_chart_json.py | 7 | # Copyright 2016 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 tracing_project
import vinn
def ConvertChartJson(chart_json):
"""Convert chart_json to Histograms.
Args:
chart_json: path to a fi... |
codingforentrepreneurs/marketplace | refs/heads/master | src/cart/views.py | 1 |
from django.contrib import messages
from django.shortcuts import render_to_response, Http404, RequestContext, HttpResponseRedirect
from django.core.urlresolvers import reverse
from products.models import Product
from products.views import check_product #takes user and product as args
from .models import Cart, CartI... |
danmergens/mi-instrument | refs/heads/master | mi/core/instrument/dataset_data_particle.py | 4 | #!/usr/bin/env python
"""
@package mi.core.instrument.data_particle_generator Base data particle generator
@file mi/core/instrument/data_particle_generator.py
@author Steve Foley
@brief Contains logic to generate data particles to be exchanged between
the driver and agent. This involves a JSON interchange format
"""
... |
macks22/dblp | refs/heads/master | api/db.py | 2 | import os
import sys
import logging
import argparse
import sqlalchemy as sa
from sqlalchemy import (
Table, Column,
Integer, String, TEXT,
ForeignKey, PrimaryKeyConstraint,
MetaData
)
import config
# engine = sa.create_engine('sqlite:///dblp.sql', echo=False)
connection_string = 'postgresql://%s:%s@... |
mrbox/django | refs/heads/master | tests/reverse_lookup/tests.py | 326 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Poll, User
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")... |
zhukaixy/kbengine | refs/heads/master | kbe/src/lib/python/Lib/tkinter/scrolledtext.py | 164 | """A ScrolledText widget feels like a text widget but also has a
vertical scroll bar on its right. (Later, options may be added to
add a horizontal bar as well, to make the bars disappear
automatically when not needed, to move them to the other side of the
window, etc.)
Configuration options are passed to the Text wi... |
suyashphadtare/sajil-final-frappe | refs/heads/develop | frappe/core/doctype/page/__init__.py | 2292 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
egelmex/ajenti | refs/heads/master | ajenti/plugins/plugins/main.py | 5 | from ajenti.api import *
from ajenti.ui import *
from ajenti.plugmgr import PluginLoader, RepositoryManager
class PluginManager(CategoryPlugin, URLHandler):
text = 'Plugins'
icon = '/dl/plugins/icon.png'
folder = 'bottom'
def on_session_start(self):
self._mgr = RepositoryManager(self.app.conf... |
TheWardoctor/Wardoctors-repo | refs/heads/master | script.module.schism.common/lib/requests/packages/chardet/charsetprober.py | 3126 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
merutak/python-social-auth | refs/heads/master | social/backends/xing.py | 83 | """
XING OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/xing.html
"""
from social.backends.oauth import BaseOAuth1
class XingOAuth(BaseOAuth1):
"""Xing OAuth authentication backend"""
name = 'xing'
AUTHORIZATION_URL = 'https://api.xing.com/v1/authorize'
REQUEST_TOKEN_URL = 'ht... |
sdague/home-assistant | refs/heads/dev | tests/components/humidifier/test_intent.py | 12 | """Tests for the humidifier intents."""
from homeassistant.components.humidifier import (
ATTR_AVAILABLE_MODES,
ATTR_HUMIDITY,
ATTR_MODE,
DOMAIN,
SERVICE_SET_HUMIDITY,
SERVICE_SET_MODE,
intent,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
SERVICE_T... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/django_extensions/management/commands/runscript.py | 6 | from django.core.management.base import BaseCommand
from django.conf import settings
from optparse import make_option
import imp
def vararg_callback(option, opt_str, opt_value, parser):
parser.rargs.insert(0, opt_value)
value = []
for arg in parser.rargs:
# stop on --foo like options
if ar... |
miyosuda/intro-to-dl-android | refs/heads/master | HandWriting/jni-build/jni/include/tensorflow/python/kernel_tests/xent_op_test.py | 3 | # Copyright 2015 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 a... |
yjhjstz/gyp | refs/heads/master | pylib/gyp/msvs_emulation.py | 1407 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... |
ArVID220u/judge | refs/heads/master | test_generator_model.py | 2 | #!/usr/bin/env python3
import random, os, sys
from subprocess import check_output
# first argument is the correct program
correct_program = "solution"
in_file = "test_gen.in"
for index in range(1,20):
in_str = ""
n = random.randint(2,10)
in_str += str(n) + "\n"
for j in range(n):
l = random.r... |
necozay/tulip-control | refs/heads/master | tulip/graphics.py | 1 | # Copyright (c) 2013-2014 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice,... |
glneo/gnuradio-davisaf | refs/heads/master | grc/examples/xmlrpc/xmlrpc_client_script.py | 22 | #!/usr/bin/env python
import time
import random
import xmlrpclib
#create server object
s = xmlrpclib.Server("http://localhost:1234")
#randomly change parameters of the sinusoid
for i in range(10):
#generate random values
new_freq = random.uniform(0, 5000)
new_ampl = random.uniform(0, 2)
new_offset = random.unifo... |
ageron/tensorflow | refs/heads/master | tensorflow/python/autograph/pyct/static_analysis/reaching_definitions.py | 4 | # Copyright 2018 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... |
tanmaythakur/django | refs/heads/master | django/utils/_os.py | 502 | from __future__ import unicode_literals
import os
import sys
import tempfile
from os.path import abspath, dirname, isabs, join, normcase, normpath, sep
from django.core.exceptions import SuspiciousFileOperation
from django.utils import six
from django.utils.encoding import force_text
if six.PY2:
fs_encoding = sy... |
zhaodelong/django | refs/heads/master | tests/model_meta/models.py | 192 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Relation(models.Model):
pass
class AbstractPerson(models.Model):
# DATA fields
data_abstract = models.CharField(max_len... |
Lujeni/ansible | refs/heads/devel | lib/ansible/module_utils/network/fortios/argspec/facts/facts.py | 20 | from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.