repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
kawamon/hue
apps/search/src/search/old_migrations/0003_auto__add_field_collection_owner.py
35
5828
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Collection.owner' db.add_column(u'search_collection', 'ow...
apache-2.0
celerityweb/django-haystack
haystack/management/commands/update_index.py
2
14661
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import logging import multiprocessing import os import time from datetime import timedelta from django.core.management.base import BaseCommand from django.db import close_old_connections, reset_queries from django.uti...
bsd-3-clause
praveen-pal/edx-platform
lms/djangoapps/verify_student/tests/test_models.py
1
2482
# -*- coding: utf-8 -*- from nose.tools import ( assert_in, assert_is_none, assert_equals, assert_raises, assert_not_equals ) from django.test import TestCase from student.tests.factories import UserFactory from verify_student.models import SoftwareSecurePhotoVerification, VerificationException class TestPhotoVer...
agpl-3.0
gkoelln/youtube-dl
youtube_dl/extractor/mtv.py
18
18984
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_xpath, ) from ..utils import ( ExtractorError, find_xpath_attr, fix_xml_ampersands, float_or_none, HEADRequest, RegexNotFoundError, sanitized_Request, s...
unlicense
hsum/sqlalchemy
test/dialect/mysql/test_compiler.py
2
21667
# coding: utf-8 from sqlalchemy.testing import eq_, assert_raises_message, expect_warnings from sqlalchemy import sql, exc, schema, types as sqltypes from sqlalchemy import Table, MetaData, Column, select, String, \ Index, Integer, ForeignKey, PrimaryKeyConstraint, extract, \ VARCHAR, NVARCHAR, Unicode, Unicod...
mit
jscn/django
tests/custom_managers/tests.py
18
23338
from __future__ import unicode_literals from django.db import models from django.test import TestCase from django.utils import six from .models import ( Book, Car, CustomManager, CustomQuerySet, DeconstructibleCustomManager, FunPerson, OneToOneRestrictedModel, Person, PersonFromAbstract, PersonManager, Pu...
bsd-3-clause
mogoweb/webkit_for_android5.1
webkit/Tools/Scripts/webkitpy/tool/bot/irc_command.py
15
5753
# 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 ...
apache-2.0
brainsqueezer/fffff
branches/version5/scripts/user_common_votes.py
7
2980
#! /usr/bin/env python from __future__ import division import MySQLdb import sys import time import datetime import gettext _ = gettext.gettext import argparse import dbconf from utils import * def main(): links = {} status = {} commons = {} queued_avoided = set() ages = {} parser = argparse.ArgumentParser(d...
agpl-3.0
adrienbrault/home-assistant
tests/components/geonetnz_quakes/test_sensor.py
8
4517
"""The tests for the GeoNet NZ Quakes Feed integration.""" import datetime from unittest.mock import patch from homeassistant.components import geonetnz_quakes from homeassistant.components.geonetnz_quakes import DEFAULT_SCAN_INTERVAL from homeassistant.components.geonetnz_quakes.sensor import ( ATTR_CREATED, ...
mit
AnTAVR/aai2
src/modules/part/l_mount.py
1
5458
import logging from abc import abstractmethod from gettext import gettext as _ from typing import List, Generator, Tuple from aai_framework.interface import ModuleInterface, DialogTestInterface from vendor.partinfo.all import Device from .l_main import format_items, NONE_ITEM_ID from .m_format import Module as ModuleP...
gpl-2.0
brandond/ansible
test/units/playbook/test_play_context.py
9
8350
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Ansible Project # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import p...
gpl-3.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sphinx/util/docstrings.py
5
2071
# -*- coding: utf-8 -*- """ sphinx.util.docstrings ~~~~~~~~~~~~~~~~~~~~~~ Utilities for docstring processing. :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys def prepare_docstring(s, ignore=1): """Convert a docstring in...
agpl-3.0
wilvk/ansible
lib/ansible/modules/network/nxos/nxos_evpn_global.py
23
2812
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
peterbraden/tensorflow
tensorflow/python/training/coordinator.py
2
14027
# 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
blinktrade/bitex
libs/jsonrpc/__init__.py
67
1125
""" Copyright (c) 2007 Jan-Klaas Kollhof This file is part of jsonrpc. jsonrpc is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later...
gpl-3.0
walterst/qiime
scripts/parallel_multiple_rarefactions.py
15
4939
#!/usr/bin/env python # File created on 14 Jul 2012 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" from...
gpl-2.0
cauchycui/scikit-learn
sklearn/tests/test_common.py
127
7665
""" General tests for all estimators in sklearn. """ # Authors: Andreas Mueller <amueller@ais.uni-bonn.de> # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause from __future__ import print_function import os import warnings import sys import pkgutil from sklearn.externals.six import PY3 fr...
bsd-3-clause
Team-Exhibit/android_kernel_samsung_u8500
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
tehmaze/ipcalc
test.py
2
11744
import unittest from ipcalc import IP, Network class TestSuite(unittest.TestCase): """Tests.""" def test_ipv4_1(self): net = Network('192.168.114.42', 23) self.assertTrue(str(net) == '192.168.114.42/23') self.assertTrue(str(net.to_ipv6().to_compressed()) == '2002:c0a8:722a::') ...
bsd-2-clause
tomschr/leo
bin/leo.py
1
10002
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function import argparse import logging from logging.config import dictConfig import os import sys if sys.version_info[0:2] <= (3, 7): from collections import OrderedDict else: # Preserve insertion order of dict objects in v3.7 ...
gpl-3.0
UstadMobile/exelearning-extjs5-mirror
exe/webui/listablock.py
1
18894
# -*- encoding: utf-8 -*- # =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
gpl-2.0
sertansenturk/tomato
src/tomato/symbolic/symbtr/graph.py
1
3180
# Copyright 2015 - 2018 Sertan Şentürk # # This file is part of tomato: https://github.com/sertansenturk/tomato/ # # tomato is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), either version 3 of the ...
agpl-3.0
google/grumpy
third_party/stdlib/bisect.py
7
2603
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ ...
apache-2.0
servo/servo
tests/wpt/web-platform-tests/common/security-features/scope/util.py
20
1381
import os from wptserve.utils import isomorphic_decode def get_template(template_basename): script_directory = os.path.dirname(os.path.abspath(isomorphic_decode(__file__))) template_directory = os.path.abspath( os.path.join(script_directory, u"template")) template_filename = os.path.join(template_director...
mpl-2.0
clawpack/seismic
2d/sloping_fault/setplot_surface.py
2
6017
""" Set up the plot figures, axes, and items to be done for each frame. This module is imported by the plotting routines and then the function setplot is called to set the plot parameters. """ import numpy as np from mapping import Mapping from clawpack.clawutil.data import ClawData import clawpack.seismic.dtopotoo...
bsd-2-clause
rgommers/statsmodels
statsmodels/stats/tests/test_statstools.py
8
10621
# TODO: Test robust skewness # TODO: Test robust kurtosis import numpy as np import pandas as pd from numpy.testing import (assert_almost_equal, assert_raises, TestCase) from statsmodels.stats.stattools import (omni_normtest, jarque_bera, durbin_watson, _medcouple_1d, medcouple,...
bsd-3-clause
divergence-kernel/d2lte-kernel
Documentation/target/tcm_mod_builder.py
4981
41422
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
kevinastone/sentry
tests/sentry/api/endpoints/test_event_details.py
15
1194
from datetime import datetime from django.core.urlresolvers import reverse from sentry.testutils import APITestCase class EventDetailsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) group = self.create_group() prev_event = self.create_event( event_id='...
bsd-3-clause
adelton/django
tests/csrf_tests/tests.py
152
19350
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
castroflavio/ryu
ryu/contrib/ovs/json.py
52
18638
# Copyright (c) 2010, 2011, 2012 Nicira, 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 agre...
apache-2.0
odinaryk/Gungnir
backend/one.py
1
3446
#encoding=utf-8 import Queue import urlparse import os import requests from urllib import quote from bs4 import BeautifulSoup import sys import json import re queue = Queue.Queue() processed_url = set() processed_img = set() PIC_ROOT = "cache" basket=[] pronum=3 def output(basket,filename): f=open(filename,'w') ...
gpl-3.0
yigitguler/django
django/contrib/auth/migrations/0001_initial.py
27
4002
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core import validators from django.db import models, migrations from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__'), ] operations = [ migration...
bsd-3-clause
Aloomaio/pymssql
tests/test_utils.py
4
6062
from .helpers import eq_ from _mssql import substitute_params def test_single_param(): res = substitute_params( 'SELECT * FROM employees WHERE id = %s', 13) eq_(res, b'SELECT * FROM employees WHERE id = 13') res = substitute_params( 'SELECT * FROM empl WHERE name = %s', b...
lgpl-2.1
farodin91/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/inputstream.py
618
30855
from __future__ import absolute_import, division, unicode_literals from six import text_type from six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import utils from io import String...
mpl-2.0
meteorcloudy/tensorflow
tensorflow/python/training/saver.py
4
86725
# 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
TomGiordano/kernel_huawei
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
802
2710
# Core.py - Python extension for perf trace, core functions # # 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. from collections import defaultdict def auto...
gpl-2.0
DhiaEddineSaidi/python-social-auth
social/backends/yahoo.py
70
6000
""" Yahoo OpenId, OAuth1 and OAuth2 backends, docs at: http://psa.matiasaguirre.net/docs/backends/yahoo.html """ from requests.auth import HTTPBasicAuth from social.utils import handle_http_errors from social.backends.open_id import OpenIdAuth from social.backends.oauth import BaseOAuth2, BaseOAuth1 class YahooO...
bsd-3-clause
samthor/intellij-community
python/helpers/docutils/parsers/rst/languages/he.py
57
3463
# Author: Meir Kriheli # Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language:...
apache-2.0
jimi-c/ansible
test/units/modules/network/f5/test_bigip_sys_global.py
27
4447
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import sys from nose.plugins.skip import SkipTest i...
gpl-3.0
CIRALabs/DSAP
src/web/dsapcfg.py
1
1287
from django.conf import settings import os import configparser def get_epp_conf(CONF_DIR): EPP_CFG_PATH = os.path.join(CONF_DIR, 'epp.conf') EPP_CFG_PARSER = configparser.ConfigParser() EPP_CFG_PARSER.read(EPP_CFG_PATH) EPP_CFG = EPP_CFG_PARSER['dsap'] return EPP_CFG def get_dsapcfg_parser(CONF_D...
mit
akretion/l10n-brazil
l10n_br_account_product/models/account_invoice_line.py
1
25788
# -*- coding: utf-8 -*- # Copyright (C) 2013 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import models, fields, api, _ from odoo.addons import decimal_precision as dp from odoo.exceptions import ValidationError from odoo.tools import float_compare from .product_t...
agpl-3.0
40223101/w16b_test
2015cd_midterm-master/static/Brython3.1.0-20150301-090019/Lib/base64.py
733
13975
#! /usr/bin/env python3 """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struct import binascii _...
agpl-3.0
uwafsl/MissionPlanner
Lib/site-packages/numpy/core/scons_support.py
54
6515
"""Code to support special facilities to scons which are only useful for numpy.core, hence not put into numpy.distutils.scons""" import sys import os from os.path import join as pjoin, dirname as pdirname, basename as pbasename from copy import deepcopy import code_generators from code_generators.generate_numpy_api ...
gpl-3.0
einarhuseby/arctic
arctic/fixtures/mongo.py
3
4631
# Copyright (C) 2013 by Clearcode <http://clearcode.cc> # and associates (see AUTHORS). # This file is part of pytest-dbfixtures. # pytest-dbfixtures is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, ei...
lgpl-2.1
BoundaryDev/boundary-plugin-mongodb-enterprise-dev
pysnmp/proto/proxy/rfc2576.py
4
9651
# PDU v1/v2c two-way proxy from pysnmp.proto import rfc1905, rfc3411, error from pysnmp.proto.api import v1, v2c from pysnmp import debug # 2.1.1 __v1ToV2ValueMap = { v1.Integer.tagSet: v2c.Integer32(), v1.OctetString.tagSet: v2c.OctetString(), v1.Null.tagSet: v2c.Null(), v1.ObjectIdentifier.tagSet: v...
apache-2.0
Siecje/asphalt
asphalt/core/context.py
1
9875
from asyncio import iscoroutinefunction, coroutine from collections import defaultdict from abc import ABCMeta, abstractmethod from typing import Optional, Callable, Any, Sequence, Dict from enum import Enum from .util import qualified_name, asynchronous from .resource import ResourceCollection, ResourceEventType, Res...
apache-2.0
xingrz/android_kernel_pifoundation_bcm2710
tools/perf/scripts/python/sctop.py
1996
2102
# 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
happya/LintCode
Largest Number.py
4
1211
""" Given a list of non negative integers, arrange them such that they form the largest number. Example Given [1, 20, 23, 4, 8], the largest formed number is 8423201. """ __author__ = 'Daniel' class Solution: def largestNumber(self, nums): """ Start off by enumerate simple examples Compa...
apache-2.0
Guneet-Dhillon/mxnet
example/rcnn/rcnn/io/image.py
34
5852
# 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
ytjiang/django
django/db/backends/mysql/client.py
520
1518
import subprocess from django.db.backends.base.client import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' @classmethod def settings_to_cmd_args(cls, settings_dict): args = [cls.executable_name] db = settings_dict['OPTIONS'].get('db', settings_dic...
bsd-3-clause
dednal/chromium.src
tools/cr/cr/actions/runner.py
56
2326
# Copyright 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. """A module for the Runner base class.""" import cr class Runner(cr.Action, cr.Plugin.Type): """Base class for implementing target runners. Runner im...
bsd-3-clause
silentsee/blog
www/sae/mail.py
1
8062
#!/usr/bin/env python # -*-coding: utf8 -*- """SAE Mail API Provides functions for application developers to deliver mail messages for their applications. Currently we only support send mail through SMTP asynchronously. Examle: 1. Send a simple plain-text message. from sae.mail import send_mail send_mai...
gpl-2.0
Jmainguy/ansible-modules-extras
packaging/os/svr4pkg.py
34
7966
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Boyd Adamson <boyd () boydadamson.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 th...
gpl-3.0
AsherGlick/Olympus-Server-Management
RemoteServer/client.py
1
3247
# This code is part of the Olympus Server Management Program #Copyright (C) 2011 Asher Glick # #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)...
bsd-2-clause
mtambos/brainstormcracy
controller/base.py
1
1543
from helpers.templates import serve_template from google.appengine.ext.db import ReferenceProperty class Base(object): def __init__(self, model_class): self.model_class = model_class self.template_path = "%s/" % self.model_class.__name__ def GET(self, key=None): if key is None: ...
mit
qoo00783/linux
scripts/gdb/linux/symbols.py
588
6302
# # gdb helper commands and functions for Linux kernel debugging # # load kernel and module symbols # # 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 import os import re from linux import module...
gpl-2.0
gsmaxwell/phase_offset_rx
gr-utils/src/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py
333
2474
# # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
yqm/sl4a
python/src/Tools/msi/uisample.py
89
147976
import msilib,os;dirname=os.path.dirname(__file__) AdminExecuteSequence = [ (u'InstallValidate', None, 1400), (u'InstallInitialize', None, 1500), (u'InstallFinalize', None, 6600), (u'InstallFiles', None, 4000), (u'InstallAdminPackage', None, 3900), (u'FileCost', None, 900), (u'CostInitialize', None, 800), (u'CostFinal...
apache-2.0
IanLee1521/django-crispy-forms
crispy_forms/tests/test_form_helper.py
14
19210
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import django from django import forms from django.core.urlresolvers import reverse from django.forms.models import formset_factory from django.middleware.csrf import _get_new_csrf_key from django.template import ( TemplateSyntaxError, Conte...
mit
ESS-LLP/erpnext
erpnext/patches/v5_4/stock_entry_additional_costs.py
89
2010
# Copyright (c) 2015, Web Notes 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 def execute(): frappe.reload_doctype("Stock Entry") frappe.reload_doctype("Stock Entry Detail") frappe...
gpl-3.0
surligas/gnuradio
gr-utils/python/modtool/gr-newmod/python/build_utils.py
252
7237
# # Copyright 2004,2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later ve...
gpl-3.0
yzl0083/orange
Orange/projection/linear.py
6
73482
#TODO: eliminate create_pls_projection (transform into a class) #TODO: Projector as a preprocessor import Orange from Orange import orangeom import math import random import numpy from Orange import classification, data, feature from Orange.classification import knn from Orange.data.preprocess.scaling import ScaleLi...
gpl-3.0
hzlf/openbroadcast
website/apps/alibrary/ajax.py
1
11064
from django.core import serializers from dajax.core import Dajax from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from dajaxice.decorators import dajaxice_register from alibrary.models import APILookup, Release, Relation, Label...
gpl-3.0
MetSystem/PTVS
Python/Tests/TestData/DjangoAnalysisTestApp/DjangoAnalysisTestApp/wsgi.py
18
1192
""" WSGI config for DjangoAnalysisTestApp project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the `...
apache-2.0
initNirvana/Easyphotos
env/lib/python3.4/site-packages/IPython/utils/syspathcontext.py
30
2164
# encoding: utf-8 """ Context managers for adding things to sys.path temporarily. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license...
mit
theflofly/tensorflow
tensorflow/python/data/experimental/kernel_tests/optimization/choose_fastest_dataset_test.py
12
3645
# Copyright 2019 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
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py
19
3499
from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.core.management import BaseCommand from django.db import DEFAULT_DB_ALIAS, router from django.db.models.deletion import Collector from django.utils import six from django.utils.six.moves import input from ...management ...
gpl-3.0
haad/ansible
lib/ansible/modules/network/cloudengine/ce_ntp.py
22
21086
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
foodszhang/kbengine
kbe/src/lib/python/Lib/distutils/tests/test_install_headers.py
147
1264
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
lgpl-3.0
hybrideagle/django
tests/admin_docs/tests.py
116
19180
import datetime import sys import unittest from django.conf import settings from django.contrib.admindocs import utils from django.contrib.admindocs.views import get_return_data_type from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse fr...
bsd-3-clause
bayusantoso/final-assignment-web-ontology
IMPLEMENTATION/Application/SourceCode/GOApps/flask/Lib/encodings/cp1254.py
272
13502
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
gpl-3.0
blakfeld/Advent-of-Code-2016
daythree/day_three.py
1
3447
#!/usr/bin/env python """ --- Day 3: Squares With Three Sides --- Now that you can think clearly, you move deeper into the labyrinth of hallways and office furniture that makes up this part of Easter Bunny HQ. This must be a graphic design department; the walls are covered in specifications for triangles. Or are they...
mit
sobercoder/gem5
src/arch/x86/isa/insts/x87/compare_and_test/classify.py
91
2149
# 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
futurecore/python-csp
test/winder_bug/pi_python_python-csp_single_separate.py
3
1822
#!/usr/bin/env python # -*- mode:python; coding:utf-8; -*- # Calculation of Pi using quadrature. Using the python-csp package by Sarah Mount. # # Copyright © 2009-10 Russel Winder import time import multiprocessing import sys sys.path.insert(0, "../..") from csp.csp import * @process def calculator ( channel , ...
gpl-2.0
richard-willowit/odoo
odoo/cli/start.py
17
3094
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import glob import itertools import os import sys from . import Command from .server import main from odoo.modules.module import get_module_root, MANIFEST_NAMES from odoo.service.db import _create_empty_database, Databa...
gpl-3.0
isandlaTech/cohorte-devtools
org.cohorte.eclipse.runner.basic/files/jython/Lib/atexit.py
336
1705
""" atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination. One public function, register, is defined. """ __all__ = ["register"] import sys _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in rev...
apache-2.0
uArm-Developer/UArmForROS
scripts/report_stopper_node.py
1
2136
#!/usr/bin/env python ''' # File Name : report_stopper_node.py # Author : Joey Song # Version : V1.0 # Date : 6 Jan, 2016 # Modified Date : 6 Jan, 2016 # Description : This documents is for uarm ROS Library and ROS package # Copyright(C) 2016 uArm Team. All right reserved. ''' # All libraries needed to import # Im...
bsd-2-clause
cloudnull/rpc-maas
playbooks/files/rax-maas/plugins/process_check_host.py
4
5304
#!/usr/bin/env python # # Copyright 2015, Rackspace US, 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 applicab...
apache-2.0
bygreencn/gitextensions
Setup/set_version_to.py
42
5199
import argparse, sys if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-v', '--version', help='numeric product version') parser.add_argument('-t', '--text', default=None, help='text product version') args = parser.parse_args...
gpl-3.0
drwyrm/Flexget
flexget/tests/api_tests/test_secrets_api.py
1
1391
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flexget.manager import Session from flexget.plugins.modify.config_secrets import Secrets from flexget.utils import json class TestSecretsAPI(object): config = 't...
mit
alazaro/tennis_tournament
django/contrib/localflavor/fi/fi_municipalities.py
394
10822
# -*- coding: utf-8 -*- """ An alphabetical list of Finnish municipalities for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ MUNICIPALITY_CHOICES = ( ('akaa', u"Akaa"), ('alajarvi', u"Alajärvi"), ('alavieska', u"Alav...
gpl-3.0
desertofunknown/Fallout-13-EN
bot/C_rtd.py
67
3045
import random def rtd(data,debug,sender): backo = data try: arg1,arg2 = backo.split("d") except ValueError, err: return("Too many or too small amount of arguments") else: if debug: print sender+":!rtd "+arg1+"d"+arg2 #faster than using %s's die,die2 = [],[] current_mark = "" outcom...
agpl-3.0
ivan-fedorov/intellij-community
python/helpers/coverage/data.py
209
9188
"""Coverage data for Coverage.""" import os from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622 from coverage.files import PathAliases from coverage.misc import file_be_gone class CoverageData(object): """Manages collected coverage data, including file storage. The data file for...
apache-2.0
sahana/Turkey
modules/pygsm/prober.py
62
1874
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 def probe(verbose=False): """Searches for probable ports on the system""" import platform from gsmmodem import GsmModem import serial # Common baudrates in approximate popularity order baudrates = [115200, 9600, 19200] ports ...
mit
jhawkesworth/ansible
test/units/modules/storage/netapp/test_na_ontap_quotas.py
38
8955
''' unit tests ONTAP Ansible module: na_ontap_quotas ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes import ansible.module_utils.netapp as ne...
gpl-3.0
kisna72/django
tests/m2m_recursive/models.py
410
1120
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
bsd-3-clause
littledogboy/zulip
zerver/lib/test_helpers.py
113
12407
from django.test import TestCase from zerver.lib.initial_password import initial_password from zerver.lib.db import TimeTrackingCursor from zerver.lib import cache from zerver.lib import event_queue from zerver.worker import queue_processors from zerver.lib.actions import ( check_send_message, create_stream_if_ne...
apache-2.0
eomerdws/aeneas
aeneas/tests/long_test_task_rconf.py
5
16852
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
agpl-3.0
plxaye/chromium
src/build/android/gyp/push_libraries.py
1
1995
#!/usr/bin/env python # # Copyright 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. """Pushes native libraries to a device. """ import json import optparse import os import sys from util import build_utils from uti...
apache-2.0
sdispater/eloquent
tests/test_integration.py
1
9770
# -*- coding: utf-8 -*- import arrow from . import EloquentTestCase from eloquent import Model, Collection from eloquent.connections import SQLiteConnection from eloquent.connectors.sqlite_connector import SQLiteConnector from eloquent.exceptions.orm import ModelNotFound class EloquentIntegrationTestCase(EloquentTes...
mit
charmoniumQ/Surprise
surprise/prediction_algorithms/random_pred.py
1
1302
""" Algorithm predicting a random rating. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from .algo_base import AlgoBase class NormalPredictor(AlgoBase): """Algorithm predicting a random rating based on the distribution of the...
bsd-3-clause
emceethemouth/kernel_mainline
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
tlksio/tlksio
env/lib/python3.4/site-packages/django/contrib/messages/storage/cookie.py
116
6560
import json from django.conf import settings from django.contrib.messages.storage.base import BaseStorage, Message from django.http import SimpleCookie from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.safestring import SafeData, mark_safe class Message...
mit
novels-project/british-fiction-1770-1836
scripts/process-british-fiction-1830-1836.py
1
3826
#!/usr/bin/env python3 import collections import json import logging import os import re import bs4 BASE_DIR = os.path.abspath(__file__ + '/../../') INPUT_DIR = os.path.join(BASE_DIR, 'data', 'www.cf.ac.uk') OUTPUT_DIR = os.path.join(BASE_DIR, 'data') OUTPUT_FN = os.path.join(OUTPUT_DIR, 'british-fiction-1830-1836.j...
cc0-1.0
Aptitudetech/ERPNext
erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
1
42014
# 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 import unittest, copy from frappe.utils import nowdate, add_days, flt from frappe.model.dynamic_links import get_dynamic_link_map from erp...
cc0-1.0
erdc/proteus
proteus/PostProcessingTools.py
1
350930
#! /usr/bin/env python """ Collect classes and routines for postprocessing solution to get quantities like conservative velocities, higher accuracy, etc .. inheritance-diagram:: proteus.PostProcessingTools :parts: 1 """ from __future__ import print_function from __future__ import absolute_import from __future__ im...
mit
xcrespo/mbed
workspace_tools/export/ds5_5.py
32
1979
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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
willhardy/django
tests/auth_tests/test_templates.py
25
2705
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( password_change, password_change_done, password_reset, password_reset_complete, password_reset_confirm, password_res...
bsd-3-clause
jss-emr/openerp-7-src
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
4
3249
########################################################################## # # Portions of this file are under the following copyright and license: # # # Copyright (c) 2003-2004 Danny Brewer # d29583@groovegarden.com # # This library is free software; you can redistribute it and/or # modify it under the ter...
agpl-3.0
oliciv/youtube-dl
youtube_dl/extractor/jpopsukitv.py
170
2584
# coding=utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unified_strdate, ) class JpopsukiIE(InfoExtractor): IE_NAME = 'jpopsuki.tv' _VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)' _TEST = { ...
unlicense