repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
nens/threedi-qgis-plugin
tool_commands/import_sufhyd/command.py
1
1869
# (c) Nelen & Schuurmans, see LICENSE.rst. from ThreeDiToolbox.tool_commands.custom_command_base import CustomCommandBase from ThreeDiToolbox.tool_commands.import_sufhyd.import_sufhyd_dialog import ( ImportSufhydDialogWidget, ) from ThreeDiToolbox.tool_commands.import_sufhyd.import_sufhyd_main import Importer from...
gpl-3.0
gilamsalem/pynfs
nfs4.0/servertests/st_fslocations.py
3
6570
from nfs4_const import * from nfs4lib import list2bitmap from environment import check def testReference(t, env): """FSLOCATION test of referral node This assumes option --usespecial was set to point to correct path FLAGS: fslocations CODE: FSLOC1 """ c = env.c1 path = env.opts.usespecial...
gpl-2.0
tensorflow/model-analysis
tensorflow_model_analysis/metrics/query_statistics.py
1
5733
# Lint as: python3 # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
blademainer/intellij-community
python/lib/Lib/mimify.py
102
14885
#! /usr/bin/env python """Mimification and unmimification of mail messages. Decode quoted-printable parts of a mail message or encode using quoted-printable. Usage: mimify(input, output) unmimify(input, output, decode_base64 = 0) to encode and decode respectively. Input and output may be the name of...
apache-2.0
chemelnucfin/tensorflow
tensorflow/contrib/graph_editor/tests/transform_test.py
23
11263
# 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...
apache-2.0
alipsgh/tornado
classifier/knn.py
1
3526
""" The Tornado Framework By Ali Pesaranghader University of Ottawa, Ontario, Canada E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com """ import math import operator from classifier.classifier import SuperClassifier from dictionary.tornado_dictionary import * def calculate_euclide...
mit
krafczyk/spack
var/spack/repos/builtin/packages/py-doxypypy/package.py
5
1648
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/scipy/ndimage/tests/test_regression.py
123
1429
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_almost_equal, run_module_suite import scipy.ndimage as ndimage def test_byte_order_median(): """Regression test for #413: median_filter does not handle bytes orders.""" a = np.arange(9,...
gpl-3.0
peterbraden/tensorflow
tensorflow/python/framework/contrib_test.py
15
1436
# Copyright 2015 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 a...
apache-2.0
cassm/will-o-the-wisp
control/coordGen.py
1
3517
#!/usr/bin/env python import math spherical = (( 60, 6), ( 20, 30), ( 45, 48), ( 75, 18), (100, 348), (300, 6), (260, 348), (285, 18), (315, 48), (340, 30), (180, 328), (140, 333), (165, 300), (195, 300), (220, 333), (120, 318), ( 95, 338), (109, 238), (131, 258), (145...
gpl-3.0
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_size05.py
9
1575
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ ...
bsd-2-clause
arthur-wsw/pinax-messages
pinax/messages/models.py
1
3535
from __future__ import unicode_literals from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from .signals import message_sent from .utils import cached_attribute @py...
mit
OESF/Linaro-Android_LinaroSprint2011Q1
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
cevaris/pants
tests/python/pants_test/targets/test_java_agent.py
10
3426
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.j...
apache-2.0
raven47git/readthedocs.org
readthedocs/restapi/permissions.py
12
1615
from rest_framework import permissions from privacy.backend import AdminPermission class IsOwner(permissions.BasePermission): """ Custom permission to only allow owners of an object to edit it. """ def has_object_permission(self, request, view, obj): # Write permissions are only allowed to th...
mit
pixelgremlins/ztruck
dj/lib/python2.7/site-packages/django/conf/locale/__init__.py
82
12130
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
apache-2.0
badloop/SickRage
sickbeard/databases/cache_db.py
6
3682
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
MCMic/Sick-Beard
lib/enzyme/asf.py
180
15818
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
mtnman38/Aggregate
aggForFoundation/dist/aggregate.app/Contents/Resources/lib/python2.7/email/quoprimime.py
246
10848
# Copyright (C) 2001-2006 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Quoted-printable content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode US ASCII-like 8-bit data called `quoted-printable'. It...
gpl-2.0
Sumith1896/sympy
sympy/functions/elementary/tests/test_complexes.py
2
22502
from sympy import ( Abs, adjoint, arg, atan2, conjugate, cos, DiracDelta, E, exp, expand, Expr, Function, Heaviside, I, im, log, nan, oo, pi, Rational, re, S, C, sign, sin, sqrt, Symbol, symbols, transpose, zoo, exp_polar, Piecewise ) from sympy.utilities.pytest import XFAIL, raises from sympy.utilities.ra...
bsd-3-clause
vikitripathi/MB-MessApp-API
messApp/env/lib/python2.7/site-packages/setuptools/command/test.py
113
6526
import unittest from unittest import TestLoader from setuptools import Command from distutils.errors import DistutilsOptionError import sys from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint) from setupto...
apache-2.0
5y/linux
scripts/gdb/linux/tasks.py
367
2552
# # gdb helper commands and functions for Linux kernel debugging # # task & thread tools # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils task_type = utils.CachedType(...
gpl-2.0
drpngx/tensorflow
tensorflow/contrib/training/python/training/resample.py
39
5844
# 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...
apache-2.0
indictranstech/fbd_erpnext
erpnext/hr/report/monthly_salary_register/monthly_salary_register.py
52
4104
# 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 from frappe.utils import flt, cstr from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} salary_slip...
agpl-3.0
icexelloss/spark
examples/src/main/python/mllib/multi_class_metrics_example.py
55
2836
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.2/django/contrib/localflavor/sk/sk_districts.py
543
2453
""" Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ DISTRICT_CHOICES = ( ('BB', _('Banska Bystrica')), ('BS', _('Banska Stiavnica')), ('BJ', _('Bardejov')), ('BN', _('Banovce nad Bebravo...
mit
costadorione/purestream
servers/wstream.py
1
2905
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para wstream.video # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ import re import time from core import ...
gpl-3.0
ovnicraft/edx-platform
common/djangoapps/third_party_auth/middleware.py
169
1053
"""Middleware classes for third_party_auth.""" from social.apps.django_app.middleware import SocialAuthExceptionMiddleware from . import pipeline class ExceptionMiddleware(SocialAuthExceptionMiddleware): """Custom middleware that handles conditional redirection.""" def get_redirect_uri(self, request, excep...
agpl-3.0
karrrt/scale
lib/python2.7/site-packages/setuptools/package_index.py
72
38943
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib from functools import wraps from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, require, Environment, find_distributions, safe_name, s...
mit
brianhouse/48to16
data_compilation/compile_audio.py
1
2894
#!/usr/bin/env python3 import sys, os, datetime, calendar, compile_gpx, pytz import numpy as np from scipy.io import wavfile from housepy import log, config, util, drawing, science, crashdb MEDIA_LENGTH = 2090.43 # hack per video to get everything to match correctly log.info("Starting...") if len(sys.argv) < 2 or n...
gpl-3.0
Snuzzo/vigor_mofokernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# 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...
gpl-2.0
schlueter/ansible
lib/ansible/modules/network/avi/avi_vsdatascriptset.py
41
4759
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
40223220/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/long_int1/__init__.py
503
3858
from browser import html, document, window import javascript #memorize/cache? def _get_value(other): if isinstance(other, LongInt): return other.value return other class BigInt: def __init__(self): pass def __abs__(self): return LongInt(self.value.abs()) def __add__(self, other): ...
gpl-3.0
Titan-C/helpful_scripts
bank.py
1
1745
#!/usr/bin/env python3 # -*- coding: utf-8 -*- r""" Parse Bank statement ==================== From CSV to ledger """ # Created: Sat May 18 18:32:47 2019 # Author: Óscar Nájera # License: GPL-3 import argparse import csv import shlex import subprocess from datetime import datetime from collections import namedtuple ...
gpl-2.0
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/mgtv.py
1
1936
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class MGTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?mgtv\.com/(v|b)/(?:[^/]+/)*(?P<id>\d+)\.html' IE_DESC = '芒果TV' _TESTS = [{ 'url': 'http://www....
gpl-3.0
toshywoshy/ansible
lib/ansible/modules/network/fortios/fortios_log_fortiguard_override_setting.py
7
10836
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
maleficarium/youtube-dl
youtube_dl/extractor/fczenit.py
57
1471
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse class FczenitIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?fc-zenit\.ru/video/(?P<id>[0-9]+)' _TEST = { 'url': 'http://fc-zenit.ru/video/41044/', 'md5': '0e3fa...
unlicense
csachs/openmicroscopy
components/tools/OmeroPy/src/omero/util/figureUtil.py
15
10940
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2006-2009 University of Dundee. All rights reserved. # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Li...
gpl-2.0
AlmostBetterNetwork/podmaster-host
assets/management/commands/migrate_podcasts_to_assets.py
3
1849
from django.core.management.base import BaseCommand from django.db import models from assets.helpers.factory import create_asset_from_url from podcasts.models import Podcast, PodcastEpisode class Command(BaseCommand): help = 'Migrates podcasts from model fields to assets' def handle(self, *args, **options):...
apache-2.0
sharkykh/SickRage
lib/tornado/testing.py
19
28046
#!/usr/bin/env python """Support classes for automated testing. * `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase with additional support for testing asynchronous (`.IOLoop`-based) code. * `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy. * `main()`: A simple test runner (wra...
gpl-3.0
crvv/shadowsocks
utils/autoban.py
1033
2156
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
apache-2.0
s20121035/rk3288_android5.1_repo
external/chromium_org/components/cronet/tools/cr_cronet.py
25
1974
#!/usr/bin/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. """ cr_cronet.py - cr - like helper tool for cronet developers """ import argparse import os import sys def run(command): print command...
gpl-3.0
napkindrawing/ansible
lib/ansible/modules/cloud/google/gce_eip.py
70
6857
#!/usr/bin/python # Copyright 2017 Google 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 vers...
gpl-3.0
shepherd44/kernel_3.14.4
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
mengxn/tensorflow
tensorflow/python/ops/image_grad.py
101
3785
# 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...
apache-2.0
aakhundov/tf-rnn-adaptive
train_sort.py
1
5275
import sys import numpy as np import tensorflow as tf import tensorflow.contrib.rnn as rnn from act_wrapper import ACTWrapper from act_model import ACTModel from data import generate_sort_data def echo(message, file): print(message) file.write(message + "\n") SEED = 0 TRAIN_STEPS = 250000 BATCH_SIZE = 16...
apache-2.0
seungjin/app5-seungjin-net.appspot.com
django/contrib/gis/geos/prototypes/topology.py
311
2226
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', 'geos_difference', 'geos_envelope', 'geos_intersection', 'geos_linemerge', 'geos_pointonsurface', 'geos_pre...
bsd-3-clause
wolfskaempf/ga_statistics
lib/python2.7/site-packages/django/contrib/auth/migrations/0001_initial.py
143
4370
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.auth.models from django.core import validators from django.db import migrations, models from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__'), ] ...
mit
bleib1dj/boto
tests/unit/glacier/test_response.py
100
1656
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
whereismyjetpack/ansible
lib/ansible/modules/windows/win_iis_webapppool.py
15
2611
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # 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 t...
gpl-3.0
vipmike007/avocado-vt
virttest/remote_commander/remote_runner.py
1
26020
#!/usr/bin/env python ''' Created on Dec 6, 2013 :author: jzupka ''' import os import sys import select import time import stat import gc import logging import traceback import subprocess import string import random import shutil import signal import remote_interface import messenger as ms from .. import data_dir ...
gpl-2.0
girving/tensorflow
tensorflow/python/framework/framework_lib.py
39
3589
# 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...
apache-2.0
cranmer/parametrized-learning
taylor/rootnotes.py
1
1776
""" Helper module for displaying ROOT canvases in ipython notebooks Usage example: # Save this file as rootnotes.py to your working directory. import rootnotes c1 = rootnotes.default_canvas() fun1 = TF1( 'fun1', 'abs(sin(x)/x)', 0, 10) c1.SetGridx() c1.SetGridy() fun1.Draw() c1 Mo...
bsd-2-clause
balloob/home-assistant
homeassistant/components/homeassistant/__init__.py
11
6982
"""Integration providing core pieces of infrastructure.""" import asyncio import itertools as it import logging import voluptuous as vol from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL import homeassistant.config as conf_util from homeassistant.const import ( ATTR_ENTITY_ID, ATTR...
apache-2.0
yapdns/yapdnsbeat
vendor/github.com/elastic/beats/packetbeat/tests/system/test_0015_udpjson.py
10
2365
from packetbeat import BaseTest from nose.tools import nottest import socket class Test(BaseTest): @nottest def test_udpjson_config(self): """ Should start with sniffer and udpjson inputs configured. """ self.render_config_template( mysql_ports=[3306], i...
mit
LiangfengD/code-for-blog
2008/google_web_search.py
13
3674
# GoogleWebSearch # # Useful for executing web searches on Google and returning # result URLs. # # Depends on the following modules: # - BeautifulSoup: # For parsing the HTML results returned by Google # - mechanize: # For executing Google search queries # # Eli Bendersky (http://eli.thegreenplace.net...
unlicense
mclois/iteexe
twisted/test/proto_helpers.py
16
1647
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from twisted.protocols import basic from twisted.internet import error class LineSendingProtocol(basic.LineReceiver): lostConn = False ...
gpl-2.0
LeMinaw/minaw.net
register/views.py
1
2544
from django.shortcuts import render from django.http import HttpResponse from django.db import IntegrityError from urllib.request import urlopen from hashlib import sha256 from os import environ from register.models import * from register.forms import * from register.data impo...
gpl-3.0
seung-lab/cloud-volume
cloudvolume/sharedmemory.py
1
6678
from collections import defaultdict import errno import math import mmap import os import sys import time import multiprocessing as mp from six.moves import range import numpy as np from .lib import Bbox, Vec, mkdir SHM_DIRECTORY = '/dev/shm/' EMULATED_SHM_DIRECTORY = '/tmp/cloudvolume-shm' EMULATE_SHM = not os.pa...
bsd-3-clause
evinstk/TantechEngineOriginal
lib/googletest-release-1.7.0/test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, 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...
mit
alash3al/rethinkdb
external/v8_3.30.33.16/testing/gmock/gtest/xcode/Scripts/versiongenerate.py
3088
4536
#!/usr/bin/env python # # Copyright 2008, 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...
agpl-3.0
supriyasingh01/github_basics
Internetworking Distributed Project/finalProject/ovs/pox-master/pox/forwarding/l2_multi.py
5
11994
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
cc0-1.0
vasyarv/edx-platform
common/test/acceptance/tests/lms/test_lms_dashboard.py
64
3835
# -*- coding: utf-8 -*- """ End-to-end tests for the main LMS Dashboard (aka, Student Dashboard). """ from ..helpers import UniqueCourseTest from ...fixtures.course import CourseFixture from ...pages.lms.auto_auth import AutoAuthPage from ...pages.lms.dashboard import DashboardPage class BaseLmsDashboardTest(UniqueCo...
agpl-3.0
kennedyshead/home-assistant
homeassistant/components/meteo_france/config_flow.py
2
4663
"""Config flow to configure the Meteo-France integration.""" import logging from meteofrance_api.client import MeteoFranceClient import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_...
apache-2.0
johnzhd/gpsmap
gpsmap/db_build.py
1
2339
import pymongo import backend def clear_db(): connect = pymongo.MongoClient(backend.global_db_url) db = connect.get_database(backend.global_db_name) l = [backend.global_db_origin_collection, backend.global_db_user_collection, backend.global_db_device_collection, backend....
mit
wujinjun/TFbook
chapter5/mnist_lenet5.py
1
3795
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf mnist = input_data.read_data_sets("MNIST_data/",one_hot = True) #导入数据 sess = tf.InteractiveSession() #开启一个Session def weight_variable(shape): #定义一个权重变量 initial = tf.truncated_normal(shape,stddev=0.1) #初始化一个正态分布噪声,标准差为0....
gpl-3.0
charbeljc/OCB
addons/hw_posbox_upgrade/controllers/main.py
172
4161
# -*- coding: utf-8 -*- import logging import os import time import openerp import openerp.addons.hw_proxy.controllers.main as hw_proxy import threading from openerp import http from openerp.http import request from openerp.tools.translate import _ _logger = logging.getLogger(__name__) upgrade_template = """ <!DOCTY...
agpl-3.0
jaraco/pytest
_pytest/vendored_packages/pluggy.py
19
30741
""" PluginManager, basic initialization and tracing. pluggy is the cristallized core of plugin management as used by some 150 plugins for pytest. Pluggy uses semantic versioning. Breaking changes are only foreseen for Major releases (incremented X in "X.Y.Z"). If you want to use pluggy in your project you should thu...
mit
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/rest_framework_mongoengine/serializers.py
1
26652
import copy from collections import OrderedDict from mongoengine import fields as me_fields from mongoengine.errors import ValidationError as me_ValidationError from rest_framework import fields as drf_fields from rest_framework import serializers from rest_framework.compat import unicode_to_repr from rest_framework.u...
gpl-3.0
drayanaindra/shoop
doc/_ext/djangodocs.py
321
12049
""" Sphinx plugins for Django documentation. """ import json import os import re from docutils import nodes from docutils.parsers.rst import directives from sphinx import __version__ as sphinx_ver, addnodes from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.util.compat import Directive from sphinx.util...
agpl-3.0
hsum/sqlalchemy
test/orm/test_cycles.py
22
40070
"""Tests cyclical mapper relationships. We might want to try an automated generate of much of this, all combos of T1<->T2, with o2m or m2o between them, and a third T3 with o2m/m2o to one/both T1/T2. """ from sqlalchemy import testing from sqlalchemy import Integer, String, ForeignKey from sqlalchemy.testing.schema i...
mit
ishank08/scikit-learn
sklearn/ensemble/bagging.py
23
38399
"""Bagging meta-estimator.""" # Author: Gilles Louppe <g.louppe@gmail.com> # License: BSD 3 clause from __future__ import division import itertools import numbers import numpy as np from warnings import warn from abc import ABCMeta, abstractmethod from ..base import ClassifierMixin, RegressorMixin from ..externals....
bsd-3-clause
tima/ansible
test/units/modules/cloud/amazon/test_ec2_vpc_vpn.py
39
15021
# (c) 2017 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 dis...
gpl-3.0
GabrielBrascher/cloudstack
plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/OvmVifModule.py
8
1969
# 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...
apache-2.0
matthewzimmer/carnd-behavioral-cloning
zimpy/networks/tensorflow/single_layer_linear.py
2
12563
import tensorflow as tf import numpy as np import math import os from zimpy.networks.base_neural_network import BaseNeuralNetwork, ConfigurationContext, HyperParametersContext class SingleLayerHyperParametersContext(HyperParametersContext): def __init__( self, hidden_layer_neuron_count=51...
mit
petewarden/tensorflow_makefile
tensorflow/python/ops/state_grad.py
26
1080
# Copyright 2015 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 a...
apache-2.0
buddly27/champollion
source/champollion/parser/__init__.py
1
4953
# :coding: utf-8 """Parser to fetch_environment all information from a :term:`Javascript` API in order to document each element from a simple identifier. """ import os from .js_module import fetch_environment as fetch_module_environment from .js_file import fetch_environment as fetch_file_environment def fetch_env...
apache-2.0
mit-crpg/openmc
tests/regression_tests/source_file/test.py
11
2869
#!/usr/bin/env python import glob import os from tests.testing_harness import * settings1="""<?xml version="1.0"?> <settings> <state_point batches="10" /> <source_point separate="true" /> <eigenvalue> <batches>10</batches> <inactive>5</inactive> <particles>1000</particles> </eigenvalue> <sourc...
mit
oppia/oppia
scripts/setup.py
2
9861
# Copyright 2019 The Oppia 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 applicable ...
apache-2.0
icejoywoo/tornado
tornado/test/httpserver_test.py
68
41032
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import netutil from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str from tornado import gen from tornado.http1connection import HTTP1Connection from tornado...
apache-2.0
Sup3Roque/Pancas
plugin.video.loganaddon/resources/lib/sources/mvsnap_mv_tv.py
20
4443
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
gpl-2.0
OscarPDR/projects_morelab
semantic_search/views.py
1
3334
# coding: utf-8 from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.db.models import Sum, Min, Max from funding_programs.models import FundingProgram from p...
gpl-3.0
creasyw/IMTAphy
sandbox/default/lib/python2.4/site-packages/wnsbase/playground/plugins/Command.py
3
2085
############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) # Kopernikusstr. 16, D-...
gpl-2.0
stackforge/poppy
poppy/manager/base/providers.py
2
3390
# Copyright (c) 2014 Rackspace, 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 wr...
apache-2.0
jendap/tensorflow
tensorflow/contrib/distributions/python/ops/vector_laplace_linear_operator.py
21
11027
# 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...
apache-2.0
hsuchie4/TACTIC
src/pyasm/deprecated/flash/widget/flash_background_upload_wdg.py
6
1239
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
jsteemann/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/tests/test_dist.py
49
10335
# -*- coding: latin-1 -*- """Tests for distutils.dist.""" import distutils.cmd import distutils.dist import os import StringIO import sys import unittest import warnings from test.test_support import TESTFN class test_dist(distutils.cmd.Command): """Sample distutils extension command.""" user_options = [ ...
apache-2.0
ojengwa/django-1
tests/utils_tests/test_autoreload.py
23
3566
import os import tempfile from importlib import import_module from django import conf from django.contrib import admin from django.test import TestCase, override_settings from django.test.utils import extend_sys_path from django.utils._os import npath, upath from django.utils.autoreload import gen_filenames LOCALE_PA...
bsd-3-clause
SkyPicker/Skywall
skywall/core/frontend.py
1
3011
import os import html import json import subprocess import aiohttp.web from skywall.core.config import config from skywall.core.constants import API_ROUTE, BUILD_ROUTE from skywall.core.modules import import_enabled_modules def get_frontend(request): devel = config.get('devel') host = config.get('webpack.host...
gpl-3.0
suizokukan/anceps
anceps/hypotheses/hypothesis.py
1
2479
#!/usr/bin/python3 # -*- coding: utf-8 -*- ################################################################################ # Anceps Copyright (C) 2014 Suizokukan # Contact: suizokukan _A.T._ orange dot fr # # This file is part of Anceps. # Anceps is free software: you can redistribute it and/or modify # ...
gpl-3.0
leppa/home-assistant
homeassistant/components/influxdb/sensor.py
1
6880
"""InfluxDB component which allows you to get data from an Influx database.""" from datetime import timedelta import logging from influxdb import InfluxDBClient, exceptions import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_NA...
apache-2.0
mrshu/scikit-learn
sklearn/covariance/__init__.py
10
1197
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
bsd-3-clause
BlackstoneEngineering/yotta
yotta/version.py
3
2082
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import argparse import logging import os # version, , represent versions and specifications, internal from .lib import version # Component, , represents an installed componen...
apache-2.0
eahneahn/free
lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/storage.py
211
2794
from datetime import datetime from django.http import HttpRequest from django.conf import settings from django.utils.importlib import import_module from django.contrib.auth.models import User def get_request(): request = HttpRequest() engine = import_module(settings.SESSION_ENGINE) request.session = eng...
agpl-3.0
acsone/odoo
openerp/service/websrv_lib.py
380
7780
# -*- coding: utf-8 -*- # # Copyright P. Christeas <p_christ@hol.gr> 2008-2010 # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users who are looking ...
agpl-3.0
daniponi/django
django/contrib/admin/sites.py
3
19794
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.db.models.base import ModelBa...
bsd-3-clause
x303597316/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/update_permissions.py
35
1239
from django.core.management.base import BaseCommand from django.contrib.auth.management import create_permissions as _create_permissions from django_extensions.management.utils import signalcommand try: from django.apps import apps as django_apps get_models = lambda: None get_app = django_apps.get_app_con...
apache-2.0
ThorbenJensen/wifi-locator
src/utils_classification.py
1
2437
"""Module provides classification of signals and evaluates models.""" from random import randrange import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import VotingClassifier from sklearn.ensemble.weight_boosting import AdaBoostClassifier from sklearn.model_selection import c...
apache-2.0
dhalleine/tensorflow
tensorflow/python/platform/logging_test.py
211
1133
# 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...
apache-2.0
GoogleCloudPlatform/PerfKitBenchmarker
tests/windows_packages/psping_test.py
1
3148
# Copyright 2018 PerfKitBenchmarker 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 appli...
apache-2.0