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
Minkov/site
judge/migrations/0002_license.py
3
2843
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('judge', '0001_initial'), ] operations = [ migrations.CreateModel( name='License...
agpl-3.0
voidrank/kuaidadiSpider
kuaidadi_parse/spiders/request_count.py
1
1153
# -*- coding: utf-8 -*- import scrapy import cjson import re from kuaidadi_parse import settings class RequestCountSpider(scrapy.Spider): name = "request_count" allowed_domains = ["v.kuaidadi.com"] start_urls = tuple(["http://v.kuaidadi.com/point?cityId=%s&scope=city&date=%s&dimension=%s&num=300" % (city...
mit
Igll91/SymfonyTest
vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
mit
Bideau/SmartForrest
PythonServer/lib/python2.7/site-packages/setuptools/py31compat.py
570
1637
import sys import unittest __all__ = ['get_config_vars', 'get_path'] try: # Python 2.7 or >=3.2 from sysconfig import get_config_vars, get_path except ImportError: from distutils.sysconfig import get_config_vars, get_python_lib def get_path(name): if name not in ('platlib', 'purelib'): ...
mit
ericzhou2008/zulip
zerver/management/commands/realm_emoji.py
113
2292
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.models import Realm from zerver.lib.actions import do_add_realm_emoji, do_remove_realm_emoji import sys class Command(BaseCommand): help = """Manage emoji for the specified realm Example: python manage.py realm...
apache-2.0
testiddd/ShaniXBMCWork
other/playtv.py
12
5818
import struct import urllib2,urllib import re import json import math CRYPT_XXTEA_DELTA= 0x9E3779B9 class Crypt_XXTEA: _key=None def setKey(self,key): if isinstance(key, basestring): k = self._str2long(key, False); elif isinstance(key, list): k = key; else: ...
gpl-2.0
MiroK/DolfinSurface
test/unit/ale/python/HarmonicSmoothing.py
1
3925
"""Unit test for HarmonicSmoothing and ALE""" # Copyright (C) 2013 Jan Blechta # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
gpl-3.0
kornev/twitter_nlp
python/ner/extractEntities2.py
10
7927
#!/usr/bin/python import sys import os import re import subprocess import platform import time import codecs from signal import * from optparse import OptionParser BASE_DIR = 'twitter_nlp.jar' if os.environ.has_key('TWITTER_NLP'): BASE_DIR = os.environ['TWITTER_NLP'] sys.path.append('%s/python' % (BASE_DIR)) ...
gpl-3.0
nthien/pulp
client_lib/pulp/client/commands/consumer/content.py
17
20248
import os from gettext import gettext as _ from okaara.prompt import CLEAR_REMAINDER, COLOR_GREEN, COLOR_RED, MOVE_UP from pulp.bindings.exceptions import NotFoundException from pulp.client import validators from pulp.client.commands.polling import PollingCommand from pulp.client.commands.options import DESC_ID, OPTI...
gpl-2.0
indeedops/dd-agent
win32/agent.py
5
12644
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from collections import deque import logging import multiprocessing from optparse import Values import sys import time # 3p import servicemanager from win32.common import handle_exe_click import win32eve...
bsd-3-clause
leiferikb/bitpop
src/tools/telemetry/telemetry/web_perf/metrics/rendering_stats.py
1
10823
# 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 operator import attrgetter from telemetry.page import page_measurement # These are LatencyInfo component names indicating the various components # that...
gpl-3.0
fabiand/anaconda
pyanaconda/ui/tui/spokes/software.py
4
8460
# Software selection text spoke # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distrib...
gpl-2.0
stefanseefeld/synopsis
Synopsis/QualifiedName.py
1
1519
# # Copyright (C) 2008 Stefan Seefeld # All rights reserved. # Licensed to the public under the terms of the GNU LGPL (>= 2), # see the file COPYING for details. # class QualifiedName(tuple): sep = '' def __getitem__(self, i): """If i is a slice, make sure a QualifiedName is returned.""" ...
lgpl-2.1
gerrive/horizon
openstack_dashboard/test/api_tests/swift_tests.py
32
11434
# 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
Triv90/Nova
nova/compute/claims.py
8
7169
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
trosa/forca
gluon/contrib/pyfpdf/fpdf.py
1
79717
#!/usr/bin/env python # -*- coding: latin-1 -*- # ****************************************************************************** # * Software: FPDF for python * # * Version: 1.54c * # * Date: 2010-09-10 ...
gpl-2.0
gchinellato/Self-Balance-Robot
examples/BerryIMU/python-LSM9DS0-gryo-accel-compass/berryIMU.py
1
7384
#!/usr/bin/python # # This program reads the angles from the acceleromter, gyrscope # and mangnetometeron a BerryIMU connected to a Raspberry Pi. # # http://ozzmaker.com/ # # Copyright (C) 2015 Mark Williams # This library is free software; you can redistribute it and/or # modify it under the terms of the GN...
gpl-3.0
lowitty/selenium
x/pm/test_cases/case_main_pgw_pm.py
1
1145
# -*- coding: utf-8 -*- import os from datetime import datetime, timedelta from com.ericsson.xn.commons import caseutils from com.ericsson.xn.x.pm.PmCommons import PmBaseFunc sep = os.sep module_name = os.path.split(os.path.abspath(__file__))[1][:-3] # Pre of the test case caseutils.pre_test_case(module_name, 'pm_aut...
mit
Affix/CouchPotatoServer
couchpotato/core/media/_base/media/main.py
65
21493
from datetime import timedelta import time import traceback from string import ascii_lowercase from CodernityDB.database import RecordNotFound, RecordDeleted from couchpotato import tryInt, get_db from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, fireEventAsync, addEvent from couchpo...
gpl-3.0
patrickm/chromium.src
tools/valgrind/common.py
184
7634
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import platform import os import signal import subprocess import sys import time class NotImplementedError(Exception): pass class Ti...
bsd-3-clause
rapidhere/open-hackathon
open-hackathon-client/src/client/functions.py
6
4097
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
mit
fopina/tgbotplug-plugins
plugins/guess.py
2
3022
from tgbot.pluginbase import TGPluginBase, TGCommandBase from tgbot.botapi import ReplyKeyboardMarkup, ReplyKeyboardHide from random import random class GuessPlugin(TGPluginBase): def list_commands(self): return ( TGCommandBase('guess_start', self.guess_start, 'start the (number) guess game!')...
mit
prakxys/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
305
4235
from binascii import hexlify, unhexlify from hashlib import md5, sha1 from ..exceptions import SSLError try: # Test for SSL features SSLContext = None HAS_SNI = False import ssl from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23 from ssl import SSLContext # Modern SSL? from ssl import...
apache-2.0
mlk/thefuck
tests/test_types.py
1
6225
# -*- coding: utf-8 -*- import os from subprocess import PIPE from mock import Mock import pytest from tests.utils import CorrectedCommand, Rule, Command from thefuck import const from thefuck.exceptions import EmptyCommand from thefuck.system import Path class TestCorrectedCommand(object): def test_equality(se...
mit
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/topi/python/topi/vision/rcnn/proposal.py
2
3693
# 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...
apache-2.0
shanemcd/ansible
test/runner/lib/sanity/yamllint.py
24
1831
"""Sanity test using yamllint.""" from __future__ import absolute_import, print_function import os import re from lib.sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SanitySkipped, ) from lib.util import ( SubprocessError, run_command, ) from lib.config ...
gpl-3.0
freezmeinster/avagata-site
django/contrib/flatpages/tests/csrf.py
228
3780
import os from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase, Client class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.client = Client(enforce_csrf_checks=...
bsd-3-clause
ioram7/keystone-federado-pgid2013
build/passlib/build/lib.linux-x86_64-2.7/passlib/tests/test_context_deprecated.py
20
29435
"""tests for passlib.context this file is a clone of the 1.5 test_context.py, containing the tests using the legacy CryptPolicy api. it's being preserved here to ensure the old api doesn't break (until Passlib 1.8, when this and the legacy api will be removed). """ #====================================================...
apache-2.0
MonsterNya/Starbound_RU
tools/copy_denied.py
10
2420
#!/bin/python from os import walk from os.path import join, relpath, normpath from json import load, dump from multiprocessing import Pool oldpath = "./experimental/translations" newpath = "./translations" substitutions = dict() with open(join(newpath, "substitutions.json"),"r") as f: substitutions = load(f) fi...
apache-2.0
nextgis/NextGIS_QGIS_open
python/plugins/processing/algs/lidar/fusion/Cover.py
7
3814
# -*- coding: utf-8 -*- """ *************************************************************************** Cover.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************************...
gpl-2.0
piquadrat/django
django/contrib/gis/geos/collections.py
41
4162
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry im...
bsd-3-clause
alvarolopez/nova
nova/objects/__init__.py
6
2788
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
barseghyanartur/django-extensions
tests/test_encrypted_fields.py
24
10268
import tempfile from contextlib import contextmanager import django import pytest from django.conf import settings from django.db import connection, models from django.test import TestCase from .testapp.models import Secret # Only perform encrypted fields tests if keyczar is present. Resolves # http://github.com/dja...
mit
IV-GII/SocialCookies
ENV1/lib/python2.7/site-packages/django/db/models/query.py
28
69525
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import itertools import sys import warnings from django.conf import settings from django.core import exceptions from django.db import connections, router, transaction, DatabaseError from django.db.models.constants import L...
gpl-2.0
runt18/mojo
third_party/cython/src/Cython/Compiler/ModuleNode.py
87
123073
# # Module parse tree node # import cython cython.declare(Naming=object, Options=object, PyrexTypes=object, TypeSlots=object, error=object, warning=object, py_object_type=object, UtilityCode=object, EncodedString=object) import os import operator from PyrexTypes import CPtrType import ...
bsd-3-clause
bureau14/qdb-benchmark
thirdparty/boost/tools/build/test/core_update_now.py
45
6202
#!/usr/bin/python # Copyright 2011 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) import BoostBuild import os def basic(): t = BoostBuild.Tester(pass_toolset=0, pass_d0=False) t.write("file.jam",...
bsd-2-clause
SCgeeker/OpenSesame
dev-scripts/check_ts.py
2
1686
#!/usr/bin/env python #-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version....
gpl-3.0
frankyrumple/ope
admin_app/gluon/contrib/timecollect.py
43
3511
# Only Python 2.6 and up, because of NamedTuple. import time from collections import namedtuple Score = namedtuple('Score', ['tag', 'stamp']) class TimeCollector(object): def __init__(self): '''The first time stamp is created here''' self.scores = [Score(tag='start', stamp=time.clock())] def ...
mit
moshthepitt/afya360
health_facilities/serializers.py
1
5329
from rest_framework import serializers from drf_haystack.serializers import HaystackSerializer from .models import FacilityOwner, FacilityType, HealthFacility from .search_indexes import HealthFacilityIndex from places.serializers import ProvinceSerializer, ConstituencySerializer, CountySerializer from places.seriali...
mit
DBMandrake/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x078.py
252
4648
data = ( 'Dang ', # 0x00 'Ma ', # 0x01 'Sha ', # 0x02 'Dan ', # 0x03 'Jue ', # 0x04 'Li ', # 0x05 'Fu ', # 0x06 'Min ', # 0x07 'Nuo ', # 0x08 'Huo ', # 0x09 'Kang ', # 0x0a 'Zhi ', # 0x0b 'Qi ', # 0x0c 'Kan ', # 0x0d 'Jie ', # 0x0e 'Fen ', # 0x0f 'E ', # 0x10 'Ya ', ...
gpl-2.0
Statoil/libecl
python/ecl/well/well_segment.py
2
2422
from cwrap import BaseCClass from ecl import EclPrototype class WellSegment(BaseCClass): TYPE_NAME = "well_segment" _active = EclPrototype("bool well_segment_active(well_segment)") _main_stem = EclPrototype("bool well_segment_main_stem(well_segment)") _nearest_wellhead = EclPrototype(...
gpl-3.0
shawnadelic/shuup
shuup_tests/functional/test_shipment_delete_with_simple_supplier.py
2
1846
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest import random from shuup.core.models import Shipment, Shipmen...
agpl-3.0
jasonseminara/OpenSourceFinal
myvenv/lib/python3.5/site-packages/django/conf/locale/sk/formats.py
504
1173
# -*- 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. F Y' TIME_FORMAT = 'G:i' DATET...
mit
yubinbai/leetcode
src/postOrderTraversal/main3.py
2
1066
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: # @param root, a tree node # @return a list of integers def postorderTraversal(self, root): ret = [] def visit(e): ret.append(e.val) if...
gpl-3.0
kubeflow/kfp-tekton-backend
sdk/python/kfp/dsl/_volume_snapshot_op.py
1
4947
# Copyright 2019 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 agreed to in writing, ...
apache-2.0
mayapurmedia/wagtail
wagtail/wagtailcore/views.py
31
2392
from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404, redirect from django.core.urlresolvers import reverse from django.conf import settings from wagtail.wagtailcore import hooks from wagtail.wagtailcore.models import Page, PageViewRestriction from wagtail.wagtailcore.forms impo...
bsd-3-clause
eternnoir/pyTelegramBotAPI
examples/middleware/session.py
2
1868
#!/usr/bin/python # This example shows how to implement session creation and retrieval based on user id with middleware handler. # # Note: For the sake of simplicity of this example no extra library is used. However, it is recommended to use # in-memory or on-disk storage implementations (redis, mysql, postgres and et...
gpl-2.0
rgom/Pydev
plugins/org.python.pydev.jython/Lib/distutils/command/bdist_rpm.py
72
20997
"""distutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" __revision__ = "$Id$" import sys import os import string from distutils.core import Command from distutils.debug import DEBUG from distutils.file_util import write_file from distutils.errors ...
epl-1.0
nyuszika7h/youtube-dl
youtube_dl/extractor/linuxacademy.py
7
6519
from __future__ import unicode_literals import json import random import re from .common import InfoExtractor from ..compat import ( compat_b64decode, compat_HTTPError, ) from ..utils import ( ExtractorError, orderedSet, unescapeHTML, urlencode_postdata, urljoin, ) class LinuxAcademyIE(I...
unlicense
goldeneye-source/ges-python
lib/tkinter/test/test_tkinter/test_loadtk.py
162
1503
import os import sys import unittest import test.support as test_support from tkinter import Tcl, TclError test_support.requires('gui') class TkLoadTest(unittest.TestCase): @unittest.skipIf('DISPLAY' not in os.environ, 'No $DISPLAY set.') def testLoadTk(self): tcl = Tcl() self.assertRaises(Tc...
gpl-3.0
Ravenm/2143-OOP-NASH
python3env/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py
536
6090
# -*- coding: utf-8 -*- # pidlockfile.py # # Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Python Software Foundation License, version 2 or # later as published by the Python Software Foundation. # No ...
cc0-1.0
dholbach/snapcraft
snaps_tests/tour_tests/00-SNAPCRAFT/test_02_parts.py
11
1085
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
Brainbuster/openpli-buildumgebung
bitbake/lib/bb/msg.py
7
5729
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'msg' implementation Message handling infrastructure for bitbake """ # Copyright (C) 2006 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
snpabilonia/rgims
modules/eden/stats.py
3
59603
# -*- coding: utf-8 -*- """ Sahana Eden Stats Model @copyright: 2012 (c) Sahana Software Foundation @license: MIT 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 ...
mit
rixrix/servo
tests/wpt/harness/wptrunner/executors/executormarionette.py
3
15451
# 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 hashlib import os import socket import sys import threading import time import traceback import urlparse import u...
mpl-2.0
BeATz-UnKNoWN/python-for-android
python-modules/twisted/twisted/mail/test/test_mail.py
49
68828
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for large portions of L{twisted.mail}. """ import os import errno import shutil import pickle import StringIO import rfc822 import tempfile import signal from zope.interface import Interface, implements from twisted.trial im...
apache-2.0
gashcrumb/origin
vendor/k8s.io/kubernetes/examples/job/work-queue-2/rediswq.py
132
6169
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
meabsence/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_config_cmd.py
47
2583
"""Tests for distutils.command.config.""" import unittest import os import sys from test.support import run_unittest from distutils.command.config import dump_file, config from distutils.tests import support from distutils import log class ConfigTestCase(support.LoggingSilencer, support.TempdirMa...
apache-2.0
roninio/gae-shopify-python-boilerplate
bp_includes/external/linkedin/server.py
28
1447
import BaseHTTPServer import cgi from .linkedin import LinkedInApplication, LinkedInAuthentication, PERMISSIONS def quick_api(api_key, secret_key): """ This method helps you get access to linkedin api quickly when using it from the interpreter. Notice that this method creates http server and wait for...
lgpl-3.0
jodal/pyspotify
tests/test_image.py
3
13570
from __future__ import unicode_literals import unittest import spotify import tests from tests import mock @mock.patch('spotify.image.lib', spec=spotify.lib) class ImageTest(unittest.TestCase): def setUp(self): self.session = tests.create_session_mock() spotify._session_instance = self.session ...
apache-2.0
robovm/robovm-studio
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_throw.py
327
1586
"""Fixer for generator.throw(E, V, T). g.throw(E) -> g.throw(E) g.throw(E, V) -> g.throw(E(V)) g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) g.throw("foo"[, V[, T]]) will warn about string exceptions.""" # Author: Collin Winter # Local imports from .. import pytree from ..pgen2 import token from .. im...
apache-2.0
OptiPop/external_chromium_org_third_party_skia
gm/rebaseline_server/download_actuals.py
16
6022
#!/usr/bin/python """ Copyright 2014 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Download actual GM results for a particular builder. """ # System-level imports import optparse import os import posixpath import re import urllib2 # Must fix up PYTHON...
bsd-3-clause
Omegaphora/external_chromium_org
third_party/jinja2/meta.py
659
4190
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
bsd-3-clause
fly19890211/edx-platform
cms/djangoapps/contentstore/views/certificates.py
14
21676
""" Certificates Data Model: course.certificates: { 'certificates': [ { 'version': 1, // data contract version 'id': 12345, // autogenerated identifier 'name': 'Certificate 1', 'description': 'Certificate 1 Description', 'course_title': 'course ti...
agpl-3.0
MortalViews/incubator-airflow
tests/contrib/hooks/test_redis_hook.py
38
1449
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
ossdemura/django-miniblog
src/Lib/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
Godiyos/python-for-android
python-modules/twisted/twisted/mail/relaymanager.py
54
21447
# -*- test-case-name: twisted.mail.test.test_mail -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Infrastructure for relaying mail through smart host Today, internet e-mail has stopped being Peer-to-peer for many problems, spam (unsolicited bulk mail) among them. Instead, mos...
apache-2.0
hickford/cython
Demos/benchmarks/util.py
33
1868
#!/usr/bin/env python """Utility code for benchmark scripts.""" __author__ = "collinwinter@google.com (Collin Winter)" import math import operator try: reduce except NameError: from functools import reduce def run_benchmark(options, num_runs, bench_func, *args): """Run the given benchmark, print result...
apache-2.0
osvalr/odoo
addons/sales_team/sales_team.py
180
6131
# -*- 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...
agpl-3.0
oskar456/youtube-dl
youtube_dl/extractor/behindkink.py
90
1647
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import url_basename class BehindKinkIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?behindkink\.com/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<id>[^/#?_]+)' _TEST = { ...
unlicense
CruiseDevice/coala
tests/test_bears/internal_folder/SpaceConsistencyTestBear.py
30
3097
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper from coalib.bears.LocalBear import LocalBear from coalib.results.Diff import Diff from coalib.results.Result import Result class SpaceConsistencyTestBear(LocalBear): def run(self, filename, file, use_spaces: bool, ...
agpl-3.0
BioGRID/BioGRID-Annotation
EG_updateDefinitions.py
2
5265
# Parse all definitions for genes from Entrez Gene that # are relevant to the organism we want loaded import Config import sys, string, argparse import MySQLdb import Database import gzip from classes import EntrezGene # Process Command Line Input argParser = argparse.ArgumentParser( description = 'Upd...
mit
jjs0sbw/CSPLN
apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/numpy/oldnumeric/fix_default_axis.py
101
8035
""" This module adds the default axis argument to code which did not specify it for the functions where the default was changed in NumPy. The functions changed are add -1 ( all second argument) ====== nansum nanmax nanmin nanargmax nanargmin argmax argmin compress 3 add 0 ====== take 3 repeat 3 sum #...
gpl-3.0
jminardi/RobotBrain
robot_brain/sensors/ping_sensor.py
1
1399
import time import RPi.GPIO as io class PingSensor(object): def __init__(self, trigger, echo, range=(0, 100)): self.trigger = trigger self.echo = echo self.range = range self.num_values = 1 io.setmode(io.BCM) io.setup(trigger, io.OUT) io.setup(echo, io.IN)...
mit
yongshengwang/hue
desktop/core/ext-py/python-openid-2.2.5/openid/test/test_urinorm.py
77
1298
import os import unittest import openid.urinorm class UrinormTest(unittest.TestCase): def __init__(self, desc, case, expected): unittest.TestCase.__init__(self) self.desc = desc self.case = case self.expected = expected def shortDescription(self): return self.desc ...
apache-2.0
kYc0o/RIOT
tests/pkg_semtech-loramac/tests/01-run.py
11
5984
#!/usr/bin/env python3 # Copyright (C) 2019 Inria # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys import time from testrunner import run # It's assumed that the same APPEUI ...
lgpl-2.1
maciek263/django2
myvenv/Lib/site-packages/django/utils/formats.py
76
8469
# Avoid importing `importlib` from this package. from __future__ import absolute_import import datetime import decimal import unicodedata from importlib import import_module from django.conf import settings from django.utils import dateformat, datetime_safe, numberformat, six from django.utils.encoding import force_s...
mit
40023154/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/threading.py
730
45641
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys import _thread from time import sleep as _sleep try: from time import monotonic as _time except ImportError: from time import time as _time from traceback import format_exc as _format_exc from _weakrefset import WeakSet # No...
gpl-2.0
40223201/w16b_test
static/Brython3.1.1-20150328-091302/Lib/tempfile.py
728
22357
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
agpl-3.0
TeXworks/texworks
.github/actions/deploy-artifactory/upload2artifactory.py
3
1166
import base64, json, os, sys import urllib.request import urllib.error repo = os.environ['ARTIFACTORY_REPO'] remotePath = os.environ['ARTIFACTORY_PATH'] baseurl = os.environ['ARTIFACTORY_URL'] username = os.environ['ARTIFACTORY_USER'] key = os.environ['ARTIFACTORY_KEY'] auth = 'Basic {0}'.format(base64.b64encode('{0}...
gpl-2.0
Slach/Diamond
src/diamond/handler/cloudwatch.py
6
6131
# coding=utf-8 """ Output the collected values to AWS CloudWatch Automatically adds the InstanceID Dimension #### Dependencies * [boto](http://boto.readthedocs.org/en/latest/index.html) #### Configuration Enable this handler * handers = diamond.handler.cloudwatch.cloudwatchHandler Example Config: [[cloudwatch...
mit
EduPepperPD/pepper2013
lms/envs/cms/mixed_dev.py
8
1344
""" This configuration is to run the MixedModuleStore on a localdev environment """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 from .dev import * MODULESTORE = { 'default': { 'ENGINE': 'xmodule.m...
agpl-3.0
bensternthal/snippets-service
vendor-local/lib/python/south/tests/autodetection.py
49
11803
from south.tests import unittest from south.creator.changes import AutoChanges, InitialChanges from south.migration.base import Migrations from south.tests import Monkeypatcher from south.creator import freezer from south.orm import FakeORM from south.v2 import SchemaMigration class TestComparison(unittest.TestCase):...
bsd-3-clause
timdiels/zeroinstall
zeroinstall/cmd/__init__.py
1
4071
""" The B{0install} command-line interface. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. from zeroinstall import _ import os, sys from optparse import OptionParser import logging from zeroinstall import SafeException valid_commands = ['select', 'download'...
lgpl-2.1
steeve/xbmctorrent
resources/site-packages/xbmctorrent/ga.py
5
2698
from xbmctorrent import plugin from functools import wraps import xbmc TRACKING_ID = "UA-40799149-3" def make_visitor(): from pyga.requests import Visitor visitor = Visitor() visitor.user_agent = get_user_agent() visitor.locale = xbmc.getLanguage() return visitor def get_ga(): from pyga.re...
gpl-3.0
sienkie/pathways-analysis
methods/LRpath/LRpath.py
1
9220
import math import numpy import os.path import sys import pandas as pd import statsmodels.api as sm from scipy import stats from databases import KEGGPathways from methods.method import Method, MethodResult from models import Experiment class LRpathResult(MethodResult): columns = ['Path_ID', 'nGe...
mit
ibrahimgunduz34/SpiffWorkflow
SpiffWorkflow/util/event.py
3
8980
# -*- coding: utf-8 -*- from __future__ import division ################################################ # DO NOT EDIT THIS FILE. # THIS CODE IS TAKE FROM Exscript.util: # https://github.com/knipknap/exscript/tree/master/src/Exscript/util ################################################ # Copyright (C) 2007-2010 Sam...
lgpl-3.0
soldag/home-assistant
homeassistant/components/fan/device_action.py
19
2094
"""Provides device automations for Fan.""" from typing import List, Optional import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_DEVICE_ID, CONF_DOMAIN, CONF_ENTITY_ID, CONF_TYPE, SERVICE_TURN_OFF, SERVICE_TURN_ON, ) from homeassistant.core import Context, HomeA...
apache-2.0
MartinEnder/erpnext-de
erpnext/hr/doctype/salary_slip/test_salary_slip.py
6
5418
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe from frappe.utils import today from erpnext.hr.doctype.employee.employee import make_salary_structure from erpnext.hr.doct...
agpl-3.0
edcast-inc/edx-platform-edcast
common/lib/xmodule/xmodule/video_module/video_module.py
9
37469
# -*- coding: utf-8 -*- # pylint: disable=abstract-method """Video is ungraded Xmodule for support video content. It's new improved video module, which support additional feature: - Can play non-YouTube video sources via in-browser HTML5 video player. - YouTube defaults to HTML5 mode from the start. - Speed changes in...
agpl-3.0
csgrad/ns-3-9-ngwmn
bindings/python/apidefs/gcc-LP64/ns3_module_bridge.py
6
16788
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## bridge-channel.h: ns3::BridgeChannel [class] module.add_class('BridgeChannel', parent=root_module['ns3::Channel']) ## bridge-net-device.h: ns3::BridgeNet...
gpl-2.0
jjas0nn/solvem
tensorflow/lib/python2.7/site-packages/tensorflow/contrib/distributions/python/ops/gumbel.py
11
7042
# 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...
mit
GDGLima/contentbox
third_party/django/middleware/gzip.py
225
2140
import re from django.utils.text import compress_sequence, compress_string from django.utils.cache import patch_vary_headers re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accor...
apache-2.0
chriscrosscutler/scikit-image
doc/examples/plot_restoration.py
17
1960
# -*- coding: utf-8 -*- """ ===================== Image Deconvolution ===================== In this example, we deconvolve a noisy version of an image using Wiener and unsupervised Wiener algorithms. This algorithms are based on linear models that can't restore sharp edge as much as non-linear methods (like TV restora...
bsd-3-clause
sean-/ansible
lib/ansible/plugins/lookup/fileglob.py
46
1172
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
quinot/ansible
lib/ansible/modules/network/aci/aci_tenant.py
5
3801
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
danielreed/python-hpOneView
examples/endpoints.py
2
2041
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP # # 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 limi...
mit
hunter007/django
tests/migrations/test_multidb.py
366
6909
import unittest from django.db import connection, migrations, models from django.db.migrations.state import ProjectState from django.test import override_settings from .test_operations import OperationTestBase try: import sqlparse except ImportError: sqlparse = None class AgnosticRouter(object): """ ...
bsd-3-clause
SGenheden/lammps
tools/python/pizza/pdbfile.py
85
9342
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2005) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains # certain rights in this software. This software is...
gpl-2.0
beeftornado/sentry
src/sentry/api/endpoints/organization_onboarding_tasks.py
1
2050
from __future__ import absolute_import from django.utils import timezone from rest_framework.response import Response from sentry.api.bases.organization import OrganizationEndpoint, OrganizationPermission from sentry.models import OnboardingTaskStatus, OrganizationOnboardingTask from sentry.receivers import try_mark_...
bsd-3-clause