repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Nepherhotep/django | refs/heads/master | tests/field_subclassing/fields.py | 170 | from __future__ import unicode_literals
import json
import warnings
from django.db import models
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
#... |
aferr/LatticeMemCtl | refs/heads/master | ext/ply/ply/ctokens.py | 363 | # ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [
# Li... |
TrampolineRTOS/trampoline | refs/heads/master | goil/makefile-x86linux32-on-macosx/clean.py | 10 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
#-----------------------------------------------------------------------------------------------------------------------
import sys, os, subprocess, atexit
#-----------------------------------------------------------------------------------------------------------------... |
wakashige/bazel | refs/heads/master | tools/build_defs/docker/rewrite_json_test.py | 18 | # 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 ag... |
atheed/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_float_types.py | 127 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
typedef float myFloat;
typedef unrestricted float myUnrestrictedFloat;
interface FloatTypes {
attribute float f;
attribute unrestricted float uf;
attribute double d;
attribute unrestricte... |
gpotter2/scapy | refs/heads/master | scapy/contrib/__init__.py | 7 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
"""
Package of contrib modules that have to be loaded explicitly.
"""
|
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pylint/test/functional/continue_in_finally.py | 6 | """Test that `continue` is catched when met inside a `finally` clause."""
# pylint: disable=missing-docstring, lost-exception, broad-except
while True:
try:
pass
finally:
continue # [continue-in-finally]
while True:
try:
pass
finally:
break
while True:
try:
... |
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3 | refs/heads/master | .waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Tools/irixcc.py | 10 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_irixcc(conf):
v=conf.env
cc=None
if v['CC']:cc=v['CC']
elif'CC'in conf.environ:cc=conf.environ['CC']
if not cc... |
quodlibetor/git | refs/heads/master | contrib/svn-fe/svnrdump_sim.py | 328 | #!/usr/bin/python
"""
Simulates svnrdump by replaying an existing dump from a file, taking care
of the specified revision range.
To simulate incremental imports the environment variable SVNRMAX can be set
to the highest revision that should be available.
"""
import sys
import os
if sys.hexversion < 0x02040000:
# T... |
suxinde2009/zulip | refs/heads/master | tools/deprecated/finbot/monthdelta.py | 116 | """monthdelta
Date calculation with months: MonthDelta class and monthmod() function.
"""
__all__ = ['MonthDelta', 'monthmod']
from datetime import date, timedelta
class MonthDelta:
"""Number of months offset from a date or datetime.
MonthDeltas allow date calculation without regard to the different length... |
pawelszulczewski/live_chess_ratings_cli | refs/heads/master | live_chess_ratings_cli.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# takes live chess ratings from http://www.2700chess.com
# and prints in command-line
#
# GPLv2
# psz, pawel <at> szulczewski <dot> org, march-september 2015
import urllib2
import getopt
import sys
from bs4 import BeautifulSoup
data = []
def main (argv):
try : ... |
ChristianFrisson/essentia | refs/heads/pkgconfig | test/src/unittest/temporal/test_strongdecay_streaming.py | 10 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
omtinez/micropython | refs/heads/master | tests/basics/tuple_mult.py | 61 | # basic multiplication
print((0,) * 5)
# check negative, 0, positive; lhs and rhs multiplication
for i in (-4, -2, 0, 2, 4):
print(i * (1, 2))
print((1, 2) * i)
# check that we don't modify existing tuple
a = (1, 2, 3)
c = a * 3
print(a, c)
|
PythonicNinja/piper | refs/heads/master | piper/wsgi.py | 1 | """
WSGI config for piper project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
BigBrother1984/android_external_chromium_org | refs/heads/kitkat | ppapi/generators/idl_c_header.py | 31 | #!/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.
""" Generator for C style prototypes and definitions """
import glob
import os
import re
import sys
from idl_log import ErrOut, I... |
goldcoin/goldcoin | refs/heads/goldcoin-master | qa/rpc-tests/preciousblock.py | 42 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PreciousBlock code
#
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
Yajo/website | refs/heads/8.0 | website_crm_quick_answer/__openerp__.py | 10 | # -*- coding: utf-8 -*-
# License AGPL-3: Antiun Ingenieria S.L. - Jairo Llopis
# See README.rst file on addon root folder for more details
{
'name': "Quick answer for website contact form",
"summary": "Add an automatic answer for contacts asking for info",
'category': 'Customer Relationship Management',
... |
2014cdag1/cdag1 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/testmock/__init__.py | 856 | import os
import sys
import unittest
here = os.path.dirname(__file__)
loader = unittest.defaultTestLoader
def load_tests(*args):
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "unittest.test.testmock." + fn[:-3]
... |
carlgao/lenga | refs/heads/master | images/lenny64-peon/usr/share/python-support/python-django/django/db/models/sql/query.py | 8 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... |
sseguku/simplecensusug | refs/heads/master | censusreporter/api/scripts/load_municipal_elections_2011.py | 3 | import os
import sys
import unicodecsv as csv
from api.models import Municipality, Province, Votes, Base
from api.utils import get_session, _engine
def parse_integer(val, s):
return int(val.replace(',', ''))
field_mapper = {
"Electoral Event": (
'electoral_event',
lambda val, s: 'municipal... |
akaariai/django | refs/heads/master | tests/migrations/test_migrations_backwards_deps_1/0002_second.py | 416 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [('migrations', '0001_initial')]
operations = []
|
repotvsupertuga/tvsupertuga.repository | refs/heads/master | plugin.video.loganaddon/resources/lib/libraries/MovieDB.py | 26 | import os
import xbmcgui
import xbmc
import time
import urllib
import urllib2
import re
import json
from bs4 import BeautifulSoup
class MovieDB:
linkImagem = 'http://image.tmdb.org/t/p/original'
generos = {}
def __init__(self, api_key, lingua):
self.api_key = api_key
self.lingua = lingua
self.getGeneros... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/unclosured/lib/python2.7/rlcompleter.py | 175 | """Word completion for GNU readline 2.0.
This requires the latest extension to the readline module. The completer
completes keywords, built-ins and globals in a selectable namespace (which
defaults to __main__); when completing NAME.NAME..., it evaluates (!) the
expression up to the last dot and completes its attribut... |
mAAyple/twitterbot | refs/heads/master | twitterbot/__init__.py | 6 | __version__ = '0.1.0'
__author__ = 'thricedotted'
from twitterbot.bot import TwitterBot, ignore
|
aio-libs/yarl | refs/heads/master | yarl/_quoting.py | 1 | import os
import sys
__all__ = ("_Quoter", "_Unquoter")
NO_EXTENSIONS = bool(os.environ.get("YARL_NO_EXTENSIONS")) # type: bool
if sys.implementation.name != "cpython":
NO_EXTENSIONS = True
if not NO_EXTENSIONS: # pragma: no branch
try:
from ._quoting_c import _Quoter, _Unquoter # type: ignore[m... |
Entropy512/linux_kernel_sgh-i997r | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
DrMeers/django | refs/heads/master | django/views/defaults.py | 19 | import warnings
from django import http
from django.template import (Context, RequestContext,
loader, Template, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requ... |
coldmind/django | refs/heads/master | tests/i18n/models.py | 451 | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class TestModel(models.Model):
text = models.CharField(max_length=10, default=_('Anything'))
class Company(models.Model):
name = models.CharField(max_length=50)
date_added = models.DateTim... |
ProteinDF/QCLObot | refs/heads/master | scripts/qc-info-frame.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import logging
import logging.config
import pprint
try:
import msgpack
except:
import msgpack_pure as msgpack
import proteindf_bridge as bridge
import proteindf_tools as pdf
import qclobot as qclo
def assign_charges(atomgroup, charges... |
teltek/edx-platform | refs/heads/master | common/djangoapps/student/management/tests/test_manage_user.py | 13 | """
Unit tests for user_management management commands.
"""
import itertools
import ddt
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import Group, User
from django.core.management import call_command, CommandError
from django.test import TestCase
from openedx.core.djangoapps.u... |
neiudemo1/django | refs/heads/master | tests/template_tests/filter_tests/test_chaining.py | 345 | from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class ChainingTests(SimpleTestCase):
"""
Chaining safeness-preserving filters should not alter the safe status.
"""
@setup({'chaining01': '{{ a|capfirst|center:"7" }}.{{ b|capfirst|center:"... |
marctc/wagtail | refs/heads/master | wagtail/wagtailimages/tests/test_admin_views.py | 3 | import json
from django.test import TestCase
from django.utils.http import urlquote
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django.core.files.uploadedfile import SimpleUploadedFile
# Get the chars that Django considers safe to leave unescaped in a URL
# This... |
dotpy/py-pf | refs/heads/master | pf/lib.py | 1 | """High-level classes to load rules more easily."""
import socket
from pf.rule import PFRule, PFPool, PFPort
from pf._utils import icmp_codes, icmp6_codes, icmp_types, icmp6_types
from pf.constants import *
__all__ = ["Rule",
"BlockRule",
"BlockInRule",
"BlockOutRule",
"P... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cython-0.22.1/tests/run/generators_py.py | 5 | # mode: run
# tag: generators
import cython
try:
from builtins import next # Py3k
except ImportError:
def next(it):
return it.next()
def very_simple():
"""
>>> x = very_simple()
>>> next(x)
1
>>> next(x)
Traceback (most recent call last):
StopIteration
>>> next(x)
... |
mglukhikh/intellij-community | refs/heads/master | python/testData/psi/ComprehensionErrors.py | 83 | [for in if]
|
uwafsl/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/lib/scimath.py | 90 | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... |
kofron/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/textfile.py | 61 | # -*- python -*-
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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, inclu... |
KorayAgaya/MITMf | refs/heads/master | core/servers/POP3.py | 24 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... |
richardnpaul/FWL-Website | refs/heads/master | lib/python2.7/site-packages/psycopg2/tests/testutils.py | 14 | # testutils.py - utility module for psycopg2 testing.
#
# Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either vers... |
scalable-networks/gnuradio-3.7.2.1 | refs/heads/master | gnuradio-runtime/python/gnuradio/gr/qa_kludged_imports.py | 59 | #!/usr/bin/env python
#
# Copyright 2005,2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
caisq/tensorflow | refs/heads/master | tensorflow/examples/tutorials/mnist/mnist_softmax_xla.py | 37 | # 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... |
valmynd/MediaFetcher | refs/heads/master | src/plugins/youtube_dl/youtube_dl/extractor/sztvhu.py | 1 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SztvHuIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)'
_TEST = {
'url': 'http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornyezettudatos-eletmod... |
joelddiaz/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.8.36-1/roles/lib_openshift/library/oc_objectvalidator.py | 6 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
saurabh3949/mxnet | refs/heads/master | example/bayesian-methods/algos.py | 26 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
MobinRanjbar/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/empty/tests.py | 58 | from __future__ import absolute_import
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .models import Empty
class EmptyModelTests(TestCase):
def... |
josephsnyder/VistA | refs/heads/master | Packages/Clinical Reminders/Patches/PXRM_2.0_28/PXRM_2.0_28.py | 2 | #---------------------------------------------------------------------------
# Copyright 2013-2019 The Open Source Electronic Health Record Alliance
#
# 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 Licen... |
csparkresearch/ExpEYES17-Qt | refs/heads/master | SPARK17/textManual/textManual.py | 1 | #!/usr/bin/python3
import os, os.path
import sys
sys.path=[os.path.dirname(__file__)]+sys.path
from subprocess import call, Popen, PIPE, STDOUT
from tm import imgWidthFilter, labelFilter, svgFilter
from MarkdownPP import MarkdownPP
from MarkdownPP.Modules import modules
# just for translations
from PyQt5 import QtCor... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/test_auth.py | 42 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2010-2013 Canonical Ltd.
#
# 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 ... |
vishalshrm539/Python-Scripts | refs/heads/master | printAstrikpattern.py | 1 |
def tri():
x=1
while(x<=10):
print("*" * x)
x=x+1
tri()
|
engdan77/edoAutoHomeMobile | refs/heads/master | twisted/web/test/test_webclient.py | 8 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the old L{twisted.web.client} APIs, C{getPage} and friends.
"""
from __future__ import division, absolute_import
import os
from errno import ENOSPC
try:
from urlparse import urlparse, urljoin
except ImportError:
from urlli... |
bollu/vispy | refs/heads/master | vispy/scene/widgets/anchor.py | 23 | from ..node import Node
class Anchor(Node):
"""
Anchor is a node derives parts of its transform from some other
coordinate system in the scene.
The purpose is to allow children of an Anchor to draw using a position
(and optionally rotation) specified by one coordinate system, and scaling/
pro... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/medicine/crafted/medpack_disease_constitution_c.py | 85615 | import sys
def setup(core, object):
return |
bobisme/odoo | refs/heads/sp-8.0 | addons/edi/models/res_partner.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
ataylor32/django | refs/heads/master | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... |
KrivenkoAlexander/python_tr | refs/heads/master | data/groups.py | 1 | from model.group import Group
test_data = [
Group(name='name1',header='header1',footer='footer1'),
Group(name='name2',header='header2',footer='footer2')
]
|
thesuperzapper/tensorflow | refs/heads/master | tensorflow/contrib/rnn/python/ops/core_rnn_cell.py | 44 | # 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... |
UNINETT/nav | refs/heads/master | python/nav/ipdevpoll/plugins/arp.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2012 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This progr... |
Baumelbi/IntroPython2016 | refs/heads/master | students/baumel/session_05/dict_set_solution.py | 6 | #!/usr/bin/env python
"""
dict/set lab solutions: Chris' version.
"""
food_prefs = {"name": "Chris",
"city": "Seattle",
"cake": "chocolate",
"fruit": "mango",
"salad": "greek",
"pasta": "lasagna"}
# 1. Print the dict by passing it to a string form... |
edublancas/python-ds-tools | refs/heads/master | src/dstools/pipeline/clients/shell.py | 2 | """
Clients that communicate with shell processes
"""
import tempfile
from pathlib import Path
import random
import string
import logging
import shlex
import subprocess
from subprocess import CalledProcessError
from dstools.pipeline.clients.Client import Client
from dstools.templates.Placeholder import Placeholder
im... |
coryb/aminator | refs/heads/master | aminator/plugins/provisioner/apt.py | 5 | # -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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 ... |
donkirkby/django | refs/heads/master | tests/gis_tests/geos_tests/test_geos.py | 150 | from __future__ import unicode_literals
import ctypes
import json
import random
import unittest
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import (
HAS_GE... |
errx/django | refs/heads/master | tests/forms_tests/tests/test_widgets.py | 7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
import warnings
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.forms import (
Bo... |
flavour/eden | refs/heads/master | languages/ja.py | 15 | # -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": 'この地域を地理的に指定するロケーション。これはロケーションの階層構造のうちの一つか、ロケーショングループの一つか、この地域の境界に面するロケーションです。',
"Acronym of the organ... |
BeDjango/intef-openedx | refs/heads/master | openedx/core/lib/api/__init__.py | 199 | """
Package for common functionality shared across various APIs.
"""
|
rodrigc/buildbot | refs/heads/master | master/buildbot/steps/package/deb/pbuilder.py | 3 | # 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of ME... |
gustavofonseca/scielo-manager | refs/heads/master | scielomanager/manage.py | 5 | #!/usr/bin/env python
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "scielomanager.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
gangadharkadam/v6_erp | refs/heads/master | erpnext/setup/doctype/notification_control/__init__.py | 37694 | from __future__ import unicode_literals
|
njmube/erpnext | refs/heads/develop | erpnext/stock/doctype/__init__.py | 37694 | from __future__ import unicode_literals
|
Zoraze/Test-Pscr | refs/heads/master | examples/naming/examples-to-run.py | 199 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
PythonJS/PythonJS | refs/heads/master | regtests/threads/call_from_worker_blocking.py | 10 | '''call function from main and get result'''
import threading
from time import sleep
shared = []
def blocking_func(x,y):
shared.append( x )
shared.append( y )
return x+y
def async_func( a ):
shared.append( a )
def main():
w = threading.start_webworker( worker, [] )
sleep(1.0)
TestError( len(shared)==3 )
Te... |
curtisstpierre/django | refs/heads/master | tests/gis_tests/layermap/models.py | 235 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... |
ivanhorvath/openshift-tools | refs/heads/prod | ansible/roles/lib_oa_openshift/library/oc_clusterrole.py | 18 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
mindnervestech/mnrp | refs/heads/master | addons/website_forum/tests/common.py | 94 | # -*- coding: utf-8 -*-
from openerp.tests import common
KARMA = {
'ask': 5, 'ans': 10,
'com_own': 5, 'com_all': 10,
'com_conv_all': 50,
'upv': 5, 'dwv': 10,
'edit_own': 10, 'edit_all': 20,
'close_own': 10, 'close_all': 20,
'unlink_own': 10, 'unlink_all': 20,
'gen_que_new': 1, 'gen_que... |
CenturylinkTechnology/ansible-modules-extras | refs/heads/devel | cloud/amazon/ec2_vpc_subnet.py | 15 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... |
haveal/googleads-python-lib | refs/heads/master | examples/adwords/v201506/campaign_management/add_keywords_in_bulk.py | 4 | #!/usr/bin/python
#
# 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 b... |
tashaband/RYU295 | refs/heads/master | ryu/services/protocols/vrrp/rpc_manager.py | 3 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... |
mlperf/training_results_v0.7 | refs/heads/master | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/lingvo/core/tshape.py | 3 | # Copyright 2019 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... |
charlon/mdot | refs/heads/master | mdot/views.py | 1 | from django.conf import settings
from django.template.loader import get_template
from django.template import RequestContext, Context
from django.shortcuts import render_to_response, render
from django.core.mail import send_mail, BadHeaderError
from django.http import HttpResponse, HttpResponseRedirect
from .mdot_rest_c... |
pfmoore/invoke | refs/heads/master | invoke/vendor/yaml2/resolver.py | 475 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... |
nitin-cherian/LifeLongLearning | refs/heads/master | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/tornado/platform/interface.py | 26 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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... |
danieljaouen/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/aws_direct_connect_connection.py | 31 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module... |
sebrandon1/neutron | refs/heads/master | neutron/services/trunk/plugin.py | 3 | # 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 agreed to in... |
mogria/rtsh | refs/heads/master | srv/setup.py | 1 | from setuptools import setup, find_packages
setup(
name = 'rtsh.srv',
version = '0.1',
description = 'Python Server for the Real Time Strategy Shell Game',
author = 'wtjerry, mogria',
author_email = 'wtjerry123@gmail.com, m0gr14@gmail.com',
keywords = 'real-time strategy game server',
url =... |
ThirdProject/android_external_chromium_org | refs/heads/cm-11.0 | build/linux/unbundle/replace_gyp_files.py | 27 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Replaces gyp files in tree with files from here that
make the build use system libraries.
"""
import optparse
import os.path
impo... |
luser/socorro | refs/heads/master | scripts/submitter.py | 2 | #! /usr/bin/env python
# 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/.
import sys
import logging
import logging.handlers
import config.submitterconfig as subconf
imp... |
puhoy/storedDict | refs/heads/master | storedDict/storedDict.py | 1 | import json
import logging
class AutoVivification(dict):
"""Implementation of perl's autovivification feature.
based on
http://stackoverflow.com/questions/651794/whats-the-best-way-to-initialize-a-dict-of-dicts-in-python
"""
def __init__(self, storedDict, **kwargs):
super(AutoVivification,... |
arvinsim/hackerrank-solutions | refs/heads/master | hackerrank/all-domains/python/introduction/write-a-function/solution.py | 1 | #!/usr/env/bin python
# https://www.hackerrank.com/challenges/write-a-function
# Python 2
def is_divisible_by(number, year):
return year % number == 0
def is_leap(year):
leap = False
if is_divisible_by(4, year):
leap = True
if is_divisible_by(100, year):
leap = False
... |
UFAL-DSG/pjsip | refs/heads/master | tests/pjsua/scripts-sendto/121_sdp_with_video_static_2.py | 59 | # $Id: 121_sdp_with_video_static_2.py 2081 2008-06-27 21:59:15Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# Video uses static payload type which will cause failure
# when session.c looks-up the codec in codec manager
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=video 4000 RTP/AVP... |
alhashash/odoo | refs/heads/master | addons/report/models/abstract_report.py | 249 | # -*- 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 ... |
wangyum/tensorflow | refs/heads/master | tensorflow/contrib/linear_optimizer/python/sdca_estimator.py | 15 | # 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... |
Osmose/kitsune | refs/heads/master | kitsune/gallery/tests/test_views.py | 15 | import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.gallery import views
from kitsune.gallery.models import Image, Video
from kitsune.gallery.tests import image, video
from kitsune.gallery.views import _get_media_info
from kitsune.sumo.tests import post, LocalizingClient, TestCase
fro... |
asrie/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base_unittest.py | 121 | # Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
akarol/cfme_tests | refs/heads/master | cfme/tests/containers/test_search_bar.py | 5 | from random import choice
import pytest
from cfme.containers.provider import ContainersProvider
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
pytest.mark.usefixtures('setup_provider'),
pytest.mark.tier(3),
pytest.mark.provider([ContainersProvider], scope='function')
]
C... |
vtemian/kruncher | refs/heads/master | crunch/jobs/add.py | 1 | import sys
import rethinkdb as r
from disco.core import Job
import csv
class GroupSum(Job):
def __init__(self, group_by, fields, *args, **kwargs):
self.group_by = int(group_by)
self.fields = map(int, fields)
super(GroupSum, self).__init__(*args, **kwargs)
@staticmethod
def map_reader(fd, size, url... |
petercable/mi-dataset | refs/heads/master | mi/dataset/parser/flord_l_wfp.py | 3 | #!/usr/bin/env python
"""
@package mi.dataset.parser.flord_l_wfp
@file marine-integrations/mi/dataset/parser/flord_l_wfp.py
@author Joe Padula
@brief Particle for the flord_l_wfp dataset driver
NOTE: there is no parser class in this file. This dataset is using the parser
in global_wfp_e_file_parser.py.
Release... |
mhils/pytest | refs/heads/master | _pytest/vendored_packages/pluggy.py | 15 | """
PluginManager, basic initialization and tracing.
pluggy is the cristallized core of plugin management as used
by some 150 plugins for pytest.
Pluggy uses semantic versioning. Breaking changes are only foreseen for
Major releases (incremented X in "X.Y.Z"). If you want to use pluggy in
your project you should thu... |
Dannnno/odo | refs/heads/master | odo/backends/tests/test_dask_bag.py | 2 | import pytest
pytest.importorskip('dask.bag')
from odo import chunks, TextFile, odo
from dask.bag import Bag
from odo.utils import filetexts
def inc(x):
return x + 1
dsk = {('x', 0): (range, 5),
('x', 1): (range, 5),
('x', 2): (range, 5)}
L = list(range(5)) * 3
b = Bag(dsk, 'x', 3)
def test_... |
wxgeo/geophar | refs/heads/master | wxgeometrie/sympy/physics/quantum/anticommutator.py | 5 | """The anti-commutator: ``{A,B} = A*B + B*A``."""
from __future__ import print_function, division
from sympy import S, Expr, Mul, Integer
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.operator import Operator
from sympy.physics.quantum.dagger import Dagger
__all__ = [
'AntiC... |
geosolutions-it/geonode | refs/heads/master | geonode/documents/enumerations.py | 5 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/win32/Demos/win32comport_demo.py | 4 | # This is a simple serial port terminal demo.
#
# Its primary purpose is to demonstrate the native serial port access offered via
# win32file.
# It uses 3 threads:
# - The main thread, which cranks up the other 2 threads, then simply waits for them to exit.
# - The user-input thread - blocks waiting for a keybo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.