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 |
|---|---|---|---|---|---|
Szpadel/sonata2 | sonata/main.py | 2 | 149315 |
__license__ = """
Sonata, an elegant GTK+ client for the Music Player Daemon
Copyright 2006-2008 Scott Horowitz <stonecrest@gmail.com>
This file is part of Sonata.
Sonata 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 Fou... | gpl-3.0 |
mhaessig/servo | tests/wpt/css-tests/tools/pytest/_pytest/tmpdir.py | 189 | 4123 | """ support for providing temporary directories to test functions. """
import re
import pytest
import py
from _pytest.monkeypatch import monkeypatch
class TempdirFactory:
"""Factory for temporary directories under the common base temp directory.
The base directory can be configured using the ``--basetemp``... | mpl-2.0 |
femmerling/DirMaker | box/lib/python2.7/site-packages/gunicorn/app/pasterapp.py | 7 | 4839 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import pkg_resources
import sys
try:
import configparser as ConfigParser
except ImportError:
import ConfigParser
from paste.deploy import loadapp, loadwsgi
SERVER = loadwsg... | mit |
AzCiS/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/autoresthttpinfrastructuretestservice/models/a.py | 8 | 1156 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Ultimaker/Uranium | tests/Settings/MockContainer.py | 1 | 3932 | from typing import Optional
from UM.Settings.Interfaces import ContainerInterface
import UM.PluginObject
from UM.Signal import Signal
## Fake container class to add to the container registry.
#
# This allows us to test the container registry without testing the container
# class. If something is wrong in the co... | lgpl-3.0 |
kkoksvik/FreeCAD | src/Mod/Fem/MechanicalMaterial.py | 7 | 2297 | # ***************************************************************************
# * *
# * Copyright (c) 2013 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... | lgpl-2.1 |
duncant/stupid_python_tricks | shadowstack.py | 1 | 2920 | # This file is part of stupid_python_tricks written by Duncan Townsend.
#
# stupid_python_tricks 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 Foundation, either version 3 of the License, or (at your
# option) an... | lgpl-3.0 |
HugoLnx/fofix | src/midi/MidiToText.py | 7 | 4151 | # -*- coding: ISO-8859-1 -*-
from MidiOutStream import MidiOutStream
class MidiToText(MidiOutStream):
"""
This class renders a midi file as text. It is mostly used for debugging
"""
#############################
# channel events
def channel_message(self, message_type, channel, data... | gpl-2.0 |
flotre/Sick-Beard | lib/hachoir_parser/misc/msoffice_summary.py | 90 | 12537 | """
Microsoft Document summaries structures.
Documents
---------
- Apache POI (HPSF Internals):
http://poi.apache.org/hpsf/internals.html
"""
from lib.hachoir_parser import HachoirParser
from lib.hachoir_core.field import (FieldSet, ParserError,
RootSeekableFieldSet, SeekableFieldSet,
Bit, Bits, NullBits,... | gpl-3.0 |
zmerlynn/kubernetes | build/json-extractor.py | 41 | 2100 | #!/usr/bin/env python
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
elssar/calibre | src/calibre/srv/errors.py | 10 | 1408 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import httplib
class JobQueueFull(Exception):
pass
class RouteError(Va... | gpl-3.0 |
ulope/django | tests/unmanaged_models/models.py | 67 | 3698 | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# All of these models are created in the database by Django.
@python_2_unicode... | bsd-3-clause |
PeterWangIntel/chromium-crosswalk | build/android/provision_devices.py | 2 | 12311 | #!/usr/bin/env python
#
# Copyright (c) 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.
"""Provisions Android devices with settings required for bots.
Usage:
./provision_devices.py [-d <device serial number>]
"""
... | bsd-3-clause |
spawnedc/MeCanBlog | django/contrib/gis/feeds.py | 327 | 5925 | from django.contrib.syndication.feeds import Feed as BaseFeed, FeedDoesNotExist
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C Geo elements.
"""
... | bsd-3-clause |
morreene/tradenews | venv/Lib/site-packages/werkzeug/contrib/atom.py | 104 | 15575 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.atom
~~~~~~~~~~~~~~~~~~~~~
This module provides a class called :class:`AtomFeed` which can be
used to generate feeds in the Atom syndication format (see :rfc:`4287`).
Example::
def atom_feed(request):
feed = AtomFeed("My Blog", feed... | bsd-3-clause |
nlholdem/icodoom | .venv/lib/python2.7/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder_fn.py | 19 | 10437 | # 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... | gpl-3.0 |
esikachev/scenario | sahara/tests/unit/plugins/vanilla/v1_2_1/test_plugin.py | 3 | 11886 | # Copyright (c) 2013 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 required by applicable law or agreed to in writ... | apache-2.0 |
klmitch/nova | nova/tests/unit/image/test_glance.py | 1 | 98337 | # Copyright 2011 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 requ... | apache-2.0 |
cjqian/incubator-airflow | airflow/migrations/versions/f2ca10b85618_add_dag_stats_table.py | 58 | 1334 | #
# 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 |
gianlucaborello/linux | scripts/gdb/linux/symbols.py | 467 | 6343 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
import os
import re
from linux import module... | gpl-2.0 |
jwir3/andross | andross/console.py | 1 | 1792 | import argparse
import pkg_resources
import sys
from tosser import Tosser
def createParser():
"""
Create an ArgumentParser object for use within the main method of this
program for command-line use of this script.
"""
version = pkg_resources.require('andross')[0].version
parser = argparse.Argum... | mpl-2.0 |
indictranstech/Das_Erpnext | erpnext/selling/page/sales_funnel/sales_funnel.py | 56 | 1473 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_funnel_data(from_date, to_date):
active_leads = frappe.db.sql("""select count(*) from `tabLead`
where (dat... | agpl-3.0 |
aagallag/nexmon | buildtools/gcc-arm-none-eabi-5_4-2016q2-osx/arm-none-eabi/share/gdb/system-gdbinit/elinos.py | 70 | 3080 | # Copyright (C) 2011-2015 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-3.0 |
EuropeanSocialInnovationDatabase/ESID-main | TextMining/Classifiers/Trainers/ANN_Trainer_Outputs.py | 1 | 26833 | import nltk
from os import listdir
from os.path import isfile, join,isdir
import csv
import re
import sklearn.metrics
from keras.callbacks import EarlyStopping
from keras import Input
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.na... | gpl-3.0 |
yhoshino11/pytest_example | .tox/flake8/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | mit |
Tiryoh/mbed | workspace_tools/size.py | 48 | 4171 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
ioanadiana/Greengraph | greengraph/map.py | 1 | 1523 | import numpy as np
from StringIO import StringIO
from matplotlib import image as img
import requests
class Map(object):
def __init__(self, lat, long, satellite=True, zoom=10, size=(400,400), sensor=False):
base="http://maps.googleapis.com/maps/api/staticmap?"
params=dict(
sensor= str... | gpl-2.0 |
magvugr/AT | EntVirtual/lib/python2.7/site-packages/pip/__init__.py | 145 | 9450 | #!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import Conf... | gpl-3.0 |
mlaurenzano/PEBIL | scripts/event_slices.py | 3 | 5788 | #!/usr/bin/env python
import getopt
import sys
import os
import struct
import string
# set to 0 for unlimited
sliceLimit = 0
debug = False
verbose = False
uint64 = 'Q'
uint32 = 'I'
uint16 = 'H'
uint8 = 'B'
int64 = 'q'
int32 = 'i'
int16 = 'h'
int8 = 'b'
data_sizes = {}
data_sizes[uint64] = 8
data_sizes[int64] = 8
da... | gpl-3.0 |
yetu/repotools | win_toolchain/get_toolchain_if_necessary.py | 4 | 9892 | #!/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.
"""Downloads and unpacks a toolchain for building on Windows. The contents are
matched by sha1 which will be updated when the toolchain... | bsd-3-clause |
jackrzhang/zulip | tools/documentation_crawler/documentation_crawler/spiders/check_help_documentation.py | 3 | 3112 | import os
from posixpath import basename
from urllib.parse import urlparse
from .common.spiders import BaseDocumentationSpider
from typing import Any, List, Set
def get_images_dir(images_path: str) -> str:
# Get index html file as start url and convert it to file uri
dir_path = os.path.dirname(os.path.real... | apache-2.0 |
maiklos-mirrors/jfx78 | modules/web/src/main/native/Tools/Scripts/webkitpy/tool/steps/update.py | 124 | 2342 | # 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... | gpl-2.0 |
elpaso/QGIS | python/plugins/processing/algs/grass7/ext/v_extrude.py | 45 | 1461 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_extrude.py
------------
Date : March 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*************************************... | gpl-2.0 |
xiangel/hue | desktop/core/ext-py/Django-1.6.10/tests/servers/test_basehttp.py | 45 | 2207 | import sys
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import TestCase
from django.utils.six import BytesIO, StringIO
class Stub(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
class WSGIRequestHandlerTestCase(TestCase):
def test_strips_undersco... | apache-2.0 |
coobas/pydons | doc/conf.py | 1 | 8546 | # -*- coding: utf-8 -*-
#
# pydons documentation build configuration file, created by
# sphinx-quickstart on Sat Aug 9 22:55:05 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | mit |
sjperkins/tensorflow | tensorflow/python/estimator/inputs/pandas_io.py | 86 | 4503 | # 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 |
ldotlopez/pypes | pypes/elements.py | 1 | 6448 | import pickle
from urllib.request import urlopen
from ldotcommons.utils import get_debugger
from .core import Element, Filter, Transformer, \
Empty, EOF
class Adder(Transformer):
def transform(self, x):
return x + self.kwargs.get('amount', 0)
class CustomTransformer(Transformer):
def __init__(... | gpl-2.0 |
stdevel/arsa | arsa.py | 1 | 9705 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# arsa.py - a script for archiving and removing old
# Spacewalk, Red Hat Satellite 5.x or SUSE Manager actions.
#
# 2016 By Christian Stankowic
# <info at stankowic hyphen development dot net>
# https://github.com/stdevel
#
from optparse import OptionParser, OptionGroup
i... | gpl-3.0 |
0359xiaodong/viewfinder | backend/base/secrets_tool.py | 13 | 4089 | #!/usr/bin/env python
#
# Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Command-line tool for creating and encrypting secrets using the
secrets_manager module.
% python -m viewfinder.backend.base.secrets_tool \
--secrets_mode={list_secrets, encrypt_secrets, get_secret,
put_secret, put... | apache-2.0 |
vitmod/enigma2-test | lib/python/Screens/About.py | 2 | 19638 | from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.Sources.StaticText import StaticText
from Components.Harddisk import Harddisk
from Components.NimManager import nimmanager
from Components.About import about
from Components.ScrollLabel import Scrol... | gpl-2.0 |
Lujeni/ansible | lib/ansible/modules/network/fortimanager/fmgr_ha.py | 38 | 13484 | #!/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 distribut... | gpl-3.0 |
pupapaik/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/vnc_client/route_table_res_handler.py | 7 | 7374 | # Copyright 2015. 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 l... | apache-2.0 |
anryko/ansible | lib/ansible/modules/net_tools/nios/nios_naptr_record.py | 68 | 5884 | #!/usr/bin/python
# Copyright (c) 2018 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',
'status': ['preview... | gpl-3.0 |
rkibria/yapyg | demo/main.py | 1 | 6331 | # Copyright (c) 2015 Raihan Kibria
#
# 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, distr... | mit |
krisys/django | tests/utils_tests/test_timezone.py | 149 | 7857 | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
requires_pytz = unittest.skipIf(pytz is None, "this test requires pytz")
if pytz is not None:
CET = pytz.timezone("Europe... | bsd-3-clause |
san-bil/proxTV | prox_tv/demos/demo_filter_image_threads.py | 2 | 1282 | ### Example script showing how to run proxTV solvers in multiple parallel threads
import prox_tv as ptv
import numpy as np
from pylab import *
import matplotlib.pyplot as plt
import time
import skimage as ski
from skimage import data, io, filters, color, util
# WRITE HERE YOUR NUMBER OF THREADS TO TEST
THREADS = [1, 2... | bsd-2-clause |
mwmuni/LIGGGHTS_GUI | OpenGL/raw/GL/ARB/program_interface_query.py | 9 | 4510 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
obonyojimmy/hospital | node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
JJRcop/tgstation | tools/midi2piano/pyperclip/__init__.py | 110 | 3343 | """
Pyperclip
A cross-platform clipboard module for Python. (only handles plain text for now)
By Al Sweigart al@inventwithpython.com
BSD License
Usage:
import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
spam = pyperclip.paste()
if not pyperclip.copy:
print("Copy functionality unav... | agpl-3.0 |
evilnet/x3 | src/plugins/hangman/plugin.py | 3 | 6602 | # anoy module
import _svc
import re
import fileinput
import random
# HANGMAN !!!!
# /---
# | o
# | /|\
# | / \
# =======
class Game:
target = '' #channel or user's nick who we are playing with
word = ''
maskchar = '*'
man = 0
dictionary = "/usr/share/dict/words"
def __init__(self, irc, targ... | gpl-3.0 |
pombredanne/tahoe-lafs | src/allmydata/scripts/create_node.py | 1 | 7744 |
import os, sys
from allmydata.scripts.common import BasedirOptions, NoDefaultBasedirOptions
from allmydata.scripts.default_nodedir import _default_nodedir
from allmydata.util.assertutil import precondition
from allmydata.util.encodingutil import listdir_unicode, argv_to_unicode, quote_local_unicode_path
from allmydat... | gpl-2.0 |
Metaswitch/calico-nova | nova/tests/unit/virt/xenapi/client/test_session.py | 11 | 6573 | # Copyright (c) 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
kenorb-contrib/BitTorrent | twisted/test/test_app.py | 16 | 4746 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.internet.app.
"""
from twisted.trial import unittest, util
from twisted.internet import app, protocol, error
from twisted.internet.defer import succeed, fail, SUCCESS, FAILURE
from twisted.python import log
i... | gpl-3.0 |
shimpe/frescobaldi | frescobaldi_app/logtool/__init__.py | 1 | 3833 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
xfournet/intellij-community | python/lib/Lib/site-packages/django/contrib/admin/widgets.py | 73 | 11754 | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | apache-2.0 |
maxisi/gwsumm | gwsumm/globalv.py | 1 | 1220 | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWSumm.
#
# GWSumm 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) ... | gpl-3.0 |
shootstar/novatest | nova/scheduler/filters/retry_filter.py | 4 | 1724 | # Copyright (c) 2012 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 |
mjpatter88/mjpython | test/int/test_integration.py | 1 | 7967 | from virtual_machine import VirtualMachine
class TestByteCodeObjectExecution():
def setup_method(self):
self.vm = VirtualMachine()
def test_returning_const(self):
def test_func():
return 10
assert self.vm.run_code(test_func.__code__) == 10
def test_returning_a_large_co... | mit |
4eek/edx-platform | cms/djangoapps/contentstore/views/certificates.py | 14 | 21676 | """
Certificates Data Model:
course.certificates: {
'certificates': [
{
'version': 1, // data contract version
'id': 12345, // autogenerated identifier
'name': 'Certificate 1',
'description': 'Certificate 1 Description',
'course_title': 'course ti... | agpl-3.0 |
FacundoAcevedo/squidban | squidcontrol.py | 1 | 4643 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import sys
import ConfigParser
import logging
import logging.config
from classes.daemon import Daemon
from classes.Comparador import Comparador
global RUTA_CONFIGURACION
# CONFIGURACION - CONFIGURACION - CONFIGURACION -
RUTA_CONFIGURACION = "/etc/squidban.c... | gpl-3.0 |
AustinWise/mongrel2 | examples/zcov/zcov/GCovGroup.py | 96 | 6378 | #!/usr/bin/python
from __future__ import division
from pprint import pprint
import cPickle
import os
import warnings
from zcov import GCovParser
class GCovGroup:
@staticmethod
def fromfile(path):
f = open(path)
try:
res = cPickle.load(f)
header,version = res[0],res[1... | bsd-3-clause |
Gitlab11/odoo | openerp/addons/base/res/res_users.py | 40 | 46628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
AutorestCI/azure-sdk-for-python | unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/module_asset_parameter.py | 5 | 1309 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
glatard/nipype | nipype/interfaces/camino/tests/test_auto_QBallMX.py | 9 | 1370 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.odf import QBallMX
def test_QBallMX_inputs():
input_map = dict(args=dict(argstr='%s',
),
basistype=dict(argstr='-basistype %s',
usedefault=True,
),
environ=dict(nohash=Tru... | bsd-3-clause |
JohnS-01/coala | tests/parsing/GlobbingTest.py | 29 | 12501 | """
Tests Globbing and related functions
Test Files are local and permanent and organized as follows:
GlobTestDir
├── SubDir1
│ ├── File11.py
│ └── File12.py
│ SubDir2
│ ├── File(with)parentheses.txt
│ └── File[with]brackets.txt
├── File1.x
├── File2.y
└── File3.z
"""
import os
import re
import unittest
from... | agpl-3.0 |
jstammers/EDMSuite | NavPython/IronPython/Lib/imghdr.py | 259 | 3544 | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
#-------------------------#
# Recognize image headers #
#-------------------------#
def what(file, h=None):
if h is None:
if isinstance(file, basestring):
f = open(file, 'rb')
h = f.read(32)
... | mit |
CapeDrew/DCMTK-ITK | Wrapping/WrapITK/Languages/Ruby/Tests/notYetUsable/itkCurvatureFlowTestPython2.py | 13 | 2703 | from InsightToolkit import *
import itktesting
import sys
import os
import shutil
basename = os.path.basename( sys.argv[0] )
name = os.path.splitext( basename )[0]
dir = "Algorithms"
testInput = itktesting.ITK_TEST_INPUT
testOutput = itktesting.ITK_TEST_OUTPUT
baseLine = itktesting.ITK_TEST_BASELINE
reader = ... | apache-2.0 |
rikai/podpublish | youtube_upload/auth/webkit_qt.py | 1 | 1947 | CHECK_AUTH_JS = """
var code = document.getElementById("code");
var access_denied = document.getElementById("access_denied");
var result;
if (code) {
result = {authorized: true, code: code.value};
} else if (access_denied) {
result = {authorized: false, message: access_denied.in... | lgpl-2.1 |
HybridF5/jacket | jacket/tests/compute/unit/compute/test_compute_api.py | 1 | 167887 | #
# 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
# ... | apache-2.0 |
dairin0d/cable-editor | object_cable_editor/dairin0d/utils_text.py | 5 | 4254 | # ***** BEGIN GPL LICENSE BLOCK *****
#
# 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 distri... | gpl-3.0 |
samirasnoun/django_cms_gallery_image | cms/south_migrations/0050_save_home.py | 17 | 16290 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
try:
page1 = orm['cms.Page'].objects.filter(parent__isnull=True)[... | bsd-3-clause |
xzturn/tensorflow | tensorflow/api_template.__init__.py | 2 | 5993 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
neharejanjeva/techstitution | venv/lib/python2.7/encodings/zlib_codec.py | 58 | 3048 | """ Python 'zlib_codec' Codec - zlib compression encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib modu... | cc0-1.0 |
yvaucher/stock-logistics-transport | stock_transport_multi_address/__openerp__.py | 1 | 1317 | # -*- coding: utf-8 -*-
#
#
# Author: Alexandre Fayolle
# 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
# published by the Free Software Foundation, either version 3 of the
# Licens... | agpl-3.0 |
ailove-dev/suds | suds/umx/basic.py | 210 | 1394 | # 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 ... | lgpl-3.0 |
nicholasbs/zulip | zerver/lib/context_managers.py | 120 | 1090 | """
Context managers, i.e. things you can use with the 'with' statement.
"""
from __future__ import absolute_import
import fcntl
import os
from contextlib import contextmanager
@contextmanager
def flock(lockfile, shared=False):
"""Lock a file object using flock(2) for the duration of a 'with' statement.
... | apache-2.0 |
simleo/openmicroscopy | components/tools/OmeroPy/src/omero/tables.py | 1 | 33778 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Tables Interface
# Copyright 2009 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import Ice
import time
import numpy
import logging
import threading
import traceback
from os import W_OK
from path import p... | gpl-2.0 |
personalrobotics/chimera | test/examples/30_pybind11_examples/02_advanced/02_classes/classes.py | 1 | 3784 | import unittest
import classes_pybind11 as py11
import classes_boost_python as boost
class TestClasses(unittest.TestCase):
def _test_override_virtual_functions(self, binding):
d = binding.test1.Dog()
self.assertEqual(binding.test1.call_go(d), "woof! woof! woof! ")
if binding is py11:
... | bsd-3-clause |
GarbojaxMcBruce/Machine_Learning | LEA Original Solution/Envirionment.py | 1 | 5902 |
class Environment:
name = ''
hunter = ''
hunter_position = [0,0]
creature = ''
creature_position = [0,0]
food_position = [0,0]
food_value = 100
size = 10
game_state = 1
def __init__(self, name, size, creature, hunter, random):
self.name = name
self.size = s... | gpl-3.0 |
mikemintz/neutron | modules/xmpp/debug.py | 207 | 14069 | ## debug.py
##
## Copyright (C) 2003 Jacob Lundqvist
##
## This program 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 Foundation; either version 2, or (at your option)
## any later version.
##
## ... | gpl-2.0 |
defionscode/ansible-modules-core | network/netvisor/pn_ospfarea.py | 30 | 6219 | #!/usr/bin/python
""" PN-CLI vrouter-ospf-add/remove """
#
# 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... | gpl-3.0 |
alikins/ansible | lib/ansible/modules/cloud/azure/azure_rm_subnet.py | 6 | 11313 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | gpl-3.0 |
apmichaud/vitess-apm | test/schema.py | 1 | 9883 | #!/usr/bin/python
import logging
import unittest
import environment
import utils
import tablet
shard_0_master = tablet.Tablet()
shard_0_replica1 = tablet.Tablet()
shard_0_replica2 = tablet.Tablet()
shard_0_rdonly = tablet.Tablet()
shard_0_backup = tablet.Tablet()
shard_1_master = tablet.Tablet()
shard_1_replica1 = t... | bsd-3-clause |
Ban3/Limnoria | plugins/Todo/test.py | 4 | 6607 | ###
# Copyright (c) 2003-2005, Daniel DiPaolo
# 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 cond... | bsd-3-clause |
keedio/sahara | sahara/tests/unit/service/validation/edp/test_job.py | 12 | 7048 | # Copyright (c) 2013 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 required by applicable law or agreed to in writ... | apache-2.0 |
gurneyalex/connector-magento | __unported__/magentoerpconnect/tests/__init__.py | 3 | 1327 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 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 |
saumishr/django | django/contrib/messages/storage/base.py | 399 | 6134 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... | bsd-3-clause |
Ervii/garage-time | garage/src/python/pants/backend/jvm/tasks/jvm_compile/analysis_tools.py | 2 | 3954 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import shu... | apache-2.0 |
whs/django | tests/m2m_through_regress/tests.py | 71 | 11667 | from io import StringIO
from django.contrib.auth.models import User
from django.core import management
from django.test import TestCase
from .models import (
Car, CarDriver, Driver, Group, Membership, Person, UserMembership,
)
class M2MThroughTestCase(TestCase):
@classmethod
def setUpTestData(cls):
... | bsd-3-clause |
christer155/Django-facebook | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/vcs/subversion.py | 25 | 10027 | import os
import re
from pip import call_subprocess
from pip.index import Link
from pip.util import rmtree, display_path
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('committed-rev="(\d+)"')
_svn_url_re = re.compile(r'URL: (.+... | bsd-3-clause |
reiinakano/scikit-plot | scikitplot/plotters.py | 1 | 44073 | """
This module contains a more flexible API for Scikit-plot users, exposing
simple functions to generate plots.
"""
from __future__ import absolute_import, division, print_function, \
unicode_literals
import warnings
import itertools
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics impor... | mit |
zasdfgbnm/tensorflow | tensorflow/python/ops/quantized_conv_ops_test.py | 27 | 7519 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
tedelhourani/ansible | lib/ansible/module_utils/infinibox.py | 135 | 3673 | # -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | gpl-3.0 |
xapi-project/ffs | volume/org.xen.xapi.storage.ffs/sr.py | 1 | 3289 | #!/usr/bin/env python
import json
import os
import os.path
import sys
import urlparse
import xapi.storage.api.volume
from xapi.storage import log
class Implementation(xapi.storage.api.volume.SR_skeleton):
def probe(self, dbg, uri):
raise AssertionError("not implemented")
def attach(self, dbg, uri):... | lgpl-2.1 |
skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/test/test_rebuild.py | 41 | 7774 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
import types
from twisted.trial import unittest
from twisted.python import rebuild
import crash_test_dummy
f = crash_test_dummy.foo
class Foo: pass
class Bar(Foo): pass
class Baz(object): pass
class Buz(Bar, Baz): pass
class Ha... | gpl-2.0 |
YGIronMan/python | zentst/0023/mysite/wsgi.py | 102 | 1419 | """
WSGI config for mysite project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | mit |
acsone/account-invoicing | account_invoice_shipping_address/sale.py | 34 | 1453 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
#
# This program... | agpl-3.0 |
jhawkesworth/ansible | lib/ansible/modules/network/fortios/fortios_log_memory_global_setting.py | 23 | 8183 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | gpl-3.0 |
karllessard/tensorflow | tensorflow/python/framework/kernels_test.py | 51 | 1543 | # Copyright 2018 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 |
kubernetes-incubator/kargo | library/kube.py | 2 | 8694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = """
---
module: kube
short_description: Manage Kubernetes Cluster
description:
- Create, replace, remove, and stop resources within a Kubernetes Cluster
version_added: "2.0"
options:
name:
required: false
default: null
description:
- The n... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.