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
dlongman/beegee-squeegee
prototype-parser/AccuChekMobileParser.py
1
3411
import csv import time from Reading import Reading as Reading ### TODO ### Add documentation to classes and methods class AccuChekMobileParser(object): # this file has some summary data in row 2 with the headers in row 1 # the result data is then in row 4 with the headers in row 3 def __init_...
mit
simalytics/askbot-devel
askbot/migrations/0048_set_proper_revision_types.py
20
27517
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): orm.QuestionRevision.objects.update(revision_type=1) orm.AnswerRevision.objects.update(revision_type=2) def backw...
gpl-3.0
rcarrillocruz/ansible
lib/ansible/utils/module_docs_fragments/tower.py
44
1991
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 la...
gpl-3.0
dpshelio/scikit-image
skimage/future/graph/graph_cut.py
19
9309
try: import networkx as nx except ImportError: import warnings warnings.warn('RAGs require networkx') import numpy as np from . import _ncut from . import _ncut_cy from scipy.sparse import linalg def cut_threshold(labels, rag, thresh, in_place=True): """Combine regions separated by weight less than th...
bsd-3-clause
j-windsor/cs3240-f15-team21-v2
reports/models.py
1
1870
from django.db import models from django.contrib.auth.models import User from django.utils import timezone import os class Report(models.Model): title = models.CharField(max_length=30) description = models.CharField(max_length = 200) create_date = models.DateTimeField('date created') public = models.Bo...
mit
Samuel789/MediPi
MedManagementWeb/env/lib/python3.5/site-packages/django/contrib/postgres/fields/hstore.py
42
3360
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.encoding import force_text from django.utils.translation ...
apache-2.0
hassoon3/odoo
addons/mail/mail_followers.py
26
12994
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Kenishi/iamacr
libs/markdown/extensions/smart_strong.py
12
1151
''' Smart_Strong Extension for Python-Markdown ========================================== This extention adds smarter handling of double underscores within words. See <https://pythonhosted.org/Markdown/extensions/smart_strong.html> for documentation. Original code Copyright 2011 [Waylan Limberg](http://achinghead.c...
mit
tareqalayan/ansible
test/units/modules/network/iosxr/test_iosxr_system.py
49
4219
# (c) 2016 Red Hat 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 # (at your option) any later version. # # Ansible is dis...
gpl-3.0
SebasSBM/django
tests/template_tests/syntax_tests/test_invalid_string.py
440
2310
from django.test import SimpleTestCase from ..utils import setup class InvalidStringTests(SimpleTestCase): libraries = {'i18n': 'django.templatetags.i18n'} @setup({'invalidstr01': '{{ var|default:"Foo" }}'}) def test_invalidstr01(self): output = self.engine.render_to_string('invalidstr01') ...
bsd-3-clause
Evzdrop/PynamoDB
pynamodb/constants.py
3
7354
""" Pynamodb constants """ # Operations BATCH_WRITE_ITEM = 'BatchWriteItem' DESCRIBE_TABLE = 'DescribeTable' BATCH_GET_ITEM = 'BatchGetItem' CREATE_TABLE = 'CreateTable' UPDATE_TABLE = 'UpdateTable' DELETE_TABLE = 'DeleteTable' LIST_TABLES = 'ListTables' UPDATE_ITEM = 'UpdateItem' DELETE_ITEM = 'DeleteItem' GET_ITEM =...
mit
sileht/aodh
aodh/storage/hbase/inmemory.py
2
9613
# # 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 # distributed under...
apache-2.0
CapOM/ChromiumGStreamerBackend
third_party/protobuf/python/google/protobuf/internal/wire_format_test.py
571
10848
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
ISIFoundation/influenzanet-website
apps/journal/tests.py
4
2025
""" Tests for the journal app """ import datetime from django.test import TestCase from .models import Entry, published_filter from .navigation import get_nodes class EntryTest(TestCase): def setUp(self): self.today = datetime.datetime.today() self.yesterday = self.today - datetime.timedelta(day...
agpl-3.0
sametmax/Django--an-app-at-a-time
apps/app6_template_tools/views.py
1
2017
# coding: utf-8 import datetime import random from django.shortcuts import render def index(request): return render(request, 'app6_index.html') def filters(request): context = {} # filter: random, pluralize, length_is, join context['people'] = ( 'Mr Black', 'Mr Pink', 'Mr...
mit
PatrickOReilly/scikit-learn
sklearn/linear_model/theil_sen.py
39
14339
# -*- coding: utf-8 -*- """ A Theil-Sen Estimator for Multiple Linear Regression Model """ # Author: Florian Wilhelm <florian.wilhelm@gmail.com> # # License: BSD 3 clause from __future__ import division, print_function, absolute_import import warnings from itertools import combinations import numpy as np from scipy...
bsd-3-clause
lifeinoppo/littlefishlet-scode
RES/REF/python_sourcecode/ipython-master/IPython/utils/_signatures.py
16
29681
"""Function signature objects for callables. Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.7 and 3.2+. """ #----------------------------------------------------------------------------- # Python 3.3 stdlib inspect.py is public domain # # Backpor...
gpl-2.0
DailyActie/Surrogate-Model
01-codes/scikit-learn-master/benchmarks/bench_tree.py
1
3618
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
mit
ruiaylin/percona-xtrabackup
storage/innobase/xtrabackup/test/kewpie/percona_tests/xtrabackup_disabled/galeraInfo_test.py
24
4569
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # 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 Softwar...
gpl-2.0
rizotas/waliki
waliki/pdf/views.py
2
1088
import tempfile from sh import rst2pdf from django.shortcuts import get_object_or_404 from waliki.models import Page from waliki.utils import send_file from waliki.settings import WALIKI_PDF_INCLUDE_TITLE from waliki.settings import WALIKI_PDF_RST2PDF_BIN from waliki.acl import permission_required @permission_require...
bsd-3-clause
eroicaleo/LearningPython
interview/leet/218_The_Skyline_Problem_v4.py
1
2103
#!/usr/bin/env python # ---- ---------- # | | | | # | --- |----- | # | | | | | # | | | | | # --------------------------- from heapq import heapify, heappush, heappop import math class Solution: def getSkyline(self, buildings): ...
mit
bdfoster/blumate
tests/components/light/test_mqtt.py
1
12976
"""The tests for the MQTT light platform. Configuration for RGB Version with brightness: light: platform: mqtt name: "Office Light RGB" state_topic: "office/rgb1/light/status" command_topic: "office/rgb1/light/switch" brightness_state_topic: "office/rgb1/brightness/status" brightness_command_topic: "offic...
mit
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractTigertranslationsOrg.py
1
4472
def extractTigertranslationsOrg(item): ''' Parser for 'tigertranslations.org' ''' ttmp = item['title'].replace("10 Years", "<snip> years").replace("10 Years Later", "<snip> years") vol, chp, frag, postfix = extractVolChapterFragmentPostfix(ttmp) if not (chp or vol) or "preview" in item['title'].lower(): retu...
bsd-3-clause
timlinux/inasafe
safe_extras/pydispatch/robust.py
20
1833
"""Module implementing error-catching version of send (sendRobust)""" from pydispatch.dispatcher import Any, Anonymous, liveReceivers, getAllReceivers from pydispatch.robustapply import robustApply def sendRobust( signal=Any, sender=Anonymous, *arguments, **named ): """Send signal from sender to all connected re...
gpl-3.0
40223227/40223227
static/Brython3.1.1-20150328-091302/Lib/numbers.py
883
10398
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from abc import ABCMeta, abstractmethod __all__ = ["Number", "Complex", "Real", "Rat...
gpl-3.0
DanteOnline/free-art
venv/lib/python3.4/site-packages/django/contrib/staticfiles/views.py
581
1329
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import os import posixpath from django.conf import settings from django.contrib.staticfiles import finders from django.http import Http404 from django.utils.six.moves.url...
gpl-3.0
runt18/nupic
src/nupic/frameworks/opf/expdescriptionhelpers.py
1
14471
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
elventear/ansible
lib/ansible/modules/cloud/amazon/cloudtrail.py
16
8672
#!/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
alexperusso/Screen
WebContent/Scripts/common/AdminLTE/dependencies/jvectormap/converter/simplifier.py
234
5985
import argparse import sys import os from osgeo import ogr from osgeo import osr import anyjson import shapely.geometry import shapely.ops import codecs import time format = '%.8f %.8f' tolerance = 0.01 infile = '/Users/kirilllebedev/Maps/50m-admin-0-countries/ne_50m_admin_0_countries.shp' outfile = 'map.shp' # Open...
gpl-3.0
lod/zookeepr
zk/model/social_network.py
3
1833
"""The application's model objects""" import sqlalchemy as sa from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.orm.collections import attribute_mapped_collection from meta import Base from pylons.controllers.util import abort from meta import Session from person_social_network_map import P...
gpl-2.0
faywong/FFPlayer
project/jni/python/src/Demo/classes/Range.py
47
3126
"""Example of a generator: re-implement the built-in range function without actually constructing the list of values. OldStyleRange is coded in the way required to work in a 'for' loop before iterators were introduced into the language; using __getitem__ and __len__ . """ def handleargs(arglist): """Take list of ...
lgpl-2.1
1d20/INT20H
myapp/views.py
1
2188
from django.shortcuts import render from django.http import HttpResponse from json import dumps as to_json from json import loads as from_json from models import * from neo import * def type_all(request): types = Type.objects.filter(is_approved=True) json = to_json([t.to_json() for t in types]) return Htt...
mit
tdyas/pants
tests/python/pants_test/backend/jvm/tasks/test_jar_task.py
1
13121
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import re from contextlib import contextmanager from textwrap import dedent from pants.backend.jvm.targets.java_agent import JavaAgent from pants.backend.jvm.targets.jvm_binary ...
apache-2.0
sgraham/nope
build/android/buildbot/bb_device_status_check.py
3
15555
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A class to keep track of devices across builds and report state.""" import json import logging import optparse import os import ps...
bsd-3-clause
laserson/luigi
luigi/contrib/esindex.py
13
14139
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
edoko/AirKernel_NS_JBN
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
ladybug-analysis-tools/honeybee
honeybee/radiance/command/getinfo.py
1
1803
# coding=utf-8 """getinfo - get header information from a RADIANCE file""" from _commandbase import RadianceCommand from ..datatype import RadiancePath, RadianceBoolFlag import os class Getinfo(RadianceCommand): get_dimensions = RadianceBoolFlag('d', 'get_dimensions') output_file = RadiancePath('output', 'ge...
gpl-3.0
fkorotkov/pants
contrib/android/tests/python/pants_test/contrib/android/tasks/test_aapt_builder.py
14
2438
# 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 from pant...
apache-2.0
infinitewarp/poketrainer
library/api/pgoapi/__init__.py
5
2311
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
mit
daodaoliang/python-phonenumbers
python/phonenumbers/data/region_NE.py
4
1866
"""Auto-generated file, do not edit by hand. NE metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_NE = PhoneMetadata(id='NE', country_code=227, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[0289]\\d{7}', possible_number_pattern='...
apache-2.0
chinghanyu/Cognet-RPi-linux
tools/perf/util/setup.py
242
1531
#!/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
sjwilks/mavlink
pymavlink/examples/apmsetrate.py
11
2047
#!/usr/bin/env python ''' set stream rate on an APM ''' import sys, struct, time, os from optparse import OptionParser parser = OptionParser("apmsetrate.py [options]") parser.add_option("--baudrate", dest="baudrate", type='int', help="master port baud rate", default=115200) parser.add_option("--d...
lgpl-3.0
savoirfairelinux/OpenUpgrade
addons/product_visible_discount/product_visible_discount.py
41
3950
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
Tatsh-ansible/ansible-modules-core
network/netvisor/pn_vrouterbgp.py
29
15078
#!/usr/bin/python """ PN-CLI vrouter-bgp-add/vrouter-bgp-remove/vrouter-bgp-modify """ # # 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 Lice...
gpl-3.0
embeddedarm/linux-3.14-pxa16x
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
hynnet/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/tests/test_pytree.py
131
17346
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for pytree.py. NOTE: Please *don't* add doc strings to individual test methods! In verbose mode, printing of the module, class and method name is much more helpful than printing of (the first line of) the...
gpl-2.0
cpc26/python-oauth2
example/client.py
375
6700
""" The MIT License Copyright (c) 2007 Leah Culver Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
mit
SujaySKumar/django
tests/invalid_models_tests/test_models.py
144
24524
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import unittest from django.conf import settings from django.core.checks import Error from django.db import connections, models from django.test.utils import override_settings from .base import IsolatedModelsTestCase def get_max_column_name_length()...
bsd-3-clause
olemb/mido
mido/backends/portmidi_init.py
1
4274
""" Low-level wrapper for PortMidi library Copied straight from Grant Yoshida's portmidizero, with slight modifications. """ import sys from ctypes import (CDLL, CFUNCTYPE, POINTER, Structure, c_char_p, c_int, c_long, c_uint, c_void_p, cast, create_string_buffer) import ctypes.u...
mit
godiard/wikipedia-activity
tools2/make_selection.py
1
12925
#!/usr/bin/env python # -*- coding: utf-8 -*- # take a list of pages # select a level default = 1 # prepare a list of links in the pages from the original list # create a file with the titles of all the selected pages # create a file with the content of all the selected pages import codecs import re from xml.sax impo...
gpl-2.0
DLu/rosbridge_suite
rosbridge_library/test/internal/test_ros_loader.py
12
11569
#!/usr/bin/env python import sys import rospy import rostest import unittest from rosbridge_library.internal import ros_loader class TestROSLoader(unittest.TestCase): def setUp(self): rospy.init_node("test_ros_loader") def test_bad_msgnames(self): bad = ["", "/", "//", "///", "////", "/////...
bsd-3-clause
Bysmyyr/chromium-crosswalk
tools/perf/page_sets/intl_es_fr_pt-BR.py
13
1640
# 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. from telemetry.page import page as page_module from telemetry.page import shared_page_state from telemetry import story class IntlEsFrPtBrPage(page_module.P...
bsd-3-clause
weolar/miniblink49
third_party/skia/tools/builder_name_schema.py
26
6247
# 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. """ Utilities for dealing with builder names. This module obtains its attributes dynamically from builder_name_schema.json. """ import json import os # ...
apache-2.0
derekjchow/models
research/street/python/nn_ops.py
20
9175
# 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
egabancho/invenio
invenio/modules/archiver/api.py
2
3234
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013, 2014 CERN. ## ## 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 version 2 of the ## License, or (at your opt...
gpl-2.0
brschneidE3/LegalNetworks
python_code/download_data_batch.py
1
5208
__author__ = 'brendan' import helper_functions import os import tarfile proj_cwd = os.path.dirname(os.getcwd()) data_dir = proj_cwd + r'/data' def download_url(url, destination_path, curl_path=r'C:/Users/brendan/Downloads/curl-7.38.0-win64/bin/curl'): """ This is a quick and easy function that simulates cli...
mit
chainer/chainer
chainermn/links/n_step_rnn.py
6
3181
import chainer import chainer.links.rnn as rnn import chainermn.functions class _MultiNodeNStepRNN(chainer.Chain): def __init__(self, link, communicator, rank_in, rank_out): super(_MultiNodeNStepRNN, self).__init__(actual_rnn=link) self.communicator = communicator self.rank_in = rank_in ...
mit
psyke83/ace2europa_kernel
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
Codlydodly/python-client
venv/lib/python2.7/site-packages/pyglet/text/formats/attributed.py
9
5145
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
mit
sticksnleaves/ghost-blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/dotnet.py
94
26751
# -*- coding: utf-8 -*- """ pygments.lexers.dotnet ~~~~~~~~~~~~~~~~~~~~~~ Lexers for .net languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ...
mit
runjmc/maraschino
lib/werkzeug/testsuite/wsgi.py
11
8402
# -*- coding: utf-8 -*- """ werkzeug.testsuite.wsgi ~~~~~~~~~~~~~~~~~~~~~~~ Tests the WSGI utilities. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from os import path from cStringIO import StringIO ...
mit
Maspear/odoo
addons/product_email_template/models/invoice.py
321
1969
# -*- coding: utf-8 -*- from openerp.osv import osv class account_invoice(osv.Model): _inherit = 'account.invoice' def invoice_validate_send_email(self, cr, uid, ids, context=None): Composer = self.pool['mail.compose.message'] for invoice in self.browse(cr, uid, ids, context=context): ...
agpl-3.0
messense/wechatpy
tests/test_create_reply.py
1
4694
# -*- coding: utf-8 -*- import unittest from wechatpy.replies import TextReply, create_reply class CreateReplyTestCase(unittest.TestCase): def test_create_reply_with_text_not_render(self): text = 'test' reply = create_reply(text, render=False) self.assertEqual('text', reply.type) ...
mit
sachintyagi22/spark
python/pyspark/sql/session.py
7
25220
# # 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
JamesGuthrie/libcloud
libcloud/dns/drivers/route53.py
14
20413
# 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 use ...
apache-2.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/urllib3/util/ssl_.py
4
13257
from __future__ import absolute_import import errno import warnings import hmac import socket from binascii import hexlify, unhexlify from hashlib import md5, sha1, sha256 from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning from ..packages import six SSLContext = None HAS_SNI = False IS_PY...
apache-2.0
broferek/ansible
lib/ansible/modules/network/fortios/fortios_ips_settings.py
14
9349
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
chen0031/nupic
nupic/regions/PictureSensorExplorers/rotate.py
17
3479
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
axinging/chromium-crosswalk
tools/perf/metrics/speedindex_unittest.py
21
4002
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # These tests access private methods in the speedindex module. # pylint: disable=protected-access import unittest from telemetry.util import color_histogra...
bsd-3-clause
partofthething/home-assistant
script/hassfest/coverage.py
9
3811
"""Validate coverage files.""" from pathlib import Path from typing import Dict from .model import Config, Integration DONT_IGNORE = ( "config_flow.py", "device_action.py", "device_condition.py", "device_trigger.py", "group.py", "intent.py", "logbook.py", "media_source.py", "scene....
mit
NEricN/RobotCSimulator
Python/App/Lib/test/test_mimetypes.py
44
6242
# -*- coding: utf-8 -*- import mimetypes import StringIO import unittest import sys from test import test_support # Tell it we don't know about external files: mimetypes.knownfiles = [] mimetypes.inited = False mimetypes._default_mime_types() class MimeTypesTestCase(unittest.TestCase): def setUp(self): ...
apache-2.0
idea4bsd/idea4bsd
python/lib/Lib/distutils/filelist.py
85
12810
"""distutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. """ # This module should be kept compatible with Python 2.1. __revision__ = "$Id: filelist.py 37828 2004-11-10 22:23:15Z loewis $" import os, string, re import fnmatch from types import * from glob i...
apache-2.0
mstriemer/zamboni
mkt/stats/views.py
9
13102
from django import http import commonware import requests from rest_framework.exceptions import ParseError from rest_framework.generics import ListAPIView from rest_framework.permissions import AllowAny, BasePermission from rest_framework.response import Response from rest_framework.views import APIView import mkt fr...
bsd-3-clause
joopert/home-assistant
tests/components/group/test_reproduce_state.py
3
1559
"""The tests for reproduction of state.""" from asyncio import Future from unittest.mock import patch from homeassistant.components.group.reproduce_state import async_reproduce_states from homeassistant.core import Context, State async def test_reproduce_group(hass): """Test reproduce_state with group.""" co...
apache-2.0
ralphiee22/kolibri
kolibri/auth/filters.py
7
10962
from django.db import models from django.db.models.query import F from six import string_types from .constants import collection_kinds from .errors import InvalidHierarchyRelationsArgument class HierarchyRelationsFilter(object): """ Helper class for efficiently making queries based on relations between model...
mit
kgblll/libresoft-gymkhana
apps/explohyperfiction/models.py
1
2903
from django.db import models from datetime import datetime from django.contrib.gis.db import models from social.core.models import * from social.core.models import Social_node # Create your models here. class Group(models.Model): manager=models.ManyToManyField("Player",null=True) name=models.TextField(null=Fal...
gpl-2.0
amenonsen/ansible
lib/ansible/modules/network/f5/bigip_apm_policy_import.py
23
11958
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
shines77/Google-ProtoBuf
python/google/protobuf/internal/wire_format_test.py
571
10848
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
Radium-Devices/Radium_jflte
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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. # # This program i...
gpl-2.0
gauravbose/digital-menu
digimenu2/tests/admin_utils/models.py
107
1712
from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A s...
bsd-3-clause
EricMuller/mywebmarks-backend
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/names/common.py
55
7726
# -*- test-case-name: twisted.names.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Base functionality useful to various parts of Twisted Names. """ from __future__ import division, absolute_import import socket from zope.interface import implementer from twisted.names import d...
mit
marmarek/livecd-tools
imgcreate/errors.py
7
2188
# # errors.py : exception definitions # # Copyright 2007, Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope th...
gpl-2.0
itakouna/lymph
lymph/core/monitoring/pusher.py
4
1319
import logging import time import gevent import msgpack import zmq.green as zmq from lymph.core.components import Component logger = logging.getLogger(__name__) DEFAULT_MONITOR_ENDPOINT = 'tcp://127.0.0.1:44044' class MonitorPusher(Component): def __init__(self, container, aggregator, endpoint=None, interva...
apache-2.0
klemensavli/django-localflavor-si
django_localflavor_si/forms.py
101
4678
""" Slovenian specific form helpers. """ from __future__ import absolute_import, unicode_literals import datetime import re from django.contrib.localflavor.si.si_postalcodes import SI_POSTALCODES_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields...
bsd-3-clause
sand8080/pnp_test
sketch/config.py
1
1453
# Server Specific Configurations server = { 'port': '8080', 'host': '0.0.0.0' } # Pecan Application Configurations app = { 'root': 'sketch.controllers.root.RootController', 'modules': ['sketch'], 'static_root': '%(confdir)s/public', 'template_path': '%(confdir)s/sketch/templates', 'debug': ...
mit
DNFcode/edx-platform
common/djangoapps/util/testing.py
25
1894
import sys from django.conf import settings from django.core.urlresolvers import clear_url_caches, resolve class UrlResetMixin(object): """Mixin to reset urls.py before and after a test Django memoizes the function that reads the urls module (whatever module urlconf names). The module itself is also sto...
agpl-3.0
StyXman/ayrton
ayrton/parser/astcompiler/misc.py
1
3583
def parse_future(tree, feature_flags): from ayrton.parser.astcompiler import ast future_lineno = 0 future_column = 0 flags = 0 have_docstring = False body = None if isinstance(tree, ast.Module): body = tree.body elif isinstance(tree, ast.Interactive): body = tree.body ...
gpl-3.0
rocky4570/moto
moto/logs/models.py
2
11939
from moto.core import BaseBackend import boto.logs from moto.core.utils import unix_time_millis from .exceptions import ( ResourceNotFoundException, ResourceAlreadyExistsException ) class LogEvent: _event_id = 0 def __init__(self, ingestion_time, log_event): self.ingestionTime = ingestion_tim...
apache-2.0
athena-voice/athena-voice-client
athena/modules/active/voice_browse.py
1
2096
""" Wraps the Spotify Web Player to play music Usage Examples: - "Open facebook.com" - "Search Neil Degrasse Tyson" - "Maximize the browser" """ from athena.classes.module import Module from athena.classes.task import ActiveTask from athena.apis import api_lib VB_PATTERNS...
gpl-3.0
alheinecke/tensorflow-xsmm
tensorflow/contrib/learn/python/learn/preprocessing/__init__.py
138
1071
# 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
kingvuplus/boom2
lib/python/Components/ScrollLabel.py
2
7349
# Embedded file name: /usr/lib/enigma2/python/Components/ScrollLabel.py import skin from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize class ScrollLabel(HTMLComponent, GUIComponent): def __init__(self, t...
gpl-2.0
lexus42/w17
static/Brython3.1.1-20150328-091302/Lib/_abcoll.py
688
5155
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gpl-3.0
bheesham/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/stream.py
673
2748
# Copyright 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 f...
mpl-2.0
resmo/ansible
lib/ansible/modules/network/aci/aci_aaa_user_certificate.py
27
7876
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.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_ver...
gpl-3.0
ChrisCuts/fnode
src/FunctionSelectionNode.py
1
6818
# -*- coding: utf-8 -*- ''' Created on 17.09.2015 @author: derChris ''' from pydispatch import dispatcher import PlugIns.NodeTemplates import PlugIns.MATLAB.MATLAB import Pipe class FunctionSelectionNode(PlugIns.NodeTemplates.NodeTemplate): _UPDATE_FUNCTION_SELECTION_WIDGET = 'UPDATE_FUNCTION_SELECTION_WID...
gpl-2.0
mongodb/mongo-python-driver
pymongo/collection.py
2
132067
# Copyright 2009-present MongoDB, 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
ehenneken/loris
loris/parameters.py
3
15597
# parameters.py # -*- coding: utf-8 -*- ''' IIIF Image API parameters as objects. The attributes of this class should make it possible to work with most imaging libraries without any further need to process the IIIF syntax. ''' import re from decimal import Decimal from math import floor from logging import getLog...
bsd-2-clause
sonaht/ansible
lib/ansible/modules/network/nxos/nxos_aaa_server_host.py
59
11475
#!/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
esakellari/root
interpreter/llvm/src/tools/clang/bindings/python/examples/cindex/cindex-includes.py
110
1644
#!/usr/bin/env python #===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===---------------------------------------...
lgpl-2.1
diamondman/proteusisc
proteusisc/frame.py
1
7853
import collections from .primitive import DeviceTarget, Primitive class Frame(collections.MutableSequence): def __init__(self, chain, *prims, fill=False): self._chain = chain self._prims = [None for i in range(len(chain._devices))] self._valid_prim = None #self._prim_type = None ...
lgpl-2.1