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 |
|---|---|---|---|---|---|
fbogner/lsdns | dependencies/dnspython-1.12.0/dns/rdtypes/ANY/RRSIG.py | 15 | 5774 | # Copyright (C) 2004-2007, 2009-2011 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 "... | mit |
chainer/chainercv | chainercv/utils/testing/assertions/assert_is_semantic_segmentation_link.py | 3 | 1225 | import numpy as np
import six
def assert_is_semantic_segmentation_link(link, n_class):
"""Checks if a link satisfies semantic segmentation link APIs.
This function checks if a given link satisfies semantic segmentation link
APIs or not.
If the link does not satifiy the APIs, this function raises an
... | mit |
spvkgn/youtube-dl | youtube_dl/extractor/cnn.py | 16 | 6428 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .turner import TurnerBaseIE
from ..utils import url_basename
class CNNIE(TurnerBaseIE):
_VALID_URL = r'''(?x)https?://(?:(?P<sub_domain>edition|www|money)\.)?cnn\.com/(?:video/(?:data/.+?|\?)/)?videos?/
(?P<path>.+?... | unlicense |
gsamokovarov/frames.py | test.py | 1 | 2402 | import inspect
import os
from contextlib import contextmanager
import pytest
import frames
@contextmanager
def non_native_frames():
previous_native = frames.NATIVE
try:
frames.NATIVE = False
yield
finally:
frames.NATIVE = previous_native
def test_is_new_style_class():
asser... | mit |
Pluto-tv/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/boto/cloudfront/distribution.py | 92 | 31275 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
justincassidy/scikit-learn | sklearn/ensemble/tests/test_forest.py | 57 | 35265 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import product
import numpy as np
from scipy.sparse import csr_... | bsd-3-clause |
40223110/2015CDAFinal_test2 | static/Brython3.1.1-20150328-091302/Lib/getopt.py | 845 | 7488 | """Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by GNU software
may be used as ... | gpl-3.0 |
spcui/tp-qemu | qemu/tests/enospc.py | 3 | 7710 | import logging
import time
import re
import os
from autotest.client.shared import error
from autotest.client import utils
from virttest import virt_vm, utils_misc, qemu_storage, data_dir
class EnospcConfig(object):
"""
Performs setup for the test enospc. This is a borg class, similar to a
singleton. The ... | gpl-2.0 |
gsehub/edx-platform | lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py | 18 | 4087 | """
Command to recalculate grades for all subsections with problem submissions
in the specified time range.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from datetime import datetime
from django.core.management.base import BaseCommand, CommandError
from pytz i... | agpl-3.0 |
medspx/QGIS | tests/src/python/test_qgsencodingselectiondialog.py | 21 | 1175 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsEncodingSelectionDialog
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later vers... | gpl-2.0 |
SivilTaram/edx-platform | common/test/acceptance/pages/studio/html_component_editor.py | 115 | 1139 | from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from component_editor import ComponentEditorView
class HtmlComponentEditorView(ComponentEditorView):
"""
Represents the rendered view of an HTML component editor.
"""
def set_content_and_sa... | agpl-3.0 |
opendatateam/udata | udata/core/organization/commands.py | 2 | 1623 | import logging
import click
from udata.commands import cli, exit_with_error
from udata.models import GeoZone, Organization
log = logging.getLogger(__name__)
@cli.group('organizations')
def grp():
'''Organizations related operations'''
pass
@grp.command()
@click.argument('geoid', metavar='<geoid>')
@click... | agpl-3.0 |
Solinea/horizon | openstack_dashboard/dashboards/project/volumes/volumes/urls.py | 60 | 2451 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
jomolinare/kobocat | onadata/libs/utils/chart_tools.py | 3 | 5073 | import re
from onadata.libs.data.query import get_form_submissions_grouped_by_field
from onadata.libs.utils import common_tags
# list of fields we can chart
CHART_FIELDS = ['select one', 'integer', 'decimal', 'date', 'datetime',
'start', 'end', 'today']
# numeric, categorized
DATA_TYPE_MAP = {
'i... | bsd-2-clause |
glove747/liberty-neutron | neutron/agent/metadata/driver.py | 5 | 7456 | # Copyright 2014 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
cesargtz/YecoraOdoo | addons/stock_dropshipping/wizard/stock_invoice_onshipping.py | 270 | 2139 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
nelango/ViralityAnalysis | model/lib/textblob/utils.py | 17 | 1526 | # -*- coding: utf-8 -*-
import re
import string
PUNCTUATION_REGEX = re.compile('[{0}]'.format(re.escape(string.punctuation)))
def strip_punc(s, all=False):
"""Removes punctuation from a string.
:param s: The string.
:param all: Remove all punctuation. If False, only removes punctuation from
the ... | mit |
alu042/edx-platform | common/djangoapps/contentserver/test/test_contentserver.py | 6 | 12992 | """
Tests for StaticContentServer
"""
import copy
import datetime
import ddt
import logging
import unittest
from uuid import uuid4
from django.conf import settings
from django.test.client import Client
from django.test.utils import override_settings
from mock import patch
from xmodule.contentstore.django import cont... | agpl-3.0 |
milmd90/TwitterBot | twitter/api.py | 3 | 173090 | #!/usr/bin/env python
#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | apache-2.0 |
minghuascode/pyj | examples/gmaps/ControlSimple.py | 11 | 1546 | # Copyright (C) 2009 Daniel Carvalho <idnael@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
marc-sensenich/ansible | lib/ansible/modules/windows/win_wakeonlan.py | 52 | 1767 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'commu... | gpl-3.0 |
kdkeyser/readthedocs.org | readthedocs/rtd_tests/tests/test_sync_versions.py | 34 | 11004 | import json
from django.test import TestCase
from readthedocs.builds.models import Version
from readthedocs.builds.constants import STABLE
from readthedocs.projects.models import Project
class TestSyncVersions(TestCase):
fixtures = ["eric", "test_data"]
def setUp(self):
self.client.login(username='... | mit |
snyaggarwal/oclapi | ocl/oclapi/management/commands/create_tokens.py | 2 | 3407 | from optparse import make_option
import os.path
import requests
import json
from django.contrib.auth.models import User
from django.core.management import BaseCommand, CommandError
from rest_framework.authtoken.models import Token
from users.models import UserProfile
from orgs.models import Organization
class Command... | mpl-2.0 |
pmolchanov/sd-fbn-search | sd-fbn-search.py | 1 | 13552 | #!/usr/bin/env python
import sys, lxml.html, httplib, urllib, csv
if len(sys.argv) < 2:
print "sd-fbn-search - Lookup San Diego County ficticious business name info"
print "usage: sd-fbn-search <search-by> <fbn>\n"
print "search-by options:"
print " 0 - Business Name"
print " 1 - Owner Name"
print " 2 - File... | mit |
mrbox/django | django/contrib/gis/gdal/srs.py | 71 | 12184 | """
The Spatial Reference class, represents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY... | bsd-3-clause |
jimbobhickville/taskflow | taskflow/engines/__init__.py | 4 | 1397 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! 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... | apache-2.0 |
synicalsyntax/zulip | zerver/lib/remote_server.py | 3 | 7286 | import logging
import urllib
from typing import Any, Dict, List, Mapping, Tuple, Union
import requests
import ujson
from django.conf import settings
from django.forms.models import model_to_dict
from django.utils.translation import ugettext as _
from analytics.models import InstallationCount, RealmCount
from version ... | apache-2.0 |
ianctse/pvlib-python | pvlib/test/test_modelchain.py | 1 | 8186 | import numpy as np
import pandas as pd
from numpy import nan
from pvlib import modelchain, pvsystem
from pvlib.modelchain import ModelChain
from pvlib.pvsystem import PVSystem
from pvlib.tracking import SingleAxisTracker
from pvlib.location import Location
from pandas.util.testing import assert_series_equal, assert_f... | bsd-3-clause |
prospwro/odoo | addons/irsid_edu_training/models/admission_line.py | 2 | 3784 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution Addon
# Copyright (C) 2009-2013 IRSID (<http://irsid.ru>),
# Paul Korotkov (korotkov.paul@gmail.com).
#
# This program is free software: you can redistribute it... | agpl-3.0 |
txemi/ansible | lib/ansible/modules/notification/twilio.py | 36 | 5983 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | gpl-3.0 |
saeki-masaki/glance | glance/api/policy.py | 7 | 25297 | # Copyright (c) 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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... | apache-2.0 |
Xevib/manuel | manuel/cli.py | 1 | 1137 | from __future__ import absolute_import
import click
from manuel.manuel import Manuel
@click.group()
def manuel():
pass
@manuel.command()
@click.argument('config_file')
@click.option('--index/--no-index', default=False)
@click.option('--recreate/--no-recreate', default=True)
@click.option('--debug/--no-debug', d... | gpl-3.0 |
brianjgeiger/osf.io | scripts/register_oauth_scopes.py | 13 | 2346 | """
Register the list of OAuth2 scopes that can be requested by third parties. This populates the Postgres collection
referenced by CAS when responding to authorization grant requests. The database class is minimal; the exact
specification for what a scope contains lives in the python module from which this collection ... | apache-2.0 |
joshuajan/odoo | openerp/addons/base/module/wizard/base_module_configuration.py | 447 | 2274 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
googlefonts/nototools | nototools/lang_data.py | 3 | 11484 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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/LICENS... | apache-2.0 |
fpy171/django | django/conf/locale/pt/formats.py | 504 | 1717 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... | bsd-3-clause |
Acidburn0zzz/servo | tests/wpt/web-platform-tests/common/security-features/subresource/font.py | 16 | 4580 | import os, sys, base64
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(request, server_data):
data = ('{"headers": %(headers)s}') % server_data
if "id" in request.GET:
request.server.stash.put(request.GET["id"], data)
# Simple base64 encoded .t... | mpl-2.0 |
alan-unravel/bokeh | examples/charts/file/palettes.py | 35 | 2197 | from collections import OrderedDict
import numpy as np
from bokeh.charts import Area, output_file, gridplot, show
from bokeh.palettes import (Blues9, BrBG9, BuGn9, BuPu9, GnBu9, Greens9,
Greys9, OrRd9, Oranges9, PRGn9, PiYG9, PuBu9,
PuBuGn9, PuOr9, PuRd9, Purple... | bsd-3-clause |
realsobek/freeipa | ipatests/test_webui/test_service.py | 4 | 9526 | # Authors:
# Petr Vobornik <pvoborni@redhat.com>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ... | gpl-3.0 |
brendanebers/geolocation-python | geolocation/distance_matrix/main.py | 4 | 1666 | # encoding: utf-8
from geolocation.distance_matrix.api import DistanceMatrixApi
from geolocation.distance_matrix.models import DistanceMatrixModel
from geolocation.distance_matrix.parser import DistanceMatrixParser
from geolocation.managers import Manager
class DistanceMatrix():
parser = DistanceMatrixParser()
... | bsd-3-clause |
giggsey/SickRage | lib/subliminal/converters/podnapisi.py | 32 | 1960 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from babelfish import LanguageReverseConverter, LanguageConvertError, LanguageReverseError
class PodnapisiConverter(LanguageReverseConverter):
def __init__(self):
self.from_podnapisi = {2: ('eng',), 28: ('spa',), 26: ('pol',), 36: ('srp',), 1... | gpl-3.0 |
p990-slimrom/platform_external_chromium | chrome/common/extensions/docs/build/directory.py | 65 | 24652 | #!/usr/bin/python
# Copyright (c) 2010 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.
"""Class for parsing metadata about extension samples."""
import locale
import os
import os.path
import re
import hashlib
import zipfi... | bsd-3-clause |
myarjunar/QGIS | python/plugins/db_manager/db_plugins/postgis/plugins/versioning/dlg_versioning.py | 9 | 11805 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Versioning plugin for DB Manager
Description : Set up versioning support for a table
Date : Mar 12, 2012
copyright : (C) 2012 by Giuseppe Sucameli
email ... | gpl-2.0 |
cancro7/gem5 | src/arch/x86/isa/insts/general_purpose/compare_and_test/test.py | 91 | 2776 | # 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 |
Monithon/Monithon-2.0 | reports/models.py | 1 | 2079 |
from django.contrib.gis.db import models
from monitor.models import MonitoringTeam
from projects.models import Monitorable
from customforms.models import Form as CustomForm, FormFieldOption
from customforms.models import FormField
import json
class Report(models.Model):
author = models.ForeignKey(MonitoringTeam, re... | gpl-2.0 |
ethanyoung/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# 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 by applicable law or ... | apache-2.0 |
Stanford-Legal-Tech-Design/legaltech-rapidpro | temba/orgs/migrations/0001_initial.py | 2 | 12340 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('locations', '0001_initial'),
migrations.swappable_dependency(settin... | agpl-3.0 |
HashUnlimited/Einsteinium-Unlimited | qa/rpc-tests/bip68-112-113-p2p.py | 41 | 27358 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | mit |
mikhaelharswanto/lge-kernel-gproj | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
40223119/w16b_test | static/Brython3.1.1-20150328-091302/Lib/_string.py | 625 | 1112 | """string helper module"""
import re
class __loader__(object):
pass
def formatter_field_name_split(fieldname):
"""split the argument as a field name"""
_list=[]
for _name in fieldname:
_parts = _name.split('.')
for _item in _parts:
is_attr=False #fix me
if re.... | gpl-3.0 |
RevelSystems/django | tests/gis_tests/layermap/tests.py | 30 | 14579 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from copy import copy
from decimal import Decimal
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.gdal import HAS_GDAL
from django.db import connection
from django.test import TestCase, o... | bsd-3-clause |
sumedhasingla/VTK | ThirdParty/Twisted/twisted/conch/test/test_recvline.py | 42 | 23851 | # -*- test-case-name: twisted.conch.test.test_recvline -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.recvline} and fixtures for testing related
functionality.
"""
import sys, os
from twisted.conch.insults import insults
from twisted.conch import recvline
f... | bsd-3-clause |
jlubcke/csvpp | csvpp/csvpp.py | 1 | 1221 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import csv
from io import StringIO
from itertools import count
import sys
try:
# Python 2
from itertools import izip_longest
except ImportError:
# Python 3
from itertools import zip_longest as izip_longest
def csvpp(csv_input):
max_widths = []
ma... | mit |
anshulkgupta/viznow | Mayank/blpapi_python3.5.5/blpapi/__init__.py | 2 | 2029 | # __init__.py
from __future__ import absolute_import
from .internals import CorrelationId
from .abstractsession import AbstractSession
from .constant import Constant, ConstantList
from .datetime import FixedOffset
from .datatype import DataType
from .element import Element
from .event import Event, EventQueue
from .... | mit |
steedos/odoo7 | openerp/addons/project/__openerp__.py | 46 | 3184 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
liyi193328/seq2seq | seq2seq/contrib/learn/session_run_hook.py | 144 | 1204 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jensengrouppsu/rapid | rapid/pyqtgraph/graphicsItems/GraphicsLayout.py | 6 | 6134 | from ..Qt import QtGui, QtCore
from .. import functions as fn
from .GraphicsWidget import GraphicsWidget
## Must be imported at the end to avoid cyclic-dependency hell:
from .ViewBox import ViewBox
from .PlotItem import PlotItem
from .LabelItem import LabelItem
__all__ = ['GraphicsLayout']
class GraphicsLayout(Graphic... | mit |
amenonsen/ansible | lib/ansible/modules/storage/purestorage/purefa_smtp.py | 2 | 4503 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | gpl-3.0 |
solintegra/addons | account_treasury_forecast/models/account_treasury_forecast_template.py | 31 | 3739 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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, either version 3 of the... | agpl-3.0 |
samuto/UnityOpenCV | opencv/tests/swig_python/highgui/cvShowImage.py | 3 | 1288 | #! /usr/bin/env python
"""
This script will test highgui's window functionality
"""
# name of this test and it's requirements
TESTNAME = "cvShowImage"
REQUIRED = ["cvLoadImagejpg", "cvNamedWindow"]
# needed for sys.exit(int) and .works file handling
import os
import sys
import works
# path to imagefiles we need
PR... | gpl-3.0 |
takis/django | django/conf/locale/sr_Latn/formats.py | 1008 | 2011 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
viswimmer1/PythonGenerator | data/python_files/29978636/wpp_newusers.py | 1 | 44626 | import codecs
import datetime
import functools
import httplib2
import itertools
import logging
from lxml import html
import mwclient
from pprint import pprint
import time
import unittest
import urllib
import urlparse
import MySQLdb
import MySQLdb.cursors
from wpp_settings import WPPRY_USER, WPPRY_PW, WPPRY_DB, WPPRY_... | gpl-2.0 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/setuptools/tests/test_resources.py | 345 | 23973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove
import os
import sys
import tempfile
import shutil
from unittest import TestCase
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution... | gpl-3.0 |
Azure/WALinuxAgent | tests/utils/test_archive.py | 1 | 9301 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License.
import os
import shutil
import tempfile
import zipfile
from datetime import datetime, timedelta
import azurelinuxagent.common.logger as logger
from azurelinuxagent.common.utils import fileutil
from azurelinuxagent.common.u... | apache-2.0 |
WadeYuChen/django-oscar | sites/sandbox/apps/user/models.py | 43 | 2256 | """
Sample user/profile models for testing. These aren't enabled by default in the
sandbox
"""
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from oscar.core import compat
from oscar.apps.customer import abstract_models
class Profile(mod... | bsd-3-clause |
boundarydevices/android_external_chromium_org | tools/telemetry/telemetry/timeline/slice.py | 8 | 2266 | # 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.
import telemetry.timeline.event as timeline_event
class Slice(timeline_event.TimelineEvent):
"""A Slice represents an interval of time plus parameters ass... | bsd-3-clause |
durai145/youtube-dl | youtube_dl/extractor/stanfordoc.py | 173 | 3526 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
orderedSet,
unescapeHTML,
)
class StanfordOpenClassroomIE(InfoExtractor):
IE_NAME = 'stanfordoc'
IE_DESC = 'Stanford Open ClassRoom'
_VALID_URL = r'https?://openclassroom... | unlicense |
vadimtk/chrome4sdp | tools/telemetry/telemetry/web_perf/metrics/single_event_unittest.py | 21 | 3135 | # 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.
import unittest
from collections import namedtuple
from telemetry.internal.results import page_test_results
from telemetry.page import page
from telemetry.w... | bsd-3-clause |
meteorcloudy/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/hybrid_layer_test.py | 158 | 2156 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
rosmo/ansible | test/units/modules/network/f5/test_bigip_ucs.py | 14 | 12793 | # -*- 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 pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
sradanov/flyingpigeon | flyingpigeon/processes/wps_analogs.py | 1 | 8822 | from datetime import datetime, date
import types
import tempfile
import tarfile
import ocgis
from ocgis import RequestDataset
import datetime as dt
import os
from flyingpigeon import analogs
from pywps.Process import WPSProcess
import logging
class AnalogsProcess(WPSProcess):
def __init__(self):
# defini... | apache-2.0 |
openweave/openweave-wdlc | backend/lib/nwv/proto_pool.py | 1 | 11246 | #
# Copyright (c) 2019-2020 Google LLC. All Rights Reserved.
# Copyright (c) 2016-2018 Nest Labs 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
#
# ... | apache-2.0 |
Devyani-Divs/pagure | pagure/ui/admin.py | 1 | 1932 | # -*- coding: utf-8 -*-
"""
(c) 2014 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from functools import wraps
import flask
import pagure.forms
from pagure import (APP, SESSION, LOG, cla_required, authenticated,
generate_gitolite_acls, generate_authorized_k... | gpl-2.0 |
OpenBankProject/Hello-OBP-DirectLogin-Python | props/socgen.py | 1 | 1133 | # -*- coding: utf-8 -*-
"""
Settings for the hello scripts.
You most likely need to edit a few of them, e.g. API_HOST and the OAuth
credentials.
"""
OUR_BANK = '00100'
USERNAME = '1000203893'
PASSWORD = '1000203893'
CONSUMER_KEY = 'bvldezvlnqj4mtva4jfktke4xliep0bt1xm44yxi'
CONSUMER_SECRET... | apache-2.0 |
cjcjameson/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/crashrecovery/test_suspendcheckpoint_crashrecovery_21_to_30.py | 2 | 7531 | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | apache-2.0 |
subramani95/neutron | neutron/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py | 3 | 2379 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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... | apache-2.0 |
google-code-export/pyglet | examples/apple_remote_demo.py | 27 | 7618 | '''
A silly demonstration of how to use the Apple remote.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import pyglet
from pyglet.gl import *
import sys
class MainWindow(pyglet.window.Window):
def __init__(self):
super(MainWindow, self).__init__(visible=False)
self.set_caption('A... | bsd-3-clause |
kybriainfotech/iSocioCRM | addons/hr_holidays/hr_holidays.py | 159 | 33482 | # -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | agpl-3.0 |
Feandil/webapp-config | WebappConfig/filetype.py | 1 | 6545 | #!/usr/bin/python -O
#
# /usr/sbin/webapp-config
# Python script for managing the deployment of web-based
# applications
#
# Originally written for the Gentoo Linux distribution
#
# Copyright (c) 1999-2007 Authors
# Released under v2 of the GNU GPL
#
# Author(s) Stuart Herbert
# ... | gpl-2.0 |
GeotrekCE/Geotrek-admin | geotrek/trekking/migrations/0005_auto_20181219_1524.py | 2 | 1413 | # Generated by Django 1.11.14 on 2018-12-19 14:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trekking', '0004_auto_20181127_1551'),
]
operations = [
migrations.RunSQL(
"DROP VIEW IF EXISTS o_v_poi, o_v_itineraire;",
... | bsd-2-clause |
asajeffrey/servo | tests/wpt/web-platform-tests/webdriver/tests/refresh/user_prompts.py | 26 | 4131 | # META: timeout=long
import pytest
from webdriver.error import StaleElementReferenceException
from tests.support.inline import inline
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
def refresh(session):
return session.transport.send(
"POST", "session/{session_id}/... | mpl-2.0 |
borisroman/vdsm | contrib/ivdsm.py | 5 | 1711 | #
# Copyright 2011 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | gpl-2.0 |
jymannob/Sick-Beard | lib/imdb/parser/sql/alchemyadapter.py | 57 | 19295 | """
parser.sql.alchemyadapter module (imdb.parser.sql package).
This module adapts the SQLAlchemy ORM to the internal mechanism.
Copyright 2008-2010 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publish... | gpl-3.0 |
jasminelou/ggame-tutorials | ggame/pygamedeps.py | 228 | 12266 | def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return True
# PYTHON 3 and PYGAME DEPENDENCIES
if module_exists('pygame'):
import pygame
class _body(object):
def __init__(self):
self.events = {}
def appe... | mit |
66maintainer/66coin | 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 |
saadasad/droid | Media.py | 1 | 2157 |
def menu():
from ftplib import FTP
import os
import time
from pygame import mixer
import sched
ftp = FTP()
choice = ''
while(choice!='0'):
print('1. Music')
print('2. Take a Picture')
print('3. Text To Speech')
print('0. To Exit')
choice = input('Enter Choice : ')
if(choice == '1'):
print('All... | gpl-3.0 |
m-tmatma/svnmailer | src/lib/svnmailer/notifier/stdout.py | 1 | 3635 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0201
# pylint-version = 0.7.0
#
# Copyright 2004-2005 André Malo or his licensors, as applicable
#
# 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... | apache-2.0 |
subhrm/google-code-jam-solutions | solutions/2018/1B/A/a.py | 1 | 1033 | # Problem a
def solve(n, l, ip):
assert n < 30, "n should be less than 300"
s = sum(ip)
rem = n - s
pc = [round_pc(v / n) for v in ip]
res = sum(pc)
if rem == 0:
return res
extra = [round_pc(i / n) for i in range(rem + 1)]
for v, p in zip(ip, pc):
if rem == 0:
... | mit |
Creworker/FreeCAD | src/App/FreeCADInit.py | 9 | 9855 | # FreeCAD init module
# (c) 2001 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de)... | lgpl-2.1 |
edgarRd/incubator-airflow | airflow/migrations/versions/e3a246e0dc1_current_schema.py | 8 | 12374 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
fin/froide | froide/publicbody/migrations/0001_initial.py | 5 | 9441 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.manager
import django.utils.timezone
from django.conf import settings
import django.db.models.deletion
import froide.publicbody.models
import taggit.managers
class Migration(migrations.Mig... | mit |
mpvoss/RickAndMortyWeatherTweets | env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 515 | 5599 | from __future__ import absolute_import
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(se... | mit |
hellhovnd/dentexchange | dentexchange/apps/employee/tests/test_public_questionnaire_detail_from_list_view.py | 2 | 2428 | # -*- coding:utf-8 -*-
import unittest
import mock
from django.http.response import Http404
from ..views import PublicQuestionnaireDetailFromListView
from ..models import EmployeeQuestionnaire
class PublicQuestionnaireDetailFromListViewTestCase(unittest.TestCase):
def test_model_should_reference_job_posting_mod... | bsd-3-clause |
vincecr0ft/hhntup | higgstautau/trigger/emulation.py | 4 | 4536 | from rootpy.tree.filtering import EventFilter
def update_trigger_trees(student, tool, name, file, tree):
"""
This method must be called when each new tree is loaded in the chain
"""
if not tool.passthrough and tool.year == 2011:
print "Loading current tree in the TriggerTool ..."
tool.... | gpl-3.0 |
tamihiro/grpc | src/python/grpcio/grpc/framework/core/_expiration.py | 20 | 6055 | # Copyright 2015, 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 |
rentongzhang/servo | tests/wpt/css-tests/tools/html5lib/utils/entities.py | 438 | 2734 | import json
import html5lib
def parse(path="html5ents.xml"):
return html5lib.parse(open(path), treebuilder="lxml")
def entity_table(tree):
return dict((entity_name("".join(tr[0].xpath(".//text()"))),
entity_characters(tr[1].text))
for tr in tree.xpath("//h:tbody/h:tr",
... | mpl-2.0 |
nikhilraog/boto | boto/mws/exception.py | 153 | 2396 | # Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/
#
# 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... | mit |
InterfaceMasters/ONL | components/all/vendor-config/imt/src/python/imt/__init__.py | 3 | 1335 | #!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 Big Switch Networks, Inc.
# Copyright 2015 Interface Masters Technologies, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use thi... | epl-1.0 |
Carmezim/tensorflow | tensorflow/tools/docs/build_docs_test.py | 24 | 1725 | # 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 |
mohamed--abdel-maksoud/chromium.src | tools/telemetry/telemetry/image_processing/io/frame_generator.py | 52 | 1479 | # 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.
import abc
class FrameReadError(Exception):
pass
class FrameGenerator(object):
""" Defines an interface for reading input frames.
Attributes:
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.