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 |
|---|---|---|---|---|---|
jinankjain/zamboni | mkt/submit/forms.py | 1 | 19036 | import datetime
import os
from collections import defaultdict
from django import forms
from django.conf import settings
import basket
import happyforms
import waffle
from tower import ugettext as _, ugettext_lazy as _lazy
import amo
from addons.models import Addon, AddonUpsell, BlacklistedSlug, Webapp
from amo.utils... | bsd-3-clause |
atuljain/odoo | addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py | 381 | 2572 | # -*- 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 |
reliak/moonpdf | ext/sumatra/scripts/langs.py | 6 | 2396 | g_langs = [
["el", "Greek (Ελληνικά)"],
["en", "English"],
["cn", "Chinese Simplified (简体中文)"],
["af", "Afrikaans"],
["ca", "Catalan (Català)"],
["am", "Armenian (Հայերեն)"],
["it", "Italian (Italiano)"],
["vn", "Vietnamese (Việt Nam)"],
["cz", "Czech (Čeština)"],
["cy", "Welsh (Cymraeg)"],
["ar"... | gpl-3.0 |
andrewyoung1991/abjad | abjad/tools/rhythmmakertools/test/test_rhythmmakertools_IncisedRhythmMaker___call__.py | 2 | 26930 | # -*- encoding: utf-8 -*-
from abjad import *
def test_rhythmmakertools_IncisedRhythmMaker___call___01():
incise_specifier = rhythmmakertools.InciseSpecifier(
prefix_talea=[-8],
prefix_counts=[0, 1],
suffix_talea=[-1],
suffix_counts=[1],
talea_denominator=32,
)
... | gpl-3.0 |
xHeliotrope/injustice_dropper | env/lib/python3.4/site-packages/phonenumbers/data/region_BG.py | 9 | 3091 | """Auto-generated file, do not edit by hand. BG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BG = PhoneMetadata(id='BG', country_code=359, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[23567]\\d{5,7}|[489]\\d{6,8}', possible... | mit |
pombredanne/RESTandra | test/system/test_cql.py | 2 | 20367 |
from os.path import abspath, dirname, join
import sys, uuid, time
sys.path.append(join(abspath(dirname(__file__)), '../../drivers/py'))
from cql import Connection
from cql.errors import CQLException
from . import ThriftTester
from . import thrift_client # TODO: temporary
def assert_raises(exception, method, *ar... | apache-2.0 |
RomainBrault/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py | 73 | 2264 | """Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | bsd-3-clause |
nhicher/ansible | test/integration/targets/azure_rm_keyvault/lookup_plugins/azure_service_principal_attribute.py | 84 | 3519 | # (c) 2018 Yunge Zhu, <yungez@microsoft.com>
# (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: azure_service_principal_attribute
req... | gpl-3.0 |
GheRivero/ansible | lib/ansible/modules/windows/win_shell.py | 24 | 4786 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible, inc
# 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': 'core'}
DOCUMENTATIO... | gpl-3.0 |
cyberden/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/nfb.py | 128 | 3783 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
)
class NFBIE(InfoExtractor):
IE_NAME = 'nfb'
IE_DESC = 'National Film Board of Canada'
_VALID_URL = r'https?://(?:www\.)?(?:nfb|onf)\.ca/film/(?P<id>[\da-z... | gpl-3.0 |
jdemon519/cfme_tests | cfme/tests/infrastructure/test_customization_template.py | 4 | 3274 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.infrastructure import pxe
from utils import error
from utils.blockers import BZ
from utils.update import update
pytestmark = [pytest.mark.tier(3)]
def test_customization_template_crud():
"""Basic CRUD test for customization templates."""
tem... | gpl-2.0 |
farseerfc/jgments | lib/Mako-0.3.4/mako/exceptions.py | 13 | 11591 | # exceptions.py
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""exception classes"""
import traceback, sys, re
from mako import util
class MakoException(E... | bsd-2-clause |
ianmiell/OLD-shutitdist | help2man/help2man.py | 1 | 1333 | """ShutIt module. See http://shutit.tk/
"""
from shutit_module import ShutItModule
class help2man(ShutItModule):
def is_installed(self, shutit):
return shutit.file_exists('/root/shutit_build/module_record/' + self.module_id + '/built')
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/help2man')
... | gpl-2.0 |
amarogithub/repository.demo.kod2 | plugins/plugin.video.simplek/addon.py | 2 | 2999 | import sys
import os
import urllib
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import logging
from operator import itemgetter
def show_tags():
tag_handle = int(sys.argv[1])
xbmcplugin.setContent(tag_handle, 'tags')
for tag in tags:
iconPath = os.path.join(home, 'logos', tag['icon'])
li... | gpl-2.0 |
ufjfeng/leetcode-jf-soln | python/274_h_index.py | 1 | 1539 | """
Given an array of citations (each citation is a non-negative integer) of a
researcher, write a function to compute the researcher's h-index.
According to the definition of h-index on Wikipedia: "A scientist has index h if
h of his/her N papers have at least h citations each, and the other N − h papers
have no more... | mit |
baoilleach/openbabel | test/testsmartssym.py | 5 | 4195 | """Test OpenBabel executables from Python
Note: Python bindings not used
On Windows or Linux, you can run these tests at the commandline
in the build folder with:
"C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake
-R pytest -VV
You could also "chdir"... | gpl-2.0 |
jerel/readthedocs.org | readthedocs/vcs_support/test.py | 8 | 2292 | import os
import shutil
import unittest
import mock
from django.conf import settings
from vcs_support import utils
TEST_STATICS = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_statics')
class TestNonBlockingLock(unittest.TestCase):
@classmethod
def setUpClass(cls):
try:
... | mit |
ZEN-ben/ZEN-Compo | src/ZENben/DefaultBundle/Resources/private/nodejs/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
opensvn/python | pygame/blend_color.py | 1 | 1174 | import pygame
from pygame.locals import *
from sys import exit
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
color1 = (221, 99, 20)
color2 = (96, 130, 51)
factor = 0
def lerp(value1, value2, factor):
return value1 + (value2 - value1) * factor
def blend_color(color1, color2, blend_factor):
... | gpl-2.0 |
benoit-pierre/python-xlib | examples/draw.py | 2 | 7498 | #!/usr/bin/python
#
# examples/draw.py -- high-level xlib test application.
#
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundati... | lgpl-2.1 |
haggi/OpenMaya | src/mayaToCorona/mtco_devmodule/scripts/Corona/aeNodeTemplates.py | 1 | 7589 | import pymel.core as pm
import logging
log = logging.getLogger("ui")
class BaseTemplate(pm.ui.AETemplate):
def addControl(self, control, label=None, **kwargs):
pm.ui.AETemplate.addControl(self, control, label=label, **kwargs)
def beginLayout(self, name, collapse=True):
pm.ui.AETe... | mit |
kjagoo/wger_stark | wger/manager/views/set.py | 2 | 8472 | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 License, or
# (at your option) any ... | agpl-3.0 |
Akylas/CouchPotatoServer | libs/suds/metrics.py | 211 | 2004 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
derenio/django-payments | payments/__init__.py | 4 | 5126 | from __future__ import unicode_literals
from collections import namedtuple
import re
try:
from urllib.parse import urljoin, urlencode
except ImportError:
from urllib import urlencode
from urlparse import urljoin
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.... | bsd-3-clause |
jaharkes/home-assistant | tests/components/media_player/test_demo.py | 4 | 10909 | """The tests for the Demo Media player platform."""
import unittest
from unittest.mock import patch
import asyncio
from homeassistant.bootstrap import setup_component
from homeassistant.const import HTTP_HEADER_HA_AUTH
import homeassistant.components.media_player as mp
import homeassistant.components.http as http
imp... | mit |
eirannejad/pyRevit | pyrevitlib/rpw/extras/rhino.py | 1 | 1703 | """
Rhino - Rhino3dmIO
Rhino3dmIO is a subset of RhinoCommon and it gives you access to openNurbs,
allowing you to, amongst other things, read and write 3dm files.
Usage:
>>> from rpw.extras.rhino import Rhino as rc
>>> pt1 = rc.Geometry.Point3d(0,0,0)
>>> pt2 = rc.Geometry.Point3d(10,10,0)
>>> line1... | gpl-3.0 |
LindaLS/Sausage_Biscuits | architecture/google_doc_handler.py | 1 | 4037 | # Instructions for downloading files using these functions:
# 1. Turn on the drive API: follow through "Step 1" from
# https://developers.google.com/drive/v3/web/quickstart/python
# At the end, you will be instructed to download a json file and
# name it "client_secret.json" - place this json file inside
... | gpl-3.0 |
jherico/qtwebkit | Tools/Scripts/webkitpy/tool/steps/commit.py | 124 | 5399 | # 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 th... | lgpl-3.0 |
hjanime/VisTrails | vistrails/core/inspector.py | 1 | 10694 | ###############################################################################
##
## Copyright (C) 2014-2015, 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 |
rvalles/pymvntricks | pomartifactversion.py | 1 | 1247 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division #1/2 = float, 1//2 = integer, python 3.0 behaviour in 2.6, to make future port to 3 easier.
from optparse import OptionParser
import libxml2
def main():
optparser = OptionParser("usage: %prog [options]",version="%prog 0.1")
optparser.add_option... | gpl-3.0 |
tonk/ansible | test/integration/targets/setup_rpm_repo/files/create-repo.py | 34 | 1495 | #!/usr/bin/env python
import sys
from collections import namedtuple
import rpmfluff
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
SPECS = [
RPM('dinginessentail', '1.0', '1', None, None),
RPM('dinginessentail', '1.0', '2', '1', None),
RPM('dinginessentail', '1.1', '1',... | gpl-3.0 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Tools/Scripts/byext.py | 37 | 3945 | #! /usr/bin/env python
"""Show file statistics by extension."""
from __future__ import print_function
import os
import sys
class Stats:
def __init__(self):
self.stats = {}
def statargs(self, args):
for arg in args:
if os.path.isdir(arg):
self.statdir(arg)
... | mit |
alxgu/ansible | lib/ansible/modules/storage/netapp/na_ontap_node.py | 38 | 4289 | #!/usr/bin/python
# (c) 2018, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
tpo/ansible | lib/ansible/playbook/taggable.py | 96 | 3170 | # (c) 2012-2014, 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) an... | gpl-3.0 |
dischinator/pyload | module/plugins/crypter/TnyCz.py | 5 | 1176 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class TnyCz(SimpleCrypter):
__name__ = "TnyCz"
__type__ = "crypter"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?tny\.cz/\w+'
__config__ = [("activated" ... | gpl-3.0 |
guerrerocarlos/odoo | addons/hr_attendance/hr_attendance.py | 250 | 9090 | # -*- 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 |
thunderboltsid/grpc | src/python/grpcio_tests/tests/unit/resources.py | 25 | 2145 | # 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 |
mgit-at/ansible | lib/ansible/modules/network/exos/exos_facts.py | 27 | 13983 | #!/usr/bin/python
#
# (c) 2018 Extreme Networks 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 late... | gpl-3.0 |
ojii/django-cms | cms/migrations/0026_finish_placeholder_migration.py | 385 | 19523 | # -*- 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):
# Dummy migration
pass
def backwards(self, orm):
# Dummy migration
pass
models = {
... | bsd-3-clause |
nkhuyu/blaze | blaze/expr/functions.py | 11 | 2183 | """
Dispatches functions like ``sum`` to builtins, numpy, or blaze depending on
input
>>> sum([1, 2, 3])
6
>>> type(sum([1, 2, 3])).__name__
'int'
>>> type(sum(np.array([1, 2, 3], dtype=np.int64))).__name__
'int64'
>>> t = symbol('t', 'var * {x: int, y: int}')
>>> type(sum(t.x)).__name__
'sum'
"""
from __future__ ... | bsd-3-clause |
JFriel/honours_project | networkx/build/lib/networkx/generators/intersection.py | 55 | 3919 | # -*- coding: utf-8 -*-
"""
Generators for random intersection graphs.
"""
# Copyright (C) 2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import random
import networkx as nx
from networkx.algorithms im... | gpl-3.0 |
boh1996/LectioAPI | importers/importPrivateActivity.py | 1 | 1740 | import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'scrapers'))
sys.path.append("..")
from datetime import datetime
from pymongo import MongoClient
from database import *
import error
import sync
import private_activity as privateActivityApi
def importPrivateActivity ( school_id, branch_id, s... | mit |
aeroevan/android_kernel_moto_shamu | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
akosyakov/intellij-community | python/testData/inspections/PyCallByClassInspection/test.py | 52 | 1180 | class Z(object):
def method(self):
pass
class A(object):
def method(self, *args, **kwargs):
Z.method(<weak_warning descr="Passing inspections.PyCallByClassInspection.test.A instead of inspections.PyCallByClassInspection.test.Z. Is this intentional?">self</weak_warning>) # passing wrong instan... | apache-2.0 |
neo5g/server-gsrp5 | server-gsrp5/orm/common.py | 2 | 1743 | # -*- coding: utf-8 -*-
LOG_ACCESS_COLUMNS = {
'create_uid':'integer REFERENCES %sbc_users ON DELETE SET NULL',
'create_datetime':'timestamp without time zone',
'write_uid':'integer REFERENCES %sbc_users ON DELETE SET NULL',
'write_datetime':'timestamp without time zone'
}
MAGIC_COLUMNS = ['id']... | agpl-3.0 |
Tiotao/morpherpy | env/Lib/site-packages/setuptools/command/install.py | 496 | 4685 | from distutils.errors import DistutilsArgError
import inspect
import glob
import warnings
import platform
import distutils.command.install as orig
import setuptools
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
# now. See https://bitbucket.org/pypa/setuptools/issue/199/
_install = orig.... | mit |
petewarden/tensorflow | tensorflow/python/ops/variable_spec_test.py | 15 | 2414 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
abo-abo/edx-platform | lms/djangoapps/instructor/tests/test_legacy_gradebook.py | 27 | 5679 | """
Tests of the instructor dashboard gradebook
"""
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory
from xmodule... | agpl-3.0 |
firerszd/kbengine | kbe/res/scripts/common/Lib/dis.py | 88 | 17160 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
import collections
import io
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
"findlinestarts", "findlabels", "show_code",
"get_instructi... | lgpl-3.0 |
melodous/designate | designate/tests/test_api/test_v2/test_recordsets.py | 1 | 19499 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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/lice... | apache-2.0 |
tux-00/ansible | lib/ansible/modules/network/avi/avi_network.py | 49 | 4780 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
soimort/you-get | src/you_get/extractors/vine.py | 3 | 1176 | #!/usr/bin/env python
__all__ = ['vine_download']
from ..common import *
import json
def vine_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_content(url)
video_id = r1(r'vine.co/v/([^/]+)', url)
title = r1(r'<title>([^<]*)</title>', html)
stream = r1(r'<meta proper... | mit |
Antiun/odoo | addons/membership/report/report_membership.py | 313 | 5267 | # -*- 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 |
cntnboys/cmput410-project | venv/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py | 205 | 16799 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3 import Retry
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
... | apache-2.0 |
cemoody/chainer | cupy/core/__init__.py | 5 | 2551 | from cupy.core import core
from cupy.core import internal
ndarray = core.ndarray
get_size = internal.get_size
complete_slice = internal.complete_slice
ufunc = core.ufunc
create_ufunc = core.create_ufunc
ElementwiseKernel = core.ElementwiseKernel
create_reduction_func = core.create_reduction_func
ReductionKernel = co... | mit |
aaltay/beam | sdks/python/apache_beam/examples/snippets/transforms/aggregation/groupbykey.py | 3 | 1582 | # 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 "License");... | apache-2.0 |
jledbetter/openhatch | mysite/profile/migrations/0076_profile_photo_thumbnail_30px_wide.py | 17 | 16615 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 Licens... | agpl-3.0 |
izhan/Stream-Framework | stream_framework/tests/feeds/redis.py | 9 | 1712 | from stream_framework.tests.feeds.base import TestBaseFeed, implementation
from stream_framework.feeds.redis import RedisFeed
from stream_framework.activity import Activity
from stream_framework.utils import datetime_to_epoch
class CustomActivity(Activity):
@property
def serialization_id(self):
'''
... | bsd-3-clause |
Chilledheart/chromium | third_party/cython/src/Cython/Debugger/Tests/test_libpython_in_gdb.py | 110 | 3979 | # -*- coding: UTF-8 -*-
"""
Test libpython.py. This is already partly tested by test_libcython_in_gdb and
Lib/test/test_gdb.py in the Python source. These tests are run in gdb and
called from test_libcython_in_gdb.main()
"""
import os
import sys
import gdb
from Cython.Debugger import libcython
from Cython.Debugger ... | bsd-3-clause |
pblottiere/QGIS | python/PyQt/PyQt5/uic/properties.py | 45 | 1045 | # -*- coding: utf-8 -*-
"""
***************************************************************************
properties.py
---------------------
Date : March 2016
Copyright : (C) 2016 by Juergen E. Fischer
Email : jef at norbit dot de
***************************... | gpl-2.0 |
savi-dev/keystone | keystone/identity/backends/kvs.py | 3 | 13588 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | apache-2.0 |
luuhfelix/ProjetoFilmes | backend/apps/filmecartaz_app/facade.py | 2 | 2146 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaegraph.business_base import NodeSearch, DeleteNode
from filmecartaz_app.commands import ListCartazCommand, SaveCartazCommand, UpdateCartazCommand, \
CartazPublicForm, CartazDetailForm, CartazShortForm
def save_cartaz_cmd(**car... | mit |
hifly/connector-magento | magentoerpconnect/tests/test_export_picking.py | 11 | 10585 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
dimtruck/magnum | magnum/tests/unit/objects/test_magnum_service.py | 2 | 5137 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
KiChjang/servo | components/script/dom/bindings/codegen/parser/tests/test_securecontext_extended_attribute.py | 12 | 16548 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
[SecureContext]
interface TestSecureContextOnInterface {
const octet TEST_CONSTANT = 0;
readonly attribute byte testAttribute;
void testMethod(byte foo);
};
partial interface TestSecureCont... | mpl-2.0 |
christophlsa/odoo | addons/report/tests/test_reports.py | 385 | 2251 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
badparking/badparking.in.ua | badparking/core/migrations/0005_auto_20160607_2233.py | 2 | 1423 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-07 19:33
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20160527_2148'),
]
... | mit |
idncom/odoo | addons/pos_discount/__init__.py | 315 | 1072 | # -*- 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... | agpl-3.0 |
ksomervi/sift | sift.py | 1 | 8293 | #!/usr/bin/python3
#
# General flow
# 1. Parse the configuration file
# a. Get the wordpress URL and password
# b. Get the image parameters (MAX_WIDTH)
# 2. Process the images
# a. Fix rotation if required ('jhead -autorate')
# b. Resize to max width of config['MAX_WIDTH']
# 3. Upload to wordpress site
imp... | gpl-2.0 |
zehpunktbarron/iOSMAnalyzer | scripts/c5_poi_tags.py | 1 | 7057 | # -*- coding: utf-8 -*-
#!/usr/bin/python2.7
#description :This file creates a plot: Calculates the development if the avarage tag-number of all POIs
#author :Christopher Barron @ http://giscience.uni-hd.de/
#date :19.01.2013
#version :0.1
#usage :python pyscript.py
#========... | gpl-3.0 |
mwaterfall/alfred-kippt-search | workflow/requests/packages/charade/latin1prober.py | 151 | 5380 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer.... | mit |
repotvsupertuga/repo | instal/plugin.video.SportsDevil/lib/ordereddict.py | 1047 | 4094 | # Copyright (c) 2009 Raymond Hettinger
#
# 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,
# publish,... | gpl-2.0 |
home-assistant/home-assistant | homeassistant/components/airly/config_flow.py | 2 | 3829 | """Adds config flow for Airly."""
from __future__ import annotations
from typing import Any
from aiohttp import ClientSession
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CO... | apache-2.0 |
sparkslabs/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Audio/Codec/PyMedia/Encoder.py | 6 | 5144 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
Tranzystorek/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_treeadapters.py | 451 | 1852 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import html5lib
from html5lib.treeadapters import sax
from html5lib.treewalkers import getTreeWalker
def test_to_sax():
handler = support.TracingSaxHandler()
tree = html5lib.parse("""<html xml:lang="en">... | mpl-2.0 |
hipgraphics/godot | platform/iphone/detect.py | 10 | 7248 | import os
import sys
def is_active():
return True
def get_name():
return "iOS"
def can_build():
import sys
import os
if sys.platform == 'darwin' or os.environ.has_key("OSXCROSS_IOS"):
return True
return False
def get_opts():
return [
('IPHONEPLATFORM', 'name of the iphone platform', 'iPhoneOS'),
('... | mit |
sameerparekh/pants | tests/python/pants_test/pantsd/test_watchman.py | 10 | 7920 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | apache-2.0 |
deepinsight/Deformable-ConvNets | deeplab/runs_CAIScene/infer5.py | 1 | 11273 | import os
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
import sys
import argparse
import numpy as np
import cv2
import math
import datetime
import random
import json
import pandas as pd
#import multiprocessing
from Queue import Queue
from threading import Thread
import mxnet as mx
import mxnet.ndarray as nd
from ea... | apache-2.0 |
fuhongliang/odoo | addons/portal/tests/__init__.py | 261 | 1078 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
dbremner/bite-project | deps/gdata-python-client/src/gdata/finance/__init__.py | 125 | 15397 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 |
liangwang/m5 | configs/ruby/protocols/MOESI_CMP_directory.py | 1 | 5822 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, 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 co... | bsd-3-clause |
viaembedded/arm-soc | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
aristanetworks/arista-ovs-nova | nova/tests/baremetal/db/test_bm_pxe_ip.py | 4 | 3577 | # Copyright (c) 2012 NTT DOCOMO, 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 requ... | apache-2.0 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/wheel/archive.py | 233 | 2286 | """
Archive tools for wheel.
"""
import os
import time
import logging
import os.path
import zipfile
log = logging.getLogger("wheel")
def archive_wheelfile(base_name, base_dir):
'''Archive all files under `base_dir` in a whl file and name it like
`base_name`.
'''
olddir = os.path.abspath(os.curdir)
... | mit |
L-Jovi/pra_django | books/models.py | 1 | 1916 | # coding: utf-8
from django.db import models
class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_length=50)
city = models.CharField(max_length=60)
state_province = models.CharField(max_length=30)
country = models.CharField(max_length=50)
websit... | gpl-2.0 |
pselle/calibre | src/calibre/gui2/store/stores/biblio_plugin.py | 22 | 1959 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2012, Alex Stanev <alex@stanev.org>'
__docformat__ = 'restructuredtext en'
import re
from calibre.gui2.store.basic... | gpl-3.0 |
ahmed-mahran/hue | desktop/core/ext-py/python-openid-2.2.5/examples/djopenid/util.py | 58 | 4921 |
"""
Utility code for the Django example consumer and server.
"""
from urlparse import urljoin
from django.db import connection
from django.template.context import RequestContext
from django.template import loader
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.core.urlreso... | apache-2.0 |
Novasoft-India/OperERP-AM-Motors | openerp/addons/account_report_company/__openerp__.py | 52 | 2562 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
gyroninja/tnoodle | git-tools/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
mrkm4ntr/incubator-airflow | airflow/providers/apache/spark/operators/spark_sql.py | 1 | 4653 | #
# 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... | apache-2.0 |
alshedivat/tensorflow | tensorflow/contrib/factorization/python/ops/gmm_ops.py | 13 | 20317 | # 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 |
embecosm/avr-gdb | gdb/testsuite/gdb.python/py-finish-breakpoint2.py | 34 | 1221 | # Copyright (C) 2011-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | gpl-2.0 |
deokwooj/DDEA | webgui/lib_bnlearn.py | 2 | 12256 | #!/usr/bin/python
# To force float point division
from __future__ import division
"""
Created on Mon Mar 24 19:24:11 2014
@author: NGO Quang Minh Khiem
@e-mail: khiem.ngo@adsc.com.sg
"""
from __future__ import division # To forace float point division
import numpy as np
from pandas import DataFrame
# R libs
import ... | gpl-2.0 |
GoogleCloudPlatform/appengine-blobstoremigrator-python | src/app/config.py | 2 | 2116 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
mganeva/mantid | Framework/PythonInterface/plugins/algorithms/MergeCalFiles.py | 1 | 6363 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=no-init
from __future__ impo... | gpl-3.0 |
Alwnikrotikz/gnome-agenda | agenda/plugins/ical/__init__.py | 2 | 5455 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: Florian Dorn <florian.dorn@gmail.com>
# @package: agenda
# @license: GNU GPLv2
#
# 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.
#
# This... | gpl-2.0 |
PyBossa/pybossa | test/test_api/test_category_api.py | 1 | 13369 | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA 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 License, or
# (at your op... | agpl-3.0 |
kmoocdev2/edx-platform | common/djangoapps/third_party_auth/tests/test_views.py | 23 | 6485 | """
Test the views served by third_party_auth.
"""
import unittest
import ddt
from django.conf import settings
from lxml import etree
from onelogin.saml2.errors import OneLogin_Saml2_Error
# Define some XML namespaces:
from third_party_auth.tasks import SAML_XML_NS
from .testutil import AUTH_FEATURE_ENABLED, AUTH_F... | agpl-3.0 |
gravyboat/streamlink | src/streamlink/plugins/hds.py | 4 | 1535 | import re
from urllib.parse import urlparse
from streamlink.plugin import Plugin
from streamlink.plugin.plugin import LOW_PRIORITY, NORMAL_PRIORITY, NO_PRIORITY, parse_url_params
from streamlink.stream import HDSStream
from streamlink.utils import update_scheme
class HDSPlugin(Plugin):
_url_re = re.compile(r"(hd... | bsd-2-clause |
micropython/micropython | tests/extmod/uasyncio_wait_for.py | 8 | 2851 | # Test asyncio.wait_for
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(id, t):
print("task start", id)
await asyncio.sleep(t)
print("task end", id)
return id * 2
async def ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.