repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
xuewei4d/scikit-learn | examples/neighbors/plot_nca_dim_reduction.py | 24 | 3839 | """
==============================================================
Dimensionality Reduction with Neighborhood Components Analysis
==============================================================
Sample usage of Neighborhood Components Analysis for dimensionality reduction.
This example compares different (linear) dimen... | bsd-3-clause |
CiscoSystems/horizon | openstack_dashboard/dashboards/project/database_backups/views.py | 33 | 4357 | # Copyright 2013 Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/distutils/core.py | 75 | 9019 | """distutils.core
The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script). Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""
__revision__ = "$Id$"... | gpl-2.0 |
noba3/KoTos | addons/plugin.video.tvondesizonexl/tvshows/views.py | 3 | 3472 | '''
Created on Nov 30, 2013
@author: ajdeveloped@gmail.com
This file is part of XOZE.
XOZE 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... | gpl-2.0 |
double12gzh/nova | nova/api/ec2/ec2utils.py | 52 | 14370 | # 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
# not use this file except in compliance with the License. You may obtain
# a ... | apache-2.0 |
HashGrowth/py-google-auth | py_google_auth/login.py | 1 | 14354 | import falcon
import json
import jsonpickle
import os
from . import utils
from . import login_utils
from . import step_two_utils
from . import change_method_utils
def verify_data_exist(req, resp, resource, params):
'''
Verify if payload was sent with request.
'''
body = req.stream.read()
try:
... | mit |
halvertoluke/edx-platform | common/lib/capa/capa/xqueue_interface.py | 179 | 4373 | #
# LMS Interface to external queueing system (xqueue)
#
import hashlib
import json
import logging
import requests
import dogstats_wrapper as dog_stats_api
log = logging.getLogger(__name__)
dateformat = '%Y%m%d%H%M%S'
XQUEUE_METRIC_NAME = 'edxapp.xqueue'
# Wait time for response from Xqueue.
XQUEUE_TIMEOUT = 35 #... | agpl-3.0 |
sensysnetworks/uClinux | user/python/Lib/dos-8x3/test_cla.py | 10 | 3126 | "Test the functionality of Python classes implementing operators."
testmeths = [
# Binary operations
"add",
"radd",
"sub",
"rsub",
"mul",
"rmul",
"div",
"rdiv",
"mod",
"rmod",
"divmod",
"rdivmod",
"pow",
"rpow",
"rshift",
"rrshift",
"lshift",
"r... | gpl-2.0 |
allmende/synnefo | snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py | 10 | 4501 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... | gpl-3.0 |
SublimeText/Pywin32 | lib/x64/win32/lib/win32traceutil.py | 4 | 1531 | # This is a helper for the win32trace module
# If imported from a normal Python program, it sets up sys.stdout and sys.stderr
# so output goes to the collector.
# If run from the command line, it creates a collector loop.
# Eg:
# C:>start win32traceutil.py (or python.exe win32traceutil.py)
# will start a pr... | bsd-3-clause |
aborrero/pkg-rpmlint | SCLCheck.py | 1 | 16259 | # -*- coding: utf-8 -*-
#############################################################################
# File : SCLCheck.py
# Package : rpmlint
# Author : Miro Hrončok
# Created on : Wed Jul 24 20:25 2013
# Purpose : Software Collections checks.
############################################... | gpl-2.0 |
mensler/ansible | lib/ansible/modules/network/avi/avi_systemconfiguration.py | 43 | 6203 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
VishvajitP/python-social-auth | social/storage/base.py | 52 | 8266 | """Models mixins for Social Auth"""
import re
import time
import base64
import uuid
import warnings
from datetime import datetime, timedelta
import six
from openid.association import Association as OpenIdAssociation
from social.backends.utils import get_backend
from social.strategies.utils import get_current_strate... | bsd-3-clause |
mattcongy/itshop | docker-images/taigav2/taiga-back/taiga/projects/likes/services.py | 2 | 3693 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández ... | mit |
areski/django | tests/auth_tests/test_middleware.py | 86 | 1251 | from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
class TestAuthenticationMiddleware(TestCase):
def setUp(self):
self.user = User.objects.create_user('test_user', 'test@exampl... | bsd-3-clause |
noironetworks/neutron | neutron/services/trunk/drivers/linuxbridge/agent/driver.py | 3 | 8707 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
tdyas/pants | src/python/pants/backend/native/tasks/conan_fetch.py | 1 | 9173 | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import functools
import os
import re
from pants.backend.native.targets.external_native_library import ExternalNativeLibrary
from pants.backend.native.targets.packaged_native_library impor... | apache-2.0 |
quantopian/coal-mine | coal_mine/abstract_store.py | 1 | 3427 | # Copyright 2015 Quantopian, 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 wri... | apache-2.0 |
blooparksystems/odoo | openerp/addons/base/ir/ir_config_parameter.py | 15 | 4146 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Store database-specific configuration parameters
"""
import uuid
import datetime
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import misc, config, ormcache
"""
A dictionar... | gpl-3.0 |
diamondman/proteusisc | proteusisc/bittypes.py | 1 | 42182 | from __future__ import generator_stop
from itertools import islice
import collections
from bitarray import bitarray as _bitarray
import math
from .errors import ProteusDataJoinError
from .contracts import ZERO, ONE, NOCARE, ARBITRARY
class bitarray(_bitarray):
def _easy_mergable(self, other):
return False... | lgpl-2.1 |
Lilywei123/tempest | tempest/cli/__init__.py | 6 | 4600 | # Copyright 2013 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 |
imankulov/sentry | src/sentry/debug/panels/redis.py | 23 | 2896 | from __future__ import absolute_import, unicode_literals
from django.template import Context, Template
from django.utils.translation import ugettext_lazy as _
from time import time
from .base import CallRecordingPanel
from ..utils.function_wrapper import FunctionWrapper
from ..utils.patch_context import PatchContext
... | bsd-3-clause |
robclark/chromium | chrome/test/functional/ap_lab/ap_configurator.py | 76 | 11626 | # 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 copy
import logging
import os
import pyauto_ap_configurator
import pyauto
import selenium.common.exceptions
from selenium.webdriver.support.ui i... | bsd-3-clause |
alexryndin/ambari | ambari-server/src/main/resources/stacks/ADH/1.4/services/ATLAS/package/scripts/params.py | 1 | 20505 | #!/usr/bin/env python
"""
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");... | apache-2.0 |
sunzhxjs/JobGIS | lib/python2.7/site-packages/pip/_vendor/requests/models.py | 187 | 29277 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | mit |
wojtekka/6tunnel | test.py | 1 | 5911 | #!/usr/bin/env python
import os
import socket
import time
import select
(SUCCESS, COMMAND_FAIL, CONNECT_FAIL, DISCONNECT, ACCEPT_FAIL, DATA_MISMATCH) = range(6)
labels = ["success", "command fail", "connection fail", "disconnection", "accept fail", "data mismatch"]
def test(expect, client_af, server_af, from_ip, to_... | gpl-2.0 |
unlessbamboo/grocery-shop | language/python/src/redis/agentTcpServer.py | 1 | 10698 | #/usr/bin/python
#coding:utf-8
import os
import sys
import redis
import socket
import select
import struct
import atexit
import signal
# set root directory
package_path = os.getcwd() + '/../'
sys.path.append(package_path)
from basepackage.baseConfig import BLACK_FILE,BLACK_PIPE
from basepackage.baselog import globalL... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/contrib/factorization/python/ops/clustering_ops.py | 11 | 35885 | # 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 |
47lining/nucleator-core | lib/nucleator/core/setup/commands/utils/generate_cert.py | 1 | 3070 | # Copyright 2015 47Lining LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
sphinx-doc/sphinx-intl | tests/test_catalog.py | 1 | 1258 | # -*- coding: utf-8 -*-
"""
test_catalog
~~~~~~~~~~~~
Test functions that implements catalog related features.
:copyright: Copyright 2019 by Takayuki SHIMIZUKAWA.
:license: BSD, see LICENSE for details.
"""
from babel.messages import Catalog, Message
def test_write_and_read_po_file_with_non_asci... | bsd-2-clause |
ychen820/microblog | y/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/http_health_checks/update.py | 4 | 8462 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for updating HTTP health checks."""
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
THRESHOLD_UPPER_BOUND = 5000
THRESHOLD_LOWER_BOUND = 1
TIMEOUT_UPPER_BOUND_... | bsd-3-clause |
ssvs111/Arduino | arduino-core/src/processing/app/i18n/python/requests/status_codes.py | 252 | 3043 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | lgpl-2.1 |
realityone/Anti_teNelgniS | src/XLStringEnc.py | 2 | 2371 | #!/usr/bin/env python
# coding=utf-8
class XLStringEnc(object):
"""
usage:
xl = XLStringEnc()
print xl.decrypt('e4b5faf2c04576af98fa3dd354d32da2')
print xl.encrypt('xlzjhrprotocol3x')
"""
base_key = 'f12acd03b45e9678'
base_box = ('SDJJLKNASDHFUIAk'
'hfu340... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/libvpx/source/libvpx/third_party/googletest/src/scripts/pump.py | 603 | 23316 | #!/usr/bin/env python
#
# Copyright 2008, 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 |
sarvex/tensorflow | tensorflow/python/training/supervisor_test.py | 14 | 36132 | # 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 |
Milias/ModellingSimulation | Week4/python/lattice.py | 1 | 3123 | # -*- coding: utf8 -*-
from numpy import *
import json
def GenerateRectangular(N, sph_size, scale, filename):
try:
f = open(filename, "w+")
except Exception as e:
return str(e)
data = {}
data["FileType"] = "LatticeGenerator"
data["Dimensions"] = 2
data["SpheresNumber"] = 0
data["SphereSize"] = s... | mit |
sjshao09/KaggleRH | zhou_bruno.py | 1 | 7384 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import model_selection, preprocessing
import xgboost as xgb
import datetime
# Any results you write to the current directory are saved as output.
df_train = pd.read_csv("input/train.csv", parse_dates=['timestamp... | mit |
danwagnerco/bowshock | bowshock/maas.py | 2 | 2217 | # http://marsweather.ingenology.com/#get_started
# Below description taken from https://github.com/ingenology/mars_weather_api
# The {MAAS} API is an open source REST API built to help make it easier and more efficient to build interactive applications that want to utilize the wealth of weather data being transmitted ... | gpl-2.0 |
edickie/ciftify | ciftify/utils.py | 1 | 17027 | #!/usr/bin/env python3
"""
A collection of utilities for the epitome pipeline. Mostly for getting
subject numbers/names, checking paths, gathering information, etc.
"""
import os
import sys
import copy
import datetime
import subprocess
import tempfile
import shutil
import logging
import math
import yaml
import ciftif... | mit |
GordonGaoNY/py_rrfm_re | server/services/bfs_service.py | 2 | 7702 | from configurations.env_configs import *
from services.api_service import *
# def graph():
# hash = dict()
# with open(_datasets_path() + 'connections.csv', 'rb') as csvfile:
# reader = csv.reader(csvfile, delimiter=',')
# for row in reader:
# if int(row[0]) in hash.keys():
# hash[int(row[0])]... | mit |
moyogo/nototools | tests/coverage_test.py | 3 | 1360 | #!/usr/bin/env python
#
# 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 require... | apache-2.0 |
felixhummel/ftt | ftt/migrations/0001_initial.py | 1 | 2259 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-16 21:58
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
initial = True
dependencies =... | gpl-3.0 |
stclair/wes-cms | django/contrib/gis/tests/layermap/models.py | 239 | 2241 | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... | bsd-3-clause |
jones139/OpenSeizureDetector | audio_version/kiss_fft130/test/mk_test.py | 67 | 3009 | #!/usr/bin/env python
import FFT
import sys
import random
import re
j=complex(0,1)
def randvec(n,iscomplex):
if iscomplex:
return [
int(random.uniform(-32768,32767) ) + j*int(random.uniform(-32768,32767) )
for i in range(n) ]
else:
return [ int(r... | gpl-3.0 |
brandond/ansible | test/units/modules/network/itential/test_iap_token.py | 54 | 1438 | """
iap_token unit tests
"""
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
MeanEYE/Sunflower | sunflower/associations.py | 1 | 10229 | from __future__ import absolute_import
import os
import shlex
import subprocess
from gi.repository import Gtk, Gio
from collections import namedtuple
from urllib.request import pathname2url
from sunflower.common import is_gui_app, decode_file_name, encode_file_name
from sunflower.parameters import Parameters
from sun... | gpl-3.0 |
blacklin/kbengine | kbe/src/lib/python/Lib/test/test_email/test_message.py | 72 | 26378 | import unittest
import textwrap
from email import policy, message_from_string
from email.message import EmailMessage, MIMEPart
from test.test_email import TestEmailBase, parameterize
# Helper.
def first(iterable):
return next(filter(lambda x: x is not None, iterable), None)
class Test(TestEmailBase):
polic... | lgpl-3.0 |
GodBlessPP/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/pkgdata.py | 603 | 2146 | """pkgdata is a simple, extensible way for a package to acquire data file
resources.
The getResource function is equivalent to the standard idioms, such as
the following minimal implementation::
import sys, os
def getResource(identifier, pkgname=__name__):
pkgpath = os.path.dirname(sys.modules[p... | agpl-3.0 |
rochaporto/collectd-ceph | plugins/base.py | 3 | 4986 | #!/usr/bin/env python
#
# vim: tabstop=4 shiftwidth=4
# 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; only version 2 of the License is applicable.
#
# This program is distributed in the hope th... | gpl-2.0 |
blaggacao/OpenUpgrade | addons/resource/migrations/8.0.1.1/pre-migration.py | 14 | 1091 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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 the Free Software Foundation, either version 3 of the
# License,... | agpl-3.0 |
demonchild2112/travis-test | grr/test_lib/test_lib_test.py | 2 | 7490 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import threading
import time
from absl.testing import absltest
from grr_response_core.lib import rdfvalue
from grr.test_lib import test_lib
class FakeTimelineTest(absltest.TestCase):
... | apache-2.0 |
jkandasa/integration_tests | cfme/tests/containers/test_relationships.py | 1 | 4376 | from random import randrange
import pytest
from cfme.containers.pod import Pod
from cfme.containers.provider import ContainersProvider, ContainersTestItem
from cfme.containers.service import Service
from cfme.containers.replicator import Replicator
from cfme.containers.image import Image
from cfme.containers.project ... | gpl-2.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.8.36-1/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py | 82 | 7174 | '''
Unit tests for oc serviceaccount
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-... | apache-2.0 |
aron-bordin/kivy | examples/demo/multistroke/settings.py | 43 | 3078 | __all__ = ('MultistrokeSettingsContainer', 'MultistrokeSettingItem',
'MultistrokeSettingBoolean', 'MultistrokeSettingSlider',
'MultistrokeSettingString', 'MultistrokeSettingTitle')
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.... | mit |
runt18/mojo | third_party/cython/src/Cython/Debugger/DebugWriter.py | 103 | 2192 | from __future__ import with_statement
import os
import sys
import errno
try:
from lxml import etree
have_lxml = True
except ImportError:
have_lxml = False
try:
# Python 2.5
from xml.etree import cElementTree as etree
except ImportError:
try:
# Python 2.5
... | bsd-3-clause |
csdms/bmi-live | bmi_live/diffusion.py | 1 | 1682 | """A model of temperature diffusion over a rectangular plate."""
import numpy as np
import yaml
class Diffusion(object):
"""Model of temperature diffusion on a plate."""
def __init__(self, config_file=None):
"""Initialize the model."""
if config_file is not None:
with open(config... | mit |
anryko/ansible | test/units/parsing/test_dataloader.py | 57 | 9955 | # (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 |
zvolsky/wikilinuxdevel | languages/pt.py | 162 | 7150 | # coding: utf8
{
'!langcode!': 'pt',
'!langname!': 'Português',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não pode actualizar ou eliminar os resultados de um JOIN',
'%s %%{row} delete... | lgpl-3.0 |
pilou-/ansible | test/units/modules/cloud/google/test_gce_tag.py | 187 | 1909 | import unittest
from ansible.modules.cloud.google.gce_tag import _get_changed_items, _intersect_items, _union_items
class TestGCETag(unittest.TestCase):
"""Unit tests for gce_tag module."""
def test_union_items(self):
"""
Combine items in both lists
removing duplicates.
"""
... | gpl-3.0 |
atsolakid/edx-platform | lms/djangoapps/bulk_email/migrations/0007_load_course_email_template.py | 182 | 5602 | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
class Migration(DataMigration):
def forwards(self, orm):
"Load data from fixture."
from django.core.management import call_command
call_command("loaddata", "course_email_template.json")
def backwards(self, orm):
"Perf... | agpl-3.0 |
kyoungrok0517/linguist | samples/Python/gen-py-linguist-thrift.py | 61 | 2259 | #
# Autogenerated by Thrift Compiler (1.0.0-dev)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtoco... | mit |
vadimtk/chrome4sdp | third_party/cython/src/Cython/Debugger/libpython.py | 101 | 83726 | #!/usr/bin/python
# NOTE: this file is taken from the Python source distribution
# It can be found under Tools/gdb/libpython.py. It is shipped with Cython
# because it's not installed as a python module, and because changes are only
# merged into new python versions (v3.2+).
'''
From gdb 7 onwards, gdb's build can be... | bsd-3-clause |
SOM-st/RTruffleSOM | tests/basic_interpreter_test.py | 2 | 5852 | import unittest
import sys
from parameterized import parameterized
from som.compiler.parse_error import ParseError
from som.vm.universe import create_universe
from som.vmobjects.clazz import Class
from som.vmobjects.double import Double
from som.vmobjects.integer import Integer
from som.vmobjects.symbol i... | mit |
biswajitsahu/kuma | vendor/packages/pkg_resources/_vendor/packaging/specifiers.py | 101 | 27684 | # Copyright 2014 Donald Stufft
#
# 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, so... | mpl-2.0 |
xodus7/tensorflow | tensorflow/contrib/gan/python/features/python/conditioning_utils_impl.py | 28 | 3817 | # 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 |
dustinrb/mezzanine | mezzanine/utils/urls.py | 7 | 4081 | from __future__ import unicode_literals
from future.builtins import str
import re
import unicodedata
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import (resolve, reverse, NoReverseMatch,
get_script_prefix)
from django.shortcuts import redir... | bsd-2-clause |
pattisdr/lookit-api | accounts/migrations/0009_auto_20170710_1438.py | 1 | 1326 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-10 14:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0008_merge_20170707_1801'),
]
operations = [
migrations.AlterModelOptio... | mit |
Godiyos/python-for-android | python3-alpha/python3-src/Tools/demo/mcast.py | 112 | 2223 | #!/usr/bin/env python3
"""
Send/receive UDP multicast packets.
Requires that your OS kernel supports IP multicast.
Usage:
mcast -s (sender, IPv4)
mcast -s -6 (sender, IPv6)
mcast (receivers, IPv4)
mcast -6 (receivers, IPv6)
"""
MYPORT = 8123
MYGROUP_4 = '225.0.0.250'
MYGROUP_6 = 'ff15:7079:7468:6f6e:646... | apache-2.0 |
abhishek-ch/kaggle_facebook_recruiting_human_or_bot | plot_data.py | 2 | 2041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 23:15:29 2015
@author: ddboline
"""
import os
import matplotlib
matplotlib.use('Agg')
import pylab as pl
from pandas.tools.plotting import scatter_matrix
def create_html_page_of_plots(list_of_plots, prefix='html'):
"""
create html page with ... | mit |
tracierenea/gnuradio | gr-fec/python/fec/qa_ber_bf.py | 33 | 4888 | #!/usr/bin/env python
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
drpaneas/linuxed.gr | lib/python2.7/site-packages/pip/wheel.py | 184 | 20618 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import with_statement
import compileall
import csv
import functools
import hashlib
import os
import re
import shutil
import sys
from base64 import urlsafe_b64encode
from email.parser import Parser
from pip.backwardcompat i... | mit |
sserrot/champion_relationships | venv/Lib/site-packages/prompt_toolkit/key_binding/bindings/page_navigation.py | 1 | 2309 | """
Key bindings for extra page navigation: bindings for up/down scrolling through
long pages, like in Emacs or Vi.
"""
from prompt_toolkit.filters import buffer_has_focus, emacs_mode, vi_mode
from prompt_toolkit.key_binding.key_bindings import (
ConditionalKeyBindings,
KeyBindings,
KeyBindingsBase,
mer... | mit |
dkillick/iris | lib/iris/tests/unit/analysis/cartography/test_rotate_grid_vectors.py | 1 | 5886 | # (C) British Crown Copyright 2018, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any later ve... | lgpl-3.0 |
AdamHull/namebench | nb_third_party/dns/rdtypes/ANY/LOC.py | 248 | 12571 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
lthurlow/openflow-tcpsnoop | setup.py | 1 | 1114 | #!/usr/bin/python
#sudo mn --custom setup.py --topo mytopo --test pingall
#host --- switch --- host
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
#... | mit |
Southpaw-TACTIC/Team | src/python/Lib/site-packages/PySide/examples/dialogs/classwizard/classwizard_rc.py | 1 | 253010 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri Jul 30 17:18:57 2010
# by: The Resource Compiler for PySide (Qt v4.6.2)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = "\
\x00\x00\x06\x53\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x4... | epl-1.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.6.0/Lib/contextlib.py | 2 | 13171 | """Utilities for with-statement contexts. See PEP 343."""
import abc
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "AbstractContextManager",
"ContextDecorator", "ExitStack", "redirect_stdout",
"redirect_stderr", "suppress"]
class A... | mit |
doodersrage/CheapLocalDeals.com | includes/libs/fckeditor/editor/filemanager/connectors/py/fckutil.py | 54 | 4235 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | mit |
tow/dnspython | tests/test_exceptions.py | 6 | 2136 | # Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | isc |
CyanogenMod/android_kernel_htc_flounder | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
kozmikkick/kozmikkernel3.8 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
cndavy/JFinal_Authority | jfinal-authority/src/main/webapp/static/js/xgcalendar/jsonhelp.py | 2 | 2680 | # -*- coding: utf-8 -*-
import datetime,time
import decimal
from django.utils import simplejson
def safe_new_datetime(d):
kw = [d.year, d.month, d.day]
if isinstance(d, datetime.datetime):
kw.extend([d.hour, d.minute, d.second, d.microsecond, d.tzinfo])
return datetime.datetime(*kw)
def safe_new_d... | apache-2.0 |
gtostock/foursquared | 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 |
yuzhangcmu/Python-Study | Leetcode/String_to_Integer_atoi.py | 2 | 2023 | """
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible t... | mit |
15Dkatz/pants | tests/python/pants_test/backend/project_info/tasks/test_ensime_integration.py | 31 | 1642 | # coding=utf-8
# Copyright 2014 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 os
from pant... | apache-2.0 |
cherusk/ansible | lib/ansible/modules/database/postgresql/postgresql_ext.py | 64 | 6115 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
Upande/MaMaSe | apps/galleryapp/thumbs.py | 1 | 7714 | # -*- encoding: utf-8 -*-
"""
django-thumbs
http://django.es
"""
from __future__ import division #Decimal division
from django.db.models import ImageField
from django.db.models.fields.files import ImageFieldFile
from PIL import Image
from django.core.files.base import ContentFile
import cStringIO
def generate_thu... | apache-2.0 |
zeickan/Infected-Engine | store/functions.py | 2 | 1347 | import random
import string
import re
def random_generator(size=6 , chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
"""
def pruebas(request):
# Formulario
if request.method == 'POST':
form = ProPedidoForm(request.POST)
if form.is_... | apache-2.0 |
BeDjango/intef-openedx | cms/djangoapps/contentstore/management/commands/populate_creators.py | 182 | 2406 | """
Script for granting existing course instructors course creator privileges.
This script is only intended to be run once on a given environment.
"""
from course_creators.views import add_user_with_status_granted, add_user_with_status_unrequested
from django.core.management.base import BaseCommand
from django.contri... | agpl-3.0 |
DinoTools/dionaea | modules/python/dionaea/sip/rfc3261.py | 1 | 22112 | # This file is part of the dionaea honeypot
#
# SPDX-FileCopyrightText: 2011-2020 PhiBo (DinoTools)
#
# SPDX-License-Identifier: GPL-2.0-or-later
import re
import logging
import time
try:
from dionaea.sip import rfc2396, rfc4566
from dionaea.sip.extras import int2bytes, ErrorWithResponse
except:
import rf... | gpl-2.0 |
Xaltotun/conan | conans/server/rest/controllers/conan_controller.py | 4 | 9988 | from conans.server.rest.controllers.controller import Controller
from bottle import request
from conans.model.ref import ConanFileReference, PackageReference
from conans.server.service.service import ConanService, SearchService
from conans.errors import NotFoundException
import json
from conans.paths import CONAN_MANIF... | mit |
trondeau/gnuradio-old | grc/base/Param.py | 6 | 7177 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
scivision/dmcutils | tests/TestHDF5writeRace.py | 1 | 1154 | #!/usr/bin/env python
"""
testing possible pytables vs h5py race on write/append
"""
from tempfile import mkstemp
from pathlib import Path
import h5py
from pandas import Series
import numpy as np
def test_h5race(outfn: Path, N: int):
assert isinstance(N, int)
ticks = np.random.randint(0, N, N)
flist = [P... | gpl-3.0 |
xantin/qualitybots | src/appengine/models/site.py | 26 | 3464 | #!/usr/bin/python2.4
#
# Copyright 2011 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... | apache-2.0 |
adamchainz/ansible | lib/ansible/plugins/callback/junit.py | 92 | 8951 | # (c) 2016 Matt Clay <matt@mystile.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... | gpl-3.0 |
erjohnso/ansible | lib/ansible/modules/monitoring/sensu_silence.py | 60 | 8521 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Steven Bambling <smbambling@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | gpl-3.0 |
bastik/youtube-dl | youtube_dl/extractor/jove.py | 177 | 3068 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate
)
class JoveIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)'
_CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide... | unlicense |
shadowbq/dot.atom | home/.atom/packages/wakatime/lib/wakatime-master/wakatime/packages/pygments_py2/pygments/lexers/robotframework.py | 77 | 18633 | # -*- coding: utf-8 -*-
"""
pygments.lexers.robotframework
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Robot Framework.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Copyright 2012 Nokia Siemens Networks Oyj
#
# Licensed under the ... | mit |
shupelneker/gae_new_structure | bp_content/themes/default/handlers/_lib/twitter.py | 22 | 5437 | from boilerplate.lib.oauth2 import Consumer as OAuthConsumer, Token, Request as OAuthRequest, \
SignatureMethod_HMAC_SHA1
import urllib2
import json
import webapp2
from urlparse import parse_qs
# Twitter configuration
TWITTER_SERVER = 'api.twitter.com'
TWITTER_REQUEST_TOKEN_URL = 'https://%s/oauth/r... | lgpl-3.0 |
ArthurGarnier/SickRage | lib/github/tests/Issue.py | 7 | 9092 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.