repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
postrational/django | refs/heads/master | django/contrib/humanize/tests.py | 4 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
from django.contrib.humanize.templatetags import humanize
from django.template import Template, Context, defaultfilters
from django.test import ... |
studio666/gnuradio | refs/heads/master | gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py | 344 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
import compound
import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(se... |
robertmattmueller/sdac-compiler | refs/heads/master | sympy/physics/vector/tests/__init__.py | 12133432 | |
AmrThabet/CouchPotatoServer | refs/heads/master | libs/oauth2/clients/__init__.py | 12133432 | |
OndrejIT/pyload | refs/heads/stable | module/lib/__init__.py | 12133432 | |
android-ia/platform_external_chromium_org | refs/heads/master | media/tools/layout_tests/test_expectations_history_unittest.py | 156 | #!/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.
from datetime import datetime
import calendar
import unittest
from test_expectations_history import TestExpectationsHistory
cl... |
xin3liang/platform_external_chromium_org | refs/heads/master | third_party/cython/src/pyximport/__init__.py | 110 | from pyximport import *
# replicate docstring
from pyximport import __doc__
|
marcosbontempo/inatelos | refs/heads/master | poky-daisy/scripts/lib/bsp/__init__.py | 3 | #
# Yocto BSP tools library
#
# Copyright (c) 2012, Intel Corporation.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
souravbadami/zulip | refs/heads/master | zerver/webhooks/transifex/tests.py | 25 | # -*- coding: utf-8 -*-
from typing import Any, Dict, Text
from zerver.lib.test_classes import WebhookTestCase
class TransifexHookTests(WebhookTestCase):
STREAM_NAME = 'transifex'
URL_TEMPLATE = u"/api/v1/external/transifex?stream={stream}&api_key={api_key}&{data_template}"
URL_DATA_TEMPLATE = "project={pr... |
Distrotech/bzr | refs/heads/distrotech-bzr | bzrlib/plugins/changelog_merge/tests/test_changelog_merge.py | 2 | # Copyright (C) 2011 by Canonical 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... |
shravan-achar/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/standalonetemplate.py | 203 | #! /usr/bin/env python
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# a fully functional basic pytest script.
#
# Pyt... |
marqueedev/django | refs/heads/master | tests/logging_tests/views.py | 342 | from __future__ import unicode_literals
from django.core.exceptions import DisallowedHost, SuspiciousOperation
def suspicious(request):
raise SuspiciousOperation('dubious')
def suspicious_spec(request):
raise DisallowedHost('dubious')
|
jmighion/ansible | refs/heads/devel | lib/ansible/modules/cloud/docker/docker_image.py | 28 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... |
mayblue9/scikit-learn | refs/heads/master | sklearn/decomposition/online_lda.py | 17 | """
=============================================================
Online Latent Dirichlet Allocation with variational inference
=============================================================
This implementation is modified from Matthew D. Hoffman's onlineldavb code
Link: http://www.cs.princeton.edu/~mdhoffma/code/onli... |
ShinyROM/android_external_chromium_org | refs/heads/master | tools/perf/measurements/startwithurl.py | 23 | # 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.
from measurements import startup
from metrics import startup_metric
class StartWithUrl(startup.Startup):
"""Measures Chromium's startup performance when s... |
HybridF5/nova | refs/heads/master | nova/tests/unit/virt/test_virt_drivers.py | 6 | # Copyright 2010 OpenStack Foundation
#
# 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... |
CoherentLabs/depot_tools | refs/heads/master | third_party/boto/ses/__init__.py | 72 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Harry Marr http://hmarr.com/
#
# 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
# wit... |
donspaulding/adspygoogle | refs/heads/master | examples/adspygoogle/dfp/v201203/get_order.py | 2 | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
PetePriority/home-assistant | refs/heads/dev | homeassistant/components/zha/core/helpers.py | 1 | """
Helpers for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
import logging
from .const import (
DEFAULT_BAUDRATE, REPORT_CONFIG_MAX_INT, REPORT_CONFIG_MIN_INT,
REPORT_CONFIG_RPT_CHANGE, RadioTy... |
attm2x/m2x-python | refs/heads/master | m2x/tests/common.py | 1 | from m2x.client import M2XClient
from m2x.api import APIBase, Response
class DummyResponse(Response):
def __init__(self, response):
super(DummyResponse, self).__init__(
response=response,
raw=response,
status=response.status_code,
headers=response.headers,
... |
rednach/krill | refs/heads/master | test/test_freshness.py | 18 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... |
eddiel/Play | refs/heads/master | applications/welcome/languages/uk.py | 134 | # coding: utf8
{
'!langcode!': 'uk',
'!langname!': 'Українська',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць.',
'%d d... |
acsone/website | refs/heads/8.0 | website_backend_views/__init__.py | 71 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
mwarkentin/django-watchman | refs/heads/master | sample_project/sample_project/wsgi.py | 2 | """
WSGI config for sample_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJAN... |
ravello/ansible | refs/heads/devel | v2/samples/multi_queues.py | 38 | #!/usr/bin/env python
import sys
import time
import Queue
import traceback
import multiprocessing
from ansible.inventory import Inventory
from ansible.inventory.host import Host
from ansible.playbook.play import Play
from ansible.playbook.task import Task
from ansible.executor.connection_info import ConnectionInforma... |
happeninghq/happening | refs/heads/master | src/events/migrations/0003_migrate_locations.py | 2 | from __future__ import unicode_literals
from django.db import migrations
def migrate_locations(apps, schema_editor):
# {"city": "", "country": "", "longitude": "", "latitude": "", "state": "", "postcode": "", "line_1": "", "line_3": "", "line_2": ""}
Event = apps.get_model('events', 'Event')
for event in ... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/comment_tests/urls_default.py | 133 | from django.conf.urls import patterns, include
urlpatterns = patterns('',
(r'^', include('django.contrib.comments.urls')),
# Provide the auth system login and logout views
(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}),
(r'^accounts/logout/$', 'django.contri... |
martinmcbride/pytexture | refs/heads/master | generativepy/drawing.py | 1 | # Author: Martin McBride
# Created: 2018-10-22
# Copyright (C) 2018, Martin McBride
# License: MIT
import cairo
import generativepy.utils
import numpy as np
# Text align
CENTER = 0
MIDDLE = 0
LEFT = 1
RIGHT = 2
TOP = 3
BOTTOM = 4
BASELINE = 5
# Fill rule
EVEN_ODD=0
WINDING=1
## Line cap/join
MITER = 0 # join
ROU... |
webmedic/booker | refs/heads/master | src/chardet/universaldetector.py | 47 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
baffolobill/mb_test_1 | refs/heads/master | src/mbtest1/erp_client/urls.py | 1 | # coding: utf-8
from django.conf.urls import include, url
from . import views
urlpatterns = [
url(r'^$', views.NodeListView.as_view(), name='client-index'),
url(r'^nodes/', include([
url(r'^$', views.NodeListView.as_view(), name='node-list'),
url(r'^create/$', views.NodeCreateView.as_view(), ... |
marinho/geraldo | refs/heads/master | site/newsite/site-geraldo/gae_wiki/views.py | 9 | from google.appengine.api import users
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.... |
tareqalayan/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_project.py | 30 | #!/usr/bin/python
# Copyright (c) 2015 IBM Corporation
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... |
pengli09/Paddle | refs/heads/develop | benchmark/tensorflow/rnn/reader.py | 13 | import os.path
import io
import numpy as np
import tensorflow as tf
# tflearn
import tflearn
from tflearn.data_utils import to_categorical, pad_sequences
from tflearn.datasets import imdb
FLAGS = tf.app.flags.FLAGS
class DataSet(object):
def __init__(self, data, labels):
assert data.shape[0] == labels.s... |
valexandersaulys/prudential_insurance_kaggle | refs/heads/master | venv/lib/python2.7/site-packages/numpy/distutils/command/autodist.py | 148 | """This module implements additional tests ala autoconf which can be useful.
"""
from __future__ import division, absolute_import, print_function
# We put them here since they could be easily reused outside numpy.distutils
def check_inline(cmd):
"""Return the inline identifier (may be empty)."""
cmd._check_... |
bdh1011/wau | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/install_scripts.py | 505 | from distutils import log
import distutils.command.install_scripts as orig
import os
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
ori... |
amagdas/superdesk | refs/heads/master | server/apps/item_lock/components/__init__.py | 395 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
|
nott/next.filmfest.by | refs/heads/master | cpm_data/models.py | 1 | from __future__ import unicode_literals
from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
from wagtail.wagtailcore.models import Orderable # TODO: is this good?
from wagtail.w... |
my7seven/ansible | refs/heads/devel | samples/lookup_pipe.py | 255 | - hosts: localhost
gather_facts: no
tasks:
- debug: msg="the date is {{ lookup('pipe', 'date') }}"
|
axbaretto/beam | refs/heads/master | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query1.py | 5 | #
# 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... |
kamcpp/tensorflow | refs/heads/master | tensorflow/python/client/__init__.py | 12133432 | |
jabber-at/hp | refs/heads/master | hp/antispam/migrations/__init__.py | 12133432 | |
dancingdan/tensorflow | refs/heads/master | tensorflow/python/estimator/canned/metric_keys.py | 11 | # 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... |
consulo/consulo-python | refs/heads/master | plugin/src/test/resources/override/typeAnnotations.py | 83 | class ArgsTest:
def __init__(self, key:str=None, value:str=None,
max_age=None, expires=None, path:str=None, domain:str=None,
secure:bool=False, httponly:bool=False, sync_expires:bool=True,
comment:str=None, version:int=None): pass
class Sub(ArgsTest):
pass
|
AllenDowney/ThinkStats2 | refs/heads/master | solutions/nsfg.py | 3 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
import sys
import numpy as np
import thinkstats2
from collections imp... |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-x86/venv/lib/python3.8/site-packages/setuptools/dep_util.py | 316 | from distutils.dep_util import newer_group
# yes, this is was almost entirely copy-pasted from
# 'newer_pairwise()', this is just another convenience
# function.
def newer_pairwise_group(sources_groups, targets):
"""Walk both arguments in parallel, testing if each source group is newer
than its corresponding t... |
weidnem/IntroPython2016 | refs/heads/master | students/cowhey/session03/mailroom.py | 3 | #!/usr/bin/env python
def accept_donation():
amount = input("How much did this person donate? \n")
if amount == "x" or check_if_number(amount):
return amount
else:
print("You must enter a numeric amount.")
return accept_donation()
def check_if_number(num):
try:
float(nu... |
Ban3/Limnoria | refs/heads/master | plugins/News/plugin.py | 6 | ###
# Copyright (c) 2003-2005, Daniel DiPaolo
# 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 cond... |
visualskyrim/bquick | refs/heads/master | bquick/bigquery/__init__.py | 1 | # -*- coding: utf-8 -*-
import httplib2
import urllib
import uuid
import time
import os
import json
import sys
from apiclient.discovery import build
from oauth2client.client import GoogleCredentials
from urllib2 import HTTPError
from bquick.bigquery import \
table_list_handler, table_delete_handler, table_copy_ha... |
rosmo/ansible | refs/heads/devel | lib/ansible/modules/network/cnos/cnos_facts.py | 37 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2019 Red Hat Inc.
# Copyright (C) 2019 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE... |
patrickstocklin/chattR | refs/heads/master | lib/python2.7/site-packages/django/contrib/staticfiles/utils.py | 248 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... |
hbrunn/bank-payment | refs/heads/8.0 | account_payment_purchase/tests/__init__.py | 8 | # -*- coding: utf-8 -*-
# (c) 2013-2015 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_account_payment_purchase
|
apache/incubator-allura | refs/heads/master | Allura/allura/model/repo.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 (t... |
Neitsch/ASE4156 | refs/heads/master | trading/migrations/0005_auto_20171015_1523.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-15 15:23
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trading', '0004_auto_20170920_0123'),
]
operations = ... |
ilexius/odoo | refs/heads/master | addons/account_budget/__init__.py | 47 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import account_budget
import report
import wizard
|
alxyang/mysql-5.6 | refs/heads/fb-mysql-5.6.35 | plugin/innodb_memcached/daemon_memcached/testsuite/breakdancer/breakdancer.py | 201 | #!/usr/bin/env python
import itertools
class Condition(object):
"""Something asserted to be true during the test.
A given condition may be used as a precondition or a
postcondition."""
def __call__(self, k, state):
"""Called with a key and a state. True if the condition is met."""
r... |
2014c2g5/2014c2 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/__init__.py | 900 | """
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the resu... |
eunchong/build | refs/heads/master | third_party/twisted_10_2/twisted/internet/_threadedselect.py | 61 | # -*- test-case-name: twisted.test.test_internet -*-
# $Id: default.py,v 1.90 2004/01/06 22:35:22 warner Exp $
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import generators
"""
Threaded select reactor
Maintainer: Bob Ippolito
The threadedselectreactor is a sp... |
kissmetrics/spark | refs/heads/master | examples/src/main/python/mllib/elementwise_product_example.py | 106 | #
# 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... |
apache/spark | refs/heads/master | resource-managers/kubernetes/integration-tests/tests/decommissioning_cleanup.py | 23 | #
# 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... |
bitcity/django | refs/heads/master | tests/cache/liberal_backend.py | 446 | from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
|
nickthecoder/itchy | refs/heads/master | resources/The-Mings/scripts/director.py | 1 | from common import *
# The size of the pixelations
PIXELATION_SIZE = 6
game = Itchy.getGame()
class Director(AbstractDirector) :
def onStarted( self ) :
self.inputQuit = Input.find("quit")
guiHeight = 100
playRect = Rect(0, 0, game.getWidth(), game.getHeight() - guiHeight)
... |
golismero/golismero-fingerprinter | refs/heads/master | netaddr/strategy/ipv6.py | 9 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2013, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
IPv6 address logic... |
phalax4/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/test/test_thread.py | 46 | import os
import unittest
import random
from test import test_support
thread = test_support.import_module('thread')
import time
import sys
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for printing out debu... |
antoinecarme/pyaf | refs/heads/master | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_LinearTrend_Seasonal_Second_ARX.py | 1 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['LinearTrend'] , ['Seasonal_Second'] , ['ARX'] ); |
3L3N4/volatility | refs/heads/master | volatility/plugins/envars.py | 12 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2012 Michael Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility 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 Fo... |
myarjunar/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_mps_ascii.py | 7 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mps_ascii.py
-----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************... |
mete0r/mete0r.olefilefs | refs/heads/master | mete0r_olefilefs/cli.py | 1 | # -*- coding: utf-8 -*-
#
# mete0r.olefilefs : PyFilesystem interface to olefile
# Copyright (C) 2015 mete0r <mete0r@sarangbang.or.kr>
#
# This program 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 Foun... |
lebabouin/CouchPotatoServer-develop | refs/heads/master | libs/tmdb3/cache_engine.py | 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: cache_engine.py
# Python Library
# Author: Raymond Wagner
# Purpose: Base cache engine class for collecting registered engines
#-----------------------
import time
from weakref import ref
class Engines( object ):
def __init__(self):
... |
alcemirfernandes/irobotgame | refs/heads/master | lib/pyglet/resource.py | 2 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
OCA/l10n-spain | refs/heads/12.0 | l10n_es_aeat_mod349/models/aeat_349_map_line.py | 2 | # Copyright 2017 Luis M. Ontalba <luis.martinez@tecnativa.com>
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openerp import fields, models
class Aeat349MapLines(models.Model):
_name = 'aeat.349.map.line'
_description = 'Aeat 349 Map Line'
... |
dmishin/log-zoom | refs/heads/master | log_transform.py | 1 | #!/usr/bin/env python
from PIL import Image
from math import *
import os
from image_distort import transform_image, compose, scale_tfm, translate_tfm
def logpolar_transform(image_size, center, out_width=None, out_height=None, alpha0 = 0):
swidth, sheight = image_size
if center is None:
center = (swidth... |
jiriprochazka/lnst | refs/heads/master | recipes/switchdev/l3-002-vlan-interface.py | 1 | """
Copyright 2016 Mellanox Technologies. All rights reserved.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
eladr@mellanox.com (Elad Raz)
"""
from lnst.Controller.Task import ctl
from TestLib import TestLib
from ti... |
Captain-Coder/tribler | refs/heads/devel | Tribler/Test/Community/popularity/test_community.py | 1 | import random
from twisted.internet.defer import inlineCallbacks
from Tribler.Core.Utilities.random_utils import random_infohash, random_string, random_utf8_string
from Tribler.Test.Core.base_test import MockObject
from Tribler.community.popularity import constants
from Tribler.community.popularity.community import Po... |
zhanghui9700/eonboard | refs/heads/master | eoncloud_web/cloud/utils/__init__.py | 12133432 | |
lmorchard/django | refs/heads/master | tests/field_defaults/__init__.py | 12133432 | |
plilja/project-euler | refs/heads/master | problem_51/__init__.py | 12133432 | |
liavkoren/djangoDev | refs/heads/master | tests/model_forms/__init__.py | 12133432 | |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.6/dist-packages/chardet/euctwfreq.py | 2 | ../../../../share/pyshared/chardet/euctwfreq.py |
androidarmv6/android_external_chromium_org | refs/heads/cm-11.0 | tools/telemetry/telemetry/core/gpu_device.py | 120 | # 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.
class GPUDevice(object):
"""Provides information about an individual GPU device.
On platforms which support them, the vendor_id and device_id are
... |
m-sanders/wagtail | refs/heads/master | wagtail/utils/apps.py | 59 | from importlib import import_module
from django.apps import apps
from django.utils.module_loading import module_has_submodule
def get_app_modules():
"""
Generator function that yields a module object for each installed app
yields tuples of (app_name, module)
"""
for app in apps.get_app_configs():... |
maciekcc/tensorflow | refs/heads/master | tensorflow/contrib/remote_fused_graph/pylib/python/ops/__init__.py | 189 | # 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... |
levyx/spark-sql-perf | refs/heads/master | dev/merge_pr.py | 9 | #!/usr/bin/env python
#
# 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 "Li... |
freedesktop-unofficial-mirror/gstreamer__gst-python | refs/heads/master | old_examples/tagsetter.py | 4 | #!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# gst-python
# Copyright (C) 2009 Stefan Kost <ensonic@user.sf.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Found... |
edmundgentle/schoolscript | refs/heads/master | SchoolScript/bin/Debug/pythonlib/Lib/fnmatch.py | 3 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The ... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Lib/test/curses_tests.py | 202 | #!/usr/bin/env python
#
# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
#
# Interactive test suite for the curses module.
# This script displays various things and the user should verify whether
# they display correctly.
#
import curses
from curses import textpad
def test_textpad(stdscr, insert_mode=False):
... |
slozier/ironpython2 | refs/heads/master | Src/StdLib/Lib/mailcap.py | 64 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... |
CivicTechTO/open-cabinet | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/sites/management.py | 467 | """
Creates the default Site object.
"""
from django.apps import apps
from django.conf import settings
from django.core.management.color import no_style
from django.db import DEFAULT_DB_ALIAS, connections, router
def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs):
... |
basicer/git | refs/heads/master | git_remote_helpers/__init__.py | 66 | #!/usr/bin/env python
"""Support library package for git remote helpers.
Git remote helpers are helper commands that interfaces with a non-git
repository to provide automatic import of non-git history into a Git
repository.
This package provides the support library needed by these helpers..
The following modules are... |
malaonline/Server | refs/heads/master | server/app/tests.py | 1 | import os
import json
import itertools
import datetime
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission
from django.contrib.auth import authenticate
from django.core.urlresolvers import reverse
from django.test import Client, TestCase, SimpleTestCase
from django.test.clie... |
stuaxo/mnd | refs/heads/master | tests/match_test.py | 1 | import collections
import unittest
from mnd.match import arg_match
# we will test arg matching against instances of this Msg type
Msg = collections.namedtuple("Msg", "note type")
class ArgMatchTest(unittest.TestCase):
def test_arg(self):
self.assertTrue(arg_match(1, 1))
def test_args(self):
... |
CMPS242-fsgh/project | refs/heads/master | classifier.py | 1 | import numpy as np
import scipy
import scipy.optimize
from scipy.special import expit
class NaiveBayes:
def __init__(self):
self._prior = None
self._mat = None
def fit(self, X, y):
y = np.matrix(y)
#print type(y)
#y = y.T
p1 = y*X
p2 = (1-y)*X
p ... |
princeofdarkness76/thefuck | refs/heads/master | tests/rules/test_fix_file.py | 12 | import pytest
import os
from thefuck.rules.fix_file import match, get_new_command
from tests.utils import Command
# (script, file, line, col (or None), stdout, stderr)
tests = (
('gcc a.c', 'a.c', 3, 1, '',
"""
a.c: In function 'main':
a.c:3:1: error: expected expression before '}' token
}
^
"""),
('clang a.c', '... |
percy-g2/Novathor_xperia_u8500 | refs/heads/master | 6.2.A.1.100/external/webkit/LayoutTests/http/tests/websocket/tests/hybi/too-long-payload_wsh.py | 11 | import struct
import time
from mod_pywebsocket import common
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
length = 0x8000000000000000
# pywebsocket refuses to send a frame with too long payload.
# Thus, we need to build a frame manually.
header = chr(0... |
mrquim/repository.mrquim | refs/heads/master | repo/script.module.youtube.dl/lib/youtube_dl/extractor/vzaar.py | 30 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
)
class VzaarIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|view)\.)?vzaar\.com/(?:videos/)?(?P<id>\d+)'
_TESTS = [{
'url': 'https://vzaar.com/vide... |
kinoshitajona/c9addmember | refs/heads/master | c9addmember/invite/apps.py | 1 | from __future__ import unicode_literals
from django.apps import AppConfig
class InviteConfig(AppConfig):
name = 'invite'
|
palazzem/google-blacklist-me | refs/heads/master | scraper/settings.py | 1 | # Scrapy settings for scraper project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'scraper'
SPIDER_MODULES = ['scraper.spiders']
NEWSPIDER_MODULE = 'scraper.s... |
channeng/tictactoe | refs/heads/master | script.py | 1 | r1 = [0,0,0]
r2 = [0,0,0]
r3 = [0,0,0]
board = [r1,r2,r3]
# PRINTING BOARD & TURNS
def printBoard():
print "\n"
for i in board:
for n in i:
print n,
print "\n"
def Pturn(n):
print "Player " + str(n) + " :"
prow = int(raw_input("Which row? (1/2/3) \n > ")) -1
while (prow +1) <= 0 or (prow+1) > 3:
... |
steppenwolf-sro/callback-schedule | refs/heads/master | callback_request/migrations/0002_auto_20161116_1940.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-16 19:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('callback_schedule', '0002_auto_20161116_1927'),
('callback_request', '0001_initial'),... |
jwren/intellij-community | refs/heads/master | python/testData/copyPaste/multiLine/IndentMulti32.after.py | 996 | class C:
def foo(self):
x = 1
y = 2
y = 2
|
GunoH/intellij-community | refs/heads/master | python/testData/copyPaste/multiLine/IndentMulti41.after.py | 996 | class C:
def foo(self):
x = 1
y = 2
y = 2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.