repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
st135yle/django-site
dbenv/lib/python3.4/site-packages/django/templatetags/i18n.py
115
19351
from __future__ import unicode_literals import sys from django.conf import settings from django.template import Library, Node, TemplateSyntaxError, Variable from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context from django.template.defaulttags import token_kwargs from django.utils import six...
mit
nest/nest-simulator
pynest/nest/tests/test_regression_issue-1034.py
11
13081
# -*- coding: utf-8 -*- # # test_regression_issue-1034.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
gpl-2.0
thomasrogers03/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py
261
9573
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
holytortoise/abwreservierung
src/reservierung/views.py
1
19052
from django.shortcuts import render from django.views.generic import TemplateView, ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView from django.views.generic.dates import WeekArchiveView from django.urls import reverse_lazy, reverse from django.contrib.auth.mixins ...
mit
alexhersh/calico
calico/common.py
1
22270
# -*- coding: utf-8 -*- # Copyright (c) 2014, 2015 Metaswitch Networks # 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/licen...
apache-2.0
PyGithub/PyGithub
github/Commit.py
2
15054
############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
lgpl-3.0
scalable-networks/gnuradio-3.7.0.1
gr-blocks/python/blocks/qa_stream_mux.py
10
6241
#!/usr/bin/env python # # Copyright 2004,2005,2007,2010,2012,2013 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 ...
gpl-3.0
eos87/Booktype
lib/booktype/apps/edit/utils.py
7
3015
# -*- coding: utf-8 -*- """ Utility functions related with editor app """ import sputnik from lxml import etree from booktype.utils.plugins import icejs def clean_chapter_html(content, text_only=False, **kwargs): """ Removes icejs contents for now. We could later add more functionality to this function...
agpl-3.0
Pythonify/awesome
venv/lib/python2.7/site-packages/pycparser/ply/ctokens.py
197
3177
# ---------------------------------------------------------------------- # ctokens.py # # Token specifications for symbols in ANSI C and C++. This file is # meant to be used as a library in other tokenizers. # ---------------------------------------------------------------------- # Reserved words tokens = [ # Li...
gpl-3.0
sternb0t/django-pandas
django_pandas/io.py
1
3578
import pandas as pd from .utils import update_with_verbose import django def to_fields(qs, fieldnames): for fieldname in fieldnames: model = qs.model for fieldname_part in fieldname.split('__'): try: field = model._meta.get_field(fieldname_part) except djang...
bsd-3-clause
martinbuc/missionplanner
Lib/tokenize.py
53
16889
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see tok...
gpl-3.0
HiSPARC/station-software
user/python/Lib/logging/handlers.py
7
48297
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-3.0
nicholasserra/sentry
src/sentry/api/serializers/models/grouptagvalue.py
2
2101
from __future__ import absolute_import import operator from django.db.models import Q from sentry.api.serializers import Serializer, register from sentry.models import EventUser, GroupTagValue, TagKey, TagValue def parse_user_tag(value): lookup, value = value.split(':', 1) if lookup == 'id': lookup...
bsd-3-clause
mrquim/mrquimrepo
repo/script.module.trakt/lib/trakt/objects/movie.py
4
5715
from __future__ import absolute_import, division, print_function from trakt.core.helpers import from_iso8601_datetime, to_iso8601_datetime,\ from_iso8601_date, to_iso8601_date, deprecated from trakt.objects.core.helpers import update_attributes from trakt.objects.video import Video class Movie(Video): def __...
gpl-2.0
Urumasi/Flask-Bones
app/data/models/oauth.py
1
5170
from flask_login import UserMixin from app.extensions import cache ,bcrypt import bcrypt as bcr from .. import db from ..mixins import CRUDMixin import datetime from rauth import OAuth1Service, OAuth2Service from flask import current_app, url_for, request, redirect, session class Oauth(CRUDMixin, UserMixin, db.Model)...
mit
waytai/django
django/utils/timesince.py
409
2671
from __future__ import unicode_literals import calendar import datetime from django.utils.html import avoid_wrapping from django.utils.timezone import is_aware, utc from django.utils.translation import ugettext, ungettext_lazy TIMESINCE_CHUNKS = ( (60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')), ...
bsd-3-clause
PetrDlouhy/django
django/views/generic/list.py
471
7630
from __future__ import unicode_literals from django.core.exceptions import ImproperlyConfigured from django.core.paginator import InvalidPage, Paginator from django.db.models.query import QuerySet from django.http import Http404 from django.utils import six from django.utils.translation import ugettext as _ from djang...
bsd-3-clause
HighwayStar/android_kernel_xiaomi_mocha
tools/perf/util/setup.py
2079
1438
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
edoko/AirKernel_NS_JBN
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
nvoron23/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/regrtest.py
55
37786
#! /usr/bin/env python """Regression test. This will find all modules whose name is "test_*" in the test directory, and run them. Various command line options provide additional facilities. Command line options: -v: verbose -- run tests in verbose mode with output to stdout -w: verbose2 -- re-run failed tests...
apache-2.0
slayerjain/servo
components/script/dom/bindings/codegen/parser/tests/test_union.py
134
5370
import WebIDL import itertools import string # We'd like to use itertools.chain but it's 2.6 or higher. def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F for it in iterables: for element in it: yield element # We'd like to use itertools.combinations but it's 2.6 or higher. def c...
mpl-2.0
ruibarreira/linuxtrail
usr/lib/python2.7/encodings/iso8859_8.py
593
11292
""" Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.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='...
gpl-3.0
lattwood/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py
124
6488
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
felixfontein/ansible
test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/parsing.py
47
10112
# 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
ResEl-TB/stages
search/tests.py
1
2810
from django.test import TestCase from django.contrib.auth.models import User from django.core.urlresolvers import reverse from post.models import Zone, Duree, Domaine, TypeContrat, Annonce from .forms import SearchForm class SearchForms(TestCase): def setUp(self): zone = Zone.objects.create(nom='île-de-fr...
gpl-2.0
markslwong/tensorflow
tensorflow/python/debug/cli/curses_widgets_test.py
137
9632
# 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
astorije/ansible-modules-extras
packaging/os/pacman.py
3
10316
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it un...
gpl-3.0
pgleeson/TempRepo3
lib/jython/Lib/SocketServer.py
10
19275
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <s...
gpl-2.0
dlazz/ansible
lib/ansible/plugins/connection/saltstack.py
7
3736
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # Based on func.py # (c) 2014, Michael Scherer <misc@zarb.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt...
gpl-3.0
AndyHelix/django-xadmin
xadmin/views/edit.py
9
19694
import copy from django import forms from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied, FieldError from django.db import models, transaction from django.forms.models import modelform_factory, modelform_defines_fields from django.http import Http404, HttpResp...
bsd-3-clause
chjw8016/GreenOdoo7-haibao
openerp/addons/crm/crm_phonecall.py
14
14638
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
mit
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/monitoring/notifications.py
1
34263
""" Class for managing notifications in pegasus-monitord. """ ## # Copyright 2007-2011 University Of Southern California # # 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.a...
gpl-3.0
pfgenyun/tamarin-redux
build/buildbot/master/custom/buildbot/slave/commands.py
8
105843
# -*- test-case-name: buildbot.test.test_slavecommand -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os, re, signal, shutil, types, time from stat import S...
mpl-2.0
mparus/android_kernel_huawei_msm8916-caf
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
amolenaar/gaphor
gaphor/tests/testcase.py
1
5292
""" Basic test case for Gaphor tests. Everything is about services so the TestCase can define it's required services and start off. """ import logging import unittest from io import StringIO from typing import Type, TypeVar from gaphas.aspect import ConnectionSink from gaphas.aspect import Connector as ConnectorAspe...
lgpl-2.1
patriciolobos/desa8
openerp/addons/base/tests/test_views.py
60
39203
# -*- encoding: utf-8 -*- from functools import partial import itertools import unittest2 from lxml import etree as ET from lxml.builder import E from psycopg2 import IntegrityError from openerp.tests import common import openerp.tools Field = E.field class ViewCase(common.TransactionCase): def setUp(self): ...
agpl-3.0
xorpaul/shinken
test/test_poller_addition.py
1
10776
#!/usr/bin/env python # Copyright (C) 2009-2010: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
thiagopnts/servo
tests/wpt/web-platform-tests/fetch/api/resources/inspect-headers.py
133
1053
def main(request, response): headers = [] request_headers = [] if "headers" in request.GET: checked_headers = request.GET.first("headers").split("|") for header in checked_headers: if header in request.headers: headers.append(("x-request-" + header, request.headers.ge...
mpl-2.0
fintech-circle/edx-platform
lms/djangoapps/instructor_task/tests/test_tasks.py
1
23409
""" Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ from functools import partial import json from uuid import uuid4 from celery.states import SUCCESS, FAILURE import ddt from django.utils.translation import ugettext_no...
agpl-3.0
waheedahmed/edx-platform
scripts/runone.py
182
3124
#!/usr/bin/env python import argparse import os import sys # I want this: # ERROR: test_update_and_fetch (edx-platform.cms.djangoapps.contentstore.tests.test_course_settings.CourseDetailsViewTest) # to become: # test --settings=cms.envs.test --pythonpath=. -s cms/djangoapps/contentstore/tests/test_course_settings...
agpl-3.0
StephenWeber/ansible
lib/ansible/modules/network/junos/junos_facts.py
24
4232
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
t794104/ansible
lib/ansible/modules/storage/netapp/na_ontap_snmp.py
38
4752
#!/usr/bin/python """ create SNMP module to add/delete/modify SNMP user """ # (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'...
gpl-3.0
nugget/home-assistant
homeassistant/components/mqtt/server.py
7
3055
""" Support for a local MQTT broker. For more details about this component, please refer to the documentation at https://home-assistant.io/components/mqtt/#use-the-embedded-broker """ import asyncio import logging import tempfile import voluptuous as vol from homeassistant.const import EVENT_HOMEASSISTANT_STOP impor...
apache-2.0
Ballz0fSteel/Umeko
lib/youtube_dl/extractor/leeco.py
23
13111
# coding: utf-8 from __future__ import unicode_literals import base64 import datetime import hashlib import re import time from .common import InfoExtractor from ..compat import ( compat_ord, compat_str, compat_urllib_parse_urlencode, ) from ..utils import ( determine_ext, encode_data_uri, Ext...
gpl-3.0
asajeffrey/servo
tests/wpt/web-platform-tests/tools/lint/rules.py
3
15945
from __future__ import unicode_literals import abc import inspect import os import re import six MYPY = False if MYPY: # MYPY is set to True when run under Mypy. from typing import Any, List, Match, Optional, Pattern, Text, Tuple, cast Error = Tuple[Text, Text, Text, Optional[int]] def collapse(text): ...
mpl-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.3/django/db/backends/mysql/base.py
54
13894
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
mit
gunchleoc/django
django/contrib/gis/db/backends/oracle/models.py
475
2275
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/twisted/twisted/mail/relay.py
28
3717
# -*- test-case-name: twisted.mail.test.test_mail -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Support for relaying mail for twisted.mail""" from twisted.mail import smtp from twisted.python import log from twisted.internet.address import UNIXAddress import os try: import cPic...
agpl-3.0
bbiskup/cpp_benchmarks
vendor/google/googletest/googlemock/test/gmock-function-mocker_nc_test.py
63
1346
"""Negative compilation tests for Google Mock macro MOCK_METHOD.""" import os import sys IS_LINUX = os.name == "posix" and os.uname()[0] == "Linux" if not IS_LINUX: sys.stderr.write( "WARNING: Negative compilation tests are not supported on this platform") sys.exit(0) # Suppresses the 'Import not at the to...
mit
kenshay/ImageScripter
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdtypes/IN/AAAA.py
248
2187
# 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 ...
gpl-3.0
ceholden/landsat_tile
setup.py
3
1060
import os from setuptools import find_packages, setup import sys PY2 = sys.version_info[0] == 2 # Get version with open(os.path.join('tilezilla', 'version.py')) as f: for line in f: if line.find('__version__') >= 0: version = line.split("=")[1].strip() version = version.strip('"')...
bsd-3-clause
superchilli/webapp
venv/lib/python2.7/site-packages/werkzeug/useragents.py
257
5418
# -*- coding: utf-8 -*- """ werkzeug.useragents ~~~~~~~~~~~~~~~~~~~ This module provides a helper to inspect user agent strings. This module is far from complete but should work for most of the currently available browsers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta...
mit
ticosax/django
tests/admin_views/tests.py
8
296033
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import re import unittest from django.contrib.admin import ModelAdmin from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.models import ADDITION, DELETION, LogEntry from django.contrib.admin.o...
bsd-3-clause
Java1Guy/ansible-modules-extras
monitoring/zabbix_hostmacro.py
91
7996
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # # 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 # (...
gpl-3.0
vdeluca/tfi
manage.py
44
1062
#!/usr/bin/env python ######################################################################### # # Copyright (C) 2012 OpenPlans # # 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-3.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/core/rules.py
29
1552
""" Replacement rules. """ from __future__ import print_function, division class Transform(object): """ Immutable mapping that can be used as a generic transformation rule. Parameters ---------- transform : callable Computes the value corresponding to any key. filter : callable, opti...
mit
arenadata/ambari
contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/services/HIVE/package/scripts/webhcat_service_check.py
10
4456
#!/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
tmuelle2/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/outputtee_unittest.py
124
1987
# Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and t...
bsd-3-clause
brucetsao/python-devicecloud
devicecloud/test/unit/test_ws.py
3
1071
import unittest from devicecloud import DeviceCloudException from mock import MagicMock, patch from devicecloud.ws import WebServiceStub from devicecloud import DeviceCloudConnection class MockConnection(MagicMock): def get(self, *args, **kwargs): return (args, kwargs) def post(self, *args, **kwar...
mpl-2.0
FrankBian/kuma
vendor/lib/python/south/introspection_plugins/django_audit_log.py
154
1436
""" South introspection rules for django-audit-log """ from django.contrib.auth.models import User from django.conf import settings from south.modelsinspector import add...
mpl-2.0
neilpelow/wmap-django
venv/lib/python3.5/site-packages/django/contrib/gis/forms/widgets.py
42
3529
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.template import loader from django.utils import six, translation logger = log...
gpl-3.0
GuillaumeDD/AdventOfCode2016
day08.py
1
5304
from __future__ import print_function # print utilities without systematic '\n' at EOL import io import re # --- Day 8: Two-Factor Authentication --- # # You come across a door implementing what you can only assume is an # implementation of two-factor authentication after a long game of # requirements telephone. # # T...
gpl-3.0
areitz/pants
src/python/pants/fs/archive.py
10
5224
# 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 abc i...
apache-2.0
nispc/ckanext-data_recommendation
ckanext/data_recommendation/plugin.py
1
2619
import ckan.plugins as plugins import ckan.plugins.toolkit as toolkit from ckan.plugins.toolkit import asbool import jieba import jieba.analyse from ckan.plugins.toolkit import request, c import pylons.config as config import opencc class Data_RecommendationPlugin(plugins.SingletonPlugin): plugins.implements(plugi...
agpl-3.0
HyperloopTeam/FullOpenMDAO
lib/python2.7/site-packages/matplotlib/figure.py
10
58719
""" The figure module provides the top-level :class:`~matplotlib.artist.Artist`, the :class:`Figure`, which contains all the plot elements. The following classes are defined :class:`SubplotParams` control the default spacing of the subplots :class:`Figure` top level container for all plot elements """ from...
gpl-2.0
CiscoSystems/neutron
neutron/tests/unit/test_api_api_common.py
68
2904
# Copyright (c) 2013 Intel Corporation. # 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 re...
apache-2.0
gcd0318/django
tests/sitemaps_tests/urls/http.py
311
4069
from datetime import date, datetime from django.conf.urls import url from django.conf.urls.i18n import i18n_patterns from django.contrib.sitemaps import GenericSitemap, Sitemap, views from django.http import HttpResponse from django.utils import timezone from django.views.decorators.cache import cache_page from ..mod...
bsd-3-clause
dylanGeng/BuildingMachineLearningSystemsWithPython
ch09/fft.py
24
3673
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import sys import os import glob import numpy as np import scipy import scipy.io.wavfile from utils i...
mit
fengbaicanhe/intellij-community
python/lib/Lib/site-packages/django/db/backends/creation.py
71
21002
import sys import time from django.conf import settings # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific differences that pertain to database *creation*, ...
apache-2.0
kivio/PerfKitBenchmarker
tools/side-by-side/side_by_side.py
5
14125
#!/usr/bin/env python # Copyright 2014 PerfKitBenchmarker 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 # # U...
apache-2.0
tomlepaine/bottle-skeleton
app.py
1
1076
import argparse from bottle import get, run, response, static_file, redirect from jinja2 import Environment, PackageLoader import config parser = argparse.ArgumentParser(prog=config.name, description=config.description) parser.add_argument('--port', type=int, ...
bsd-2-clause
ZhangXinNan/tensorflow
tensorflow/contrib/kinesis/python/kernel_tests/kinesis_test.py
9
5546
# Copyright 2018 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 applic...
apache-2.0
eeshangarg/zulip
zerver/migrations/0297_draft.py
6
1348
# Generated by Django 2.2.14 on 2020-07-23 17:07 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("zerver", "0296_remove_userprofile_short_name"), ] operations = [ migratio...
apache-2.0
engineer0x47/SCONS
build/lib/SCons/Tool/aixcc.py
2
2267
"""SCons.Tool.aixcc Tool-specific initialization for IBM xlc / Visual Age C compiler. 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 - 2014 The SCons Foundation # # Permission is hereb...
mit
wtolson/circle-craters
test/test_qgis_environment.py
116
1885
# coding=utf-8 """Tests for QGIS functionality. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ ...
bsd-3-clause
whiteclover/Breeze
breeze/chatcenter/room.py
1
1148
import time import logging LOGGER = logging.getLogger(__name__) class Room(object): def __init__(self, name): self.name = name self.peers = {} def broadcast(self, msg): if msg: for peer in self.peers.values(): if peer != msg.user: LOGGER.info('peer: %s', peer) peer.send(msg) def add_peer(s...
gpl-2.0
mhumeSF/ansible-container
setup.py
1
3215
import os import sys import shlex import shutil from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand from setuptools.command.sdist import sdist as SDistCommand from pip.req import parse_requirements import container class PlaybookAsTests(TestCommand): user_options = ...
lgpl-3.0
plumgrid/plumgrid-nova
nova/tests/test_safeutils.py
13
4052
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # # 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/LICEN...
apache-2.0
dxwu/BinderFilter
resources/android-toolchain-16/lib/python2.7/idlelib/SearchDialog.py
81
2040
from Tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase def _setup(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_searchdialog"): engine._searchdialog = SearchDialog(root, engine) return engine._searchdia...
mit
kangfend/django
tests/schema/models.py
9
3782
from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test # runner doesn't migrate them. new_apps = ...
bsd-3-clause
marcore/edx-platform
lms/celery.py
25
1079
""" Import celery, load its settings from the django settings and auto discover tasks in all installed django apps. Taken from: http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html """ from __future__ import absolute_import import os from celery import Celery from django.conf import settings fro...
agpl-3.0
googleapis/python-dialogflow
tests/unit/gapic/dialogflow_v2beta1/test_entity_types.py
1
136892
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
hellhovnd/django
django/contrib/auth/tests/test_auth_backends.py
3
15696
from __future__ import unicode_literals from datetime import date from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.test_custom_user import ExtensionUser, CustomPermi...
bsd-3-clause
adobe-research/spark-cluster-deployment
initial-deployment-puppet/modules/spark/files/spark/python/pyspark/storagelevel.py
2
2459
# # 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
sameerparekh/pants
contrib/cpp/src/python/pants/contrib/cpp/tasks/cpp_task.py
9
1810
# 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 subprocess f...
apache-2.0
arante/pyloc
microblog/flask/lib/python3.5/site-packages/sqlparse/engine/statement_splitter.py
20
3648
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause from sqlparse import sql, tokens as T class StatementSplitter(object): """Filter that split stream...
gpl-3.0
chiefspace/udemy-rest-api
udemy_rest_api_section5/code/env/lib/python3.4/site-packages/flask/ctx.py
170
14739
# -*- coding: utf-8 -*- """ flask.ctx ~~~~~~~~~ Implements the objects required to keep the context. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys from functools import update_wrapper from werkzeug.exceptions import HTTPException from .globa...
gpl-2.0
nmercier/linux-cross-gcc
linux/lib/python2.7/dist-packages/samba/subunit/__init__.py
32
2672
# Subunit handling # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2014 # # 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 vers...
bsd-3-clause
Ninjakow/TrueSkill
lib/click/types.py
196
18864
import os import stat from ._compat import open_stream, text_type, filename_to_ui, \ get_filesystem_encoding, get_streerror, _get_argv_encoding, PY2 from .exceptions import BadParameter from .utils import safecall, LazyFile class ParamType(object): """Helper for converting values through types. The followin...
gpl-3.0
h2oai/h2o-dev
h2o-py/tests/testdir_munging/pyunit_trim.py
10
1383
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def trim_check(): # Connect to a pre-existing cluster # testing on a string column frame = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_trim.csv"), col_types=["string","numeric","numeric","numeric","numeri...
apache-2.0
Sorsly/subtle
google-cloud-sdk/lib/third_party/httplib2/iri2uri.py
706
3828
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The character...
mit
blockstack/blockstack-server
integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_stacks_sendtokens_interleaved.py
1
5075
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
gpl-3.0
ovnicraft/openerp-restaurant
mail/tests/test_mail_gateway.py
40
40085
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
petewarden/tensorflow
tensorflow/python/kernel_tests/random/stateless_random_ops_test.py
9
22220
# Copyright 2018 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
qedi-r/home-assistant
tests/components/alexa/test_state_report.py
2
5501
"""Test report state.""" from homeassistant.components.alexa import state_report from . import TEST_URL, DEFAULT_CONFIG async def test_report_state(hass, aioclient_mock): """Test proactive state reports.""" aioclient_mock.post(TEST_URL, text="", status=202) hass.states.async_set( "binary_sensor.t...
apache-2.0
uday1889/gensim
gensim/corpora/bleicorpus.py
68
4496
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Blei's LDA-C format. """ from __future__ import with_statement from os import path import logging from gensim import interfaces,...
gpl-3.0
sander76/home-assistant
tests/components/alexa/test_flash_briefings.py
21
4685
"""The tests for the Alexa component.""" # pylint: disable=protected-access import datetime import pytest from homeassistant.components import alexa from homeassistant.components.alexa import const from homeassistant.const import HTTP_NOT_FOUND, HTTP_UNAUTHORIZED from homeassistant.core import callback from homeassis...
apache-2.0
goanpeca/loghub
loghub/cli/label_creator.py
2
1563
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) The Spyder Development Team # # Licensed under the terms of the MIT License # (See LICENSE.txt for details) # ----------------------------------------------------------------------------- """Create gi...
mit
zhaozengguang/opencog
examples/visual_demos/visualise_importance_diffusion.py
30
1911
#!/usr/bin/python2.5 import sys import os import subprocess import time # the visualiser executable, make blank if you don't want it to be spawned # automatically ubigraph_server="/home/joel/src/UbiGraph-alpha-0.2.4-Linux64-Ubuntu-8.04/bin/ubigraph_server" N = 10 def main(): #/sys.argv() #print "Spawning u...
agpl-3.0
RudoCris/horizon
openstack_dashboard/dashboards/admin/instances/panel.py
46
1091
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0