repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hkchenhongyi/django | refs/heads/master | django/core/serializers/__init__.py | 347 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... |
CyanogenMod/android_kernel_acer_t20-common | refs/heads/2.6.39 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
phelmig/Sql2Neo | refs/heads/master | doc/build/html/_static/sql2neo.py | 2 | #!/opt/local/bin/python
import MySQLdb
from py2neo import cypher
from py2neo import neo4j
import datetime
import calendar
class sql2NeoRelationship(object):
"""sql2NeoRelationship a SQL relationship that will be migrated to Neo4j. The name defines the relationship name in Neo4j and does not have to be unique. Upper c... |
absoludity/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/utils/mathfont.py | 101 | from __future__ import print_function
import fontforge
from misc import MathMLAssociationCopyright
em = 1000
def create(aName):
print("Generating %s.woff..." % aName, end="")
mathFont = fontforge.font()
mathFont.fontname = aName
mathFont.familyname = aName
mathFont.fullname = aName
mathFont.co... |
ferabra/edx-platform | refs/heads/master | lms/djangoapps/commerce/api/v0/urls.py | 56 | """ API v0 URLs. """
from django.conf.urls import patterns, url, include
from commerce.api.v0 import views
BASKET_URLS = patterns(
'',
url(r'^$', views.BasketsView.as_view(), name='create'),
url(r'^{}/order/$'.format(r'(?P<basket_id>[\w]+)'), views.BasketOrderView.as_view(), name='retrieve_order'),
)
ur... |
M157q/shadowsocks | refs/heads/master | shadowsocks/common.py | 945 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
1ta/study_python | refs/heads/master | files/sun/practice/smallest_sublist.py | 1 | class Solution:
"""
@param nums: a list of integers
@return: A integer denote the sum of minimum subarray
"""
def minSubArray(self, nums):
def FindCross(nums,left,right):
mid = int((left+right+1)/2)
l_sum,sum_l = +float("inf"),0
for i in nums[left:mid][::-... |
mua/Radial-Engine | refs/heads/master | src/external/bullet/Extras/Serialize/HeaderGenerator/bulletGenerate.py | 48 | import dump
header = """/* Copyright (C) 2011 Erwin Coumans & Charlie C
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for a... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/debug/cli/profile_analyzer_cli.py | 12 | # 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... |
alexandrucoman/vbox-nova-driver | refs/heads/master | nova/virt/virtualbox/pathutils.py | 2 | # Copyright (c) 2015 Cloudbase Solutions Srl
# 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... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/examples/itemviews/editabletreemodel/ui_mainwindow.py | 2 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\Lib\site-packages\PyQt4\examples\itemviews\editabletreemodel\mainwindow.ui'
#
# Created: Wed Jan 18 20:24:02 2017
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore,... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/contrib/opt/python/training/moving_average_optimizer_test.py | 13 | # 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... |
cosmoharrigan/pylearn2 | refs/heads/master | pylearn2/expr/tests/test_coding.py | 49 | from pylearn2.expr.coding import triangle_code
import numpy as np
import theano.tensor as T
from theano import function
from pylearn2.utils import as_floatX
def test_triangle_code():
rng = np.random.RandomState([20,18,9])
m = 5
n = 6
k = 7
X = as_floatX(rng.randn(m,n))
D = as_floatX(rng.randn... |
pwmarcz/django | refs/heads/master | tests/urlpatterns_reverse/views_broken.py | 501 | # I just raise an AttributeError to confuse the view loading mechanism
raise AttributeError('I am here to confuse django.core.urlresolvers.get_callable')
|
balloob/home-assistant | refs/heads/dev | tests/components/rfxtrx/test_switch.py | 12 | """The tests for the RFXtrx switch platform."""
from unittest.mock import call
import pytest
from homeassistant.components.rfxtrx import DOMAIN
from homeassistant.core import State
from tests.common import MockConfigEntry, mock_restore_cache
from tests.components.rfxtrx.conftest import create_rfx_test_cfg
EVENT_RFY... |
jgoclawski/django | refs/heads/master | tests/field_defaults/tests.py | 405 | from datetime import datetime
from django.test import TestCase
from django.utils import six
from .models import Article
class DefaultTests(TestCase):
def test_field_defaults(self):
a = Article()
now = datetime.now()
a.save()
self.assertIsInstance(a.id, six.integer_types)
... |
ryfx/modrana | refs/heads/master | core/bundle/geopy/units.py | 84 | import math
from geopy import util
# Angles
def degrees(radians=0, arcminutes=0, arcseconds=0):
deg = 0.
if radians:
deg = math.degrees(radians)
if arcminutes:
deg += arcminutes / arcmin(degrees=1.)
if arcseconds:
deg += arcseconds / arcsec(degrees=1.)
return deg
def radia... |
pschmitt/home-assistant | refs/heads/dev | tests/components/bom/test_sensor.py | 7 | """The tests for the BOM Weather sensor platform."""
import json
import re
import unittest
from urllib.parse import urlparse
import requests
from homeassistant.components import sensor
from homeassistant.components.bom.sensor import BOMCurrentData
from homeassistant.setup import setup_component
from tests.async_mock... |
UdjinM6/dash_hash | refs/heads/master | test.py | 2 | import dash_hash
from binascii import unhexlify, hexlify
import unittest
# dash block #1
# moo@b1:~/.dash$ dashd getblockhash 1
# 000007d91d1254d60e2dd1ae580383070a4ddffa4c64c2eeb4a2f9ecc0414343
# moo@b1:~/.dash$ dashd getblock 000007d91d1254d60e2dd1ae580383070a4ddffa4c64c2eeb4a2f9ecc0414343
# {
# "hash" : "00000... |
maxsz/plugin.video.putio | refs/heads/master | resources/__init__.py | 2547 | # Dummy file to make this directory a package.
|
kamotos/django-storages | refs/heads/master | storages/backends/database.py | 10 | # DatabaseStorage for django.
# 2009 (c) GameKeeper Gambling Ltd, Ivanov E.
from django.conf import settings
from django.core.files import File
from django.core.exceptions import ImproperlyConfigured
from storages.compat import urlparse, BytesIO, Storage
try:
import pyodbc
except ImportError:
raise Improperl... |
vauxoo-dev/account-financial-tools | refs/heads/8.0 | __unported__/account_tax_analysis/__openerp__.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... |
jtraver/dev | refs/heads/master | python3/json/json1.py | 1 | #!/usr/bin/env python3
import os
import sys
import json
print(("env = %s" % str(os.environ)))
print((os.environ['HOME']))
print((os.environ.get('HOME')))
print((os.environ.get('JOB_NAME', 'job_name')))
print((sys.prefix))
print((json.dumps(str(os.environ))))
filename = "env.json"
fileh = open(filename, "w")
# file... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/Jinja2/examples/basic/cycle.py | 83 | from jinja2 import Environment
env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")
print env.from_string("""\
<ul>
# for item in range(10)
<li class="${loop.cycle('odd', 'even')}">${item}</li>
# endfor
</ul>\
""").render()
|
jwren/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/largefiles/proto.py | 92 | # Copyright 2011 Fog Creek Software
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import urllib2
from mercurial import error, httppeer, util, wireproto
from mercurial.wireproto import batchable, future
from mercurial.... |
bilgi-cmpe/bilgignu-arcade | refs/heads/master | autostart.py | 1 | """Script for launching a game on RetroPie after startup.
This script launches the latest emulated device and first game on the list. It
is useful for arcade machines with one game. In event of reboot script launches
the game without human interaction.
This script is developed by students of Istanbul Bilgi University... |
MoritzS/django | refs/heads/master | tests/i18n/project_dir/app_no_locale/models.py | 129 | from django.utils.translation import gettext as _
string = _("This app has no locale directory")
|
zuun77/givemegoogletshirts | refs/heads/master | codejam/2020/1B/q3-sol.py | 1 | # Copyright (c) 2020 kamyu. All rights reserved.
#
# Google Code Jam 2020 Round 1B - Problem C. Join the Ranks
# https://codingcompetitions.withgoogle.com/codejam/round/000000000019fef2/00000000002d5b64
#
# Time: O(R * S), one-liner, optimized from join_the_ranks4.py
# Space: O(1)
#
from itertools import imap
def jo... |
SamuelDSR/YouCompleteMe-Win7-GVIM | refs/heads/master | third_party/jedi/jedi/docstrings.py | 4 | """
Docstrings are another source of information for functions and classes.
:mod:`dynamic` tries to find all executions of functions, while the docstring
parsing is much easier. There are two different types of docstrings that |jedi|
understands:
- `Sphinx <http://sphinx-doc.org/markup/desc.html#info-field-lists>`_
- ... |
airbnb/knowledge-repo | refs/heads/master | update_screenshots.py | 1 | import sys
sys.path.insert(0, '..')
import threading
import time
from selenium.webdriver import Chrome
import knowledge_repo
def take_screenshots():
driver = Chrome()
driver.get('http://127.0.0.1:7000')
driver.set_window_size(1260, 800)
driver.save_screenshot('main.png')
driver.find_element_by_cs... |
lz1988/django-web2015 | refs/heads/master | build/lib/django/forms/extras/__init__.py | 324 | from __future__ import absolute_import
from django.forms.extras.widgets import *
|
muntasirsyed/intellij-community | refs/heads/master | python/testData/override/classmethodNewStyle_after.py | 83 | class A(object):
@classmethod
def m(cls):
pass
class B(A):
@classmethod
def m(cls):
<selection>super(B, cls).m()</selection>
|
tszym/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_clb_nodes.py | 8 | #!/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.0',
'status': ['preview'],
... |
WCP52/docs | refs/heads/master | testing/demo/testgui.py | 1 | import sys
from qt5-base-5.4.03 import *
app = QApplication(sys.argv)
button = QPushButton("Hello world0",None)
button.show()
app.exec_() |
ltiao/scikit-learn | refs/heads/master | benchmarks/bench_glmnet.py | 297 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... |
crookedreyes/py4e-specialization | refs/heads/master | code3/hidden.py | 1 | # Keep this file separate
# https://apps.twitter.com/
# Create new App and get the four strings
def oauth():
return {"consumer_key": "rTjxwzvUPe1QfMCfxfrMZy1HW ",
"consumer_secret": "e6KEWCQmS45zIFbmlrPbT8aiTsT94wLhkVXB6v0b6kftaYZqbC",
"token_key": "292680650-aLwhQmyw3kpJ1tMsip... |
andrius-preimantas/odoo | refs/heads/master | openerp/report/pyPdf/generic.py | 136 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 copyrig... |
cavedweller/rust-sel4 | refs/heads/master | tools/umm.py | 17 | #!/usr/bin/env python
#
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
import sys
import os.path
import optparse
import re
## We assume lengt... |
openiitbombayx/edx-platform | refs/heads/master | cms/envs/aws.py | 2 | """
This is the default template for our main set of AWS servers.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
# Pylint gets confused by path.py instances, which report themselves... |
amrdraz/brython | refs/heads/master | www/src/Lib/traceback.py | 15 | import sys
def print_exc(file=sys.stderr):
exc = __BRYTHON__.current_exception
file.write(exc.info)
if isinstance(exc, SyntaxError):
offset = exc.args[1][2]
file.write('\n '+offset*' '+'^')
file.write('\n'+exc.__name__)
if exc.args:
file.write(': %s' %exc.args[0])
file.w... |
shenlong3030/asv-django-guestbook | refs/heads/master | django/contrib/sessions/middleware.py | 10 | import time
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils.http import cookie_date
from django.utils.importlib import import_module
class SessionMiddleware(object):
def process_request(self, request):
engine = import_module(settings.SESSION_EN... |
40223225/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/parsers/expat.py | 876 | """Interface to the Expat non-validating XML parser."""
import sys
from pyexpat import *
# provide pyexpat submodules as xml.parsers.expat submodules
sys.modules['xml.parsers.expat.model'] = model
sys.modules['xml.parsers.expat.errors'] = errors
|
MaplePlan/djwp | refs/heads/master | django/db/backends/postgresql_psycopg2/base.py | 17 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import logging
import sys
from django.db.backends import *
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from django.db.backends.postgresql_psycopg2.client import DatabaseClient
fr... |
jrbl/invenio | refs/heads/master | modules/webstyle/lib/webinterface_handler_config.py | 11 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio 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... |
Treeki/NewerSMBW | refs/heads/master | Koopatlas/src/wii/filesystem.py | 1 | import weakref
class WiiFSObject(object):
def __init__(self):
self._parent_ref = None
self._name = ''
self._low_name = ''
@property
def parent(self):
ref = self._parent_ref
return (ref() if ref else None)
@parent.setter
def parent(self, value):
self._parent_ref = weakref.ref(value)
@parent.delet... |
Zhongqilong/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_tools/test_pdeps.py | 76 | """Tests for the pdeps script in the Tools directory."""
import os
import sys
import unittest
import tempfile
from test import support
from test.test_tools import scriptsdir, skip_if_missing, import_tool
skip_if_missing()
class PdepsTests(unittest.TestCase):
@classmethod
def setUpClass(self):
self... |
ashemedai/ansible | refs/heads/devel | lib/ansible/playbook/play_context.py | 9 | # -*- coding: utf-8 -*-
# (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,... |
jamielennox/python-kiteclient | refs/heads/master | kiteclient/v1/group.py | 1 | # 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... |
Balannen/LSMASOMM | refs/heads/master | atom3/Kernel/classDiagram/CD_test1.py | 1 | from graph_ASG_ERmetaMetaModel import *
from stickylink import *
from widthXfillXdecoration import *
from ASG_ClassDiagramB import *
from ASG_ClassDiagramB import *
from AtomClass import *
from AtomInheritance import *
from AtomAssociation import *
from ATOM3MSEnum import *
from ATOM3Port import *
from ATOM3I... |
mikedingjan/wagtail | refs/heads/master | wagtail/images/widgets.py | 5 | import json
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from wagtail.admin.widgets import AdminChooser
from wagtail.images import get_image_model
class AdminImageChooser(AdminChooser):
choose_one_text = _('Choose an image')
choose_another_text ... |
chinmaygarde/depot_tools | refs/heads/master | third_party/simplejson/tool.py | 688 | 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 as json
def main():
... |
arjunbm13/youtube-dl | refs/heads/master | youtube_dl/extractor/videofyme.py | 126 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
int_or_none,
)
class VideofyMeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
IE_NAME = 'videofy.me'
_TEST = {
'url': ... |
anurag03/integration_tests | refs/heads/master | cfme/tests/networks/test_sdn_topology.py | 1 | import pytest
import random
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.gce import GCEProvider
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.utils.wait import wait_for
from cfme.utils.log import logger
pytestmark ... |
haoyuchen1992/osf.io | refs/heads/develop | website/addons/forward/views/__init__.py | 69 | from . import config, widget # noqa
|
xuweiliang/Codelibrary | refs/heads/master | openstack_dashboard/enabled/_2020_admin_device_panel_group.py | 1 | from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'device'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Device Manage')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP... |
jokerlin/WSE | refs/heads/master | diff_match_patch.py | 1 | """Diff Match and Patch
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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
U... |
mandx/pyrax | refs/heads/master | samples/cloudfiles/fetch_objects.py | 13 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... |
pilnujemy/pytamy | refs/heads/master | foundation/offices/emails/models.py | 2 | from __future__ import unicode_literals
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel
@py... |
saintbird/django-userena | refs/heads/master | demo/demo/settings.py | 15 | # Django settings for Userena demo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
import os
settings_dir = os.path.dirname(__file__)
PROJECT_ROOT = os.path.abspath(os.path.dirname(settings_dir))
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGIN... |
cbertinato/pandas | refs/heads/master | pandas/tests/arrays/test_numpy.py | 1 | """
Additional tests for PandasArray that aren't covered by
the interface tests.
"""
import numpy as np
import pytest
import pandas as pd
from pandas.arrays import PandasArray
from pandas.core.arrays.numpy_ import PandasDtype
import pandas.util.testing as tm
@pytest.fixture(params=[
np.array(['a', 'b'], dtype=ob... |
brianlsharp/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/optimize/slsqp.py | 53 | """This module implements the Sequential Least SQuares Programming optimization
algorithm (SLSQP), orginally developed by Dieter Kraft.
See http://www.netlib.org/toms/733
"""
__all__ = ['approx_jacobian','fmin_slsqp']
from _slsqp import slsqp
from numpy import zeros, array, linalg, append, asfarray, concatenate, fi... |
daoluan/decode-Django | refs/heads/master | Django-1.5.1/tests/regressiontests/one_to_one_regress/tests.py | 107 | from __future__ import absolute_import
from django.test import TestCase
from .models import Place, Restaurant, Bar, Favorites, Target, UndergroundBar
class OneToOneRegressionTests(TestCase):
def setUp(self):
self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
self.p1.save()
s... |
nicholasserra/sentry | refs/heads/master | src/sentry/web/frontend/project_quotas.py | 6 | from __future__ import absolute_import
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from sentry import app, features
from sentry.quotas.base import Quota
from sentry.web.forms.projects import ProjectQuotasForm
from sentry.web.... |
rjschwei/azure-sdk-for-python | refs/heads/master | azure-batch/azure/batch/models/cloud_job_schedule_paged.py | 3 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
sommerc/bioformats | refs/heads/develop | components/xsd-fu/python/ome/modeltools/generateds.py | 9 | from __future__ import absolute_import
import sys
import keyword
import logging
# The generateDS package and our generateds module
# collide on case-insensitive file systems.
import generateDS.generateDS
from ome.modeltools.exceptions import ModelProcessingError
from xml import sax
from ome.modeltools.model import OM... |
willharris/django | refs/heads/master | django/contrib/gis/admin/options.py | 42 | from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographic models. Map settings... |
synconics/odoo | refs/heads/8.0 | addons/account_check_writing/account_voucher.py | 51 | # -*- 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... |
panxia6679/ursula | refs/heads/master | library/os_network.py | 14 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 vers... |
mude918/aws_site01 | refs/heads/master | site01/wsgi.py | 1 | """
WSGI config for site01 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... |
mavit/ansible | refs/heads/devel | test/units/plugins/action/test_synchronize.py | 13 | '''
(Epdb) pprint(DeepDiff(self.final_task_vars, out_task_vars), indent=2)
{ 'dic_item_added': set([u"root['ansible_python_interpreter']"]),
'dic_item_removed': set([ u"root['hostvars']['127.0.0.1']",
u"root['hostvars']['::1']",
u"root['hostvars']['localhost']"]... |
scripni/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/win/gyptest-cl-runtime-library.py | 344 | #!/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.
"""
Make sure runtime C library setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp... |
termicoder/termicoder | refs/heads/develop | termicoder/judges/codechef/utils/login_oauth.py | 1 | import click
import json
from ....utils.logging import logger
def login_oauth():
home_page = 'http://termicoder.diveshuttam.me/'
logger.info(
"Browser window will launch, authorize termicoder with CodeChef.\n"
"NOTE: If codechef errors about 'Invalid authorization request',\n"
"Logout... |
guschmue/tensorflow | refs/heads/master | tensorflow/contrib/tfprof/tfprof_logger.py | 92 | # 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... |
tovrstra/sympy | refs/heads/master | sympy/core/benchmarks/bench_expand.py | 9 | from sympy.core import symbols, I
x,y,z = symbols('xyz')
p = 3*x**2*y*z**7+7*x*y*z**2+4*x+x*y**4
e = (x+y+z+1)**32
def timeit_expand_nothing_todo():
p.expand()
def bench_expand_32():
"""(x+y+z+1)**32 -> expand"""
e.expand()
def timeit_expand_complex_number_1():
((2+3*I)**1000).expand(complex=True)... |
numerigraphe/odoo | refs/heads/8.0 | addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.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... |
dntt1/youtube-dl | refs/heads/master | youtube_dl/extractor/lecture2go.py | 87 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
determine_protocol,
parse_duration,
int_or_none,
)
class Lecture2GoIE(InfoExtractor):
_VALID_URL = r'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(... |
40223227/2015cdbg6w0622-40223227- | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/highlight.py | 617 | import keyword
import _jsre as re
from browser import html
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'_'
digits = '0123456789'
builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
"eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +... |
Nowheresly/odoo | refs/heads/8.0 | addons/l10n_fr/wizard/__init__.py | 424 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... |
izonder/intellij-community | refs/heads/master | python/testData/refactoring/move/moveNamespacePackage2/after/src/a.py | 961 | VAR = 42 |
agiliq/nginx-python-buildpack | refs/heads/master | vendor/pip-1.5.4/pip/_vendor/requests/packages/charade/langcyrillicmodel.py | 2761 | ######################## 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... |
Endika/django | refs/heads/master | django/conf/locale/sv/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... |
ThiagoGarciaAlves/erpnext | refs/heads/develop | erpnext/accounts/doctype/sales_taxes_and_charges/__init__.py | 37694 | from __future__ import unicode_literals
|
aam-at/tensorflow | refs/heads/master | tensorflow/python/ops/numpy_ops/integration_test/benchmarks/micro_benchmarks.py | 13 | # Copyright 2020 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... |
slyphon/pants | refs/heads/master | tests/python/pants_test/backend/project_info/tasks/test_ensime_integration.py | 31 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
blacklin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/linecache.py | 97 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... |
Leila20/django | refs/heads/master | tests/gis_tests/test_data.py | 379 | """
This module has the mock object definitions used to hold reference geometry
for the GEOS and GDAL tests.
"""
import json
import os
from django.utils import six
from django.utils._os import upath
from django.utils.functional import cached_property
# Path where reference test data is located.
TEST_DATA = os.path.jo... |
mnuthan1/workflow | refs/heads/master | lib/python2.7/site-packages/pip/req.py | 328 | from email.parser import FeedParser
import os
import imp
import locale
import re
import sys
import shutil
import tempfile
import textwrap
import zipfile
from distutils.util import change_root
from pip.locations import (bin_py, running_under_virtualenv,PIP_DELETE_MARKER_FILENAME,
write_delete... |
WSDC-NITWarangal/django | refs/heads/master | django/middleware/http.py | 216 | from django.utils.cache import get_conditional_response
from django.utils.http import http_date, parse_http_date_safe
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has an ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Si... |
darcamo/python-crash-course | refs/heads/gh-pages | node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... |
Pexego/alimentacion | refs/heads/7.0 | eln_product/__init__.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... |
gedare/gem5 | refs/heads/master | util/stats/print.py | 90 | # Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... |
hcs42/heapkeeper | refs/heads/master | setup/settings.py | 1 | # Django settings for Heapkeeper project.
import os
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
PROJECT_DIR = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PR... |
cfjhallgren/shogun | refs/heads/develop | examples/undocumented/python/kernel_combined.py | 6 | #!/usr/bin/env python
from tools.load import LoadMatrix
from numpy import double
lm=LoadMatrix()
traindat = double(lm.load_numbers('../data/fm_train_real.dat'))
testdat = double(lm.load_numbers('../data/fm_test_real.dat'))
traindna = lm.load_dna('../data/fm_train_dna.dat')
testdna = lm.load_dna('../data/fm_test_dna.da... |
felixfontein/ansible | refs/heads/devel | test/support/integration/plugins/module_utils/compat/ipaddress.py | 94 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file, and this file only, is based on
# Lib/ipaddress.py of cpython
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
... |
waseem18/oh-mainline | refs/heads/master | vendor/packages/requests/requests/utils.py | 618 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
import wa... |
mcflugen/topoflow | refs/heads/master | topoflow/gui/Read_XML_Info.py | 6 |
#!/usr/bin/env python
# April 28, 2009
# S.D. Peckham
import wx
import xml.dom.minidom
# class TF_Variable_Info
# class TF_Variable_List
# class TF_Process_Info
# def Read_XML_Info
#----------------------------------------------------------------
class TF_Variable_Info():
def __init__(self, name=''... |
cardoe/virt-manager | refs/heads/v0.10.0-maint | tests/misc.py | 4 | #
# 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 version.
#
# This program is distributed in the hope that it will be useful,
... |
chugunovyar/factoryForBuild | refs/heads/master | env/lib/python2.7/site-packages/flower/utils/search.py | 3 | import re
def parse_search_terms(raw_search_value):
search_regexp = r'(?:[^\s,"]|"(?:\\.|[^"])*")+' # splits by space, ignores space in quotes
if not raw_search_value:
return {}
parsed_search = {}
for query_part in re.findall(search_regexp, raw_search_value):
if not query_part:
... |
FRBs/DM | refs/heads/new_spectra | frb/tests/test_scripts.py | 2 | # Module to run tests on instantiating FRB objects
from __future__ import print_function, absolute_import, division, unicode_literals
# TEST_UNICODE_LITERALS
import pytest
from frb.scripts import frb_summary
def test_frb_summary():
pargs = frb_summary.parser(['180924'])
frb_summary.main(pargs)
|
ioanpocol/superdesk-core | refs/heads/master | apps/keywords/__init__.py | 8 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.