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 |
|---|---|---|---|---|---|
viaregio/cartridge | cartridge/shop/migrations/0005_auto__add_field_product_rating_count__add_field_product_rating_average.py | 2 | 21083 | # encoding: 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):
# Adding field 'Product.rating_count'
db.add_column('shop_product', 'rating_count', self.gf('django.db.models.fiel... | bsd-2-clause |
yhat/ggplot | ggplot/scales/scale_fill_funfetti.py | 1 | 1106 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .scale import scale
from copy import deepcopy
class scale_fill_funfetti(scale):
"""
Make your plots look like funfetti
Parameters
----------
type: string
One of confetti or sp... | bsd-2-clause |
rplevka/robottelo | tests/foreman/cli/test_logging.py | 1 | 9907 | """CLI tests for logging.
:Requirement: Logging
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Logging
:Assignee: shwsingh
:TestType: Functional
:CaseImportance: Medium
:Upstream: No
"""
import re
import pytest
from fauxfactory import gen_string
from nailgun import entities
from robottelo i... | gpl-3.0 |
chrismattmann/girder | plugins/celery_jobs/server/__init__.py | 2 | 3005 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | apache-2.0 |
pjuu/pjuu | pjuu/lib/indexes.py | 1 | 1615 | # -*- coding: utf8 -*-
"""Creates the MongoDB indexes. This can be run each time the app is deployed
it will have no effect on indexes which are already there.
:license: AGPL v3, see LICENSE for more details
:copyright: 2014-2021 Joe Doherty
"""
# 3rd party imports
import pymongo
# Pjuu imports
from pjuu import mon... | agpl-3.0 |
google-research/rl-reliability-metrics | rl_reliability_metrics/analysis/plot_training_curves_test.py | 1 | 2747 | # coding=utf-8
# Copyright 2019 The Authors of RL Reliability Metrics.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
drglove/SickRage | lib/profilehooks.py | 143 | 24752 | """
Profiling hooks
This module contains a couple of decorators (`profile` and `coverage`) that
can be used to wrap functions and/or methods to produce profiles and line
coverage reports. There's a third convenient decorator (`timecall`) that
measures the duration of function execution without the extra profiling
ove... | gpl-3.0 |
rain1988/you-get | src/you_get/extractors/iqiyi.py | 6 | 5273 | #!/usr/bin/env python
__all__ = ['iqiyi_download']
from ..common import *
from uuid import uuid4
from random import random,randint
import json
from math import floor
from zlib import decompress
import hashlib
'''
Changelog:
-> http://www.iqiyi.com/common/flashplayer/20150810/MainPlayer_5_2_26_c3_3_7_1.swf
http://... | mit |
erlimar/prototypeguide | src/lib/jinja2/testsuite/lexnparse.py | 402 | 22314 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja... | mit |
cyanna/edx-platform | lms/djangoapps/courseware/views.py | 4 | 56361 | """
Courseware views functions
"""
import logging
import urllib
import json
import cgi
from datetime import datetime
from collections import defaultdict
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.conf import setti... | agpl-3.0 |
hbutau/vimdotfiles | pymode/autopep8.py | 8 | 120700 | #!/usr/bin/env python
# Copyright (C) 2010-2011 Hideo Hattori
# Copyright (C) 2011-2013 Hideo Hattori, Steven Myint
# Copyright (C) 2013-2015 Hideo Hattori, Steven Myint, Bill Wendling
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files... | lgpl-3.0 |
nagyistoce/odoo-dev-odoo | addons/procurement_jit/__init__.py | 374 | 1078 | # -*- 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 |
01org/iris-panel | iris/packagedb/views/scm.py | 8 | 2713 | # -*- coding: utf-8 -*-
# This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.... | gpl-2.0 |
0x7678/wireless-ids | wids.py | 2 | 199163 | #! /usr/bin/python
#
# This was written for educational purpose only. Use it at your own risk.
# Author will be not responsible for any damage!
# Written By SY Chua, syworks@gmail.com
#
appver="1.0, R.9"
apptitle="WIDS"
appDesc="- The Wireless Intrusion Detection System"
appcreated="07 Jan 2014"
appupdated="26 Feb 201... | gpl-2.0 |
andymckay/zamboni | mkt/webapps/management/commands/convert_icons.py | 1 | 2020 | import os
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.files.storage import default_storage as storage
import amo
from amo.decorators import write
from amo.utils import chunked, resize_image
from mkt.site.storage_utils import wa... | bsd-3-clause |
FrankBian/kuma | vendor/packages/translate-toolkit/translate/lang/test_ar.py | 7 | 1306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage('ar')
assert language.punctranslate(u"") == u""
assert language.punctranslate(u"abc efg") == u"abc efg"
assert la... | mpl-2.0 |
droidlabour/git_intgrtn_aws_s3 | CreateSSHKey/Crypto/SelfTest/PublicKey/test_importKey.py | 112 | 14943 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_importKey.py: Self-test for importing RSA keys
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone i... | mit |
rootfs/origin | cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/kubernetes/translations/extract.py | 377 | 3965 | #!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
joelcan/tools-eth-contract-dev | pyethereum/pyethereum/_version.py | 1 | 7911 | """
Version management with versioneer
https://github.com/warner/python-versioneer
Distribution through PyPI
1: git tag 0.6.31
2: python setup.py register sdist upload
Distributiuon through github
(i.e. users use github to generate tarballs with git archive)
1: git tag 0.6.31
2: git push; git push -... | mit |
omni5cience/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/nbconvert/preprocessors/extractoutput.py | 8 | 4702 | """Module containing a preprocessor that extracts all of the outputs from the
notebook file. The extracted outputs are returned in the 'resources' dictionary.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the... | mit |
ntt-sic/neutron | neutron/tests/unit/test_api_v2_resource.py | 3 | 14593 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Intel Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apa... | apache-2.0 |
LyonsLab/coge | bin/last_wrapper/Bio/GA/Selection/RouletteWheel.py | 4 | 4701 | """Implement Roulette Wheel selection on a population.
This implements Roulette Wheel selection in which individuals are
selected from a population randomly, with their proportion of selection
based on their relative fitness in the population.
"""
# standard modules
import random
import copy
# local modules
from Abst... | bsd-2-clause |
SaM-Solutions/samba | source4/scripting/python/samba/netcmd/fsmo.py | 19 | 7846 | #!/usr/bin/env python
#
# Changes a FSMO role owner
#
# Copyright Nadezhda Ivanova 2009
# Copyright Jelmer Vernooij 2009
#
# 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... | gpl-3.0 |
pjg101/SickRage | lib/html5lib/_inputstream.py | 45 | 32499 | from __future__ import absolute_import, division, unicode_literals
from six import text_type, binary_type
from six.moves import http_client, urllib
import codecs
import re
import webencodings
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import _ReparseException
from . im... | gpl-3.0 |
iut-ibk/P8-WSC-GUI | 3dparty/Editra/src/syntax/_erlang.py | 3 | 4464 | ###############################################################################
# Name: erlang.py #
# Purpose: Define Erlang syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | gpl-2.0 |
zubair-arbi/edx-platform | common/djangoapps/student/tests/test_enrollment.py | 96 | 8505 | """
Tests for student enrollment.
"""
import ddt
import unittest
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from util.testing im... | agpl-3.0 |
nolanliou/tensorflow | tensorflow/contrib/session_bundle/example/export_half_plus_two.py | 75 | 6029 | # 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 |
tinkhaven-organization/odoo | addons/l10n_th/__init__.py | 893 | 1045 | # -*- 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 |
root-mirror/root | bindings/pyroot/cppyy/cppyy/test/test_pythonify.py | 20 | 16364 | import py, os, sys
from pytest import raises
from .support import setup_make, pylong
currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("example01Dict"))
def setup_module(mod):
setup_make("example01")
class TestPYTHONIFY:
def setup_class(cls):
cls.test_dct = test_dct
i... | lgpl-2.1 |
vaygr/ansible | test/sanity/validate-modules/utils.py | 5 | 4256 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, 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 ... | gpl-3.0 |
rschwiebert/galgebra | examples/Old Format/terminal_check.py | 1 | 10489 | #!/usr/bin/python
import sys
import sys
from sympy import Symbol,symbols,sin,cos,Rational,expand,simplify,collect
from printer import enhance_print,Get_Program,Print_Function,Format
from mv import MV,Com,Nga,ONE,ZERO
def basic_multivector_operations():
Print_Function()
(ex,ey,ez) = MV.setup('e*x|y|z')
A ... | bsd-3-clause |
edgewood/borg | src/borg/testsuite/shellpattern.py | 4 | 2698 | import re
import pytest
from .. import shellpattern
def check(path, pattern):
compiled = re.compile(shellpattern.translate(pattern))
return bool(compiled.match(path))
@pytest.mark.parametrize("path, patterns", [
# Literal string
("foo/bar", ["foo/bar"]),
("foo\\bar", ["foo\\bar"]),
# Non... | bsd-3-clause |
invisiblek/python-for-android | python3-alpha/python3-src/Lib/distutils/file_util.py | 54 | 7810 | """distutils.file_util
Utility functions for operating on single files.
"""
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = { None: 'copying',
'hard': 'hard linking',
'sym': 'symbo... | apache-2.0 |
bwrsandman/OpenUpgrade | addons/hr_contract/__openerp__.py | 260 | 1834 | # -*- 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 |
AI-comp/Orientation2015Problems | rime/plugins/pack_mjudge.py | 1 | 4824 | #!/usr/bin/python
#
# Copyright (c) 2011 Rime Project.
#
# 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, m... | mit |
laszlocsomor/tensorflow | tensorflow/python/kernel_tests/concatenate_dataset_op_test.py | 42 | 5552 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
nielsbuwen/ilastik | tests/test_applets/thresholdTwoLevels/testOpAnisotropicGaussianSmoothing.py | 4 | 3469 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 |
Javex/mixminion | etc/mmUtils.py | 6 | 2318 | # Implmentes the mixminion interface.
import os, sys
import re
# Give it a list of ommands and what should go in the std input
# it returns what appeared in the std output.
# PRIVATE: DO NOT CALL FROM OUTSIDE THIS MODULE!!!
def mm_command(cmd, in_str = None, show_stderr = 1):
# c = cmd
c = reduce(lambda x,y: ... | mit |
takeshineshiro/nova | nova/tests/unit/api/openstack/compute/test_plugins/dummy_schema.py | 94 | 1276 | # Copyright 2014 IBM
#
# 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 w... | apache-2.0 |
sduenas/perceval | tests/test_bugzillarest.py | 1 | 22077 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2017 Bitergia
#
# 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 l... | gpl-3.0 |
hubert667/AIR | build/PyYAML/lib3/yaml/cyaml.py | 274 | 3294 |
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader',
'CBaseDumper', 'CSafeDumper', 'CDumper']
from _yaml import CParser, CEmitter
from .constructor import *
from .serializer import *
from .representer import *
from .resolver import *
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __ini... | gpl-3.0 |
Zigazou/PyMinitel | minitel/ui/Conteneur.py | 1 | 8946 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Classe permettant de regrouper des éléments d’interface utilisateur"""
from .UI import UI
from ..Sequence import Sequence
from ..constantes import ENTREE, MAJ_ENTREE
class Conteneur(UI):
"""Classe permettant de regrouper des éléments d’interface utilisateur
Ce... | gpl-3.0 |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/processing/lib/forking.py | 1 | 12412 | #
# Module for starting a process object using os.fork() or CreateProcess()
#
# processing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
import os
import sys
import signal
import processing
__all__ = ['Popen', 'assertSpawning', 'exit']
#
# Check that the current thread is sp... | apache-2.0 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/tkinter/dnd.py | 151 | 11488 | """Drag-and-drop support for Tkinter.
This is very preliminary. I currently only support dnd *within* one
application, between different windows (or within the same window).
I an trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc. I also hope that
this wi... | apache-2.0 |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/reportlab/pdfbase/_fontdata_enc_symbol.py | 56 | 3187 | SymbolEncoding = (
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, 'space',
'exclam', 'universal', 'numbersign', 'ex... | gpl-3.0 |
jamiefolsom/edx-platform | lms/djangoapps/django_comment_client/permissions.py | 56 | 7646 | """
Module for checking permissions with the comment_client backend
"""
import logging
from types import NoneType
from request_cache.middleware import RequestCache
from lms.lib.comment_client import Thread
from opaque_keys.edx.keys import CourseKey
from django_comment_common.models import all_permissions_for_user_in... | agpl-3.0 |
Comunitea/OCB | addons/account_check_writing/account.py | 379 | 2032 | # -*- 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 |
rahushen/ansible | lib/ansible/modules/network/eos/eos_static_route.py | 26 | 7482 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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',
... | gpl-3.0 |
openstack/neutron | neutron/tests/functional/services/trunk/rpc/test_server.py | 2 | 1506 | # (c) Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... | apache-2.0 |
cecep-edu/edx-platform | openedx/core/djangolib/testing/utils.py | 17 | 4853 | """
Utility classes for testing django applications.
:py:class:`CacheIsolationMixin`
A mixin helping to write tests which are isolated from cached data.
:py:class:`CacheIsolationTestCase`
A TestCase baseclass that has per-test isolated caches.
"""
import copy
from django import db
from django.core.cache imp... | agpl-3.0 |
shlomif/patool | patoolib/programs/compress.py | 1 | 1159 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2012 Bastian Kleineidam
#
# 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.
#... | gpl-3.0 |
minhtuancn/odoo | addons/crm/__openerp__.py | 258 | 4199 | # -*- 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 |
tntC4stl3/scrapy | scrapy/commands/crawl.py | 109 | 2520 | import os
from scrapy.commands import ScrapyCommand
from scrapy.utils.conf import arglist_to_dict
from scrapy.exceptions import UsageError
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return "[options] <spider>"
def short_desc(self):
return "Run a spider"
... | bsd-3-clause |
Tarsbot/pika | tests/unit/callback_tests.py | 11 | 16337 | # -*- coding: utf8 -*-
"""
Tests for pika.callback
"""
import logging
try:
import mock
except ImportError:
from unittest import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
from pika import amqp_object
from pika import callback
from pika import frame
from pika import spe... | bsd-3-clause |
Branlala/docker-sickbeardfr | sickbeard/sickbeard/providers/btn.py | 35 | 12781 | # coding=utf-8
# Author: Dani�l Heimans
# URL: http://code.google.com/p/sickbeard
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Li... | mit |
arseneyr/essentia | test/src/unittest/stats/test_median.py | 1 | 1737 | #!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation ... | agpl-3.0 |
tndatacommons/tndata_backend | tndata_backend/goals/migrations/0007_auto_20150210_2233.py | 2 | 10684 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import goals.models
class Migration(migrations.Migration):
dependencies = [
('goals', '0006_auto_20150209_1746'),
]
operations = [
migrations.CreateModel(
name='BehaviorA... | mit |
hpe-storage/python-lefthandclient | test/HPELeftHandMockServer_ssh.py | 2 | 5278 | # (c) Copyright 2015 Hewlett Packard Enterprise Development LP
#
# 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 re... | apache-2.0 |
JuanCTorres/interview-prep-solutions | codelab/listcycle.py | 1 | 1048 | """
https://codelab.interviewbit.com/problems/listcycle/
"""
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A ... | mit |
iwaseyusuke/ryu | ryu/services/protocols/bgp/info_base/evpn.py | 10 | 1810 | # Copyright (C) 2016 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
dermoth/gramps | gramps/gui/widgets/reorderfam.py | 2 | 8092 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2001-2007 Donald N. Allingham
# Copyright (C) 2009-2010 Gary Burton
#
# 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 v... | gpl-2.0 |
mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/python/mxnet/libinfo.py | 2 | 3536 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
spencerlyon2/distcan | setup.py | 1 | 1060 | from distutils.core import setup
import os
long_desc = 'Add a fallback short description here'
if os.path.exists('README.txt'):
long_desc = open('README.txt').read()
# Write a versions.py file for class attribute
VERSION = "0.0.1"
def write_version_py(filename=None):
doc = ("\"\"\"\n" +
"This is ... | mit |
slightstone/SickRage | lib/sqlalchemy/ext/declarative/api.py | 78 | 17872 | # ext/declarative/api.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Public API functions and helpers for declarative."""
from ...schema import ... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/metastore/v1alpha/metastore-v1alpha-py/google/cloud/metastore_v1alpha/types/__init__.py | 2 | 2294 | # -*- 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 |
oliverhr/odoo | addons/hr/__init__.py | 382 | 1092 | # -*- 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 |
azureplus/hue | desktop/core/ext-py/Django-1.6.10/django/views/defaults.py | 105 | 3178 | import warnings
from django import http
from django.template import (Context, RequestContext,
loader, Template, TemplateDoesNotExist)
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore need @requ... | apache-2.0 |
hef/samba | buildtools/wafsamba/samba_abi.py | 24 | 8800 | # functions for handling ABI checking of libraries
import Options, Utils, os, Logs, samba_utils, sys, Task, fnmatch, re, Build
from TaskGen import feature, before, after
# these type maps cope with platform specific names for common types
# please add new type mappings into the list below
abi_type_maps = {
'_Bool... | gpl-3.0 |
atwoz/vimeko | update_plugins.py | 2 | 3193 | import zipfile
import shutil
import tempfile
import requests
from os import path
#--- Globals ----------------------------------------------
PLUGINS = """
ack.vim https://github.com/mileszs/ack.vim
ag.vim https://github.com/rking/ag.vim
bufexplorer https://github.com/corntrace/bufexplorer
ctrlp.vim https://github.co... | mit |
2014c2g6/c2g6 | w2/static/Brython2.0.0-20140209-164925/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | gpl-2.0 |
twitter/zktraffic | zktraffic/zab/quorum_packet.py | 1 | 12328 | # ==================================================================================================
# Copyright 2015 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
anuragamodi/profitpy | profit/models/ticker.py | 18 | 2372 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
from PyQt4.QtCore import Qt, QModelIndex, QVariant, QString
from profit.lib import valueAlign
from profit.models import BasicItem, BasicItemModel
## This model... | gpl-2.0 |
wylliam-silva/leiteilustrador | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | 12751 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
isyippee/nova | nova/keymgr/not_implemented_key_mgr.py | 112 | 1417 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
wmde/jenkins-job-builder | jenkins_jobs/modules/hipchat_notif.py | 12 | 4499 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/tests/python/predict/mxnet_predict_example.py | 54 | 2451 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
embeddedarm/android_external_chromium_org | chrome/common/extensions/docs/server2/sidenav_data_source_test.py | 23 | 4689 | #!/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.
import json
import unittest
from extensions_paths import JSON_TEMPLATES
from mock_file_system import MockFileSystem
from server_instan... | bsd-3-clause |
leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/intpyapp.py | 17 | 15409 | # intpyapp.py - Interactive Python application class
#
import win32con
import win32api
import win32ui
import __main__
import sys
import string
import app
import traceback
from pywin.mfc import window, afxres, dialog
import commctrl
import dbgcommands
lastLocateFileName = ".py" # used in the "File/Locate" dialog...
#... | bsd-3-clause |
heafod/SaltAdmin | view/main.py | 7 | 2274 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from config.setting import *
def make_html(s):
return web.websafe(s).replace('\r\n', '<br />')
web.template.Template.globals['make_html'] = make_html
# Get Seession ID and ShowName
def getLogin():
if web.config._session.get('isLogin') is False:
return False
... | gpl-2.0 |
biothings/biothings_explorer | biothings_explorer/api_call_dispatcher.py | 1 | 11261 | # -*- coding: utf-8 -*-
"""
Make API calls.
.. moduleauthor:: Jiwen Xin <kevinxin@scripps.edu>
"""
from collections import defaultdict
from copy import deepcopy
from itertools import groupby
from operator import itemgetter
from .registry import Registry
from .apicall import BioThingsCaller
from .api_output_parser im... | apache-2.0 |
halberom/ansible | lib/ansible/modules/cloud/amazon/ec2_ami.py | 25 | 21901 | #!/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 |
elmerdpadilla/iv | addons/purchase/company.py | 383 | 1576 | # -*- 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 |
intellimath/pyon | test/test_perfomance.py | 1 | 1913 | import pyon
import pickle
import time
import ast
import json
class C(object):
def __init__(self, count):
self.count = count
#
def __reduce__(self):
_dict = dict(self.__dict__)
count = _dict.pop('count')
return C, (count,), _dict
lst = []
for i in range(10000):
c ... | mit |
shuggiefisher/django-guardian | guardian/tests/mixins_test.py | 12 | 4973 | from django.contrib.auth.models import User, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase
from django.test.client ... | bsd-2-clause |
benpatterson/edx-platform | cms/djangoapps/contentstore/course_info_model.py | 112 | 6790 | """
Views for viewing, adding, updating and deleting course updates.
Current db representation:
{
"_id" : locationjson,
"definition" : {
"data" : "<ol>[<li><h2>date</h2>content</li>]</ol>"},
"items" : [{"id": ID, "date": DATE, "content": CONTENT}]
"metadata" : ignored
}
}
"""
impor... | agpl-3.0 |
armadill-odyssey/aima-python | submissions/VanderKallen/myBayes.py | 15 | 1344 | import traceback
from submissions.VanderKallen import slavery
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
slaveTot = DataFrame()
slaveAS = DataFrame
transactions = slavery.get_transaction()
slaveTot.data = []
slaveAS.data = []
def genderNumber(gender):
if gender ==... | mit |
BruceDLong/CodeDog | Scons/scons-local-4.1.0.post1/SCons/Tool/applelink.py | 4 | 7117 | """SCons.Tool.applelink
Tool-specific initialization for Apple's gnu-like linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby g... | gpl-2.0 |
LinusU/ansible | contrib/inventory/ec2.py | 20 | 54413 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | gpl-3.0 |
PGHS-CP1A-2015/python_koans_kjhansen | python3/koans/about_dice_project.py | 14 | 1958 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import random
class DiceSet:
def __init__(self):
self._values = None
@property
def values(self):
return self._values
def roll(self, n):
# Needs implementing!
# Tip: random.r... | mit |
zork9/pygame-pyMM | maproom1.py | 1 | 6299 |
# Copyright (c) 2013 Johan Ceuppens.
# All rights reserved.
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# dis... | gpl-2.0 |
gojira/tensorflow | tensorflow/contrib/data/python/kernel_tests/serialization/sequence_dataset_serialization_test.py | 14 | 4952 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
colour-science/colour-demosaicing | colour_demosaicing/bayer/tests/test_mosaicing.py | 1 | 1598 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour_demosaicing.bayer.mosaicing`
module.
"""
import numpy as np
import os
import unittest
from colour import read_image
from colour_demosaicing import TESTS_RESOURCES_DIRECTORY
from colour_demosaicing.bayer import mosaicing_CF... | bsd-3-clause |
MericGarcia/deployment-mean | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
dhoffman34/django | tests/commands_sql/tests.py | 6 | 3478 | from __future__ import unicode_literals
from django.apps import apps
from django.core.management.color import no_style
from django.core.management.sql import (sql_create, sql_delete, sql_indexes,
sql_destroy_indexes, sql_all)
from django.db import connections, DEFAULT_DB_ALIAS, router
from django.test import TestC... | bsd-3-clause |
Andreasdahlberg/sillycat | scripts/rfm69_check.py | 1 | 3685 | #!/usr/bin/env python3
# -*- coding: utf-8 -*
#
# 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 program is dist... | gpl-3.0 |
gem/oq-hazardlib | openquake/hazardlib/scalerel/gsc_offshore_thrusts.py | 1 | 6407 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2017 GEM Foundation
#
# OpenQuake 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 Licen... | agpl-3.0 |
uiri/pxqz | venv/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/prepared.py | 623 | 1032 | from ctypes import c_char
from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Prepared geometry constructor and destructors.
geos_prepare = GEOSFunc('GEOSPrepare')... | gpl-3.0 |
CMSS-BCRDB/RDS | trove/guestagent/datastore/experimental/postgresql/service/process.py | 4 | 3478 | # Copyright (c) 2013 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 ... | apache-2.0 |
QuantCrimAtLeeds/PredictCode | open_cp/gui/tk/session_view.py | 1 | 1550 | """
session_view
~~~~~~~~~~~~
"""
import tkinter as tk
import tkinter.ttk as ttk
import open_cp.gui.tk.util as util
_text = {
"none" : "No recent sessions found",
"cancel" : "Cancel",
}
class SessionView(ttk.Frame):
def __init__(self, parent, controller, model):
super().__init__(parent)
... | artistic-2.0 |
zultron/virt-manager | virtManager/network.py | 2 | 5678 | #
# Copyright (C) 2006, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# 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
# (... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.