repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
benoitsteiner/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/xent_op_test.py | 77 | # 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... |
rafaelvasco/SpriteMator | refs/heads/master | src/model/resources_cache.py | 1 | # --------------------------------------------------------------------------------------------------
# Name: Resources Cache
# Purpose: Manages application resources;
#
# Author: Rafael Vasco
#
# Created: 12/10/13
# Copyright: (c) Rafael 2013
# Licence: <your licence>
#------------------------... |
Show-Me-the-Code/python | refs/heads/master | sarikasama/0018/0018.py | 6 | #!/usr/bin/env python3
#convert from xls to xml
import xlrd, json
from lxml import etree
from collections import OrderedDict
def xls2xml(xls_name):
with xlrd.open_workbook(xls_name) as wb:
ws = wb.sheet_by_index(0)
table = OrderedDict()
for i in range(ws.nrows):
key = int(ws.row_values(i)[... |
luchy0120/BigDL | refs/heads/master | docs/gen_site.py | 3 | #!/usr/bin/env python
import argparse
import sys
import os
from subprocess import Popen, PIPE
import subprocess
def run_cmd(cmds, err_msg, s=False):
cmd = cmds
if s:
cmd = ' '.join(cmds)
try:
# print cmd
p = Popen(cmd, shell=s)
p.communicate()
if p.returncode != 0:... |
jacquesd/indico-plugins | refs/heads/master | piwik/indico_piwik/reports.py | 1 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
atuljain/odoo | refs/heads/master | addons/website_customer/__init__.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
WillGuan105/django | refs/heads/master | django/test/utils.py | 178 | import logging
import re
import sys
import time
import warnings
from contextlib import contextmanager
from functools import wraps
from unittest import skipIf, skipUnless
from xml.dom.minidom import Node, parseString
from django.apps import apps
from django.conf import UserSettingsHolder, settings
from django.core impo... |
allotria/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/func_after.py | 83 | def foo(*a):
if a
pass<caret> |
cloud-engineering/xfc-email-notifier | refs/heads/master | snippets/snippet_pythin_list.py | 1 | collection = {u'tag:gmail.google.com,2004:1468634828421702221': set([u'me (testing.service.007@gmail.com)', u'Original Message Subject: Welcome to YouTube! Date: Sat, 17 May 2014 14:41:10 +0000']), u'tag:gmail.google.com,2004:1468645322476315753': set([u'dasdasdas -- -- Kind Regards Vipul Hari', u'vipul hari (vipu.hari... |
BlackHole/enigma2-1 | refs/heads/master | lib/python/Components/Renderer/ChannelNumber.py | 74 | from Components.VariableText import VariableText
from enigma import eLabel, iPlayableService
from Renderer import Renderer
class ChannelNumber(Renderer, VariableText):
def __init__(self):
Renderer.__init__(self)
VariableText.__init__(self)
self.text = "---"
GUI_WIDGET = eLabel
def changed(self, what):
if w... |
ikerr/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/dialogs.py | 299 | from bpy import context
CONTEXT = {
0: {
'title': "Error Message",
'icon': 'CANCEL'
},
1: {
'title': "Warning Message",
'icon': 'ERROR' # I prefer this icon for warnings
},
2: {
'title': "Message",
'icon': 'NONE'
},
3: {
'title': "Ques... |
daenamkim/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_snmp_user.py | 14 | #!/usr/bin/python
#
# 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 distribut... |
caio2k/RIDE | refs/heads/master | src/robotide/lib/robot/running/randomizer.py | 27 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
sYnfo/samba | refs/heads/master | third_party/dnspython/dns/rdtypes/ANY/MX.py | 101 | # 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 "... |
cwyark/micropython | refs/heads/master | tests/basics/tuple_mult.py | 18 | # 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)
# unsupported type on RHS
try:
() * None
except TypeError:
p... |
tghosgor/libarmmcu | refs/heads/master | gyp/test/defines/gyptest-defines-env-regyp.py | 268 | #!/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 build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... |
mujiansu/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/propsys/test/testpropsys.py | 35 | from win32com.propsys import propsys, pscon
print "propsys was imported (sorry - that is the extent of the tests,"
print "but see the shell folder_view demo, which uses this module)"
# that's all folks! |
dgarros/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_router.py | 51 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... |
pawaranand/phrerp | refs/heads/develop | erpnext/stock/doctype/item/__init__.py | 37694 | from __future__ import unicode_literals
|
laurendc/scripts | refs/heads/master | check_os_install_bash.py | 1 | #!/usr/bin/python
# Check OS version, install bash update
# Lauren Caliolio 9/30/2014
import platform
import subprocess
OS = platform.mac_ver()[0]
if OS == "10.7.5":
subprocess.call(['/usr/sbin/jamf', 'policy', '-trigger', 'LionBash'])
elif OS == "10.8.5":
subprocess.call(['/usr/sbin/jamf', 'policy', '-trigg... |
MacHu-GWU/angora-project | refs/heads/master | angora/baseclass/classtree.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage example::
>>> from angora.baseclass.classtree import gencode
>>> gencode(data, "example.py")
"""
from __future__ import print_function
import datetime
import sys
import os
try:
from . import nameddict
except SystemError:
from angora.baseclass... |
holmes/intellij-community | refs/heads/master | python/testData/resolve/NestedListComp.py | 83 | lst1 = [[1,2,3],[4,5,6],[7,8,9]]
lst2 = [xx for yy in lst1 for xx in yy]
# <ref>
|
StefanRijnhart/OpenUpgrade | refs/heads/master | addons/payment_adyen/models/adyen.py | 136 | # -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import Adye... |
edxnercel/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/prompt.py | 204 | import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
... |
waltharius/NewsBlur | refs/heads/master | apps/reader/migrations/0001_initial.py | 18 |
from south.db import db
from django.db import models
from apps.reader.models import *
class Migration:
def forwards(self, orm):
# Adding model 'UserSubscription'
db.create_table('reader_usersubscription', (
('id', orm['reader.UserSubscription:id']),
('user', o... |
vmarkovtsev/django | refs/heads/master | django/conf/locale/az/formats.py | 1059 | # -*- 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 E Y г.'
TIME_FORMAT = 'G:i'
DAT... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/celery/celery/tests/test_backends/test_base.py | 18 | from __future__ import absolute_import
from __future__ import with_statement
import sys
import types
from mock import Mock
from nose import SkipTest
from celery.utils import serialization
from celery.utils.serialization import subclass_exception
from celery.utils.serialization import \
find_nearest_pickleabl... |
40223148/finaltest | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/configparser.py | 692 | """Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.
class:
ConfigParse... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/twisted/web/test/test_http_headers.py | 3 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.http_headers}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import TestCase
from twisted.python.compat import _PY3
from twisted.web.http_headers import Headers
class BytesHeadersTe... |
puneetgkaur/sugar | refs/heads/master | src/jarabe/view/cursortracker.py | 13 | # Copyright (C) 2012 One Laptop Per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribu... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/monoprice/const.py | 21 | """Constants for the Monoprice 6-Zone Amplifier Media Player component."""
DOMAIN = "monoprice"
CONF_SOURCES = "sources"
CONF_SOURCE_1 = "source_1"
CONF_SOURCE_2 = "source_2"
CONF_SOURCE_3 = "source_3"
CONF_SOURCE_4 = "source_4"
CONF_SOURCE_5 = "source_5"
CONF_SOURCE_6 = "source_6"
CONF_NOT_FIRST_RUN = "not_first_r... |
Fusion-Rom/android_external_chromium_org | refs/heads/lp5.1 | tools/telemetry/unittest_data/discoverable_classes/another_discover_dummyclass.py | 90 | # 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.
"""More dummy exception subclasses used by core/discover.py's unit tests."""
# Import class instead of module explicitly so that inspect.getmembers() return... |
asorianostratio/incubator-toree | refs/heads/master | etc/pip_install/toree/__init__.py | 11 | #
# 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 us... |
kamenim/samba-old | refs/heads/master | buildtools/wafsamba/samba_python.py | 7 | # waf build tool for building IDL files with pidl
import Build
from samba_utils import *
from samba_autoconf import *
from Configure import conf
@conf
def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,4,2)):
# enable tool to build python extensions
conf.find_program('python', var='PYTHON', mandatory=ma... |
Lekanich/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/schemes.py | 96 | # Copyright 2009, Alexander Solovyov <piranha@piranha.org.ua>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""extend schemes with shortcuts to repository swarms
This extension allows you to specify shortcuts for parent URLs wi... |
sassoftware/rmake | refs/heads/master | rmake_test/functional_test/cmdlinetest/restarttest.py | 2 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
sertac/django | refs/heads/master | django/db/models/sql/compiler.py | 32 | import re
import warnings
from itertools import chain
from django.core.exceptions import FieldError
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import OrderBy, Random, RawSQL, Ref
from django.db.models.query_utils import QueryWrapper, select_related_descend
from django.db.models... |
asadziach/tensorflow | refs/heads/pedestrian_detection_walabot_tf | tensorflow/contrib/distributions/python/kernel_tests/kullback_leibler_test.py | 27 | # 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... |
Eric-Gaudiello/tensorflow_dev | refs/heads/master | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/wheel/signatures/djbec.py | 566 | # Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... |
lwiecek/django | refs/heads/master | django/contrib/sessions/backends/cache.py | 117 | from django.conf import settings
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.cache import caches
from django.utils.six.moves import range
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based sessi... |
google-research/vision_transformer | refs/heads/master | vit_jax/utils.py | 1 | # Copyright 2021 Google LLC.
#
# 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, ... |
olegpshenichniy/Booktype | refs/heads/master | lib/booktype/api/auth.py | 7 | from django.contrib.auth.backends import ModelBackend
from .tokens import token_generator
class Backend(ModelBackend):
"""
Auth Backend to authenticate users with the token genrated via api
"""
def authenticate(self, pk, token):
user = self.get_user(pk)
# if is not a valid user, just ... |
yufengg/tensorflow | refs/heads/master | tensorflow/python/debug/cli/profile_analyzer_cli_test.py | 30 | # 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... |
jeremiahsavage/cwltool | refs/heads/master | cwltool/schemas/draft-3/salad/schema_salad/makedoc.py | 10 | import mistune
import schema
import json
import yaml
import os
import copy
import re
import sys
import StringIO
import logging
import urlparse
from aslist import aslist
import re
import argparse
_logger = logging.getLogger("salad")
def has_types(items):
r = []
if isinstance(items, dict):
if items["typ... |
EconomicSL/housing-model | refs/heads/master | src/main/resources/calibration/code/SaleReprice.py | 2 | # -*- coding: utf-8 -*-
"""
Defines several classes to study the reprice or price decrease behaviour of households trying to sell their houses. It
uses Zoopla data
@author: daniel, Adrian Carro
"""
import Datasets as ds
import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
import scipy.stat... |
wschenck/nest-simulator | refs/heads/master | pynest/examples/brunel_alpha_nest.py | 7 | # -*- coding: utf-8 -*-
#
# brunel_alpha_nest.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Licen... |
ToontownUprising/src | refs/heads/master | toontown/margins/MarginGlobals.py | 3 | # Priorities:
MP_low = 0
MP_normal = 1
MP_high = 2
MP_urgent = 3
def updateMarginVisibles():
messenger.send('MarginVisible-update')
|
dydek/django | refs/heads/master | tests/timezones/tests.py | 10 | from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from contextlib import contextmanager
from unittest import SkipTest, skipIf
from xml.dom.minidom import parseString
from django.contrib.auth.models import User
from django.core import serializers
from django.core.exceptions i... |
deepmind/dm_control | refs/heads/master | dm_control/composer/constants.py | 1 | # Copyright 2018 The dm_control Authors.
#
# 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 i... |
vprime/puuuu | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py | 623 | """
Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOS_VERSION
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the... |
wilsonianb/nacl_contracts | refs/heads/master | src/trusted/validator/driver/ncval_annotate.py | 3 | #!/usr/bin/python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import re
import subprocess
import sys
BUNDLE_SIZE = 32
Error = collections.namedtuple('Error', 'offset me... |
minhphung171093/GreenERP | refs/heads/master | openerp/addons/hw_posbox_upgrade/__openerp__.py | 27 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'PosBox Software Upgrader',
'version': '1.0',
'category': 'Hardware Drivers',
'website': 'https://www.odoo.com/page/point-of-sale',
'sequence': 6,
'summary': 'Allows to remotely upgrade... |
kifcaliph/odoo | refs/heads/8.0 | addons/mrp_byproduct/__openerp__.py | 259 | # -*- 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... |
glaubitz/fs-uae-debian | refs/heads/master | launcher/OpenGL/raw/GL/ARB/instanced_arrays.py | 9 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... |
shin-/compose | refs/heads/master | compose/progress_stream.py | 3 | from __future__ import absolute_import
from __future__ import unicode_literals
from compose import utils
class StreamOutputError(Exception):
pass
def write_to_stream(s, stream):
try:
stream.write(s)
except UnicodeEncodeError:
encoding = getattr(stream, 'encoding', 'ascii')
strea... |
SmartInfrastructures/fuel-web-dev | refs/heads/master | nailgun/nailgun/test/unit/test_task_managers.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... |
pkats15/hdt_analyzer | refs/heads/master | django_test/django_venv/Lib/posixpath.py | 9 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... |
riteshshrv/django | refs/heads/master | tests/m2m_regress/tests.py | 273 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
SelfReferChildSibling, Tag, TagCollection, Worksheet,
)
class M2MRegre... |
80vs90/libsaas | refs/heads/master | test/test_recurly.py | 4 | import unittest
from datetime import date
from libsaas import http, xml
from libsaas.executors import test_executor
from libsaas.services import recurly
class RecurlyTestCase(unittest.TestCase):
def setUp(self):
self.executor = test_executor.use()
self.executor.set_response(
b'<?xml... |
AntonioMtn/NZBMegaSearch | refs/heads/master | requests/packages/charade/charsetgroupprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... |
hunter007/django | refs/heads/master | tests/introspection/tests.py | 207 | from __future__ import unicode_literals
from unittest import skipUnless
from django.db import connection
from django.db.utils import DatabaseError
from django.test import TransactionTestCase, mock, skipUnlessDBFeature
from .models import Article, Reporter
class IntrospectionTests(TransactionTestCase):
availab... |
AWPorter/aima-python | refs/heads/master | submissions/Porter/project/csp.py | 27 | """CSP (Constraint Satisfaction Problems) problems and solvers. (Chapter 6)."""
from utils import argmin_random_tie, count, first
import search
from collections import defaultdict
from functools import reduce
import itertools
import re
import random
class CSP(search.Problem):
"""This class describes finite-do... |
ayepezv/GAD_ERP | refs/heads/master | addons/sale_service_rating/models/__init__.py | 69 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import project
|
s-y/web | refs/heads/master | main/admin.py | 1 | #!/usr/bin/env python
# coding: utf-8
from __future__ import print_function, unicode_literals
from django.contrib import admin
from .forms import *
from .models import *
class NoteAdmin(admin.ModelAdmin):
form = AddNoteForm
admin.site.register(Note, NoteAdmin)
|
drawquest/drawquest-web | refs/heads/master | website/compressor/utils/__init__.py | 4 | # -*- coding: utf-8 -*-
import os
import sys
from compressor.exceptions import FilterError
if sys.version_info < (2, 5):
# Add any http://docs.python.org/library/functions.html?#any to Python < 2.5
def any(seq):
for item in seq:
if item:
return True
return False
el... |
tectronics/wfrog | refs/heads/master | wfrender/test/test.py | 5 | from pygooglechart import Chart
from pygooglechart import _check_colour
from pygooglechart import Axis
from pygooglechart import RadarChart
from pygooglechart import SimpleLineChart
import random, yaml
class Test1(object):
"""
This is a test extension
"""
pass
def random_data(points=16, maximum=100):
... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/__init__.py | 105 | # -*- coding: utf-8 -*-
#
# SelfTest/Random/__init__.py: Self-test for random number generation modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the exten... |
greinerb/mongo-web-shell | refs/heads/master | webapps/lib/db.py | 3 | # Copyright 2013 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/chromium_org/tools/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py | 350 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verify that a hard_dependency that is not exported is not pulled in as a
dependency for a target if the target does not explicitly speci... |
aagusti/e-sipkd | refs/heads/master | esipkd_ori_17012017/scripts/initial_data.py | 1 | import os
import csv
from types import DictType
from sqlalchemy import (
Table,
MetaData,
)
from data.user import UserData
from data.routes import RouteData
from data.apps import AppsData
from data.unit import UnitData
from data.rekening import RekeningData
from data.pajak import PajakData
from data.group i... |
avmelnikoff/RIOT | refs/heads/master | tests/driver_grove_ledbar/tests/01-run.py | 32 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# 2017 Sebastian Meiling <s@mlng.net>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
fr... |
maandree/java-gtk2 | refs/heads/master | src/javagtk2/consts/generate.py | 1 | #!/usr/bin/env python3
# java-gtk2 – GTK+ 2.0 bindings for Java
#
# Copyright © 2013 Mattias Andrée (maandree@member.fsf.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, either version ... |
emaste/binutils-gdb | refs/heads/master | gdb/python/lib/gdb/command/type_printers.py | 28 | # Type printer commands.
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any late... |
gkarlin/django-jenkins | refs/heads/master | build/Django/tests/modeltests/timezones/admin.py | 150 | from __future__ import absolute_import
from django.contrib import admin
from .models import Event, Timestamp
class EventAdmin(admin.ModelAdmin):
list_display = ('dt',)
admin.site.register(Event, EventAdmin)
class TimestampAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
admin.site.registe... |
candy7393/VTK | refs/heads/master | ThirdParty/Twisted/twisted/test/test_factories.py | 34 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test code for basic Factory classes.
"""
from __future__ import division, absolute_import
import pickle
from twisted.trial.unittest import TestCase
from twisted.internet.task import Clock
from twisted.internet.protocol import ReconnectingC... |
IllusionRom-deprecated/android_platform_external_chromium_org_tools_grit | refs/heads/master | grit/gather/chrome_html_unittest.py | 6 | #!/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.
'''Unit tests for grit.gather.chrome_html'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.... |
fedora-conary/rbuild | refs/heads/master | rbuild/__init__.py | 2 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
miscaandrei/django-testapp | refs/heads/master | django/contrib/localflavor/co/forms.py | 196 | """
Colombian-specific form helpers.
"""
from __future__ import absolute_import
from django.contrib.localflavor.co.co_departments import DEPARTMENT_CHOICES
from django.forms.fields import Select
class CODepartmentSelect(Select):
"""
A Select widget that uses a list of Colombian states as its choices.
""... |
evidation-health/bokeh | refs/heads/master | bokeh/server/models/server_model.py | 13 | from __future__ import absolute_import
from bokeh.exceptions import DataIntegrityException, UnauthorizedException
class ServerModel(object):
idfield = None
typename = None
@classmethod
def modelkey(cls, objid):
return "model:%s:%s"% (cls.typename, objid)
def mykey(self):
return s... |
mcking49/apache-flask | refs/heads/master | Python/Lib/site-packages/sqlalchemy/orm/dependency.py | 55 | # orm/dependency.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Relationship dependencies.
"""
from .. import sql, util, exc as sa_exc
from .... |
SRabbelier/Melange | refs/heads/master | app/soc/modules/gsoc/views/program.py | 1 | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... |
sauloal/cnidaria | refs/heads/master | scripts/venv/lib/python2.7/site-packages/cogent/parse/genbank.py | 1 | #!/usr/bin/env python
from cogent.parse.record import FieldWrapper
from cogent.parse.record_finder import DelimitedRecordFinder, \
LabeledRecordFinder
from cogent.core.genetic_code import GeneticCodes
from string import maketrans, strip, rstrip
from cogent.core.moltype import PROTEIN, DNA, ASCII
from cogent.core.an... |
gcd0318/django | refs/heads/master | tests/model_package/models/article.py | 522 | from django.db import models
class Site(models.Model):
name = models.CharField(max_length=100)
class Article(models.Model):
sites = models.ManyToManyField(Site)
headline = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", blank=True)
|
chevah/python-cffi | refs/heads/master | demo/_curses_setup.py | 12 | from setuptools import setup
setup(
name="_curses",
version="0.1",
py_modules=["_curses"],
setup_requires=["cffi>=1.0.dev0"],
cffi_modules=[
"_curses_build.py:ffi",
],
install_requires=["cffi>=1.0.dev0"], # should maybe be "cffi-backend" only?
zip_safe=False,
)
|
gpapakyriakopoulos/PyFlask | refs/heads/master | pyflask/lib/python2.7/distutils/__init__.py | 1211 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... |
pdehaye/theming-edx-platform | refs/heads/master | common/lib/xmodule/xmodule/abtest_module.py | 4 | import random
import logging
from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xmodule.xml_module import XmlDescriptor
from xmodule.exceptions import InvalidDefinitionError
from xblock.core import String, Scope, Dict
DEFAULT = "_DEFAULT_GROUP"
log = loggin... |
mpasternak/michaldtz-fix-552 | refs/heads/master | contrib/layout/examples/interpreter.py | 29 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from code import InteractiveInterpreter
import sys
from pyglet.gl import *
from pyglet.window import Window
from pyglet.window import key
from pyglet import clock
from layout import *
data = '''<?xml version="1.0"?>
<html>
<he... |
ijat/Hotspot-PUTRA-Auto-login | refs/heads/master | PyInstaller-3.2/PyInstaller/hooks/hook-certifi.py | 1 | #-----------------------------------------------------------------------------
# Copyright (c) 2014-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
voidException/zulip | refs/heads/master | zilencer/management/commands/populate_db.py | 114 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from django.contrib.sites.models import Site
from zerver.models import Message, UserProfile, Stream, Recipient, Client, \
Subscription, Huddle, get_huddle, Realm, UserMessage, \
get... |
mattbernst/polyhartree | refs/heads/master | support/ansible/modules/core/cloud/amazon/ec2_elb_lb.py | 13 | #!/usr/bin/python
# 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 distributed... |
roadmapper/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_log_syslogd2_filter.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
HelloLily/hellolily | refs/heads/develop | lily/settings/settings.py | 1 | import logging.config
import os
import random
import string
from datetime import datetime, timedelta
from urlparse import urlparse, uses_netloc
import chargebee
import dj_database_url
import raven
from django.conf import global_settings
################################################################################... |
balloob/home-assistant | refs/heads/dev | homeassistant/components/nexia/scene.py | 10 | """Support for Nexia Automations."""
from typing import Any
from homeassistant.components.scene import Scene
from homeassistant.helpers.event import async_call_later
from .const import ATTR_DESCRIPTION, DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR
from .entity import NexiaEntity
SCENE_ACTIVATION_TIME = 5
async def as... |
benjaminabel/pelican-plugins | refs/heads/master | better_codeblock_line_numbering/__init__.py | 68 | from .better_codeblock_line_numbering import *
|
Molecular-Image-Recognition/Molecular-Image-Recognition | refs/heads/master | code/rmgpy/molecule/generator.py | 1 | ################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... |
PyRsw/PyRsw | refs/heads/master | src/Plot_tools/smart_time.py | 1 | # Helper for formatting time strings
def smart_time(t):
tstr = 't = '
if t < 2*60.:
tstr += '{0:.4f} sec'.format(t)
elif t < 90.*60:
tstr += '{0:.4f} min'.format(t/60)
elif t < 48.*60*60:
tstr += '{0:.4f} hrs'.format(t/(60*60))
else:
tstr += '{0:.4f} day'.format(t/(2... |
GREO/gnuradio-git | refs/heads/master | volk/include/volk/make_c.py | 2 | from xml.dom import minidom
import string
from volk_regexp import *
def make_c(funclist, taglist, arched_arglist, retlist, my_arglist, fcountlist) :
tempstring = "";
tempstring = tempstring + '/*this file is auto generated by volk_register.py*/';
tempstring = tempstring + '\n\n#include<volk/volk.h>\n';
... |
popazerty/bnigma2 | refs/heads/master | lib/python/Components/PluginList.py | 10 | from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
from enigma import eListboxPythonMultiContent, gFont
from Tools.LoadPixmap import LoadPixmap
def PluginEntryComponent(plugin, width... |
kevalds51/sympy | refs/heads/master | sympy/polys/solvers.py | 78 | """Low-level linear systems solver. """
from __future__ import print_function, division
from sympy.matrices import Matrix, zeros
class RawMatrix(Matrix):
_sympify = staticmethod(lambda x: x)
def eqs_to_matrix(eqs, ring):
"""Transform from equations to matrix form. """
xs = ring.gens
M = zeros(len(eq... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/conf/project_template/project_name/settings.py | 82 | """
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.