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 |
|---|---|---|---|---|---|
ColOfAbRiX/ansible | lib/ansible/plugins/filter/json_query.py | 93 | 1583 | # (c) 2015, Filipe Niero Felisbino <filipenf@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 License, or
# (at your option) any l... | gpl-3.0 |
IPMITMO/statan | coala-bears/bears/c_languages/codeclone_detection/ClangFunctionDifferenceBear.py | 3 | 7854 | import functools
from itertools import combinations
from bears.c_languages.ClangBear import clang_available, ClangBear
from bears.c_languages.codeclone_detection.ClangCountingConditions import (
condition_dict)
from bears.c_languages.codeclone_detection.ClangCountVectorCreator import (
ClangCountVectorCreator)... | mit |
chiluf/visvis.dev | backends/backend_fltk.py | 5 | 9139 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
""" The FLTK backend.
"""
import visvis
from visvis import BaseFigure, events, constants
import fltk
KEYMAP = { fltk.FL_SHIFT: constants.... | bsd-3-clause |
havatv/QGIS | python/plugins/processing/algs/qgis/RasterLayerHistogram.py | 15 | 4036 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerHistogram.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | gpl-2.0 |
40223202/test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/event.py | 603 | 19086 | #!/usr/bin/env python
'''Pygame module for interacting with events and queues.
Pygame handles all it's event messaging through an event queue. The routines
in this module help you manage that event queue. The input queue is heavily
dependent on the pygame display module. If the display has not been
initialized and a ... | agpl-3.0 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/parallel/controller/dependency.py | 2 | 7155 | """Dependency utilities
Authors:
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#----... | apache-2.0 |
jeremiahyan/odoo | odoo/addons/base/tests/test_res_users.py | 4 | 4686 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase, Form, tagged
class TestUsers(TransactionCase):
def test_name_search(self):
""" Check name_search on user. """
User = self.env['res.users']
te... | gpl-3.0 |
klyone/PacketTesterXML | PTXML_server.py | 1 | 1324 | #! /usr/bin/python
# ******************************************************************************
# @file PTXML_client.py
# @brief Example using PTXMLServer
#
# Copyright (C) 2014
#
# @author Miguel Jimenez Lopez <klyone@ugr.es>
#
# ******************************************************************************
... | lgpl-3.0 |
shikhar394/uptane | tests/test_der_encoder.py | 1 | 21951 | """
<Program Name>
test_der_encoder.py
<Purpose>
Unit testing for DER Encoding, uptane/encoding/asn1_codec.py
"""
from __future__ import print_function
from __future__ import unicode_literals
import uptane # Import before TUF modules; may change tuf.conf values.
import tuf.formats
import tuf.keys
import tuf.repo... | mit |
Filechaser/nzbToMedia | libs/beetsplug/permissions.py | 7 | 3087 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
"""Fixes file permissions after the file gets written on import. Put something
like the following in your config.yaml to configure:
permissions:
file: 644
dir: 755
"""
import os
from beets import conf... | gpl-3.0 |
kiddinn/plaso | tests/test_lib.py | 1 | 6573 | # -*- coding: utf-8 -*-
"""Shared functions and classes for testing."""
import io
import os
import shutil
import re
import tempfile
import unittest
from dfdatetime import time_elements
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import... | apache-2.0 |
synergeticsedx/deployment-wipro | common/djangoapps/third_party_auth/tests/test_pipeline.py | 77 | 1807 | """Unit tests for third_party_auth/pipeline.py."""
import random
from third_party_auth import pipeline
from third_party_auth.tests import testutil
import unittest
# Allow tests access to protected methods (or module-protected methods) under test.
# pylint: disable=protected-access
class MakeRandomPasswordTest(tes... | agpl-3.0 |
sander76/home-assistant | tests/components/kira/test_sensor.py | 5 | 1611 | """The tests for Kira sensor platform."""
import unittest
from unittest.mock import MagicMock
from homeassistant.components.kira import sensor as kira
from tests.common import get_test_home_assistant
TEST_CONFIG = {kira.DOMAIN: {"sensors": [{"host": "127.0.0.1", "port": 17324}]}}
DISCOVERY_INFO = {"name": "kira", "... | apache-2.0 |
dragon788/powerline | powerline/lint/markedjson/events.py | 38 | 2157 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [
key for k... | mit |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Klout/User/ShowUser.py | 5 | 3067 | # -*- coding: utf-8 -*-
###############################################################################
#
# ShowUser
# Retrieves information for a specified Klout user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... | gpl-2.0 |
brian-l/django-1.4.10 | django/contrib/gis/management/commands/inspectdb.py | 315 | 1466 | from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_field_type(... | bsd-3-clause |
thecodinghub/news-for-good | news/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## 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... | bsd-3-clause |
40423130/2016fallcadp_hw | plugin/render_math/math.py | 283 | 14202 | # -*- 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 gets treated... | agpl-3.0 |
mtndesign/mtnvim | myvim/bundle/ropevim/ftplugin/python/libs/rope/refactor/multiproject.py | 91 | 2639 | """This module can be used for performing cross-project refactorings
See the "cross-project refactorings" section of ``docs/library.txt``
file.
"""
from rope.base import resources, project, libutils
class MultiProjectRefactoring(object):
def __init__(self, refactoring, projects, addpath=True):
"""Crea... | gpl-2.0 |
marcellodesales/svnedge-console | ext/solaris-sparc/pkg-toolkit/pkg/vendor-packages/mako/codegen.py | 6 | 32514 | # codegen.py
# Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module source code."""
import time
impo... | agpl-3.0 |
jcoady9/python-for-android | python-modules/twisted/twisted/conch/ssh/forwarding.py | 61 | 5659 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""
This module contains the implementation of the TCP forwarding, which allows
clients and servers to forward arbitrary TCP data across the connection.
Maintainer: Paul Swartz
"""
import struct
from twisted.internet import protoc... | apache-2.0 |
fclesio/learning-space | Python/ims24/ims24/contrators/requester.py | 1 | 3740 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
#
# requester.py
# @Author : Gustavo F (gustavo@gmf-tech.com)
# @Link : https://github.com/sharkguto
# @Date : 17/02/2019 11:06:12
import typing
import requests
from requests_futures.sessions import FuturesSession
from ims24 import logger
from ims24.configuration.... | gpl-2.0 |
Glignos/inspire-next | inspirehep/modules/fixtures/files.py | 4 | 2972 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
pbmanis/acq4 | acq4/analysis/scripts/eventExplorer.py | 3 | 15464 | from __future__ import print_function
from acq4.util import Qt
import acq4.Manager
import acq4.pyqtgraph as pg
import acq4.pyqtgraph.opengl as gl
import numpy as np
import acq4.util.functions as fn
import re
man = acq4.Manager.getManager()
## update DB field to reflect dir meta info
#for i in db.select('Cell', ['row... | mit |
iddqd1/django-cms | cms/tests/test_check.py | 1 | 7102 | # -*- coding: utf-8 -*-
from copy import deepcopy
import os
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import base
from django.test import SimpleTestCase, TestCase
from cms.api import add_plugin
from cms.models.pluginmodel... | bsd-3-clause |
vmindru/ansible | lib/ansible/modules/web_infrastructure/sophos_utm/utm_network_interface_address_info.py | 31 | 2619 | #!/usr/bin/python
# Copyright: (c) 2018, Juergen Wiebe <wiebe@e-spirit.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',
'statu... | gpl-3.0 |
enigmampc/catalyst | catalyst/data/continuous_future_reader.py | 1 | 12198 | import numpy as np
import pandas as pd
from catalyst.data.session_bars import SessionBarReader
class ContinuousFutureSessionBarReader(SessionBarReader):
def __init__(self, bar_reader, roll_finders):
self._bar_reader = bar_reader
self._roll_finders = roll_finders
def load_raw_arrays(self, col... | apache-2.0 |
NaturalGIS/naturalgis_qgis | python/plugins/processing/gui/BatchAlgorithmDialog.py | 25 | 11235 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BatchAlgorithmDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | gpl-2.0 |
vfasky/BlogCatke | virtualenv.bundle/requests/packages/chardet2/jpcntx.py | 25 | 19197 | ######################## 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 Ri... | apache-2.0 |
FreeScienceCommunity/or-tools | examples/python/volsay2.py | 34 | 2029 | # Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
mandeepdhami/nova | nova/tests/functional/v3/test_pci.py | 24 | 7238 | # Copyright 2013 Intel.
#
# 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 i... | apache-2.0 |
hbrunn/OCB | openerp/service/model.py | 62 | 8421 | # -*- coding: utf-8 -*-
from functools import wraps
import logging
from psycopg2 import IntegrityError, OperationalError, errorcodes
import random
import threading
import time
import openerp
from openerp.tools.translate import translate
from openerp.osv.orm import except_orm
from contextlib import contextmanager
imp... | agpl-3.0 |
ocaisa/easybuild-framework | easybuild/toolchains/iompi.py | 5 | 1519 | ##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
shadyueh/pyranking | env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py | 252 | 106466 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | mit |
atplanet/ansible-modules-extras | packaging/os/pkg5.py | 75 | 4862 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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 o... | gpl-3.0 |
KohlsTechnology/ansible | lib/ansible/plugins/filter/ipaddr.py | 15 | 29588 | # (c) 2014, Maciej Delmanowski <drybjed@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 License, or
# (at your option) any later ... | gpl-3.0 |
varunnaganathan/django | tests/admin_widgets/tests.py | 2 | 61214 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext
import os
from datetime import datetime, timedelta
from importlib import import_module
from unittest import skipIf
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import ... | bsd-3-clause |
home-assistant/home-assistant | homeassistant/components/yeelight/config_flow.py | 1 | 9179 | """Config flow for Yeelight integration."""
import logging
import voluptuous as vol
import yeelight
from homeassistant import config_entries, exceptions
from homeassistant.components.dhcp import IP_ADDRESS
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
from homeassistant.core import callba... | apache-2.0 |
GeographicaGS/moocng | moocng/courses/migrations/0015_calculate_stats.py | 2 | 14058 | # -*- coding: utf-8 -*-
# Copyright 2013 UNED
#
# 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... | apache-2.0 |
aerickson/ansible | test/units/plugins/cache/test_cache.py | 91 | 4078 | # (c) 2012-2015, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | gpl-3.0 |
j5shi/ST3_Config | Packages/Anaconda/commands/mccabe.py | 6 | 2445 |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import sublime
import sublime_plugin
from ..anaconda_lib.worker import Worker
from ..anaconda_lib.callback import Callback
from ..anaconda_lib.helpers import get_settings, active_view
clas... | mit |
Noviat/odoo | addons/hr_recruitment/wizard/hr_recruitment_create_partner_job.py | 337 | 3434 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
RobertWWong/WebDev | djangoApp/ENV/lib/python3.5/site-packages/django/contrib/gis/serializers/geojson.py | 36 | 2813 | from __future__ import unicode_literals
from django.contrib.gis.gdal import CoordTransform, SpatialReference
from django.core.serializers.base import SerializerDoesNotExist
from django.core.serializers.json import Serializer as JSONSerializer
class Serializer(JSONSerializer):
"""
Convert a queryset to GeoJSO... | mit |
wenqf11/huhamhire-hosts | util/retrievedata.py | 24 | 10221 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# retrievedata.py : Retrieve data from the hosts data file.
#
# Copyleft (C) 2014 - huhamhire hosts team <hosts@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You should
# ... | gpl-3.0 |
CIFASIS/pylearn2 | pylearn2/packaged_dependencies/theano_linear/unshared_conv/localdot.py | 39 | 5044 | """
WRITEME
"""
import logging
from ..linear import LinearTransform
from .unshared_conv import FilterActs, ImgActs
from theano.compat.six.moves import xrange
from theano.sandbox import cuda
if cuda.cuda_available:
import gpu_unshared_conv # register optimizations
import numpy as np
import warnings
try:
impor... | bsd-3-clause |
adityaduggal/erpnext | erpnext/patches/v5_0/update_item_description_and_image.py | 102 | 1951 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.website.utils import find_first_image
from frappe.utils import cstr
import re
def execute():
item_details = frappe._dict()
for d in frappe.db.sql("select name, des... | gpl-3.0 |
doomsterinc/odoo | addons/multi_company/__init__.py | 886 | 1054 | # -*- 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... | agpl-3.0 |
pcamarillor/Exploratory3D | external/gtest-1.5.0/test/gtest_break_on_failure_unittest.py | 1050 | 7214 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
rbdavid/MolecDynamics | Analysis/data_collector.py | 2 | 1272 | #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
# USAGE:
# PREAMBLE:
import numpy as np
import sys
log_file = sys.argv[1]
system = sys.argv[2]
# SUBROUTINES
# MAIN PROGRAM:
lf = open('%s' %(log_file), 'r')
tf = open('%s.time.dat' %(system), 'w')
ef = open('%s.tot_en.dat' %(system), 'w')
pf = open(... | mit |
pschwartz/ansible | v1/ansible/cache/__init__.py | 133 | 1828 | # (c) 2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) any lat... | gpl-3.0 |
Awingu/open-ovf | py/ovf/env/PlatformSection.py | 1 | 2180 | # vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distr... | epl-1.0 |
jeandet/meson | mesonbuild/mlog.py | 1 | 5948 | # Copyright 2013-2014 The Meson development team
# 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 |
Endika/django | django/contrib/sitemaps/__init__.py | 15 | 5550 | from django.apps import apps as django_apps
from django.conf import settings
from django.core import paginator
from django.core.exceptions import ImproperlyConfigured
from django.urls import NoReverseMatch, reverse
from django.utils import translation
from django.utils.six.moves.urllib.parse import urlencode
from djang... | bsd-3-clause |
ARG-TLQ/Red-DiscordBot | redbot/core/errors.py | 3 | 2555 | import importlib.machinery
import discord
from redbot.core.utils.chat_formatting import humanize_number
from .i18n import Translator
_ = Translator(__name__, __file__)
class RedError(Exception):
"""Base error class for Red-related errors."""
class PackageAlreadyLoaded(RedError):
"""Raised when trying to ... | gpl-3.0 |
chrrrles/ansible | lib/ansible/plugins/action/set_fact.py | 71 | 1710 | # Copyright 2013 Dag Wieers <dag@wieers.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
# (at your option) any later versio... | gpl-3.0 |
mariusor/tlcal | plusfw/scraper/html.py | 1 | 5805 | import plusfw
from datetime import datetime
from requests import get, post, codes, exceptions
import json
class Html:
"""
"""
base_uris = {
plusfw.LABEL_PFW: "https://www.plusforward.net",
plusfw.LABEL_QLIVE: "https://www.plusforward.net",
plusfw.LABEL_QIV: "https://www.plusforwa... | mit |
paulhtremblay/boto_emr | boto_emr/get_s3_common_crawl_paths.py | 1 | 1380 | import boto3
import os
def list_objects(bucket_name, prefix):
final = []
session = boto3.Session()
client = session.client('s3')
next_token = 'init'
kwargs = {}
while next_token:
if next_token != 'init':
kwargs.update({'ContinuationToken': next_token})
response = cl... | mit |
frohoff/Empire | lib/modules/python/situational_awareness/network/active_directory/get_domaincontrollers.py | 12 | 4374 | class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Get Domain Controllers',
# list of one or more authors for the mod... | bsd-3-clause |
semplice/alan2 | alan-config.py | 1 | 5617 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# alan2 - An openbox menu builder
# Copyright (C) 2013 Semplice Project
#
# 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... | gpl-3.0 |
llamberson/git-cola | cola/widgets/highlighter.py | 11 | 3404 | from __future__ import division, absolute_import, unicode_literals
from PyQt4 import QtCore, QtGui
from cola.compat import ustr
have_pygments = True
try:
from pygments.styles import get_style_by_name
from pygments import lex
from pygments.util import ClassNotFound
from pygments.lexers import get_lexe... | gpl-2.0 |
eharney/nova | nova/objects/utils.py | 14 | 4736 | # Copyright 2013 IBM Corp.
#
# 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 |
jhg/django | tests/gis_tests/inspectapp/tests.py | 17 | 8167 | from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.core.management import call_command
from django.db import connection, connections
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import mod... | bsd-3-clause |
helenst/django | django/contrib/gis/tests/relatedapp/models.py | 36 | 1892 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
class SimpleModel(models.Model):
objects = models.GeoManager()
class Meta:
abstract = True
app_label = 'relatedapp'
@python_2_unicode_compatible
class Location(SimpleModel):
point = m... | bsd-3-clause |
DrKylstein/tiled-vorticons | keenlib/ted15.py | 1 | 3290 | '''
Commander Keen 1-3 level loader/saver
2014 <dr.kylstein@gmail.com>
'''
from __future__ import print_function
import math
import rlew
import file_gen_util as util
RLEW_FLAG = 0xFEFE
HEADER_FIELDS = ('width', 'height', 'plane_count', 'unk1', 'unk2', 'unk3',
'unk4', 'plane_size', 'unk5', 'unk6', 'u... | mit |
gabriel-samfira/jrunner | jrunner/jobqueue/workers/simple.py | 1 | 1445 | # Copyright 2013 Cloudbase Solutions Srl
# 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 applicabl... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/jupyter_client/channels.py | 9 | 6729 | """Base classes to manage a Client's interaction with a running kernel"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
import atexit
import errno
from threading import Thread
import time
import zmq
# import ZMQError in to... | mit |
Diapolo/bitcoin | qa/rpc-tests/disablewallet.py | 102 | 1820 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise API with -disablewallet.
#
from test_framework.test_framework import BitcoinTestFramework
f... | mit |
poppogbr/genropy | legacy_packages/dev/main.py | 1 | 1554 | #!/usr/bin/env python
# encoding: utf-8
import sys
import os
class Package(object):
def config_attributes(self):
return dict(comment='dev package',
name_short='dev', name_long='dev', name_full='dev')
def config_db(self, pkg):
#developer table
t = pkg.table('de... | lgpl-2.1 |
kirca/odoo | openerp/tools/misc.py | 9 | 42537 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
chachan/nodeshot | nodeshot/interop/sync/synchronizers/openwisp.py | 5 | 1809 | from __future__ import absolute_import
from django.contrib.gis.geos import Point
from .base import XMLParserMixin, GenericGisSynchronizer
class OpenWisp(XMLParserMixin, GenericGisSynchronizer):
""" OpenWisp GeoRSS synchronizer class """
def parse(self):
""" parse data """
super(OpenWisp, sel... | gpl-3.0 |
songmonit/CTTMSONLINE_V8 | addons/hr/__openerp__.py | 260 | 2372 | # -*- 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 |
wndhydrnt/airflow | airflow/example_dags/example_http_operator.py | 3 | 2871 | # -*- 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 |
felixfontein/ansible | test/support/integration/plugins/modules/postgresql_db.py | 53 | 23381 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
... | gpl-3.0 |
titasakgm/brc-stock | openerp/addons/note_pad/note_pad.py | 441 | 1301 | # -*- 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 |
makermade/arm_android-19_arm-linux-androideabi-4.8 | lib/python2.7/mailbox.py | 64 | 80751 | #! /usr/bin/env python
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method. See functions _sync_flush() and
# _sync_close().
import sys
im... | gpl-2.0 |
DirkWilhelmi/mikro_tms | rpi_functions.py | 1 | 1501 | import ConfigParser
from r515.basic_functions import BasicFunctions
from r515.basic_settings import BasicSettings
from r515.connection import Connection
config = ConfigParser.ConfigParser()
config.read(['r515.cfg'])
conn = Connection(config.get('Connection', 'IP'), config.get('Connection', 'USR'), config.get('Connect... | gpl-2.0 |
skoslowski/gnuradio | gr-blocks/python/blocks/qa_logger.py | 4 | 3225 | #!/usr/bin/env python
#
# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, blocks
class test_logger (gr_unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | gpl-3.0 |
mfherbst/spack | var/spack/repos/builtin.mock/packages/othervirtual/package.py | 5 | 1509 | ##############################################################################
# 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 |
dr4g0nsr/phoenix-kodi-addon | plugin.video.phstreams/resources/lib/sources/muchmoviesv2_mv_tv.py | 7 | 7118 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
raybuhr/grab | test/spider_stat.py | 12 | 1676 | import six
from grab.spider import Spider, Task
from tempfile import mkstemp
import os
from six import StringIO
import mock
import sys
from test.util import TMP_DIR
from test.util import BaseGrabTestCase, build_spider
class BasicSpiderTestCase(BaseGrabTestCase):
def setUp(self):
self.server.reset()
... | mit |
bretlowery/snakr | lib/django/contrib/flatpages/views.py | 475 | 2777 | from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader
from django.uti... | bsd-3-clause |
newswangerd/ansible | test/units/module_utils/test_distro.py | 35 | 1512 |
# (c) 2018 Adrian Likins <alikins@redhat.com>
# Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# or
# Apache License v2.0 (see http://www.apache.org/licenses/LICENSE-2.0)
#
# Dual licensed so any test cases could potentially be included ... | gpl-3.0 |
nozuono/calibre-webserver | src/calibre/ebooks/rtf2xml/group_styles.py | 24 | 8744 | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | gpl-3.0 |
gaddman/ansible | lib/ansible/modules/cloud/cloudstack/cs_securitygroup.py | 78 | 5313 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# 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 |
ThiagoGarciaAlves/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/patcomp.py | 304 | 7091 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Pattern compiler.
The grammer is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
__author__ = "Guido van Rossum <guido@python.org>"
# Python imports
import os
imp... | apache-2.0 |
cz-maria/Pawel_the_Mage | wrogowie.py | 1 | 3434 | import pygame
import stale
class Enemy(pygame.sprite.Sprite):
walking_frames_l = []
walking_frames_r = []
def __init__(self):
super().__init__()
image = pygame.image.load("knight.png").convert()
image.set_colorkey(stale.WHITE)
self.walking_frames_l.append(image)
... | mit |
holygits/incubator-airflow | tests/contrib/hooks/test_zendesk_hook.py | 37 | 3566 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
AmeristralianDollar/AmeristralianDollar | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
pde/tosback2 | web-frontend/beautifulsoup4/bs4/builder/_htmlparser.py | 9 | 7507 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import HTMLParser
import sys
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to set to False. Unfortunately,
# http://bugs.python.... | gpl-2.0 |
I-prefer-the-front-end/I-prefer-the-front-end | iptfe/blog/views.py | 1 | 1283 | from django.shortcuts import render
from django.http import HttpResponse
from blog.models import Post, Comment
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
def archive(request):
all_posts = Post.objects.all();
context = {}
context['posts'] = all_p... | mit |
jeromeetienne/neoip | libxml2-2.6.27/python/tests/ctxterror.py | 87 | 1318 | #!/usr/bin/python -u
#
# This test exercise the redirection of error messages with a
# functions defined in Python.
#
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
expect="""--> (3) xmlns: URI foo is not absolute
--> (4) Opening and ending tag mismatch: x line 0 and y
"""
err=""
def callba... | gpl-3.0 |
l0b0/tilde | .config/calibre/global.py | 1 | 3641 | # calibre wide preferences
### Begin group: DEFAULT
# database path
# Path to the database in which books are stored
database_path = '/home/username/library1.db'
# filename pattern
# Pattern to guess metadata from filenames
filename_pattern = u'(?P<title>.+) - (?P<author>[^_]+)'
# isbndb com key
# Access key for... | gpl-3.0 |
philippze/django-cms | menus/templatetags/menu_tags.py | 35 | 14631 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from classytags.arguments import IntegerArgument, Argument, StringArgument
from classytags.core import Options
from classytags.helpers import InclusionTag
from cms.utils.i18n import force_language, get_language_objects
from django import template
from djang... | bsd-3-clause |
home-assistant/home-assistant | homeassistant/components/skybell/camera.py | 27 | 2818 | """Camera support for the Skybell HD Doorbell."""
from datetime import timedelta
import logging
import requests
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
f... | apache-2.0 |
chdecultot/erpnext | erpnext/erpnext_integrations/utils.py | 5 | 1165 | import frappe
from frappe import _
import base64, hashlib, hmac
from six.moves.urllib.parse import urlparse
def validate_webhooks_request(doctype, hmac_key, secret_key='secret'):
def innerfn(fn):
settings = frappe.get_doc(doctype)
if frappe.request and settings and settings.get(secret_key) and not frappe.flags.... | gpl-3.0 |
jdahlin/stoq-wubi | src/bittorrent/Uploader.py | 12 | 8059 | # Written by Bram Cohen
# see LICENSE.txt for license information
from CurrentRateMeasure import Measure
class Upload:
def __init__(self, connection, choker, storage,
max_slice_length, max_rate_period, fudge):
self.connection = connection
self.choker = choker
self.storage = st... | gpl-2.0 |
reinout/django | django/core/files/temp.py | 28 | 2501 | """
The temp module provides a NamedTemporaryFile that can be reopened in the same
process on any platform. Most platforms use the standard Python
tempfile.NamedTemporaryFile class, but Windows users are given a custom class.
This is needed because the Python implementation of NamedTemporaryFile uses the
O_TEMPORARY f... | bsd-3-clause |
kennethlove/django | tests/regressiontests/inline_formsets/tests.py | 6 | 6162 | from __future__ import absolute_import, unicode_literals
from django.forms.models import inlineformset_factory
from django.test import TestCase
from .models import Poet, Poem, School, Parent, Child
class DeletionTests(TestCase):
def test_deletion(self):
PoemFormSet = inlineformset_factory(Poet, Poem, c... | bsd-3-clause |
rouge8/pip | tests/functional/test_download.py | 1 | 21568 | import os.path
import shutil
import textwrap
import pytest
from pip._internal.cli.status_codes import ERROR
from tests.lib.path import Path
def fake_wheel(data, wheel_path):
shutil.copy(
data.packages.joinpath('simple.dist-0.1-py2.py3-none-any.whl'),
data.packages.joinpath(wheel_path),
)
@... | mit |
TensorVision/MediSeg | eval.py | 1 | 3028 | """Evaluation of the Model.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import math
import time
import tensorflow.python.platform
from tensorflow.python.platform import gfile
import numpy as np
import tensorflow as tf... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.