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 |
|---|---|---|---|---|---|
shinfan/api-client-staging | generated/python/gapic-google-cloud-pubsub-v1/google/cloud/gapic/pubsub/v1/subscriber_client.py | 7 | 49157 | # Copyright 2017, 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 ... | bsd-3-clause |
mortii/reddit_instagram_bot | instagram_scraper.py | 1 | 3201 | import json
import urllib2 as urllib
import re as regex
from bs4 import BeautifulSoup
import streamable
import imgur
class Instagram:
def __init__(self, url):
url_reader = urllib.urlopen(url)
soup = BeautifulSoup(url_reader, 'html.parser')
self.url = url
self.user = self._get_user(soup)
self.title, self.... | gpl-3.0 |
Michal-Fularz/decision_tree | decision_trees/own_parfit/plot.py | 2 | 6724 | import matplotlib.pyplot as plt
import matplotlib.colorbar as cb
import numpy as np
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=UserWarning)
__all__ = ["plot1DGrid", "plot2DGrid", "plot3DGrid", "plotScores"]
def plot1DGrid(scores, paramsT... | mit |
thanhacun/odoo | addons/crm_profiling/wizard/__init__.py | 438 | 1080 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
wkeyword/pip | pip/pep425tags.py | 249 | 4427 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import re
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
_osx_arch_pat = re.compile(r'(.+)_(... | mit |
Hasimir/brython | www/src/Lib/importlib/abc.py | 743 | 14595 | """Abstract base classes related to import."""
from . import _bootstrap
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
import abc
import imp
import marshal
import sys
import tokenize
import warnings
... | bsd-3-clause |
jmesteve/medical | openerp/tests/addons/test_impex/models.py | 95 | 5855 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
def selection_fn(obj, cr, uid, context=None):
return list(enumerate(["Corge", "Grault", "Wheee", "Moog"]))
def function_fn(model, cr, uid, ids, field_name, arg, context):
return dict((id, 3) for id in ids)
def function_fn_write(model, cr, uid, id, fi... | agpl-3.0 |
yhpeng-git/mxnet | example/ssd/demo.py | 9 | 4697 | import argparse
import tools.find_mxnet
import mxnet as mx
import os
import importlib
import sys
from detect.detector import Detector
CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', ... | apache-2.0 |
klausman/scion | python/lib/sciond_api/host_info.py | 3 | 2021 | # Copyright 2017 ETH Zurich
#
# 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, sof... | apache-2.0 |
red-hood/calendarserver | txweb2/dav/method/report_principal_search_property_set.py | 1 | 2879 | # -*- test-case-name: txweb2.dav.test.test_report_expand -*-
##
# Copyright (c) 2006-2015 Apple Inc. 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 without restriction... | apache-2.0 |
mmardini/django | tests/generic_views/test_edit.py | 22 | 17034 | from __future__ import unicode_literals
from unittest import expectedFailure
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
from django.views... | bsd-3-clause |
skygenomics/CSBB-v1.0 | WINDOWS_VERSION/Modules/PCA_Samples.py | 2 | 2048 | print '\n''Importing Libraries''\n'
import pip
def install(package):
pip.main(['install', package])
uninstall(numpy)
uninstall(scipy)
install(numpy)
install(scipy)
install(--upgrade,numpy)
install(--upgrade,scipy)
install(pandas)
install(--upgrade,pandas)
install(scikit-learn)
... | mit |
peeyush-tm/check_mk | web/plugins/icons/wato.py | 3 | 2730 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
takeshineshiro/neutron | neutron/db/migration/alembic_migrations/ryu_init_ops.py | 47 | 1206 | # Copyright 2014 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 ... | apache-2.0 |
vaygr/ansible | lib/ansible/modules/packaging/os/slackpkg.py | 14 | 6161 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kim Nørgaard
# Written by Kim Nørgaard <jasen@jasen.dk>
# Based on pkgng module written by bleader <bleader@ratonland.org>
# that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <htt... | gpl-3.0 |
khkaminska/bokeh | bokeh/compat/mplexporter/renderers/fake_renderer.py | 64 | 2561 | from .base import Renderer
class FakeRenderer(Renderer):
"""
Fake Renderer
This is a fake renderer which simply outputs a text tree representing the
elements found in the plot(s). This is used in the unit tests for the
package.
Below are the methods your renderer must implement. You are fre... | bsd-3-clause |
hephaex/kernel | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
golismero/golismero-devel | thirdparty_libs/nltk/test/doctest_nose_plugin.py | 12 | 5686 | # -*- coding: utf-8 -*-
"""
Patched version of nose doctest plugin.
See https://github.com/nose-devs/nose/issues/7
"""
from nose.plugins.doctests import *
class _DoctestFix(Doctest):
def options(self, parser, env):
super(_DoctestFix, self).options(parser, env)
parser.add_option('--doctest-options'... | gpl-2.0 |
MyAOSP/external_chromium_org | third_party/closure_linter/closure_linter/errorrules.py | 156 | 1379 | #!/usr/bin/env python
#
# Copyright 2010 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 |
apasricha/KVMTrace-kernel-mod | 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 |
jandrest2018/TWJ-2017-A | 04 Angular/C-Web/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | mit |
luiscberrocal/homeworkpal | homeworkpal_project/employee/tests/factories.py | 1 | 2598 | import string
from django.conf import settings
from django.contrib.auth.models import User
from factory import LazyAttribute, lazy_attribute, SubFactory, Iterator
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyText
from faker import Factory as FakerFactory
from employee.models import TENUR... | mit |
chadoe/xbmc | tools/EventClients/lib/python/bt/hid.py | 181 | 2733 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-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 2 of the License, or
# (at your option) any later version.
... | gpl-2.0 |
frankvdp/django | django/contrib/gis/gdal/prototypes/raster.py | 59 | 5690 | """
This module houses the ctypes function prototypes for GDAL DataSource (raster)
related data structures.
"""
from ctypes import POINTER, c_bool, c_char_p, c_double, c_int, c_void_p
from functools import partial
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, std_call
from django.contrib.gis.gdal.prototype... | bsd-3-clause |
OpenAcademy-OpenStack/nova-scheduler | nova/scheduler/filters/metrics_filter.py | 12 | 1979 | # Copyright (c) 2014 Intel, 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 |
mensler/ansible | examples/scripts/uptime.py | 58 | 3218 | #!/usr/bin/env python
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.plugins.callbac... | gpl-3.0 |
guorendong/iridium-browser-ubuntu | third_party/WebKit/Source/bindings/scripts/v8_dictionary.py | 6 | 8246 | # 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.
"""Generate template contexts of dictionaries for both v8 bindings and
implementation classes that are used by blink's core/modules.
"""
import operator
fro... | bsd-3-clause |
lz1988/django-web2015 | tests/regressiontests/http_utils/tests.py | 52 | 1551 | from __future__ import unicode_literals
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
from django.http.utils import conditional_content_removal
from django.test import TestCase
class HttpUtilTests(TestCase):
def test_conditional_content_removal(self):
"""
Tests that co... | bsd-2-clause |
Sonicbids/django | django/contrib/gis/geos/prototypes/topology.py | 48 | 2756 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_cascaded_union',
'geos_centroid', 'geos_convexhull', 'geos_difference',
'geos_envelope', 'geos_intersection', 'geos_linemerge',
... | bsd-3-clause |
kuanyui/django-haystack | haystack/manager.py | 27 | 3657 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from haystack.query import EmptySearchQuerySet, SearchQuerySet
class SearchIndexManager(object):
def __init__(self, using=None):
super(SearchIndexManager, self).__init__()
self.using = using
... | bsd-3-clause |
windinthew/audacity | lib-src/lv2/lv2/waflib/Tools/xlc.py | 330 | 1175 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlc(conf):
cc=conf.find_program(['xlc_r','xlc'],var='CC')
cc=conf.cmd_to_list(cc)
conf.g... | gpl-2.0 |
kslundberg/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/jvm_platform_integration_mixin.py | 5 | 10415 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | apache-2.0 |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/created_date_v30_rc2.py | 1 | 3094 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | mit |
OE-Backup/Infrastructure | site-cookbooks/pp2-ps/files/default/fo-prd/mail_app_running.py | 1 | 1076 | #!/usr/bin/python
import smtplib
def prompt(prompt):
return raw_input(prompt).strip()
fromaddr = 'noreply@openenglish.com'
toaddrs = 'notifications@openenglish.com'
msg = """From: noreply@openenglish.com
To: notifications@openenglish.com
Subject: [PRD] Payment Service app is UP in slave (10.0.111.15).
Payment ... | apache-2.0 |
matbu/ansible-modules-extras | cloud/amazon/ec2_vpc_nacl_facts.py | 45 | 6624 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
SebDieBln/QGIS | python/plugins/processing/core/GeoAlgorithm.py | 1 | 20746 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GeoAlgorithmExecutionException.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********... | gpl-2.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/encodings/cp424.py | 272 | 12055 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | apache-2.0 |
mdhaman/superdesk-core | superdesk/__init__.py | 2 | 5286 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""Superdesk... | agpl-3.0 |
manazag/hopper.pw | hopperpw/main/south_migrations/0004_updated_host_fields.py | 4 | 4762 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Host.comment'
db.alter_column(u'main_host', 'comment', self.gf('django.db.models.fields.C... | bsd-3-clause |
pombredanne/invenio-old | modules/elmsubmit/lib/elmsubmit_richtext2txt.py | 4 | 13971 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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 versio... | gpl-2.0 |
nk113/django-ficuspumila | setup.py | 1 | 1392 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# import to get rid of an error in atexit._run_exitfuncs
import logging
import multiprocessing
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_pac... | bsd-3-clause |
gustavomazevedo/tbackup-server | server/migrations/0004_auto__del_field_backup_origin__add_field_backup_user.py | 1 | 9066 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Backup.origin'
db.delete_column(u'server_backup', 'orig... | mit |
jotes/pontoon | pontoon/sync/tests/test_checks.py | 1 | 3190 | from unittest.mock import patch, PropertyMock
from pontoon.base.utils import aware_datetime
from pontoon.base.tests import TranslationFactory
from pontoon.checks.models import (
Warning,
Error,
)
from pontoon.sync.tests import FakeCheckoutTestCase
class TestChangesetTranslationsChecks(FakeCheckoutTestCase):
... | bsd-3-clause |
mmauroy/SickRage | sickbeard/providers/thepiratebay.py | 4 | 8954 | # Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 Lic... | gpl-3.0 |
moniqx4/bite-project | server/handlers/examples_handler.py | 17 | 1145 | # Copyright 2010 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 |
tlodge/dataware.nox | src/nox/netapps/user_event_log/networkeventsws.py | 9 | 14432 | # -*- coding: utf8 -*-
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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 |
mahak/cinder | cinder/tests/unit/volume/drivers/netapp/dataontap/utils/test_utils.py | 2 | 6375 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
mzizzi/ansible | lib/ansible/modules/network/eos/eos_user.py | 20 | 12545 | #!/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 |
jusdng/odoo | addons/l10n_be_coda/l10n_be_coda.py | 340 | 1253 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 |
krellsarah/bingo-generator | src/pdfkit/api.py | 8 | 3119 | # -*- coding: utf-8 -*-
from .pdfkit import PDFKit
from .pdfkit import Configuration
def from_url(url, output_path, options=None, toc=None, cover=None, configuration=None):
"""
Convert file of files from URLs to PDF document
:param url: URL or list of URLs to be saved
:param output_path: path to out... | mit |
ferittuncer/ITU-Turkish-NLP-Pipeline-Caller | setup.py | 1 | 1031 | import pipeline_caller
from setuptools import setup, find_packages
def readme():
with open('README.rst') as f:
return f.read()
setup(
name="ITU-Turkish-NLP-Pipeline-Caller",
version=pipeline_caller.version,
packages=find_packages(),
py_modules=['pipeline_caller'],
entry_points={
... | gpl-2.0 |
puracore/pura | qa/rpc-tests/test_framework/netutil.py | 45 | 5014 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Linux network utilities
import sys
import socket
import fcntl
import struct
import array
import os
fro... | mit |
bholley/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/command.py | 258 | 3985 | """Dispatches requests to remote WebDriver endpoint."""
import exceptions
import httplib
import json
import urlparse
import webelement
class CommandExecutor(object):
"""Dispatches requests to remote WebDriver endpoint."""
_HEADERS = {
"User-Agent": "Python WebDriver Local End",
"Content-Type... | mpl-2.0 |
roadmapper/ansible | lib/ansible/modules/cloud/google/gcp_compute_http_health_check.py | 13 | 15217 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
integree/django-congo | congo/maintenance/tests/unused_user_accounts.py | 1 | 1266 | # -*- coding: utf-8 -*-
from congo.conf import settings
from congo.maintenance.tests import BaseTest
from datetime import timedelta
from django.apps import apps
from django.utils import timezone
from django.utils.formats import date_format
from django.utils.translation import ugettext_lazy as _
from congo.templ... | mit |
dermoth/gramps | gramps/gen/db/__init__.py | 10 | 2522 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
yonilx/show-attend-and-tell-django | showattendtell/cococaption/pycocoevalcap/rouge/rouge.py | 10 | 3643 | #!/usr/bin/env python
#
# File Name : rouge.py
#
# Description : Computes ROUGE-L metric as described by Lin and Hovey (2004)
#
# Creation Date : 2015-01-07 06:03
# Author : Ramakrishna Vedantam <vrama91@vt.edu>
import numpy as np
import pdb
def my_lcs(string, sub):
"""
Calculates longest common subsequence ... | mit |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py | 439 | 24250 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .auth import _basic_auth_str
from .compat import cookielib, Or... | bsd-3-clause |
JTCunning/sentry | tests/sentry/web/frontend/projects/tests.py | 14 | 8141 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import mock
import logging
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import ProjectKey, ProjectKeyStatus, ProjectOption, TagKey
from sentry.testutils import TestCase
logger = logging.getLog... | bsd-3-clause |
maxkoryukov/headphones | lib/mako/ext/babelplugin.py | 60 | 2064 | # ext/babelplugin.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""gettext message extraction via Babel: http://babel.edgewall.org/"""
from babel.messages.extr... | gpl-3.0 |
marcoarruda/MissionPlanner | Lib/lib2to3/fixes/fix_filter.py | 61 | 2183 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
N... | gpl-3.0 |
pas256/ansible | test/units/playbook/test_attribute.py | 219 | 1824 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
davidzchen/tensorflow | tensorflow/python/debug/lib/debug_data_test.py | 14 | 11805 | # 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 |
jordiclariana/ansible | lib/ansible/modules/commands/raw.py | 7 | 3364 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
mayfield/snowflake-connector-python | file_compression_type.py | 1 | 3100 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2017 Snowflake Computing Inc. All right reserved.
#
class FileCompressionType():
def __init__(self):
pass
Types = {
u'GZIP': {
u'name': u'GZIP',
u'file_extension': u'.gz',
u'mime_type': u'... | apache-2.0 |
shakamunyi/os-cloud-config | os_cloud_config/cmd/init_keystone.py | 1 | 3490 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 |
rdo-management/neutron | neutron/plugins/metaplugin/meta_models_v2.py | 45 | 1594 | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | apache-2.0 |
dsajkl/reqiop | common/djangoapps/track/views/tests/test_segmentio.py | 2 | 13634 | """Ensure we can parse events sent to us from the segment.io webhook integration"""
from datetime import datetime
import json
from ddt import ddt, data, unpack
from mock import sentinel
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.test.utils import override_se... | agpl-3.0 |
sargas/scipy | scipy/optimize/nonlin.py | 1 | 46280 | r"""
.. module:: scipy.optimize.nonlin
=================
Nonlinear solvers
=================
.. currentmodule:: scipy.optimize
This is a collection of general-purpose nonlinear multidimensional
solvers. These solvers find *x* for which *F(x) = 0*. Both *x*
and *F* can be multidimensional.
Routines
========
Large-... | bsd-3-clause |
Jet-Streaming/framework | deps/googletest/googlemock/scripts/fuse_gmock_files.py | 242 | 8631 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mpl-2.0 |
ashishnerkar1/scrapy | tests/test_utils_iterators.py | 11 | 13686 | import os
from twisted.trial import unittest
from scrapy.utils.iterators import csviter, xmliter, _body_or_str
from scrapy.contrib_exp.iterators import xmliter_lxml
from scrapy.http import XmlResponse, TextResponse, Response
from tests import get_testdata
FOOBAR_NL = u"foo" + os.linesep + u"bar"
class XmliterTestCa... | bsd-3-clause |
jehutting/kivy | kivy/input/providers/tuio.py | 43 | 12049 | '''
TUIO Input Provider
===================
TUIO is the de facto standard network protocol for the transmission of
touch and fiducial information between a server and a client. To learn
more about TUIO (which is itself based on the OSC protocol), please
refer to http://tuio.org -- The specification should be of specia... | mit |
NeCTAR-RC/nova | nova/db/sqlalchemy/migrate_repo/versions/294_add_service_heartbeat.py | 72 | 1061 | # Copyright (c) 2015 Wind River 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 law or agreed to ... | apache-2.0 |
ahamilton55/ansible | lib/ansible/module_utils/facts/system/date_time.py | 197 | 2597 | # Data and time related facts collection for ansible.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
Sintendo/dolphin | Tools/CleanFiles.py | 161 | 2838 |
import codecs
import os
import glob
standard_sections = [
"Core",
"EmuState",
"OnLoad",
"OnFrame",
"ActionReplay",
"Video",
"Video_Settings",
"Video_Enhancements",
"Video_Hacks",
"Speedhacks",
]
standard_comments = {
"Core": "Values set here will override the main dolphin ... | gpl-2.0 |
jjanssen/django-cms-timetravel | cms_timetravel/managers/plugins.py | 1 | 1902 | import logging
from django.core.exceptions import ValidationError
from cms.models import CMSPlugin
from cms.models.placeholdermodel import Placeholder
from cms.plugin_rendering import PluginContext, render_plugin as _render_plugin
from ..utils import get_timetravel_date
from ..models import Schedulable
def render_p... | apache-2.0 |
shoopio/shoop | shuup_tests/admin/test_product_package.py | 2 | 4243 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from django.forms import formset_factory
from shuup... | agpl-3.0 |
gazpachoking/Flexget | flexget/plugins/operate/sequence.py | 2 | 1822 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import itertools
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('sequence')
class PluginSequence(object):
""" All... | mit |
mjirayu/sit_academy | lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py | 155 | 12352 | """
Synchronizes a mailchimp list with the students of a course.
"""
import logging
import math
import random
import itertools
from itertools import chain
from optparse import make_option
from collections import namedtuple
from django.core.management.base import BaseCommand, CommandError
from mailsnake import MailSna... | agpl-3.0 |
joeyespo/django-extensions | django_extensions/management/commands/sqldsn.py | 12 | 5124 | # -*- coding: utf-8 -*-
"""
sqldns.py - Prints Data Source Name on stdout
"""
import sys
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.core.management.color import color_style
class Command(BaseCommand):
option_lis... | mit |
ntim/hyperion | effects/knight-rider.py | 2 | 1331 | import hyperion
import time
import colorsys
# Get the parameters
speed = float(hyperion.args.get('speed', 1.0))
fadeFactor = float(hyperion.args.get('fadeFactor', 0.7))
color = hyperion.args.get('color', (255,0,0))
# Check parameters
speed = max(0.0001, speed)
fadeFactor = max(0.0, min(fadeFactor, 1.0))
# Initiali... | mit |
zengenti/ansible | lib/ansible/modules/network/aos/aos_blueprint.py | 13 | 9007 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
raymondxyang/tensorflow | tensorflow/python/kernel_tests/depthtospace_op_test.py | 90 | 8089 | # 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 |
xcasper/python_koans | python3/koans/about_asserts.py | 37 | 2280 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
# Confused? This video should help:
#
# http://bit.ly/about_asserts... | mit |
rdblue/Impala | infra/python/bootstrap_virtualenv.py | 12 | 5526 | # Copyright (c) 2015 Cloudera, 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 o... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/image_data_disk_py3.py | 1 | 2698 | # 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 |
rhndg/openedx | common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py | 2 | 117042 | # pylint: disable=no-member
"""
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
from collections import namedtuple
import datetime
import logging
import ddt
import itertools
import mimetypes
from unittest import skip
from uuid import uuid4
from contextlib import contextmana... | agpl-3.0 |
robcza/intelmq | intelmq/tests/bots/experts/modify/test_expert.py | 1 | 2270 | # -*- coding: utf-8 -*-
"""
Testing modify expert bot.
"""
import unittest
from pkg_resources import resource_filename
import intelmq.lib.test as test
from intelmq.bots.experts.modify.expert import ModifyExpertBot
EVENT_TEMPL = {"__type": "Event",
"feed.name": "Spamhaus Cert",
"feed.ur... | agpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/botocore/vendored/requests/packages/urllib3/response.py | 478 | 16459 | try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... | mit |
windskyer/nova | nova/objects/tag.py | 11 | 2493 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | gpl-2.0 |
katsikas/gnuradio | build/gr-pager/swig/pager_swig.py | 1 | 21424 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | gpl-3.0 |
tvansteenburgh/PerfKitBenchmarker | perfkitbenchmarker/packages/openmpi.py | 6 | 1879 | # 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 agr... | apache-2.0 |
robintw/scikit-image | doc/examples/plot_holes_and_peaks.py | 15 | 2623 | """
===============================
Filling holes and finding peaks
===============================
In this example, we fill holes (i.e. isolated, dark spots) in an image using
morphological reconstruction by erosion. Erosion expands the minimal values of
the seed image until it encounters a mask image. Thus, the seed... | bsd-3-clause |
lenstr/rethinkdb | test/memcached_workloads/many_rows.py | 34 | 5440 | #!/usr/bin/env python
# Copyright 2010-2015 RethinkDB, all rights reserved.
import os, random, sys, time
try:
xrange
except NameError:
xrange = range
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import rdb_workload_common, vcoptparse, utils
errorToleran... | agpl-3.0 |
icebreaker/dotfiles | gnome/gnome2/gedit/plugins.symlink/advanced-bookmarks/plugin.py | 1 | 5011 | # -*- coding: utf-8 -*-
# Copyright (C) 2008 - Eugene Khorev
#
# 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 version.
#
#... | mit |
larrybradley/astropy | astropy/coordinates/builtin_frames/icrs_observed_transforms.py | 3 | 4323 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains the transformation functions for getting to "observed" systems from ICRS.
"""
import erfa
from astropy import units as u
from astropy.coordinates.builtin_frames.utils import atciqz, aticq
from astropy.coordinates.basef... | bsd-3-clause |
sarvex/tensorflow | tensorflow/python/keras/tests/model_architectures.py | 6 | 10308 | # Copyright 2020 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 |
kennethlove/django | django/utils/importlib.py | 445 | 1229 | # Taken from Python 2.7 with permission from/by the original author.
import sys
def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex'):
raise ValueError("'package' not set to a string")
dot = len(package)
for x in ... | bsd-3-clause |
hyperized/ansible | lib/ansible/plugins/lookup/indexed_items.py | 100 | 1579 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (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
DOCUMENTATION = """
lookup: indexed_items
author:... | gpl-3.0 |
ConeyLiu/spark | python/pyspark/shell.py | 37 | 2333 | #
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.