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 |
|---|---|---|---|---|---|
preparationh67/youtube-dl | youtube_dl/extractor/slideshare.py | 126 | 2003 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
)
class SlideshareIE(InfoExtractor):
_VALID_URL = r'https?://www\.slideshare\.net/[^/]+?/(?P<title>.+?)($|\?)'
_TEST = {
... | unlicense |
jiemakel/omorfi | src/python/generate-regexes.py | 2 | 2646 | #!/usr/bin/env python3
# -*- coding: utf8 -*-
"""
This script generates twolc files from database data.
"""
# Author: Omorfi contributors, 2014
# 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 Found... | gpl-3.0 |
dgmarcin/test | gitosis/gitweb.py | 21 | 4520 | """
Generate ``gitweb`` project list based on ``gitosis.conf``.
To plug this into ``gitweb``, you have two choices.
- The global way, edit ``/etc/gitweb.conf`` to say::
$projects_list = "/path/to/your/projects.list";
Note that there can be only one such use of gitweb.
- The local way, create a new config file::... | gpl-2.0 |
crmccreary/openerp_server | openerp/tools/test_config.py | 456 | 1418 | # -*- coding: utf-8 -*-
""" Tests for the configuration file/command-line arguments. """
# This test should be run from its directory.
# TODO A configmanager object cannot parse multiple times a config file
# and/or the command line, preventing to 'reload' a configuration.
import os
import config
config_file_00 =... | agpl-3.0 |
timmahrt/praatIO | examples/anonymize_recording.py | 1 | 1182 | """
Replaces someone saying a name with a tone over the name to 'hide' the name.
The times that the names are spoken are taken from a transcript
of the recording.
"""
import os
from os.path import join
from praatio import tgio
from praatio import audioio
path = join(".", "files")
outputPath = join(path, "anonymized... | mit |
waynecoulson/TV-Show-Downloader | lib/hachoir_parser/image/png.py | 90 | 9156 | """
PNG picture file parser.
Documents:
- RFC 2083
http://www.faqs.org/rfcs/rfc2083.html
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, Fragment,
ParserError, MissingField,
UInt8, UInt16, UInt32,
String, CString,
Bytes, RawBytes,
B... | gpl-3.0 |
Kazade/NeHe-Website | google_appengine/lib/django-0.96/django/db/models/manager.py | 33 | 4145 | from django.db.models.query import QuerySet, EmptyQuerySet
from django.dispatch import dispatcher
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
# Size of each "chunk" for get_iterator calls.
# Larger values are slightly faster at the expense of more storage space.
GET_ITERA... | bsd-3-clause |
tartavull/google-cloud-python | vision/google/cloud/vision_v1/__init__.py | 2 | 1156 | # Copyright 2017, Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
ashhher3/ibis | ibis/sql/sqlite/tests/test_functions.py | 5 | 9489 | # Copyright 2015 Cloudera 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 agreed to in writing, so... | apache-2.0 |
Korkki/django | tests/urlpatterns_reverse/tests.py | 154 | 50058 | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import User
from django... | bsd-3-clause |
jab/bidict | bidict/_frozenbidict.py | 1 | 2502 | # -*- coding: utf-8 -*-
# Copyright 2009-2021 Joshua Bronson. All Rights Reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#=================================... | mpl-2.0 |
nickanderson/ansible | lib/ansible/runner/lookup_plugins/nested.py | 174 | 2285 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
gangadharkadam/smrtfrappe | frappe/templates/pages/list.py | 14 | 1548 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os
from frappe.modules import get_doc_path
from jinja2 import Environment, Template, FileSystemLoader
no_cache = 1
no_sitemap = 1
def get_context(context):
co... | mit |
lhemmen/python-xbee | examples/dispatch_async.py | 43 | 1992 | #! /usr/bin/python
"""
dispatch_async.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
This example continuously reads the serial port and dispatches packets
which arrive to appropriate methods for processing in a separate thread.
"""
from xbee import XBee
from xbee.helpers.dispatch import Dispatch
import time
import ... | mit |
timothydmorton/bokeh | examples/interactions/interactive_bubble/data.py | 49 | 1265 | import numpy as np
from bokeh.palettes import Spectral6
def process_data():
from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions
# Make the column names ints not strings for handling
columns = list(fertility.columns)
years = list(range(int(columns[0]), int(columns[-... | bsd-3-clause |
faust64/ansible | lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py | 48 | 14932 | #!/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 distributed... | gpl-3.0 |
rikur/flynn | Godeps/_workspace/src/github.com/flynn/go-tuf/client/testdata/generate/generate.py | 21 | 3245 | #!/usr/bin/env python
#
# A script to generate TUF repository files.
#
# A modification of generate.py from the Python implementation:
# https://github.com/theupdateframework/tuf/blob/v0.9.9/tests/repository_data/generate.py
import shutil
import datetime
import optparse
import stat
from tuf.repository_tool import *
i... | bsd-3-clause |
Elandril/Sick-Beard | lib/hachoir_parser/file_system/iso9660.py | 90 | 4966 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, ... | gpl-3.0 |
RachitKansal/scikit-learn | examples/plot_johnson_lindenstrauss_bound.py | 127 | 7477 | r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected i... | bsd-3-clause |
RossBrunton/django | tests/aggregation_regress/tests.py | 66 | 53789 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... | bsd-3-clause |
Ulauncher/Ulauncher | tests/conftest.py | 1 | 1321 | from functools import reduce
from gi.repository import GdkX11
import pytest
is_display_enabled = bool(GdkX11.X11Display.get_default())
def pytest_runtest_setup(item):
if isinstance(item, pytest.Function):
if item.iter_markers('with_display') and not is_display_enabled:
pytest.skip("Cannot ru... | gpl-3.0 |
tedwen/tea-scrum | TeaScrum/product/tests.py | 1 | 3808 | from django.test import TestCase
from django.contrib.auth.models import User, Group, Permission
from views import *
def add_permissions(group, codenames):
""" Add a permission to the group """
if isinstance(codenames, basestring):
codenames = [codenames]
for codename in codenames:
perm = ge... | apache-2.0 |
ritchyteam/odoo | addons/l10n_fr/report/compute_resultant_report.py | 374 | 4004 | # -*- coding: utf-8 -*-
#
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users w... | agpl-3.0 |
aloksinha2001/rk3066-kernel | mm/scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
SmartInfrastructures/fuel-web-dev | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/clients/keystone_client.py | 4 | 3405 | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... | apache-2.0 |
danielluker/ShoppingList | webapp/shoppinglist/shoppinglist/settings.py | 1 | 3330 | """
Django settings for shoppinglist project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build... | mit |
valentin-krasontovitsch/ansible | lib/ansible/plugins/doc_fragments/files.py | 9 | 3717 | # Copyright: (c) 2014, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
# Note: mode is overridden by the copy and template modules so if you change the descriptio... | gpl-3.0 |
editxt/editxt | resources/syntax/groovy.syntax.py | 1 | 2836 | # -*- coding: UTF-8 -*-
# Syntax definition automatically generated by hljs2xt.py
# source: groovy.js
name = 'Groovy'
file_patterns = ['*.groovy']
keyword = """
byte short char int long boolean float double void def as in assert
trait super this abstract static volatile transient public private
protected s... | gpl-3.0 |
hezuoguang/ZGVL | WLServer/site-packages/django/contrib/sitemaps/tests/test_flatpages.py | 225 | 1575 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.unittest import skipUnless
from .base import SitemapTestsBase
class FlatpagesSitemapTests(SitemapTestsBase):
@skipUnless("django.contrib.flatpages" in settings.INSTALLED_APPS,
"django.contrib.flatpages app... | apache-2.0 |
kaixinjxq/crosswalk-test-suite | webapi/webapi-resourcetiming-w3c-tests/resourcetiming-py/w3c/submission/resources/generate_resource.py | 25 | 1827 | import os
def main(request, response):
try:
get_type = request.GET.first("types")
status = 200
body = ""
content_type = "text/plain"
def file_get_contents(path):
file_object = open(
os.path.split(
os.path.realpath(__file__))... | bsd-3-clause |
malept/youtube-dl | youtube_dl/extractor/soundgasm.py | 149 | 2041 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class SoundgasmIE(InfoExtractor):
IE_NAME = 'soundgasm'
_VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_\-]+)/(?P<title>[0-9a-zA-Z_\-]+)'
_TEST = {
'url': 'http://soundgasm.... | unlicense |
ctava/maps-angularjs-gae-python | applications.py | 1 | 5470 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2014 Christopher Tava
#
import webapp2
from google.appengine.ext import db
import logging
import sys
import json
from appconfig import Application, Experiment, Variation
class ApplicationsHandler(webapp2.RequestHandler):
def get(self):
try:
... | mit |
praveenaki/zulip | zerver/management/commands/knight.py | 115 | 2607 | from __future__ import absolute_import
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from zerver.lib.actions import do_change_is_admin
from zerver.models import UserProfile
class Command(BaseCommand):
help = """Give an existing user administ... | apache-2.0 |
sajeeshcs/nested_quota_latest | nova/tests/functional/v3/test_multiple_create.py | 13 | 1752 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
elliotchencv/caffe-windows-cudnn | scripts/cpp_lint.py | 26 | 187464 | #!/usr/bin/python2
#
# Copyright (c) 2009 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... | bsd-2-clause |
brainwane/zulip | zerver/webhooks/travis/view.py | 3 | 1986 | # Webhooks for external integrations.
from typing import Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.validator import check_bool, che... | apache-2.0 |
wolverineav/horizon | openstack_dashboard/dashboards/project/access_and_security/tests.py | 6 | 12538 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | apache-2.0 |
nakul02/incubator-systemml | src/main/python/tests/test_matrix_agg_fn.py | 14 | 3752 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
aetilley/scikit-learn | sklearn/datasets/lfw.py | 50 | 19048 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
lnielsen/invenio | invenio/modules/oauth2server/forms.py | 1 | 4533 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
apple/llvm-project | lldb/test/API/commands/expression/persistent_types/TestNestedPersistentTypes.py | 8 | 1109 | """
Test that nested persistent types work.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class NestedPersistentTypesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test_persistent_types(self):
""... | apache-2.0 |
chen0031/nupic | nupic/support/enum.py | 26 | 3005 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
samastur/django-filer | filer/migrations/0011_auto__del_field_folderpermission_can_add_children__del_field_folderper.py | 49 | 11222 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'FolderPermission.can_add_children'
db.delete_column('filer_folderpermission', 'can_add_chi... | bsd-3-clause |
KitKasai/KitBot | showdownbot.py | 1 | 2108 | import websocket
import requests
import json
class PokemonShowdownBot:
def __init__(self):
self.data = json.loads(open('config.json').read())
self.url = self.data['url']
self.rooms = []
self.openConnection()
def onMessage(self, ws, message):
print(message)
if not message: return
if '\n' not in messa... | mit |
amgowano/oppia | extensions/interactions/MusicNotesInput/MusicNotesInput.py | 17 | 1635 | # 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 |
songjs1993/DeepLearning | 3CNN/CNN_LeNet_5_cifar_dev.py | 1 | 15045 | # Auther: Alan
"""
实现AlexNet网络结构:但是实际上AlexNet网络结构的餐率领有60M,其实际的参数量比后来的几个网络结构都要多,这里不选择
但是尝试实现更深层的卷积网络来查看性能
这里一共整理了4层
"""
# Auther: Alan
"""
将LeNet5应用在Cifar数据集上
"""
import tensorflow as tf
import random
import os
import scipy.io as sio
import matplotlib.pyplot as plt # plt 用于显示图片
import matplotlib.image a... | apache-2.0 |
bd339/servo | tests/wpt/css-tests/tools/html5lib/utils/spider.py | 436 | 4157 | #!/usr/bin/env python
"""Spider to try and find bugs in the parser. Requires httplib2 and elementtree
usage:
import spider
s = spider.Spider()
s.spider("http://www.google.com", maxURLs=100)
"""
import urllib.request, urllib.error, urllib.parse
import urllib.robotparser
import md5
import httplib2
import html5lib
fro... | mpl-2.0 |
mj10777/QGIS | python/plugins/processing/gui/DirectorySelectorDialog.py | 45 | 4455 | # -*- coding: utf-8 -*-
"""
***************************************************************************
DirectorySelectorDialog.py
---------------------
Date : May 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*****... | gpl-2.0 |
ymcagodme/Norwalk-Judo | django/contrib/localflavor/se/utils.py | 202 | 2398 | import re
import datetime
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
tmp = sum([int(... | bsd-3-clause |
danijar/sets | sets/core/dataset.py | 1 | 3148 | import random
import numpy as np
class Dataset:
"""
A mapping from column names to immutable arrays of equal length.
"""
def __init__(self, **data):
self._data = {}
self._length = None
super().__init__()
for column, data in data.items():
self[column] = data... | mit |
sangh/LaserShow | pyglet-hg/pyglet/window/cocoa/__init__.py | 3 | 47436 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
truhoang/3d-coverage-solo | src/mavros/mission.py | 1 | 4215 | # -*- python -*-
# vim:set ts=4 sw=4 et:
#
# Copyright 2014 Vladimir Ermakov.
#
# This file is part of the mavros package and subject to the license terms
# in the top-level LICENSE file of the mavros repository.
# https://github.com/mavlink/mavros/tree/master/LICENSE.md
import csv
import time
import rospy
import mav... | mit |
blaze33/django | django/template/defaultfilters.py | 105 | 28133 | """Default variable filters."""
from __future__ import unicode_literals
import re
import random as random_module
import unicodedata
from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
from django.template.base import Variable, Library, VariableD... | bsd-3-clause |
pathes/dollar | dollar.py | 1 | 10009 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Backtrack2:
"""
Backtrack dynamic algorithm for Shubik's 2-player dollar auction.
"""
def __init__(self, b1=50, b2=50, s=20):
self.b1 = b1
self.b2 = b2
self.s = s
self.a = None
def backtrack(self):
# a - ... | mit |
jspargo/AneMo | thermo/flask/lib/python2.7/site-packages/markupsafe/tests.py | 674 | 6107 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... | gpl-2.0 |
yhe39/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_script-src_unsafe-inline_blocked_ext-manual.py | 30 | 2752 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "script-src 'unsafe-in... | bsd-3-clause |
x303597316/hue | desktop/core/ext-py/Paste-2.0.1/paste/util/PySourceColor.py | 50 | 83623 | # -*- coding: Latin-1 -*-
"""
PySourceColor: color Python source code
"""
"""
PySourceColor.py
----------------------------------------------------------------------------
A python source to colorized html/css/xhtml converter.
Hacked by M.E.Farmer Jr. 2004, 2005
Python license
----------------------------------... | apache-2.0 |
pepeportela/edx-platform | openedx/core/djangoapps/content/course_structures/api/v0/tests_api.py | 21 | 5841 | """
Course Structure api.py tests
"""
from .api import course_structure
from openedx.core.djangoapps.content.course_structures.signals import listen_for_course_publish
from xmodule.modulestore.django import SignalHandler
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tes... | agpl-3.0 |
googleapis/googleapis-gen | google/cloud/retail/v2/retail-v2-py/google/cloud/retail_v2/services/catalog_service/client.py | 1 | 23598 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
paepcke/json_to_relation | json_to_relation/test/testManageDb.py | 1 | 4504 | # Copyright (c) 2014, Stanford University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ... | bsd-3-clause |
cchristelis/inasafe | safe/gui/tools/shake_grid/test/test_shakemap_converter_dialog.py | 8 | 3407 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. 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 Fre... | gpl-3.0 |
kerstin/moviepy | examples/headblur.py | 13 | 1584 | import pickle
from moviepy.editor import *
from moviepy.video.tools.tracking import manual_tracking, to_fxfy
# LOAD THE CLIP (subclip 6'51 - 7'01 of a chaplin movie)
clip = VideoFileClip("../../videos/chaplin.mp4").subclip((6,51.7),(7,01.3))
# MANUAL TRACKING OF THE HEAD
# the three next lines are for the manual t... | mit |
timohtey/mediadrop_copy | mediacore_env/Lib/encodings/iso8859_9.py | 593 | 13412 | """ Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.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,input,errors='... | gpl-3.0 |
maferelo/saleor | saleor/product/migrations/0062_sortable_models.py | 3 | 1509 | # Generated by Django 2.0.3 on 2018-05-08 16:05
from django.db import migrations, models
def assign_sort_order_to_product_images(apps, schema_editor):
ProductAttribute = apps.get_model("product", "ProductAttribute")
for attribute in ProductAttribute.objects.prefetch_related("values"):
for order, valu... | bsd-3-clause |
Liamraystanley/dropb.in | lib/flask/exthook.py | 783 | 5087 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... | mit |
dataxu/ansible | test/units/modules/network/f5/test_bigip_vlan.py | 23 | 10000 | # -*- 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 |
markjeee/gammu | python/examples/setconfig.py | 1 | 1102 | #!/usr/bin/env python
'''
Mere a test case than a useful example, showing various ways of setting
configuration.
'''
CONFIGS = [
{
'StartInfo': True,
'UseGlobalDebugFile': True,
'DebugFile': None,
'SyncTime': True,
'Connection': 'at',
'LockDevice': True,
'Deb... | gpl-2.0 |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-libxml2/libxml2.py | 1 | 335733 | import libxml2mod
import types
import sys
# The root of all libxml2 errors.
class libxmlError(Exception): pass
#
# id() is sometimes negative ...
#
def pos_id(o):
i = id(o)
if (i < 0):
return (sys.maxint - i)
return i
#
# Errors raised by the wrappers when some tree handling failed.
#
class treeE... | mit |
D-Vaillant/julius | julius/ciphers.py | 1 | 1184 | """ ciphers.py:
Ciphers!
"""
import functools
import itertools
from string import ascii_lowercase, ascii_uppercase
def letter_to_num(letter: str,
is_inversed=False) -> int:
"""
Takes a letter to a number!
"""
if letter in ascii_uppercase:
num = ord(letter) - ord('A')
... | gpl-3.0 |
harterj/moose | python/moosesqa/check_requirements.py | 3 | 12477 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import re
im... | lgpl-2.1 |
stvstnfrd/xblock-sdk | sample_xblocks/basic/content.py | 2 | 8847 | """Content-oriented XBlocks."""
from string import Template
from lxml import etree
from web_fragments.fragment import Fragment
from xblock.core import Scope, String, XBlock
class HelloWorldBlock(XBlock):
"""A simple block: just show some fixed content."""
def fallback_view(self, view_name, context=None):... | apache-2.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_9_0/if_vlan_broker.py | 16 | 62205 | from ..broker import Broker
class IfVlanBroker(Broker):
controller = "if_vlans"
def show(self, **kwargs):
"""Shows the details for the specified if vlan.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
... | apache-2.0 |
davidfraser/sqlalchemy | examples/vertical/dictlike-polymorphic.py | 28 | 7181 | """Mapping a polymorphic-valued vertical table as a dictionary.
Builds upon the dictlike.py example to also add differently typed
columns to the "fact" table, e.g.::
Table('properties', metadata
Column('owner_id', Integer, ForeignKey('owner.id'),
primary_key=True),
Column('key', Unico... | mit |
chipx86/reviewboard | reviewboard/admin/tests/test_validation.py | 2 | 1234 | """Unit tests for reviewboard.admin.validation."""
from __future__ import unicode_literals
from django.forms import ValidationError
from reviewboard.admin.validation import validate_bug_tracker
from reviewboard.testing.testcase import TestCase
class ValidationTests(TestCase):
"""Unit tests for reviewboard.admi... | mit |
fatedier/shadowsocks-1 | tests/coverage_server.py | 1072 | 1655 | #!/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 |
microcom/odoo | addons/website_blog/tests/common.py | 46 | 1479 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestWebsiteBlogCommon(common.TransactionCase):
def setUp(self):
super(TestWebsiteBlogCommon, self).setUp()
Users = self.env['res.users']
group_blog_manager_id = self.ref('base.group_website_designer')
group_employee_i... | agpl-3.0 |
chitr/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_phys.py | 19 | 2828 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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 t... | apache-2.0 |
RossLYoung/django-photologue | photologue/views.py | 3 | 5802 | import warnings
from django.views.generic.dates import ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView, \
YearArchiveView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.base import RedirectView
from django.core.urlresol... | bsd-3-clause |
USGSDenverPychron/pychron | pychron/database/orms/isotope/meas.py | 1 | 10404 | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | apache-2.0 |
Gateworks/platform-external-chromium_org | chrome/test/chromedriver/embed_version_in_cpp.py | 69 | 1114 | #!/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.
"""Embeds Chrome user data files in C++ code."""
import optparse
import os
import sys
import chrome_paths
import cpp_source
sys.path... | bsd-3-clause |
thelac/crazyflie | lib/cfclient/ui/widgets/plotwidget.py | 27 | 10563 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/numpy/f2py/tests/test_parameter.py | 27 | 3970 | from __future__ import division, absolute_import, print_function
import os
import math
import numpy as np
from numpy.testing import run_module_suite, dec, assert_raises, assert_equal
import util
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestParameters(util.F2PyTest):
#... | mit |
daeseokyoun/youtube-dl | youtube_dl/extractor/franceinter.py | 17 | 1644 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class FranceInterIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.franceinter.fr/player/ree... | unlicense |
siutanwong/scikit-learn | sklearn/preprocessing/__init__.py | 268 | 1319 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... | bsd-3-clause |
wearpants/osf.io | website/tokens/handlers.py | 17 | 4230 | import httplib as http
from flask import redirect, request
import markupsafe
from modularodm import Q
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError, PermissionsError
from framework import status
from website.tokens.exceptions import UnsupportedSanctionHandlerKind,... | apache-2.0 |
laperry1/android_external_chromium_org | components/policy/tools/syntax_check_policy_template_json.py | 34 | 19621 | #!/usr/bin/env python
# Copyright (c) 2012 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.
'''
Checks a policy_templates.json file for conformity to its syntax specification.
'''
import json
import optparse
import os
impo... | bsd-3-clause |
factorlibre/odoomrp-wip | quality_control_between_dates/models/qc_inspection.py | 29 | 1106 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class QcInspectio... | agpl-3.0 |
JCA-Developpement/Odoo | addons/account/edi/invoice.py | 342 | 13984 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
hehuabing/rt-thread | components/external/freetype/src/tools/docmaker/docmaker.py | 146 | 3202 | #!/usr/bin/env python
#
# docmaker.py
#
# Convert source code markup to HTML documentation.
#
# Copyright 2002, 2004, 2008, 2013, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.T... | gpl-2.0 |
XiaodunServerGroup/xiaodun-platform | lms/djangoapps/courseware/tests/tests.py | 29 | 7262 | """
Test for LMS courseware app.
"""
import mock
from mock import Mock
from unittest import TestCase
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from textwrap import dedent
from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore.django import modulest... | agpl-3.0 |
AlexOugh/horizon | openstack_dashboard/nikola_auth/tests/settings.py | 1 | 1577 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
0k/odoo | addons/account_anglo_saxon/__init__.py | 436 | 1090 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... | agpl-3.0 |
WhireCrow/openwrt-mt7620 | staging_dir/host/lib/python2.7/ctypes/test/test_objects.py | 142 | 1756 | r'''
This tests the '_objects' attribute of ctypes instances. '_objects'
holds references to objects that must be kept alive as long as the
ctypes instance, to make sure that the memory buffer is valid.
WARNING: The '_objects' attribute is exposed ONLY for debugging ctypes itself,
it MUST NEVER BE MODIFIED!
'_object... | gpl-2.0 |
Architektor/PySnip | venv/bin/painter.py | 1 | 2139 | #!/home/syberic/AOSServer/PySnip/venv/bin/python2
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of ti... | gpl-3.0 |
awatts/boto | tests/integration/logs/test_layer1.py | 114 | 1814 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | mit |
kivy/kivy | kivy/tests/test_uix_dropdown.py | 4 | 3031 | from kivy.tests import async_run, UnitKivyApp
def dropdown_app():
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.dropdown import DropDown
from kivy.uix.label import Label
class RootButton(Button):
dropdown = None
def on_touch_down(self, touch):
... | mit |
wangming28/syzygy | third_party/numpy/files/numpy/oldnumeric/ufuncs.py | 102 | 1231 | __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide',
'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos',
'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or',
'bitwise_and', 'logical_xor', 'log', 'subtract', 'invert',
'negative',... | apache-2.0 |
stefwalter/sssd | src/tests/pyhbac-test.py | 9 | 19286 | #!/usr/bin/python
import unittest
import sys
import os
import copy
srcdir = os.getenv('builddir')
if not srcdir:
srcdir = "."
MODPATH = srcdir + "/.libs" #FIXME - is there a way to get this from libtool?
def compat_assertItemsEqual(this, expected_seq, actual_seq, msg=None):
return this.assertEqual(sorted(exp... | gpl-3.0 |
valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/naver.py | 1 | 4324 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
update_url_query,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tv(?:cast)?\.naver\.com/v/(?P<id>\d+)'
_TESTS = [{
'url': 'http://tv.naver.com/v/81652... | gpl-3.0 |
tingtingths/cipherhelper | ciphers.py | 1 | 5984 | """Ciphers module.
Provide Asymmetric and Symmetric cipher functions.\
"""
from enum import IntEnum
from Crypto import Random
from Crypto.Cipher import PKCS1_v1_5, AES
from Crypto.PublicKey import RSA
from Crypto.Random import random as rand
from Crypto.Util import Counter
class AESBlockCipher:
class Size(IntEn... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.