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
huggingface/transformers
src/transformers/commands/lfs.py
2
7951
""" Implementation of a custom transfer agent for the transfer type "multipart" for git-lfs. Inspired by: github.com/cbartz/git-lfs-swift-transfer-agent/blob/master/git_lfs_swift_transfer.py Spec is: github.com/git-lfs/git-lfs/blob/master/docs/custom-transfers.md To launch debugger while developing: ``` [lfs "cust...
apache-2.0
hrashk/sympy
sympy/plotting/textplot.py
1
2000
from __future__ import print_function, division from sympy import * def textplot(expr, a, b, W=55, H=18): """ Print a crude ASCII art plot of the SymPy expression 'expr' (which should contain a single symbol, e.g. x or something else) over the interval [a, b]. Examples ======== textplot...
bsd-3-clause
vamin/MESS.DB
mess/utils.py
1
5267
# -*- coding: utf-8 -*- # Copyright 2013-2014 Victor Amin, http://vamin.net/ """MESS.DB utilities module This module contains helper functions and classes that are used by many mess modules. """ from __future__ import print_function from __future__ import unicode_literals import argparse import hashlib import json ...
agpl-3.0
thepiper/standoff
vpy/lib/python2.7/site-packages/flask/testsuite/views.py
561
5068
# -*- coding: utf-8 -*- """ flask.testsuite.views ~~~~~~~~~~~~~~~~~~~~~ Pluggable views. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import flask.views import unittest from flask.testsuite import FlaskTestCase from werkzeug.http import par...
gpl-3.0
starqiu/PythonLearn
Django-1.6.5/tests/files/tests.py
6
7421
from __future__ import absolute_import from io import BytesIO import os import gzip import shutil import tempfile from django.core.cache import cache from django.core.files import File from django.core.files.move import file_move_safe from django.core.files.base import ContentFile from django.core.files.uploadedfile ...
gpl-2.0
unaizalakain/django
django/contrib/staticfiles/utils.py
335
1976
import fnmatch import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured def matches_patterns(path, patterns=None): """ Return True or False depending on whether the ``path`` should be ignored (if it matches any pattern in ``ignore_patterns``). """ if patt...
bsd-3-clause
evstropov/django-webmoney-merchant
webmoney_merchant/forms.py
1
2066
import re from django import forms from django.utils.translation import ugettext_lazy as _ PURSE_RE = re.compile(r'^(?P<type>[BCDEGKRUXYZ])(?P<number>\d{12})$') WMID_RE = re.compile(r'^\d{12}$') class PaymentRequestForm(forms.Form): LMI_PAYMENT_AMOUNT = forms.DecimalField(max_digits=7, decimal_places=2, widget=f...
apache-2.0
EraYaN/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/bithdtv.py
48
5237
import traceback from bs4 import BeautifulSoup from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider log = CPLog(__name__) class Base(Torr...
gpl-3.0
aigamo/primecloud-controller
iaas-gw/src/iaasgw/controller/ec2/ec2LoadBalancercontroller.py
5
25854
# coding: UTF-8 # # Copyright 2014 by SCSK Corporation. # # This file is part of PrimeCloud Controller(TM). # # PrimeCloud Controller(TM) 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...
gpl-2.0
klothe/tablib
tablib/packages/xlrd3/xfcell.py
54
8607
# Author: mozman <mozman@gmx.at> # Purpose: xfcell -- cell with convenient xf function # Created: 04.12.2010 # Copyright (C) 2010, Manfred Moitzi # License: BSD-style licence """ The XFCell() object contains the data for one cell. WARNING: You don't call this class yourself. You access Cell objects via met...
mit
the76thHunter/tmdbsimple
tests/test_account.py
1
7205
# -*- coding: utf-8 -*- """ test_account.py ~~~~~~~~~~~~~~~ This test suite checks the methods of the Account class of tmdbsimple. Created by Celia Oakley on 2013-11-05 :copyright: (c) 2013-2014 by Celia Oakley. :license: GPLv3, see LICENSE for more details. """ import unittest import tmdbsimple as tmdb from test...
gpl-3.0
joariasl/odoo
addons/hr_recruitment/__openerp__.py
260
2780
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
csb-toolbox/CSB
csb/test/cases/bio/io/mrc/__init__.py
1
2664
import csb.test as test from csb.io import MemoryStream from csb.bio.io.mrc import DensityMapReader, DensityMapWriter, DensityMapFormatError, HeaderInfo, ByteOrder @test.unit class TestDensityMapReader(test.Case): def setUp(self): super(TestDensityMapReader, self).setUp() ...
mit
zuotingbing/spark
dev/create-release/translate-contributors.py
104
12627
#!/usr/bin/env python # # 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 "Lic...
apache-2.0
seaotterman/tensorflow
tensorflow/examples/adding_an_op/zero_out_op_1.py
190
1053
# 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
bayesimpact/bob-emploi
data_analysis/importer/deployments/uk/test/career_changers_test.py
1
1456
"""Tests for the bob_emploi.data_analysis.importer.deployments.uk.career_changers module.""" import io from os import path import unittest import requests_mock from bob_emploi.data_analysis.importer.deployments.uk import career_changers @requests_mock.mock() class TestCareerChangers(unittest.TestCase): """Test...
gpl-3.0
GarySparrow/mFlaskWeb
venv/Lib/site-packages/sqlalchemy/dialects/mssql/zxjdbc.py
21
2144
# mssql/zxjdbc.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mssql+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc :c...
mit
kaochiuan/HsinchuCityWebsite
HsinchuCityWebsite/HsinchuCityWebsite/app/templateModels.py
1
1595
 class temple(object): def __init__(self, name, locateRegion, mastergod, religiousBelief, organizationType, location, phone1, phone2): self.name = name self.locateRegion = locateRegion self.mastergod = mastergod self.religiousBelief = religiousBelief self.organizationType = ...
mit
hkariti/mopidy
tests/audio/test_actor.py
11
19047
from __future__ import absolute_import, unicode_literals import threading import unittest import gobject gobject.threads_init() import mock import pygst pygst.require('0.10') import gst # noqa import pykka from mopidy import audio from mopidy.audio.constants import PlaybackState from mopidy.internal import path ...
apache-2.0
omnirom/android_external_chromium-org
build/android/provision_devices.py
28
9689
#!/usr/bin/env python # # Copyright (c) 2013 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. """Provisions Android devices with settings required for bots. Usage: ./provision_devices.py [-d <device serial number>] """ ...
bsd-3-clause
yunity/foodsaving-backend
karrot/users/factories.py
1
1082
from django.contrib.auth import get_user_model from factory import DjangoModelFactory, CREATE_STRATEGY, LazyAttribute, PostGeneration, Sequence from karrot.utils.tests.fake import faker class UserFactory(DjangoModelFactory): class Meta: model = get_user_model() strategy = CREATE_STRATEGY is_...
agpl-3.0
DepthDeluxe/ansible
lib/ansible/modules/network/avi/avi_stringgroup.py
46
4045
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
robhudson/django
django/contrib/admin/migrations/0001_initial.py
419
1958
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.admin.models from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('conten...
bsd-3-clause
jiminliang/cuda-convnet2
make-data/make-data.py
179
7155
# Copyright 2014 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...
apache-2.0
elover/python-django-blog
myblog/pygments/lexers/foxpro.py
335
26220
# -*- coding: utf-8 -*- """ pygments.lexers.foxpro ~~~~~~~~~~~~~~~~~~~~~~ Simple lexer for Microsoft Visual FoxPro source code. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer from pygm...
mit
drbean/ultisnips
test/test_SnippetPriorities.py
5
4205
from test.vim_test_case import VimTestCase as _VimTest from test.constant import EX, ESC class SnippetPriorities_MultiWordTriggerOverwriteExisting(_VimTest): snippets = ( ("test me", "${1:Hallo}", "Types Hallo"), ("test me", "${1:World}", "Types World"), ("test me", "We overwrite", "Overwr...
gpl-3.0
fuhongliang/odoo
addons/hr_evaluation/__init__.py
432
1084
# -*- encoding: 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 G...
agpl-3.0
rodorad/spark-tk
regression-tests/generatedata/naive_bayes_generator.py
14
3334
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel 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 # # Unless require...
apache-2.0
inveniosoftware/invenio-oauthclient
invenio_oauthclient/views/client.py
1
8781
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Client blueprint used to handle OAuth callbacks.""" from flask import Blueprint, ...
mit
MSM8939-Samsung/android_kernel_samsung_a7lte
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
128technology/yinsolidated
test/plugin_json_test.py
1
5346
# Copyright 2016 128 Technology, Inc. """Unit tests for the yinsolidated pyang plugin""" from __future__ import unicode_literals import json import os import subprocess import pyang import pytest from yinsolidated.plugin import plugin YINSOLIDATED_PLUGIN_DIRECTORY = os.path.dirname(plugin.__file__) YIN_NAMESPAC...
mit
hpcleuven/easybuild-easyblocks
easybuild/easyblocks/a/abaqus.py
2
4177
## # Copyright 2009-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
martydill/url_shortener
code/venv/lib/python2.7/site-packages/IPython/nbconvert/utils/tests/test_pandoc.py
14
2546
"""Test Pandoc module""" #----------------------------------------------------------------------------- # Copyright (C) 2014 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #----------------------------...
mit
40223209/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/numbers.py
883
10398
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from abc import ABCMeta, abstractmethod __all__ = ["Number", "Complex", "Real", "Rat...
gpl-3.0
Taranys/Sick-Beard
lib/hachoir_parser/audio/midi.py
90
7912
""" Musical Instrument Digital Interface (MIDI) audio file parser. Documentation: - Standard MIDI File Format, Dustin Caldwell (downloaded on wotsit.org) Author: Victor Stinner Creation: 27 december 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, Bits, ParserError, S...
gpl-3.0
commonwealth-of-puerto-rico/lean
paart/apps/user_management/links.py
4
2691
from __future__ import absolute_import from django.utils.translation import ugettext_lazy as _ from navigation.classes import Link from .icons import (icon_user, icon_user_add, icon_user_edit, icon_user_delete, icon_group, icon_group_add, icon_group_edit, icon_group_delete, icon_set_password, icon_group_memb...
gpl-3.0
DavidLP/home-assistant
homeassistant/components/mqtt/cover.py
6
20154
"""Support for MQTT cover devices.""" import logging import voluptuous as vol from homeassistant.components import cover, mqtt from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, DEVICE_CLASSES_SCHEMA, SUPPORT_CLOSE, SUPPORT_CLOSE_TILT, SUPPORT_OPEN, SUPPORT_OPEN_TILT, SUPPORT_SET_...
apache-2.0
spatialdev/onadata
onadata/apps/viewer/migrations/0002_auto__add_field_datadictionary_xls.py
13
8621
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DataDictionary.xls' db.add_column('odk_viewer_datadictionary', 'xls', self.gf('django.db.m...
bsd-2-clause
alexryndin/ambari
ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil/examples/nettop.py
48
4716
#!/usr/bin/env python # # $Id: iotop.py 1160 2011-10-14 18:50:36Z g.rodola@gmail.com $ # # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Shows real-time network statistics. Author: Giampaolo Rodola'...
apache-2.0
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/test/test_glob.py
88
6941
import glob import os import shutil import sys import unittest from test.test_support import run_unittest, TESTFN def fsdecode(s): return unicode(s, sys.getfilesystemencoding()) class GlobTests(unittest.TestCase): def norm(self, *parts): return os.path.normpath(os.path.join(self.tempdir, *parts)) ...
mit
jbedorf/tensorflow
tensorflow/python/tpu/tpu_embedding.py
2
44069
# Copyright 2018 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
BigxMac/firefox-ios
scripts/xliff-cleanup.py
2
2807
#!/usr/bin/env python # # xliff-cleanup.py <files> # # 1. Remove all <file> sections that we do not care about. We only care about the # the one for our main app and those for our extensions. # # 2. Look at all remaining <file> sections and remove those strings that should not # be localized. Currently that ...
mpl-2.0
eaas-framework/virtualbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py
11
36459
## @file # This file is used to parse a Module file of .PKG file # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The full text ...
gpl-2.0
ChameleonCloud/horizon
openstack_dashboard/test/integration_tests/tests/test_login.py
6
1213
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
lepy/phuzzy
phuzzy/contrib/pydoe/doe_composite.py
1
6172
""" This code was originally published by the following individuals for use with Scilab: Copyright (C) 2012 - 2013 - Michael Baudin Copyright (C) 2012 - Maria Christopoulou Copyright (C) 2010 - 2011 - INRIA - Michael Baudin Copyright (C) 2009 - Yann Collette Copyright (C) 2009 - CEA - Jean-Marc Mart...
mit
brendanator/atari-rl
agents/training.py
1
3130
import os import tensorflow as tf from threading import Thread from networks.factory import NetworkFactory import util class Trainer(object): def __init__(self, config): util.log('Creating network and training operations') self.config = config # Creating networks factory = NetworkFactory(config) ...
mit
bowlofstew/Impala
tests/query_test/test_hdfs_caching.py
13
8247
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Validates limit on scan nodes # import logging import os import pytest from copy import copy from subprocess import call from tests.beeswax.impala_beeswax import ImpalaBeeswaxException from tests.common.impala_test_suite import * from tests.common.test_vector i...
apache-2.0
TeamExodus/external_chromium_org
build/android/gyp/aidl.py
81
1552
#!/usr/bin/env python # # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Invokes Android's aidl """ import optparse import os import sys from util import build_utils def main(argv): option_parser =...
bsd-3-clause
LukeMurphey/splunk-google-drive
src/bin/google_drive_app/pyasn1/codec/native/decoder.py
15
7671
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # from pyasn1 import debug from pyasn1 import error from pyasn1.type import base from pyasn1.type import char from pyasn1.type import tag from pyasn1.type import uni...
apache-2.0
mairin/anaconda
pyanaconda/anaconda.py
2
7956
#!/usr/bin/python # # anaconda: The Red Hat Linux Installation program # # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Red Hat, Inc. 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...
gpl-2.0
ibrahimsh/final-project-software-programming
HashTable.py
1
22420
__author__ = 'MatrixRev' import codecs import json import re from collections import Mapping from collections import defaultdict from collections import Counter import Levenshtein import nltk from nltk.corpus import stopwords import fileinput import string import os import collections import rdflib from rdflib.namespa...
apache-2.0
dscorbett/pygments
pygments/lexers/inferno.py
4
3117
# -*- coding: utf-8 -*- """ pygments.lexers.inferno ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Inferno os and all the related stuff. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, by...
bsd-2-clause
wilmoz/servo
components/script/dom/bindings/codegen/parser/tests/test_implements.py
264
5961
# Import the WebIDL module, so we can do isinstance checks and whatnot import WebIDL def WebIDLTest(parser, harness): # Basic functionality threw = False try: parser.parse(""" A implements B; interface B { attribute long x; }; interface ...
mpl-2.0
dfalt974/SickRage
lib/rebulk/chain.py
13
15353
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Chain patterns and handle repetiting capture group """ # pylint: disable=super-init-not-called import itertools from .loose import call, set_defaults from .match import Match, Matches from .pattern import Pattern, filter_match_kwargs from .remodule import re class _I...
gpl-3.0
bpyoung92/apprtc
src/app_engine/apprtc_test.py
5
6431
# Copyright 2014 Google Inc. All Rights Reserved. import json import time import unittest import webtest import analytics import apprtc import constants import probers from test_util import CapturingFunction from test_util import ReplaceFunction from google.appengine.api import memcache from google.appengine.ext im...
bsd-3-clause
AveryOS/binutils
gdb/testsuite/gdb.python/py-framefilter-invalidarg.py
46
1937
# Copyright (C) 2014-2015 Free Software Foundation, 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 License, or # (at your option) any later version. # # This progr...
gpl-2.0
onlineconvert/onlineconvert-api-sdk-python3
client/jobs_api.py
1
11925
#!/usr/bin/env python """ JobsApi.py Copyright 2015 SmartBear Software 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...
apache-2.0
basicthinker/THNVM
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/square_root.py
91
3871
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
jeanlinux/calibre
src/calibre/devices/mtp/test.py
14
9378
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
lidiamcfreitas/FenixScheduleMaker
oldFiles/project-env/lib/python2.7/site-packages/wheel/install.py
472
18070
""" Operations on existing wheel files, including basic installation. """ # XXX see patched pip to install import sys import warnings import os.path import re import zipfile import hashlib import csv import shutil try: _big_number = sys.maxsize except NameError: _big_number = sys.maxint from wheel.decorato...
bsd-2-clause
ssaamm/sign-language-translator
app.py
2
1970
from classifier import clf from flask import Flask, render_template, jsonify, request, json from hand_data import get_hand_position from lib import Leap import pickle import random import redis app = Flask(__name__) controller = Leap.Controller() controller.set_policy(Leap.Controller.POLICY_BACKGROUND_FRAMES) past_s...
mit
alanch-ms/PTVS
Python/Product/PythonTools/Templates/Projects/WorkerRoleProject/worker.py
3
1954
import os from time import sleep # # The azure library provides access to services made available by the # Microsoft Azure platform, such as storage and messaging. # # See http://go.microsoft.com/fwlink/?linkid=254360 for documentation and # example code. # from azure.servicebus import ServiceBusService from azure.st...
apache-2.0
code-kitchen/django-utensils
utensils/storage.py
1
1100
from django.conf import settings from storages.backends.s3boto import S3BotoStorage """ Store your static and media files on Amazon S3 easily. Example settings config: AWS = { 'STATIC': { 'location': 'static', # AWS_LOCATION 'querystring_auth': False, # AWS_QUERYSTRING_AU...
mit
walterreade/scikit-learn
sklearn/datasets/tests/test_base.py
33
7160
import os import shutil import tempfile import warnings import nose import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn...
bsd-3-clause
mdrumond/tensorflow
tensorflow/python/layers/convolutional_test.py
31
43050
# 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
schqiushui/android_kernel_htc_msm8974
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
Snifer/BurpSuite-Plugins
faraday/shell/core/helpers_python.py
2
14698
''' Faraday Penetration Test IDE - Community Version Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) See the file 'doc/LICENSE' for the license information ''' """ * This is an implementation of wcwidth() and wcswidth() (defined in * IEEE Std 1002.1-2001) for Unicode. * * http://www.opengr...
gpl-2.0
murix/openimu
libraries/adxl345driver/examples/ADXL345_run/accel_cal.py
16
1450
import scipy.optimize from pylab import * from numpy import * cal = open('cal1.dat') for f in [cal]: data = array([map(float, l.split()) for l in f.readlines()]) N = len(data[0]) x = data[:,0] y = data[:,1] z = data[:,2] data = data[:,:3] def cost(args): rs = diag(1. / array(arg...
gpl-3.0
a-parhom/edx-platform
cms/djangoapps/contentstore/tests/test_clone_course.py
21
6291
""" Unit tests for cloning a course between the same and different module stores. """ import json from django.conf import settings from mock import Mock, patch from opaque_keys.edx.locator import CourseLocator from contentstore.tasks import rerun_course from contentstore.tests.utils import CourseTestCase from course_...
agpl-3.0
elidrc/PSO
test_pso.py
1
1192
from benchmark_functions import * from pso import * import matplotlib.pyplot as plt iterations = 100 particles = 500 dimensions = 2 search_space = [[-5.12] * dimensions, [5.12] * dimensions] # print init_pso(iterations, particles, search_space) velocity, fitness, local_best, local_position, global_best, global_positi...
mit
sahana/Turkey
modules/unit_tests/s3/s3timeplot.py
14
74187
# -*- coding: utf-8 -*- # # Time Plot Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3timeplot.py # import datetime import random import unittest import dateutil.tz from gluon import * from s3.s3timeplot import * from s3.s3timeplot import tp_datetime fr...
mit
mjabri/holoviews
holoviews/element/path.py
1
8204
""" A Path element is a way of drawing arbitrary shapes that can be overlayed on top of other elements. Subclasses of Path are designed to generate certain common shapes quickly and condeniently. For instance, the Box path is often useful for marking areas of a raster image. Contours is also a subclass of Path but in...
bsd-3-clause
demsey/openembedded
contrib/weekly-changelog-report.py
7
2288
#!/usr/bin/python # generates an OE changelog for last weeks activity (Mon-Sun) assuming it is run on # any day of the following week # TODO # - remove patch count as it does not match after we remove "Merge branch" statements # - add bugzilla info import datetime import os today = datetime.date.today() # 0 = Mon...
mit
miguelfervi/SSBW-Restaurantes
restaurantes/lib/python2.7/site-packages/django/utils/safestring.py
478
4414
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ f...
gpl-3.0
TNT-Samuel/Coding-Projects
DNS Server/Source - Copy/Lib/site-packages/dask/bytes/tests/test_bytes_utils.py
5
4420
import io import pytest from dask.bytes.utils import read_block, seek_delimiter, infer_storage_options def test_read_block(): delimiter = b'\n' data = delimiter.join([b'123', b'456', b'789']) f = io.BytesIO(data) assert read_block(f, 1, 2) == b'23' assert read_block(f, 0, 1, delimiter=b'\n') ==...
gpl-3.0
androidarmv6/android_external_chromium_org
tools/unused-symbols-report.py
178
4793
#!/usr/bin/env python # Copyright (c) 2011 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. """Prints a report of symbols stripped by the linker due to being unused. To use, build with these linker flags: -Wl,--gc-sectio...
bsd-3-clause
nmartensen/pandas
pandas/tests/scalar/test_interval.py
7
4026
from __future__ import division from pandas import Interval import pytest import pandas.util.testing as tm @pytest.fixture def interval(): return Interval(0, 1) class TestInterval(object): def test_properties(self, interval): assert interval.closed == 'right' assert interval.left == 0 ...
bsd-3-clause
RobinQuetin/CAIRIS-web
cairis/cairis/tests/GoalTests.py
1
8342
import logging from urllib import quote import jsonpickle from Goal import Goal from GoalEnvironmentProperties import GoalEnvironmentProperties from tests.CairisTests import CairisTests __author__ = 'Robin Quetin' class GoalTests(CairisTests): # region Class fields logger = logging.getLogger(__name__) ex...
apache-2.0
omprakasha/odoo
addons/l10n_be_hr_payroll_account/__openerp__.py
298
1626
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
tiwillia/openshift-tools
scripts/remote-heal/remote-healer.py
5
6385
#!/usr/bin/python # vim: expandtab:tabstop=4:shiftwidth=4 ''' Tool to process and take action on incoming zabbix triggers. ''' # Disabling invalid-name because pylint doesn't like the naming conention we have. # pylint: disable=invalid-name import argparse import ConfigParser import logging import os import re imp...
apache-2.0
ssbarnea/ansible
lib/ansible/module_utils/facts/network/freebsd.py
232
1190
# 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 distributed in the hope that ...
gpl-3.0
bitmazk/django-people
people/admin.py
1
2123
"""Admin classes for the ``people`` app.""" from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from hvad.admin import TranslatableAdmin from . import models class NationalityAdmin(TranslatableAdmin): """Admin for the ``Nationality`` model.""" list_display = ['get_name',...
mit
wgerlach/pipeline
bin/archive/seq_type_guess.py
3
3744
#!/usr/bin/env python import os, sys, math, random, subprocess, gzip from collections import defaultdict from optparse import OptionParser from Bio import SeqIO from Bio.SeqIO.QualityIO import FastqGeneralIterator def seq_iter(file_hdl, stype): if stype == 'fastq': return FastqGeneralIterator(file_hdl) ...
bsd-2-clause
defionscode/ansible
lib/ansible/modules/network/aci/aci_switch_leaf_selector.py
7
10169
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.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_...
gpl-3.0
Kingdread/qutebrowser
qutebrowser/commands/runners.py
5
8580
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
with-git/tensorflow
tensorflow/python/kernel_tests/cholesky_op_test.py
4
14711
# 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
mikeing2001/LoopDetection
pox/forwarding/hub.py
32
1184
# 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...
gpl-3.0
madelynfreed/rlundo
venv/lib/python2.7/site-packages/yaml/resolver.py
474
8972
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
gpl-3.0
jocave/snapcraft
integration_tests/test_plainbox_provider_plugin.py
8
1165
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
Onirik79/aaritmud
src/controllers/game_connection_comet.py
1
1690
# -*- coding: utf-8 -*- """ Modulo per la gestione della connessione al gioco con tecnologia simil-comet. """ #= IMPORT ====================================================================== from twisted.web.server import NOT_DONE_YET from src.web_resource import WebResource #= CLASSI ==========================...
gpl-2.0
DirkHoffmann/indico
indico/modules/events/notes/models/notes_test.py
4
6197
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import pytest from sqlalchemy import inspect from sqlalchemy.exc import IntegrityError from indico.module...
gpl-3.0
sssemil/cjdns
node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-optimizations.py
247
3416
#!/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 sure optimization settings are extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Te...
gpl-3.0
terbolous/SickRage
lib/guessit/rules/__init__.py
20
2370
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Rebulk object default builder """ from rebulk import Rebulk from .markers.path import path from .markers.groups import groups from .properties.episodes import episodes from .properties.container import container from .properties.format import format_ from .properties....
gpl-3.0
coldmind/django
django/utils/cache.py
99
11172
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
bsd-3-clause
Workday/OpenFrame
tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/ec2/autoscale/test_group.py
90
36594
#!/usr/bin/env python # Copyright (c) 2012 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 ...
bsd-3-clause
ncoghlan/pip
setup.py
5
2853
import codecs import os import re import sys from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand here = os.path.abspath(os.path.dirname(__file__)) class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.tes...
mit
caoning1985/sqt
src/strategy_py/google/protobuf/json_format.py
18
27443
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
apache-2.0
mrunalp/docker
hack/infrastructure/docker-ci/deployment.py
4
6191
#!/usr/bin/env python import os, sys, re, json, requests, base64 from subprocess import call from fabric import api from fabric.api import cd, run, put, sudo from os import environ as env from datetime import datetime from time import sleep # Remove SSH private key as it needs more processing CONFIG = json.loads(re.s...
apache-2.0
lbishal/scikit-learn
sklearn/metrics/cluster/bicluster.py
359
2797
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
bsd-3-clause
sebastianlan/wedfairy-api
poll/models.py
1
1124
from django.db import models class Poll(models.Model): id = models.AutoField(primary_key=True) title = models.CharField(blank=True, null=True, max_length=255) message = models.TextField(blank=True, null=True) select = models.IntegerField(blank=True, null=True) type = models.IntegerField(blank=True...
mit