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 |
|---|---|---|---|---|---|
erdincay/youtube-dl | youtube_dl/options.py | 5 | 37003 | from __future__ import unicode_literals
import os.path
import optparse
import shlex
import sys
from .downloader.external import list_external_downloaders
from .compat import (
compat_expanduser,
compat_get_terminal_size,
compat_getenv,
compat_kwargs,
)
from .utils import (
preferredencoding,
w... | unlicense |
bosstb/HaberPush | youtube_dl/extractor/hotstar.py | 33 | 3711 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
)
class HotStarIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hotstar\.com/(?:.+?[/-])?(?P<id>\d{10})'
_TESTS = [{
'url': 'http... | mit |
graehl/yaml-cpp.core | test/gmock-1.7.0/test/gmock_test_utils.py | 769 | 3684 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
zzhy1996/chase-or-not | chaseornotwebapi/Homepage/questionnare/urls.py | 2 | 1205 | """ChaseOrNotWeb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | mit |
splav/servo | components/script/dom/bindings/codegen/parser/tests/test_cereactions.py | 15 | 3205 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface Foo {
[CEReactions(DOMString a)] void foo(boolean arg2);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown for... | mpl-2.0 |
dato-code/how-to | experiment_over_parameters.py | 3 | 2776 | # The following two utility functions are useful when you want
# to try out a variety of argument values for a given function.
import graphlab as gl
import itertools
def crossproduct(d):
"""
Create an SFrame containing the crossproduct of all provided options.
Parameters
----------
d : dict
... | cc0-1.0 |
jackTheRipper/iotrussia | web_server/lib/flask-master/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-2.0 |
mezz64/home-assistant | tests/components/rfxtrx/test_sensor.py | 14 | 12370 | """The tests for the Rfxtrx sensor platform."""
import pytest
from homeassistant.components.rfxtrx import DOMAIN
from homeassistant.components.rfxtrx.const import ATTR_EVENT
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
TEMP_CELSIUS,
)
from ... | apache-2.0 |
archf/ansible | lib/ansible/plugins/terminal/asa.py | 28 | 2414 | #
# (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 d... | gpl-3.0 |
leah/python-oauth | oauth/example/server.py | 375 | 7669 | """
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | mit |
nathanial/lettuce | tests/integration/lib/Django-1.2.5/django/views/i18n.py | 44 | 8933 | import os
import gettext as gettext_module
from django import http
from django.conf import settings
from django.utils import importlib
from django.utils.translation import check_for_language, activate, to_locale, get_language
from django.utils.text import javascript_quote
from django.utils.encoding import smart_unicod... | gpl-3.0 |
lgscofield/odoo | addons/gamification/wizard/grant_badge.py | 280 | 2230 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 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 |
brianjgeiger/osf.io | osf/models/osf_group.py | 10 | 19478 | import logging
import functools
from django.apps import apps
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from guardian.shortcuts import assign_perm, remove_perm, get_perms, get_objects_for_group, get_... | apache-2.0 |
VisTrails/VisTrails | vistrails/db/versions/v1_0_1/domain/log.py | 9 | 3202 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
bzennn/blog_flask | python/lib/python3.5/site-packages/jinja2/__init__.py | 73 | 2565 | # -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% ... | gpl-3.0 |
riccardomc/moto | moto/route53/models.py | 3 | 10249 | from __future__ import unicode_literals
import uuid
from jinja2 import Template
from moto.core import BaseBackend
from moto.core.utils import get_random_hex
class HealthCheck(object):
def __init__(self, health_check_id, health_check_args):
self.id = health_check_id
self.ip_address = health_check... | apache-2.0 |
mitch-kyle/message-board | support/apache-cassandra-2.2.1/pylib/cqlshlib/tracing.py | 86 | 3055 | # 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 |
fevangelou/namebench | nb_third_party/dns/rdtypes/ANY/CNAME.py | 248 | 1092 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
ericgriffin/metasort | lib/boost/tools/build/v2/tools/mc.py | 35 | 1603 | # Copyright (c) 2005 Alexey Pakhunov.
# Copyright (c) 2011 Juraj Ivancic
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
# Support for Microsoft message compiler tool.
# Notes:
# - there'... | apache-2.0 |
romerojunior/cloudian-api | cloudianapi/components/qos.py | 1 | 1104 | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Copyright 2017, Schuberg Philis BV
#
# 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... | apache-2.0 |
RockySteveJobs/python-for-android | python-build/python-libs/gdata/src/atom/service.py | 135 | 28680 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008 Google 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 app... | apache-2.0 |
NSLS-II-SRX/ipython_ophyd | profile_srx_user/ipython_qtconsole_config.py | 13 | 24674 | # Configuration file for ipython-qtconsole.
c = get_config()
#------------------------------------------------------------------------------
# IPythonQtConsoleApp configuration
#------------------------------------------------------------------------------
# IPythonQtConsoleApp will inherit config from: BaseIPythonA... | bsd-2-clause |
ilya-epifanov/ansible | v1/ansible/module_utils/gce.py | 305 | 4179 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
Infernion/django-wiki | wiki/plugins/mediawikiimport/management/commands/mediawiki_import.py | 7 | 7767 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
import getpass
from wiki.models.article import ArticleRevision, ArticleForObject, Article
from wiki.models.urlpath import URLPath
from... | gpl-3.0 |
Ophiuchus1312/enigma2-master | lib/python/Screens/Setup.py | 1 | 9218 | from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap, ActionMap
from Components.config import config, ConfigNothing, ConfigYesNo, ConfigSelection, ConfigText, ConfigPassword
from Tools.Directories import resolveFilename, SCOPE_CURRENT_PLUGIN
from Components.SystemInfo import SystemInfo
fro... | gpl-2.0 |
shinfan/api-client-staging | generated/python/proto-google-cloud-monitoring-v3/google/cloud/proto/monitoring/v3/metric_service_pb2.py | 7 | 53346 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/proto/monitoring/v3/metric_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goo... | bsd-3-clause |
Jobava/git-cola | cola/widgets/stash.py | 4 | 7107 | """Provides the StashView dialog."""
from __future__ import division, absolute_import, unicode_literals
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from PyQt4.QtCore import SIGNAL
from cola import cmds
from cola import qtutils
from cola import utils
from cola.i18n import N_
from cola.... | gpl-2.0 |
ZenDevelopmentSystems/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 248 | 2903 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
AzamYahya/shogun | tests/integration/generator/clustering.py | 21 | 1619 | """Generator for Clustering
"""
from numpy import matrix
from shogun.Distance import EuclideanDistance
import shogun.Clustering as clustering
from shogun.Library import Math_init_random
import fileop
import featop
import dataop
import category
def _run (name, first_arg):
"""
Run generator for a specific clusteri... | gpl-3.0 |
40223117cda/2015_cd0505 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testpatch.py | 739 | 53126 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... | agpl-3.0 |
SimonSapin/servo | tests/wpt/web-platform-tests/tools/third_party/more-itertools/more_itertools/tests/test_more.py | 39 | 62676 | from __future__ import division, print_function, unicode_literals
from decimal import Decimal
from doctest import DocTestSuite
from fractions import Fraction
from functools import partial, reduce
from heapq import merge
from io import StringIO
from itertools import (
chain,
count,
groupby,
islice,
... | mpl-2.0 |
zhangzhonglai/heron | heron/common/src/python/basics/gateway_looper.py | 10 | 3998 | # Copyright 2016 Twitter. 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 agree... | apache-2.0 |
marcoarruda/MissionPlanner | Lib/site-packages/numpy/f2py/tests/test_array_from_pyobj.py | 59 | 20418 | import unittest
import os
import sys
import copy
import nose
from numpy.testing import *
from numpy import array, alltrue, ndarray, asarray, can_cast,zeros, dtype
from numpy.core.multiarray import typeinfo
import util
wrap = None
def setup():
"""
Build the required testing extension module
"""
glob... | gpl-3.0 |
wshallum/ansible | test/units/module_utils/json_utils/test_filter_non_json_lines.py | 18 | 3102 | # -*- coding: utf-8 -*-
# (c) 2016, Matt Davis <mdavis@ansible.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 o... | gpl-3.0 |
wshallum/ansible | lib/ansible/modules/notification/slack.py | 1 | 10102 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, René Moser <mail@renemoser.net>
# (c) 2015, Stefan Berggren <nsg@nsg.cc>
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... | gpl-3.0 |
ebonymarieb/django-calaccess-raw-data | example/toolbox/management/commands/analyzecoderush.py | 17 | 1650 | import os
import time
import calculate
from github import Github
from datetime import datetime
from django.conf import settings
from calaccess_raw import get_model_list
from calaccess_raw.management.commands import CalAccessCommand
from django.contrib.humanize.templatetags.humanize import intcomma
class Command(CalAc... | mit |
albertomurillo/ansible | lib/ansible/module_utils/aws/waiters.py | 8 | 10427 | # Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
try:
import botocore.waiter as core_waiter
except ImportError:
pass # caught by HAS_BOTO3
ec2_data = {
"version": 2,
"waiters": {
"RouteTableExists": {
... | gpl-3.0 |
ngoix/OCRF | sklearn/utils/_scipy_sparse_lsqr_backport.py | 378 | 18021 | """Sparse Equations and Least Squares.
The original Fortran code was written by C. C. Paige and M. A. Saunders as
described in
C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear
equations and sparse least squares, TOMS 8(1), 43--71 (1982).
C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse... | bsd-3-clause |
ngageoint/geoevents | geoevents/timeline/api.py | 2 | 1197 | # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django.contrib.auth.models import User
from tastypie.contrib.contenttypes.fields import GenericForeignKeyFie... | mit |
spaceone/pyjs | examples/shell/Popups.py | 6 | 6813 | from pyjamas.ui.Button import Button
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.PopupPanel import PopupPanel
from pyjamas.ui.ListBox import ListBox
from pyjamas.ui.HTML import HTML
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui.DialogBox import DialogBox
from pyjamas.ui.Frame import ... | apache-2.0 |
Pluto-tv/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py | 14 | 4458 | # 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 f... | bsd-3-clause |
kevinlondon/youtube-dl | youtube_dl/extractor/nosvideo.py | 128 | 2519 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
urlencode_postdata,
xpath_text,
xpath_with_ns,
)
_x = lambda p: xpath_with_ns(p, {'xspf': 'http://xspf.org/ns/0... | unlicense |
tungvx/deploy | .google_appengine/lib/django_1_2/django/contrib/gis/utils/srs.py | 311 | 3157 | from django.contrib.gis.gdal import SpatialReference
from django.db import connections, DEFAULT_DB_ALIAS
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=DEFAULT_DB_ALIAS):
"""
This function takes a GDAL SpatialReference system and adds its information
... | apache-2.0 |
wangjun/cl-auto-reply | gae/lib/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | mit |
Sonicbids/django | django/contrib/gis/gdal/libgdal.py | 9 | 3596 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contri... | bsd-3-clause |
Miroff/mapcss-parser | mapcss_parser/lex.py | 1 | 5639 | #!/usr/bin/python
""" MapCSS lexer """
import re
import ply.lex as lex
from mapcss_parser import error
# Compute column.
# input is the input text string
# token is a token instance
# Basically taken from the PLY documentation
def find_column(input,token):
last_cr = input.rfind('\n',0,token.lexpos)
r... | bsd-2-clause |
AndrewGrossman/django | tests/multiple_database/routers.py | 379 | 1927 | from __future__ import unicode_literals
from django.db import DEFAULT_DB_ALIAS
class TestRouter(object):
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
retu... | bsd-3-clause |
greeshmab/SAIL-DatabaseProject | Alumni/languages/ro.py | 162 | 17306 | # coding: utf8
{
'!=': '!=',
'!langcode!': 'ro',
'!langname!': 'Română',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" (actualizează) este o expresie opțională precum "câmp1=\'valoare_nouă\'". Nu puteți actualiza sau șterge rezultatele unui... | gpl-2.0 |
alimony/django | django/contrib/gis/gdal/prototypes/geom.py | 181 | 4946 | from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal
from django.contrib.gis.gdal.prototypes.errcheck import check_envelope
from django.contrib.gis.gdal.prototypes.generation import (
const_string_... | bsd-3-clause |
40223101/2015final2 | static/Brython3.1.1-20150328-091302/Lib/collections/abc.py | 739 | 16026 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | gpl-3.0 |
venusource/python-neutronclient | neutronclient/common/validators.py | 12 | 2592 | # Copyright 2014 NEC Corporation
# 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 b... | apache-2.0 |
mvillis/wordplay | wordplay/tests/views/test_account_views.py | 2 | 1087 | __author__ = 'traviswarren'
from django.test import TestCase
from django.core.urlresolvers import reverse
class RegisterViewTestCases(TestCase):
def test_get_register(self):
response = self.client.get(reverse('register'))
self.assertTemplateUsed(response, 'register.html')
self.assertCo... | apache-2.0 |
Pop-Currency-Foundation/PopularCoin-Gold-Edition | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
nagyistoce/oppia | extensions/value_generators/models/generators.py | 30 | 3749 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
mattwthompson/mdtraj | tests/test_rmsd.py | 3 | 7890 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | lgpl-2.1 |
40223101/2015cda_g1 | static/Brython3.1.1-20150328-091302/Lib/_testcapi.py | 742 | 4231 |
CHAR_MAX = 127
CHAR_MIN = -128
DBL_MAX = 1.7976931348623157e+308
DBL_MIN = 2.2250738585072014e-308
FLT_MAX = 3.4028234663852886e+38
FLT_MIN = 1.1754943508222875e-38
INT_MAX = 2147483647
INT_MIN = -2147483648
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
LONG_MAX = 2147483647
LONG_MIN = -2... | gpl-3.0 |
catapult-project/catapult | third_party/google-endpoints/endpoints/api_backend_service.py | 7 | 6161 | # Copyright 2016 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... | bsd-3-clause |
timtroendle/urban-occupants-paper | urbanoccupants/tests/test_hipf_with_toy_example.py | 1 | 9065 | """Testing the HIPF algorithm with the toy example from its original paper.
The paper defining the algorithm and the toy example is:
Müller and Axhausen 2011: "Hierarchical IPF: Generating a synthetic population for Switzerland"
"""
import itertools
from collections import namedtuple
import pandas as pd
import numpy... | mit |
kbidarkar/robottelo | robottelo/ui/role.py | 2 | 5779 | # -*- encoding: utf-8 -*-
"""Implements Roles UI."""
from robottelo.constants import FILTER
from robottelo.ui.base import Base, UIError
from robottelo.ui.locators import common_locators, locators, tab_locators
from robottelo.ui.navigator import Navigator
class Role(Base):
"""Implements the CRUD functions for Role... | gpl-3.0 |
hsduk/lets-encrypt-preview | letsencrypt/errors.py | 3 | 2306 | """Let's Encrypt client errors."""
class Error(Exception):
"""Generic Let's Encrypt client error."""
class AccountStorageError(Error):
"""Generic `.AccountStorage` error."""
class AccountNotFound(AccountStorageError):
"""Account not found error."""
class ReverterError(Error):
"""Let's Encrypt Re... | apache-2.0 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/pandas/tseries/tests/test_timeseries_legacy.py | 6 | 8447 | # pylint: disable-msg=E1101,W0612
from datetime import datetime, time, timedelta
import sys
import os
import nose
import numpy as np
randn = np.random.randn
from pandas import (Index, Series, TimeSeries, DataFrame,
isnull, date_range, Timestamp, DatetimeIndex,
Int64Index, to_d... | gpl-2.0 |
hudora/huDjango | hudjango/validators.py | 1 | 2465 | # -*- coding: utf-8 -*-
"""Validators extending DJANGO.
See http://www.djangoproject.com/documentation/forms/#validators for more documentation on Django's
validators. Hopfully the validators below are all self explanatory."""
# Coded 2006 by Maximillian Dornseif for HUDORA GmbH
# You may use this under a "BSD Licen... | bsd-2-clause |
kaiyou/docker-py | docker/tls.py | 12 | 3168 | import os
import ssl
from . import errors
from .transport import SSLAdapter
class TLSConfig(object):
"""
TLS configuration.
Args:
client_cert (tuple of str): Path to client cert, path to client key.
ca_cert (str): Path to CA cert file.
verify (bool or str): This can be ``False`` ... | apache-2.0 |
mzbenami/netmiko | tests/old_format/test_cisco_legacy.py | 14 | 2659 | #!/usr/bin/env python
'''
Explictly use ssh_dispatcher to select SSH class
'''
import pytest
import netmiko
import time
from DEVICE_CREDS import *
def setup_module(module):
module.EXPECTED_RESPONSES = {
'base_prompt' : 'pynet-rtr1',
'interface_ip' : '10.220.88.20'
}
show_ver_comma... | mit |
arjenderijke/cobbler | cobbler/action_acl.py | 16 | 3403 | """
Configures acls for various users/groups so they can access the cobbler command
line as non-root. Now that CLI is largely remoted (XMLRPC) this is largely just
useful for not having to log in (access to shared-secret) file but also grants
access to hand-edit various collections files and other useful things.
Copy... | gpl-2.0 |
motion2015/a3 | common/djangoapps/course_modes/admin.py | 1 | 3158 | """
Django admin page for course modes
"""
from django.conf import settings
from pytz import timezone, UTC
from ratelimitbackend import admin
from course_modes.models import CourseMode
from django import forms
from opaque_keys import InvalidKeyError
from xmodule.modulestore.django import modulestore
from opaque_keys.e... | agpl-3.0 |
IshankGulati/scikit-learn | examples/neighbors/plot_digits_kde_sampling.py | 108 | 2026 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... | bsd-3-clause |
AnthonyHullDiamond/scanning | org.eclipse.scanning.points/scripts/scanpointgenerator/rois/point_roi.py | 2 | 1309 | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Ch... | epl-1.0 |
HiSPARC/topaz | 130820_coincidence_window/coincidence_window.py | 1 | 6461 | """Test time windows for coincidences
This script gets the number of found coincidences as a function of the
coincidence window.
TODO: Fix coincidences that are subsets. The number of coincidences
should not keep increasing, because at some point one coincidence might
contain another coincidences. e.g. 1, 3, 2 also i... | gpl-3.0 |
kohnle-lernmodule/KITexe201based | exe/engine/resource.py | 4 | 37725 | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# 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... | gpl-2.0 |
runekaagaard/django-contrib-locking | tests/select_related_regress/models.py | 166 | 3337 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Building(models.Model):
name = models.CharField(max_length=10)
def __str__(self):
return "Building: %s" % self.name
@python_2_unicod... | bsd-3-clause |
public-ink/public-ink | server/appengine/lib/matplotlib/tight_bbox.py | 22 | 2601 | """
This module is to support *bbox_inches* option in savefig command.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
from matplotlib.transforms import Bbox, TransformedBbox, Affine2D
def adjust_bbox(fig, bbox_inches, fixe... | gpl-3.0 |
DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/usb_packet/__init__.py | 8 | 1582 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Li... | gpl-3.0 |
SKIRT/PTS | magic/train/collection.py | 1 | 9368 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | agpl-3.0 |
BrandonY/gsutil | gslib/commands/signurl.py | 1 | 20601 | # -*- coding: utf-8 -*-
# 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 require... | apache-2.0 |
hglkrijger/WALinuxAgent | azurelinuxagent/common/osutil/gaia.py | 2 | 7204 | #
# Copyright 2017 Check Point Software Technologies
#
# 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 o... | apache-2.0 |
veridiam/Madcow-Waaltz | build/lib/madcow/modules/youtube.py | 4 | 1404 | """Mystery meat demistifier: Scrape youtube titles"""
from madcow.util.http import getsoup
from madcow.util.text import decode
from madcow.util import Module, strip_html
from urlparse import urlparse
import cgi
import re
import os
LOGO = u'\x1b[m\x0f\x1b[30m\x1b[47mYou\x1b[37m\x1b[41m\x1b[1mTube\x1b[m\x0f'
SCHEMES =... | gpl-3.0 |
rmboggs/django | tests/inspectdb/tests.py | 100 | 13023 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from unittest import skipUnless
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.six import PY3, StringIO
from .models import ColumnTypes... | bsd-3-clause |
stdtabs/phptabs | docs/conf.py | 1 | 2127 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
extensions = [
'sphinxcontrib.phpdomain'
]
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
primary_domain = 'php'
highlight_language = 'php'
templates_path = ['_templat... | lgpl-2.1 |
zguangyu/shadowsocks | shadowsocks/udprelay.py | 924 | 11154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
MTG/essentia | src/python/essentia/extractor/onsetdetection.py | 1 | 3188 | # Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 |
dcosentino/edx-platform | common/djangoapps/terrain/stubs/comments.py | 23 | 4932 | """
Stub implementation of cs_comments_service for acceptance tests
"""
import re
import urlparse
from .http import StubHttpRequestHandler, StubHttpService
class StubCommentsServiceHandler(StubHttpRequestHandler):
@property
def _params(self):
return urlparse.parse_qs(urlparse.urlparse(self.path).que... | agpl-3.0 |
unsiloai/syntaxnet-ops-hack | tensorflow/python/util/tf_inspect.py | 48 | 4988 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
wskplho/sl4a | python/src/Lib/idlelib/ParenMatch.py | 58 | 6611 | """ParenMatch -- An IDLE extension for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from HyperParser import HyperParser
from configHandler import idleConf... | apache-2.0 |
puzan/ansible | lib/ansible/modules/cloud/openstack/os_nova_flavor.py | 12 | 8467 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
takeshineshiro/cinder | cinder/api/contrib/__init__.py | 41 | 1221 | # Copyright 2011 Justin Santa Barbara
# 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 |
ownport/ansiblite | src/jinja2/asyncsupport.py | 13 | 7196 | # -*- coding: utf-8 -*-
"""
jinja2.asyncsupport
~~~~~~~~~~~~~~~~~~~
Has all the code for async support which is implemented as a patch
for supported Python versions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import sys
import asyncio
import inspec... | gpl-3.0 |
Azure/azure-sql-database-samples | django/django-pymssql/setup.py | 1 | 5903 | #!/usr/bin/python
import pymssql
import sys
server = sys.argv[1]
database = sys.argv[2]
username = sys.argv[3]
password = sys.argv[4]
conn = pymssql.connect(server=str(server), user=str(username)+'@'+str(server.split('.')[0]), password=password, database=database)
cursor = conn.cursor()
cursor.execute("CREATE proc [dbo... | mit |
a10networks/a10sdk-python | a10sdk/core/cgnv6/cgnv6_icmp_stats.py | 2 | 4809 | from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param 64_known_drop: {"description": "NAT64 Forward Known ICMPv6 Drop", "format": "counter", "type": "number", "oid": "13", "optional": true, "size": "8"}
... | apache-2.0 |
marqueedev/django | django/contrib/postgres/aggregates/statistics.py | 493 | 2033 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... | bsd-3-clause |
krbaker/Diamond | src/collectors/vmstat/vmstat.py | 33 | 1666 | # coding=utf-8
"""
Uses /proc/vmstat to collect data on virtual memory manager
#### Dependencies
* /proc/vmstat
"""
import diamond.collector
import os
import re
class VMStatCollector(diamond.collector.Collector):
PROC = '/proc/vmstat'
MAX_VALUES = {
'pgpgin': diamond.collector.MAX_COUNTER,
... | mit |
csrocha/OpenUpgrade | addons/base_import/__openerp__.py | 317 | 1227 | {
'name': 'Base import',
'description': """
New extensible file import for OpenERP
======================================
Re-implement openerp's file import system:
* Server side, the previous system forces most of the logic into the
client which duplicates the effort (between clients), makes the
import s... | agpl-3.0 |
legumeinfo/lis_context_viewer | search/microservices/search/chromosomesearch_pb2_grpc.py | 2 | 2481 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import chromosomesearch_pb2 as chromosomesearch__pb2
class ChromosomeSearchStub(object):
"""Missing associated documentation comment in .proto file."""
... | gpl-3.0 |
Javiercerna/MissionPlanner | Lib/site-packages/numpy/lib/financial.py | 81 | 21210 | # Some simple financial calculations
# patterned after spreadsheet computations.
# There is some complexity in each function
# so that the functions behave like ufuncs with
# broadcasting and being able to be called with scalars
# or arrays (or other sequences).
import numpy as np
__all__ = ['fv', 'pmt', 'nper', ... | gpl-3.0 |
maxrosan/NS-3-support-for-OBS | src/mpi/bindings/modulegen__gcc_ILP32.py | 2 | 173230 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
stpsomad/DynamicPCDMS | pointcloud/run/zand/deep_ranges_depth.py | 2 | 2989 | # -*- coding: utf-8 -*-
"""
Created on Tue May 31 15:50:12 2016
@author: Stella Psomadaki
"""
#run for mini
import os
import time
from tabulate import tabulate
from pointcloud.AbstractQuerier import Querier
import pointcloud.oracleTools as ora
###########################
### Setup Variables ###
#... | isc |
guorendong/iridium-browser-ubuntu | third_party/scons-2.0.1/engine/SCons/Tool/sunf90.py | 61 | 2180 | """SCons.Tool.sunf90
Tool-specific initialization for sunf90, the Sun Studio F90 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20... | bsd-3-clause |
XiaosongWei/chromium-crosswalk | third_party/WebKit/Source/bindings/scripts/v8_interface.py | 6 | 64750 | # Copyright (C) 2013 Google Inc. All rights reserved.
# coding=utf-8
#
# 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 cond... | bsd-3-clause |
fxia22/ASM_xf | PythonD/lib/python2.4/distutils/command/config.py | 4 | 13395 | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | gpl-2.0 |
EnviroCentre/monitoring-module | src/lib/voluptuous.py | 2 | 48794 | # encoding: utf-8
#
# Copyright (C) 2010-2013 Alec Thomas <alec@swapoff.org>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Alec Thomas <alec@swapoff.org>
"""Schema validation for Python data structures.
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.