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
psiwczak/openstack
nova/virt/xenapi/volume_utils.py
1
15660
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Citrix 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/LICE...
apache-2.0
yangming85/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/auth/tests/basic.py
137
3575
from django.test import TestCase from django.contrib.auth.models import User, AnonymousUser from django.core.management import call_command from StringIO import StringIO class BasicTestCase(TestCase): def test_user(self): "Check that users can be created and can set their password" u = User.objects...
gpl-3.0
davidwilson-85/easymap
graphic_output/Pillow-4.2.1/Tests/test_file_sgi.py
1
1819
from helper import unittest, PillowTestCase, hopper from PIL import Image, SgiImagePlugin class TestFileSgi(PillowTestCase): def test_rgb(self): # Created with ImageMagick then renamed: # convert hopper.ppm -compress None sgi:hopper.rgb test_file = "Tests/images/hopper.rgb" im =...
gpl-3.0
ruler501/acrTestingScripts
autorun.py
1
2366
import sys import threading import psutil if sys.platform.startswith('win32'): from winpexpect import EOF, TIMEOUT from winpexpect import winspawn as spawn else: from pexpect import EOF, TIMEOUT from pexpect import spawn class PlatformError(Exception): def __init__(self, platform): self.platform =...
lgpl-3.0
tradel/AppDynamicsREST
docs/conf.py
1
8506
#!/usr/bin/env python # -*- coding: utf-8 -*- # # AppDynamicsREST documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in th...
apache-2.0
kxliugang/edx-platform
lms/djangoapps/discussion_api/tests/test_api.py
6
122916
""" Tests for Discussion API internal interface """ from datetime import datetime, timedelta import itertools from urlparse import parse_qs, urlparse, urlunparse from urllib import urlencode import ddt import httpretty import mock from pytz import UTC from django.core.exceptions import ValidationError from django.htt...
agpl-3.0
hehongliang/tensorflow
tensorflow/python/debug/cli/evaluator.py
80
5731
# 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
JulyKikuAkita/PythonPrac
cs15211/BuddyStrings.py
1
3894
__source__ = 'https://leetcode.com/problems/buddy-strings/' # Time: O(N) where NN is the length of A and B # Space: O(1) # # Description: Leetcode # 859. Buddy Strings # # Given two strings A and B of lowercase letters, # return true if and only if we can swap two letters in A so that the result equals B. # # Example ...
apache-2.0
kikusu/chainer
chainer/training/trainer.py
1
12389
import collections import os import six from chainer import reporter as reporter_module from chainer.training import extension as extension_module from chainer.training import trigger as trigger_module class _ExtensionEntry(object): def __init__(self, extension, priority, trigger, invoke_before_training): ...
mit
jakesyl/androguard
demos/dalvikvm_format_6.py
38
2935
#!/usr/bin/env python import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from androguard.core.bytecodes import dvm from androguard.core.bytecodes import apk from androguard.core.analysis import analysis from androguard.core import androconf import hashlib def hexdump(src, length=8, off=0): result = ...
apache-2.0
stijnvanhoey/defence
node_modules/node-sass/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
GiladE/birde
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py
250
4062
from __future__ import absolute_import, division, unicode_literals from gettext import gettext _ = gettext from . import _base from ..constants import cdataElements, rcdataElements, voidElements from ..constants import spaceCharacters spaceCharacters = "".join(spaceCharacters) class LintError(Exception): pass ...
mit
nkuhlen/replication-study-financial-macro
.mywaflib/waflib/extras/run_r_script.py
2
2830
#!/usr/bin/env python # encoding: utf-8 # Hans-Martin von Gaudecker, 2012-15 """ Run a R script in the directory specified by **ctx.bldnode**. Strings supplied to the **prepend** and **append** keywords will be added to the command line. Usage:: ctx( features='run_r_script', source='some_script.r', target=['...
gpl-3.0
marcelovilaca/DIRAC
Workflow/Utilities/Utils.py
13
3645
""" Collection of utilities function """ import os, time from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO, getCSExtensions from DIRAC.Core.Workflow.Module import ModuleDefinition from DIRAC.Core.Workflow.Parameter import Parameter from DIRA...
gpl-3.0
snarfed/beautifulsoup
bs4/element.py
3
62762
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
mit
unseenlaser/python-for-android
python3-alpha/python3-src/Lib/unittest/test/test_assertions.py
51
11863
import datetime import warnings import unittest class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, self.assertAlmostEqual,...
apache-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity.py
1
7733
# 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
JuliaPackageMirrors/Jumos.jl
doc/_ext_/juliadoc/jlhelp.py
7
3856
import codecs from os import path from docutils import nodes from sphinx.builders.text import TextBuilder from sphinx.writers.text import TextTranslator from sphinx.writers.text import TextWriter from sphinx.util.osutil import ensuredir from sphinx.util.console import bold, purple, darkgreen, term_width_line def jl_...
mpl-2.0
wilvk/ansible
lib/ansible/modules/cloud/vmware/vmware_dvswitch.py
21
7755
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
GoogleCloudPlatform/training-data-analyst
courses/developingapps/python/kubernetesengine/start/frontend/quiz/webapp/questions.py
18
1280
# Copyright 2017, Google, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Drooids/odoo
openerp/report/int_to_text.py
442
2641
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
syaiful6/django
django/contrib/auth/backends.py
468
6114
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission class ModelBackend(object): """ Authenticates against settings.AUTH_USER_MODEL. """ def authenticate(self, username=None, password=None, **kwargs): UserMod...
bsd-3-clause
broferek/ansible
lib/ansible/modules/cloud/amazon/efs_info.py
4
13913
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
svanschalkwyk/datafari
windows/python/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py
442
9262
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll winterm = None if windll is not None: winterm = WinTerm() def is_a_tty(stre...
apache-2.0
electrumalt/electrum-ixc
gui/qt/seed_dialog.py
1
3876
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2013 ecdsa@github # # 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...
gpl-3.0
andela-ooladayo/django
tests/get_or_create/tests.py
282
15058
from __future__ import unicode_literals import traceback from datetime import date from django.db import DatabaseError, IntegrityError from django.test import TestCase, TransactionTestCase, ignore_warnings from django.utils.encoding import DjangoUnicodeDecodeError from .models import ( Author, Book, DefaultPerso...
bsd-3-clause
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_cookielib.py
63
71359
# -*- coding: latin-1 -*- """Tests for cookielib.py.""" import re, os, time from unittest import TestCase from test import test_support class DateTimeTests(TestCase): def test_time2isoz(self): from cookielib import time2isoz base = 1019227000 day = 24*3600 self.assertEquals(time...
apache-2.0
omnirom/android_kernel_huawei_angler
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
mfherbst/spack
var/spack/repos/builtin/packages/bedtools2/package.py
5
2043
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
gnuhub/intellij-community
plugins/hg4idea/testData/bin/hgext/rebase.py
90
32420
# rebase.py - rebasing feature for mercurial # # Copyright 2008 Stefano Tortarolo <stefano.tortarolo at gmail dot com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to move sets of revisions to a different ancestor T...
apache-2.0
kgiusti/dispatch
tests/system_tests_multicast.py
3
38121
# # 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...
apache-2.0
popazerty/try
lib/python/Components/Lcd.py
3
11670
from boxbranding import getBoxType from twisted.internet import threads from enigma import eDBoxLCD, eTimer from config import config, ConfigSubsection, ConfigSelection, ConfigSlider, ConfigYesNo, ConfigNothing from Components.SystemInfo import SystemInfo from Tools.Directories import fileExists from Components.Netwo...
gpl-2.0
renatofb/weblate
weblate/trans/tests/test_autofix.py
11
3620
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
partp/gtg-services
GTG/backends/backend_tomboy.py
2
2467
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
gpl-3.0
EricMuller/mynotes-backend
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/conch/test/test_insults.py
13
33581
# -*- test-case-name: twisted.conch.test.test_insults -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python.reflect import namedAny from twisted.trial import unittest from twisted.test.proto_helpers import StringTransport from twisted.conch.insults.insults import ServerProtoc...
mit
youprofit/servo
components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
208
3824
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface SpecialMethods { getter long long (unsigned long index); setter long long (unsigned long index, long long value); creator long long (unsigned long index, long long value); deleter long long (un...
mpl-2.0
Acehaidrey/incubator-airflow
airflow/providers/amazon/aws/transfers/mongo_to_s3.py
4
4312
# # 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...
apache-2.0
andyzsf/edx
common/djangoapps/monitoring/signals.py
172
4584
""" Add receivers for django signals, and feed data into the monitoring system. If a model has a class attribute 'METRIC_TAGS' that is a list of strings, those fields will be retrieved from the model instance, and added as tags to the recorded metrics. """ from django.db.models.signals import post_save, post_delete,...
agpl-3.0
lepistone/odoo
openerp/workflow/service.py
378
4972
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-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
MyAOSP/external_chromium_org
build/android/pylib/host_driven/test_info_collection.py
50
5344
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module containing information about the host-driven tests.""" import logging import os import tests_annotations class TestInfo(object): """An ob...
bsd-3-clause
rschnapka/odoo
openerp/addons/base/res/report/__init__.py
79
1201
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
philotas/enigma2
lib/python/Components/TimerList.py
16
7927
from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from skin import parseFont from Tools.FuzzyDate import FuzzyTime from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER, RT_VALIGN_TOP, RT_VALIGN_BOTTOM from Tools.Alternatives impo...
gpl-2.0
photoninger/ansible
lib/ansible/modules/cloud/amazon/redshift_subnet_group.py
16
5953
#!/usr/bin/python # Copyright 2014 Jens Carl, Hothead Games 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', 'stat...
gpl-3.0
ahmadio/edx-platform
lms/djangoapps/instructor/tests/test_legacy_xss.py
46
2251
""" Tests of various instructor dashboard features that include lists of students """ from django.conf import settings from django.test.client import RequestFactory from markupsafe import escape from nose.plugins.attrib import attr from student.tests.factories import UserFactory, CourseEnrollmentFactory from edxmako....
agpl-3.0
GdZ/scriptfile
software/googleAppEngine/lib/django_1_2/django/core/management/commands/startapp.py
321
1909
import os from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module class Command(LabelCommand): help = "Creates a Django app directory structure for the given app name in the current directory." args = "[appname]" label = 'application...
mit
charukiewicz/beer-manager
venv/lib/python3.4/site-packages/passlib/utils/_blowfish/_gen_files.py
21
6169
"""passlib.utils._blowfish._gen_files - meta script that generates unrolled.py""" #============================================================================= # imports #============================================================================= # core import os import textwrap # pkg from passlib.utils.compat impor...
mit
nafex/pyload
module/lib/thrift/protocol/TBase.py
64
2532
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
gpl-3.0
Hellrungj/CSC-412-Networking
rpc-project/venv/lib/python2.7/site-packages/rpyc/core/protocol.py
7
24841
""" The RPyC protocol """ import sys import weakref import itertools import socket import time from threading import Lock from rpyc.lib.compat import pickle, next, is_py3k, maxint, select_error from rpyc.lib.colls import WeakValueDict, RefCountingColl from rpyc.core import consts, brine, vinegar, netref from rpyc.core...
gpl-3.0
takluyver/readthedocs.org
readthedocs/core/management/commands/clean_builds.py
14
2156
from datetime import datetime, timedelta import logging from optparse import make_option from django.core.management.base import BaseCommand from django.db.models import Max from builds.models import Build, Version from builds.utils import clean_build_path log = logging.getLogger(__name__) class Command(BaseComman...
mit
jcrist/pydy
examples/double_pendulum/visualize.py
7
2397
""" This file will use pydy.viz to visualize the double pendulum. Run this script via a command line: $ python visualization.py """ from numpy import pi from pydy.viz.shapes import Cylinder, Sphere from pydy.viz.scene import Scene from pydy.viz.visualization_frame import VisualizationFrame from simulate impor...
bsd-3-clause
sup95/zulip
zerver/views/webhooks/librato.py
11
7746
from __future__ import absolute_import from typing import Any, Optional, Callable, Tuple from six import text_type from six.moves import zip from django.utils.translation import ugettext as _ from django.utils.datetime_safe import datetime from django.http import HttpRequest, HttpResponse from zerver.decorator impor...
apache-2.0
yashsharan/sympy
sympy/benchmarks/bench_discrete_log.py
30
2523
from __future__ import print_function, division import sys from time import time from sympy.ntheory.residue_ntheory import (discrete_log, _discrete_log_trial_mul, _discrete_log_shanks_steps, _discrete_log_pollard_rho, _discrete_log_pohlig_hellman) # Cyclic group (Z/pZ)* with p prime, order p - 1 and...
bsd-3-clause
zcbenz/cefode-chromium
chrome_frame/tools/test/page_cycler/cf_cycler.py
78
2625
#!/usr/bin/env python # Copyright (c) 2011 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. """Automates IE to visit a list of web sites while running CF in full tab mode. The page cycler automates IE and navigates it to a...
bsd-3-clause
ayoubg/gem5-graphics
gem5/tests/quick/se/01.hello-2T-smt/test.py
40
1798
# Copyright (c) 2006 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
jnishi/chainer
tests/chainer_tests/links_tests/connection_tests/test_scale.py
9
4443
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize( {'learn_W': True, 'bias_term': False, 'bias_shape':...
mit
bwyyoung/haroopad
node_modules/grunt/node_modules/js-yaml/support/pyyaml-src/parser.py
210
25495
# The following YAML grammar is LL(1) and is parsed by a recursive descent # parser. # # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END # implicit_document ::= block_node DOCUMENT-END* # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* # block_node_or_inden...
gpl-3.0
danic85/time-capsule
src/file-browser.py
1
1530
import os, time, datetime, sys from PIL import Image path = '../test_files' def get_minimum_creation_time(exif_data): mtime = '?' if 306 in exif_data and exif_data[306] < mtime: # 306 = DateTime mtime = exif_data[306] if 36867 in exif_data and exif_data[36867] < mtime: # 36867 = DateTimeOriginal ...
gpl-3.0
bjko/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/layouttestresults.py
124
4096
# Copyright (c) 2010, 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
yonglehou/spiderfoot
ext/metapdf/metapdf.py
8
2657
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012 Ali Anari # # 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 #...
gpl-2.0
nsnam/ns-3.16-git
src/tap-bridge/examples/tap-csma-virtual-machine.py
157
3012
# -*- Mode: Python; -*- # # Copyright 2010 University of Washington # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be usefu...
gpl-2.0
drawks/ansible
lib/ansible/plugins/action/service.py
36
3755
# (c) 2015, Ansible 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 di...
gpl-3.0
nvoron23/hue
desktop/core/ext-py/MySQL-python-1.2.5/tests/dbapi20.py
45
31434
#!/usr/bin/env python ''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read...
apache-2.0
mharnold/spiderosm
spiderosm/cannames.py
1
14317
''' Canonical street names! (To allow name matching between OSM and Portland City DB.) ''' import re import string import pylev # ratio of edit distance between strings to string length (= max number of edits possible) def levenshtein_ratio(s1, s2): assert len(s1) > 0 and len(s2) > 0 return pylev.levenshtein(...
mit
Lightmatter/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/django/conf/locale/id/formats.py
83
2141
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j N Y' DATETIME_FORMAT = "j N Y, ...
mit
kmoocdev/edx-platform
cms/djangoapps/contentstore/views/tests/test_access.py
45
1651
""" Tests access.py """ from django.test import TestCase from django.contrib.auth.models import User from student.roles import CourseInstructorRole, CourseStaffRole from student.tests.factories import AdminFactory from student.auth import add_users from contentstore.views.access import get_user_role from opaque_keys.e...
agpl-3.0
WildflowerSchools/sensei
app/models/radio_observation.py
1
1982
import dateutil.parser from shared import * from sqlalchemy.dialects.postgresql import insert import pytz # Raw radio observation class RadioObservation(db.Model): classroom_id = db.Column(db.Integer, nullable=False, primary_key=True) observed_at = db.Column(db.DateTime, nullable=False, primary_key=True) r...
mit
pylixm/sae-django-demo
django1.7-sae/site-packages/django/dispatch/dispatcher.py
60
11775
import sys import threading import weakref from django.utils.six.moves import xrange if sys.version_info < (3, 4): from .weakref_backports import WeakMethod else: from weakref import WeakMethod def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__), id(target.__func__)...
apache-2.0
showgood/YCM_windows
third_party/requests/requests/packages/chardet/charsetprober.py
3127
1902
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
hsiaoyi0504/scikit-learn
examples/classification/plot_lda.py
164
2224
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
with-git/tensorflow
tensorflow/contrib/cluster_resolver/python/training/tpu_cluster_resolver_test.py
21
3916
# 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 applicable ...
apache-2.0
pforret/python-for-android
python-modules/twisted/twisted/plugins/twisted_qtstub.py
61
1417
# Copyright (c) 2006 Twisted Matrix Laboratories. # See LICENSE for details. """ Backwards-compatibility plugin for the Qt reactor. This provides a Qt reactor plugin named C{qt} which emits a deprecation warning and a pointer to the separately distributed Qt reactor plugins. """ import warnings from twisted.applica...
apache-2.0
azurestandard/django
tests/regressiontests/utils/dateformat.py
9
6056
from __future__ import unicode_literals from datetime import datetime, date import os import time from django.utils.dateformat import format from django.utils import dateformat, translation, unittest from django.utils.timezone import utc from django.utils.tzinfo import FixedOffset, LocalTimezone class DateFormatTes...
bsd-3-clause
Iceberg-Marketplace/Iceberg-API-PYTHON
icebergsdk/resources/webhooks.py
2
1828
# -*- coding: utf-8 -*- import os import time from icebergsdk.resources.base import IcebergObject, UpdateableIcebergObject if os.getenv('ICEBERG_DEBUG', False): MAX_NUMBER_OF_CHECKS = 2 CHECK_EVERY_SECONDS = 5 else: MAX_NUMBER_OF_CHECKS = 10 CHECK_EVERY_SECONDS = 1 class Webhook(UpdateableIcebergObje...
mit
davy39/eric
UI/Previewer.py
1
6911
# -*- coding: utf-8 -*- # Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a previewer widget for HTML, Markdown and ReST files. """ from __future__ import unicode_literals import os from PyQt5.QtCore import QTimer from PyQt5.QtWidgets import QStackedWidget import Pr...
gpl-3.0
irisfeng/CodeScanner
SZQRCodeViewController/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/pylib/gyp/MSVSSettings.py
47
44444
# 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. """Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. The...
mit
Cadene/keras
examples/mnist_irnn.py
8
3040
from __future__ import absolute_import from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.initializations import normal, identity from keras.l...
mit
turi-code/SFrame
oss_src/unity/python/sframe/_json.py
5
1873
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' import array as _array import datetime as _datetime import json as _json def to_serializable(obj): from . import extensions return extension...
bsd-3-clause
veorq/blueflower
blueflower/modules/bzip2.py
2
1655
# copyright (c) 2014 JP Aumasson <jeanphilippe.aumasson@gmail.com> # # This file is part of blueflower. # # blueflower 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 ...
gpl-3.0
iuyte/VEX-709S-2018
.ycm_extra_conf.py
1
6322
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
lgpl-3.0
mjirayu/sit_academy
lms/envs/cms/dev.py
132
1508
""" Settings for the LMS that runs alongside the CMS on AWS """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from ..dev import * FEATURES['AUTH_USE_CERTIFICATES'] = False SUBDOMAIN_...
agpl-3.0
qwertyjune/BethSaidaBible
venv/lib/python2.7/site-packages/django/contrib/gis/forms/widgets.py
62
3727
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSGeometry, GEOSException from django.forms.widgets import Widget from django.template import loader from django.utils import six from django.utils import t...
gpl-3.0
adlnet-archive/edx-platform
lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py
60
5146
# -*- 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): # Adding field 'InstructorTask.subtasks' db.add_column('instructor_task_instructortask', 'subtasks', ...
agpl-3.0
luciddg/auth-tool
lib/plugin/token.py
1
2084
# -*- coding: utf-8 -*- import hmac import hashlib import math import time from cherrypy.process import plugins __all__ = ['TokenEnginePlugin'] class TokenEnginePlugin(plugins.SimplePlugin): """ Generates and verifies RFC-6238-compliant time-based one-time passwords. Uses the SHA256 digest algorithm an...
mit
yoosw/printrun_etri
printrun/gui/__init__.py
1
23864
# This file is part of the Printrun suite. # # Printrun 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. # # Printrun is distributed in ...
gpl-3.0
apixandru/intellij-community
python/lib/Lib/site-packages/django/conf/locale/nn/formats.py
685
1657
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y H:i' YEAR_MONTH_FOR...
apache-2.0
mdovgialo/steam-vr-wheel
steam_vr_wheel/pyvjoy/vjoydevice.py
1
1698
from .constants import * from .exceptions import * import steam_vr_wheel.pyvjoy._sdk as _sdk class VJoyDevice(object): """Object-oriented API for a vJoy Device""" def __init__(self,rID=None, data=None): """Constructor""" self.rID=rID self._sdk= _sdk self._vj=self._sdk._vj if data: ...
mit
gaursagar/cclib
src/cclib/bridge/cclib2pyquante.py
1
1092
# -*- coding: utf-8 -*- # # Copyright (c) 2017, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Bridge for using cclib data in PyQuante (http://pyquante.sourceforge.net).""" from __future__ import print_fu...
bsd-3-clause
vrv/tensorflow
tensorflow/python/ops/state_ops.py
20
9586
# Copyright 2015 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
popazerty/e2-gui
lib/python/Screens/InputDeviceSetup.py
5
11888
from Screens.Screen import Screen from Screens.HelpMenu import HelpableScreen from Screens.MessageBox import MessageBox from Components.InputDevice import iInputDevices, iRcTypeControl from Components.Sources.StaticText import StaticText from Components.Sources.List import List from Components.config import config, Con...
gpl-2.0
memaldi/geopy
geopy/geocoders/googlev3.py
12
12755
""" :class:`.GoogleV3` is the Google Maps V3 geocoder. """ import base64 import hashlib import hmac from geopy.compat import urlencode from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT, DEFAULT_SCHEME from geopy.exc import ( GeocoderQueryError, GeocoderQuotaExceeded, ConfigurationError, Geocod...
mit
VasuAgrawal/tartanHacks2015
site/flask/lib/python2.7/site-packages/pip/_vendor/requests/utils.py
121
20879
# -*- coding: utf-8 -*- """ requests.utils ~~~~~~~~~~~~~~ This module provides utility functions that are used within Requests that are also useful for external consumption. """ import cgi import codecs import collections import io import os import platform import re import sys import socket import struct import wa...
mit
ibinti/intellij-community
python/lib/Lib/macurl2path.py
332
3275
"""Macintosh-specific module for conversion between pathnames and URLs. Do not import directly; use urllib instead.""" import urllib import os __all__ = ["url2pathname","pathname2url"] def url2pathname(pathname): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not r...
apache-2.0
charlyoleg/Cnc25D
cnc25d/gearbar.py
1
18085
# gearbar.py # generates gearbar and simulates gear. # created by charlyoleg on 2013/09/26 # # (C) Copyright 2013 charlyoleg # # This file is part of the Cnc25D Python package. # # Cnc25D is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # th...
gpl-3.0
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.6.0/Lib/fnmatch.py
27
3166
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
mit
codasus/django-blogages
blogages/apps/blogages_core/views.py
1
4123
from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, render_to_response from django.utils.functional import memoize from django.views.decorators.csrf import csrf_exempt from django.views.generic import TemplateView, ListView as BaseListView from bootstrap.views import (ListView,...
mit
stewnorriss/LibCloud
libcloud/common/brightbox.py
55
3413
# 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
scripnichenko/nova
nova/tests/unit/api/openstack/compute/test_server_group_quotas.py
26
6143
# Copyright 2014 Hewlett-Packard Development Company, L.P # 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....
apache-2.0
robdennis/sideboard
tests/plugins/different_versions/rdflib3_1_0/env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/completion.py
538
1838
import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ COMP_CWORD=$COMP_CWORD \\ ...
bsd-3-clause
Akagi201/learning-python
grpc/helloworld/helloworld_pb2.py
1
7591
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: helloworld.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.p...
mit
joelfiddes/topoMAPP
toposub/toposub_postInstant.py
2
1185
#!/usr/bin/env python """ This module runs toposub Example: as import: Attributes:$gridpath $samples $file1 $targV Todo: """ path2script = "./rsrc/toposubPostInstant.R" # main def main(gridpath, samples, file1, targV): """Main entry point for the script.""" run_rscript_fileout(path2script,[gri...
mit