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 |
|---|---|---|---|---|---|
as110/as110.github.io | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/__init__.py | 363 | 1827 | # -*- coding: utf-8 -*-
"""
pygments.formatters
~~~~~~~~~~~~~~~~~~~
Pygments formatters.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os.path
import fnmatch
from pygments.formatters._mapping import FORMATTERS
from pygments.p... | mit |
UOMx/edx-platform | openedx/core/djangoapps/credentials/tests/test_utils.py | 2 | 4932 | """Tests covering Credentials utilities."""
import unittest
from django.conf import settings
from django.core.cache import cache
from django.test import TestCase
from nose.plugins.attrib import attr
import httpretty
from edx_oauth2_provider.tests.factories import ClientFactory
from provider.constants import CONFIDENTI... | agpl-3.0 |
grap/account-financial-tools | __unported__/account_tax_update/__init__.py | 44 | 1084 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
# This module copyright (C) 2013 Camptocamp (<http://www.camptocamp.com>).
#
# This program is fr... | agpl-3.0 |
da1z/intellij-community | python/helpers/profiler/_prof_imports.py | 6 | 1151 | import os
import sys
IS_PY3K = False
try:
if sys.version_info[0] >= 3:
IS_PY3K = True
except AttributeError:
pass #Not all versions have sys.version_info
import thriftpy
profiler = thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "profiler.thrift"), module_name="profiler_thrif... | apache-2.0 |
mkelcb/knet | knet/com/io/knet_IO.py | 1 | 22995 | # -*- coding: utf-8 -*-
#MIT License
#Copyright (c) 2017 Marton Kelemen
#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, c... | mit |
aabbox/kbengine | kbe/src/lib/python/Lib/test/test_strtod.py | 84 | 20594 | # Tests for the correctly-rounded string -> float conversions
# introduced in Python 2.7 and 3.1.
import random
import unittest
import re
import sys
import test.support
if getattr(sys, 'float_repr_style', '') != 'short':
raise unittest.SkipTest('correctly-rounded string->float conversions '
... | lgpl-3.0 |
sanger-pathogens/iva | iva/assembly.py | 1 | 29056 | # Copyright (c) 2014-2016 Genome Research Ltd.
#
# This file is part of IVA.
#
# IVA 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 |
AOSP-YU/platform_external_skia | tools/skp/page_sets/skia_tigersvg_desktop.py | 33 | 1279 | # Copyright 2014 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
melon-li/openstack-dashboard | openstack_dashboard/dashboards/project/containers/tables.py | 5 | 16556 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
raccoongang/edx-platform | openedx/core/djangoapps/content/block_structure/tests/test_manager.py | 5 | 9624 | """
Tests for manager.py
"""
import ddt
from nose.plugins.attrib import attr
from unittest import TestCase
from ..block_structure import BlockStructureBlockData
from ..config import RAISE_ERROR_WHEN_NOT_FOUND, STORAGE_BACKING_FOR_CACHE, waffle
from ..exceptions import UsageKeyNotInBlockStructure, BlockStructureNotFoun... | agpl-3.0 |
VinnieJohns/ggrc-core | test/integration/ggrc_workflows/test_basic_workflow_actions.py | 6 | 9993 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from datetime import datetime
from freezegun import freeze_time
from ggrc import db
from ggrc_workflows.models import Cycle
from ggrc_workflows.models import CycleTaskGroupObjectTask
from ggrc_workflows.mod... | apache-2.0 |
ShyamSS-95/Bolt | bolt/lib/nonlinear/tests/performance/performance_solver_components.py | 1 | 1333 | import arrayfire as af
import numpy as np
import pylab as pl
from bolt.lib.physical_system import physical_system
from bolt.lib.nonlinear_solver.nonlinear_solver \
import nonlinear_solver
from bolt.lib.nonlinear_solver.tests.performance.input_files \
import domain
from bolt.lib.nonlinear_solver.tests.performa... | gpl-3.0 |
bygloam/yapf | yapftests/main_test.py | 3 | 3718 | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
theflofly/tensorflow | tensorflow/python/training/proximal_gradient_descent.py | 12 | 4434 | # 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 |
dufferzafar/mitmproxy | test/netlib/http/http1/test_read.py | 2 | 11189 | from __future__ import absolute_import, print_function, division
from io import BytesIO
from mock import Mock
import pytest
from netlib.exceptions import HttpException, HttpSyntaxException, HttpReadDisconnect, TcpDisconnect
from netlib.http import Headers
from netlib.http.http1.read import (
read_request, read_re... | mit |
Flumotion/flumotion | flumotion/test/bouncertest.py | 3 | 1796 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
sahitya-pavurala/luigi | luigi/contrib/esindex.py | 29 | 14121 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
kennethreitz/tablib | src/tablib/formats/_html.py | 1 | 1613 | """ Tablib - HTML export support.
"""
import codecs
from io import BytesIO
from MarkupPy import markup
class HTMLFormat:
BOOK_ENDINGS = 'h3'
title = 'html'
extensions = ('html', )
@classmethod
def export_set(cls, dataset):
"""HTML representation of a Dataset."""
stream = Bytes... | mit |
09zwcbupt/ryu | ryu/controller/mac_to_network.py | 53 | 1960 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
xiaowing/pgmail_crawler | PgmailCrawler.py | 1 | 16174 | '''
@author: xiaowing
@license: MIT License
'''
import io, sys, shutil, getopt, time, random, queue, urllib.parse, pdb, threading
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') # Change the default encode of stdout.
import requests
import psycopg2
from datetime import date, datet... | mit |
strk/mapnik | scons/scons-local-2.2.0/SCons/Tool/rpcgen.py | 14 | 2918 | """SCons.Tool.rpcgen
Tool-specific initialization for RPCGEN tools.
Three normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The... | lgpl-2.1 |
xebitstudios/nw.js | test/remoting/testcfg.py | 68 | 2628 | import test
import os
from os.path import join, dirname, exists, basename, isdir
import re
import utils
class RemotingTestCase(test.TestCase):
def __init__(self, path, file, arch, mode, nwdir, context, config, additional=[]):
super(RemotingTestCase, self).__init__(context, path, arch, mode, nwdir)
self.file... | mit |
DeadBugEngineering/myHDL_shenanigans | ssd1306_8x64bit_driver/myhdl_10dev/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 152 | 2854 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | lgpl-2.1 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/email/feedparser.py | 2 | 20356 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... | mit |
DazWorrall/ansible | lib/ansible/module_utils/facts/network/generic_bsd.py | 55 | 11823 | # 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 in the hope that ... | gpl-3.0 |
slyphon/pants | tests/python/pants_test/build_graph/test_build_file_parser.py | 5 | 12566 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | apache-2.0 |
shotgunsoftware/pyqt-uploader | uploader.py | 1 | 58592 | #!/usr/bin/env python
"""
A PyQt interface for uploading files to Shotgun.
Allows you to configure that app for a specific shotgun instance and directory structure.
Uploaded files need to be linked to an existing entity, but can have notes and tags applied.
Author: Rob Blau <rblau@laika.com>
"""
####################... | bsd-3-clause |
greggparrish/musicscout | musicscout/utils.py | 1 | 4665 | from bs4 import BeautifulSoup
import os
import re
import requests
from mutagen import File
from mutagen.id3 import ID3NoHeaderError
from mutagen.easyid3 import EasyID3
from .config import Config
cf = Config().conf_vars()
MEDIA_SITES = ['youtu', 'soundcloud']
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/... | unlicense |
grounduphq/stexchange | docs/conf.py | 1 | 7758 | # -*- coding: utf-8 -*-
#
# stexchange documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 17 11:46:20 2013.
#
# 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.
#
# ... | mit |
PongPi/isl-odoo | addons/portal_project/__openerp__.py | 380 | 1686 | # -*- 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 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/django/views/decorators/vary.py | 586 | 1200 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-langu... | mit |
dex4er/django | django/contrib/admin/templatetags/admin_modify.py | 106 | 2356 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and in... | bsd-3-clause |
wkfwkf/statsmodels | statsmodels/distributions/mixture_rvs.py | 27 | 9592 | from statsmodels.compat.python import range
import numpy as np
def _make_index(prob,size):
"""
Returns a boolean index for given probabilities.
Notes
---------
prob = [.75,.25] means that there is a 75% chance of the first column
being True and a 25% chance of the second column being True. The... | bsd-3-clause |
acdh-oeaw/totetiroler | places/views.py | 1 | 4026 | import requests
import json
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.shortcuts import render, redirect, get_object_or_404
from django.views import generic
from django.views.generic.edit import DeleteView
from django.core.urlresolvers impo... | mit |
urandu/rethinkdb | test/rql_test/connections/http_support/jinja2/testsuite/utils.py | 415 | 2235 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import unittest
import pickle
from jinja2.testsuite import JinjaTestCase
from jinja2.utils imp... | agpl-3.0 |
percyfal/bokeh | bokeh/models/axes.py | 2 | 5823 | ''' Guide renderers for various kinds of axes that can be added to
Bokeh plots
'''
from __future__ import absolute_import
from ..core.has_props import abstract
from ..core.properties import Auto, Datetime, Dict, Either, Enum, Float, Include, Instance, Int, Override, Seq, String, Tuple
from ..core.property_mixins impo... | bsd-3-clause |
ryancanhelpyou/servo | tests/wpt/web-platform-tests/webdriver/javascript/execute_script_test.py | 65 | 5664 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class ExecuteScriptTest(base_test.WebDriverBaseTest):
def test_ecmascript_translates_null_return_to_none(self):
self.driver.get(self.webserver.where_is("javascript/res/execute_script... | mpl-2.0 |
hansey/youtube-dl | test/test_write_annotations.py | 42 | 2546 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import get_params, try_rm
import io
import xml.etree.ElementTree
import youtu... | unlicense |
dmarteau/QGIS | python/PyQt/PyQt5/uic/__init__.py | 45 | 1461 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Jürgen E. Fischer
Email : jef at norbit dot de
***************************... | gpl-2.0 |
zang-cloud/zang-python | tests/inboundxml/test_dial.py | 2 | 2276 | import unittest
from zang.inboundxml.elements.dial import Dial
from zang.domain.enums.http_method import HttpMethod
from zang.inboundxml.elements.number import Number
class TestDial(unittest.TestCase):
def test_init_with_required_values(self):
expected = '<Dial></Dial>'
assert Dial().xml == expec... | mit |
lamdnhan/osf.io | website/addons/wiki/model.py | 6 | 4973 | # -*- coding: utf-8 -*-
import datetime
import functools
import logging
from bleach import linkify
from bleach.callbacks import nofollow
import markdown
from markdown.extensions import codehilite, fenced_code, wikilinks
from modularodm import fields
from framework.forms.utils import sanitize
from framework.guid.mod... | apache-2.0 |
lvasselt/cassandra-shawn | test/system/__init__.py | 2 | 9506 | # 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 |
pablocastro/elasticsearch | dev-tools/create_bwc_repo_with_ancient_indices.py | 92 | 2753 | import create_bwc_index
import logging
import os
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != 0:
raise R... | apache-2.0 |
yongni/grpc | src/python/grpcio_tests/tests/unit/_rpc_test.py | 16 | 35279 | # Copyright 2016 gRPC 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 applicable law or agreed to in writing... | apache-2.0 |
citrix-openstack-build/neutron | neutron/tests/base.py | 3 | 3108 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-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/l... | apache-2.0 |
radicalbit/ambari | ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/check_oozie_server_status.py | 8 | 1418 | """
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 use this ... | apache-2.0 |
uhlik/render_maxwell | support/material_preview_mxi.py | 2 | 3590 | #!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Jakub Uhlík
#
# 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 So... | gpl-2.0 |
fengshao0907/robomongo | src/third-party/mongodb/site_scons/site_tools/jsheader.py | 12 | 1331 | import os
from SCons.Builder import Builder
def jsToH(target, source, env):
outFile = str( target[0] )
h = ['#include "mongo/base/string_data.h"'
,'namespace mongo {'
,'struct JSFile{ const char* name; const StringData& source; };'
,'namespace JSFiles{'
]
def cppEscape... | gpl-3.0 |
GitHub-XK/numjuggler | numjuggler/parser.py | 1 | 26756 | """
Functions for parsing MCNP input files.
"""
import re
import warnings
# regular expressions
re_int = re.compile('\D{0,1}\d+') # integer with one prefix character
re_ind = re.compile('\[.+\]') # interior of square brackets for tally in lattices
re_rpt = re.compile('\d+[rRiI]') # repitition syntax of MCNP inpu... | gpl-3.0 |
LubyRuffy/theHarvester | discovery/shodan/api.py | 23 | 7549 | try:
from json import dumps, loads
except:
from simplejson import dumps, loads
from urllib2 import urlopen
from urllib import urlencode
__all__ = ['WebAPI']
class WebAPIError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return self.value
class WebAP... | gpl-2.0 |
hadyelsahar/RE-NLG-Dataset | run_example.py | 1 | 2574 | from pipeline.pipeline import *
from pipeline.entitylinker import *
from pipeline.triplealigner import *
from pipeline.datareader import DBpediaAbstractsDataReader
from pipeline.writer import *
from pipeline.coreference import *
from pipeline.placeholdertagger import *
from utils.triplereader import *
from utils.triple... | mit |
farhi-naz/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_results.py | 126 | 3187 | # 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 |
lyw07/kolibri | kolibri/core/logger/api.py | 2 | 10012 | import logging
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.query import F
from django.db.utils import IntegrityError
from django.http import Http404
from django_filters import ModelChoiceFilter
from django_filters.rest_framework import CharFilter
from django_filters.rest_framework impor... | mit |
mKeRix/home-assistant | homeassistant/components/upcloud/switch.py | 7 | 1281 | """Support for interacting with UpCloud servers."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import STATE_OFF
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import dispatcher_s... | mit |
talishte/ctigre | env/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')... | bsd-2-clause |
leonth/private-configs | sublime-text-3/Packages/Jedi - Python autocompletion/jedi/keywords.py | 4 | 2217 | from __future__ import with_statement
import pydoc
import keyword
from jedi._compatibility import is_py3k
from jedi.parser import representation as pr
from jedi import common
import builtin
try:
from pydoc_data import topics as pydoc_topics
except ImportError:
# Python 2.6
import pydoc_topics
if is_py3k... | mit |
gdelpierre/ansible-modules-core | network/nxos/nxos_bgp_neighbor_af.py | 19 | 39971 | #!/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 |
cainmatt/django | django/utils/datastructures.py | 394 | 9231 | import copy
from collections import OrderedDict
from django.utils import six
class OrderedSet(object):
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
self.dict = OrderedDict(((x, None) for x in iterable) ... | bsd-3-clause |
kavitshah8/SDNDeveloper | pox/misc/packet_dump.py | 46 | 2821 | # Copyright 2012 James McCauley
#
# 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 writi... | apache-2.0 |
amaniak/fabric | tests/test_project.py | 38 | 5250 | import unittest
import os
import fudge
from fudge.inspector import arg
from fabric.contrib import project
class UploadProjectTestCase(unittest.TestCase):
"""Test case for :func: `fabric.contrib.project.upload_project`."""
fake_tmp = "testtempfolder"
def setUp(self):
fudge.clear_expectations()... | bsd-2-clause |
thompsnm/ancprb | flightpath/printrun/printrun/projectlayer.py | 20 | 38361 | # This file is part of the Printrun suite.
#
# Printrun 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.
#
# Printrun is distributed in ... | gpl-3.0 |
MDPvis/rlpy | examples/uav/q-ifdd.py | 4 | 1932 | from rlpy.Domains import PST
from rlpy.Agents import Q_Learning
from rlpy.Representations import *
from rlpy.Policies import eGreedy
from rlpy.Experiments import Experiment
import numpy as np
from hyperopt import hp
param_space = { # 'discretization': hp.quniform("discretization", 5, 50, 1),
'discover_threshold':... | bsd-3-clause |
timothycrosley/thedom | thedom/code_documentation.py | 1 | 3121 | '''
CodeDocumentation.py
Contains elements that are used for displaying and documenting code
uses pygments to enable code highlighting
Copyright (C) 2015 Timothy Edmund Crosley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public L... | gpl-2.0 |
backmari/moose | python/peacock/tests/input_tab/InputFileEditor/test_InputFileEditor.py | 2 | 1907 | #!/usr/bin/env python
from peacock.Input.InputFileEditor import InputFileEditor
from peacock.Input.ExecutableInfo import ExecutableInfo
from peacock.utils import Testing
class Tests(Testing.PeacockTester):
def setUp(self):
super(Tests, self).setUp()
self.test_input_file = "../../common/fsp_test.i"
... | lgpl-2.1 |
abhattad4/Digi-Menu | digimenu2/tests/string_lookup/tests.py | 290 | 2573 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Bar, Base, Child, Foo, Whiz
class StringLookupTests(TestCase):
def test_string_form_referencing(self):
"""
Regression test for #1661 and #1662
Check that string... | bsd-3-clause |
gautam1858/tensorflow | tensorflow/python/training/server_lib_multiple_containers_test.py | 36 | 2495 | # 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 |
wbinventor/openmc | openmc/deplete/atom_number.py | 3 | 5889 | """AtomNumber module.
An ndarray to store atom densities with string, integer, or slice indexing.
"""
from collections import OrderedDict
import numpy as np
class AtomNumber(object):
"""Stores local material compositions (atoms of each nuclide).
Parameters
----------
local_mats : list of str
... | mit |
Nervanti/eettee | api/taggit/tests/tests.py | 1 | 24339 | from __future__ import absolute_import, unicode_literals
from unittest import TestCase as UnitTestCase
import django
from django.contrib.contenttypes.models import ContentType
from django.core import serializers
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.test import TestCase,... | mit |
pbarton666/buzz_bot | djangoproj/djangoapp/crawler/django_dbRoutines.py | 1 | 35782 | '''
This module contains database routines that may be accessed with or without using a web framework.
'''
###TODO: need to put the project and the app on the python path so these imports work (a copy of settings.py is in the current directory for now)
#I think all we realy need to do is make sure the settings modul... | mit |
hyOzd/cadquery | tests/TestWorkplanes.py | 4 | 5235 | """
Tests basic workplane functionality
"""
#core modules
#my modules
from cadquery import *
from tests import BaseTest,toTuple
xAxis_ = Vector(1, 0, 0)
yAxis_ = Vector(0, 1, 0)
zAxis_ = Vector(0, 0, 1)
xInvAxis_ = Vector(-1, 0, 0)
yInvAxis_ = Vector(0, -1, 0)
zInvAxis_ = Vector(0, 0, -1)
class TestWorkplanes(Ba... | lgpl-3.0 |
ktan2020/legacy-automation | win/Lib/site-packages/jpype/_refdaemon.py | 8 | 1084 | #*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | mit |
syed/instatnt-press | models/db.py | 7 | 8583 | # -*- coding: utf-8 -*-
#
# Instant Press. Instant sites. CMS developed in Web2py Framework
# Site: http://www.instant2press.com
#
# Copyright (c) 2010 Mulone, Pablo Martín
#
# License Code: GPL, General Public License v. 2.0
# License Content: Creative Commons Attribution 3.0
#
# Also visit: www.web2py.com
# ... | gpl-2.0 |
aveshagarwal/openshift-ansible | roles/lib_openshift/library/oc_route.py | 18 | 65753 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
helenst/django-extensions | django_extensions/management/commands/graph_models.py | 28 | 7350 | import sys
from optparse import NO_DEFAULT, make_option
import six
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.modelviz import generate_dot
from django_extensions.management.utils import signalcommand
try:
import pygraphviz
... | mit |
asgardproject/django-kudos | setup.py | 2 | 2100 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
from setuptools import setup, find_packages
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
def read(*path):
return open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)).read()
... | bsd-3-clause |
40223114/w16- | static/Brython3.1.1-20150328-091302/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | gpl-3.0 |
hectord/lettuce | tests/integration/lib/Django-1.3/django/conf/locale/nn/formats.py | 685 | 1657 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... | gpl-3.0 |
codeworkx/android_kernel_rockchip_rk30xx | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
hugobowne/scikit-learn | sklearn/ensemble/base.py | 40 | 3621 | """
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..utils import _get_n_jobs
class BaseEnsemble(BaseEstimator, MetaEstimatorMixin):
"""Base cl... | bsd-3-clause |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/paramiko/packet.py | 3 | 20247 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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.1 of the License, or (a... | gpl-3.0 |
rkawale/Internalhr-frappe | frappe/templates/website_group/settings.py | 3 | 3491 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.permissions import get_access, clear_permissions
from frappe.templates.generators.website_group import get_pathname
from frappe.utils.email_li... | mit |
dsjohns2/CS-241-Honors-Project | File_Encoder/yacctab.py | 34 | 130122 |
# yacctab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.8'
_lr_method = 'LALR'
_lr_signature = '5B6B33CB64AC0388290E0F1204699060'
_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,24,26,27,28,30,32,33,34,36,37,38,39,40,41,43,44,45,46,47,49,50,51,56,57,58,5... | mit |
NetApp/cinder | cinder/objects/group.py | 4 | 7851 | # Copyright 2016 EMC 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 applicable law or... | apache-2.0 |
dkroy/luigi | test/test_sigpipe.py | 95 | 2848 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
suranap/qiime | qiime/parallel/pick_otus.py | 15 | 25920 | #!/usr/bin/env python
# File created on 07 Jul 2012
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso", "Jens Reeder", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__... | gpl-2.0 |
chouseknecht/ansible | lib/ansible/plugins/doc_fragments/oneview.py | 43 | 2374 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# OneView doc fragment
DOCUMENTATION = r'''
options:
config:
description:
... | gpl-3.0 |
total-impact/total-impact-core | extras/db_housekeeping/migrate_user_docs.py | 2 | 5507 | import couchdb, os, logging, sys, collections
from pprint import pprint
import time
import requests
import copy
import random
import datetime
from werkzeug.security import generate_password_hash
from totalimpact import dao
import psycopg2
# run in heroku by a) commiting, b) pushing to heroku, and c) running
# heroku ... | mit |
aeron15/ruffus | ruffus/test/test_files_decorator.py | 5 | 4552 | #!/usr/bin/env python
from __future__ import print_function
"""
test_files_decorator.py
test @files which take single files forwards arguments as single files rather
than as lists
"""
import os
tempdir = os.path.relpath(os.path.abspath(os.path.splitext(__file__)[0])) + "/"
import sys
# add gran... | mit |
kajgan/e2 | lib/python/Plugins/Extensions/DVDBurn/TitleProperties.py | 48 | 6651 | from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Pixmap import Pixmap
from enigma import ePicLoad
from Components.config import config, getConfigListEntry, ConfigInteger
from Components.ConfigList import ConfigListScreen
fr... | gpl-2.0 |
abhattad4/Digi-Menu | django/contrib/auth/context_processors.py | 514 | 1938 | # PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, app_label):
self.user, self.app_label = user, app_label
def __repr__(self):
return str(self.user.get_all_permissions())
... | bsd-3-clause |
Kalashnikitty/ville-kernel | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
s40523137/2017springwcm_g5 | plugin/render_math/math.py | 30 | 14555 | # -*- coding: utf-8 -*-
"""
Math Render Plugin for Pelican
==============================
This plugin allows your site to render Math. It uses
the MathJax JavaScript engine.
For markdown, the plugin works by creating a Markdown
extension which is used during the markdown compilation
stage. Math therefore get... | agpl-3.0 |
vbannai/disk-qos-horizon | horizon/dashboards/syspanel/networks/ports/forms.py | 2 | 3858 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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
#... | apache-2.0 |
nttdata-osscloud/ceilometer | ceilometer/tests/alarm/evaluator/test_combination.py | 2 | 17579 | # -*- encoding: utf-8 -*-
#
# Copyright © 2013 eNovance <licensing@enovance.com>
#
# Authors: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
#
# 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
#
# ... | apache-2.0 |
quantifiedcode-bot/invenio-deposit | invenio_deposit/fields/pages_number.py | 7 | 1526 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your... | gpl-2.0 |
openmicroscopy/openmicroscopy | examples/Training/python/Advanced/Write_data_advanced.py | 3 | 1817 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 University of Dundee & Open Microscopy Environment.
# All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
"""
FOR TRAINING PURPOSES ONLY!
"""
from __future__ import print_function
import omero
from o... | gpl-2.0 |
flavoi/diventi | diventi/blog/models.py | 1 | 4236 | from functools import reduce
import operator
from django.db import models
from django.db.models import Q
from django.conf import settings
from django.utils import timezone
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from ckeditor.fields import RichTextField
from c... | apache-2.0 |
akuseru/zulip | zerver/models.py | 113 | 49724 | from __future__ import absolute_import
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, UserManager, \
PermissionsMixin
from django.dispatch import receiver
from zerver.lib.cache import cache_with_key, flush_user_profile, flush_realm, \
user... | apache-2.0 |
washort/zamboni | mkt/feed/fields.py | 6 | 5042 | from rest_framework import serializers
from mkt.fireplace.serializers import FeedFireplaceESAppSerializer
from mkt.webapps.serializers import (AppSerializer, ESAppFeedSerializer,
ESAppFeedCollectionSerializer,
ESAppSerializer)
class FeedCollec... | bsd-3-clause |
prasadvagdargi/med_image_analysis | Testing/Unit/sitkGetArrayViewFromImageTest.py | 2 | 6220 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.