repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
darron/dd-agent | checks/check_status.py | 22 | 31901 | """
This module contains classes which are used to occasionally persist the status
of checks.
"""
# stdlib
from collections import defaultdict
import cPickle as pickle
import datetime
import logging
import os
import platform
import sys
import tempfile
import time
# 3p
import ntplib
import yaml
# project
import config... | bsd-3-clause |
40223142/CDA0629 | static/Brython3.1.0-20150301-090019/Lib/test/re_tests.py | 879 | 31796 | #!/usr/bin/env python3
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex... | gpl-3.0 |
mrquim/repository.mrquim | repo/service.xbmc.versioncheck/lib/versions.py | 48 | 6995 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | gpl-2.0 |
edermartioli/mcal | spectralclass.py | 1 | 12874 | # -*- coding: utf-8 -*-
"""
Spectral Classes
---------------------------
Created on January 31 2017
@author: Eder Martioli
Laboratorio Nacional de Astrofisica, Brazil
"""
import os
import numpy as np
from astropy.io import fits
import mcallib
from scipy import constants
import gzip
########## SPECTRUM CLASS #########... | gpl-3.0 |
Innovahn/odoo.old | addons/analytic_user_function/analytic_user_function.py | 163 | 7769 | # -*- 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 |
jdavidagudelo/django-social-auth-corrected | social_auth/backends/contrib/disqus.py | 1 | 2438 | try:
import json as simplejson
except ImportError:
try:
import simplejson
except ImportError:
from django.utils import simplejson
from social_auth.backends import BaseOAuth2, OAuthBackend
from social_auth.utils import dsa_urlopen, backend_setting
from urllib import urlencode
DISQUS_SERVER... | bsd-3-clause |
gjhiggins/vcoincore | test/functional/p2p_invalid_locator.py | 25 | 1957 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid locators.
"""
from test_framework.messages import msg_getheaders, msg_g... | mit |
spreg-git/pysal | pysal/esda/smoothing.py | 3 | 53684 | """
Apply smoothing to rate computation
[Longer Description]
Author(s):
Myunghwa Hwang mhwang4@gmail.com
David Folch dfolch@asu.edu
Luc Anselin luc.anselin@asu.edu
Serge Rey srey@asu.edu
"""
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>, David Folch <dfolch@asu.edu>, Luc Anselin <luc.anselin@asu.... | bsd-3-clause |
Konubinix/weboob | modules/pastealacon/test.py | 3 | 3905 | # -*- coding: utf-8 -*-
# Copyright(C) 2011-2014 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | agpl-3.0 |
jamesylgan/szechuantech | python-scripts/urllib3/packages/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | mit |
RobertoMalatesta/shedskin | examples/loop.py | 6 | 16880 | """
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:#www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | gpl-3.0 |
wwj718/murp-edx | lms/djangoapps/analytics/basic.py | 8 | 3788 | """
Student and course analytics.
Serve miscellaneous course and student data
"""
from django.contrib.auth.models import User
import xmodule.graders as xmgraders
STUDENT_FEATURES = ('id', 'username', 'first_name', 'last_name', 'is_staff', 'email')
PROFILE_FEATURES = ('name', 'language', 'location', 'year_of_birth',... | agpl-3.0 |
Khaon/android_external_skia | platform_tools/android/gyp_gen/tool_makefile_writer.py | 63 | 3616 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code for generating Android.mk for a tool."""
import android_framework_gyp
import gypd_parser
import makefile_writer
import os
import vars_dict_lib
def write_to... | bsd-3-clause |
Nessphoro/sublimeassembly | code/completion.py | 1 | 2196 | import sublime
import sublime_plugin
from .helpers import *
from .context import *
class completionListener(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
if is_asm(view):
prefixLineStart = view.line(locations[0])
line = view.substr(prefixLi... | bsd-3-clause |
caseyc37/pygame_cffi | test/imageext_test.py | 2 | 2605 | import os
import sys
if __name__ == '__main__':
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not is_pygame_pkg:
sys.path.insert(0, par... | lgpl-2.1 |
GoogleCloudPlatform/declarative-resource-client-library | python/services/compute/beta/ssl_certificate.py | 1 | 7634 | # Copyright 2021 Google LLC. 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 o... | apache-2.0 |
valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/scipy/_lib/_util.py | 8 | 8458 | from __future__ import division, print_function, absolute_import
import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import numpy as np
def _aligned_zeros(shape, dtype=float, order="C", align=None):
"""Allocate a new ndarray with aligned m... | gpl-2.0 |
maginatics/swift | test/unit/container/test_server.py | 12 | 120178 | # Copyright (c) 2010-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 law or agree... | apache-2.0 |
AOSPU/external_chromium_org | third_party/closure_linter/closure_linter/javascripttokens.py | 266 | 4955 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
michaelkirk/QGIS | python/plugins/processing/algs/grass/GrassUtils.py | 3 | 15753 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GrassUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... | gpl-2.0 |
Tiotao/morpherpy | env/Lib/site-packages/pip/_vendor/distlib/locators.py | 203 | 48796 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except Impo... | mit |
oberlin/django | django/core/serializers/json.py | 320 | 3782 | """
Serialize data to/from JSON
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import, unicode_literals
import datetime
import decimal
import json
import sys
import uuid
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import (
... | bsd-3-clause |
petemoore/git-repo | subcmds/grep.py | 89 | 7931 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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... | apache-2.0 |
anaran/kuma | vendor/packages/pyflakes/reporter.py | 52 | 2666 | """
Provide the Reporter class.
"""
import re
import sys
class Reporter(object):
"""
Formats the results of pyflakes checks to users.
"""
def __init__(self, warningStream, errorStream):
"""
Construct a L{Reporter}.
@param warningStream: A file-like object where warnings will... | mpl-2.0 |
Winand/pandas | pandas/tests/indexes/timedeltas/test_ops.py | 6 | 48590 | import pytest
import numpy as np
from datetime import timedelta
from distutils.version import LooseVersion
import pandas as pd
import pandas.util.testing as tm
from pandas import to_timedelta
from pandas.util.testing import assert_series_equal, assert_frame_equal
from pandas import (Series, Timedelta, DataFrame, Time... | bsd-3-clause |
GoSteven/Diary | django/contrib/localflavor/at/forms.py | 10 | 2336 | """
AT-specific Form helpers
"""
import re
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import Field, RegexField, Select
from django.forms import ValidationError
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField):
"""
A form field that val... | bsd-3-clause |
project-asap/IReS-Platform | asap-tools/kafka/kafka_file_producer.py | 1 | 2429 | #!/usr/bin/env python
from os import listdir
from os.path import isfile, isdir
from collections import Iterable
from kafka import SimpleProducer, KafkaClient
from argparse import ArgumentParser
def read_all(files, max_lines=None):
if not isinstance(files, Iterable):files = [files]
read_lines =0
for f in ... | apache-2.0 |
13xforever/webserver | admin/plugins/fcgi.py | 5 | 1725 | # -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-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 S... | gpl-2.0 |
joram/sickbeard-orange | lib/enzyme/mkv.py | 163 | 30439 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
# Copyright 2003-2006 Jason Tackaberry <tack@urandom.ca>
#
# This file is part of enzyme.
#
# en... | gpl-3.0 |
FusionSP/android_external_chromium_org | tools/ipc_fuzzer/play_testcase.py | 56 | 3131 | #!/usr/bin/env python
# Copyright 2013 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.
"""Wrapper around chrome.
Replaces all the child processes (renderer, GPU, plugins and utility) with the
IPC fuzzer. The fuzzer will t... | bsd-3-clause |
campbe13/openhatch | vendor/packages/mechanize/test-tools/twisted-ftpserver.py | 22 | 2670 | import optparse
import sys
import twisted.cred.checkers
import twisted.cred.credentials
import twisted.cred.portal
import twisted.internet
import twisted.protocols.ftp
from twisted.python import filepath, log
from zope.interface import implements
def make_ftp_shell(avatar_id, root_path):
if avatar_id is twisted... | agpl-3.0 |
vincepandolfo/django | django/contrib/gis/sitemaps/views.py | 144 | 2365 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExi... | bsd-3-clause |
woutersmet/Zeosummer | share/plugins/builder/tube.py | 2 | 11813 | # Zeobuilder is an extensible GUI-toolkit for molecular model construction.
# Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of Zeobuilder.
#
# Zeobuilde... | gpl-3.0 |
amyvmiwei/kbengine | kbe/src/lib/python/Lib/distutils/tests/test_config_cmd.py | 95 | 2602 | """Tests for distutils.command.config."""
import unittest
import os
import sys
from test.support import run_unittest
from distutils.command.config import dump_file, config
from distutils.tests import support
from distutils import log
class ConfigTestCase(support.LoggingSilencer,
support.TempdirMa... | lgpl-3.0 |
GeoscienceAustralia/PyRate | tests/test_algorithm.py | 1 | 8635 | # This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... | apache-2.0 |
commshare/testLiveSRS | trunk/objs/CherryPy-3.2.4/cherrypy/process/plugins.py | 37 | 25462 | """Site services for use with a Web Site Process Bus."""
import os
import re
import signal as _signal
import sys
import time
import threading
from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident, ntob, set, Timer, SetDaemonProperty
# _module__file__base is used by Autoreload to make
# absolute any... | mit |
jiangzhuo/kbengine | kbe/tools/xlsx2py/xlsx2py/xlsx2py.py | 29 | 15312 | # -*- coding: gb2312 -*-
import sys
import re
import os
import string
import signal
import time
import codecs
import json
from ExcelTool import ExcelTool
from config import *
import functions
try:
import character
except:
character = functions
import xlsxtool
import xlsxError
import copy
SYS_CO... | lgpl-3.0 |
MihaiMoldovanu/ansible | lib/ansible/module_utils/facts/system/chroot.py | 40 | 1029 | # Copyright (c) 2017 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
import os
from ansible.module_utils.facts.collector import BaseFactCollector
def is_chroot():
... | gpl-3.0 |
UCSBarchlab/PyRTL | tests/rtllib/test_matrix.py | 1 | 99917 | import random
import math
import unittest
import pyrtl
import pyrtl.rtllib.matrix as Matrix
class MatrixTestBase(unittest.TestCase):
def check_against_expected(self, result, expected_output, floored=False):
"""
:param Matrix result: matrix that is the result of some operation we're testing
... | bsd-3-clause |
Jannes123/django-oscar | tests/integration/offer/absolute_benefit_tests.py | 51 | 15825 | from decimal import Decimal as D
from django.core import exceptions
from django.test import TestCase
import mock
from oscar.apps.offer import models
from oscar.apps.offer.utils import Applicator
from oscar.test.basket import add_product, add_products
from oscar.test import factories
class TestAnAbsoluteDiscountAppl... | bsd-3-clause |
samdoran/ansible | lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py | 43 | 21975 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | gpl-3.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/swarming_client/utils/on_error.py | 9 | 7469 | # coding=utf-8
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0 that
# can be found in the LICENSE file.
"""Declares a single function to report errors to a server.
By running the script, you accept that errors will be reported to ... | mit |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/operations/_virtual_network_gateways_operations.py | 1 | 131134 | # 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 may ... | mit |
wnt-zhp/hufce | django/contrib/gis/db/backends/spatialite/models.py | 403 | 1847 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
class GeometryColumns(models.Model):
"""
The 'geometry_columns' table from SpatiaLite.
"""
f_table_name = models.CharField(ma... | gpl-3.0 |
AlexHill/django | tests/field_deconstruction/tests.py | 7 | 11022 | import warnings
from django.test import TestCase
from django.db import models
class FieldDeconstructionTests(TestCase):
"""
Tests the deconstruct() method on all core fields.
"""
def test_name(self):
"""
Tests the outputting of the correct name if assigned one.
"""
# F... | bsd-3-clause |
krinart/AutobahnPython | examples/asyncio/wamp/beginner/server.py | 6 | 2835 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | apache-2.0 |
kkk669/mxnet | python/mxnet/contrib/tensorboard.py | 34 | 3192 | # 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 |
eHealthAfrica/ureport | ureport/contacts/models.py | 2 | 9707 | from dash.orgs.models import Org
from django.core.cache import cache
from django.db import models, DataError
from django.db.models import Sum
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
# Create your models here.
import pytz
from ureport.locations.models import Boundary
fr... | agpl-3.0 |
YSOVAR/YSOVAR | YSOVAR/autofuncs.py | 1 | 22958 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 H.M.Guenther & K.Poppenhaeger. See Licence.rst for details.
'''Define and register some common functions for the autogeneration of columns.
Module level variables
----------------------
This module contains a dictionary of default reddening vectors.
The form of the vectors... | gpl-3.0 |
shsingh/ansible | lib/ansible/modules/storage/netapp/netapp_e_syslog.py | 11 | 10536 | #!/usr/bin/python
# (c) 2018, NetApp, 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 |
gooddata/openstack-nova | nova/virt/zvm/hypervisor.py | 2 | 6380 | # Copyright 2017,2018 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 agr... | apache-2.0 |
robertobarreda/django-safe-browsing | safebrowsing/vendors/google/expression.py | 3 | 11623 | #!/usr/bin/env python2.5
#
# Copyright 2010 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 l... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/third_party/scons-2.0.1/engine/SCons/Tool/gs.py | 61 | 2553 | """SCons.Tool.gs
Tool-specific initialization for Ghostscript.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundatio... | mit |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/_virtual_network_gateways_operations.py | 1 | 53818 | # 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 may ... | mit |
Luttik/mellowcakes_prototype | setup.py | 1 | 3722 | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'pip_readme.rst'), encoding='utf-8') as f:
long_description = f.read()
setup... | mit |
Shouqun/node-gn | tools/depot_tools/recipes/recipe_modules/git/examples/full.py | 1 | 5612 | # Copyright 2013 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.
DEPS = [
'git',
'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/raw_io',
'r... | mit |
michalkurka/h2o-3 | h2o-py/tests/testdir_algos/glrm/pyunit_arrests_set_loss_by_col_glrm.py | 6 | 1984 | from __future__ import print_function
from builtins import str
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
import numpy as np
def glrm_set_loss_by_col():
print("Importing USArrests.csv data...")
arrestsH2O... | apache-2.0 |
nsmoooose/csp | csp/data/ui/scripts/windows/pause.py | 1 | 1717 | #!/usr/bin/python
# Combat Simulator Project
# Copyright (C) 2002-2005 The Combat Simulator Project
# http://csp.sourceforge.net
#
# 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... | gpl-2.0 |
sboparen/spacechem-scripts | compare/collect.py | 2 | 1117 | #!/usr/bin/env python2
import excess
class stats:
def __init__(self, user, planet):
self.user = user
self.planet = planet
def __str__(self):
return '<stats %s/%s>' % (self.user.name, self.planet.pnum)
def process(planet, users):
if 'children' in planet.__dict__:
for ch in planet.children:
... | mit |
rhinstaller/anaconda | pyanaconda/modules/storage/fcoe/__init__.py | 6 | 1042 | #
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be ... | gpl-2.0 |
ganeshrn/ansible | test/support/windows-integration/collections/ansible_collections/ansible/windows/plugins/modules/win_uri.py | 15 | 4256 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r'''
---
module: win_uri
short_description... | gpl-3.0 |
hackers-terabit/portage | pym/portage/dbapi/bintree.py | 1 | 48970 | # Copyright 1998-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
__all__ = ["bindbapi", "binarytree"]
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.checksum:hashfunc_map,perform_multiple_checksums,' + \
'ver... | gpl-2.0 |
thaim/ansible | lib/ansible/module_utils/openstack.py | 26 | 7072 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | mit |
petteyg/intellij-community | python/lib/Lib/site-packages/django/db/backends/dummy/base.py | 89 | 1515 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from django.db.back... | apache-2.0 |
jfmartinez64/test | libs/xmpp/auth.py | 196 | 15633 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | gpl-3.0 |
chris-wood/ndn-cxx-accounting | .waf-tools/pch.py | 16 | 4636 | #! /usr/bin/env python
# encoding: utf-8
# Alexander Afanasyev (UCLA), 2014
"""
Enable precompiled C++ header support (currently only clang++ and g++ are supported)
To use this tool, wscript should look like:
def options(opt):
opt.load('pch')
# This will add `--with-pch` configure option.
# Unless --with-pch ... | gpl-3.0 |
odicraig/kodi2odi | addons/plugin.video.footballreplays/net.py | 2 | 10235 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | gpl-3.0 |
eyohansa/django | tests/distinct_on_fields/tests.py | 263 | 5996 | from __future__ import unicode_literals
from django.db.models import Max
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import str_prefix
from .models import Celebrity, Fan, Staff, StaffTag, Tag
@skipUnlessDBFeature('can_distinct_on_fields')
@skipUnlessDBFeature('supports_nullable_uniq... | bsd-3-clause |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/cloudconnectlib/core/http.py | 2 | 10074 | from builtins import str
from builtins import range
from builtins import object
import time
import traceback
import six
import munch
from cloudconnectlib.common import util
from cloudconnectlib.common.log import get_cc_logger
from cloudconnectlib.core import defaults
from cloudconnectlib.core.exceptions import HTTPErr... | isc |
tedye/leetcode | tools/leetcode.082.Remove Duplicates from Sorted List II/leetcode.082.Remove Duplicates from Sorted List II.submission8.py | 1 | 1096 | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
if not head: return None
dummyHead = ListNode(-0x7ff... | mit |
yanheven/nova | nova/compute/build_results.py | 96 | 1039 | # Copyright 2014 OpenStack Foundation
# 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 requ... | apache-2.0 |
hudie8655/google | lib/flask/ctx.py | 776 | 14266 | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.excep... | apache-2.0 |
ARM-software/trappy | trappy/cpu_power.py | 1 | 6417 | # Copyright 2015-2017 ARM Limited
#
# 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 w... | apache-2.0 |
Kamigami55/anime-checker | main.py | 1 | 2465 | #!/usr/bin/python3
# coding: utf8
###########################################################
#
# anime-checker.py
#
# by Eason Chang <eason@easonchang.com>
#
# A python script to automatically check whether my favorite animes
# have updated and then send me an email to notify me.
#
# This script does a one-time ... | mit |
aidanlister/django | django/contrib/gis/gdal/envelope.py | 477 | 7009 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | bsd-3-clause |
MCRSoftwares/AcadSocial | mainAcad/methods.py | 1 | 3190 | # -*- encoding: utf-8 -*-
"""
Equipe MCRSoftwares - AcadSocial
Versão do Código: 01v001a
Responsável: Victor Ferraz
Auxiliar: -
Requisito(s): RF001, RF002, RF020, RF022, RF023, RF027
Caso(s) de Uso: DV001, DV002, DVA012
Descrição:
Definição dos métodos auxiliares relacionados à aplicação principal.
"""
from d... | gpl-2.0 |
BeATz-UnKNoWN/python-for-android | python-modules/twisted/twisted/mail/pop3client.py | 53 | 24432 | # -*- test-case-name: twisted.mail.test.test_pop3client -*-
# Copyright (c) 2001-2004 Divmod Inc.
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
POP3 client protocol implementation
Don't use this module directly. Use twisted.mail.pop3 instead.
@author: Jp Calderone
"""
import re
... | apache-2.0 |
no2a/ansible | lib/ansible/parsing/utils/jsonify.py | 203 | 1451 | # (c) 2012-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) an... | gpl-3.0 |
mach0/QGIS | python/plugins/grassprovider/ext/r_tileset.py | 9 | 1300 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_proj.py
---------
Date : October 2017
Copyright : (C) 2017 by Médéric Ribreux
Email : medspx at medspx dot fr
*****************************************... | gpl-2.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/_markupbase.py | 891 | 14598 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... | lgpl-3.0 |
tumbl3w33d/ansible | test/units/modules/network/fortios/test_fortios_router_static6.py | 21 | 10757 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
pdellaert/ansible | test/units/modules/remote_management/oneview/hpe_test_utils.py | 118 | 8245 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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 optio... | gpl-3.0 |
remipassmoilesel/python_scripts | ncurses/tutorial.py | 1 | 2293 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# Tutoriel sur Ncurse, bibliotheque d'affichage sur terminaux
# Source: https://docs.python.org/2/howto/curses.html
import time
import subprocess
import sys
# tout le script se déroule dans un try pour intercepter l'appui sur CTRL+C
try:
# intiation de la bibliot... | gpl-3.0 |
EvanK/ansible | lib/ansible/module_utils/network/ios/ios.py | 14 | 7072 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
MartinHjelmare/home-assistant | homeassistant/components/synology_chat/notify.py | 7 | 1871 | """SynologyChat platform for notify component."""
import json
import logging
import requests
import voluptuous as vol
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (ATTR_DATA, PLATFORM_SCHEMA,
... | apache-2.0 |
Omegaphora/external_chromium_org | chrome/common/extensions/docs/server2/samples_data_source.py | 25 | 2735 | # 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 logging
import traceback
from data_source import DataSource
from extensions_paths import EXAMPLES
from future import All, Future
from platform_ut... | bsd-3-clause |
catapult-project/catapult-csm | dashboard/dashboard/auto_bisect.py | 1 | 9913 | # Copyright 2015 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.
"""URL endpoint for a cron job to automatically run bisects."""
import logging
from dashboard import can_bisect
from dashboard import pinpoint_request
from... | bsd-3-clause |
gfonk/ansible | lib/ansible/plugins/strategies/linear.py | 10 | 14299 | # (c) 2012-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) an... | gpl-3.0 |
ukgovdatascience/classifyintentsapp | app/main/forms.py | 1 | 3159 | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, BooleanField, SelectField, SubmitField, RadioField
from wtforms.validators import DataRequired, Length, Email, Regexp, InputRequired
from wtforms import ValidationError
from flask_pagedown.fields import PageDownField
from ..models import Ro... | mit |
fdvarela/odoo8 | openerp/service/report.py | 324 | 5148 | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import openerp
import openerp.report
from openerp import tools
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report state:
# False -> True
self_reports... | agpl-3.0 |
itzzshirlayyy/Online_Ordering | venv/lib/python2.7/site-packages/setuptools/tests/contexts.py | 59 | 1819 | import tempfile
import os
import shutil
import sys
import contextlib
import site
from ..compat import StringIO
@contextlib.contextmanager
def tempdir(cd=lambda dir:None, **kwargs):
temp_dir = tempfile.mkdtemp(**kwargs)
orig_dir = os.getcwd()
try:
cd(temp_dir)
yield temp_dir
finally:
... | mit |
rosswhitfield/mantid | Framework/PythonInterface/mantid/plots/__init__.py | 3 | 1385 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
orlenko/plei | mezzanine/blog/migrations/0010_category_site_allow_comments.py | 12 | 11028 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.sites.models import Site
class Migration(SchemaMigration):
def forwards(self, orm):
site = Site.objects.get_current()
# Adding field 'BlogCategor... | bsd-2-clause |
hanw/sonic-lite | hw/bin/bitstream.py | 1 | 8327 | #!/usr/bin/python
# Filename: bitstream.py
#
# Input: 64 bit per line raw bitstream, first bit at lsb.
# Output: 66 bit per line raw bitstream, first bit at lsb.
#
# Author: HanW
# Date: Nov/23/2011
#
from bitstring import *
#
# Helper function --
# Input: 64-bit per line, in hex, first bit as LSB
# Output: 66-bit per... | mit |
cloud-fan/spark | examples/src/main/python/mllib/random_forest_regression_example.py | 27 | 2527 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
sncn-private/imx6-linux | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
jrmontag/Data-Science-45min-Intros | ml-basis-expansion-101/kernel.py | 347 | 5100 | """
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogram... | unlicense |
archf/ansible | lib/ansible/plugins/connection/buildah.py | 8 | 6797 | # Based on the docker connection plugin
#
# Connection plugin for building container images using buildah tool
# https://github.com/projectatomic/buildah
#
# Written by: Tomas Tomecek (https://github.com/TomasTomecek)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify... | gpl-3.0 |
anastasia-tarasova/indy-sdk | docs/how-tos/rotate-key/python/step4.py | 4 | 1548 | print_log('\n13. Reading new verkey from wallet\n')
verkey_in_wallet = await did.key_for_local_did(wallet_handle, trust_anchor_did)
print_log('Trust Anchor Verkey in wallet: ', verkey_in_wallet)
print_log('\n14. Building GET_NYM request to get Trust Anchor verkey\n')
get_nym_request = await ledger.build_get_... | apache-2.0 |
babelsberg/babelsberg-r | topaz/objects/constraintobject.py | 1 | 12412 | from rpython.rlib import jit
from topaz.celldict import CellDict, VersionTag
from topaz.constraintinterpreter import ConstrainedVariable
from topaz.module import ClassDef, ModuleDef
from topaz.objects.hashobject import W_HashObject
from topaz.objects.objectobject import W_Object, W_RootObject
from topaz.objects.procob... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.