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 |
|---|---|---|---|---|---|
jtyr/ansible-modules-core | network/eos/_eos_template.py | 19 | 7276 | #!/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 |
dharamgollapudi/jaikuengine | middleware/auth.py | 34 | 1198 | # Copyright 2009 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 agreed to in writing, ... | apache-2.0 |
Gentlemanlylad5/googlepersonfinder | tools/babel/support.py | 54 | 13005 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... | apache-2.0 |
bgalehouse/grr | client/client_actions/plist.py | 8 | 2510 | #!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Client actions related to plist files."""
import cStringIO
import types
from binplist import binplist
from grr.client import actions
from grr.client import vfs
from grr.lib import plist as plist_lib
from grr.lib.rdfvalues import plist as r... | apache-2.0 |
OpenTrons/opentrons-api | api/tests/opentrons/api/test_session.py | 2 | 18003 | from unittest.mock import patch
import itertools
import copy
import pytest
import base64
from opentrons.api import session
from opentrons.api.session import (
_accumulate, _dedupe)
from opentrons.hardware_control import ThreadedAsyncForbidden
from tests.opentrons.conftest import state
from functools import partia... | apache-2.0 |
jelly/calibre | src/calibre/gui2/tweak_book/preview.py | 2 | 23925 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import time, textwrap, json
from bisect import bisect_right
from base64 impo... | gpl-3.0 |
BrotherPhil/django | tests/staticfiles_tests/test_storage.py | 147 | 18183 | from __future__ import unicode_literals
import os
import sys
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collectstatic
from django.contrib.staticfiles.management.commands.collectstatic import \
... | bsd-3-clause |
sinnwerkstatt/landmatrix | apps/landmatrix/models/activity_changeset.py | 1 | 1373 | from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class ReviewDecision(models.Model):
name = models.CharField(_("Name"), max_length=255)
description = models.TextField(_("Description"), blank=True, null=True)... | agpl-3.0 |
TridevGuha/pywikibot-core | pywikibot/daemonize.py | 6 | 1961 | # -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
# (C) Pywikibot team, 2007-2015
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#
import os
import sys
import codecs
is_daemon = False
def daemonize(close_fd=True, chdir=True, write_pid=False, redirect_std=N... | mit |
JeffRoy/mi-dataset | mi/dataset/parser/pco2a_a_dcl.py | 3 | 9450 | #!/usr/bin/env python
"""
@package mi.dataset.parser.pco2a_a_dcl
@file marine-integrations/mi/dataset/parser/pco2a_a_dcl.py
@author Sung Ahn
@brief Parser for the pco2a_a_dcl dataset driver
This file contains code for the pco2a_a_dcl parser and code to produce data particles.
For instrument telemetered data, there is... | bsd-2-clause |
jrha/aquilon | tests/broker/test_constraints_location.py | 2 | 1424 | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | apache-2.0 |
zaccoz/odoo | addons/account/res_currency.py | 340 | 2267 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
dfdx2/django | tests/aggregation/models.py | 104 | 1242 | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str__(self):
return self.name
class Publisher(models.Model):
name = models.CharField(max_length=255)
... | bsd-3-clause |
OGGM/oggm | oggm/cli/benchmark.py | 2 | 8716 | """Command line arguments to the oggm_benchmark command
Type `$ oggm_benchmark -h` for help
"""
# External modules
import os
import sys
import argparse
import time
import logging
import pandas as pd
import geopandas as gpd
# Locals
import oggm.cfg as cfg
from oggm import utils, workflow, tasks
from oggm.exceptions ... | bsd-3-clause |
arguman/arguman.org | web/premises/admin.py | 2 | 1481 | from django.contrib import admin
from django.db import models
from django.db.models import Count
from django.forms import Textarea
from premises.models import Contention, Premise, Report
class ReportAdmin(admin.ModelAdmin):
list_display = ('reporter', 'premise', 'contention')
class PremiseInline(admin.TabularI... | agpl-3.0 |
corona10/Simple-MiniC-Compiler | lib/llvm-3.5.0.src/examples/Kaleidoscope/MCJIT/complete/genk-timing.py | 108 | 11103 | #!/usr/bin/env python
import sys
import random
class TimingScriptGenerator:
"""Used to generate a bash script which will invoke the toy and time it"""
def __init__(self, scriptname, outputname):
self.timeFile = outputname
self.shfile = open(scriptname, 'w')
self.shfile.write("echo \"\"... | mit |
Southpaw-TACTIC/TACTIC | 3rd_party/python3/site-packages/cherrypy/test/test_proxy.py | 6 | 5630 | import cherrypy
from cherrypy.test import helper
script_names = ['', '/path/to/myapp']
class ProxyTest(helper.CPWebCase):
@staticmethod
def setup_server():
# Set up site
cherrypy.config.update({
'tools.proxy.on': True,
'tools.proxy.base': 'www.mydomain.test',
... | epl-1.0 |
dude-pa/dude | tests/food/test_suggest_drinks.py | 1 | 1181 | from mock import patch
import unittest
import yoda
from click.testing import CliRunner
class TestSuggestDrink(unittest.TestCase):
"""
Test for the following commands:
| Module: food
| command: suggest_drinks
"""
RANDOM_DRINK = {
'drinks': [{
'strDrink': 'Oatmeal Co... | mit |
OpenTreeOfLife/peyotl | peyotl/nexson_validation/adaptor.py | 2 | 1724 | #!/usr/bin/env python
"""NexsonValidationAdaptor class.
"""
from peyotl.nexson_validation._badgerfish_validation import BadgerFishValidationAdaptor
from peyotl.nexson_validation._by_id_validation import ByIdHBFValidationAdaptor
from peyotl.nexson_syntax import detect_nexson_version
from peyotl.nexson_syntax.helper impo... | bsd-2-clause |
meskio/bitmask_client | src/leap/bitmask/util/__init__.py | 1 | 3265 | # -*- coding: utf-8 -*-
# __init__.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | gpl-3.0 |
Gr1ph00n/staticwebanalyzer | SDK/dnspython-1.11.1/tests/generate.py | 12 | 19826 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | mit |
bhairavmehta95/flashcard-helper-alexa-skill | venv/lib/python2.7/site-packages/pymysql/tests/test_SSCursor.py | 27 | 3920 | import sys
try:
from pymysql.tests import base
import pymysql.cursors
except Exception:
# For local testing from top-level directory, without installing
sys.path.append('../pymysql')
from pymysql.tests import base
import pymysql.cursors
class TestSSCursor(base.PyMySQLTestCase):
def test_SS... | mit |
40223134/0512 | static/Brython3.1.1-20150328-091302/Lib/unittest/result.py | 727 | 6397 | """Test result object"""
import io
import sys
import traceback
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
return method(self, *args, **kw)
... | gpl-3.0 |
uli/scummvm-spmp8000 | devtools/tasmrecover/tasm/op.py | 61 | 9469 | # ScummVM - Graphic Adventure Engine
#
# ScummVM is the legal property of its developers, whose names
# are too numerous to list here. Please refer to the COPYRIGHT
# file distributed with this source distribution.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU ... | gpl-2.0 |
denys-duchier/django | django/contrib/gis/db/models/functions.py | 5 | 19280 | from decimal import Decimal
from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
from django.contrib.gis.db.models.sql import AreaField, DistanceField
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as Distan... | bsd-3-clause |
keven/ibpy | ib/opt/sender.py | 3 | 2332 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# Defines Sender class to handle outbound requests.
#
# Sender instances defer failed attribute lookup to their
# EClientSocket member objects.
#
##
from ib.ext.EClientSocket import EClientSocket
from ib.opt.message import registry, clientSocketMethods
class Sender(ob... | bsd-3-clause |
nicky-ji/edx-nicky | common/lib/xmodule/xmodule/modulestore/modulestore_settings.py | 9 | 4467 | """
This file contains helper functions for configuring module_store_setting settings and support for backward compatibility with older formats.
"""
import warnings
import copy
def convert_module_store_setting_if_needed(module_store_setting):
"""
Converts old-style module_store_setting configuration settings... | agpl-3.0 |
elkingtonmcb/django | django/contrib/gis/db/backends/postgis/schema.py | 333 | 3091 | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde... | bsd-3-clause |
YanTangZhai/tf | tensorflow/python/ops/sparse_ops.py | 3 | 22657 | # 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 required by applicable law or a... | apache-2.0 |
janocat/odoo | addons/project_timesheet/__init__.py | 441 | 1084 | # -*- 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 |
skrzym/monday-morning-quarterback | Research/report.py | 1 | 13031 | from matplotlib import pyplot as plt
import matplotlib.ticker as plticker
import seaborn as sns
import pandas as pd
import numpy as np
import math
import warnings
from collections import Counter
import nfldatatools as nfltools
rs_pbp = nfltools.gather_data(playoffs=False)
po_pbp = nfltools.gather_data(playoffs=True)
... | mit |
namecoin/namecoin-core | contrib/zmq/zmq_sub.py | 28 | 3470 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Bitcoin should be started with the command line argument... | mit |
qpxu007/luigi | luigi/parameter.py | 1 | 22062 | # -*- 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 |
jnphilipp/FCPM | fcpm.py | 1 | 18629 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed... | gpl-3.0 |
asedunov/intellij-community | python/helpers/python-skeletons/nose/tools/__init__.py | 80 | 5457 | """Skeleton for 'nose.tools' module.
Project: nose 1.3 <https://nose.readthedocs.org/>
Skeleton by: Andrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
"""
import sys
def assert_equal(first, second, msg=None):
"""Fail if the two objects are unequal as determined by the '==' operator.
"""
pass
def a... | apache-2.0 |
mzdaniel/oh-mainline | vendor/packages/Django/django/contrib/flatpages/tests/forms.py | 155 | 1271 | from django.conf import settings
from django.contrib.flatpages.admin import FlatpageForm
from django.test import TestCase
class FlatpageAdminFormTests(TestCase):
def setUp(self):
self.form_data = {
'title': "A test page",
'content': "This is a test",
'sites': [settings.S... | agpl-3.0 |
pdubroy/kurt | build/MacOS/PyInstaller/pyinstaller-svn-r812/buildtests/test1.py | 1 | 1267 | # Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the... | gpl-2.0 |
sgerhart/ansible | lib/ansible/modules/cloud/azure/azure_rm_containerinstance_facts.py | 33 | 9452 | #!/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',
... | mit |
KousikaGanesh/purchaseandInventory | openerp/addons/sale/wizard/sale_make_invoice.py | 34 | 3548 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
jn7163/django | tests/multiple_database/routers.py | 379 | 1927 | from __future__ import unicode_literals
from django.db import DEFAULT_DB_ALIAS
class TestRouter(object):
"""
Vaguely behave like primary/replica, but the databases aren't assumed to
propagate changes.
"""
def db_for_read(self, model, instance=None, **hints):
if instance:
retu... | bsd-3-clause |
Jgarcia-IAS/SAT | openerp/addons-extra/odoo-pruebas/odoo-server/openerp/addons/base/ir/ir_qweb.py | 6 | 59875 | # -*- coding: utf-8 -*-
import collections
import cStringIO
import datetime
import hashlib
import json
import itertools
import logging
import math
import os
import re
import sys
import textwrap
import uuid
from subprocess import Popen, PIPE
from urlparse import urlparse
import babel
import babel.dates
import werkzeug
... | agpl-3.0 |
neilLasrado/erpnext | erpnext/projects/doctype/project_update/project_update.py | 18 | 2577 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ProjectUpdate(Document):
pass
@frappe.whitelist()
def daily_reminde... | gpl-3.0 |
volatilityfoundation/volatility | volatility/plugins/overlays/windows/win10_x86_vtypes.py | 4 | 703386 | ntkrpamp_types = {
'LIST_ENTRY64' : [ 0x10, {
'Flink' : [ 0x0, ['unsigned long long']],
'Blink' : [ 0x8, ['unsigned long long']],
} ],
'LIST_ENTRY32' : [ 0x8, {
'Flink' : [ 0x0, ['unsigned long']],
'Blink' : [ 0x4, ['unsigned long']],
} ],
'_KUSER_SHARED_DATA' : [ 0x708, {
'TickCountLowDepreca... | gpl-2.0 |
google/clusterfuzz | src/appengine/handlers/testcase_detail/redo.py | 1 | 1598 | # Copyright 2019 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 |
gazoo74/linux | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
lecaoquochung/ddnb.django | django/core/signing.py | 82 | 6692 | """
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... | bsd-3-clause |
beckdaniel/GPy | GPy/likelihoods/binomial.py | 7 | 4599 | # Copyright (c) 2012-2014 The GPy authors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from ..util.univariate_Gaussian import std_norm_pdf, std_norm_cdf
from . import link_functions
from .likelihood import Likelihood
from scipy import special
class Binomial(Likeliho... | bsd-3-clause |
Messaoud-Boudjada/dipy | dipy/tracking/tests/test_propagation.py | 9 | 7292 | import os
import numpy as np
import numpy.testing
from dipy.data import get_data, get_sphere
from dipy.core.gradients import gradient_table
from dipy.reconst.gqi import GeneralizedQSamplingModel
from dipy.reconst.dti import TensorModel, quantize_evecs
from dipy.tracking import utils
from dipy.tracking.eudx import EuDX... | bsd-3-clause |
julien6387/supvisors | supvisors/utils.py | 2 | 5877 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 Julien LE CLEACH
#
# 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 Lice... | apache-2.0 |
pdellaert/ansible | lib/ansible/modules/network/vyos/_vyos_l3_interface.py | 23 | 8638 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
amancevice/stanhope | stanhope/stanhope/tables.py | 1 | 9826 | """
StanhopeFramers Tables
"""
import io
import subprocess
import pandas
from stanhope import utils
pandas.set_option('display.max_rows', 999)
pandas.set_option('display.width', 999)
pandas.set_option('display.max_colwidth', 999)
class Table(object):
def __init__(self, *tables):
self.tables = tables or ... | mit |
rmboggs/django | tests/template_tests/syntax_tests/test_regroup.py | 367 | 3984 | from datetime import date
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class RegroupTagTests(SimpleTestCase):
@setup({'regroup01': ''
'{% regroup data by bar as grouped %}'
'{% for group in gro... | bsd-3-clause |
tensorflow/probability | tensorflow_probability/python/optimizer/linesearch/__init__.py | 1 | 1076 | # Copyright 2018 The TensorFlow Probability 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 o... | apache-2.0 |
LanderU/ardupilot | Tools/autotest/pysim/fdpexpect.py | 88 | 2560 | """This is like pexpect, but will work on any file descriptor that you pass it.
So you are responsible for opening and close the file descriptor.
$Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $
"""
from __future__ import print_function
import os
from pexpect import ExceptionPexpect, spawn
__all__ = ['fdspawn']
c... | gpl-3.0 |
bingshuika/hearthbreaker-new | jsonschema/_format.py | 65 | 6881 | import datetime
import re
import socket
from jsonschema.compat import str_types
from jsonschema.exceptions import FormatError
class FormatChecker(object):
"""
A ``format`` property checker.
JSON Schema does not mandate that the ``format`` property actually do any
validation. If validation is desired... | mit |
secnot/django-param-field | param_field/tests/test_parser.py | 1 | 20865 | from django.test import TestCase
from pyparsing import ParseBaseException, ParseException, ParseFatalException
from decimal import Decimal
from collections import OrderedDict
from param_field.parser import parse_fields
from param_field.params import *
from param_field.conf import settings
class TestParserBase(TestC... | lgpl-3.0 |
sam-tsai/django | tests/requests/tests.py | 73 | 33786 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import time
from datetime import datetime, timedelta
from io import BytesIO
from itertools import chain
from django.core.exceptions import SuspiciousOperation
from django.core.handlers.wsgi import LimitedStream, WSGIRequest
from django.http import (
... | bsd-3-clause |
psynteract/psynteract-os | setup.py | 1 | 5181 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspa... | gpl-3.0 |
noba3/KoTos | addons/plugin.video.screen_yahoo_com/default.py | 1 | 20315 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import urllib
import urllib2
import cookielib
import xbmcplugin
import xbmcaddon
import xbmcgui
import json
import sys
import os
import re
addon = xbmcaddon.Addon()
socket.setdefaulttimeout(60)
pluginhandle = int(sys.argv[1])
addonID = addon.getAddonInfo('id')
cj... | gpl-2.0 |
PLyczkowski/Sticky-Keymap | 2.74/python/lib/site-packages/requests/packages/urllib3/request.py | 853 | 5751 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | demo/res/scripts/data/d_spaces_spawns.py | 1 | 2275 | # -*- coding: utf-8 -*-
datas={
1: [
],
2: [
(1001, (-102.9299, 191.0, -150.922),(0.0,0.0,0.0), 1),
(1002, (-105.0, 191.0, -150.922),(0.0,0.0,0.0), 1),
(1003, (-132.9299, 191.0, -150.922),(0.0,0.0,0.0), 1),
(1003, (-137.833725, 170.639648, -202.246201),(0.0,0.0,0.0), 1),
(1003, (-146.968063, 161.339844, -... | lgpl-3.0 |
ianscrivener/microservices-infrastructure | plugins/callbacks/profile_tasks.py | 41 | 2464 | # The MIT License (MIT)
#
# Copyright (c) 2014 Jharrod LaFon
#
# 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, mod... | apache-2.0 |
TheoRettisch/p2pool-giarcoin | p2pool/util/memoize.py | 281 | 1737 | import itertools
class LRUDict(object):
def __init__(self, n):
self.n = n
self.inner = {}
self.counter = itertools.count()
def get(self, key, default=None):
if key in self.inner:
x, value = self.inner[key]
self.inner[key] = self.counter.next(), value
... | gpl-3.0 |
JRepoInd/Repo_Indi | plugin.video.tvondesizonexl/xoze/snapvideo/Playwire.py | 3 | 1736 | '''
Created on Nov 21, 2012
@author: ajju
'''
from xoze.snapvideo import VideoHost, Video, STREAM_QUAL_HD_720
from xoze.utils import http
import logging
import re
try:
import json
except ImportError:
import simplejson as json
VIDEO_HOSTING_NAME = 'PLAYWIRE'
def getVideoHost():
video_host = VideoHost()
... | gpl-2.0 |
metacloud/python-openstackclient | openstackclient/compute/v2/agent.py | 2 | 4860 | # Copyright 2013 OpenStack Foundation
#
# 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 |
flynx/pli | pli/persistance/sql/shelve.py | 1 | 2359 | #=======================================================================
__version__ = '''0.0.01'''
__sub_version__ = '''20070108034250'''
__copyright__ = '''(c) Alex A. Naanou 2003'''
#-----------------------------------------------------------------------
import pli.pattern.mixin.mapping as mapping
#-----------... | bsd-3-clause |
crmccreary/openerp_server | openerp/addons/caldav/wizard/calendar_event_export.py | 9 | 2386 | # -*- 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 |
wraiden/spacewalk | backend/server/test/unit-test/test_rhnLib_timestamp.py | 8 | 2404 | #!/usr/bin/python
#
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should... | gpl-2.0 |
anryko/ansible | lib/ansible/modules/storage/hpe3par/ss_3par_cpg.py | 35 | 9416 | #!/usr/bin/python
# Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# 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 |
TheMOOCAgency/edx-platform | common/djangoapps/student/management/commands/create_random_users.py | 20 | 1874 | """
A script to create some dummy users
"""
import uuid
from django.core.management.base import BaseCommand
from student.models import CourseEnrollment
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.forms imp... | agpl-3.0 |
diox/olympia | src/olympia/devhub/views.py | 2 | 70834 | import datetime
import os
import time
from uuid import UUID, uuid4
from django import forms as django_forms, http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage as storage
from django.db import transaction
from django.db.model... | bsd-3-clause |
dave-billin/overo-ui-moos-auv | contrib/python/generate-manifest-2.6.py | 19 | 14802 | #!/usr/bin/env python
# generate Python Manifest for the OpenEmbedded build system
# (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
# (C) 2007 Jeremy Laine
# licensed under MIT, see COPYING.MIT
import os
import sys
import time
VERSION = "2.6.6"
__author__ = "Michael 'Mickey' Lauer <mlauer@vanille-me... | mit |
datalytica/esky | esky/patch.py | 4 | 51684 | # Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
# All rights reserved; available under the terms of the BSD License.
"""
esky.patch: directory diffing and patching support for esky.
This module forms the basis of esky's differential update support. It defines
a compact protocol to encode the differences betwe... | bsd-3-clause |
nextgis/osm_adm | ru_classifier/oktmo/mosclassific.py | 1 | 4088 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from urllib2 import Request, urlopen, HTTPError
import re
from BeautifulSoup import BeautifulSoup
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
from sys import stderr
import time
UA = 'Mozilla/5.0 (compatible; MSIE 5.5; Windows NT)'
def _fetch_page(url):
... | gpl-2.0 |
cfg2015/EPT-2015-2 | openerp/service/db.py | 230 | 13586 | # -*- coding: utf-8 -*-
import json
import logging
import os
import shutil
import tempfile
import threading
import traceback
import zipfile
from functools import wraps
from contextlib import closing
import psycopg2
import openerp
from openerp import SUPERUSER_ID
from openerp.exceptions import Warning
import openerp... | agpl-3.0 |
chemelnucfin/tensorflow | tensorflow/python/training/optimizer.py | 1 | 49527 | # 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 |
telwertowski/Books-Mac-OS-X | Versions/Books_3.0b6/Library of Congress Importer.app/Contents/Resources/PyZ3950/charneg.py | 30 | 4232 | #!/usr/bin/env python
assert (0)
# XXX shouldn't use, absorbed into z3950_2001.py
#from PyZ3950 import asn1
import asn1
InitialSet=asn1.SEQUENCE ([('g0',None,asn1.TYPE(asn1.IMPLICIT(0,cls=asn1.CONTEXT_FLAG),asn1.INTEGER),1),
('g1',None,asn1.TYPE(asn1.IMPLICIT(1,cls=asn1.CONTEXT_FLAG),asn1.INTEGER),1),
('g2',... | mit |
gautam1858/tensorflow | tensorflow/python/autograph/lang/directives.py | 31 | 2230 | # 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 |
isc-projects/forge | tests/protosupport/v6/srv_msg.py | 1 | 45127 | # Copyright (C) 2012-2020 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ... | isc |
YuMatsuzawa/HadoopEclipseProject | contrib/hod/hodlib/Common/tcp.py | 182 | 5299 | #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 thi... | apache-2.0 |
mshavlovsky/mannord | mannord/tests/testHits.py | 1 | 3423 | #!/usr/bin/python
import unittest
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from mannord import (ItemMixin, UserMixin, ActionMixin)
import mannord.hits as hits
import mannord as mnrd
Base = declarative_base()
class TestHIT... | bsd-2-clause |
dataxu/ansible | test/units/plugins/lookup/test_password.py | 71 | 18937 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 License, or
# (a... | gpl-3.0 |
Technocaveman/There-is-no-Third-Step | node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/perldoc.py | 364 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
ahmadiga/min_edx | common/djangoapps/third_party_auth/tests/specs/test_google.py | 67 | 1132 | """Integration tests for Google providers."""
from third_party_auth.tests.specs import base
class GoogleOauth2IntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for provider.GoogleOauth2."""
def setUp(self):
super(GoogleOauth2IntegrationTest, self).setUp()
self.provider = self... | agpl-3.0 |
mvaled/OpenUpgrade | addons/membership/membership.py | 128 | 27626 | # -*- 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 |
pinkeshbadjatiya/listenbrainz-server | listenstore/listenstore/listen.py | 1 | 2104 | # coding=utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
import ujson
from datetime import datetime
import calendar
class Listen(object):
""" Represents a listen object """
def __init__(self, user_id=None, timestamp=None, artist_msid=None, album_msid=None,
... | gpl-2.0 |
n6151h/pyconau2016 | zkpylons/tests/functional/test_fulfilment_type.py | 3 | 2256 | from .crud_helper import CrudHelper
from .fixtures import FulfilmentStatusFactory, FulfilmentTypeFactory
class TestFulfilmentType(CrudHelper):
def test_new(self, app, db_session):
statie = [FulfilmentStatusFactory() for i in range(10)]
db_session.commit()
data = {
"name" ... | gpl-2.0 |
elucify/robotframework-selenium2library | src/Selenium2Library/keywords/_logging.py | 65 | 1206 | import os
import sys
from robot.variables import GLOBAL_VARIABLES
from robot.api import logger
from keywordgroup import KeywordGroup
class _LoggingKeywords(KeywordGroup):
# Private
def _debug(self, message):
logger.debug(message)
def _get_log_dir(self):
logfile = GLOBAL_VARIABLES['${LOG ... | apache-2.0 |
antonyc/django-rest-framework | tests/conftest.py | 84 | 1809 | def pytest_configure():
from django.conf import settings
settings.configure(
DEBUG_PROPAGATE_EXCEPTIONS=True,
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'}},
SITE_ID=1,
SECRET_KEY='not very secret in tests',
... | bsd-2-clause |
atuljain/odoo | addons/membership/wizard/__init__.py | 432 | 1071 | # -*- 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 |
anetasie/sherpa | sherpa/ui/__init__.py | 4 | 1720 | #
# Copyright (C) 2007, 2018 Smithsonian Astrophysical Observatory
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
artwr/airflow | airflow/contrib/auth/backends/ldap_auth.py | 1 | 11630 | # -*- 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 |
mashaoze/esp-idf | examples/protocols/mqtt/ws/mqtt_ws_example_test.py | 2 | 6064 | import re
import os
import sys
import time
import socket
import imp
use_mqtt_client_sketch = False
try:
imp.find_module('paho')
import paho.mqtt.client as mqtt
# Make things with supposed existing module
except ImportError:
use_mqtt_client_sketch = True
pass
global g_recv_topic
global g_recv_data... | apache-2.0 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/django/template/loader.py | 64 | 8040 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | mit |
encukou/freeipa | ipaclient/remote_plugins/2_164/join.py | 8 | 1490 | #
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
# pylint: disable=unused-import
import six
from . import Command, Method, Object
from ipalib import api, parameters, output
from ipalib.parameters import DefaultFrom
from ipalib.plugable import Registry
from ipalib.text import _
from ipapython.dn ... | gpl-3.0 |
marionleborgne/nupic | tests/unit/nupic/data/functionsource_test.py | 15 | 3217 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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 |
HunseopJeong/WATT | tools/WebIDLBinder/third_party/ply/example/GardenSnake/GardenSnake.py | 166 | 19213 | # GardenSnake - a parser generator demonstration program
#
# This implements a modified version of a subset of Python:
# - only 'def', 'return' and 'if' statements
# - 'if' only has 'then' clause (no elif nor else)
# - single-quoted strings only, content in raw format
# - numbers are decimal.Decimal instances (not ... | apache-2.0 |
MisterTea/HyperNEAT | boost_1_57_0/libs/python/test/implicit.py | 12 | 1024 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from implicit_ext import *
>>> x_value(X(42))
42
>>> x_value(42)
42
>>> x = make_x(X(42))
>>> x.value()
42
>>> try: ... | bsd-3-clause |
OSSESAC/odoopubarquiluz | addons/survey/wizard/survey_browse_answer.py | 54 | 2742 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
stacywsmith/ansible | test/units/modules/network/vyos/test_vyos_command.py | 59 | 4088 | # (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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.