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 |
|---|---|---|---|---|---|
uni-peter-zheng/tp-libvirt | libvirt/tests/src/libvirt_pci_passthrough.py | 7 | 6582 | import os
from autotest.client import utils
from autotest.client.shared import error
from virttest import virsh, utils_test, aexpect
from virttest.libvirt_xml.vm_xml import VMXML
from virttest.libvirt_xml.nodedev_xml import NodedevXML
from virttest.staging import service
def run(test, params, env):
"""
Test ... | gpl-2.0 |
eparis/contrib | flannel-server/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
msebire/intellij-community | python/helpers/epydoc/markup/pyval_repr.py | 105 | 22390 | # epydoc -- Marked-up Representations for Python Values
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: apidoc.py 1448 2007-02-11 00:05:34Z dvarrazzo $
"""
Syntax highlighter for Python values. Currently provides special
colorization support for:
... | apache-2.0 |
xen0l/ansible | lib/ansible/modules/windows/win_tempfile.py | 28 | 1630 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community... | gpl-3.0 |
siwells/uARG | server/src/uarg/uarg.py | 1 | 1787 | # coding: utf-8
# as per http://www.python.org/dev/peps/pep-0263/
import ConfigParser
from flask import Flask, g, json, jsonify, Markup, render_template, request, session, url_for
import configuration
from views_api import api
from views_webui import web
app = Flask(__name__)
app.register_blueprint(api)
app.regist... | gpl-3.0 |
loretoparisi/nupic | tests/swarming/nupic/swarming/experiments/max_branching_temporal/permutations.py | 38 | 5857 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
simonz05/activity-feed | setup.py | 1 | 3017 | # -*- coding: utf-8 -*-
r"""
Activity Feed
---
An Activity Feed for Python using Redis.
"""
import sys
import os
from setuptools import setup, Extension, Feature
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
try:
im... | mit |
manics/omego | omego/artifacts.py | 1 | 17352 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
from builtins import str
from past.builtins import basestring
from builtins import object
import os
import logging
f... | gpl-2.0 |
dimagol/trex-core | scripts/external_libs/nose-1.3.4/python3/nose/plugins/base.py | 11 | 26058 | import os
import textwrap
from optparse import OptionConflictError
from warnings import warn
from nose.util import tolist
class Plugin(object):
"""Base class for nose plugins. It's recommended but not *necessary* to
subclass this class to create a plugin, but all plugins *must* implement
`options(self, par... | apache-2.0 |
Elbagoury/odoo | addons/account/wizard/account_journal_select.py | 385 | 2068 | # -*- 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 |
CredoReference/edx-platform | common/test/acceptance/pages/studio/xblock_editor.py | 21 | 6838 | from bok_choy.page_object import PageObject
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from common.test.acceptance.pages.common.utils import click_css
from common.test.acceptance.tests.helpers import get_selected_option_text, select_option_by_text
class BaseXBloc... | agpl-3.0 |
AltSchool/django | django/db/backends/postgresql/operations.py | 149 | 10182 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.5/django/contrib/gis/utils/srs.py | 210 | 3235 | from django.contrib.gis.gdal import SpatialReference
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spatial_ref_sys` table of the spatial backend. Doing th... | apache-2.0 |
imankulov/sentry | src/sentry/web/forms/fields.py | 3 | 5450 | """
sentry.web.forms.fields
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from ipaddr import IPNetwork
from django.core.validators import URLValidator
from django.f... | bsd-3-clause |
abdullah2891/remo | vendor-local/lib/python/tablib/packages/yaml/parser.py | 114 | 25403 |
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
# implicit_document ::= block_node DOCUMENT-END*
# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
# block_node_or_inden... | bsd-3-clause |
Menooker/gem5_pcm | tests/quick/se/70.tgen/test.py | 74 | 2122 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
chauhanhardik/populo_2 | cms/djangoapps/contentstore/views/tests/test_entrance_exam.py | 83 | 12383 | """
Test module for Entrance Exams AJAX callback handler workflows
"""
import json
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase
from contentst... | agpl-3.0 |
roshantha9/AbstractManycoreSim | src/libApplicationModel/HEVCSyntheticWorkloadValidator_fast.py | 1 | 26004 | import pprint
import argparse
import sys, os
import random
import time
import math
import gc
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
from collections import OrderedDict
from scipy.stats import rv_discrete
from scipy.stats import exponweib
import scipy.stats as ss
i... | gpl-3.0 |
mhbu50/erpnext | erpnext/stock/report/stock_ageing/stock_ageing.py | 2 | 8593 | # 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
from frappe import _
from frappe.utils import date_diff, flt, cint
from six import iteritems
from erpnext.stock.doctype.serial_no.serial_n... | gpl-3.0 |
tombstone/models | research/deep_contextual_bandits/bandits/core/bayesian_nn.py | 4 | 1112 | # 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 applicab... | apache-2.0 |
JioCloud/tempest-lib | tempest_lib/tests/services/compute/test_floating_ip_pools_client.py | 2 | 1785 | # Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
InAnimaTe/CouchPotatoServer | libs/bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | gpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/uuid/package.py | 5 | 1733 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
ychaim/peatio-client-python | demo.py | 3 | 2201 | import time
import urllib2
from lib.client import Client, get_api_path
client = Client(access_key='your access key', secret_key='your secret key')
#demo of GET APIs
#get member info
print client.get(get_api_path('members'))
#get markets
markets = client.get(get_api_path('markets'))
print "markets:", markets
#get ... | cc0-1.0 |
vertical-knowledge/pypermedia | tests/unit/test_siren.py | 1 | 14281 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pypermedia.siren import _check_and_decode_response, SirenBuilder, UnexpectedStatusError, \
MalformedSirenError, SirenLink, SirenEntity, SirenAction, TemplatedStr... | gpl-2.0 |
ResolveWang/algrithm_qa | stackandqueue/q5.py | 1 | 1488 | """
问题描述:一个栈中元素的类型为整型,现在想将该栈从顶到底按从大到小的顺序排序,只许
额外申请一个栈。除此之外,可以申请新的变量,但不能申请额外的数据结构。如何完成排序?
思路:将要排序的栈记为stack,申请的辅助栈记为help。在stack上执行pop操作,弹出的
元素记为cur.
1)如果cur小于或等于help的栈顶元素,则将cur直接压入help
2)如果cur大于help的栈顶元素,则将help的元素逐一弹出,逐一压入stack,直到cur小于
或等于help的栈顶元素,再将cur压入help
3)将help的所有元素压入stack
"""
class SortedStack:
def __init_... | mit |
d-salas/electron | script/dump-symbols.py | 144 | 1962 | #!/usr/bin/env python
import os
import sys
from lib.config import PLATFORM
from lib.util import atom_gyp, execute, rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
CHROMIUM_DIR = os.path.join(... | mit |
BruceDLong/CodeDog | Scons/scons-local-4.1.0.post1/SCons/Variables/ListVariable.py | 4 | 4340 | # MIT License
#
# Copyright The SCons Foundation
#
# 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, ... | gpl-2.0 |
felliott/modular-file-renderer | tests/extensions/tabular/test_renderer.py | 2 | 6538 | import os
import pytest
from xlrd.biffh import XLRDError
from mfr.core.provider import ProviderMetadata
from mfr.extensions.tabular import settings
from mfr.extensions.tabular import TabularRenderer
from mfr.extensions.tabular import exceptions
PATH = os.path.dirname(os.path.abspath(__file__))
BODY = '<div id="mfrG... | apache-2.0 |
nik124seleznev/ZC500TG | tools/dct/obj/ModuleObj.py | 2 | 4092 | #! /usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import time
import re
import string
from utility import version
from utility.util import log
from utility.util import LogLevel
class ModuleObj:
_chip_id = ''
_gen_path = ''
def __init__(self, name1, name2):
self.__hName = name1
se... | gpl-2.0 |
nasoundead/emacs.d | elpa/jedi-core-20170121.2210/jediepcserver.py | 18 | 9725 | #!/usr/bin/env python
"""
Jedi EPC server.
Copyright (C) 2012 Takafumi Arakaki
Author: Takafumi Arakaki <aka.tkf at gmail.com>
This file is NOT part of GNU Emacs.
Jedi EPC server 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 So... | bsd-2-clause |
calexil/FightstickDisplay | pyglet/libs/win32/libwintab.py | 1 | 8616 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | gpl-3.0 |
Kazade/NeHe-Website | google_appengine/lib/django_1_2/django/contrib/gis/db/models/query.py | 290 | 35968 | from django.db import connections
from django.db.models.query import QuerySet, Q, ValuesQuerySet, ValuesListQuerySet
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import get_srid_info, GeometryField, PointField, LineStringField
from django.contrib.gis.db.models.sql import... | bsd-3-clause |
daonb/Open-Knesset | laws/tests/test_proposal_modal.py | 6 | 1226 | # encoding: utf-8
#
from datetime import datetime
from django.test import TestCase
from laws.models import Bill, KnessetProposal
just_id = lambda x: x.id
APP = 'laws'
class ProposalModelTest(TestCase):
def setUp(self):
super(ProposalModelTest, self).setUp()
self.bill = Bill.objects.create(stag... | bsd-3-clause |
throwable-one/teamcity-messages | tests/integration-tests/pytest_integration_test.py | 1 | 27567 | # coding=utf-8
import contextlib
import os
import platform
import sys
import pytest
import virtual_environments
from diff_test_tools import expected_messages, SCRIPT
from service_messages import ServiceMessage, assert_service_messages, has_service_messages
from test_util import run_command, get_teamcity_messages_root... | apache-2.0 |
sorki/hacked_cnc | hc/command.py | 1 | 1694 | from twisted.internet.defer import Deferred
from twisted.python import log
class Command(object):
g = False
m = False
t = False
special = False
comment = False
internal = False
unknown = False
acked = False
empty = False
raw = None
normalized = None
pre_encoded = None
... | bsd-3-clause |
wrouesnel/ansible | lib/ansible/modules/cloud/azure/azure_rm_keyvault.py | 30 | 20114 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
tsgit/invenio | modules/bibupload/lib/batchuploader_regression_tests.py | 16 | 12131 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 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 option) a... | gpl-2.0 |
hmen89/odoo | openerp/report/render/rml2txt/__init__.py | 381 | 1351 | # -*- 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... | agpl-3.0 |
ptkool/spark | examples/src/main/python/streaming/network_wordcount.py | 51 | 1920 | #
# 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 us... | apache-2.0 |
xuru/pyvisdk | pyvisdk/do/virtual_cdrom_atapi_backing_option.py | 1 | 1112 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualCdromAtapiBackingOption(vim, *args, **kwargs):
'''The VirtualCdromOption.Atapi... | mit |
ssalevan/cobbler | web/cobbler_web/urls.py | 11 | 1865 | from django.conf.urls.defaults import *
from views import *
# Uncomment the next two lines to enable the admin:
# from cobbler_web.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
(r'^$', index),
(r'^ksfile/list(/(?P<page>\d+))?$', ksfile_list),
(r'^ksfile/edit$', ksfile_edit, {'edi... | gpl-2.0 |
kenkuang1213/Halide | python_bindings/tutorial/lesson_11_cross_compilation.py | 7 | 6975 | #!/usr/bin/python3
# Halide tutorial lesson 11.
# This lesson demonstrates how to use Halide as a cross-compiler.
# This lesson can be built by invoking the command:
# make tutorial_lesson_11_cross_compilation
# in a shell with the current directory at the top of the halide source tree.
# Otherwise, see the platf... | mit |
hollabaq86/haikuna-matata | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
zengenti/ansible | lib/ansible/modules/messaging/rabbitmq_queue.py | 25 | 9624 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@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... | gpl-3.0 |
TeamEOS/external_chromium_org | chrome/browser/policy/test/asn1der.py | 101 | 1562 | # Copyright (c) 2011 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.
"""Helper module for ASN.1/DER encoding."""
import binascii
import struct
# Tags as defined by ASN.1.
INTEGER = 2
BIT_STRING = 3
NULL = 5
OBJECT_IDENTI... | bsd-3-clause |
MaxIV-KitsControls/netspot | netspot/lib/ansible_runner/callbacks/record_logs.py | 1 | 7576 | #!/usr/bin/python -tt
"""Ansible CallBackModule to log output."""
# pylint: disable=W0212
from datetime import datetime
from ansible.plugins.callback import CallbackBase
try:
from spotmax import spotmax
except ImportError:
pass
class PlayLogger(object):
"""Store log output in a single object."""
def __ini... | mit |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/numpy/core/tests/test_getlimits.py | 93 | 2278 | """ Test functions for limits module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.core import finfo, iinfo
from numpy import half, single, double, longdouble
from numpy.testing import (
TestCase, run_module_suite, assert_equal
)
#############################... | apache-2.0 |
spencerchan/ctabus | flask-bokeh_site/app.py | 1 | 1226 | import subprocess
import atexit
from flask import Flask, render_template, request
from bokeh.embed import autoload_server
from bokeh.client import pull_session
from forms import RouteSelectForm
app = Flask(__name__)
app.config.from_object('config')
bokeh_process = subprocess.Popen(
['bokeh', 'serve','--allow-webs... | gpl-3.0 |
YinYanfei/CadalWorkspace | thrift/src/thrift-0.8.0/lib/py/src/protocol/TBase.py | 64 | 2532 | #
# 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... | gpl-3.0 |
ctiller/grpc | src/python/grpcio_tests/tests/unit/_interceptor_test.py | 8 | 27086 | # Copyright 2017 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 |
DavidWittman/ansible-modules-core | cloud/amazon/ec2_eip.py | 26 | 10029 | #!/usr/bin/python
DOCUMENTATION = '''
---
module: ec2_eip
short_description: associate an EC2 elastic IP with an instance.
description:
- This module associates AWS EC2 elastic IP addresses with instances
version_added: 1.4
options:
instance_id:
description:
- The EC2 instance id
required: false
p... | gpl-3.0 |
ghostop14/gr-lfast | python/bindings/bind_oot_file.py | 12 | 2066 | import warnings
import argparse
import os
from gnuradio.bindtool import BindingGenerator
import pathlib
import sys
parser = argparse.ArgumentParser(description='Bind a GR Out of Tree Block')
parser.add_argument('--module', type=str,
help='Name of gr module containing file to bind (e.g. fft digital ... | gpl-3.0 |
diegoguimaraes/django | django/contrib/gis/db/backends/postgis/introspection.py | 39 | 4526 | from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection
from django.contrib.gis.gdal import OGRGeomType
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for PostGIS geometry types not populated until
# int... | bsd-3-clause |
emersonsoftware/ansiblefork | lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py | 14 | 35418 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
jmankoff/data | Assignments/jmankoff-explore/lib/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | gpl-3.0 |
mcepl/ropeide | ropeide/registers.py | 1 | 3639 | import Tkinter
from ropeide.uihelpers import SearchableList, SearchableListHandle
class Registers(object):
def __init__(self):
self.locations = {}
self.strings = {}
def add_location(self, name, resource, line):
self.locations[name] = (resource, line)
def add_string(self, name, ... | gpl-2.0 |
JonnyWong16/plexpy | lib/ipwhois/exceptions.py | 3 | 3044 | # Copyright (c) 2013, 2014, 2015, 2016 Philip Hane
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of c... | gpl-3.0 |
zhoulingjun/django | tests/file_uploads/tests.py | 127 | 23425 | #! -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import errno
import hashlib
import json
import os
import shutil
import tempfile as sys_tempfile
import unittest
from io import BytesIO
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploaded... | bsd-3-clause |
tensorflow/examples | tensorflow_examples/lite/model_maker/core/file_util.py | 1 | 1092 | # Copyright 2020 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 |
tanmaykm/edx-platform | common/test/acceptance/pages/lms/peer_grade.py | 40 | 1061 | """
Students grade peer submissions.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
class PeerGradePage(PageObject):
"""
Students grade peer submissions.
"""
url = None
def is_browser_on_page(self):
def _is_correct_page():
is_present = (... | agpl-3.0 |
FlymeOS/tools | smaliparser/FormatSmaliLib.py | 3 | 1429 | '''
Created on Jul 22, 2014
@author: tangliuxiang
'''
import os, sys
from os import path
import Smali
from SmaliLib import SmaliLib
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from formatters.format import Format
class FormatSmaliLib(SmaliLib):
'''
classdocs
'''
mFormat... | apache-2.0 |
godiard/music-keyboard-activity | draw_piano.py | 1 | 23771 | #!/usr/bin/env python
# Copyright (C) 2011, One Laptop Per Child
# Author, Gonzalo Odiard
# License: LGPLv2
#
# The class PianoKeyboard draws a keyboard and interacts with the mouse
# References
# http://www.josef-k.net/mim/MusicSystem.html
# http://wiki.laptop.org/images/4/4e/Tamtamhelp2.png
#
import logging
from gi.... | gpl-2.0 |
masayoota/upPIR | uppir_create_manifest.py | 3 | 5829 | """
<Author>
Justin Cappos
(inspired from a previous version by Geremy Condra)
<Start Date>
May 17th, 2011
<Description>
Creates a manifest from the files in a directory. This takes a set of
files that one wants to serve (rooted in 'vendorroot') and prepares the
necessary metadata (manifest file) to se... | mit |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py | 119 | 14414 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 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 t... | bsd-3-clause |
Boussadia/weboob | weboob/tools/capabilities/gallery/genericcomicreadertest.py | 12 | 1043 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Noé Rubinstein
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | agpl-3.0 |
chokribr/invenio | invenio/modules/jsonalchemy/testsuite/functions/sync_meeting_names.py | 33 | 1888 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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 option) any later... | gpl-2.0 |
Horrendus/radiocontrol | old_radiocontrol_app/radiocontrol/urls.py | 1 | 1261 | """radiocontrol URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | agpl-3.0 |
yarsanich/openprocurement.tender.belowthreshold | openprocurement/tender/belowthreshold/views/bid.py | 1 | 13519 | # -*- coding: utf-8 -*-
from openprocurement.api.models import get_now
from openprocurement.api.utils import (
set_ownership,
json_view,
context_unpack,
APIResource,
)
from openprocurement.tender.belowthreshold.validation import (
validate_bid_data,
validate_patch_bid_data,
)
from openprocureme... | apache-2.0 |
gurneyalex/connector-magento | __unported__/magentoerpconnect_options_active/connector.py | 9 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Markus Schneider
# Copyright 2014 initOS GmbH & Co. KG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
... | agpl-3.0 |
pschmitt/home-assistant | homeassistant/components/mqtt/fan.py | 5 | 15603 | """Support for MQTT fans."""
import logging
import voluptuous as vol
from homeassistant.components import fan, mqtt
from homeassistant.components.fan import (
ATTR_SPEED,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassista... | apache-2.0 |
jcftang/ansible-modules-extras | system/zfs.py | 5 | 8096 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Johan Wiren <johan.wiren.se@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 th... | gpl-3.0 |
akshaynathr/mailman | src/mailman/handlers/cleanse.py | 3 | 2543 | # Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
MediaKraken/MediaKraken_Deployment | source/testing/test_subprogram/test_subprogram_thetvdb_updates.py | 1 | 1257 | """
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | gpl-3.0 |
merlian/django-xadmin | xadmin/plugins/aggregation.py | 49 | 2408 | from django.db.models import FieldDoesNotExist, Avg, Max, Min, Count, Sum
from django.utils.translation import ugettext as _
from xadmin.sites import site
from xadmin.views import BaseAdminPlugin, ListAdminView
from xadmin.views.list import ResultRow, ResultItem
from xadmin.util import display_for_field
AGGREGATE_ME... | bsd-3-clause |
hlamer/kate | addons/kate/pate/src/plugins/expand/expands_completion_model.py | 3 | 2772 | # -*- coding: utf-8 -*-
#
# This file is part of Kate's Expand plugin.
#
# Copyright (C) 2013 Alex Turbov <i.zaufi@gmail.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 3 o... | lgpl-2.1 |
BackupGGCode/python-for-android | python-modules/twisted/twisted/protocols/mice/mouseman.py | 81 | 2882 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Logictech MouseMan serial protocol.
http://www.softnco.demon.co.uk/SerialMouse.txt
"""
from twisted.internet import protocol
class MouseMan(protocol.Protocol):
"""
Parser for Logitech MouseMan serial mouse protocol (comp... | apache-2.0 |
luispedro/jug | jug/tests/test_jug_check.py | 1 | 1666 | import inspect
import os
import jug.jug
import jug.task
import jug.subcommands.check
from jug.task import Task
from jug.backends.dict_store import dict_store
from jug.tests.task_reset import task_reset_at_exit, task_reset
from jug.tests.utils import simple_execute
from jug.options import default_options
jug.jug.silen... | mit |
davebx/tools-iuc | tools/trycycler/trycycler.py | 12 | 1175 | #!/usr/bin/env python3
from os import path, walk
from sys import argv
def cluster(output_folder):
counter = 1
for root, dir, files in walk(output_folder):
if root.endswith('1_contigs'):
output_path = path.join(output_folder, f"cluster_0{counter}.fasta")
with open(output_path, ... | mit |
Thortoise/Super-Snake | Blender/animation_nodes-master/sockets/particle.py | 1 | 1488 | import bpy
from bpy.types import Particle
from .. base_types.socket import AnimationNodeSocket
class ParticleSocket(bpy.types.NodeSocket, AnimationNodeSocket):
bl_idname = "an_ParticleSocket"
bl_label = "Particle Socket"
dataType = "Particle"
allowedInputTypes = ["Particle"]
drawColor = (0.5, 0.3, ... | gpl-3.0 |
glovebx/odoo | addons/pos_restaurant/restaurant.py | 325 | 2246 | # -*- 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 |
IV-GII/Django_Traduccion | allauth/socialaccount/providers/twitter/tests.py | 2 | 3882 | # -*- coding: utf-8 -*-
from allauth.socialaccount.tests import create_oauth_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import TwitterProvider
class TwitterTests(create_oauth_tests(registry.by_id(TwitterProvider.id))):
def get_mocked_respons... | gpl-3.0 |
rec/echomesh | code/python/external/platform/darwin/numpy/ctypeslib.py | 11 | 13874 | """
============================
``ctypes`` Utility Functions
============================
See Also
---------
load_library : Load a C library.
ndpointer : Array restype/argtype with verification.
as_ctypes : Create a ctypes array from an ndarray.
as_array : Create an ndarray from a ctypes array.
References
----------... | mit |
Shun0228/RocketSim | RocketSimClass/param.py | 1 | 2019 |
def rocket_param():
# Set rocket parameter (default setting)
rocket_parameter = {
'len': 1.50, # length of rocket [m]
'diam': 0.13, # diameter of body [m]
'mass_i': 6.00, # initial mass [kg]
'mass_f': 5.50, # final mass [kg]
'CGlen_i': 0.79, # init... | mit |
jbedorf/tensorflow | tensorflow/python/kernel_tests/control_flow_ops_py_test.py | 3 | 170943 | # 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 |
wedaly/django-rest-framework | tests/test_request.py | 53 | 10805 | """
Tests for content parsing, and form-overloaded content parsing.
"""
from __future__ import unicode_literals
import json
from io import BytesIO
import django
import pytest
from django.conf.urls import url
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from d... | bsd-2-clause |
wschwa/Mr-Orange-Sick-Beard | lib/guessit/patterns.py | 2 | 9325 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
# Copyright (c) 2011 Ricard Marxer <ricardmp@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesse... | gpl-3.0 |
Lawrence-Liu/scikit-learn | sklearn/ensemble/tests/test_forest.py | 57 | 35265 | """
Testing for the forest module (sklearn.ensemble.forest).
"""
# Authors: Gilles Louppe,
# Brian Holt,
# Andreas Mueller,
# Arnaud Joly
# License: BSD 3 clause
import pickle
from collections import defaultdict
from itertools import product
import numpy as np
from scipy.sparse import csr_... | bsd-3-clause |
abraxa/libsigrokdecode | decoders/mlx90614/pd.py | 13 | 2625 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 Li... | gpl-3.0 |
Comcast/neutron | neutron/plugins/midonet/midonet_lib.py | 16 | 27496 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Midokura Japan K.K.
# Copyright (C) 2013 Midokura PTE LTD
# 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 th... | apache-2.0 |
TRox1972/youtube-dl | youtube_dl/extractor/ro220.py | 176 | 1451 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... | unlicense |
sorrowless/fuyaql | tests/test_fuyaql.py | 1 | 3019 | import pytest
import sys
from fuelyaql import fuyaql
class TestFuyaql:
@pytest.fixture
def opts(self):
return [
'CLUSTER_ID', '1'
]
@pytest.fixture
def old_context(self):
return {
'1': {
'uid': 1,
'roles': ['p... | gpl-3.0 |
maartenq/ansible | lib/ansible/modules/cloud/profitbricks/profitbricks_volume_attachments.py | 36 | 7782 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
turon/openthread | tests/scripts/thread-cert/Cert_5_3_09_AddressQuery.py | 1 | 9053 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
RachitKansal/scikit-learn | sklearn/metrics/classification.py | 95 | 67713 | """Metrics to assess performance on classification task given classe prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gram... | bsd-3-clause |
arbrandes/edx-platform | common/lib/sandbox-packages/loncapa/loncapa_check.py | 5 | 1151 | #!/usr/bin/python # lint-amnesty, pylint: disable=missing-module-docstring
#
# File: mitx/lib/loncapa/loncapa_check.py
#
# Python functions which duplicate the standard comparison functions available to LON-CAPA problems.
# Used in translating LON-CAPA problems to i4x problem specification language.
import math
imp... | agpl-3.0 |
robhudson/zamboni | apps/bandwagon/tests/test_tasks.py | 6 | 1424 | import os
import shutil
import tempfile
from django.conf import settings
from nose.tools import eq_
from PIL import Image
from amo.tests.test_helpers import get_image_path
from bandwagon.tasks import resize_icon
def test_resize_icon():
somepic = get_image_path('mozilla.png')
src = tempfile.NamedTemporaryF... | bsd-3-clause |
sunny94/temp | sympy/unify/core.py | 24 | 7138 | """ Generic Unification algorithm for expression trees with lists of children
This implementation is a direct translation of
Artificial Intelligence: A Modern Approach by Stuart Russel and Peter Norvig
Second edition, section 9.2, page 276
It is modified in the following ways:
1. We allow associative and commutati... | bsd-3-clause |
zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/lb/test_create_lb_alone_vr.py | 4 | 2010 | '''
Test load balance on separated VR VM.
Test step:
1. Create 3 VM with load balance l3 network service.
2. Create a LB with 3 VMs' nic
3. Check the LB
4. Destroy VMs
@author: Youyk
'''
import os
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_... | apache-2.0 |
yannickcr/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/radiofrance.py | 163 | 2089 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RadioFranceIE(InfoExtractor):
_VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)'
IE_NAME = 'radiofrance'
_TEST = {
'url': 'http://maison.radiofrance.fr/radiovisio... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.