repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lamperi/aoc | refs/heads/master | 2017/20/solve.py | 1 | example = """p=< 3,0,0>, v=< 2,0,0>, a=<-1,0,0>
p=< 4,0,0>, v=< 0,0,0>, a=<-2,0,0>
"""
data = open("input.txt").read()
def sum_vec(v1, v2):
return [i1+i2 for i1, i2 in zip(v1, v2)]
def func(data):
partices = []
for line in data.splitlines():
parts = line.split(">")[:3]
p = [int(s.strip()) ... |
jpautom/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_partial_dependence.py | 365 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... |
otherness-space/myProject002 | refs/heads/master | my_project_002/lib/python2.7/site-packages/django/utils/dateformat.py | 116 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
from __future__ import unicode_literals
import re
import time
import calendar
import d... |
SergeySatskiy/cdm-pythonparser | refs/heads/master | legacy/src/unittest/nested_classes.py | 2 |
class A( a, b ):
class B():
def __init__( self ):
pass
def __str__( self, k = "ask" ):
def nested():
class C:
def f():
pass
pass
pass
def z( self ):
pass
def g():
class D... |
pgleeson/TempRepo3 | refs/heads/master | lib/jython/Lib/xmlrpclib.py | 85 | #
# XML-RPC CLIENT LIBRARY
# $Id: xmlrpclib.py 41594 2005-12-04 19:11:17Z andrew.kuchling $
#
# an XML-RPC client interface for Python.
#
# the marshalling and response parser code can also be used to
# implement XML-RPC servers.
#
# Notes:
# this version is designed to work with Python 2.1 or newer.
#
# History:
# 199... |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/__init__.py | 12133432 | |
quru/wagtail | refs/heads/master | wagtail/wagtailcore/tests/__init__.py | 12133432 | |
jounex/hue | refs/heads/master | desktop/core/ext-py/django-axes-1.4.0/examples/example/__init__.py | 12133432 | |
tchernomax/ansible | refs/heads/devel | lib/ansible/modules/system/nosh.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Thomas Caravia <taca@kadisius.eu>
# 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',
... |
hassoon3/odoo | refs/heads/8.0 | addons/stock_dropshipping/__init__.py | 223 | # -*- 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... |
nespinoza/secret-santa | refs/heads/master | run.py | 1 | # -*- coding: utf-8 -*-
from mail_utils import email_meta_loader
from mail_utils import assign_partner
from mail_utils import load_emails
from mail_utils import send_email
if __name__ == "__main__":
email = email_meta_loader()
emails = load_emails(email['list'])
assign_partner(emails)
... |
virgree/odoo | refs/heads/8.0 | addons/l10n_gr/__init__.py | 438 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... |
andreesg/bda.plone.orders | refs/heads/master | src/bda/plone/orders/browser/views.py | 1 | # -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from Products.CMFPlone.interfaces import IPloneSiteRoot
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage
from bda.plone.cart import as... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | python/Lib/site-packages/gdata/tlslite/utils/compat.py | 361 | """Miscellaneous functions to mask Python version differences."""
import sys
import os
if sys.version_info < (2,2):
raise AssertionError("Python 2.2 or later required")
if sys.version_info < (2,3):
def enumerate(collection):
return zip(range(len(collection)), collection)
class Set:
def ... |
teramagazine/coin | refs/heads/master | qa/rpc-tests/invalidtxrequest.py | 10 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.comptool import Tes... |
openstack/keystone | refs/heads/master | keystone/common/sql/contract_repo/versions/078_placeholder.py | 30 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
csutherl/sos | refs/heads/master | sos/plugins/quagga.py | 12 | # Copyright (C) 2007 Ranjith Rajaram <rrajaram@redhat.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 2 of the License, or
# (at your option) any later version.
# This prog... |
c3nav/c3nav | refs/heads/master | src/c3nav/routing/utils/draw.py | 1 | from django.conf import settings
def _ellipse_bbox(x, y, height):
x *= settings.RENDER_SCALE
y *= settings.RENDER_SCALE
y = height-y
return ((x - 2, y - 2), (x + 2, y + 2))
def _line_coords(from_point, to_point, height):
return (from_point.x * settings.RENDER_SCALE, height - (from_point.y * sett... |
HyperBaton/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_svm.py | 37 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... |
jmartinm/InvenioAuthorLists | refs/heads/master | modules/websubmit/lib/functions/Mail_Submitter.py | 5 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio 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 ... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/contrib/gis/db/backends/oracle/compiler.py | 148 | from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler
from django.db.backends.oracle import compiler
SQLCompiler = compiler.SQLCompiler
class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler):
pass
class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler):
pass
c... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/completion/mro.after.py | 83 | class C(object):
pass
C.__mro__ |
LonglyCode/flask | refs/heads/master | docs/flaskdocext.py | 192 | import re
import inspect
_internal_mark_re = re.compile(r'^\s*:internal:\s*$(?m)')
def skip_member(app, what, name, obj, skip, options):
docstring = inspect.getdoc(obj)
if skip:
return True
return _internal_mark_re.search(docstring or '') is not None
def setup(app):
app.connect('autodoc-sk... |
tsufiev/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/pages/pageobject.py | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
jkburges/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/user_unittest.py | 124 | # Copyright (C) 2010 Research in Motion Ltd. 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 conditio... |
chugunovyar/factoryForBuild | refs/heads/master | env/lib/python2.7/site-packages/scipy/sparse/linalg/tests/test_interface.py | 38 | """Test functions for the sparse.linalg.interface module
"""
from __future__ import division, print_function, absolute_import
from functools import partial
from itertools import product
import operator
import nose
from numpy.testing import TestCase, assert_, assert_equal, \
assert_raises
import numpy as np
... |
DataONEorg/d1_python | refs/heads/master | utilities/src/d1_util/download_all_objects.py | 1 | #!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... |
bespike/litecoin | refs/heads/0.18 | test/functional/rpc_users.py | 4 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
denovator/myfriki | refs/heads/master | lib/werkzeug/werkzeug/security.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import hmac
import hashlib
import posi... |
Kongsea/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/utils/gc.py | 45 | # 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... |
rahul67/hue | refs/heads/master | apps/oozie/src/oozie/migrations/0003_auto__add_sqoop.py | 40 | # encoding: 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 'Sqoop'
db.create_table('oozie_sqoop', (
('files', self.gf('django.db.models.fields.Cha... |
charmander/livestreamer | refs/heads/develop | src/livestreamer/plugins/mips.py | 34 | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.plugin.api.utils import parse_query
from livestreamer.stream import RTMPStream
BALANCER_URL = "http://www.mips.tv:1935/loadbalancer"
PLAYER_URL = "http://mips.tv/embedplayer/{0}/1/500/400"
SWF_URL = "... |
t3dev/odoo | refs/heads/master | addons/payment/controllers/portal.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import http, _
from odoo.http import request
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from datetime import datetime, timedelta
_logger = logging.getLogger(__name__)
class Payment... |
Midnighter/Everyday-Utilities | refs/heads/master | meb/utils/threaded.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=================
Threading Classes
=================
:Author:
Moritz Emanuel Beber
:Date:
2011-02-26
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
threaded.py
Notes
-----
Most classes (unless they inherit fro... |
srikantbmandal/ansible | refs/heads/devel | lib/ansible/plugins/action/ce.py | 7 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... |
pankajanand18/python-tests | refs/heads/master | coinchange.py | 1 | coins=[1,2,5,10]
def getDenomination(coins,sum):
min_deno=[0] * (sum + 1 )
for amt in xrange(1,sum+1):
min_deno[amt]= 30000
temp= 30000
for i in xrange(len(coins)):
if amt >= coins[i]:
temp_amt = min_deno[amt-coins[i]] + 1
#print temp_amt
if temp_amt < temp:
temp = temp_amt
min_deno[... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py | 2 | # Copyright 2015 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.
import logging
from telemetry.util import statistics
DISPLAY_HERTZ = 60.0
VSYNC_DURATION = 1e6 / DISPLAY_HERTZ
# When to consider a frame frozen (in VSYNC ... |
t11e/django | refs/heads/master | django/db/backends/sqlite3/base.py | 1 | """
SQLite3 backend for django.
Python 2.3 and 2.4 require pysqlite2 (http://pysqlite.org/).
Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the
standard library.
"""
import re
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import con... |
caglar10ur/lxc | refs/heads/master | config/yum/lxc-patch.py | 64 | # Yum plugin to re-patch container rootfs after a yum update is done
#
# Copyright (C) 2012 Oracle
#
# Authors:
# Dwight Engen <dwight.engen@oracle.com>
#
# This library 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 Softw... |
vlinhd11/vlinhd11-android-scripting | refs/heads/master | python/src/Lib/test/test_slice.py | 56 | # tests for slice objects; in particular the indices method.
import unittest
from test import test_support
from cPickle import loads, dumps
import sys
class SliceTest(unittest.TestCase):
def test_constructor(self):
self.assertRaises(TypeError, slice)
self.assertRaises(TypeError, slice, 1, 2, 3, ... |
stbka/ansible | refs/heads/devel | lib/ansible/parsing/yaml/objects.py | 169 | # (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... |
saurabh6790/med_new_app | refs/heads/develop | patches/march_2013/p11_update_attach_files.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
for f in webnotes.conn.sql("""select parent, fieldname
from tabDocField where options="attach_files:" """, as_dict=1):
if webnotes.conn.get_value("DocT... |
chirpradio/chirpradio-machine | refs/heads/master | chirp/library/schema.py | 1 | """Schema for our music library database.
Our data model is extremely simple:
* Our database contains audio file objects.
* Each audio file is uniquely identified by a fingerprint.
* Each audio file has many ID3 tags.
* ID3 tags are partitioned into sets by a timestamp.
"""
from chirp.common import mp3_header... |
guozhangwang/kafka | refs/heads/trunk | tests/kafkatest/sanity_checks/__init__.py | 93 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
JohnDenker/brython | refs/heads/master | www/src/Lib/test/test_xmlrpc.py | 27 | import base64
import datetime
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import socket
import os
import re
import io
import contextlib
from test import support
try:
import threading
except ImportError:
threading = N... |
SCOAP3/invenio | refs/heads/master | invenio/modules/formatter/format_elements/bfe_title_brief.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio 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,... |
sorenk/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/vyos.py | 58 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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) any late... |
bankonme/python-keepkey | refs/heads/master | tests/test_msg_simplesigntx.py | 3 | # tx 4a7b7e0403ae5607e473949cfa03f09f2cd8b0f404bf99ce10b7303d86280bf7
# 100 UTXO for spending for unittests
import unittest
import common
import binascii
import keepkeylib.messages_pb2 as proto
import keepkeylib.types_pb2 as proto_types
from keepkeylib.client import CallException
from keepkeylib.tx_api import TXAPITe... |
Eficent/odoomrp-wip | refs/heads/8.0 | stock_picking_wave_delivery/__openerp__.py | 25 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2015 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modi... |
spallavolu/scikit-learn | refs/heads/master | sklearn/cluster/affinity_propagation_.py | 224 | """ Algorithms for clustering : Meanshift, Affinity propagation and spectral
clustering.
"""
# Author: Alexandre Gramfort alexandre.gramfort@inria.fr
# Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, ClusterMixin
from ..utils import a... |
weareua/MarkIT | refs/heads/master | accounts/models.py | 1 | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
# user mapping
user = models.OneToOneField(User)
class Meta(object):
verbose_name = (u"User Profile")
# extra user data
mobile_phone = models.CharField(
... |
marissazhou/django | refs/heads/master | tests/forms_tests/widget_tests/test_checkboxselectmultiple.py | 161 | from django.forms import CheckboxSelectMultiple
from .base import WidgetTest
class CheckboxSelectMultipleTest(WidgetTest):
widget = CheckboxSelectMultiple()
def test_render_value(self):
self.check_html(self.widget, 'beatles', ['J'], choices=self.beatles, html=(
"""<ul>
<li><l... |
kylehogan/hil | refs/heads/master | tests/deployment/vlan_networks.py | 4 | # Copyright 2013-2015 Massachusetts Open Cloud Contributors
#
# 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 applicab... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/json/tests/test_encode_basestring_ascii.py | 143 | from collections import OrderedDict
from json.tests import PyTest, CTest
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uab... |
IMSGlobal/openbadges-validator-core | refs/heads/develop | openbadges/verifier/verifier.py | 2 | import json
from openbadges_bakery import unbake
from pydux import create_store
import traceback
from .actions.input import set_input_type, store_input
from .actions.tasks import add_task, report_message, resolve_task, trigger_condition
from .exceptions import SkipTask, TaskPrerequisitesError
from .logger import logge... |
digitalocean/netbox | refs/heads/develop | netbox/tenancy/api/__init__.py | 12133432 | |
ciudadanointeligente/votainteligente-portal-electoral | refs/heads/master | preguntales/tests/ranking_tests.py | 1 | # coding=utf-8
from elections.tests import VotaInteligenteTestCase as TestCase
from elections.models import Election, Candidate
from preguntales.models import Message, Answer
from preguntales.views import RankingMixin
from django.core.urlresolvers import reverse
class RankingTestCaseBase(TestCase):
def setUp(self... |
jasimpson/gnuradio-jasimpson | refs/heads/master | gr-msdd6000/src/python_test/test_tcp.py | 16 | #!/usr/bin/python
from socket import *
import string
import time
import struct;
import random;
myport = random.randint(1025,65535);
port = 10000
host = "10.45.4.43"
myaddr = ("10.45.1.229",myport);
buf = 100000;
TCPSock = socket(AF_INET,SOCK_STREAM);
#TCPSock = socket(AF_INET,SOCK_DGRAM);
TCPSock.bind(myaddr);
TCP... |
msiedlarek/qtwebkit | refs/heads/5.4 | Source/WebCore/make-file-arrays.py | 127 | #!/usr/bin/env python
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... |
ralphbean/mongrel2 | refs/heads/master | docs/manual/inputs/parsing_mongrel2_reqs.py | 94 | import json
def parse_netstring(ns):
len, rest = ns.split(':', 1)
len = int(len)
assert rest[len] == ',', "Netstring did not end in ','"
return rest[:len], rest[len+1:]
def parse(msg):
sender, conn_id, path, rest = msg.split(' ', 3)
headers, rest = parse_netstring(rest)
body, _ = parse_net... |
b4be1/ball_catcher | refs/heads/master | src/model_dubin.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 26 21:32:22 2015
Initialization
@author: plim
"""
import casadi as ca
import casadi.tools as cat
import numpy as np
# %% =========================================================================
# Parameters
# ============================... |
runt18/mojo | refs/heads/master | mojo/public/c/PRESUBMIT.py | 42 | # Copyright 2014 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.
"""Presubmit script for mojo/public/c.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API ... |
maxalbert/ansible | refs/heads/devel | lib/ansible/executor/task_queue_manager.py | 46 | # (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... |
winklerand/pandas | refs/heads/master | pandas/tests/indexes/timedeltas/test_indexing.py | 2 | from datetime import timedelta
import pytest
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas import TimedeltaIndex, timedelta_range, compat, Index, Timedelta
class TestTimedeltaIndex(object):
_multiprocess_can_split_ = True
def test_insert(self):
idx = Timedelta... |
nhomar/odoo | refs/heads/8.0 | addons/portal_claim/__init__.py | 346 | # -*- 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... |
blueboxgroup/nova | refs/heads/master | nova/cells/rpc_driver.py | 63 | # Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/license... |
wangsai/oppia | refs/heads/master | extensions/__init__.py | 12133432 | |
paulrouget/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/__init__.py | 12133432 | |
laurentgo/pants | refs/heads/master | tests/python/pants_test/backend/python/__init__.py | 12133432 | |
silenci/neutron | refs/heads/master | neutron/scheduler/__init__.py | 12133432 | |
ujenmr/ansible | refs/heads/devel | lib/ansible/modules/windows/win_wait_for_process.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
geodrinx/gearthview | refs/heads/master | ext-libs/twisted/test/ssl_helpers.py | 45 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Helper classes for twisted.test.test_ssl.
They are in a separate module so they will not prevent test_ssl importing if
pyOpenSSL is unavailable.
"""
from __future__ import division, absolute_import
from twisted.python.compat import nativeStr... |
jkthompson/nupic | refs/heads/master | examples/opf/experiments/multistep/hotgym/permutations.py | 5 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
robdennis/sideboard | refs/heads/master | tests/plugins/manypackages/multi/env/lib/python2.7/sre.py | 4 | /usr/lib/python2.7/sre.py |
pabelanger/did | refs/heads/master | docs/conf.py | 11 | # -*- coding: utf-8 -*-
#
# did documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 27 17:44:03 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
dosiecki/NewsBlur | refs/heads/master | apps/search/management/commands/index_stories.py | 15 | import re
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.rss_feeds.models import Feed, MStory
from apps.reader.models import UserSubscription
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
mak... |
westinedu/similarinterest | refs/heads/master | zinnia/management/commands/spam_cleanup.py | 2 | """Spam cleanup command module for Zinnia"""
from django.contrib import comments
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import NoArgsCommand
from zinnia.models import Entry
class Command(NoArgsCommand):
"""Command object for removing comments
flagged as sp... |
lingthio/Flask-User | refs/heads/master | flask_user/email_adapters/email_adapter_interface.py | 1 | """This module defines the EmailAdapter interface.
"""
# Author: Ling Thio <ling.thio@gmail.com>
# Copyright (c) 2013 Ling Thio
from __future__ import print_function
from flask_user import ConfigError
class EmailAdapterInterface(object):
""" Define the EmailAdapter interface to send emails through various emai... |
fredhusser/scikit-learn | refs/heads/master | benchmarks/bench_glm.py | 297 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... |
anbasile/flask_sample | refs/heads/master | flask/lib/python2.7/site-packages/pycparser/c_lexer.py | 42 | #------------------------------------------------------------------------------
# pycparser: c_lexer.py
#
# CLexer class: lexer for the C language
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
import re
import sys
from .ply imp... |
tangyibin/goblin-core | refs/heads/master | riscv/llvm/3.5/llvm-3.5.0.src/utils/lit/tests/test-output.py | 26 | # XFAIL: python2.5
# RUN: %{lit} -j 1 -v %{inputs}/test-data --output %t.results.out > %t.out
# RUN: FileCheck < %t.results.out %s
# CHECK: {
# CHECK: "__version__"
# CHECK: "elapsed"
# CHECK-NEXT: "tests": [
# CHECK-NEXT: {
# CHECK-NEXT: "code": "PASS",
# CHECK-NEXT: "elapsed": {{[0-9.]+}},
# CHECK-NEXT: ... |
KokareIITP/django | refs/heads/master | django/db/backends/mysql/base.py | 323 | """
MySQL database backend for Django.
Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
from django.conf import settings... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/templatetags/indent_text.py | 71 | from django import template
register = template.Library()
class IndentByNode(template.Node):
def __init__(self, nodelist, indent_level, if_statement):
self.nodelist = nodelist
self.indent_level = template.Variable(indent_level)
if if_statement:
self.if_statement = template.Var... |
hujiajie/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/testing/__init__.py | 1201 | # Copyright 2014 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.
|
golden1232004/webrtc_new | refs/heads/master | chromium/src/build/android/gyp/write_build_config.py | 2 | #!/usr/bin/env python
#
# Copyright 2014 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.
"""Writes a build_config file.
The build_config file for a target is a json file containing information about
how to build that targ... |
Wafflespeanut/servo | refs/heads/master | tests/wpt/css-tests/tools/py/doc/example/genxml.py | 217 |
import py
class ns(py.xml.Namespace):
pass
doc = ns.books(
ns.book(
ns.author("May Day"),
ns.title("python for java programmers"),),
ns.book(
ns.author("why", class_="somecssclass"),
ns.title("Java for Python programmers"),),
publisher="N.N",
)
print doc.unicode(ind... |
uweschmitt/emzed | refs/heads/master | patched_modules/sitecustomize.py | 1 | # -*- coding: utf-8 -*-
# Spyder's ExternalPythonShell sitecustomize
import sys
import os
import os.path as osp
import pdb
import bdb
import __builtin__
############ EMZED ADDDONS BEGIN ##############################
print "run patched sitecustomize"
sys.path.insert(0, os.environ.get("EMZED_HOME",""))... |
archlinux/archweb | refs/heads/master | mirrors/views/mirrorlist.py | 1 | from operator import attrgetter, itemgetter
from django import forms
from django.db.models import Q
from django.forms.widgets import SelectMultiple, CheckboxSelectMultiple
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.csrf import csrf_exempt
from django_countries import ... |
zanderle/django | refs/heads/master | tests/admin_registration/tests.py | 266 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.decorators import register
from django.contrib.admin.sites import site
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from .models import Location, Person, Place, Traveler... |
PaulSec/theHarvester | refs/heads/master | htmlExport.py | 19 | from lib import markup
from lib import graphs
import re
class htmlExport():
def __init__(self, users, hosts, vhosts, dnsres,
dnsrev, file, domain, shodan, tldres):
self.users = users
self.hosts = hosts
self.vhost = vhosts
self.fname = file
self.dnsres = dn... |
GDGND/evm | refs/heads/master | allauth/socialaccount/providers/facebook/south_migrations/__init__.py | 12133432 | |
LouisChen1905/OneAnalyser | refs/heads/master | src/one_analyse/test/argument/__init__.py | 12133432 | |
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | openedx/core/djangoapps/course_groups/migrations/__init__.py | 12133432 | |
andmos/ansible | refs/heads/devel | lib/ansible/modules/messaging/rabbitmq/__init__.py | 12133432 | |
bowang/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/decode_png_op_test.py | 134 | # 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... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/cms/models/placeholdermodel.py | 29 | # -*- coding: utf-8 -*-
from cms.utils.compat import DJANGO_1_7
from django.contrib import admin
from django.contrib.auth import get_permission_codename
from django.db import models
from django.template.defaultfilters import title
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translati... |
aconrad/webassets | refs/heads/master | src/webassets/filter/cssrewrite/__init__.py | 19 | import os
from os.path import join
from webassets.utils import common_path_prefix
from webassets.utils import urlparse
from . import urlpath
try:
from collections import OrderedDict
except ImportError:
# Use an ordered dict when available, otherwise we simply don't
# support ordering - it's just a nice bonu... |
simartin/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/httplib_compat.py | 48 | # -*- coding: utf-8 -*-
"""
hyper/httplib_compat
~~~~~~~~~~~~~~~~~~~~
This file defines the publicly-accessible API for hyper. This API also
constitutes the abstraction layer between HTTP/1.1 and HTTP/2.
This API doesn't currently work, and is a lower priority than the HTTP/2
stack at this time.
"""
import socket
try... |
seadsystem/website | refs/heads/ddavisscott-patch-2 | web2py/gluon/contrib/pyrtf/Styles.py | 44 | """
A Styles is a collection of PropertySets that can be applied to a particular RTF element.
At present there are only two, Text and Paragraph but ListStyles will be added soon too.
"""
from PropertySets import *
class TextStyle :
def __init__( self, text_props, name=None, shading_props=None ) :
self.... |
bitifirefly/edx-platform | refs/heads/master | common/djangoapps/student/views.py | 12 | """
Student Views
"""
import datetime
import logging
import uuid
import json
import warnings
from collections import defaultdict
from pytz import UTC
from requests import HTTPError
from ipware.ip import get_ip
from django.conf import settings
from django.contrib.auth import logout, authenticate, login
from django.cont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.