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 |
|---|---|---|---|---|---|
omarkhan/ansible-modules-core | packaging/os/apt_repository.py | 93 | 17068 | #!/usr/bin/python
# encoding: utf-8
# (c) 2012, Matt Wright <matt@nobien.net>
# (c) 2013, Alexander Saltanov <asd@mokote.com>
# (c) 2014, Rutger Spiertz <rutger@kumina.nl>
#
# 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... | gpl-3.0 |
azet/capirca | tools/ldpush/fake_ssh_connection.py | 7 | 2426 | #!/usr/bin/python
#
# Copyright 2013 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 a... | apache-2.0 |
gsarma/PyOpenWorm | tests/EvidenceQualityTest.py | 1 | 2772 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .DataTestTemplate import _DataTest
import PyOpenWorm
from PyOpenWorm.evidence import Evidence
from PyOpenWorm.document import Document
from PyOpenWorm.website import Website
from PyOpenWorm.context import Context
from six.moves.urllib.parse import url... | mit |
DarthMaulware/EquationGroupLeaks | Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/EXPLOITS/ELCA/fosho/requests/packages/urllib3/request.py | 2 | 2191 | # urllib3/request.py
##
##
##
##
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
''''''
_encode_url_methods = set(['DELETE', 'GET', 'HEAD', 'OPT... | unlicense |
puttarajubr/commcare-hq | custom/succeed/reports/patient_task_list.py | 1 | 14071 | from datetime import datetime
import logging
from django.core.urlresolvers import reverse
from django.utils import html
from django.utils.translation import ugettext as _, ugettext_noop
import json
from corehq.apps.api.es import ReportCaseES
from corehq.apps.cloudcare.api import get_cloudcare_app, get_cloudcare_form_... | bsd-3-clause |
JosephCastro/selenium | py/selenium/webdriver/__init__.py | 14 | 1608 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
nightjean/Deep-Learning | tensorflow/contrib/solvers/python/ops/lanczos.py | 80 | 9878 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ojengwa/odoo | doc/_extensions/odoo/switcher.py | 262 | 1500 | from docutils import nodes, utils
from docutils.parsers.rst import Directive
from pygments.lexers import get_lexer_by_name
def setup(app):
app.add_directive('switcher', SwitcherDirective)
app.add_directive('case', CaseDirective)
class SwitcherDirective(Directive):
has_content = True
def run(self):
... | agpl-3.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/software-center/softwarecenter/cmdfinder.py | 2 | 2531 | # Copyright (C) 2011 Canonical
#
# Authors:
# Matthew McGowan
# Michael Vogt
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 3.
#
# This program is distributed in the hope that it ... | gpl-3.0 |
meteogrid/OWSLib | owslib/swe/observation/waterml2.py | 5 | 5221 | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2014 Pete Taylor
#
# Authors : Pete Taylor <peterataylor@gmail.com>
#
# Contact email: peterataylor@gmail.com
# =============================================================================
from... | bsd-3-clause |
mahmoudShaheen/PyMedox | packages/arduino.py | 1 | 1286 | #!/usr/bin/env python
#################################
# @author: Mahmoud Shaheen #
# MedicalBox IOT Project #
# Arduino #
#################################
#functions for serial communication with Arduino
#called from controlHardware module
import serial
import data
import time
ser = se... | mit |
Greennut/ostproject | django/contrib/webdesign/templatetags/webdesign.py | 91 | 2167 | from django.contrib.webdesign.lorem_ipsum import words, paragraphs
from django import template
register = template.Library()
class LoremNode(template.Node):
def __init__(self, count, method, common):
self.count, self.method, self.common = count, method, common
def render(self, context):
try:
... | bsd-3-clause |
Ladeia/ProjectEuler | Problem145/Python/solution_1.py | 1 | 3513 | #!/usr/bin/env python3
#coding=utf-8
"""
How many reversible numbers are there below one-billion?
Problem 145
Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits.
For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so ... | mit |
szilveszter/django | tests/extra_regress/tests.py | 55 | 15018 | from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
self.u = User.objects.cr... | bsd-3-clause |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/pip/_vendor/packaging/markers.py | 324 | 8230 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pip._vendor.pyp... | mit |
flypy/pykit | pykit/ir/passes.py | 3 | 1349 | # -*- coding: utf-8 -*-
"""
Pass helpers.
"""
from __future__ import print_function, division, absolute_import
from pykit.ir import defs, combine
from pykit.ir.builder import OpBuilder, Builder
from pykit.utils import prefix as prefix_, mergedicts
class FunctionPass(object):
"""
Can be used from visitors or ... | bsd-3-clause |
hroncok/devassistant | test/test_snippet.py | 8 | 2063 | import os
import pytest
from devassistant import settings
from devassistant.loaded_yaml import LoadedYaml
from devassistant.snippet import Snippet
class TestSnippet(object):
@pytest.mark.parametrize(('yaml', 'expected'), [
({}, {}),
({'args': {}}, {}),
({'args': {'foo': 'bar'}}, {'foo': '... | gpl-2.0 |
a3qz/networked_platformer | editor/editor.py | 1 | 4284 | import random
import time
import data
import sprite
import sys
import pygame
import constants
import collectable
import client
import wall
from struct import *
import board
class Game:
def __init__(self, s):
self.objects = [] #start with a list of no objects
self.screen = s #get the screen surfac... | gpl-3.0 |
M4sse/chromium.src | tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py | 176 | 9706 | #!/usr/bin/env python
# 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.
"""Dromaeo benchmark automation script.
Script runs dromaeo tests in browsers specified by --browser switch and saves
results to a... | bsd-3-clause |
Kapeli/PopClip-Extensions | source/InstantTranslate/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
yaojingwu1992/XlsxWriter | xlsxwriter/test/comparison/test_header_image10.py | 8 | 1486 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
Dreae/PyCrest | docs/conf.py | 4 | 7522 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Distill Framework documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 10 11:21:12 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | mit |
onitake/ansible | lib/ansible/utils/module_docs_fragments/openswitch.py | 58 | 3815 | #
# (c) 2015, Peter Sprygada <psprygada@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
# (at your option) any late... | gpl-3.0 |
megaserg/pants | tests/python/pants_test/backend/core/tasks/test_mutex_task_mixin.py | 5 | 4378 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
fro... | apache-2.0 |
redhat-openstack/rally | rally/cli/commands/plugin.py | 10 | 4075 | # Copyright 2015: Mirantis 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 b... | apache-2.0 |
23andMe/ansible-modules-extras | network/a10/a10_service_group.py | 117 | 13447 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb service-group objects
(c) 2014, Mischa Peters <mpeters@a10networks.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 publishe... | gpl-3.0 |
cherokee/webserver | admin/CTK/CTK/Template.py | 5 | 2582 | # CTK: Cherokee Toolkit
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2009-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.... | gpl-2.0 |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/views/decorators/http.py | 63 | 5999 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators import decorato... | apache-2.0 |
dmlc/mxnet | example/reinforcement-learning/dqn/replay_memory.py | 9 | 12097 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
danieljaouen/ansible | lib/ansible/modules/cloud/google/gcspanner.py | 88 | 9807 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Google Inc.
# 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 |
rossepstein2013/groupme-liker | lib/jinja2/ext.py | 357 | 25072 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | apache-2.0 |
classmember/proof_of_concept | python/events/lib/python3.4/site-packages/pip/_internal/cli/autocompletion.py | 29 | 6083 | """Logic that powers autocompletion installed by ``pip completion``.
"""
import optparse
import os
import sys
from pip._internal.cli.main_parser import create_main_parser
from pip._internal.commands import commands_dict, get_summaries
from pip._internal.utils.misc import get_installed_distributions
def autocomplete... | mit |
drxaero/calibre | src/calibre/ebooks/pdf/render/engine.py | 10 | 14304 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
zacps/zulip | tools/lib/test_script.py | 5 | 2256 | from __future__ import absolute_import
from __future__ import print_function
from typing import Tuple
import os
from version import PROVISION_VERSION
def get_major_version(v):
# type: (str) -> int
return int(v.split('.')[0])
def get_version_file():
# type: () -> str
return 'var/provision_version'
P... | apache-2.0 |
bwhite/hadoopy | examples/l4-vision-and-image-processing-with-hadoop/ex0-face-finder/face_finder.py | 1 | 3141 | #!/usr/bin/env python
# (C) Copyright 2011 Brandyn A. White
#
# 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 distrib... | gpl-3.0 |
sachingupta006/Mezzanine | mezzanine/generic/migrations/0006_move_keywords.py | 12 | 10241 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor
from django.contrib.sites.models import Site
class Migrat... | bsd-2-clause |
sarvex/depot-tools | third_party/logilab/common/urllib2ext.py | 92 | 3416 | from __future__ import print_function
import logging
import urllib2
import kerberos as krb
class GssapiAuthError(Exception):
"""raised on error during authentication process"""
import re
RGX = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
def get_negociate_value(headers):
for authreq in headers.geth... | bsd-3-clause |
MattsFleaMarket/python-for-android | python-build/python-libs/gdata/build/lib/atom/__init__.py | 136 | 49199 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | apache-2.0 |
ClearwaterCore/gmock-upstream | gtest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
xq262144/hue | desktop/core/ext-py/Django-1.6.10/tests/validation/test_error_messages.py | 108 | 3896 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import six
from django.utils.unittest import TestCase
class ValidationMessagesTest(TestCase):
def _test_validation_messages(self, field, value, expe... | apache-2.0 |
valtech-mooc/edx-platform | cms/lib/xblock/test/test_runtime.py | 25 | 2194 | """
Tests of edX Studio runtime functionality
"""
from urlparse import urlparse
from mock import Mock
from unittest import TestCase
from cms.lib.xblock.runtime import handler_url
class TestHandlerUrl(TestCase):
"""Test the LMS handler_url"""
def setUp(self):
self.block = Mock()
def test_trailin... | agpl-3.0 |
klmitch/nova | nova/tests/unit/compute/test_instance_list.py | 3 | 16596 | # 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
# d... | apache-2.0 |
ctools/ctools | cscripts/csphagen.py | 1 | 44281 | #! /usr/bin/env python
# ==========================================================================
# Computes the PHA spectra for source/background and ARF/RMF files using the
# reflected region method
#
# Copyright (C) 2017-2021 Luigi Tibaldo
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
uclouvain/osis | base/tests/views/test_learning_unit_proposal.py | 1 | 55572 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
andmos/ansible | lib/ansible/modules/cloud/vmware/vmware_vm_vm_drs_rule.py | 55 | 12538 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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... | gpl-3.0 |
christianwengert/mailclient | src/bin/__init__.py | 1 | 2230 | # coding=utf-8
import subprocess
from imapclient import IMAPClient
HOST = 'mail.netzone.ch'
USERNAME = 'christian@wengert.ch'
PASSWORD = subprocess.check_output(["/usr/local/bin/pass", "mail/christian@wengert.ch"])
PASSWORD = PASSWORD.split()[0].decode('utf8')
KEYMAPPING = {}
ssl = True
class Signature():
pa... | bsd-3-clause |
edx-solutions/edx-platform | openedx/features/course_experience/plugins.py | 4 | 2843 | """
Platform plugins to support the course experience.
This includes any locally defined CourseTools.
"""
from django.urls import reverse
from django.utils.translation import ugettext as _
from lms.djangoapps.courseware.courses import get_course_by_id
from student.models import CourseEnrollment
from . import SHOW_... | agpl-3.0 |
calvinchengx/O-Kay-Blog-wih-Kay-0.10.0 | kay/cache/middleware.py | 10 | 2123 | # -*- coding: utf-8 -*-
"""
Middleware for cache.
:Copyright: (c) 2009 Takashi Matsuo <tmatsuo@candit.jp> All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import logging
from google.appengine.api import memcache
from kay.conf import settings
import kay.cache
def get_key(url, lang):
return "... | bsd-3-clause |
ningirsu/stepmania-server | smserver/controllers/routes.py | 1 | 1366 | """ Routes files """
from smserver.smutils.smpacket import smcommand
from smserver.controllers import legacy
ROUTES = {
# Legacy controller for compatibility with Stepmania 5.X
smcommand.SMClientCommand.NSCPingR: legacy.ping_response.PINGRController,
smcommand.SMClientCommand.NSCHello: legacy.hello.Hello... | mit |
stefan-andritoiu/upm | examples/python/mb704x.py | 6 | 1976 | #!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016 Intel Corporation.
#
# 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
# witho... | mit |
ThomasMcVay/MediaApp | MediaAppKnobs/KnobElements/RectButton.py | 1 | 1663 | #===============================================================================
# @Author: Madison Aster
# @ModuleDescription:
# @License:
# MediaApp Library - Python Package framework for developing robust Media
# Applications with Qt Library
# Copyright (C) 2013 Madison Aster
# ... | lgpl-2.1 |
rutgers-apl/Atomicity-Violation-Detector | tdebug-llvm/llvm/utils/DSAclean.py | 147 | 1187 | #! /usr/bin/python
#changelog:
#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove
#nodes such as %tmp.1.i and %tmp._i.3
#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just
#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spell... | gpl-2.0 |
roubert/python-phonenumbers | python/phonenumbers/timezone.py | 5 | 5470 | """Phone number to time zone mapping functionality
>>> import phonenumbers
>>> from phonenumbers.timezone import time_zones_for_number
>>> ro_number = phonenumbers.parse("+40721234567", "RO")
>>> tzlist = time_zones_for_number(ro_number)
>>> len(tzlist)
1
>>> str(tzlist[0])
'Europe/Bucharest'
>>> mx_number = phonenumb... | apache-2.0 |
lvapeab/nmt-keras | tests/NMT_architectures/unidir_deep_GRU_ConditionalLSTM.py | 1 | 3021 | import argparse
import os
import pytest
from tests.test_config import load_tests_params, clean_dirs
from data_engine.prepare_data import build_dataset
from nmt_keras.training import train_model
from nmt_keras.apply_model import sample_ensemble, score_corpus
def test_NMT_Unidir_deep_GRU_ConditionalLSTM():
params =... | mit |
ray-project/ray | rllib/agents/impala/vtrace_tf.py | 3 | 17057 | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
0011/Unblock-Youku | test/run-all-tests.py | 12 | 3293 | #!/usr/bin/env python
"""
Allow you smoothly surf on many websites blocking non-mainland visitors.
Copyright (C) 2012 - 2014 Bo Zhu http://zhuzhu.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by t... | agpl-3.0 |
strands-project/strands_qsr_lib | qsr_prob_rep/src/qsrrep_hmms/rcc3_hmm.py | 8 | 1322 | # -*- coding: utf-8 -*-
from qsrrep_hmms.hmm_abstractclass import HMMAbstractclass
class RCC3HMM(HMMAbstractclass):
_state_list = ["dc", "po", "o"]
def __init__(self):
super(self.__class__, self).__init__()
self.num_possible_states = 3
def _qsr_to_symbol(self, qsr_data):
"""Tran... | mit |
nistormihai/superdesk-core | tests/io/update_ingest_tests.py | 8 | 3180 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from ... | agpl-3.0 |
hastexo/edx-platform | openedx/core/djangoapps/ace_common/template_context.py | 5 | 1202 | """
Context dictionary for templates that use the ace_common base template.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings
def get_base_template_c... | agpl-3.0 |
RobotGame/rgkit | rgkit/settings.py | 3 | 1197 | class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
class Settings(AttrDict):
def __init__(self, *args, **kwargs):
super(Settings, self).__init__(*args, **kwargs)
def init_map(self, map_data):
self... | unlicense |
MoonshineSG/OctoPrint | src/octoprint/plugins/softwareupdate/updaters/update_script.py | 7 | 3592 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
im... | agpl-3.0 |
mcollins12321/anita | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py | 2919 | 3678 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
Dhivyap/ansible | lib/ansible/modules/cloud/amazon/ecs_service.py | 8 | 30831 | #!/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 distributed... | gpl-3.0 |
yestech/gae-django-template | django/core/management/commands/reset.py | 229 | 2598 | from optparse import make_option
from django.conf import settings
from django.core.management.base import AppCommand, CommandError
from django.core.management.color import no_style
from django.core.management.sql import sql_reset
from django.db import connections, transaction, DEFAULT_DB_ALIAS
class Command(AppComman... | bsd-3-clause |
shrimpboyho/git.js | emscript/emscripten/1.5.6/tools/autodebugger.py | 12 | 11391 | '''
Processes an LLVM assembly (.ll) file, adding debugging information.
You can then run the .ll file in the LLVM interpreter (lli) and
compare that to the output when compiled using emscripten.
Warning: You probably want to compile with SKIP_STACK_IN_SMALL=0! Otherwise
there may be weird errors.
'''
impo... | gpl-2.0 |
CottageLabs/portality | portality/default_models.py | 3 | 20330 |
from datetime import datetime
from portality.core import app
from portality.dao import DomainObject as DomainObject
'''
Define models in here. They should all inherit from the DomainObject.
Look in the dao.py to learn more about the default methods available to the Domain Object.
When using portality in your own fl... | mit |
kozmikkick/KozmiKKerneL-KitKat | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
kontron/python-ipmi | pyipmi/sensor.py | 1 | 7640 | # cOPYRIGht (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is... | lgpl-2.1 |
mezz64/home-assistant | homeassistant/util/ruamel_yaml.py | 10 | 4816 | """ruamel.yaml utility functions."""
from collections import OrderedDict
import logging
import os
from os import O_CREAT, O_TRUNC, O_WRONLY, stat_result
from typing import Dict, List, Optional, Union
import ruamel.yaml
from ruamel.yaml import YAML # type: ignore
from ruamel.yaml.compat import StringIO
from ruamel.yam... | apache-2.0 |
hplustree/trove | trove/tests/unittests/guestagent/test_couchbase_manager.py | 3 | 6377 | # Copyright 2012 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 l... | apache-2.0 |
ygol/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
henrytao-me/openerp.positionq | openerp/addons/point_of_sale/wizard/pos_sales_user.py | 55 | 2240 | # -*- 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 |
henriquegemignani/randovania | randovania/gui/tracker_window.py | 1 | 32424 | import collections
import functools
import json
import typing
from pathlib import Path
from random import Random
from typing import Optional, Dict, Set, List, Tuple, Iterator, Union
import matplotlib.pyplot as plt
import networkx
from PySide2 import QtWidgets
from PySide2.QtCore import Qt
from PySide2.QtWidgets import... | gpl-3.0 |
Tejal011089/medsyn2_lib | webnotes/model/create_new.py | 34 | 1724 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Create a new document with defaults set
"""
import webnotes
from webnotes.utils import nowdate, nowtime, cint, flt
import webnotes.defaults
def get_new_doc(doctype, paren... | mit |
crosswalk-project/crosswalk-android-extensions | build/idl-generator/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py | 51 | 2378 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
tkw1536/GitManager | tests/commands/test_state.py | 1 | 4328 | import unittest
import unittest.mock
from GitManager.commands import state
from GitManager.repo import description
from GitManager.utils import format
from GitManager.repo import implementation
class TestState(unittest.TestCase):
""" Tests that the state command works properly """
@unittest.mock.patch(
... | mit |
sourcepole/kadas-albireo | python/ext-libs/pytz/tzinfo.py | 95 | 19212 | '''Base classes and helpers for building zone specific tzinfo classes'''
from datetime import datetime, timedelta, tzinfo
from bisect import bisect_right
try:
set
except NameError:
from sets import Set as set
import pytz
from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
__all__ = []
_time... | gpl-2.0 |
vmindru/ansible | lib/ansible/modules/network/onyx/onyx_interface.py | 9 | 17101 | #!/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 |
tejoesperanto/pasportaservo | hosting/migrations/0048_profile_gender_pronoun.py | 3 | 6310 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-04-10 13:25
from __future__ import unicode_literals
from django.db import migrations, models, connection
from django.core.management.color import no_style
import hosting.fields
def populate_genders(app_registry, schema_editor):
Gender = app_registry.ge... | agpl-3.0 |
moijes12/oh-mainline | vendor/packages/kombu/kombu/transport/django/migrations/0001_initial.py | 39 | 2435 | # encoding: utf-8
from __future__ import absolute_import
# flake8: noqa
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Queue'
db.create_table('djkombu_queue', (
... | agpl-3.0 |
vkmguy/Flights-and-Hotels | database/hotelDB.py | 2 | 1448 | from utility import DBConnectivity
from classes.hotel_detail import Hotel
def get_hotels(location):
try:
con=DBConnectivity.create_connection()
cur=DBConnectivity.create_cursor(con)
list_of_hotels=[]
cur.execute("select hotelid, hotelname, location, efare, dfare from hotel where loca... | epl-1.0 |
cewood/ansible | lib/ansible/plugins/action/script.py | 67 | 4108 | # (c) 2012, 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 |
muffinresearch/amo-validator | validator/testcases/javascript/actions.py | 1 | 39965 | from copy import deepcopy
from functools import partial
import sys
import types
# Global import of predefinedentities will cause an import loop
import instanceactions
from validator.constants import (BUGZILLA_BUG, DESCRIPTION_TYPES, FENNEC_GUID,
FIREFOX_GUID, MAX_STR_SIZE)
from validat... | bsd-3-clause |
michaelpacer/networkx | networkx/algorithms/connectivity/utils.py | 24 | 3304 | # -*- coding: utf-8 -*-
"""
Utilities for connectivity package
"""
import networkx as nx
__author__ = '\n'.join(['Jordi Torrents <jtorrents@milnou.net>'])
__all__ = ['build_auxiliary_node_connectivity',
'build_auxiliary_edge_connectivity']
def build_auxiliary_node_connectivity(G):
r"""Creates a direc... | bsd-3-clause |
gmoothart/validictory | validictory/validator.py | 4 | 24170 | import re
import sys
import copy
import socket
from datetime import datetime
from decimal import Decimal
from collections import Mapping, Container
if sys.version_info[0] == 3:
_str_type = str
_int_types = (int,)
else:
_str_type = basestring
_int_types = (int, long)
class SchemaError(ValueError):
... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/directpy11/Samples/SampleLights.py | 2 | 2818 |
"""This sample demonstrates some very simple lightning effects."""
import math
import d3d11
import d3d11x
from d3d11c import *
def heightCallback(x, z, byteIndex, data):
return data[byteIndex] * 0.03
class SampleLights(d3d11x.Frame):
def onCreate(self):
#Heightmap.
#self.heightmap = d3d11x.... | gpl-3.0 |
abioyeayo/proj-ardu-pilot | ardupilot/libraries/AP_InertialSensor/examples/coning.py | 241 | 10508 | #!/usr/bin/python
from math import *
from pymavlink.rotmat import Vector3, Matrix3
from numpy import linspace
from visual import *
class Quat:
def __init__(self,w=1.0,x=0.0,y=0.0,z=0.0):
self.w = w
self.x = x
self.y = y
self.z = z
def to_euler(self):
roll = (atan2(2.0*... | gpl-3.0 |
Cosiroc/bleau-database | Triangulation/MathFunctions.py | 2 | 1561 | ####################################################################################################
#
# Bleau Database - A database of the bouldering area of Fontainebleau
# Copyright (C) Salvaire Fabrice 2016
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | agpl-3.0 |
sam-m888/gramps | gramps/gen/filters/rules/family/_hascitation.py | 5 | 1914 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | gpl-2.0 |
gplssm/europepstrans | europepstrans/results/__init__.py | 1 | 13654 | """
TimeFrameResults steals methods from oemof.outputlib adapted to the structure
applied here. Most relevant difference is results data stored in self.data
"""
from oemof.outputlib import DataFramePlot, ResultsDataFrame
import pickle
from matplotlib import pyplot as plt
import logging
import pandas as pd
class Ti... | gpl-3.0 |
yamahata/linux-umem | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
alimony/django | tests/admin_inlines/models.py | 25 | 6614 | """
Testing of admin inline formsets.
"""
import random
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
retur... | bsd-3-clause |
dyyi/moneybook | venv/Lib/site-packages/django/core/paginator.py | 347 | 5031 | import collections
from math import ceil
from django.utils import six
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0,
allow_empty_first... | apache-2.0 |
geodrinx/gearthview | ext-libs/twisted/web/vhost.py | 68 | 4372 | # -*- test-case-name: twisted.web.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
I am a virtual hosts implementation.
"""
# Twisted Imports
from twisted.python import roots
from twisted.web import resource
class VirtualHostCollection(roots.Homogenous):
"""Wrapper for virtual hosts ... | gpl-3.0 |
imsparsh/python-for-android | python3-alpha/python3-src/Lib/test/test_urlparse.py | 46 | 40151 | #! /usr/bin/env python3
from test import support
import unittest
import urllib.parse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
RFC3986_BASE = 'http://a/b/c/d;p?q'
SIMPLE_BASE = 'http://a/b/c/d'
# A list of test cases. Each test case is a a two-tuple that contains
# a string with the... | apache-2.0 |
scrollback/kuma | vendor/packages/nose/nose/loader.py | 14 | 25489 | """
Test Loader
-----------
nose's test loader implements the same basic functionality as its
superclass, unittest.TestLoader, but extends it by more liberal
interpretations of what may be a test and how a test may be named.
"""
from __future__ import generators
import logging
import os
import sys
import unittest
imp... | mpl-2.0 |
gjvis/splinter | tests/base.py | 6 | 7889 | # -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from .async_finder import AsyncFinderTests
from .click_elements import ClickElementsTest
from .cookies import CookiesTest
from .element_... | bsd-3-clause |
njantrania/osf.io | website/addons/base/views.py | 2 | 20027 | import os
import uuid
import httplib
import datetime
import jwe
import jwt
import furl
from flask import request
from flask import redirect
from flask import make_response
from modularodm.exceptions import NoResultsFound
from framework import sentry
from framework.auth import cas
from framework.auth import Auth
from ... | apache-2.0 |
boundlessgeo/QGIS | tests/src/python/test_qgssinglesymbolrenderer.py | 17 | 3133 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgssinglesymbolrenderer.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
*****... | gpl-2.0 |
cloudera/hue | desktop/core/ext-py/phoenixdb-1.1.0.dev0/setup.py | 3 | 3121 | #
# 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.