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 |
|---|---|---|---|---|---|
vmax-feihu/hue | desktop/core/ext-py/Django-1.6.10/tests/m2m_through/tests.py | 117 | 12908 | from __future__ import absolute_import
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (Person, Group, Membership, CustomMembership,
PersonSelfRefM2M, Friendship)
class M2mThroughTests(TestCase):
def setUp(self):
self.bob = Person.o... | apache-2.0 |
pellaeon/bsd-cloudinit | cloudbaseinit/plugins/windows/extendvolumes.py | 4 | 6289 | # Copyright (c) 2013 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
pkruskal/scikit-learn | examples/cluster/plot_agglomerative_clustering_metrics.py | 402 | 4492 | """
Agglomerative clustering with different metrics
===============================================
Demonstrates the effect of different metrics on the hierarchical clustering.
The example is engineered to show the effect of the choice of different
metrics. It is applied to waveforms, which can be seen as
high-dimens... | bsd-3-clause |
kenwang815/KodiPlugins | script.module.youtube.dl/lib/youtube_dl/extractor/dfb.py | 87 | 2255 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class DFBIE(InfoExtractor):
IE_NAME = 'tv.dfb.de'
_VALID_URL = r'https?://tv\.dfb\.de/video/(?P<display_id>[^/]+)/(?P<id>\d+)'
_TEST = {
'url': 'http://tv.dfb.de/video/u-19-em... | gpl-2.0 |
jordan8037310/CouchPotatoServer | couchpotato/core/_base/updater/main.py | 11 | 15026 | import json
import os
import shutil
import tarfile
import time
import traceback
import zipfile
from datetime import datetime
from threading import RLock
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import sp
from co... | gpl-3.0 |
kelvinwong-ca/django-likert-field | test_projects/django14/django14/wsgi.py | 2 | 1138 | """
WSGI config for django14 project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | bsd-3-clause |
jamslevy/gsoc | app/python25src/urllib.py | 3 | 11085 | """Open an arbitrary URL.
See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols... | apache-2.0 |
jdemon519/cfme_tests | scripts/fetch_jenkins_artifacts.py | 6 | 1060 | #!/usr/bin/env python2
"""Collect artifacts after jenkins run
"""
import argparse
import sys
from utils.conf import credentials
from utils.ssh import SSHClient
def main():
parser = argparse.ArgumentParser(epilog=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('addr... | gpl-2.0 |
FlipperPA/wagtail | wagtail/tests/testapp/migrations/0046_personpage.py | 13 | 2924 | # Generated by Django 2.2.6 on 2020-01-07 14:24
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail.search.index
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0042_index_on_pager... | bsd-3-clause |
40223131/2015cda_g20519 | static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py | 739 | 71473 | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | gpl-3.0 |
mach0/QGIS | tests/src/python/test_qgspointcloudattributecombobox.py | 23 | 4327 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPointCloudAttributeComboBox
.. note:: 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 ... | gpl-2.0 |
sparkslabs/kamaelia | Code/Python/Kamaelia/Examples/Contrib/Kamaelia.Apps.SA/DataSink.py | 6 | 1244 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Vers... | apache-2.0 |
aileron-split/aileron-web | server/blog/models.py | 1 | 1104 | from django.db import models
# Blog app models.
class Post(models.Model):
published = models.BooleanField(default=False)
published_date = models.DateTimeField(null=True, blank=True)
slug = models.SlugField(max_length=80)
title = models.CharField(max_length=80, default='Post Title')
subtitle = mode... | gpl-3.0 |
BrendanLeber/adventofcode | 2019/09-sensor_boost/intcode.py | 1 | 7073 | # -*- coding: utf-8 -*-
import pdb
import sys
import traceback
from collections import deque
from enum import IntEnum
from typing import Deque, Dict, List, NamedTuple, Optional, Tuple, Union
class ParameterMode(IntEnum):
POSITIONAL = 0
IMMEDIATE = 1
RELATIVE = 2
class ParameterType(IntEnum):
READ =... | mit |
pasiegel/SickGear | lib/guessit/__init__.py | 13 | 9163 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free... | gpl-3.0 |
maxamillion/openshift-ansible | roles/lib_openshift/library/oc_configmap.py | 18 | 57633 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
perfsonar/pscheduler | pscheduler-server/pscheduler-server/api-server/pschedulerapiserver/args.py | 2 | 2482 | #
# Argument-Related Functions
#
import pscheduler
import uuid
from flask import request
def arg_boolean(name):
"""Determine if a boolean argument is part of a request. The
argument is considered true if it is 'true', 'yes' or '1' or if it
is present but has no value. Otherwise it is considered False.... | apache-2.0 |
jeffery9/mixprint_addons | mail/tests/__init__.py | 5 | 1238 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/ubiquity/ubiquity/i18n.py | 1 | 12630 | # -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright (C) 2006, 2007, 2008 Canonical Ltd.
# Written by Colin Watson <cjwatson@ubuntu.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | gpl-3.0 |
manolama/dd-agent | checks.d/consul.py | 10 | 20576 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict
from datetime import datetime, timedelta
from itertools import islice
from math import ceil, floor, sqrt
from urlparse import urljoin
# project
from checks import Agen... | bsd-3-clause |
balloob/home-assistant | homeassistant/components/wink/water_heater.py | 16 | 4115 | """Support for Wink water heaters."""
import logging
import pywink
from homeassistant.components.water_heater import (
ATTR_TEMPERATURE,
STATE_ECO,
STATE_ELECTRIC,
STATE_GAS,
STATE_HEAT_PUMP,
STATE_HIGH_DEMAND,
STATE_PERFORMANCE,
SUPPORT_AWAY_MODE,
SUPPORT_OPERATION_MODE,
SUPPO... | apache-2.0 |
JamesMGreene/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py | 124 | 5952 | # 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 th... | bsd-3-clause |
atvcaptain/enigma2 | lib/python/Plugins/SystemPlugins/VideoClippingSetup/plugin.py | 34 | 5782 | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry
config.plugins.VideoClippingSetup = ConfigSubsection()
config.plugins.VideoClippingSetup.clip_left = ConfigInteger(default = 0)
co... | gpl-2.0 |
fvant/ansible-modules-core | windows/win_ping.py | 208 | 1376 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
#
# 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 ... | gpl-3.0 |
wsmith323/django | django/contrib/sites/models.py | 316 | 3743 | from __future__ import unicode_literals
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.http.request import split_domain_port
from django.utils.encoding import python_2_unicode_com... | bsd-3-clause |
dariemp/odoo | addons/crm_claim/__init__.py | 390 | 1078 | # -*- 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 |
AutorestCI/azure-sdk-for-python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/sql_sink.py | 2 | 3853 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
JamesMGreene/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/port_testcase.py | 115 | 28371 | # 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 f... | bsd-3-clause |
antont/tundra | src/Application/PythonScriptModule/pymodules_old/simiangrid/auth.py | 1 | 2238 | #httplib was ok and httplib2 especially had nice api, but they don't work thru proxies and stuff
#-- curl is the most robust thing
#import httplib
import curl #a high level wrapper over pycurl bindings
import json
import hashlib #only 'cause has a hardcoded pwd here now - for real this comes from connection or launcher... | apache-2.0 |
AirChen/PythonPractic | PythonNetCode/chapter4/4_6_checking_webpage_with_HEAD_request.py | 2 | 1355 | #!/usr/bin/env python
# Python Network Programming Cookbook -- Chapter - 4
# This program is optimized for Python 2.7.
# It may run on any other version with/without modifications.
import argparse
import httplib
import urlparse
import re
import urllib
DEFAULT_URL = 'http://www.python.org'
HTTP_GOOD_CODES = [httplib.... | mit |
citrix-openstack-build/keystone | keystone/middleware/ec2_token.py | 3 | 3146 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
MarkusHackspacher/PythonFarmGame | farmlib/expbar.py | 1 | 2110 | '''
Created on 31-05-2012
@author: orneo1212
'''
import pygame
from pygameui import Label
class ExpBar(Label):
"""ExpBar class
"""
def __init__(self, player):
self.player = player
self.oldexp = -1.0
Label.__init__(self, "", (9, 58))
def update_text(self):
"""update t... | gpl-3.0 |
thinkopensolutions/hr | hr_worked_days_from_timesheet/tests/test_worked_days_from_timesheet.py | 7 | 5350 | # -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia <https://opensynergy-indonesia.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class TestComputeWorkdays(TransactionCase):
def setUp(self):
super(TestComputeWorkdays, self).s... | agpl-3.0 |
openzim/zimfarm | dispatcher/backend/src/tests/integration/routes/users/test_auth.py | 1 | 4647 | import os
import base64
import pathlib
import datetime
import tempfile
import subprocess
import pytest
OPENSSL_BIN = os.getenv("OPENSSL_BIN", "openssl")
class TestAuthentication:
def do_test_token(self, client, token):
headers = {"Authorization": token, "Content-Type": "application/json"}
respon... | gpl-3.0 |
rcarrillocruz/ansible | lib/ansible/utils/module_docs_fragments/purestorage.py | 71 | 1297 | #
# (c) 2017, Simon Dodsley <simon@purestorage.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 |
simpeg/simpeg | SimPEG/EM/Static/IP/Run.py | 1 | 2114 | import numpy as np
from SimPEG import (Maps, DataMisfit, Regularization,
Optimization, Inversion, InvProblem, Directives)
def run_inversion(
m0, survey, actind, mesh,
std, eps,
maxIter=15, beta0_ratio=1e0,
coolingFactor=5, coolingRate=2,
upper=np.inf, lower=-np.inf,
use_sen... | mit |
themrmax/scikit-learn | sklearn/ensemble/tests/test_weight_boosting.py | 28 | 18031 | """Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal, assert_true, assert_greater
from sklearn.utils.testing impo... | bsd-3-clause |
ghwatson/SpanishAcquisitionIQC | spacq/interface/pulse/tests/test_parser.py | 2 | 8811 | from nose.tools import eq_
from os import path
from unittest import main, TestCase
from ...units import Quantity
from ..parser import (Acquire, Assignment, Attribute, Block, Declaration,
Delay, Dictionary, DictionaryItem, Loop, ParallelPulses, Pulse,
PulseSequence, Variable)
from .. import parser
resource_dir =... | bsd-2-clause |
byterom/android_external_chromium_org | tools/telemetry/telemetry/core/forwarders/android_forwarder.py | 25 | 18685 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import re
import socket
import struct
import subprocess
from telemetry.core import forwarders
from telemetry.core import platform
f... | bsd-3-clause |
codesprinters/twillmanager | twill/other_packages/_mechanize_dist/_request.py | 20 | 3236 | """Integration with Python standard library module urllib2: Request class.
Copyright 2004-2006 John J Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import urllib2,... | bsd-3-clause |
siberider/androguard | androsim.py | 38 | 8073 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | apache-2.0 |
MuckRock/muckrock | muckrock/fine_uploader/tests.py | 1 | 6657 | """
Tests for fine uploader integration
"""
# Django
from django.test import RequestFactory, TestCase
from django.urls import reverse
# Standard Library
import json
# Third Party
from nose.tools import assert_false, eq_
# MuckRock
from muckrock.core.factories import UserFactory
from muckrock.fine_uploader import vi... | agpl-3.0 |
chubbymaggie/pwndbg | pwndbg/proc.py | 3 | 2285 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides values which would be available from /proc which
are not fulfilled by other modules and some process/gdb flow
related information.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ i... | mit |
howknows/Ropper | ropperapp/disasm/chain/arch/ropchainx86.py | 1 | 36189 | # coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper 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 ver... | gpl-2.0 |
nickpack/reportlab | src/reportlab/graphics/samples/exploded_pie.py | 4 | 3172 | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.piecharts import Pie
from excelcolors import *
from reportlab.graphics.widgets.grids import ShadedRect
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from... | bsd-3-clause |
catapult-project/catapult-csm | third_party/gsutil/third_party/boto/tests/integration/s3/test_cert_verification.py | 126 | 1532 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# 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 withou... | bsd-3-clause |
brchiu/tensorflow | tensorflow/contrib/eager/python/examples/rnn_colorbot/rnn_colorbot_test.py | 35 | 2229 | # 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 |
stemblab/intuitive-cs | py/recon.py | 2 | 4493 | #!puzlet
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import proj3d
# Plot vector as line segement will ball at one end.
def plot_vec(start,end,label,color):
ax.plot([start[0],end[0]],[start[1],end[1]],[start[2],end[2]],
label=label,c... | mit |
halberom/ansible | lib/ansible/modules/network/junos/junos_facts.py | 24 | 4232 | #!/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 |
obnoxxx/samba | source4/dsdb/tests/python/user_account_control.py | 20 | 33010 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This tests the restrictions on userAccountControl that apply even if write access is permitted
#
# Copyright Samuel Cabrero 2014 <samuelcabrero@kernevil.me>
# Copyright Andrew Bartlett 2014 <abartlet@samba.org>
#
# Licenced under the GPLv3
#
import optparse
import sys
im... | gpl-3.0 |
lwiecek/django | tests/file_storage/tests.py | 5 | 40799 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation, Suspicio... | bsd-3-clause |
mortada/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/transforms/unary_transforms.py | 87 | 3863 | # 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 |
40223119/w17test | static/Brython3.1.1-20150328-091302/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | gpl-3.0 |
myfavouritekk/TPN | tools/propagate/regression_propagation.py | 1 | 6216 | #!/usr/bin/env python
# --------------------------------------------------------
# Test regression propagation on ImageNet VID video
# Modified by Kai KANG (myfavouritekk@gmail.com)
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image database."""
import argparse
import... | mit |
Shrulik/Open-Knesset | simple/management/commands/mk_roles_parser.py | 9 | 2465 | #!/usr/bin/env python
# This Python file uses the following encoding: utf-8
import urllib
from BeautifulSoup import BeautifulSoup
import logging
logger = logging.getLogger("open-knesset.mk_roles_parser")
GOVT_INFO_PAGE = r"http://www.knesset.gov.il/mk/heb/MKIndex_Current.asp?view=4";
possible_role_prefix = [ 'שר'.dec... | bsd-3-clause |
cliffe/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/logging/config.py | 50 | 34344 | # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-3.0 |
qe-team/marmot | marmot/experiment/context_utils.py | 1 | 15242 | from __future__ import print_function, division
import sys
import numpy as np
from collections import Counter
###########################################################################
#
# This file contains different functions for generation of non-standard
# contexts (contexts where each 'token' is a list of words... | isc |
TunnelBlanket/Houdini | Houdini/Data/Stamp.py | 1 | 1225 | # coding: utf-8
from sqlalchemy import Column, Integer, SmallInteger, text, ForeignKey
from sqlalchemy.orm import relationship
from Houdini.Data import Base
metadata = Base.metadata
class Stamp(Base):
__tablename__ = 'stamp'
PenguinID = Column(ForeignKey(u'penguin.ID', ondelete=u'CASCADE', onupdate=u'CASCAD... | mit |
hsu/ardupilot | Tools/LogAnalyzer/tests/TestIMUMatch.py | 100 | 4071 | from LogAnalyzer import Test,TestResult
import DataflashLog
from math import sqrt
class TestIMUMatch(Test):
'''test for empty or near-empty logs'''
def __init__(self):
Test.__init__(self)
self.name = "IMU Mismatch"
def run(self, logdata, verbose):
#tuning parameters:
war... | gpl-3.0 |
benfinke/ns_python | build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbparameter.py | 3 | 7993 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests_test.py | 7 | 22461 | # Copyright 2015 The Bazel 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 applicable la... | mit |
yarikoptic/scrapy | tests/test_loader.py | 57 | 28175 | import unittest
import six
from functools import partial
from scrapy.loader import ItemLoader
from scrapy.loader.processors import Join, Identity, TakeFirst, \
Compose, MapCompose, SelectJmes
from scrapy.item import Item, Field
from scrapy.selector import Selector
from scrapy.http import HtmlResponse
# test items... | bsd-3-clause |
Pexego/account-financial-tools | account_invoice_currency/models/account_invoice.py | 27 | 3754 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2011
# Pexego Sistemas Informáticos. (http://pexego.es)
# Zikzakmedia S.L. (http://zikzakmedia.com)
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
jckarter/swift | utils/swift_build_support/swift_build_support/products/swiftevolve.py | 13 | 1868 | # swift_build_support/products/swiftevolve.py --------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.t... | apache-2.0 |
glenngillen/dotfiles | .vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/jedilsp/jedi/api/file_name.py | 3 | 5620 | import os
from jedi.api import classes
from jedi.api.strings import StringName, get_quote_ending
from jedi.api.helpers import match
from jedi.inference.helpers import get_str_or_none
class PathName(StringName):
api_type = 'path'
def complete_file_name(inference_state, module_context, start_leaf, quote, string,... | mit |
shootstar/ctest | ceilometer/image/notifications.py | 2 | 5589 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc
#
# Author: Eoghan Glynn <eglynn@redhat.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/license... | apache-2.0 |
Crompulence/cpl-library | examples/interactive_plot_example/python/CFD_recv_and_plot_grid_interactive.py | 1 | 3724 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
from mpi4py import MPI
from cplpy import CPL
from draw_grid import draw_grid
#initialise MPI and CPL
comm = MPI.COMM_WORLD
CPL = CPL()
CFD_COMM = CPL.init(CPL.CFD_REALM)
nprocs_realm = CFD_COMM.Get_size()
# Parameters of the cpu... | gpl-3.0 |
tidatida/linux-stable-grsec | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
Bishwajet/foursquared.eclair | util/gen_class.py | 262 | 3173 | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
HEADER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.types;
%(imports)s
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
*/
public class %(type... | apache-2.0 |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Tasking/Mcl_Cmd_Put_Tasking.py | 1 | 6883 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: Mcl_Cmd_Put_Tasking.py
UPLOADS_DIR = 'Uploads'
MAX_CHUNK_SIZE = 1047552
def TaskingMain(namespace):
import mcl.imports
import mcl.target
... | unlicense |
helewonder/knightgame | wargame/game.py | 1 | 3956 | from hut import Hut, create_unit
from functions import print_bold, print_dotted_line, show_health, \
print_wave_line
from knight import Knight
from uniterror import HutNotNumberError, HutOutRangeError
class OrGame():
"""
The Game Class , mainly
"""
def __init__(self, hut_numbers=5):
"""ge... | mit |
dext0r/flask-script | tests.py | 6 | 25189 | # -*- coding: utf-8 -*-
import re
import sys
import unittest
from flask import Flask
from flask.ext.script._compat import StringIO, text_type
from flask.ext.script import Command, Manager, Option, prompt, prompt_bool, prompt_choices
from pytest import raises
class Catcher(object):
"""Helper decorator to test r... | bsd-3-clause |
nttks/jenkins-test | common/djangoapps/config_models/admin.py | 83 | 2777 | """
Admin site models for managing :class:`.ConfigurationModel` subclasses
"""
from django.forms import models
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
# pylint: disable=protected-access
class ConfigurationModelAdmin(admin.ModelAdmin)... | agpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-60/modules/myenv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 355 | 6215 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... | gpl-3.0 |
rversteegen/commandergenius | project/jni/python/src/Lib/plat-mac/lib-scriptpackages/Explorer/URL_Suite.py | 82 | 1268 | """Suite URL Suite: Standard suite for Uniform Resource Locators
Level 1, version 1
Generated from /Applications/Internet Explorer.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'GURL'
class URL_Suite_Events:
_argmap_GetURL = {
'to' : 'dest',
}
... | lgpl-2.1 |
simone-campagna/zirkon | zirkon/validator/time_validators.py | 2 | 1715 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Simone Campagna
#
# 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 |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/contrib/autograph/utils/context_managers.py | 64 | 1708 | # 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... | mit |
Chuban/moose | python/chigger/exodus/__init__.py | 6 | 1323 | #pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #
# (c) 2010... | lgpl-2.1 |
JFriel/honours_project | venv/lib/python2.7/site-packages/nltk/__init__.py | 7 | 6093 | # Natural Language Toolkit (NLTK)
#
# Copyright (C) 2001-2016 NLTK Project
# Authors: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
The Natural Language Toolkit (NLTK) is an open source Python library
for Natural... | gpl-3.0 |
Voskrese/archlive.archldr | src/wubi/backends/win32/memory.py | 8 | 1513 | # Copyright (c) 2008 Agostino Russo
#
# Written by Agostino Russo <agostino.russo@gmail.com>
#
# This file is part of Wubi the Win32 Ubuntu Installer.
#
# Wubi is free software; you can redistribute it and/or modify
# it under 5the terms of the GNU Lesser General Public License as
# published by the Free Software Found... | gpl-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 714 | 5988 | from __future__ import absolute_import
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... | gpl-2.0 |
lokirius/python-for-android | python-modules/twisted/twisted/python/deprecate.py | 49 | 11960 | # -*- test-case-name: twisted.python.test.test_deprecate -*-
# Copyright (c) 2008-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Deprecation framework for Twisted.
To mark a method or function as being deprecated do this::
from twisted.python.versions import Version
from twisted.python.depr... | apache-2.0 |
Mach33Labs/labautomation | github.py | 1 | 5717 | #!/usr/bin/python
import datetime
import fcntl
import github3
import gzip
import json
import os
import re
import select
import socket
import subprocess
import sys
import time
import mysql.connector
TARGET_VM = 'devosa'
TARGET_IP_BLOCK = '192.168.53.0/24'
with open(os.path.expanduser('~/.github_automation'), 'r') ... | apache-2.0 |
PaulWay/spacewalk | client/rhel/rhn-client-tools/src/up2date_client/rpmUtils.py | 2 | 5077 | # some high level utility stuff for rpm handling
# Client code for Update Agent
# Copyright (c) 1999--2012 Red Hat, Inc. Distributed under GPLv2.
#
# Author: Preston Brown <pbrown@redhat.com>
# Adrian Likins <alikins@redhat.com>
#
#
# FIXME: Some exceptions in here are currently in up2date.py
# fix... | gpl-2.0 |
stephane-martin/salt-debian-packaging | salt-2016.3.2/tests/integration/states/pkgrepo.py | 2 | 3037 | # -*- coding: utf-8 -*-
'''
tests for pkgrepo states
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains
)
ensure_in_syspath('../../')
# Impor... | apache-2.0 |
AquaGeek/zbar | python/test/test_zbar.py | 4 | 17964 | #!/usr/bin/python
import sys, os, re
import unittest as ut
import zbar
# FIXME this needs to be conditional
# would be even better to auto-select PIL or ImageMagick (or...)
import Image
data = None
size = (0, 0)
def load_image():
image = Image.open(os.path.join(sys.path[0], "barcode.png")).convert('L')
retur... | lgpl-2.1 |
cloud101/ChatExchange | chatexchange/client.py | 2 | 9537 | import collections
import re
import time
import Queue
import threading
import logging
import weakref
import requests
from . import browser, events, messages, rooms, users
TOO_FAST_RE = r"You can perform this action again in (\d+) seconds"
logger = logging.getLogger(__name__)
class Client(object):
"""
A ... | gpl-2.0 |
City-busz/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/bin/GSettingsWidgets.py | 2 | 11457 | from gi.repository import Gio, GLib
from SettingsWidgets import *
# Monkey patch Gio.Settings object
def __setitem__(self, key, value):
# set_value() aborts the program on an unknown key
if key not in self:
raise KeyError('unknown key: %r' % (key,))
# determine type string of this key
range = ... | gpl-2.0 |
mmcdermo/helpinghand | server/venv/lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py | 224 | 6622 | from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from django.utils.six.moves import xrange
from math import pi, sin, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 180.
RTOD = 18... | mit |
eeshangarg/oh-mainline | vendor/packages/distribute/setuptools/tests/test_upload_docs.py | 65 | 1885 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... | agpl-3.0 |
fin09pcap/freight_forwarder | tests/unit/utils_test.py | 2 | 13308 | # -*- coding: utf-8; -*-
from __future__ import unicode_literals, absolute_import
import string
import random
import os
import json
from tests import unittest, mock
from freight_forwarder.utils import *
import requests
class UtilsTest(unittest.TestCase):
def setUp(self):
self.docker_https_host = 'https... | mit |
xapi-project/sm | tests/test_HBASR.py | 1 | 8516 | import mock
import HBASR
import unittest
import xmlrpclib
import xs_errors
import os
import SR
import xml.dom.minidom
import util
def mock_init(self):
pass
def imp_fake_probe():
dom = xml.dom.minidom.Document()
hbalist = dom.createElement("HBAInfoList")
dom.appendChild(hbalist)
for host in ["ho... | lgpl-2.1 |
abhikeshav/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_aaa_locald_cfg.py | 1 | 1133 | """ Cisco_IOS_XR_aaa_locald_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR aaa\-locald package configuration.
This YANG module augments the
Cisco\-IOS\-XR\-aaa\-lib\-cfg
module with configuration data.
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All rights reserved.
"""
import ... | apache-2.0 |
darkmiru/support-tools | googlecode-issues-exporter/bitbucket_issue_converter.py | 92 | 6834 | # Copyright 2014 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 |
mkaluza/external_chromium_org | chrome/common/extensions/docs/server2/intro_data_source.py | 23 | 2178 | # Copyright (c) 2012 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.
import os
from compiled_file_system import Unicode
from data_source import DataSource
from docs_server_utils import FormatKey
from extensions_paths impo... | bsd-3-clause |
noxora/flask-base | flask/lib/python3.4/site-packages/Crypto/SelfTest/PublicKey/test_RSA.py | 4 | 12176 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_RSA.py: Self-test for the RSA primitive
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedic... | mit |
schlueter/ansible | lib/ansible/modules/cloud/google/gce.py | 16 | 28171 | #!/usr/bin/python
# Copyright 2013 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',
'status': ['preview'],
... | gpl-3.0 |
cchurch/ansible | test/units/modules/monitoring/test_pagerduty.py | 56 | 5882 | from units.compat import unittest
from ansible.modules.monitoring import pagerduty
import json
class PagerDutyTest(unittest.TestCase):
def setUp(self):
self.pd = pagerduty.PagerDutyRequest(module=pagerduty, name='name', user='user', token='token')
def _assert_ongoing_maintenance_windows(self, module... | gpl-3.0 |
holmes/intellij-community | python/helpers/profiler/thrift/protocol/TCompactProtocol.py | 106 | 10992 | #
# 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 |
BernhardPosselt/itp-bif3 | infoscreen/inc/config.py | 2 | 3589 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# System imports
import os
import ConfigParser
import re
import codecs
class WebsiteConfig(object):
"""
Interface for writing to the config file
"""
def __init__(self, configs):
"""Constructor
Keyword arguments:
configs -- ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.