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 |
|---|---|---|---|---|---|
albertjan/pypyjs | website/js/pypy.js-0.2.0/lib/modules/test/test_rlcompleter.py | 122 | 2848 | from test import test_support as support
import unittest
import __builtin__ as builtins
import rlcompleter
class CompleteMe(object):
""" Trivial class used in testing rlcompleter.Completer. """
spam = 1
class TestRlcompleter(unittest.TestCase):
def setUp(self):
self.stdcompleter = rlcompleter.Com... | mit |
grilo/ansible-1 | lib/ansible/modules/network/nxos/nxos_vlan.py | 21 | 11538 | #!/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 |
mattsmart/biomodels | oncogenesis_dynamics/firstpassage.py | 1 | 15435 | import matplotlib.pyplot as plt
import numpy as np
import time
from os import sep
from multiprocessing import Pool, cpu_count
from constants import OUTPUT_DIR, PARAMS_ID, PARAMS_ID_INV, COLOURS_DARK_BLUE
from data_io import read_varying_mean_sd_fpt_and_params, collect_fpt_mean_stats_and_params, read_fpt_and_params,\
... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_collections.py | 8 | 63844 | """Unit tests for collections.py."""
import unittest, doctest, operator
from test.support import TESTFN, forget, unlink
import inspect
from test import support
from collections import namedtuple, Counter, OrderedDict, _count_elements
from test import mapping_tests
import pickle, copy
from random import randrange, shuf... | gpl-2.0 |
zeroc0d3/docker-lab | nodejs/rootfs/usr/lib/python2.7/dist-packages/powerline/lib/watcher/uv.py | 34 | 4854 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
from collections import defaultdict
from threading import RLock
from functools import partial
from threading import Thread
from errno import ENOENT
from powerline.lib.path import realpath
from... | mit |
popazerty/e2_sh4 | lib/python/Components/ParentalControlList.py | 37 | 2159 | from MenuList import MenuList
from Components.ParentalControl import IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET
from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename
from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
from Tools.LoadPixmap import LoadPixmap
#Now... | gpl-2.0 |
its-lab/MoniTutor-Tunnel | start_resultwriter.py | 1 | 2246 | import argparse
import logging
import signal
import time
from server.icinga2_resultwriter import IcingaResultWriter as ResultWriter
import sys
import os
from utils import daemonize
from utils import configure_logging
from utils import get_logger
parser = argparse.ArgumentParser(description="MoniTunnel server")
parser.... | gpl-3.0 |
jamesblunt/edx-platform | lms/djangoapps/edxnotes/views.py | 72 | 3809 | """
Views related to EdxNotes.
"""
import json
import logging
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseBadRequest, Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from edxmako.shortcuts import render_to_response
fro... | agpl-3.0 |
edcast-inc/edx-platform-edcast | lms/djangoapps/course_wiki/utils.py | 204 | 3623 | """
Utility functions for course_wiki.
"""
from django.core.exceptions import ObjectDoesNotExist
from xmodule import modulestore
import courseware
def user_is_article_course_staff(user, article):
"""
The root of a course wiki is /<course_number>. This means in case there
are two courses which have the sa... | agpl-3.0 |
neilalbrock/xhtml2pdf | ez_setup.py | 61 | 9429 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | apache-2.0 |
endlessm/chromium-browser | tools/cr/cr/targets/target.py | 10 | 4752 | # 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.
"""Module to hold the Target plugin."""
from __future__ import print_function
import operator
import re
import cr
import cr.base.context
DEFAULT = cr.Conf... | bsd-3-clause |
RobinQuetin/CAIRIS-web | cairis/cairis/RiskScatterDialog.py | 1 | 1238 | # 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... | apache-2.0 |
YongseopKim/crosswalk-test-suite | webapi/tct-testconfig/inst.xpk.py | 357 | 6759 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
JeyZeta/Dangerous | Dangerous/Golismero/thirdparty_libs/nltk/sem/boxer.py | 12 | 46491 | # Natural Language Toolkit: Interface to Boxer
# <http://svn.ask.it.usyd.edu.au/trac/candc/wiki/boxer>
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2012 NLTK Project
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
An interface to Boxer.
Usage:
Set the environme... | mit |
chemelnucfin/tensorflow | tensorflow/python/keras/preprocessing/image_test.py | 9 | 13832 | # 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 |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/_base.py | 915 | 13711 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... | mit |
datacommonsorg/website | server/routes/api/browser.py | 1 | 6125 | # 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 agreed to in writing, ... | apache-2.0 |
jimi-c/ansible | test/units/modules/network/nxos/test_nxos_config.py | 11 | 8373 | # (c) 2016 Red Hat 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 later version.
#
# Ansible is dis... | gpl-3.0 |
provaleks/o8 | openerp/addons/base/module/wizard/__init__.py | 365 | 1250 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
stevehof/location-ninja | lib/flask_admin/tools.py | 7 | 2422 | import sys
import traceback
# Python 3 compatibility
from ._compat import reduce
def import_module(name, required=True):
"""
Import module by name
:param name:
Module name
:param required:
If set to `True` and module was not found - will throw exception.
... | gpl-3.0 |
sayplastic/numword | numword/numword_es.py | 2 | 5123 | # coding: utf-8
#This file is part of numword. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'''
numword for ES
'''
from numword_eu import NumWordEU
#TODO correct orthographics
#TODO error messages
class NumWordES(NumWordEU):
'''
NumWord ES
... | lgpl-2.1 |
offbye/paparazzi | sw/airborne/test/stabilization/setup.py | 83 | 2143 | from distutils.core import setup, Extension
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
from os import path, getenv
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
pprz_src = getenv("PAPARAZZI_SRC", path.normpath(path.joi... | gpl-2.0 |
simgunz/anki | pylib/anki/importing/anki2.py | 1 | 17394 | # Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import os
import unicodedata
from typing import Any, Dict, List, Optional, Tuple
from anki.collection import Collection
from anki.consts import *
from anki.decks import DeckManager
from anki.... | agpl-3.0 |
AlbertoPeon/invenio | modules/websubmit/lib/functions/Report_Number_Generation.py | 25 | 10904 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at... | gpl-2.0 |
xuegang/gpdb | gpMgmt/bin/gppylib/test/unit/test_unit_leaked_schema_dropper.py | 39 | 2184 | from mock import *
from gp_unittest import *
from gpcheckcat_modules.leaked_schema_dropper import LeakedSchemaDropper
class LeakedSchemaDropperTestCase(GpTestCase):
def setUp(self):
self.db_connection = Mock(spec=['query'])
two_leaked_schemas = Mock()
two_leaked_schemas.getresult.return_... | apache-2.0 |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/django/db/models/fields/related.py | 47 | 72699 | from operator import attrgetter
from django.db import connection, connections, router
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from dja... | apache-2.0 |
theworldbright/mainsite | aspc/events/models.py | 2 | 7699 | from django.db import models
from aspc.events.backends.facebook import FacebookBackend
from aspc.events.backends.collegiatelink import CollegiateLinkBackend
from django.template.defaultfilters import truncatewords
from django.core.exceptions import ObjectDoesNotExist
from datetime import datetime, timedelta
import time... | mit |
Sing-Li/go-buildpack | builds/runtimes/python-2.7.6/lib/python2.7/test/test_generators.py | 72 | 50768 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback (most recent call la... | mit |
kurli/blink-crosswalk | Tools/Scripts/webkitpy/layout_tests/port/mac.py | 1 | 4978 | # 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 the ... | bsd-3-clause |
richardcs/ansible | lib/ansible/modules/windows/win_iis_webbinding.py | 7 | 3866 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com>
# Copyright: (c) 2017, Henrik Wallström <henrik@wallstroms.nu>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
OnroerendErfgoed/atramhasis | atramhasis/scripts/initializedb.py | 1 | 3979 | import os
import sys
from pyramid.paster import get_appsettings
from pyramid.paster import setup_logging
from pyramid.scripts.common import parse_vars
from skosprovider_sqlalchemy.models import ConceptScheme
from skosprovider_sqlalchemy.models import Label
from skosprovider_sqlalchemy.utils import import_provider
from... | gpl-3.0 |
Quikling/gpdb | gpMgmt/bin/gprestore_filter.py | 4 | 20742 | #!/usr/bin/env python
from gppylib.gpparseopts import OptParser, OptChecker
from gppylib.operations.backup_utils import split_fqn, checkAndRemoveEnclosingDoubleQuote, removeEscapingDoubleQuoteInSQLString,\
escapeDoubleQuoteInSQLString
import re
import os
import sys
search_p... | apache-2.0 |
sid88in/incubator-airflow | airflow/contrib/operators/vertica_to_hive.py | 17 | 5346 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
lduarte1991/edx-platform | lms/djangoapps/shoppingcart/utils.py | 24 | 2849 | """
Utility methods for the Shopping Cart app
"""
from django.conf import settings
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LAParams, LTFigure, LTTextBox, LTTextLine
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager
fr... | agpl-3.0 |
ujdhesa/unisubs | apps/profiles/migrations/0005_auto__del_language.py | 6 | 4421 | # 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):
# Deleting model 'Language'
db.delete_table('profiles_language')
def backwards(self, orm... | agpl-3.0 |
conejoninja/xbmc-seriesly | servers/ovfile.py | 1 | 3968 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# seriesly - XBMC Plugin
# Conector para ovfile
# http://blog.tvalacarta.info/plugin-xbmc/seriesly/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import scra... | gpl-3.0 |
ATIX-AG/ansible | lib/ansible/modules/network/cloudengine/ce_netstream_aging.py | 43 | 18023 | #!/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 |
indirectlylit/kolibri | kolibri/core/discovery/test/test_api.py | 2 | 4426 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import mock
import requests
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from .. import models
from ..utils.network import ... | mit |
shanemcd/ansible | lib/ansible/modules/packaging/os/pacman.py | 14 | 14647 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __futur... | gpl-3.0 |
asimshankar/tensorflow | tensorflow/python/ops/resource_variable_ops.py | 2 | 60767 | # 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 |
tsotetsi/textily-web | temba/schedules/migrations/0003_reset_1.py | 4 | 2581 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-06 22:38
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | agpl-3.0 |
HiroIshikawa/21playground | learning/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py | 2994 | 1681 | ######################## 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... | mit |
AnishShah/tensorflow | tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper_test.py | 25 | 5440 | # 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 |
setsulla/owanimo | script/battle_20BP.py | 1 | 1260 | import os
import sys
import time
from owanimo.app.error import ERROR as e
from owanimo.script import allegory_normal
from owanimo.util import define
from owanimo.util.log import LOG as L
class Allegory(allegory_normal.Allegory):
def __init__(self, runner, profile, player):
allegory_normal.Allegory.__init_... | mit |
dbbhattacharya/kitsune | vendor/packages/sqlalchemy/test/aaa_profiling/test_zoomark_orm.py | 6 | 13694 | """Benchmark for SQLAlchemy.
An adaptation of Robert Brewers' ZooMark speed tests. """
import datetime
import sys
import time
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.test import *
ITERATIONS = 1
dbapi_session = engines.ReplayableSession()
metadata = None
class ZooMarkTest(TestBase):
... | bsd-3-clause |
iguzu/gae-django | django/contrib/auth/models.py | 6 | 14736 | import datetime
import urllib
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.manager import EmptyManager
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import smart_str
from django.utils.h... | bsd-3-clause |
nesl/mercury | Services/Elevation/ElevationService.py | 1 | 9994 |
# --- IMPORTS ---
import simplejson
import numpy as np
import os
import sys
import traceback
import time
try:
import urllib.parse as urllibParse
except ImportError:
import urllib as urllibParse
try:
import urllib.request as urllibRequest
except ImportError:
import urllib as urllibRequest
# Before using th... | gpl-2.0 |
rjschwei/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/models/virtual_machine_scale_set_vm.py | 1 | 5933 | # 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 |
millanp/django-paypal | paypal/standard/ipn/views.py | 12 | 3222 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.http import HttpResponse, QueryDict
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from paypal.standard.ipn.forms import PayPalIPNForm
from paypa... | mit |
pomegranited/edx-platform | lms/djangoapps/mobile_api/video_outlines/serializers.py | 97 | 8891 | """
Serializer for video outline
"""
from rest_framework.reverse import reverse
from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN
from xmodule.modulestore.django import modulestore
from courseware.access import has_access
from courseware.courses import get_course_by_id
from courseware.model_data imp... | agpl-3.0 |
righthandabacus/shadowsocks-2.8.2 | shadowsocks/common.py | 945 | 8921 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
toshywoshy/ansible | lib/ansible/modules/network/fortimanager/fmgr_secprof_profile_group.py | 39 | 8605 | #!/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 |
ahmadio/edx-platform | common/lib/symmath/symmath/formula.py | 66 | 25851 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Flexible python representation of a symbolic mathematical formula.
Acceptes Presentation MathML, Content MathML (and could also do OpenMath).
Provides sympy representation.
"""
#
# File: formula.py
# Date: 04-May-12 (creation)
# Author: I. Chuang <ichuang@mit.edu>
#
im... | agpl-3.0 |
KurtDeGreeff/infernal-twin | build/pip/pip/_vendor/colorama/winterm.py | 442 | 5732 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... | gpl-3.0 |
ppries/tensorflow | tensorflow/python/framework/op_def_library_test.py | 21 | 65553 | # 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 |
frankyrumple/ope | laptop_credential/gluon/packages/dal/pydal/adapters/informix.py | 11 | 5178 | # -*- coding: utf-8 -*-
import datetime
import re
from .._globals import IDENTITY
from .base import BaseAdapter
class InformixAdapter(BaseAdapter):
drivers = ('informixdb',)
types = {
'boolean': 'CHAR(1)',
'string': 'VARCHAR(%(length)s)',
'text': 'BLOB SUB_TYPE 1',
'json': 'B... | mit |
dimdung/boto | tests/compat.py | 115 | 1560 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
gptech/ansible | lib/ansible/module_utils/cloud.py | 119 | 3974 | #
# (c) 2016 Allen Sanabria, <asanabria@linuxdynasty.org>
#
# 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 |
topix-hackademy/contact-tools | contacts/urls.py | 1 | 1408 | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from . import views_company, view_contact, view_role, view_company_type
urlpatterns = [
url(r'^company-type/$', view_company_type.all_company_types),
url(r'^company-type/(?P<id>[0-9]+)/$', view_company_type.single_c... | mit |
nansencenter/DAPPER | dapper/mods/Lorenz63/sakov2012.py | 1 | 1726 | """Reproduce results from Table 1 `bib.sakov2012iterative`."""
import numpy as np
import dapper.mods as modelling
from dapper.mods.Lorenz63 import LPs, Tplot, dstep_dx, step, x0
t = modelling.Chronology(0.01, dkObs=25, KObs=1000, Tplot=Tplot, BurnIn=4*Tplot)
Nx = len(x0)
Dyn = {
'M': Nx,
'model': step,
... | mit |
OpenNFT/OpenNFT | opennft/config.py | 1 | 3927 | # -*- coding: utf-8 -*-
"""
__________________________________________________________________________
Copyright (C) 2016-2021 OpenNFT.org
"""
import os
import pyqtgraph as pg
LOG_LEVEL = 'DEBUG'
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
UI_PATH = os.path.join(ROOT_PATH, 'ui')
PLUGIN_PATH = os.path.... | gpl-3.0 |
buddyli/private2w | controller/type_oper.py | 2 | 1592 | #!/usr/bin/env python
#-*- encoding:utf-8 -*-
from bottle import route, mako_template as template, redirect, request, response, get, post
from bottle import static_file, view #为了不经过controller直接返回诸如html,css等静态文件引入
from model.documents import *
from setting import *
DATE_FORMAT = '%Y-%m-%d %H:%M:%S' # 入库格式化时间
@get('/t... | apache-2.0 |
jeffalexandro/mx-app | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | apache-2.0 |
marcli/sos | sos/plugins/kernelrt.py | 14 | 1587 | # -*- python -*-
# -*- coding: utf-8 -*-
#
# Copyright 2012 Red Hat Inc.
# Guy Streeter <streeter@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; version 2.
#
# This appli... | gpl-2.0 |
wido/cloudstack | test/integration/component/test_snapshots.py | 7 | 46019 | # 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 |
jlegendary/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_mock.py | 496 | 5168 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
ovaistariq/xb-mgr | lib/buffered_email_handler.py | 2 | 2221 | # (c) 2012, Ovais Tariq <ovaistariq@gmail.com>
#
# This file is part of Xtrabackup Backup Manager
#
# 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... | gpl-3.0 |
streamlink/streamlink | tests/plugins/test_artetv.py | 3 | 1508 | from streamlink.plugins.artetv import ArteTV
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlArteTV(PluginCanHandleUrl):
__plugin__ = ArteTV
should_match = [
# new url
"http://www.arte.tv/fr/direct/",
"http://www.arte.tv/de/live/",
"http://www.arte.tv/... | bsd-2-clause |
reinaH/osf.io | website/addons/base/exceptions.py | 23 | 1683 | """
Custom exceptions for add-ons.
"""
class AddonError(Exception):
pass
class HookError(AddonError):
pass
class AddonEnrichmentError(AddonError):
@property
def can_delete(self):
return False
@property
def can_download(self):
return False
@property
def renderable... | apache-2.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_0_0/device_service_flow_broker.py | 14 | 58685 | from ..broker import Broker
class DeviceServiceFlowBroker(Broker):
controller = "device_service_flows"
def show(self, **kwargs):
"""Shows the details for the specified device service flow.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
... | apache-2.0 |
yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py | 5 | 2082 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
Simran-B/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_urlparse.py | 55 | 16540 | #! /usr/bin/env python
from test import test_support
import unittest
import urlparse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
RFC3986_BASE = "http://a/b/c/d;p?q"
# A list of test cases. Each test case is a a two-tuple that contains
# a string with the query and a dictionary with the... | apache-2.0 |
soylentdeen/Graffity | src/Vibrations/VibrationExplorer.py | 1 | 5531 | import sys
sys.path.append('../')
import numpy
import Graffity
import CIAO_DatabaseTools
import astropy.time as aptime
from matplotlib import pyplot
import colorsys
def getFreqs():
while True:
retval = []
enteredText = raw_input("Enter a comma separated list of frequencies: ")
try:
... | mit |
fdvarela/odoo8 | addons/account_anglo_saxon/__openerp__.py | 67 | 2462 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
tornadozou/tensorflow | tensorflow/python/training/session_manager_test.py | 41 | 31753 | # 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 |
popazerty/enigma2-4.3 | lib/python/Screens/LanguageSelection.py | 6 | 5658 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap
from Components.Language import language
from Components.config import config
from Components.Sources.List import List
from Components.Label import Label
from Components.Sources.StaticText import Stati... | gpl-2.0 |
opentracing/opentracing-python | opentracing/mocktracer/propagator.py | 3 | 1271 | # Copyright (c) The OpenTracing Authors.
#
# 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,... | apache-2.0 |
rajul/tvb-framework | tvb/interfaces/__init__.py | 2 | 1546 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | gpl-2.0 |
rbreitenmoser/snapcraft | snapcraft/plugins/catkin.py | 1 | 19520 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright © 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hop... | gpl-3.0 |
kgblll/libresoft-gymkhana | social/layers/InternalLayer.py | 2 | 7302 | #!/usr/bin/env python
# Copyright (C) 2009-2010 GSyC/LibreSoft, Universidad Rey Juan Carlos
#
# 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... | gpl-2.0 |
BayanGroup/sentry | tests/sentry/api/endpoints/test_team_details.py | 1 | 3125 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from mock import patch
from sentry.models import (
OrganizationMemberType, Team, TeamStatus
)
from sentry.testutils import APITestCase
class TeamDetailsTest(APITestCase):
def test_simple(self):
team = self.team # fo... | bsd-3-clause |
nwchandler/ansible | lib/ansible/modules/storage/zfs/zpool_facts.py | 69 | 6653 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@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 L... | gpl-3.0 |
ntt-sic/heat | heat/tests/test_clients.py | 1 | 2473 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 |
irfancharania/plugin.video.paktvforum | resources/lib/sites/desironak.py | 1 | 4266 | from resources.lib.abc_base import BaseForum
from BeautifulSoup import BeautifulSoup
import resources.lib.util as util
import HTMLParser
import resources.lib.structure as s
import resources.lib.hosts as hosts
class DesiRonakApi(BaseForum):
short_name = 'desironak'
long_name = 'Desi Ronak Forum'
local_thum... | mit |
uni2u/neutron | neutron/plugins/embrane/common/constants.py | 12 | 2733 | # Copyright 2013 Embrane, 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... | apache-2.0 |
liosha2007/temporary-groupdocs-python-sdk | examples/api-samples/inc_samples/sample11.py | 1 | 5359 | ### This sample will show how programmatically create and post an annotation into document. How to delete the annotation
# Import of classes from libraries
from pyramid.renderers import render_to_response
from groupdocs.ApiClient import ApiClient
from groupdocs.AntApi import AntApi
from groupdocs.GroupDocsRequestSign... | apache-2.0 |
newrocknj/horizon | openstack_dashboard/dashboards/project/data_processing/jobs/workflows/create.py | 13 | 6682 | # 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 Li... | apache-2.0 |
underyx/ansible | v2/ansible/module_utils/rax.py | 32 | 10155 | # 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
# license to the complete wo... | gpl-3.0 |
Krozark/Kraggne | Kraggne/forms.py | 1 | 4491 | from django import forms
from django.forms import ValidationError
from django.core.validators import URLValidator
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
import re
from Kraggne.utils import MakePattern, clean_url
from Kraggne.models import MenuItem, F... | bsd-2-clause |
D4wN/brickv | src/brickv/plugin_system/plugins/red/program_page_files.py | 1 | 6157 | # -*- coding: utf-8 -*-
"""
RED Plugin
Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com>
program_page_files.py: Program Wizard Files Page
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 Foundati... | gpl-2.0 |
googleapis/python-aiplatform | scripts/readme-gen/readme_gen.py | 122 | 1722 | #!/usr/bin/env python
# Copyright 2016 Google 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... | apache-2.0 |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/lib2to3/pgen2/grammar.py | 119 | 5373 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | gpl-3.0 |
chenjun0210/tensorflow | tensorflow/python/kernel_tests/stack_ops_test.py | 64 | 5580 | # 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 |
ltilve/ChromiumGStreamerBackend | build/android/pylib/base/base_test_result_unittest.py | 134 | 2817 | # 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.
"""Unittests for TestRunResults."""
import unittest
from pylib.base.base_test_result import BaseTestResult
from pylib.base.base_test_result import Test... | bsd-3-clause |
dsajkl/123 | common/test/acceptance/tests/studio/test_studio_acid_xblock.py | 25 | 6923 | """
Acceptance tests for Studio related to the acid xblock.
"""
from unittest import skip
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.xblock.acid import AcidView
from ...fixtures.course import Cours... | agpl-3.0 |
evidation-health/bokeh | examples/plotting/file/tap.py | 43 | 1258 | from __future__ import division
import itertools
import numpy as np
from six.moves import zip
from bokeh.plotting import ColumnDataSource, figure, show, output_file
from bokeh.models import TapTool
xx, yy = np.meshgrid(range(0,101,4), range(0,101,4))
x = xx.flatten()
y = yy.flatten()
N = len(x)
inds = [str(i) for i ... | bsd-3-clause |
agx/git-buildpackage | gbp/rpm/policy.py | 1 | 8077 | # vim: set fileencoding=utf-8 :
#
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.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 |
gkonstantyno/construct | tests/test_lib.py | 1 | 1840 | import unittest
from construct.lib.binary import int_to_bin, bin_to_int, swap_bytes, encode_bin, decode_bin
from construct.lib.expr import Path
class TestBinary(unittest.TestCase):
def test_int_to_bin(self):
self.assertEqual(int_to_bin(19, 5), b"\x01\x00\x00\x01\x01")
self.assertEqual(int_to_bin(... | mit |
bootchk/pensool | source/gui/manager/drop.py | 1 | 3475 | '''
Coordinates drag and drop, which crosses controls.
!!! Note that all event coords are in the device coord system.
TODO not a class, just a singleton module
'''
'''
Copyright 2010, 2011 Lloyd Konneker
This file is part of Pensool.
Pensool is free software: you can redistribute it and/or modify
it under the terms... | gpl-3.0 |
jeremiahyan/odoo | odoo/addons/base/models/res_partner.py | 1 | 50395 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import collections
import datetime
import hashlib
import pytz
import threading
import re
import requests
from lxml import etree
from random import randint
from werkzeug import urls
from odoo import api, f... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.