repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
ibmsoe/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/stack_op_test.py
65
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
alberts/check_mk
refs/heads/master
web/plugins/wato/check_mk_configuration.py
1
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
maohongyuan/kbengine
refs/heads/master
kbe/src/lib/python/Doc/tools/sphinxext/c_annotations.py
31
# -*- coding: utf-8 -*- """ c_annotations.py ~~~~~~~~~~~~~~~~ Supports annotations for C API elements: * reference count annotations for C API functions. Based on refcount.py and anno-api.py in the old Python documentation tools. * stable API annotations Usage: Set the `refcount_file`...
nuagenetworks/vspk-python
refs/heads/master
vspk/v5_0/fetchers/nusharednetworkresources_fetcher.py
2
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
damdam-s/OpenUpgrade
refs/heads/8.0
addons/web_tests/tests/__init__.py
385
# -*- coding: utf-8 -*- import test_ui
gajden/se-guess-who
refs/heads/master
crawlers/wikidata_crawler.py
1
import json import os from dircache import listdir from os.path import join, basename import shutil import wget def read_json(path): with open(path, 'r') as f_in: data = json.load(f_in) return data class WikiDataCrawler(object): def __init__(self, mapping_path=None): self.url = 'https:/...
sidzan/netforce
refs/heads/master
netforce_account/netforce_account/tests/service_sale_multi_pay.py
4
from netforce.test import TestCase from netforce.model import get_model from datetime import * import time class Test(TestCase): _name="service.sale.multi.pay" _description="Service sale payment for 2 invoices" def test_run(self): # create invoice #1 vals={ "type": "out", ...
evernote/evernote-sdk-python3
refs/heads/master
lib/thrift/TSerialization.py
111
# # 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...
lizardsystem/lizard-esf
refs/heads/master
lizard_esf/tasks.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # pylint: disable=C0111 # Copyright (c) 2012 Nelen & Schuurmans. GPL licensed, see LICENSE.rst. import logging from celery.task import task from lizard_esf.import_dbf import DBFImporter from lizard_esf.models import DBFConfiguration from lizard_esf.export_dbf import DBFEx...
asedunov/intellij-community
refs/heads/master
python/testData/inspections/PyTypeCheckerInspection/HomogeneousTuplePlusHeterogeneousTupleWithTheSameElementsType.py
30
A = tuple(sorted([1, 4, 2])) B = A + (4, 6, 7, 8)
acbodine/koding
refs/heads/master
go/src/vendor/github.com/caglar10ur/lxc/src/python-lxc/setup.py
15
#!/usr/bin/env python3 # # python-lxc: Python bindings for LXC # # (C) Copyright Canonical Ltd. 2012 # # Authors: # Stéphane Graber <stgraber@ubuntu.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 Soft...
thanhacun/odoo
refs/heads/8.0
addons/account/wizard/account_report_general_journal.py
378
# -*- 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...
brianmay/karaage
refs/heads/master
karaage/migrations/0002_auto_20140924_1111.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('karaage', '0001_initial'), ] operations = [ migrations.AlterField( model_name='logentry', name='cont...
rinfo/fst
refs/heads/master
wsgi.py
2
""" WSGI application settings for FST instance The default setup at Domstolsverket assumes that instances of FST run under the default virtualenv unless something else is explicitly specified. """ import os import sys import site # Change this to match your production server path! VIRTUALENV_PATH = '/opt/rinfo/fst/ve...
ProteinDF/ProteinDF_bridge
refs/heads/master
proteindf_bridge/position_test.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 The ProteinDF development team. # see also AUTHORS and README if provided. # # This file is a part of the ProteinDF software package. # # The ProteinDF is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
scalable-networks/ext
refs/heads/master
gnuradio-3.7.0.1/gr-qtgui/apps/qt_digital.py
58
#!/usr/bin/env python # # Copyright 2011 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 option) ...
Medium/phantomjs-1
refs/heads/master
src/breakpad/src/tools/gyp/test/subdirectory/gyptest-SYMROOT-default.py
399
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
craynot/django
refs/heads/master
tests/template_tests/filter_tests/test_urlencode.py
388
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import urlencode from django.test import SimpleTestCase from ..utils import setup class UrlencodeTests(SimpleTestCase): @setup({'urlencode01': '{{ url|urlencode }}'}) def test_urlencode01(self): outp...
detialiaj/pro
refs/heads/master
SYS/inout/migrations/0006_entry.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-01-02 00:08 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0017_auto_20161217_2358'), ('inout', '0005_...
ucrawler/cp-uc
refs/heads/master
libs/suds/umx/core.py
200
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
marcuskelly/recover
refs/heads/master
Lib/site-packages/passlib/tests/test_handlers_cisco.py
5
""" passlib.tests.test_handlers_cisco - tests for Cisco-specific algorithms """ #============================================================================= # imports #============================================================================= from __future__ import absolute_import, division, print_function # core ...
xinjiguaike/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/video_module/video_xfields.py
46
""" XFields for video module. """ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings _ = lambda text: text class VideoFields(object): """Fields for `VideoModule` and `VideoDescriptor`....
home-assistant/home-assistant
refs/heads/dev
tests/test_runner.py
2
"""Test the runner.""" import threading from unittest.mock import patch from homeassistant import core, runner from homeassistant.util import executor, thread # https://github.com/home-assistant/supervisor/blob/main/supervisor/docker/homeassistant.py SUPERVISOR_HARD_TIMEOUT = 220 TIMEOUT_SAFETY_MARGIN = 10 async ...
matheuscas/pyfuzzy_toolbox
refs/heads/master
pyfuzzy_toolbox/mf.py
1
import numpy as np def trimf(x, params): """Triangular-shaped membership function Keyword arguments: x -- integer, float or (int or float) input numpy array params -- list with parameters a and c locate the "feet" of the triangle and the parameter b locates the peak. """ if not (type(x) == i...
detiber/lib_openshift
refs/heads/master
lib_openshift/models/v1_job_spec.py
2
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
hoihu/micropython
refs/heads/master
tests/basics/special_methods2.py
7
class Cud(): def __init__(self): #print("__init__ called") pass def __repr__(self): print("__repr__ called") return "" def __lt__(self, other): print("__lt__ called") def __le__(self, other): print("__le__ called") def __eq__(self, other): ...
vberaudi/scipy
refs/heads/master
scipy/sparse/linalg/eigen/arpack/setup.py
76
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.system_info import get_info, NotFoundError from numpy.distutils.misc_util import Configuration from scipy._build_utils i...
arbrandes/edx-platform
refs/heads/master
lms/djangoapps/coursewarehistoryextended/tests.py
3
""" Tests for coursewarehistoryextended Many aspects of this app are covered by the courseware tests, but these are specific to the new storage model with multiple backend tables. """ import json from unittest import skipUnless from unittest.mock import patch from django.conf import settings from django.db import co...
pigeonflight/strider-plone
refs/heads/master
docker/appengine/lib/django-1.4/tests/regressiontests/utils/crypto.py
41
import math import timeit import hashlib from django.utils import unittest from django.utils.crypto import pbkdf2 class TestUtilsCryptoPBKDF2(unittest.TestCase): # http://tools.ietf.org/html/draft-josefsson-pbkdf2-test-vectors-06 rfc_vectors = [ { "args": { "password": "...
siosio/intellij-community
refs/heads/master
python/testData/copyPaste/Indent7709.dst.py
83
a = 1 <caret> b = 2
erkanay/django
refs/heads/master
tests/servers/models.py
623
from django.db import models class Person(models.Model): name = models.CharField(max_length=256)
CydarLtd/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_smu.py
40
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
paweljasinski/ironpython3
refs/heads/master
Tests/test_index.py
2
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
alexsmx/djangoAppengineSrcTemplate
refs/heads/master
django/contrib/databrowse/views.py
529
from django.http import Http404 from django.shortcuts import render_to_response ########### # CHOICES # ########### def choice_list(request, app_label, module_name, field_name, models): m, f = lookup_field(app_label, module_name, field_name, models) return render_to_response('databrowse/choice_list.html', {'m...
textbook/flash_services
refs/heads/master
tests/test_core_service.py
1
from collections import OrderedDict from datetime import datetime, timezone, timedelta import pytest from flash_services.core import Service class Fake(Service): ROOT = 'root/url' def __init__(self, *, foo, bar): super().__init__() def update(self): pass def format_data(self, dat...
romain-dartigues/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py
25
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
firstjob/python-social-auth
refs/heads/master
social/apps/django_app/default/migrations/0003_alter_email_max_length.py
63
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('default', '0002_add_related_name'), ] operations = [ migrations.AlterField( model_name='code', name=...
aboganas/frappe
refs/heads/develop
frappe/core/doctype/scheduler_log/scheduler_log.py
18
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class SchedulerLog(Document): def onload(self): if not self.seen: ...
tobinjt/Flexget
refs/heads/develop
flexget/plugins/cli/win32_service.py
4
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import argparse import logging import os import socket import sys import flexget from flexget import options from flexget.event import event from flexget.terminal import c...
lukacu/manus
refs/heads/master
python/manus_starter/__init__.py
1
#!/usr/bin/env python2 import os import sys import time import struct import signal import shutil from subprocess import call from ignition import ProgramGroup from manus_starter.privileged import run_upgrade, run_shutdown try: from manus import VERSION except ImportError: VERSION = 'N/A' LOCAL_CAMERA = os...
pasiegel/SickGear
refs/heads/master
lib/unidecode/x003.py
246
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
daavery/audacity
refs/heads/master
lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/Runner.py
330
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import random,atexit try: from queue import Queue except ImportError: from Queue import Queue from waflib import Utils,Task,Errors,Logs GAP=10 class TaskConsumer(Utils.threa...
beauseant/dogalive
refs/heads/master
lib/sqlite.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 as lite import logging import argparse import datetime class SQLite: _name = 'sqlite.db' _con = None _dir = '' def __init__ ( self, direct ): self._dir = direct try: self._con = lite.connect( self._name ) except lite.Erro...
aglitke/vdsm
refs/heads/master
tests/vmTestsData.py
2
# # Copyright Red Hat 2013 # # 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 the hope...
pap/nupic
refs/heads/master
src/nupic/swarming/ModelTerminator.py
31
# ---------------------------------------------------------------------- # 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...
gauravssnl/PyPastebin-Symbian
refs/heads/master
requests/packages/oreos/__init__.py
3
# -*- coding: utf-8 -*- from .core import dict_from_string
jinglining/flink
refs/heads/master
flink-python/pyflink/table/environment_settings.py
13
################################################################################ # 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...
sffjunkie/home-assistant
refs/heads/master
homeassistant/components/switch/edimax.py
7
""" Support for Edimax switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.edimax/ """ import logging from homeassistant.components.switch import DOMAIN, SwitchDevice from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PASSWORD,...
koson/MissionPlannerKMTI
refs/heads/master
Lib/pydoc_data/topics.py
45
# Autogenerated by Sphinx on Sat Jul 3 08:52:04 2010 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``,...
mina86/linux
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
338
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
twobob/buildroot-kindle
refs/heads/master
output/build/host-python-2.7.2/Lib/bsddb/test/test_cursor_pget_bug.py
112
import unittest import os, glob from test_all import db, test_support, get_new_environment_path, \ get_new_database_path #---------------------------------------------------------------------- class pget_bugTestCase(unittest.TestCase): """Verify that cursor.pget works properly""" db_name = 'test-curs...
davehunt/kuma
refs/heads/master
vendor/packages/pytz/exceptions.py
657
''' Custom exceptions raised by pytz. ''' __all__ = [ 'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError', 'NonExistentTimeError', ] class UnknownTimeZoneError(KeyError): '''Exception raised when pytz is passed an unknown timezone. >>> isinstance(UnknownTimeZoneError(), LookupError)...
luser/steeplechase
refs/heads/master
steeplechase/__init__.py
4
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from runsteeplechase import *
hzlf/openbroadcast
refs/heads/master
website/__filer/models/tools.py
15
#-*- coding: utf-8 -*- from filer.models import Clipboard def discard_clipboard(clipboard): clipboard.files.clear() def delete_clipboard(clipboard): for file in clipboard.files.all(): file.delete() def get_user_clipboard(user): if user.is_authenticated(): clipboard = Clipboard.objects....
ContinuumIO/numpy
refs/heads/master
numpy/core/tests/test_arrayprint.py
4
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.compat import sixu from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal ) class TestArrayRepr(object): def test_nan_inf(self): x = np.array([np.n...
rfree2/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/prune_targets/gyptest-prune-targets.py
47
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies --root-target removes the unnecessary targets. """ import TestGyp test = TestGyp.TestGyp() # The xcode-ninja generator has it...
pantsbuild/pex
refs/heads/main
pex/vendor/_vendored/pip/pip/_vendor/certifi/core.py
17
# -*- coding: utf-8 -*- """ certifi.py ~~~~~~~~~~ This module returns the installation location of cacert.pem or its contents. """ import os try: from importlib.resources import path as get_path, read_text _CACERT_CTX = None _CACERT_PATH = None def where(): # This is slightly terrible, but ...
lutianming/online-ARMA
refs/heads/master
arma.py
1
import numpy as np from numpy.linalg import inv from scipy.optimize import fmin_bfgs import matplotlib.pyplot as plt import statsmodels.api as sm import pandas as pd import data from statsmodels.tsa.arima_process import arma_generate_sample def K_min(y, A): def f(x): tmp = np.matrix(y).reshape(-1, 1) - np....
johndbritton/gitviz
refs/heads/master
dulwich/dulwich/tests/test_objects.py
3
# test_objects.py -- tests for objects.py # Copyright (C) 2007 James Westby <jw+debian@jameswestby.net> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License or (at your o...
vbannai/disk-qos-horizon
refs/heads/master
horizon/dashboards/syspanel/networks/subnets/views.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation # # 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 #...
WANdisco/hive
refs/heads/trunk
service/lib/py/fb303_scripts/__init__.py
214
# # 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...
moreati/django
refs/heads/master
tests/forms_tests/tests/test_regressions.py
135
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import ( CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm, ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select, TextInput, ) from django.test import TestCase, ignore_warnings from django.utils...
bspink/django
refs/heads/master
tests/auth_tests/test_context_processors.py
269
import datetime from django.contrib.auth import authenticate from django.contrib.auth.context_processors import PermLookupDict, PermWrapper from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.test import SimpleTes...
westinedu/sovleit
refs/heads/master
django/conf/locale/lt/formats.py
332
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. F j \d.' TIME_FORMAT = 'H:i:s' # DATETIME_FORMAT = # YEAR_MONTH_F...
tgoodyear/dpkt
refs/heads/master
tests/test-perf.py
24
#!/usr/bin/env python import time, sys import dnet sys.path.insert(0, '.') import dpkt from impacket import ImpactDecoder, ImpactPacket from openbsd import packet import scapy import xstruct xip = xstruct.structdef('>', [ ('v_hl', ('B', 1), (4 << 4) | (dnet.IP_HDR_LEN >> 2)), ('tos', ('B', 1), dnet.IP_TOS_DE...
whitepyro/debian_server_setup
refs/heads/master
lib/pysrt/srtexc.py
94
""" Exception classes """ class Error(Exception): """ Pysrt's base exception """ pass class InvalidTimeString(Error): """ Raised when parser fail on bad formated time strings """ pass class InvalidItem(Error): """ Raised when parser fail to parse a sub title item """ ...
youprofit/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/infinite-redirects.py
228
def main(request, response): location = "%s://%s:%s/%s" % (request.url_parts.scheme, request.url_parts.netloc, request.url_parts.port, request.url_parts.path) page = "alternate"; type = 302; mix = 0; ...
jonberliner/keras
refs/heads/master
keras/utils/theano_utils.py
19
from __future__ import absolute_import import numpy as np import theano import theano.tensor as T def floatX(X): return np.asarray(X, dtype=theano.config.floatX) def sharedX(X, dtype=theano.config.floatX, name=None): return theano.shared(np.asarray(X, dtype=dtype), name=name) def shared_zeros(shape, dtype...
amol-/depot
refs/heads/master
depot/io/memory.py
1
""" Provides MemoryStorage implementation to keep files in memory. This is useful for caches or tests. """ import uuid import io from datetime import datetime from .interfaces import FileStorage, StoredFile from . import utils from .._compat import unicode_text class MemoryStoredFile(StoredFile): def __init__(...
Kra1o5/android_kernel_bq_curie2qc
refs/heads/cm-11.0
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
mohammed-alfatih/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_client.py
442
#!/usr/bin/env python # # Copyright 2011, 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...
darkleons/BE
refs/heads/master
addons/hr_contract/base_action_rule.py
389
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
acsone/odoo-autodiscover
refs/heads/master
tests/addons/8.0/z1/odoo_addons/__init__.py
179
import pkg_resources pkg_resources.declare_namespace(__name__)
fridex/fabric8-analytics-worker
refs/heads/master
tests/workers/test_recurse.py
1
from f8a_worker.dispatcher.foreach import _is_url_dependency def test__is_url_dependency(): data = [ ({"name": "test2", "version": "1.0.0"}, False), ({"name": "test3", "version": "http://some.tar/ball.tgz"}, True), ({"name": "test4", "version": "git://some.git/repo.git"}, True), ({...
bnaul/scikit-learn
refs/heads/master
examples/exercises/plot_cv_digits.py
24
""" ============================================= Cross-validation on Digits Dataset Exercise ============================================= A tutorial exercise using Cross-validation with an SVM on the Digits dataset. This exercise is used in the :ref:`cv_generators_tut` part of the :ref:`model_selection_tut` section...
manassolanki/frappe
refs/heads/develop
frappe/desk/search.py
4
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Search from __future__ import unicode_literals import frappe, json from frappe.utils import cstr, unique from frappe import _ from six import string_types # this is called by the Link Field @frappe.whitelist() def se...
Mistobaan/tensorflow
refs/heads/master
tensorflow/python/debug/cli/debugger_cli_common.py
68
# 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...
FabricaSocial/sic
refs/heads/master
sic/auth/models.py
10644
from django.db import models # Create your models here.
wbc2010/django1.2.5
refs/heads/master
django1.2.5/django/contrib/contenttypes/management.py
315
from django.contrib.contenttypes.models import ContentType from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_unicode def update_contenttypes(app, created_models, verbosity=2, **kwargs): """ Creates content types for models in the given app, removing any model ...
opencivicdata/python-opencivicdata-django
refs/heads/master
opencivicdata/tests/test_division.py
2
#!/u/bin/env python # -*- coding: utf-8 -*- from opencivicdata.divisions import Division def test_get(): div = Division.get("ocd-division/country:de/state:by/cd:248") assert div.name == "Bad Kissingen" assert div.name in str(div) def test_children(): us = Division.get("ocd-division/country:ua") ...
felixfontein/ansible
refs/heads/devel
test/units/module_utils/facts/system/distribution/test_parse_distribution_file_Slackware.py
35
# -*- coding: utf-8 -*- # Copyright (c) 2019 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 import os import pytest from ansible.module_utils.facts.system.distribution i...
Jusedawg/SickRage
refs/heads/develop
lib/imdb/parser/http/searchPersonParser.py
76
""" parser.http.searchPersonParser module (imdb package). This module provides the HTMLSearchPersonParser class (and the search_person_parser instance), used to parse the results of a search for a given person. E.g., when searching for the name "Mel Gibson", the parsed page would be: http://akas.imdb.com/find?q=Me...
ClearCorp/odoo-costa-rica
refs/heads/9.0
TODO-9.0/l10n_cr_account/__init__.py
2
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
sparkslabs/kamaelia
refs/heads/master
Code/Python/Kamaelia/Kamaelia/Support/DVB/CRC.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License,...
tarzan0820/odoo
refs/heads/8.0
openerp/addons/base/ir/ir_values.py
228
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
cecep-edu/edx-platform
refs/heads/eucalyptus.2
scripts/release.py
37
#!/usr/bin/env python """ a release-master multitool """ from __future__ import print_function, unicode_literals import sys import argparse from datetime import date, timedelta import re import collections import functools import textwrap import json import getpass try: from path import Path as path from git i...
openshift/openshift-tools
refs/heads/prod
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/openshift_health_checker/test/fluentd_test.py
55
import pytest import json from openshift_checks.logging.fluentd import Fluentd, OpenShiftCheckExceptionList, OpenShiftCheckException def assert_error_in_list(expect_err, errorlist): assert any(err.name == expect_err for err in errorlist), "{} in {}".format(str(expect_err), str(errorlist)) fluentd_pod_node1 = {...
cyclecomputing/boto
refs/heads/2.27.x
boto/s3/multidelete.py
244
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # # 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 limitation the rights to use, copy, modify, m...
ian-garrett/meetMe
refs/heads/master
env/lib/python3.4/site-packages/setuptools/command/egg_info.py
301
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys try: from setuptools_s...
sbellem/django
refs/heads/master
tests/contenttypes_tests/tests.py
81
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.apps.registry import Apps, apps from django.contrib.contenttypes import management from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import Conte...
openstack/trove
refs/heads/master
trove/tests/scenario/groups/instance_actions_group.py
1
# Copyright 2015 Tesora 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 a...
aeischeid/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/util.py
497
# Copyright 2011, 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 of conditions and the f...
grap/OCB
refs/heads/7.0
addons/mrp_operations/report/mrp_workorder_analysis.py
53
# -*- 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...
Alexoner/mooc
refs/heads/master
coursera/nlpintro-001/Assignment1/code/providedcode/transitionparser.py
1
# Code modified from the Natural Language Toolkit # Original author: Long Duong <longdt219@gmail.com> import tempfile import pickle import os import copy import operator import scipy.sparse as sparse import numpy as np from sklearn.datasets import load_svmlight_file from sklearn import svm class Configuration(object...
Voxel8/OctoPrint
refs/heads/master
src/octoprint/plugins/softwareupdate/version_checks/git_commit.py
32
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import errno import subproc...
AndrewGrossman/django
refs/heads/master
django/contrib/staticfiles/management/commands/runserver.py
248
from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler from django.core.management.commands.runserver import \ Command as RunserverCommand class Command(RunserverCommand): help = "Starts a lightweight Web server for development and also serves static files." d...
Kast0rTr0y/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/jenkins_plugin.py
21
#!/usr/bin/python # encoding: utf-8 # (c) 2016, Jiri Tyr <jiri.tyr@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 #...
takeshineshiro/nova
refs/heads/master
nova/tests/unit/keymgr/fake.py
110
# Copyright 2011 Justin Santa Barbara # 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/l...
hakancelik96/coogger
refs/heads/master
core/cooggerapp/views/utopic/commit.py
1
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.messages.views import SuccessMessageMixin from django.http import Http404 from django.shortcuts import get_object_or_404 from django.urls import reverse from django.views.generic import ListView, Te...
SilverCory/CloudBot
refs/heads/master
plugins/karma.py
2
import time import re from sqlalchemy import Table, Column, Integer, String, PrimaryKeyConstraint from sqlalchemy import select from cloudbot import hook from cloudbot.util import timeformat, formatting, database CAN_DOWNVOTE = False TIME_LIMIT = 300.0 karma_table = Table( 'karma', database.metadata, ...