repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
diox/zamboni | refs/heads/master | mkt/comm/migrations/0003_auto_20150915_1245.py | 7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('extensions', '0006_auto_20150914_0745'),
('comm', '0002_auto_20150727_1017'),
]
operations = [
migrations.AddField(
... |
nuncjo/odoo | refs/heads/8.0 | addons/account/wizard/account_move_line_reconcile_select.py | 385 | # -*- 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... |
blossomica/airmozilla | refs/heads/master | airmozilla/main/tests/views/test_eventeditchapters.py | 2 | import os
import json
import shutil
import mock
from nose.tools import eq_, ok_
from django.core.urlresolvers import reverse
from airmozilla.main.models import (
Event,
Chapter,
Picture,
Template,
)
from airmozilla.uploads.models import Upload
from airmozilla.base.tests.testbase import DjangoTestCase... |
damonkohler/sl4a | refs/heads/master | python/src/Lib/wave.py | 68 | """Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... |
doganov/edx-platform | refs/heads/master | cms/envs/bok_choy.py | 2 | """
Settings for Bok Choy tests that are used when running Studio.
Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running the tests
Note: it isn't possible to have a single settings file, because Django doesn't
support both generating ... |
sathieu/samba | refs/heads/master | python/samba/tests/glue.py | 9 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# 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) a... |
MarkTseng/django-farmersale | refs/heads/master | farmersale-env/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py | 90 | # Needed ctypes routines
from ctypes import c_double, byref
# Other GDAL imports.
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature... |
victor-gonzalez/AliPhysics | refs/heads/master | PWGJE/EMCALJetTasks/Tracks/analysis/base/SpectraSum.py | 41 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... |
bohlian/erpnext | refs/heads/develop | erpnext/accounts/doctype/cost_center/test_cost_center.py | 104 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Cost Center') |
glo/ee384b | refs/heads/master | opencv/tests/python/highgui/cvCaptureFromFileYUY2.py | 2 | #! /usr/bin/env python
"""
This script will test highgui's video reading functionality
for RAW YUY2 .avi files
"""
# pixel format to check
FORMAT = "YUY2"
# import check routine
import cvCaptureFromFile
# check video file of format FORMAT,
# the function also exits and returns
# 0,1 or 77 accordingly.
cvCaptureFr... |
rdezavalia/ansible | refs/heads/devel | contrib/inventory/windows_azure.py | 40 | #!/usr/bin/env python
'''
Windows Azure external inventory script
=======================================
Generates inventory that Ansible can understand by making API request to
Windows Azure using the azure python library.
NOTE: This script assumes Ansible is being executed where azure is already
installed.
p... |
etxc/namebench | refs/heads/master | libnamebench/base_ui.py | 172 | # Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
newerthcom/savagerebirth | refs/heads/master | libs/python-2.72/Lib/test/test_select.py | 39 | from test import test_support
import unittest
import select
import os
import sys
@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
... |
caot/intellij-community | refs/heads/master | python/testData/surround/CustomFoldingRegionIllegalSelection.py | 79 | [
1,
<selection>2
]</selection> |
75651/kbengine_cloud | refs/heads/master | kbe/res/scripts/common/Lib/string.py | 78 | """A collection of string constants.
Public module variables:
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a ... |
fayf/pyload | refs/heads/stable | module/plugins/hoster/SmoozedCom.py | 12 | # -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.plugins.internal.MultiHoster import MultiHoster
class SmoozedCom(MultiHoster):
__name__ = "SmoozedCom"
__type__ = "hoster"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r'^unmatchable$' #: Sin... |
rahuldhote/odoo | refs/heads/8.0 | addons/l10n_vn/__openerp__.py | 342 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... |
kluyckx/solrupdater | refs/heads/master | src/pyth/__init__.py | 7 | """
Pyth -- Python text markup and conversion
"""
import os.path
__version__ = '0.5.6'
writerMap = {
'.rtf': 'pyth.plugins.rtf15.writer.Rtf15Writer',
'.html': 'pyth.plugins.xhtml.writer.XHTMLWriter',
'.xhtml': 'pyth.plugins.xhtml.writer.XHTMLWriter',
'.txt': 'pyth.plugins.plaintext.writer.PlaintextWr... |
GladeRom/android_external_chromium_org | refs/heads/gr-3.1 | tools/telemetry/telemetry/timeline/inspector_importer.py | 33 | # 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.
'''Imports event data obtained from the inspector's timeline.'''
import telemetry.timeline.slice as tracing_slice
import telemetry.timeline.thread as timelin... |
uw-it-aca/uw-restclients | refs/heads/master | restclients/test/canvas/courses.py | 4 | from django.test import TestCase
from restclients.canvas.courses import Courses
class CanvasTestCourses(TestCase):
def test_course(self):
with self.settings(
RESTCLIENTS_CANVAS_DAO_CLASS='restclients.dao_implementation.canvas.File'):
canvas = Courses()
course = can... |
Curious72/sympy | refs/heads/master | sympy/core/benchmarks/bench_basic.py | 92 | from __future__ import print_function, division
from sympy.core import symbols, S
x, y = symbols('x,y')
def timeit_Symbol_meth_lookup():
x.diff # no call, just method lookup
def timeit_S_lookup():
S.Exp1
def timeit_Symbol_eq_xy():
x == y
|
zanph/zanph | refs/heads/master | flaskroulette/venv/lib/python2.7/site-packages/requests/packages/urllib3/util/__init__.py | 201 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
assert_fingerprint,
resolve_cert_reqs,
... |
gilles-duboscq/mx | refs/heads/master | mx_gate.py | 2 | #
# ----------------------------------------------------------------------------------------------------
#
# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify ... |
gdimitris/ChessPuzzler | refs/heads/master | Virtual_Environment/lib/python2.7/site-packages/migrate/tests/fixture/models.py | 124 | from sqlalchemy import *
# test rundiffs in shell
meta_old_rundiffs = MetaData()
meta_rundiffs = MetaData()
meta = MetaData()
tmp_account_rundiffs = Table('tmp_account_rundiffs', meta_rundiffs,
Column('id', Integer, primary_key=True),
Column('login', Text()),
Column('passwd', Text()),
)
tmp_sql_table = T... |
rapilabs/django | refs/heads/master | tests/m2m_and_m2o/tests.py | 383 | from django.db.models import Q
from django.test import TestCase
from .models import Issue, UnicodeReferenceModel, User
class RelatedObjectTests(TestCase):
def test_related_objects_have_name_attribute(self):
for field_name in ('test_issue_client', 'test_issue_cc'):
obj = User._meta.get_field(... |
dimroc/tensorflow-mnist-tutorial | refs/heads/master | lib/python3.6/site-packages/tensorflow/contrib/training/python/training/sampling_ops.py | 41 | # 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... |
anchel/zookeeper | refs/heads/trunk | src/contrib/huebrowser/zkui/src/zkui/settings.py | 114 | # 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 ... |
BT-rmartin/odoo | refs/heads/BT_2900 | addons/board/__init__.py | 439 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
40223141/2015cda_g6 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/colordict.py | 621 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## 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 Foundation; either
## version 2 of the License, or (... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/Lib/test/test_platform.py | 10 | import sys
import os
import unittest
import platform
import subprocess
from test import test_support
from test.test_support import is_jython
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
if hasattr(os, "symlink"):
@unittest.skipIf(is_jython,... |
ubear/Pyspider | refs/heads/master | pyspider/database/mongodb/resultdb.py | 37 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-10-13 22:18:36
import json
import time
from pymongo import MongoClient
from pyspider.database.base.resultdb import ResultDB as BaseResultDB
from .mong... |
Myself5/android_kernel_sony_msm8994_OM5Z | refs/heads/cm-14.1 | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v8/services/services/click_view_service/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2020 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... |
dani0805/django_workflow | refs/heads/master | simple_approval/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
mottosso/pyblish-magenta | refs/heads/master | pyblish_magenta/api.py | 1 | from .lib import (
setup,
register_plugins,
deregister_plugins,
find_next_version,
format_version,
compute_publish_directory,
)
from .plugin import (
Extractor
)
# third-party
from .vendor.inflection import (
humanize,
underscore,
camelize
)
__all__ = [
"setup",
"regis... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | tools/crx_id/crx_id.py | 120 | #!/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.
""" Read a CRX file and write out the App ID and the Full Hash of the ID.
See: http://code.google.com/chrome/extensions/crx.html
an... |
nerevu/frappe | refs/heads/develop | frappe/tests/test_permissions.py | 25 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""Use blog post test to test user permissions logic"""
import frappe
import frappe.defaults
import unittest
import json
import frappe.model.meta
from frappe.core.page.user_permi... |
petecummings/django | refs/heads/master | tests/save_delete_hooks/tests.py | 453 | from __future__ import unicode_literals
from django.test import TestCase
from django.utils import six
from .models import Person
class SaveDeleteHookTests(TestCase):
def test_basic(self):
p = Person(first_name="John", last_name="Smith")
self.assertEqual(p.data, [])
p.save()
self.... |
seismology-RUB/ASP3D | refs/heads/master | asp3d/core/activeSeismoPick.py | 1 | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Copyright 2017 Marcel Paffrath (Ruhr-Universitaet Bochum, Germany)
#
# This file is part of ActiveSeismoPick3D
#----------------------------------------------------------------------------
import math
import num... |
chen0510566/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/fftpack/__init__.py | 58 | #
# fftpack - Discrete Fourier Transform algorithms.
#
# Created: Pearu Peterson, August,September 2002
from info import __all__,__doc__
from fftpack_version import fftpack_version as __version__
from basic import *
from pseudo_diffs import *
from helper import *
from numpy.dual import register_func
for k in ['fft'... |
alshedivat/tensorflow | refs/heads/master | tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py | 6 | # 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... |
Stavitsky/nova | refs/heads/master | nova/scheduler/filters/affinity_filter.py | 56 | # Copyright 2012, Piston Cloud Computing, Inc.
# Copyright 2012, OpenStack Foundation
# 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... |
Nitaco/ansible | refs/heads/devel | lib/ansible/modules/identity/ipa/ipa_hostgroup.py | 60 | #!/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)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
kived/py4a-updater | refs/heads/master | UpdaterTest/main.py | 1 | '''
Sample Android app to test auto updates.
Change the update check URL in service/main.py
'''
import kivy
from kivy.properties import StringProperty, BooleanProperty, ObjectProperty
from kivy.uix.boxlayout import BoxLayout
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
from pyupdate... |
apavlo/h-store | refs/heads/master | tests/frontend/org/voltdb/regressionsuites/sqlfeatureprocs/manycolumnddl.py | 9 | #!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2010 VoltDB L.L.C.
#
# 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
# without limita... |
jkall/qgis-bkuplyr-plugin | refs/heads/master | plugin_zip_and_upload.py | 1 | #!/usr/bin/env python
# coding=utf-8
"""This script uploads a plugin package on the server.
Authors: A. Pasotti, V. Picavet
git sha : $TemplateVCSFormat
Modified by JK
#Please notice, this will only work with flat plugin folder structure!
USAGE:
python plug... |
tsteward/the-blue-alliance | refs/heads/master | helpers/bluezone_helper.py | 2 | import cloudstorage
import datetime
import json
import logging
from helpers.firebase.firebase_pusher import FirebasePusher
from helpers.match_helper import MatchHelper
from helpers.outgoing_notification_helper import OutgoingNotificationHelper
from models.event import Event
from models.match import Match
from models.s... |
paulcalabro/git | refs/heads/master | contrib/svn-fe/svnrdump_sim.py | 328 | #!/usr/bin/python
"""
Simulates svnrdump by replaying an existing dump from a file, taking care
of the specified revision range.
To simulate incremental imports the environment variable SVNRMAX can be set
to the highest revision that should be available.
"""
import sys
import os
if sys.hexversion < 0x02040000:
# T... |
BillBillBillBill/WishTalk-server | refs/heads/master | WishTalk/api/user.py | 1 | # -*- coding: utf-8 -*-
import random
import time
from hashlib import sha256
from hmac import HMAC
from flask import request
from api import api, ERROR_USER, GlobalError
from model.user import User, UserInfo
from server import db, redisClient
from util.jsonResponse import jsonSuccess, jsonError
from util.token import... |
kurtw/wagtail | refs/heads/master | wagtail/tests/dummy_sendfile_backend.py | 7 | from __future__ import absolute_import, unicode_literals
from django.http import HttpResponse
def sendfile(request, filename, **kwargs):
"""
Dummy sendfile backend implementation.
"""
return HttpResponse('Dummy backend response')
|
stevenewey/django | refs/heads/master | tests/migrations/migrations_test_apps/lookuperror_b/models.py | 103 | from django.db import models
class B1(models.Model):
pass
class B2(models.Model):
a1 = models.ForeignKey('lookuperror_a.A1')
class B3(models.Model):
pass
|
ADemonisis/mitmproxy | refs/heads/master | examples/modify_form.py | 16 |
def request(context, flow):
if "application/x-www-form-urlencoded" in flow.request.headers[
"content-type"]:
form = flow.request.get_form_urlencoded()
form["mitmproxy"] = ["rocks"]
flow.request.set_form_urlencoded(form)
|
xguse/scikit-bio | refs/heads/master | skbio/alignment/__init__.py | 3 | r"""
Alignments and Sequence collections (:mod:`skbio.alignment`)
============================================================
.. currentmodule:: skbio.alignment
This module provides functionality for working with biological sequence
collections and alignments. These can be composed of generic sequences,
nucelotide s... |
YangChihWei/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/case.py | 743 | """Test case implementation"""
import sys
import functools
import difflib
import pprint
import re
import warnings
import collections
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable)
__unittest = True
DIFF_OMITTED = ('\nDiff is %s charact... |
jiankers/weevely3 | refs/heads/master | modules/system/extensions.py | 16 | from core.vectors import PhpCode
from core.module import Module
from core import messages
import random
class Extensions(Module):
"""Collect PHP and webserver extension list."""
def init(self):
self.register_info(
{
'author': [
'Emilio Pinna'
... |
eBay/restcommander | refs/heads/master | play-1.2.4/python/Lib/encodings/big5.py | 816 | #
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_tw, codecs
import _multibytecodec as mbc
codec = _codecs_tw.getcodec('big5')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrementalE... |
cwyark/micropython-uaioftp | refs/heads/master | setup.py | 1 | import sys
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system's.
sys.path.pop(0)
from setuptools import setup
sys.path.append("..")
setup(name='micropython-uaioftp',
version='0.9.2',
description='Lightweight ftp asyncio library for MicroPython.',
long... |
gdimitris/ChessPuzzler | refs/heads/master | Virtual_Environment/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py | 34 | # sql/sqltypes.py
# Copyright (C) 2005-2015 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
"""SQL specific types.
"""
import datetime as dt
import codecs
from .type_api imp... |
robovm/robovm-studio | refs/heads/master | python/testData/completion/classMethod.py | 83 | class B(object):
@classmethod
def xyzzy(cls):
pass
@classmethod
def class_method3(cls):
cls.x<caret>
|
scalable-networks/gnuradio-3.7.2.1 | refs/heads/master | gr-blocks/python/blocks/qa_skiphead.py | 57 | #!/usr/bin/env python
#
# Copyright 2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... |
yunity/yunity-core | refs/heads/master | karrot/applications/stats.py | 2 | from django.db.models import Count
from django.utils import timezone
from influxdb_metrics.loader import write_points
from karrot.groups.stats import group_tags
def application_status_update(application):
tags = group_tags(application.group)
fields = {
'application_{}'.format(application.status): 1,
... |
r39132/airflow | refs/heads/master | airflow/operators/druid_check_operator.py | 2 | # -*- coding: utf-8 -*-
#
# 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
#... |
njase/numpy | refs/heads/master | setup.py | 9 | #!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays. NumPy is built ... |
theflofly/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/bucketize_op_test.py | 13 | # 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... |
ubiar/odoo | refs/heads/8.0 | addons/edi/models/res_company.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
a-doumoulakis/tensorflow | refs/heads/master | tensorflow/contrib/boosted_trees/python/kernel_tests/prediction_ops_test.py | 6 | # 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... |
llnz/poc_decimator | refs/heads/master | src/runner.py | 1 | #! /usr/bin/env python
import sys
import time
import os
import tempfile
import subprocess
import csv
def rundecimator(file, rlvl, qlvl):
'''run the decimator with the given max quality levels'''
print "running decimator with resolution %d and quality %s on %s" % (rlvl, qlvl, file),
sys.stdout.flush(... |
Yuudachimoe/HikariChun-RedBot | refs/heads/master | lib/youtube_dl/extractor/digiteka.py | 64 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/scatter3d/marker/_symbol.py | 1 | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="symbol", parent_name="scatter3d.marker", **kwargs):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
40423130/2016fallcadp_hw | refs/heads/gh-pages | plugin/liquid_tags/include_code.py | 246 | """
Include Code Tag
----------------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% include_code path/to/code [lang:python] [Title text] [codec:utf8] %}
The "path to code" is specified relative to the ``code`` subdirectory of
the content directory Option... |
Hodorable/0602 | refs/heads/master | openstack_dashboard/dashboards/project/databases/views.py | 33 | # Copyright 2013 Rackspace Hosting
#
# 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 ... |
SFPD/rlreloaded | refs/heads/master | control4/agents/random_discrete_agent.py | 1 | import numpy as np
from control4.core.agent import Agent
class RandomDiscreteAgent(Agent):
def __init__(self,num_actions):
self.num_actions = num_actions
def lag_array_names(self):
return []
def input_info(self):
return {}
def output_info(self):
return {}
def ca... |
xwv/shadowsocks | refs/heads/master | setup.py | 929 | import codecs
from setuptools import setup
with codecs.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name="shadowsocks",
version="2.8.2",
license='http://www.apache.org/licenses/LICENSE-2.0',
description="A fast tunnel proxy that help you get through firewalls",
... |
procamora/Wiki-Personal | refs/heads/master | pelican-plugins/sub_parts/sub_parts.py | 59 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pelican import signals
import logging
logger = logging.getLogger(__name__)
def patch_subparts(generator):
generator.subparts = []
slugs = {}
for article in generator.articles:
slugs[article.slug] = article
if '--' in art... |
smmribeiro/intellij-community | refs/heads/master | python/testData/intentions/PyConvertCollectionLiteralIntentionTest/convertOneElementIncompleteListToTuple.py | 37 | [42 |
znoxx/tbng | refs/heads/master | setup/configure_componetns.py | 1 | #!/usr/bin/env python3
#
# import modules used here -- sys is a very standard one
import sys,argparse,os,subprocess
from lxml import html
import requests
import urllib.request
import tempfile
import re
import pexpect
from libtbngsetup import *
def configure_tor(torrc):
token="tbng enabled settings"
settings="""L... |
vmware/chaperone-ui | refs/heads/master | execute/urls.py | 1 | #
# Copyright 2015 VMware, 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 ... |
netsamir/dotfiles | refs/heads/master | files/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/settings.py | 37 | """
This module contains variables with global |jedi| settings. To change the
behavior of |jedi|, change the variables defined in :mod:`jedi.settings`.
Plugins should expose an interface so that the user can adjust the
configuration.
Example usage::
from jedi import settings
settings.case_insensitive_comple... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/labservices/azure-mgmt-labservices/azure/mgmt/labservices/aio/operations/__init__.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
ezigman/pjsip-upstream | refs/heads/master | tests/pjsua/scripts-sendto/401_fmtp_g7221_with_bitrate_24000.py | 42 | # $Id: 401_fmtp_g7221_with_bitrate_24000.py 3664 2011-07-19 03:42:28Z nanang $
import inc_sip as sip
import inc_sdp as sdp
# Answer with codec G722.1 should choose the same bitrate
# which in this test is 24000
sdp = \
"""
v=0
o=- 3428650655 3428650655 IN IP4 192.168.1.9
s=pjmedia
c=IN IP4 192.168.1.9
t=0 0
a=X-nat:0... |
liangazhou/django-rdp | refs/heads/master | packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/sched.py | 175 | """A generally useful event scheduler class.
Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.
Each instance is parametrized with two functions, one that is
supposed to return the current time, one that i... |
froyobin/ironic | refs/heads/our_branch | ironic/db/sqlalchemy/alembic/versions/2581ebaf0cb2_initial_migration.py | 7 | #
# 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
# ... |
TheWaWaR/shadowsocks | refs/heads/master | shadowsocks/crypto/rc4_md5.py | 1042 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... |
WhySoGeeky/DroidPot | refs/heads/master | venv/lib/python2.7/site-packages/pip/vcs/subversion.py | 280 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile... |
egenerat/flight-manager | refs/heads/master | django/contrib/gis/db/backends/base.py | 12 | """
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.conf import settings
from django.contrib.gis import gdal
class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
... |
wimnat/ansible | refs/heads/devel | test/integration/targets/ignore_unreachable/fake_connectors/bad_put_file.py | 35 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ansible.plugins.connection.local as ansible_local
from ansible.errors import AnsibleConnectionFailure
from ansible.utils.display import Display
display = Display()
class Connection(ansible_local.Connection):
def put_f... |
JeffreyFalgout/ciml | refs/heads/master | labs/lab6-NaiveBayes/datasets.py | 4 | from numpy import *
from util import *
def loadTextData(filename):
wfreq = Counter()
h = open(filename, 'r')
D = []
for l in h.readlines():
a = l.split()
if len(a) > 1:
y = float(a[0])
if y > 0.5: y = 1.
else: y = -1.
x = {}
f... |
skamsie/facebook-friends-tracker | refs/heads/master | compare.py | 1 | #!/usr/bin/env python3
import argparse
import os
import csv
from collections import Counter
from scrutinize import DATA_DIR
parser = argparse.ArgumentParser()
parser.add_argument(
'-l', '--list',
help='prints tree of data dir',
action='store_true'
)
parser.add_argument(
'-o', '--old',
help='path ... |
basnijholt/holoviews | refs/heads/master | holoviews/operation/timeseries.py | 2 | import param
import numpy as np
import pandas as pd
from ..core import Operation, Element
from ..core.data import PandasInterface
from ..core.util import pandas_version
from ..element import Scatter
class RollingBase(param.Parameterized):
"""
Parameters shared between `rolling` and `rolling_outlier_std`.
... |
chickonice/AutonomousFlight | refs/heads/master | px4_new_ws/build/catkin_generated/order_packages.py | 1 | # generated from catkin/cmake/template/order_packages.context.py.in
source_root_dir = "/home/odroid/Documents/AutonomousFlight/px4_new_ws/src"
whitelisted_packages = "".split(';') if "" != "" else []
blacklisted_packages = "".split(';') if "" != "" else []
underlay_workspaces = "/home/odroid/Documents/AutonomousFlight/... |
openstack/networking-l2gw | refs/heads/master | networking_l2gw/extensions/l2gateway.py | 1 | # Copyright 2015 OpenStack Foundation
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/structureView/attributes.py | 83 | class B(object):
c1 = 0
def f(self, x):
self.i1 = x
l1 = self.i1
self.i2 = l1
def __init__(self, x, y):
self.i2 = x
self.i3 = y
@classmethod
def g(cls, x):
cls.c2 = cls.c1
g1 = "foo"
class C(B):
c2 = -1
def __init__(self, x, y):
s... |
massmutual/scikit-learn | refs/heads/master | examples/model_selection/plot_underfitting_overfitting.py | 230 | """
============================
Underfitting vs. Overfitting
============================
This example demonstrates the problems of underfitting and overfitting and
how we can use linear regression with polynomial features to approximate
nonlinear functions. The plot shows the function that we want to approximate,
wh... |
itinko/mitro | refs/heads/master | browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/_version.py | 28 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (build by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
gladsonvm/haystackdemo | refs/heads/master | lib/python2.7/site-packages/haystack/__init__.py | 4 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from haystack.constants import DEFAULT_ALIAS
from haystack import signals
from haystack.utils import loading
__author__ = 'Daniel Lindsley'
__version__ = (2, 1, 0)
# Setup ... |
activitycentral/ebookreader | refs/heads/master | src/ReadTab/readtoolbar.py | 1 | # Copyright (C) 2006, Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in... |
0x90/python-gsmmodem | refs/heads/master | tools/identify-modem.py | 9 | #!/usr/bin/env python
"""\
Simple script to assist with identifying a GSM modem
The debug information obtained by this script (when using -d) can be used
to aid test cases (since I don't have access to every modem in the world ;-) )
@author: Francois Aucamp <francois.aucamp@gmail.com>
"""
from __future__ import prin... |
hsoft/moneyguru | refs/heads/master | core/tests/gui/table_sort_test.py | 1 | # Copyright 2019 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from ..testutil import eq_, with_app
from ...const import AccountType
from... |
watarukura/booklog2slack | refs/heads/master | lambda_function.py | 1 | # -*- coding: utf-8 -*-
import urllib
import urllib2
from bs4 import BeautifulSoup
from dateutil.parser import parse as parse_date
from dateutil.relativedelta import relativedelta
import datetime
import dateutil.tz
BOOKLOG_TIMELINE_URL="http://booklog.jp/users/<your_account>/feed"
SLACK_API_END_POINT="https://slack.co... |
piiswrong/mxnet | refs/heads/master | example/rcnn/rcnn/io/rpn.py | 34 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.