repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
asoneofus/v350 | refs/heads/master | FADG_4.39A/external/webkit/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py | 3 | #!/usr/bin/env python
# Copyright (C) 2010 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 ... |
mushtaqak/edx-platform | refs/heads/master | openedx/core/lib/tempdir.py | 139 | """Make temporary directories nicely."""
import atexit
import os.path
import shutil
import tempfile
def mkdtemp_clean(suffix="", prefix="tmp", dir=None): # pylint: disable=redefined-builtin
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir = tempfile.mkdtemp(suffix=s... |
tranhuucuong91/generator-angular-flask | refs/heads/master | app/templates/db_downgrade.py | 61 | #!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
print 'Current database version: ' + str... |
rcrane/kinetic-c | refs/heads/master | vendor/protobuf-2.6.0/python/google/protobuf/internal/service_reflection_test.py | 4 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... |
amuaddib/qemu_scratch | refs/heads/stm32 | scripts/qapi.py | 50 | #
# QAPI helper library
#
# Copyright IBM, Corp. 2011
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
#
# This work is licensed under the terms of the GNU GPLv2.
# See the COPYING.LIB file in the top-level directory.
from ordereddict import OrderedDict
def tokenize(data):
while len(data):
ch = data[... |
canglade/NLP | refs/heads/master | endpoints/bookstore-grpc/bookstore_client.py | 8 | # Copyright 2016 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... |
mjtamlyn/django | refs/heads/master | tests/app_loading/not_installed/models.py | 415 | from django.db import models
class NotInstalledModel(models.Model):
class Meta:
app_label = 'not_installed'
class RelatedModel(models.Model):
class Meta:
app_label = 'not_installed'
not_installed = models.ForeignKey(NotInstalledModel, models.CASCADE)
class M2MRelatedModel(models.Mod... |
chirino/proton | refs/heads/trunk | proton-c/env.py | 1 | #
# 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... |
drammock/mne-python | refs/heads/main | tutorials/forward/20_source_alignment.py | 6 | # -*- coding: utf-8 -*-
"""
.. _plot_source_alignment:
Source alignment and coordinate frames
======================================
This tutorial shows how to visually assess the spatial alignment of MEG sensor
locations, digitized scalp landmark and sensor locations, and MRI volumes. This
alignment process is cruci... |
bourneli/deep-learning-notes | refs/heads/master | series_autoencode/python/src/test/test_encode_with_tag_demo.py | 1 | # -*- coding: utf-8 -*-
import numpy as np
import random
import tensorflow as tf
import time
from src.embedding import RNNEncodeWithTag
print("Current TensorFlow Version", tf.__version__)
##################################################################################
# 参数设置
######################################... |
golismero/golismero | refs/heads/master | thirdparty_libs/dns/rdtypes/ANY/RP.py | 100 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
sudssm/daruma | refs/heads/master | tools/utils.py | 1 | from multiprocessing import Process, Pipe
import os
import sys
from uuid import uuid4
from urlparse import urlparse, parse_qs
from concurrent.futures import ThreadPoolExecutor
from custom_exceptions.exceptions import SandboxProcessFailure
APP_NAME = "daruma"
INTERNAL_SERVER_HOST = "localhost"
INTERNAL_SERVER_PORT = 28... |
kimeraapp/pythonjobs.ie | refs/heads/master | pythonjobs/services.py | 1 | import string
import random
from django.core.mail import send_mail
from django.template import loader
import tweepy
from pythonjobs import settings
class Twitter(object):
def __init__(self):
self.consumer_key = settings.TWITTER_KEY
self.consumer_secret = settings.TWITTER_SECRET
... |
percipient/django-two-factor-auth | refs/heads/master | two_factor/management/commands/two_factor_disable.py | 4 | from django.core.management.base import BaseCommand, CommandError
try:
from django.contrib.auth import get_user_model
except ImportError:
from django.contrib.auth.models import User
else:
User = get_user_model()
from django_otp import devices_for_user
class Command(BaseCommand):
"""
Command for d... |
opencivicdata/scrapers-ca | refs/heads/master | ca_nb_municipalities/__init__.py | 1 | from utils import CanadianJurisdiction
class NewBrunswickMunicipalities(CanadianJurisdiction):
classification = 'government'
division_id = 'ocd-division/country:ca/province:nb'
division_name = 'New Brunswick'
name = 'New Brunswick municipal councils'
url = 'http://www2.gnb.ca/content/gnb/en/depart... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/veteran_reward/frn_vet_holo_leia.py | 85615 | import sys
def setup(core, object):
return |
atzengin/OCC | refs/heads/master | occ/gui/Bars.py | 1 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
OpenCV Companion 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) a... |
DaanHoogland/cloudstack | refs/heads/patch-2 | test/integration/testpaths/testpath_same_vm_name.py | 7 | # 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... |
ict-felix/stack | refs/heads/master | vt_manager_kvm/src/python/agent/kvm/provisioning/configurators/irati/IratiDebianVMConfigurator.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014-2015 National Institute of Advanced Industrial Science and Technology
#
# 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/l... |
JT5D/scikit-learn | refs/heads/master | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 8 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... |
abhattad4/Digi-Menu | refs/heads/master | django/forms/extras/widgets.py | 82 | """
Extra HTML Widget classes
"""
from __future__ import unicode_literals
import datetime
import re
from django.conf import settings
from django.forms.widgets import Select, Widget
from django.utils import datetime_safe, six
from django.utils.dates import MONTHS
from django.utils.encoding import force_str
from django... |
Yelp/love | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='YelpLove',
version='1.0.0',
description='A web application and API for expressing love and joy.',
packages=['.'],
url='https://github.com/Yelp/love',
)
|
elyezer/robottelo | refs/heads/master | tests/foreman/cli/test_ostreebranch.py | 1 | # -*- encoding: utf-8 -*-
"""Test class for Ostree Branch CLI.
:Requirement: Ostreebranch
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: CLI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import random
from robottelo.cli.contentview import ContentView
from robottelo.cli.factory... |
esc24/mapping-manager | refs/heads/placeholder | manager/forms.py | 1 |
# (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of metOcean-mapping.
#
# metOcean-mapping 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 version 3 of
# the Licens... |
enigmampc/catalyst | refs/heads/master | tests/exchange/test_suites/test_suite_exchange.py | 1 | import json
import os
import random
from logging import Logger, WARNING
from time import sleep
import pandas as pd
from catalyst.assets._assets import TradingPair
from logbook import TestHandler
from catalyst.exchange.exchange_errors import ExchangeRequestError
from catalyst.exchange.exchange_execution import Exchang... |
user-none/calibre | refs/heads/master | src/calibre/ebooks/txt/textileml.py | 23 | # -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2011, Leigh Parry <leighparry@blueyonder.co.uk>'
__docformat__ = 'restructuredtext en'
'''
Transform OEB content into Textile formatted plain text
'''
import re
from functools import partial
from calibre.ebooks.htmlz.oeb2html import OEB2HTML
from calibr... |
MihaiMoldovanu/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/pear.py | 17 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __f... |
gauribhoite/personfinder | refs/heads/master | env/site-packages/setuptools/command/saveopts.py | 1052 | from setuptools.command.setopt import edit_config, option_base
class saveopts(option_base):
"""Save command-line options to a file"""
description = "save supplied options to setup.cfg or other config file"
def run(self):
dist = self.distribution
settings = {}
for cmd in dist.com... |
AbdealiJK/coala | refs/heads/master | tests/coalaDeleteOrigTest.py | 11 | import os
import tempfile
import unittest
from coalib import coala_delete_orig
from coalib.misc.ContextManagers import retrieve_stdout
from coalib.parsing import Globbing
from coalib.settings.Section import Section
from coalib.settings.Setting import Setting
class coalaDeleteOrigTest(unittest.TestCase):
def set... |
yelizariev/website-addons | refs/heads/9.0 | website_proposal_lead/__openerp__.py | 1 | {
'name' : 'Website proposal for leads',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
'category' : 'Base',
'website' : 'https://yelizariev.github.io',
'description': """
Web-based proposals for leads
""",
'depends' : ['website_proposal', 'c... |
nrado/flight_dynamics_autopilot | refs/heads/master | MpltLib_GtkAggPlot.py | 1 | #!/usr/bin/env python
import matplotlib
matplotlib.use ('TKAgg')
from pylab import *
from scipy.integrate import odeint
from scipy.signal import lti, impulse, step
def DrawDiag_GtkAgg (X, Y, FigureNum=None, NumSubplot=None, FigTitle='No title', FigSuptitle='No suptitle', Xlabel=None, Ylabel=None, type='normal', ge... |
hexlism/css_platform | refs/heads/master | sleepyenv/lib/python2.7/site-packages/WTForms-2.0.2-py2.7.egg/wtforms/ext/i18n/form.py | 139 | import warnings
from wtforms import form
from wtforms.ext.i18n.utils import get_translations
translations_cache = {}
class Form(form.Form):
"""
Base form for a simple localized WTForms form.
**NOTE** this class is now un-necessary as the i18n features have
been moved into the core of WTForms, and wi... |
CXQERP/ODOOERP | refs/heads/master | addons/sale_margin/sale_margin.py | 172 | ##############################################################################
#
# 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 GNU Affero General Public L... |
DinoCow/airflow | refs/heads/master | airflow/contrib/operators/dynamodb_to_s3.py | 7 | #
# 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... |
hiway/micropython | refs/heads/master | tests/basics/gen_yield_from.py | 95 | # Case of terminating subgen using return with value
def gen():
yield 1
yield 2
return 3
def gen2():
print("here1")
print((yield from gen()))
print("here2")
g = gen2()
print(list(g))
# Like above, but terminate subgen using StopIteration
def gen3():
yield 1
yield 2
raise StopIter... |
mbauskar/phrerp | refs/heads/develop | erpnext/hr/doctype/salary_manager/__init__.py | 41 | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... |
RounakPramanik/python-vnfsvcclient | refs/heads/master | vnfsvcclient/common/__init__.py | 2 | # Copyright 2011 VMware, 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 ... |
Conedy/Conedy | refs/heads/master | testing/network/expected/sum_addNode.py | 2 | 00000 0 output/addNode.py.err
56950 1 output/addNode.py.out
|
ULHPC/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/h/hpl.py | 1 | ##
# Copyright 2009-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
nycbjr/tf700t_kernel | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
imovedev/cf-php-build-pack-cakephp2 | refs/heads/master | lib/httpd/extension.py | 14 | # 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 use ... |
todaychi/hue | refs/heads/master | desktop/core/ext-py/pysaml2-2.4.0/example/sp-wsgi/service_conf.py | 31 | from saml2.assertion import Policy
HOST = '127.0.0.1'
PORT = 8087
HTTPS = False
# Which groups of entity categories to use
POLICY = Policy(
{
"default": {"entity_categories": ["swamid", "edugain"]}
}
)
# HTTPS cert information
SERVER_CERT = "pki/mycert.pem"
SERVER_KEY = "pki/mykey.pem"
CERT_CHAIN = "... |
tilezen/tileserver | refs/heads/master | tileserver/cache.py | 2 | import errno
import os
import time
from collections import namedtuple
from contextlib import contextmanager
from string import zfill
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
el... |
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/kazoo-2.0/docs/conf.py | 33 | # -*- coding: utf-8 -*-
#
# kazoo documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 11 13:23:01 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
ruchikd/Algorithms | refs/heads/master | Python/PrintBSTInColumnOrder/PrintBSTInColumnOrder.py | 1 | # 4
# / \
# 2 6
# / \ / \
# 1 3 5 7
# 4
# / \
# 2 2
# / \ / \
# 1 3 3 1
class Node:
rChild, lChild, data = None, None, None
def __init__(self, data):
sel... |
nvoron23/avos | refs/heads/master | openstack_dashboard/dashboards/identity/domains/constants.py | 88 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
mbauskar/sapphire-erpnext | refs/heads/master | erpnext/patches/v5_0/fix_taxes_and_totals_in_party_currency.py | 103 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.model.meta import get_field_precision
def execute():
if not frappe.db.sql("""select name from `tabPatch Log`
where patch = 'erpnext.patches.v5_0.taxes_and_total... |
fengshao0907/tornado | refs/heads/master | maint/test/appengine/common/cgi_runtests.py | 111 | #!/usr/bin/env python
import sys
import unittest
# Most of our tests depend on IOLoop, which is not usable on app engine.
# Run the tests that work, and check that everything else is at least
# importable (via tornado.test.import_test)
TEST_MODULES = [
'tornado.httputil.doctests',
'tornado.iostream.doctests',
... |
eddiep1101/django-oscar | refs/heads/master | src/oscar/apps/basket/forms.py | 16 | from django import forms
from django.conf import settings
from django.db.models import Sum
from django.forms.models import BaseModelFormSet, modelformset_factory
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_model
from oscar.forms import widgets
Line = get_model('basket', ... |
pwalczysko/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/src/omero/__init__.py | 11 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Primary OmeroPy types
Classes:
omero.client -- Main OmeroPy connector object
Copyright 2007, 2008 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
from omero_version import omero_version
fr... |
OpringaoDoTurno/airflow | refs/heads/master | tests/dags/test_impersonation.py | 45 | # -*- 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
... |
coberger/DIRAC | refs/heads/integration | Core/Utilities/Distribution.py | 6 | # $HeadURL$
__RCSID__ = "$Id$"
import urllib2, re, tarfile, os, types, sys, subprocess, urlparse, tempfile
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Utilities import CFG, File, List
class Distribution:
cernAnonRoot = 'http://svn.cern.ch/guest/dirac'
googleAnonRoot = 'http://dirac-grid.googlecode.... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/278_pystone.py | 189 | #! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... |
palmerjh/iEBE | refs/heads/master | PlayGround/job-2/EbeCollector/assignmentFormat.py | 16 | #!/usr/bin/env python
""" Provide support for assignment formats.
The convention is that when stored in files, column index starts
with 1, even though python convention starts with 0.
"""
# Version 1
from listR import isFloat
def assignmentExprStream2Dict(data, assignmentSymbol="=", commentSymbol="#"):
... |
frankvdp/django | refs/heads/master | django/db/backends/postgresql_psycopg2/utils.py | 465 | from ..postgresql.utils import * # NOQA
|
codepantry/django | refs/heads/master | django/conf/locale/da/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'
DATET... |
SujaySKumar/django | refs/heads/master | tests/template_tests/syntax_tests/test_named_endblock.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class NamedEndblockTests(SimpleTestCase):
@setup({'namedendblocks01': '1{% block first %}_{% block second %}'
'2{% endblock second %}_{% endblock first %}3'})
def ... |
hforge/ikaaro | refs/heads/master | ikaaro/config_captcha.py | 2 | # -*- coding: UTF-8 -*-
# Copyright (C) 2011 Juan David Ibáñez Palomar <jdavid@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
xyzz/vcmi-build | refs/heads/master | project/jni/python/src/Lib/lib-tk/Tix.py | 50 | # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Tix.py 63487 2008-05-20 07:13:37Z georg.brandl $
#
# Tix.py -- Tix widget wrappers.
#
# For Tix, see http://tix.sourceforge.net
#
# - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
# based on an idea of Jean-Marc Lu... |
pezy/python_test | refs/heads/master | byteofpy/data_structures.py | 1 | shoplist = ['apple', 'mango', 'carrot', 'banana']
print 'I have', len(shoplist), 'items to purchase'
print 'These items are:'
for item in shoplist:
print item,
print '\nI also have to buy rice.'
shoplist.append('rice')
print 'My shopping list is now', shoplist
print 'I will sort my list now.'
shoplist.sort()
pr... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/food/spice/spice_neutron_pixey_01.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/collection/reward/pob_couch_furniture_hue_01.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/furniture/nym_themepark/nym_themepark_plant_10.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/item/item_firework_two.py | 85615 | import sys
def setup(core, object):
return |
adviti/melange | refs/heads/master | thirdparty/google_appengine/lib/django_1_2/tests/modeltests/many_to_one_null/models.py | 92 | """
16. Many-to-one relationships that can be null
To define a many-to-one relationship that can have a null foreign key, use
``ForeignKey()`` with ``null=True`` .
"""
from django.db import models
class Reporter(models.Model):
name = models.CharField(max_length=30)
def __unicode__(self):
return self... |
signalfuse/maestro-ng | refs/heads/master | maestro/__main__.py | 1 | #!/usr/bin/env python
# Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015-2018 SignalFx, Inc.
#
# Docker container orchestration utility.
from __future__ import print_function
import argparse
import logging
import sys
import traceback
from . import exceptions, loader, maestro, name, termoutput, version
... |
thepiper/standoff | refs/heads/master | vpy/lib/python2.7/site-packages/jinja2/_stringdefs.py | 990 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... |
a-veitch/grpc | refs/heads/master | src/python/grpcio_tests/tests/unit/framework/common/test_control.py | 16 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
trianam/tkLayoutTests | refs/heads/master | TestRouting/test1b/conf/xml/longbarrel_cmsIdealGeometryXML_cff.py | 43 | import FWCore.ParameterSet.Config as cms
from Geometry.CMSCommonData.cmsIdealGeometryXML_cfi import *
XMLIdealGeometryESSource.geomXMLFiles = cms.vstring(
'SLHCUpgradeSimulations/Geometry/data/longbarrel/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/no... |
mcrewson/squib | refs/heads/master | squib/utility.py | 1 | # vim:set ts=4 sw=4 et nowrap syntax=python ff=unix:
#
# Copyright 2011-2018 Mark Crewson <mark@crewson.net>
#
# 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/lice... |
MJB47/Jokusoramame | refs/heads/master | migrations/versions/b3a672162cc0_add_usercolour_table.py | 1 | """Add UserColour table
Revision ID: b3a672162cc0
Revises: 9da95f53e8a1
Create Date: 2017-02-05 00:05:23.241442
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b3a672162cc0'
down_revision = '9da95f53e8a1'
branch_labels = None
depends_on = None
def upgrade():... |
diorcety/intellij-community | refs/heads/master | python/testData/psi/WithStatement2.py | 62 | # with = 1 # legal identifier
# with = 1
with = 1
# from __future__ import nested_scopes, with_statement
from __future__ import nested_scopes, with_statement
# with x.y(z)[t] as y: pass
with x.y(z)[t] as y: pass
# with = 1 # now illegal
with = 1
|
electionleaflets/electionleaflets | refs/heads/django_1_7 | electionleaflets/apps/boundaries/models.py | 1 | from django.db import models
from constituencies.models import Constituency
class Boundary(models.Model):
constituency = models.ForeignKey( Constituency )
boundary = models.TextField()
zoom = models.IntegerField()
north = models.FloatField()
south = models.FloatField()
east = models.FloatField(... |
solvery/lang-features | refs/heads/master | python/case/case.aptovision_api_1/cmd_interact_1.py | 1 | import sys
import time
import json
import IPython
import telnetlib
if len(sys.argv) <= 1:
ip_addr='127.0.0.1'
else:
ip_addr = sys.argv[1]
host=ip_addr
port=6970
tn = telnetlib.Telnet(host, port, timeout=20)
tn.set_debuglevel(0)
def nt_read(tn):
s = tn.read_until('{')
s += tn.read_ve... |
chirpradio/chirpradio-machine | refs/heads/master | chirp/library/order_test.py | 1 | #!/usr/bin/env python
import unittest
import mutagen.id3
from chirp.library import order
class OrderTest(unittest.TestCase):
def test_decode(self):
test_cases = (("1", 1, None),
(" 6", 6, None),
("006", 6, None),
("1/2", 1, 2),
... |
lepricon49/CouchPotatoServer | refs/heads/master | libs/gntp/shim.py | 123 | # Copyright: 2013 Paul Traylor
# These sources are released under the terms of the MIT license: see LICENSE
"""
Python2.5 and Python3.3 compatibility shim
Heavily inspirted by the "six" library.
https://pypi.python.org/pypi/six
"""
import sys
PY3 = sys.version_info[0] == 3
if PY3:
def b(s):
if isinstance(s, byt... |
cseed/hail | refs/heads/master | hail/python/hailtop/aiogoogle/auth/session.py | 1 | from types import TracebackType
from typing import Optional, Type, TypeVar
import abc
import aiohttp
from hailtop.utils import request_retry_transient_errors, RateLimit, RateLimiter
from .credentials import Credentials
from .access_token import AccessToken
SessionType = TypeVar('SessionType', bound='BaseSession')
cl... |
barbuza/django | refs/heads/master | tests/admin_views/models.py | 110 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.e... |
Pixomondo/rez | refs/heads/master_pxo | src/rez/tests/data/solver/packages/test_variant_split_mid2/2.0/package.py | 5 | name = "test_variant_split_mid2"
version = "2.0"
variants = [["test_variant_split_end-1"], ["test_variant_split_end-3"]]
|
xiaom-GitHub/openthread | refs/heads/master | tools/harness-automation/cases/commissioner_9_2_14.py | 16 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/swirl_prong_hue.py | 85615 | import sys
def setup(core, object):
return |
bfirsh/django-old | refs/heads/master | django/conf/locale/vi/formats.py | 80 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'\N\gà\y d \t\há\n\g n \nă\m Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'H:i:s \N\gà\y d \t\há\n\g n \nă\m Y'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd-m-Y'
SHORT_DATETIM... |
titasakgm/brc-stock | refs/heads/master | openerp/addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/template/defaultfilters.py | 15 | """Default variable filters."""
import re
import random as random_module
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
from django.template import Variable, Library
from django.conf import settings
from django.utils.translation impo... |
JIoJIaJIu/servo | refs/heads/master | tests/jquery/run_jquery.py | 215 | #!/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 os
import re
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
im... |
JohnnyKing94/pootle | refs/heads/master | tests/core/schema.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import json
import pytest
from pootle.core.... |
xen0l/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/vmware.py | 30 | # Copyright: (c) 2016, Charles Paul <cpaul@ansible.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Parameters for VMware modules
DOCUMENTATION = '''
options:
hostname:
descript... |
frederick-masterton/django | refs/heads/master | django/contrib/gis/gdal/datasource.py | 80 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... |
Pandhariix/ARIIA | refs/heads/master | ariia/talk_manager.py | 1 | # -*- coding: utf-8 -*-
from chatterbot import ChatBot
from chatterbot.training.trainers import ListTrainer
class TalkManager:
"""
Class Managing the discussions held by Ariia
and her training.
"""
def __init__(self):
"""
Constructor
"""
self.ariiaTalker = ChatBot("Ariia")
self.talk = None
... |
jimgoo/keras | refs/heads/master | keras/utils/io_utils.py | 61 | from __future__ import absolute_import
import h5py
import numpy as np
from collections import defaultdict
class HDF5Matrix():
refs = defaultdict(int)
def __init__(self, datapath, dataset, start, end, normalizer=None):
if datapath not in list(self.refs.keys()):
f = h5py.File(datapath)
... |
iAmMrinal0/reddit | refs/heads/master | Newsletterbot/newsletterbot.py | 3 | #/u/GoldenSights
import praw # simple interface to the reddit API, also handles rate limiting of requests
import time
import os
import sys
import sqlite3
'''USER CONFIGURATION'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Pass... |
RockySteveJobs/python-for-android | refs/heads/master | python-build/python-libs/xmpppy/xmpp/commands.py | 200 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... |
daegun/mitro | refs/heads/master | browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/__init__.py | 28 | # 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 os
import optparse
import webbrowser
import time
from copy import copy
import simplejson as json
from... |
almcc/cinder-data | refs/heads/master | cinder_data/model.py | 1 | from schematics.models import Model
from schematics.types import DateTimeType, IntType
class CinderModel(Model):
"""A basic model that assumes the model has an id attribute.
Note:
cinder-data makes use of schematics for it's models. Full documentation on Schematics
can be found at: https://sc... |
grap/OpenUpgrade | refs/heads/8.0 | addons/stock_account/stock.py | 43 | # -*- 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... |
MarcosVn/turinginformatica | refs/heads/master | backend/appengine/routes/__init__.py | 181 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
|
lz1988/django-web2015 | refs/heads/master | build/lib/django/utils/baseconv.py | 238 | # Copyright (c) 2010 Guilherme Gondim. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF
# ... |
ikpb/android_kernel_blu_studio6lte | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
vamsirajendra/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/backend_bases.py | 69 | """
Abstract base classes define the primitives that renderers and
graphics contexts must implement to serve as a matplotlib backend
:class:`RendererBase`
An abstract base class to handle drawing/rendering operations.
:class:`FigureCanvasBase`
The abstraction layer that separates the
:class:`matplotlib.fi... |
marcosleonefilho/hoop-tastypie | refs/heads/master | tastypie/bundle.py | 4 | from django.http import HttpRequest
# In a separate file to avoid circular imports...
class Bundle(object):
"""
A small container for instances and converted data for the
``dehydrate/hydrate`` cycle.
Necessary because the ``dehydrate/hydrate`` cycle needs to access data at
different points.
"... |
Senseg/Py4A | refs/heads/master | python3-alpha/python3-src/Lib/cgitb.py | 48 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.