repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
liqi328/rjrepaircompany | refs/heads/master | django/contrib/comments/managers.py | 417 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
class CommentManager(models.Manager):
def in_moderation(self):
"""
QuerySet for all comments currently in the moderation queue.
"""
return self.ge... |
miguelinux/vbox | refs/heads/master | src/VBox/ValidationKit/testmanager/batch/virtual_test_sheriff.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id: virtual_test_sheriff.py $
# pylint: disable=C0301
"""
Virtual Test Sheriff.
Duties:
- Try to a assign failure reasons to recently failed tests.
- Reboot or disable bad test boxes.
"""
__copyright__ = \
"""
Copyright (C) 2012-2016 Oracle Corporation
This ... |
emonty/ansible | refs/heads/devel | lib/ansible/inventory/data.py | 43 | # (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, or
# (at your option) an... |
Fuzion24/androguard | refs/heads/master | androguard/core/bytecode.py | 14 | # This file is part of Androguard.
#
# Copyright (C) 2012/2013, Anthony Desnos <desnos at t0t0.fr>
# 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.a... |
opendoor/django-gather | refs/heads/master | gather/migrations/0012_auto__add_field_location_slug.py | 2 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Location.slug'
db.add_column('gather_location', 'slug',
self.gf('djang... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/src/Lib/test/test_pyexpat.py | 51 | # XXX TypeErrors on calling handlers, or on bad return values from a
# handler, are obscure and unhelpful.
import StringIO, sys
import unittest
import pyexpat
from xml.parsers import expat
from test.test_support import sortdict, run_unittest
class SetAttributeTest(unittest.TestCase):
def setUp(self):
s... |
flipreverse/systemtap-android-src | refs/heads/android | scripts/kprobes_test/kprobes_test.py | 15 | #!/usr/bin/python
# Copyright (C) 2010 Red Hat Inc.
#
# This file is part of systemtap, and is free software. You can
# redistribute it and/or modify it under the terms of the GNU General
# Public License (GPL); either version 2, or (at your option) any
# later version.
import os
import pickle
import re
import sys
... |
jones139/ChEWS | refs/heads/master | svgwrite/data/svgparser.py | 3 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: svgparser using pyparser
# Created: 16.10.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
# depends on: pyparsing.py by Paul T. McGuire - http://pyparsing.wikispaces.com/
__all__ = ["is_valid_transferlist", "is_valid_pa... |
renegelinas/mi-instrument | refs/heads/master | mi/dataset/driver/ctdpf_ckl/wfp/test/test_ctdpf_ckl_wfp_telemetered_driver.py | 5 |
from mi.core.log import get_logger
import unittest
import os
from mi.dataset.driver.wc_wm.cspp.wc_wm_cspp_telemetered_driver import parse
from mi.dataset.driver.ctdpf_ckl.wfp.resource import RESOURCE_PATH
from mi.dataset.dataset_driver import ParticleDataHandler
__author__ = 'mworden'
log = get_logger()
class D... |
isrohutamahopetechnik/MissionPlanner | refs/heads/master | Lib/lib2to3/fixes/fix_set_literal.py | 61 | """
Optional fixer to transform set() calls to set literals.
"""
# Author: Benjamin Peterson
from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms
class FixSetLiteral(fixer_base.BaseFix):
BM_compatible = True
explicit = True
PATTERN = """power< 'set' traile... |
garncarz/dns-server | refs/heads/master | dns/tests/test_redirection.py | 1 | from django.test import TestCase
from dns import models
class RedirectionTestCase(TestCase):
def test_redirection(self):
url = 'https://vietcong1.eu'
models.Redirection.objects.create(abbr='vc', target=url)
resp = self.client.get('/links/vc')
self.assertRedirects(resp, url, fet... |
suitai/MyTweetApp | refs/heads/master | bin/download.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
import getopt
import urllib2
def download(url, out_dir, overwrite=False):
file_name = url.split('/')[-1]
out_dir = os.path.expanduser(out_dir)
out_dir = os.path.expandvars(out_dir)
out_file = "%s/%s" % (out_dir, file_name)
if not o... |
ivoflipse/devide | refs/heads/master | snippets/changeObjectsLUT.py | 7 | # snippet to change the LookupTables (colourmaps) of the selected objects
# this should be run in the introspection context of a slice3dVWR
# $Id$
import os
import tempfile
import vtk
className = obj.__class__.__name__
if className == 'slice3dVWR':
# find all polydata objects
so = obj._tdObjects._getSelecte... |
g-vidal/upm | refs/heads/master | examples/python/aeotecdsb09104.py | 6 | #!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# witho... |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/localflavor/us/models.py | 47 | from django.db import models
from django.contrib.localflavor.us.models import USStateField
# When creating models you need to remember to add a app_label as
# 'localflavor', so your model can be found
class USPlace(models.Model):
state = USStateField(blank=True)
state_req = USStateField()
state_default = ... |
marckuz/django | refs/heads/master | tests/datetimes/__init__.py | 12133432 | |
anaran/olympia | refs/heads/master | scripts/__init__.py | 12133432 | |
manassolanki/erpnext | refs/heads/develop | erpnext/hr/doctype/driving_license_category/__init__.py | 12133432 | |
angelapper/odoo | refs/heads/9.0 | addons/product_extended/product_extended.py | 24 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields
from openerp.osv import osv
class product_template(osv.osv):
_name = 'product.template'
_inherit = 'product.template'
def compute_price(self, cr, uid, product_ids, template_ids=False, recursive=Fal... |
mengxn/tensorflow | refs/heads/master | tensorflow/python/estimator/model_fn_test.py | 42 | # 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... |
psi4/DatenQM | refs/heads/master | qcfractal/alembic/versions/30fd8253d87f_kvstore_compress.py | 1 | """Compression of KVStore
Revision ID: 30fd8253d87f
Revises: 1604623c481a
Create Date: 2020-08-30 10:11:57.574292
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "30fd8253d87f"
down_revision = "1604623c481a"
branch_labe... |
pariahsoft/Dennis | refs/heads/master | commands/help.py | 1 | ########################################
## Adventure Bot "Dennis" ##
## commands/help.py ##
## Copyright 2012-2013 PariahSoft LLC ##
########################################
## **********
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software... |
AlexRobson/scikit-learn | refs/heads/master | examples/linear_model/plot_iris_logistic.py | 283 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logistic Regression 3-class Classifier
=========================================================
Show below is a logistic-regression classifiers decision boundaries on the
`iris <http://en.wikipedia.org/wiki/Iris_f... |
iglpdc/nipype | refs/heads/master | nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py | 12 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..brains import BRAINSEyeDetector
def test_BRAINSEyeDetector_inputs():
input_map = dict(args=dict(argstr='%s',
),
debugDir=dict(argstr='--debugDir %s',
),
environ=dict(nohash=True,
usedefault=True,... |
thomazs/geraldo | refs/heads/master | site/newsite/site-geraldo/django/utils/text.py | 15 | import re
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.translation import ugettext_lazy
from htmlentitydefs import name2codepoint
# Capitalizes the first letter of a string.
capfirst = lambda x: x and force_unicode(x)[... |
dfm/arxiv2speech | refs/heads/master | arxiv2speech.py | 1 | #!/usr/bin/env python
from __future__ import print_function, absolute_import, unicode_literals
__all__ = ["run"]
__version__ = "0.0.4"
__author__ = "Dan Foreman-Mackey (danfm@nyu.edu)"
__copyright__ = "Copyright 2013 Daniel Foreman-Mackey"
__contributors__ = []
import os
import re
import json
import shutil
import s... |
drrelyea/SPGL1_python_port | refs/heads/master | spgl1/__init__.py | 1 | from .spgl1 import *
from .lsqr import lsqr
try:
from .version import version as __version__
except ImportError:
__version__ = '0.0.0' |
mcauser/micropython | refs/heads/master | tests/extmod/ure_sub_unmatched.py | 15 | # test re.sub with unmatched groups, behaviour changed in CPython 3.5
try:
import ure as re
except ImportError:
try:
import re
except ImportError:
print("SKIP")
raise SystemExit
try:
re.sub
except AttributeError:
print("SKIP")
raise SystemExit
# first group matches, se... |
saukrIppl/seahub | refs/heads/master | thirdpart/Django-1.8.10-py2.7.egg/django/conf/locale/bn/formats.py | 575 | # -*- 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 = 'g:i A'
# D... |
chrisndodge/edx-platform | refs/heads/master | common/djangoapps/student/tests/test_certificates.py | 22 | """Tests for display of certificates on the student dashboard. """
import unittest
import ddt
import mock
from django.conf import settings
from django.core.urlresolvers import reverse
from mock import patch
from django.test.utils import override_settings
from xmodule.modulestore import ModuleStoreEnum
from xmodule.m... |
alexdglover/shill-isms | refs/heads/master | venv/lib/python2.7/site-packages/wheel/pkginfo.py | 565 | """Tools for reading and writing PKG-INFO / METADATA without caring
about the encoding."""
from email.parser import Parser
try:
unicode
_PY3 = False
except NameError:
_PY3 = True
if not _PY3:
from email.generator import Generator
def read_pkg_info_bytes(bytestr):
return Parser().pars... |
xq262144/hue | refs/heads/master | desktop/core/src/desktop/management/commands/create_user_directories.py | 8 |
# adapted from django-extensions (http://code.google.com/p/django-command-extensions/)
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to y... |
grangier/django-11599 | refs/heads/master | tests/modeltests/pagination/__init__.py | 12133432 | |
huangchuchuan/Spider | refs/heads/master | OopSpider/oop/oop/__init__.py | 12133432 | |
codeforamerica/template-maker | refs/heads/master | template_maker/builder/__init__.py | 12133432 | |
hrayr-artunyan/shuup | refs/heads/master | shuup_tests/admin/fixtures/__init__.py | 12133432 | |
ewitz/PhotoHaus | refs/heads/master | venv/lib/python2.7/site-packages/wtforms/ext/appengine/db.py | 228 | """
Form generation utilities for App Engine's ``db.Model`` class.
The goal of ``model_form()`` is to provide a clean, explicit and predictable
way to create forms based on ``db.Model`` classes. No malabarism or black
magic should be necessary to generate a form for models, and to add custom
non-model related fields: ... |
akosyakov/intellij-community | refs/heads/master | python/testData/inspections/suppress/suppressOutsideInjection.py | 71 | # noinspection PyUnresolvedReferences
#language=Python
print "print xxx" |
jmeridth/myansible | refs/heads/main | roles/irc/files/.weechat/python/autoload/completion.py | 3 | # -*- coding: utf-8 -*-
###
# Copyright (c) 2010 by Elián Hanisch <lambdae2@gmail.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) an... |
coin-or/GiMPy | refs/heads/master | test/test_strong_components.py | 1 | from __future__ import print_function
from gimpy import Graph, DIRECTED_GRAPH
def generate_test_instance1():
g = Graph(type=DIRECTED_GRAPH, display='pygame')
g.add_edge(0,1)
g.add_edge(1,2)
g.add_edge(2,0)
g.add_edge(2,3)
g.add_edge(3,4)
g.add_edge(5,6)
g.add_edge(6,7)
g.add_edge(7,... |
Chilledheart/chromium | refs/heads/master | tools/telemetry/telemetry/internal/browser/possible_browser.py | 24 | # Copyright 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.
from telemetry.internal.app import possible_app
class PossibleBrowser(possible_app.PossibleApp):
"""A browser that can be controlled.
Call Create() to... |
PermutaTriangle/PermStruct | refs/heads/master | examples/classical_7x4/1243_1324_1342_1423_1432_2143_2314_3124.py | 1 | from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag
import sys
is_classical = True
# STATUS ================================================ >
patts = map(Permutation, [[1,2,4,3], [1,3,2,4], [1,3,4,2], [1,4... |
Grirrane/odoo | refs/heads/master | openerp/addons/base/tests/test_res_config.py | 398 | import unittest2
import openerp
import openerp.tests.common as common
class test_res_config(common.TransactionCase):
def setUp(self):
super(test_res_config, self).setUp()
self.res_config = self.registry('res.config.settings')
# Define the test values
self.menu_xml_id = 'base.menu... |
kreatorkodi/repository.torrentbr | refs/heads/master | script.module.urlresolver/lib/urlresolver/hmf.py | 6 | """
URLResolver Addon for Kodi
Copyright (C) 2016 t0mm0, tknorris
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) any late... |
BizzCloud/PosBox | refs/heads/master | addons/hr_recruitment/wizard/__init__.py | 381 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
OptimusGitEtna/RestSymf | refs/heads/master | Python-3.4.2/Lib/test/test_list.py | 90 | import sys
from test import support, list_tests
import pickle
class ListTest(list_tests.CommonTest):
type2test = list
def test_basic(self):
self.assertEqual(list([]), [])
l0_3 = [0, 1, 2, 3]
l0_3_bis = list(l0_3)
self.assertEqual(l0_3, l0_3_bis)
self.assertTrue(l0_3 is ... |
catapult-project/catapult | refs/heads/master | telemetry/telemetry/timeline/__init__.py | 12133432 | |
anhaidgroup/py_entitymatching | refs/heads/master | py_entitymatching/blocker/__init__.py | 12133432 | |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/resolve_url/__init__.py | 12133432 | |
aaronkurtz/gourmand | refs/heads/master | gourmand/branding/tests.py | 1 | from django.contrib.auth.models import User
from django.test import TestCase, Client
class BrandingTest(TestCase):
def test_frontpage(self):
pw = 'p@ssw0rd'
user = User.objects.create_user(username='user', email='email@example.com', password=pw)
self.client = Client()
response = se... |
fxia22/ASM_xf | refs/heads/master | PythonD/site_python/twisted/scripts/tkmktap.py | 2 |
# Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in th... |
mistercrunch/airflow | refs/heads/master | tests/test_utils/salesforce_system_helpers.py | 10 | # 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... |
delinhabit/django | refs/heads/master | tests/template_tests/urls.py | 153 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import include, url
from . import views
ns_patterns = [
# Test urls for testing reverse lookups
url(r'^$', views.index),
url(r'^client/([0-9,]+)/$', views.client),
url(r'^client/(?P<id>[0-9]+)/(?P<action>[^/]+)/$', ... |
wdv4758h/ZipPy | refs/heads/master | lib-python/3/lib2to3/fixes/fix_standarderror.py | 203 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for StandardError -> Exception."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixStandarderror(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
... |
djfye/RocketMap | refs/heads/develop | pogom/__init__.py | 186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
|
willingc/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/i18n/other/__init__.py | 12133432 | |
chriha/GistTerminal | refs/heads/master | libs/__init__.py | 12133432 | |
adamwiggins/cocos2d | refs/heads/master | samples/demo_transitions.py | 4 | #
# cocos2d
# http://cocos2d.org
#
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from cocos.director import director
from cocos.layer import Layer, ColorLayer
from cocos.scene import Scene
from cocos.scenes.transitions import *
from cocos.actions import *
from cocos.sprite impo... |
batiste/django-page-cms | refs/heads/master | pages/testproj/documents/views.py | 1 | from django.shortcuts import render
from pages.testproj.documents.models import Document
def document_view(request, *args, **kwargs):
context = kwargs
if kwargs.get('current_page', False):
documents = Document.objects.filter(page=kwargs['current_page'])
context['documents'] = documents
if ... |
RX14/autokey | refs/heads/master | src/lib/common.py | 47 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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) any late... |
jnbek/update_mirrors | refs/heads/master | update_mirrors.py | 1 | #!/usr/bin/env python
import os
import shlex
import subprocess
import multiprocessing
mirrors = {
'pacbsd' : {
'args' : '-azzrpP --delete',
'url' : 'rsync.pacbsd.org::Repository',
},
'cpan' : {
'args' : '-arpP --delete',
'url' : 'cpan-rsync.perl.org::CPAN',
},
'gn... |
jdnz/qml-rg | refs/heads/master | Meeting 7/image_loader_and_encoder.py | 2 | import math
import os
from skimage import io
from skimage import transform as tf
from matplotlib import pyplot as plt
from skimage.transform import resize
import numpy as np
"""This code loads the images from the APS capture and encodes them with a neural network
in a lower dimensional vector.
For 20 hidden layers and ... |
zahari/samba | refs/heads/master | selftest/tests/__init__.py | 13 | # __init__.py -- The tests for selftest
# Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
#
# 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 3
# of the License or (at your option) a... |
TheWylieStCoyote/gnuradio | refs/heads/master | gnuradio-runtime/examples/mp-sched/synthetic.py | 3 | #!/usr/bin/env python
#
# Copyright 2008,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr, eng_notation
from gnur... |
aldanopolis/android_kernel_motorola_msm8226 | refs/heads/cm-14.1 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
SatrioDwiPrabowo/Android_Alexa_Kernel_Nicki | refs/heads/master | tools/perf/scripts/python/net_dropmonitor.py | 4235 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
adrientetar/robofab | refs/heads/python3-ufo3 | Scripts/RoboFabIntro/demo_GlyphMath.py | 9 | #FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
condensedLight = f["a#condensed_light"]
wideLight = f["a#wi... |
jocke-l/blues | refs/heads/master | blues/postgres.py | 2 | """
Postgres Blueprint
==================
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.postgres
settings:
postgres:
version: 9.3 # PostgreSQL version (required)
schemas:
some_schema_name: # The schema name
user: foo ... |
brokenjacobs/ansible | refs/heads/devel | test/units/module_utils/basic/test_deprecate_warn.py | 62 | # -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
RHInception/re-core | refs/heads/master | test/test_steps.py | 2 | # Copyright (C) 2014 SEE AUTHORS FILE
#
# This program 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distr... |
joopert/home-assistant | refs/heads/dev | homeassistant/components/maxcube/climate.py | 4 | """Support for MAX! Thermostats via MAX! Cube."""
import logging
import socket
from maxcube.device import (
MAX_DEVICE_MODE_AUTOMATIC,
MAX_DEVICE_MODE_MANUAL,
MAX_DEVICE_MODE_VACATION,
MAX_DEVICE_MODE_BOOST,
)
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.cli... |
samapriya/External.Asset-EE.Pipeline | refs/heads/master | gee_asset_manager/batch_remover.py | 3 | import fnmatch
import logging
import sys
import ee
def delete(asset_path):
root = asset_path[:asset_path.rfind('/')]
all_assets_names = [e['id'] for e in ee.data.getList({'id': root})]
filtered_names = fnmatch.filter(all_assets_names, asset_path)
if not filtered_names:
logging.warning('Nothin... |
yakky/django | refs/heads/master | django/conf/locale/da/__init__.py | 12133432 | |
reyrodrigues/EU-SMS | refs/heads/master | temba/msgs/migrations/0027_create_outgoing_indexes.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
# language=SQL
CREATE_SQL = """
DROP INDEX IF EXISTS msgs_msg_org_failed_created_on;
DROP INDEX IF EXISTS msgs_msg_sent_label;
DROP INDEX IF EXISTS msgs_msg_outbox_label;
DROP INDEX IF EXISTS msgs_msg_failed_label;
CREAT... |
krischer/python-future | refs/heads/master | src/future/backports/email/mime/audio.py | 82 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ['MIMEAudio']
import sndhdr
fro... |
buckets1337/MotherMUD | refs/heads/master | passlib/utils/pbkdf2.py | 23 | """passlib.pbkdf2 - PBKDF2 support
this module is getting increasingly poorly named.
maybe rename to "kdf" since it's getting more key derivation functions added.
"""
#=============================================================================
# imports
#==============================================================... |
tedi3231/openerp | refs/heads/master | build/lib/openerp/addons/stock_no_autopicking/__init__.py | 69 | # -*- 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... |
alextruberg/custom_django | refs/heads/master | tests/staticfiles_tests/urls/default.py | 176 | from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
)
|
asi1024/competitive-library | refs/heads/master | cpp/docs/title.py | 2 | #!/usr/bin/env python
import collections
import json
import os
max_src_len = 3
def category(path, name, verifier):
def ext(fname):
return fname.split('.')[-1]
def extract_ext(fname):
return '.'.join(fname.split('.')[:-1])
def get_relpath(path, start):
return os.path.normpath(... |
tfroehlich82/erpnext | refs/heads/develop | erpnext/non_profit/doctype/chapter/chapter.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
class Chapter(WebsiteGenerator):
_website = frappe._dict(
... |
stickyd/libgdx | refs/heads/master | extensions/gdx-freetype/jni/freetype-2.5.5/src/tools/glnames.py | 360 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LI... |
miky-kr5/Super-HUGS-Revolution-98 | refs/heads/master | particle.py | 2 | ############################################
# Created on 1-10-2013. Miguel Angel Astor #
############################################
import math
import random
import pygame
import math_utils
import imloader
class Particle(pygame.sprite.Sprite):
def __init__(self, lifespan, scale, texture, gravity = [0.0, 9.8],... |
alexthered/kienhoc-platform | refs/heads/master | lms/djangoapps/foldit/migrations/0001_initial.py | 114 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Score'
db.create_table('foldit_score', (
('id', self.gf('django.db.models.fields... |
jeffmahoney/supybot | refs/heads/urlsnarfer | test/test_dynamicScope.py | 15 | ###
# Copyright (c) 2005, Jeremiah Fincher
# 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 conditi... |
petrvanblokland/Xierpa3 | refs/heads/master | xierpa3/__init__.py | 14 | # -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
# xierpa server
# Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com
#
# X I E R P A 3
# Distribution by the MIT License.
#
# -----------------------------------------------------------... |
clovis/PhiloLogic4 | refs/heads/master | www/scripts/get_text_object.py | 2 | #!/usr/bin/env python3
import json
import os
from wsgiref.handlers import CGIHandler
from philologic.runtime.DB import DB
from philologic.runtime.HitWrapper import ObjectWrapper
from philologic.runtime import generate_text_object
import sys
sys.path.append("..")
import custom_functions
try:
from custom_functio... |
tai271828/courses | refs/heads/master | cs/udacity/cs101-intro-cs/code/lesson5/problem-set/refactoring_hashtable.py | 4 | # 6. In video 28. Update, it was suggested that some of the duplicate code in
# lookup and update could be avoided by a better design. We can do this by
# defining a procedure that finds the entry corresponding to a given key, and
# using that in both lookup and update.
# Here are the original procedures:
def hashta... |
joequery/django | refs/heads/master | tests/field_subclassing/models.py | 252 | """
Tests for field subclassing.
"""
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from .fields import JSONField, Small, SmallerField, SmallField
@python_2_unicode_compatible
class MyModel(models.Model):
name = models.CharField(max_length=10)
data = Sm... |
freedomtan/tensorflow | refs/heads/master | tensorflow/python/data/experimental/benchmarks/matching_files_benchmark.py | 16 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cwisecarver/osf.io | refs/heads/develop | scripts/figshare/__init__.py | 12133432 | |
emedinaa/contentbox | refs/heads/master | third_party/social/tests/backends/__init__.py | 12133432 | |
deployed/django | refs/heads/master | django/contrib/sessions/management/__init__.py | 12133432 | |
nvoron23/statsmodels | refs/heads/master | statsmodels/robust/tests/__init__.py | 12133432 | |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/pyasn1/type/base.py | 20 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import sys
from pyasn1.type import constraint, tagmap, tag
from pyasn1 import error
__all__ = ['Asn1Item', 'Asn1ItemBase', 'AbstractSimpleAsn1Item', 'AbstractConstructe... |
open-synergy/event | refs/heads/8.0 | event_contact/__openerp__.py | 1 | # -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Event Contacts',
'version': '8.0.1.0.0',
'summary': 'Add contacts to event and event type',
'author': 'OpenSynergy Indonesia, '
'Antiun Ingeniería S.L., '... |
radio-astro-tools/pvextractor | refs/heads/master | pvextractor/geometry/slices.py | 9 | import numpy as np
from .line_slices import extract_line_slice
from .poly_slices import extract_poly_slice
def extract_slice(cube, path, spacing=1.0, order=3, respect_nan=True,
wcs=None):
"""
Given an array with shape (z, y, x), extract a (z, n) slice from a path
with ``n`` segments.
... |
mquandalle/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/actions-multiple/gyptest-all.py | 345 | #!/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.
"""
Verifies two actions can be attached to the same input files.
"""
import sys
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('a... |
amisrs/angular-flask | refs/heads/master | angular_flask/lib/python2.7/site-packages/yaml/loader.py | 672 |
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from reader import *
from scanner import *
from parser import *
from composer import *
from constructor import *
from resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.... |
manazhao/tf_recsys | refs/heads/r1.0 | tensorflow/contrib/framework/python/framework/experimental.py | 179 | # 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... |
project-magpie/enigma2-openpli | refs/heads/master | lib/python/Plugins/SystemPlugins/FastScan/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.