repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
CydarLtd/ansible
docs/bin/plugin_formatter.py
8
17963
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others # # 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 So...
gpl-3.0
bkahlert/seqan-research
raw/pmbs12/pmsb13-data-20120615/trunk/misc/seqan_instrumentation/bin/classes/simplejson/tests/test_fail.py
136
3555
from unittest import TestCase import simplejson as json # Fri Dec 30 18:57:26 2005 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_...
mit
kyspencer/3D_Empirical_Attainment_Function
test_avl_eaf3d.py
1
13963
''' test_avltree.py This python scripts tests methods in avltree_eaf3d.py, including new functions requested by the article authors. - remove_node() - floor_x() - higher_x() - lower_y() ''' import unittest import avltree_eaf3d as bst import eaf3D import numpy as np from operat...
mit
Vivek-anand-jain/ns3-aqm-blue
utils.py
179
4188
#! /usr/bin/env python # These methods are used by test.py and waf to look for and read the # .ns3rc configuration file, which is used to specify the modules that # should be enabled import os import sys def get_list_from_file(file_path, list_name): '''Looks for a Python list called list_name in the file specifi...
gpl-2.0
ActiveState/code
recipes/Python/577288_Maclaurinsseriessinh/recipe-577288.py
1
1381
#On the name of ALLAH and may the blessing and peace of Allah #be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam. #Author : Fouad Teniou #Date : 06/07/10 #version :2.6 """ maclaurin_sinh is a function to compute sinh(x) using maclaurin series and the interval of convergence is -inf < x < +inf sinh(...
mit
jamesblunt/edx-platform
lms/djangoapps/mobile_api/video_outlines/views.py
121
4888
""" Video Outlines We only provide the listing view for a video outline, and video outlines are only displayed at the course level. This is because it makes it a lot easier to optimize and reason about, and it avoids having to tackle the bigger problem of general XBlock representation in this rather specialized format...
agpl-3.0
graphite-project/whisper
bin/whisper-fetch.py
4
2665
#!/usr/bin/env python import sys import time import signal import optparse try: import whisper except ImportError: raise SystemExit('[ERROR] Please make sure whisper is installed properly') _DROP_FUNCTIONS = { 'zeroes': lambda x: x != 0, 'nulls': lambda x: x is not None, 'empty': lambda x: x != 0 and...
apache-2.0
GehenHe/Recognize-Face-on-Android
tensorflow/contrib/seq2seq/python/ops/attention_decoder_fn.py
19
18947
# 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
eliasrg/SURF2017
reference/hikmet.py
1
6092
import numpy as np from scipy.interpolate import interp1d from scipy.signal import convolve import matplotlib.pyplot as plt from tqdm import trange import sys, os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'code'))) from itertools import islice import numpy as np ...
mit
defance/edx-platform
common/lib/xmodule/xmodule/tests/test_library_content.py
24
23869
# -*- coding: utf-8 -*- """ Basic unit tests for LibraryContentModule Higher-level tests are in `cms/djangoapps/contentstore/tests/test_libraries.py`. """ from bson.objectid import ObjectId from mock import Mock, patch from xblock.fragment import Fragment from xblock.runtime import Runtime as VanillaRuntime from xmo...
agpl-3.0
appapantula/Mocha.jl
docs/conf.py
23
8570
# -*- coding: utf-8 -*- # # Mocha documentation build configuration file, created by # sphinx-quickstart on Thu Nov 13 00:43:40 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
kuraha4/roguelike-tutorial-python
src/engine.py
1
28069
# -*- coding: utf-8 -*- """Initialize the terminal and game, then start the game loop. New Todo: - Refactor engine.py - Make [Action]s classes Old Todo: - targting area indicator - use LIBTCOD-CFFI API instead of LEGACY TDL API - auto-targeting - translation within message_log.add_message Not...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/wsgiref/validate.py
92
15151
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Middlew...
gpl-2.0
tqtran7/horizon
horizon/forms/fields.py
14
9041
# Copyright 2012 Nebula, 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 agree...
apache-2.0
szilvajuhos/CAW
scripts/runtimeannotate.py
3
1643
#!/usr/bin/env python3 """ Annotates a BED file with RunHaplotypecaller run times Runtimes come from a trace.txt file. Run like this: python3 runtimeannotate.py intervals.bed trace.txt > annotated.bed """ import re import sys from itertools import islice duration_regex = re.compile('((?P<hours>[0-9]*)h($| ))?((?...
mit
liyy7/scrapy
scrapy/xlib/tx/_newclient.py
159
55339
# -*- test-case-name: twisted.web.test.test_newclient -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ An U{HTTP 1.1<http://www.w3.org/Protocols/rfc2616/rfc2616.html>} client. The way to use the functionality provided by this module is to: - Connect a L{HTTP11ClientProtocol} to an HT...
bsd-3-clause
G33KS44n/mysql-5.6
xtrabackup/test/kewpie/lib/server_mgmt/mysqld.py
24
23122
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010,2011 Patrick Crews # # 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 Soft...
gpl-2.0
EvanK/ansible
test/units/modules/remote_management/oneview/test_oneview_enclosure_facts.py
47
4912
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import unittest from oneview_module_loader import OneViewModuleBase from ansible.modules.remote_management.oneview.oneview_enclosure_facts i...
gpl-3.0
pokutnik/skype4py
Skype4Py/api/darwin.py
19
17797
""" Low level *Skype for Mac OS X* interface implemented using *Carbon distributed notifications*. Uses direct *Carbon*/*CoreFoundation* calls through the *ctypes* module. This module handles the options that you can pass to `Skype.__init__` for *Mac OS X* machines. - ``RunMainLoop`` (bool) - If set to False, Skype4P...
bsd-3-clause
jncornett/googletest
scripts/common.py
1180
2919
# Copyright 2013 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 foll...
bsd-3-clause
zlatinski/omap-android-drm-kms
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/boto/support/layer1.py
17
24929
# 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
ewindisch/nova
nova/api/openstack/compute/versions.py
7
8835
# Copyright 2011 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/LICENSE-2.0 # # Unless requ...
apache-2.0
jkonecny12/anaconda
pyanaconda/modules/payloads/payloads_interface.py
3
4596
# # DBus interface for packaging. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distri...
gpl-2.0
zhxwmessi/or-tools
examples/python/set_partition.py
34
4494
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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
ksetyadi/Sahana-Eden
models/sync.py
1
18000
# -*- coding: utf-8 -*- """ SYNC Synchronization, Model @author: Amer Tahir @author: nursix @version: 0.1.0 Resources: setting - Global synchronization settings status - Status of manual synchronization notification - Queue for notification messages ...
mit
benoitsteiner/tensorflow
tensorflow/contrib/util/loader.py
90
2003
# 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
mfornero/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
debugger06/MiroX
windows/setup.py
1
26692
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
gpl-2.0
dekadev/Deka-kernel-CM10.1-3.0
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
pihentagyu/django_chms
django_chms/settings.py
1
4970
""" Django settings for django_chms project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impor...
bsd-2-clause
srcLurker/home-assistant
homeassistant/components/bloomsky.py
22
2423
""" Support for BloomSky weather station. For more details about this component, please refer to the documentation at https://home-assistant.io/components/bloomsky/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.const import CONF_API_KEY from homeassista...
mit
newerthcom/savagerebirth
libs/python-2.72/Lib/test/test_mimetools.py
136
1778
import unittest from test import test_support import string import StringIO mimetools = test_support.import_module("mimetools", deprecated=True) msgtext1 = mimetools.Message(StringIO.StringIO( """Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Foo! """)) class MimeToolsT...
gpl-2.0
justinpotts/mozillians
vendor-local/lib/python/celery/decorators.py
14
1117
# -*- coding: utf-8 -*- """ celery.decorators✞ ================== Deprecated decorators, use `celery.task.task`, and `celery.task.periodic_task` instead. The new decorators does not support magic keyword arguments. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __fut...
bsd-3-clause
google-research/google-research
kws_streaming/models/model_flags.py
1
2775
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
preete-dixit-ck/incubator-airflow
airflow/operators/subdag_operator.py
18
3402
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
alheinecke/tensorflow-xsmm
tensorflow/python/kernel_tests/dense_update_ops_no_tsan_test.py
55
3017
# 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
ccnmtl/lettuce
tests/integration/lib/Django-1.2.5/django/core/management/commands/flush.py
52
3433
from optparse import make_option from django.conf import settings from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS from django.core.management import call_command from django.core.management.base import NoArgsCommand, CommandError from django.core.management.color import no_style from d...
gpl-3.0
kevin-teddy/gajim
src/common/zeroconf/client_zeroconf.py
2
21835
## common/zeroconf/client_zeroconf.py ## ## Copyright (C) 2006 Stefan Bethge <stefan@lanpartei.de> ## 2006 Dimitur Kirov <dkirov@gmail.com> ## ## This file is part of Gajim. ## ## Gajim is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published...
gpl-3.0
ema/conpaas
conpaas-services/src/conpaas/services/xtreemfs/agent/client.py
1
2080
# -*- coding: utf-8 -*- """ :copyright: (C) 2010-2013 by Contrail Consortium. """ from conpaas.core import https import httplib, json class AgentException(Exception): pass def _check(response): code, body = response if code != httplib.OK: raise Exception('Received http response code %d' % (code)) data =...
bsd-3-clause
darthm0e/WeatherStation-RPI
readings.py
1
3414
__author__ = 'jeremymorgan' # libraries import sys import urllib2 import json #import Adafruit_DHT import Adafruit_BMP.BMP085 as BMP085 # custom functions from ds18b20 import ds18b20_read_temp import tsl45315 import luxreader # Instance of TSL2561 Class luxrdr = tsl45315.TSL45315() # Config am2302Pin = 22 # Check ...
gpl-2.0
open-synergy/server-tools
base_export_manager/tests/test_ir_exports.py
13
1833
# -*- coding: utf-8 -*- # © 2015 Antiun Ingeniería S.L. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.exceptions import ValidationError from openerp.tests.common import TransactionCase class TestIrExportsCase(TransactionCase): def test_create_with_basic_data(sel...
agpl-3.0
charlescearl/VirtualMesos
third_party/libprocess/third_party/gmock-1.6.0/test/gmock_output_test.py
986
5999
#!/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...
apache-2.0
iceroad/baresoil-benchmark-image-resizer
lambda/src/PIL/GimpPaletteFile.py
21
1339
# # Python Imaging Library # $Id$ # # stuff to read GIMP palette files # # History: # 1997-08-23 fl Created # 2004-09-07 fl Support GIMP 2.0 palette files. # # Copyright (c) Secret Labs AB 1997-2004. All rights reserved. # Copyright (c) Fredrik Lundh 1997-2004. # # See the README file for information on usage ...
apache-2.0
jhcepas/ete
ete3/tools/ete_build_lib/task/cog_selector.py
2
10555
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the...
gpl-3.0
flit/pyOCD
pyocd/coresight/cortex_m_v8m.py
2
7538
# pyOCD debugger # Copyright (c) 2019-2020 Arm Limited # Copyright (c) 2021 Chris Reed # SPDX-License-Identifier: Apache-2.0 # # 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-2.0
imoseyon/leanKernel-d2usc-deprecated
external/webkit/Tools/Scripts/webkitpy/common/net/networktransaction.py
15
3051
# Copyright (C) 2010 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 th...
gpl-2.0
Sodki/ansible-modules-extras
monitoring/pagerduty_alert.py
121
7587
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
vrieni/orange
Orange/OrangeCanvas/canvas/items/linkitem.py
6
16367
""" ========= Link Item ========= """ import math from PyQt4.QtGui import ( QGraphicsItem, QGraphicsEllipseItem, QGraphicsPathItem, QGraphicsObject, QGraphicsTextItem, QGraphicsDropShadowEffect, QPen, QBrush, QColor, QPainterPath, QTransform ) from PyQt4.QtCore import Qt, QPointF, QEvent from .nodeitem ...
gpl-3.0
nkgilley/home-assistant
tests/components/gogogate2/test_config_flow.py
6
2322
"""Tests for the GogoGate2 component.""" from gogogate2_api import GogoGate2Api from gogogate2_api.common import ApiError from gogogate2_api.const import ApiErrorCode from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD, CONF_USERNAME from homeassistant.co...
apache-2.0
SimVascular/VTK
Filters/Core/Testing/Python/hull.py
20
1635
#!/usr/bin/env python import math import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Generate random planes to form a convex polyhedron. # Create a polyhedral representation of the planes. # create some points lying between 1<=r<5 (r is radius) # the po...
bsd-3-clause
hogarthj/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_inventory.py
18
3741
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # 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...
gpl-3.0
flavour/helios
models/09_project.py
3
69892
# -*- coding: utf-8 -*- """ Project Tracking & Management Project > Activity > Task although each level of the hierarchy can stand alone """ if deployment_settings.has_module("project"): from gluon.sqlhtml import CheckboxesWidget # ===========================================================...
mit
junho85/nxt-python
nxt/ipsock.py
21
1953
# nxt.ipsock module -- Server socket communication with LEGO Minstorms NXT # Copyright (C) 2011 zonedaobne, Marcus Wanner # # 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 t...
gpl-3.0
fspaolo/scikit-learn
sklearn/feature_extraction/tests/test_dict_vectorizer.py
7
3089
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause from random import Random import numpy as np import scipy.sparse as sp from nose.tools import assert_equal from nose.tools import assert_true from nose.tools import assert_false from numpy.testing import assert_array_equal from sklearn.feature_ext...
bsd-3-clause
SCORE42/nodeshot
nodeshot/interop/sync/management/commands/sync.py
1
5258
# coding=utf-8 from __future__ import absolute_import, unicode_literals from logging import exception from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.db.models import Q from django.utils.module_loading import imp...
gpl-3.0
abhishek-ch/hue
desktop/core/ext-py/Django-1.6.10/tests/swappable_models/tests.py
51
2639
from __future__ import absolute_import, unicode_literals from django.utils.six import StringIO from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core import management from django.db.models.loading import cache from django.test import TestCase fro...
apache-2.0
artus40/maraudes_project
notes/models.py
1
6302
import logging from django.utils import timezone from django.core.exceptions import ValidationError from django.shortcuts import reverse from django.db import models from . import managers from statistiques.models import FicheStatistique logger = logging.getLogger(__name__) HOMME = 'M' FEMME = 'Mme' GENRE_CHOICES = (...
gpl-3.0
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/test/test_unpack.py
174
2619
doctests = """ Unpack tuple >>> t = (1, 2, 3) >>> a, b, c = t >>> a == 1 and b == 2 and c == 3 True Unpack list >>> l = [4, 5, 6] >>> a, b, c = l >>> a == 4 and b == 5 and c == 6 True Unpack implied tuple >>> a, b, c = 7, 8, 9 >>> a == 7 and b == 8 and c == 9 True Unpa...
apache-2.0
mattiacarpin/telenor
waf-tools/misc.py
69
11666
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ This tool is totally deprecated Try using: .pc.in files for .pc files the feature intltool_in - see demos/intltool make-like rules """ import shutil, re, os from waflib import TaskGen, Node, Task, Utils, Build, Errors from waflib.TaskGen i...
gpl-2.0
DevOps4Networks/ansible
lib/ansible/plugins/lookup/__init__.py
31
3634
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
lcy-seso/Paddle
python/paddle/v2/dataset/conll05.py
5
9478
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
nakamotoSAMtoshi/sCoin
contrib/pyminer/pyminer.py
766
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
UniversalMasterEgg8679/ansible
test/units/modules/network/iosxr/test_iosxr_system.py
51
3747
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
WSDC-NITWarangal/django
tests/view_tests/tests/test_static.py
337
5470
from __future__ import unicode_literals import mimetypes import unittest from os import path from django.conf.urls.static import static from django.http import FileResponse, HttpResponseNotModified from django.test import SimpleTestCase, override_settings from django.utils.http import http_date from django.views.stat...
bsd-3-clause
iSumitG/vsm
vsm/model/lsa.py
1
4211
import numpy as np from scipy import sparse from scipy.sparse import linalg as linalgs __all__ = [ 'Lsa' ] class Lsa(object): """ """ def __init__(self, corpus=None, context_type=None, td_matrix=None): """ Initialize Lsa. :param corpus: A Corpus object containing the traini...
mit
jmacmahon/invenio
modules/miscutil/lib/inveniocfg_upgrader_unit_tests.py
3
5669
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011, 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (a...
gpl-2.0
pdbaines/KepleR
python/kplr_explore.py
1
2041
import kplr import pyfits import numpy as np client = kplr.API() dir(client) # Kepler ID # (if of interest) : KOI number # (if confirmed) : "Name" e.g., '62b' #koi = client.koi(952.01) planet = client.planet("62b") # or "Kepler-62 b" # This object has a lot of attributes (with names given # http://archive.sts...
mit
matrixise/odoo
addons/hr_attendance/__openerp__.py
52
2119
# -*- 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...
agpl-3.0
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_1_0/adv_setting_broker.py
17
26806
from ..broker import Broker class AdvSettingBroker(Broker): controller = "adv_settings" def show(self, **kwargs): """Shows the details for the specified adv setting. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:``...
apache-2.0
maiklos-mirrors/jfx78
modules/web/src/main/native/Tools/Scripts/webkitpy/common/prettypatch.py
140
2966
# Copyright (c) 2010 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 ...
gpl-2.0
bgaunt/openEcslent
engine/command.py
2
2741
#--------------------------------------------------------------------------- # Copyright 2010, 2011 Sushil J. Louis and Christopher E. Miles, # Evolutionary Computing Systems Laboratory, Department of Computer Science # and Engineering, University of Nevada, Reno. # # This file is part of OpenECSLENT # # OpenECS...
gpl-3.0
esakellari/root
tutorials/pyroot/tornado.py
7
1475
## \file ## \ingroup tutorial_pyroot ## Tornado example. ## ## \macro_image ## \macro_code ## ## \author Wim Lavrijsen from ROOT import TCanvas, TView, TPolyMarker3D, TPaveText from ROOT import gROOT, gBenchmark from math import cos, sin, pi gBenchmark.Start( 'tornado' ) d = 16 numberOfPoints = 200 numberOfCircles =...
lgpl-2.1
nvbn/thefuck
tests/rules/test_git_stash.py
5
1155
import pytest from thefuck.rules.git_stash import match, get_new_command from thefuck.types import Command cherry_pick_error = ( 'error: Your local changes would be overwritten by cherry-pick.\n' 'hint: Commit your changes or stash them to proceed.\n' 'fatal: cherry-pick failed') rebase_error = ( 'C...
mit
ojengwa/Bookie
bookie/views/stats.py
1
1512
"""Basic views with no home""" import logging from pyramid.view import view_config from bookie.lib.access import ReqAuthorize from bookie.models import BmarkMgr from bookie.models.auth import ActivationMgr from bookie.models.auth import UserMgr from bookie.views import BookieView LOG = logging.getLogger(__name__) ...
agpl-3.0
avneesh91/django
tests/forms_tests/field_tests/test_multivaluefield.py
18
5599
from datetime import datetime from django.forms import ( CharField, Form, MultipleChoiceField, MultiValueField, MultiWidget, SelectMultiple, SplitDateTimeField, SplitDateTimeWidget, TextInput, ValidationError, ) from django.test import SimpleTestCase beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'...
bsd-3-clause
MaizerGomes/youtube-dl
youtube_dl/extractor/nuvid.py
127
2665
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, ) from ..utils import ( parse_duration, unified_strdate, ) class NuvidIE(InfoExtractor): _VALID_URL = r'https?://(?:www|m)\.nuvid\.com/video/(?P<id>[0-9]+)' _TEST = {...
unlicense
nxnfufunezn/qtile
libqtile/widget/image.py
8
4384
# Copyright (c) 2013 dequis # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Adi Sieker # # 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 t...
mit
luiseduardohdbackup/odoo
openerp/addons/base/ir/ir_config_parameter.py
311
4463
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
gtoonstra/airflow
airflow/sensors/__init__.py
4
2711
# -*- 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 #...
apache-2.0
BFriedland/UserDataBase-Heroku
udbprojectpostgresVENV/settings.py
2
3226
""" Django settings for udbprojectpostgresVENV project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BA...
mit
raoulbq/scipy
scipy/linalg/matfuncs.py
46
19913
# # Author: Travis Oliphant, March 2002 # from __future__ import division, print_function, absolute_import __all__ = ['expm','expm2','expm3','cosm','sinm','tanm','coshm','sinhm', 'tanhm','logm','funm','signm','sqrtm', 'expm_frechet', 'expm_cond', 'fractional_matrix_power'] from numpy import (In...
bsd-3-clause
lino-framework/xl
lino_xl/lib/contacts/mixins.py
1
8336
# -*- coding: UTF-8 -*- # Copyright 2008-2017 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """Model mixins for `lino_xl.lib.contacts`. """ from builtins import object from django.db import models from django.conf import settings from django.utils.translation import gett...
bsd-2-clause
yongshengwang/builthue
desktop/core/ext-py/Django-1.4.5/tests/regressiontests/queries/tests.py
20
77554
from __future__ import absolute_import import datetime import pickle import sys from django.conf import settings from django.core.exceptions import FieldError from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS from django.db.models import Count from django.db.models.query import Q, ITER_CH...
apache-2.0
courtarro/gnuradio-wg-grc
gr-vocoder/python/vocoder/qa_g721_vocoder.py
57
1573
#!/usr/bin/env python # # Copyright 2011,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 optio...
gpl-3.0
LouisPlisso/analysis_tools
load_hdf5_data.py
1
1153
"Module to load hd5 files" import numpy as np import h5py def load_h5_dataset(dataset): "Retruns a numpy array of the hdf5 dataset." temp = np.zeros(dtype=dataset.dtype, shape=dataset.shape) temp = dataset[...] return temp def load_h5_datasets(h5py_file, fullpath=True): "Returns a dataset dicton...
gpl-3.0
bkeepers/pygments.rb
vendor/pygments-main/pygments/lexers/dotnet.py
197
26727
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
mit
mattbernst/polyhartree
support/ansible/modules/extras/network/citrix/netscaler.py
143
5056
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage Citrix NetScaler entities (c) 2013, Nandor Sivok <nandor@gawker.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 Softwa...
gpl-3.0
xubenben/scikit-learn
sklearn/neighbors/base.py
22
31143
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
bsd-3-clause
kaixinjxq/crosswalk-test-suite
webapi/tct-typedarrays-nonw3c-tests/typedarrays/tools/gentest.py
19
2635
#!/usr/bin/env python # Copyright (c) 2013 Intel Corporation. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this list # of conditions and th...
bsd-3-clause
alexthered/kienhoc-platform
openedx/core/djangoapps/credit/tasks.py
32
7887
""" This file contains celery tasks for credit course views. """ import datetime from pytz import UTC from django.conf import settings from celery import task from celery.utils.log import get_task_logger from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey, UsageKey from openedx.core.d...
agpl-3.0
rbarrois/volatildap
volatildap/server.py
1
14346
# -*- coding: utf-8 -*- # This software is distributed under the two-clause BSD license. """Temporary LDAP server based on OpenLdap for tests.""" from __future__ import unicode_literals import codecs import logging import os import random import socket import subprocess import sys import tempfile import time from ....
bsd-2-clause
mshafiq9/django
django/contrib/gis/db/backends/spatialite/introspection.py
391
3131
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import ( DatabaseIntrospection, FlexibleFieldLookupDict, ) from django.utils import six class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` ...
bsd-3-clause
wolfgangmauerer/prosoda
prosoda/cluster/codeBlock.py
1
1622
# This file is part of prosoda. prosoda 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even ...
gpl-2.0
RaresO/test
node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 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. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
prasannav7/ggrc-core
src/ggrc/login/noop.py
5
1902
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com """ggrc.login.noop Login as example user for development mode. """ import flask_...
apache-2.0
fengzhyuan/scikit-learn
benchmarks/bench_plot_parallel_pairwise.py
297
1247
# Author: Mathieu Blondel <mathieu@mblondel.org> # License: BSD 3 clause import time import pylab as pl from sklearn.utils import check_random_state from sklearn.metrics.pairwise import pairwise_distances from sklearn.metrics.pairwise import pairwise_kernels def plot(func): random_state = check_random_state(0) ...
bsd-3-clause
KnowNo/reviewboard
contrib/internal/devserver.py
10
1977
#!/usr/bin/env python from __future__ import print_function, unicode_literals import getopt import os import sys DEFAULT_HOST = "0.0.0.0" DEFAULT_PORT = "8080" def usage(): print("usage: %s options" % sys.argv[0]) print() print("OPTIONS:") print(" -h Show this message") print(" ...
mit
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/abc.py
488
7145
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" import types from _weakrefset import WeakSet # Instance of old-style class class _C: pass _InstanceType = type(_C()) def abstractmethod(funcobj): """A d...
mit