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
AnhellO/DAS_Sistemas
Ene-Jun-2019/juanalmaguer/Extraordinario/Ejercicio 1.py
1
1906
import abc class ComponenteGrafico(metaclass = abc.ABCMeta): @abc.abstractmethod def renderizar(self): pass def _init_(self, *args, **kwargs): pass class Hijo(ComponenteGrafico): #Hereda de la clase abstracta ComponenteGrafico def _init_(self, *args, **kwargs): Component...
mit
JoltLabs/django-web-sugar
web_sugar/runtests/wsgi.py
1
1449
""" WSGI config for django_web_sugar project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLI...
bsd-3-clause
waynedkim/macadamia
sites/gwtorrent.py
1
1914
import urllib, urlparse import macadamia from bs4 import BeautifulSoup URLS = { "base": "http://www.gwtorrent.com/bbs/", "search": "board.php?bo_table={CATEGORY}&sfl=wr_subject&stx={KEYWORD}&sop=and", "article": "board.php?bo_table={CATEGORY}&wr_id={ID}", "download": "download.php?bo_table={CATEGORY}&wr_id={ID}" }...
gpl-2.0
endlessm/chromium-browser
net/data/websocket/trailing-whitespace_wsh.py
8
1068
# Copyright 2015 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. # # The purpose of this test is to verify that the WebSocket handshake correctly # ignores trailing whitespace on response headers. # It is used by test case ...
bsd-3-clause
jlegendary/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
jobiols/knowledge
document_sftp/models/document_sftp_root.py
5
2006
# -*- coding: utf-8 -*- # © 2016 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import stat try: from paramiko import SFTPAttributes from ..document_sftp_handle import DocumentSFTPHandle except ImportError: # pragma: no cover pass from openerp import api, m...
agpl-3.0
matburt/ansible
lib/ansible/plugins/connection/accelerate.py
30
12971
# (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
navycrow/Sick-Beard
sickbeard/webserve.py
1
148091
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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
plumgrid/plumgrid-nova
nova/virt/baremetal/db/migration.py
25
1255
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
DakotaNelson/sneaky-creeper
sneakers/tests/test_all.py
1
3025
import unittest import json import random import string import os from unittest.case import SkipTest from nose.tools import assert_equals, assert_in from functools import partial from twython import TwythonError import sneakers basePath = os.path.dirname(os.path.abspath(sneakers.__file__)) def unit_channel(channel,...
mit
adelina-t/nova
nova/scheduler/filters/extra_specs_ops.py
78
2255
# Copyright (c) 2011 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
TheMOOCAgency/edx-platform
lms/djangoapps/courseware/tests/test_submitting_problems.py
7
48341
# -*- coding: utf-8 -*- """ Integration tests for submitting problem responses and getting grades. """ import ddt import json import os from textwrap import dedent from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase ...
agpl-3.0
googleapis/python-firestore
tests/unit/v1/test_field_path.py
3
17364
# -*- coding: utf-8 -*- # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
crazyyoung01/vv
vn.femas/vnfemastd/test/tdtest.py
21
4917
# encoding: UTF-8 import sys from time import sleep from PyQt4 import QtGui from vnfemastd import * #---------------------------------------------------------------------- def print_dict(d): """按照键值打印一个字典""" for key,value in d.items(): print key + ':' + str(value) #----------------...
mit
111pontes/ydk-py
cisco-ios-xe/ydk/models/cisco_ios_xe/cisco_ia.py
1
20080
""" cisco_ia DMI self\-management YANG module for IOS Copyright (c) 2016 by Cisco Systems, Inc. All rights reserved. """ import re import collections from enum import Enum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk.errors import YPYError, YPYModelError class CiaL...
apache-2.0
luigiberrettini/build-deploy-stats
statsSend/teamCity/teamCityStatisticsSender.py
1
2136
#!/usr/bin/env python3 from dateutil import parser from statsSend.session import Session from statsSend.utils import print_exception from statsSend.urlBuilder import UrlBuilder from statsSend.teamCity.teamCityProject import TeamCityProject class TeamCityStatisticsSender: def __init__(self, settings, reporter): ...
mit
hmoraldo/AnimationEditor
src/MainMenu.py
1
2118
import Tkinter as tk import ttk import tkFileDialog as filedialog import Utils import AnimationEditor, LineEditor, RefVertexEditor, VertexEditor lblRefVertex = None refVertex = None class DialogMode(): New = 0 Open = 1 def selectFile(mode): if mode == DialogMode.Open: return filedialog.askopenfilename() else:...
mit
naparuba/opsbro
opsbro/kv.py
2
18337
import os import time import threading import socket from .httpclient import get_http_exceptions, httper from .log import LoggerFactory from .now import NOW from .dbwrapper import dbwrapper from .gossip import gossiper from .library import libstore from .stop import stopper from .util import get_sha1_hash from .jsonmg...
mit
thodoris/djangoPharma
djangoPharma/env/Lib/site-packages/django/db/models/deletion.py
46
13712
from collections import Counter, OrderedDict from operator import attrgetter from django.db import IntegrityError, connections, transaction from django.db.models import signals, sql from django.utils import six class ProtectedError(IntegrityError): def __init__(self, msg, protected_objects): self.protect...
apache-2.0
mtdewulf/incubator-airflow
airflow/contrib/operators/vertica_operator.py
45
1690
# -*- 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
cgars/ToLsTOy
ToLsTOy/test/test_gui.py
1
8315
# ------------------------------------------------------------------------------- # Copyright (c) 2016 Christian Garbers. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Simplified BSD License # which accompanies this distribution # # Contributors: # Ch...
bsd-2-clause
partofthething/home-assistant
tests/components/statsd/test_init.py
3
4611
"""The tests for the StatsD feeder.""" from unittest import mock from unittest.mock import MagicMock, patch import pytest import voluptuous as vol import homeassistant.components.statsd as statsd from homeassistant.const import EVENT_STATE_CHANGED, STATE_OFF, STATE_ON import homeassistant.core as ha from homeassistan...
mit
seanli9jan/tensorflow
tensorflow/python/util/tf_should_use.py
13
7425
# 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
shlyakpavel/s720-w832-KK-kernel
mediatek/build/tools/proguard_shrink_parser.py
17
2092
#!/usr/bin/python import sys from xml.dom import minidom from optparse import OptionParser def writeFile(outputFile, className, classMembers, newClass): if className != None: if newClass: #print 'remove class %s' % (className) outputFile.write('remove class %s\n' % (className)) ...
gpl-3.0
xArm-Developer/xArm-Python-SDK
example/wrapper/common/8006-save_force_zero.py
1
1250
#!/usr/bin/env python3 # Software License Agreement (BSD License) # # Copyright (c) 2019, UFACTORY, Inc. # All rights reserved. # # Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com> """ Description: save force sensor zero data to xArm controller. """ import os import sys import time sys.path.append(os.p...
bsd-3-clause
RomanZWang/osf.io
website/addons/badges/tests/utils.py
59
1215
import string import mock import random from website.addons.badges.model import Badge def create_mock_badger(mock_badger): #mock_badger.configured = True mock_badger.name = 'Honey' mock_badger.email = 'Not@real.com' for _ in range(4): create_mock_badge(mock_badger) mock_badger.save() ...
apache-2.0
huntxu/neutron
neutron/tests/unit/db/test_dvr_mac_db.py
1
9826
# Copyright (c) 2014 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 required by applic...
apache-2.0
tchellomello/home-assistant
homeassistant/components/accuweather/sensor.py
6
6196
"""Support for the AccuWeather service.""" from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_DEVICE_CLASS, CONF_NAME, DEVICE_CLASS_TEMPERATURE, ) from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import ( ATTR_FORECAST, ATTR_ICON, ATTR_LABEL, ATTR...
apache-2.0
salamer/django
django/core/files/temp.py
462
2950
""" The temp module provides a NamedTemporaryFile that can be reopened in the same process on any platform. Most platforms use the standard Python tempfile.NamedTemporaryFile class, but Windows users are given a custom class. This is needed because the Python implementation of NamedTemporaryFile uses the O_TEMPORARY f...
bsd-3-clause
MaPePeR/numpy
numpy/core/numeric.py
16
85523
from __future__ import division, absolute_import, print_function import sys import warnings import collections from numpy.core import multiarray from . import umath from .umath import (invert, sin, UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE, ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG, ...
bsd-3-clause
rjagerman/AT3
anontunnel/service/main.py
1
6645
import os try: import android os.environ["PYTHON_EGG_CACHE"] = "/data/data/org.tribler.at3.anontunnel/cache" os.environ['TRIBLER_STATE_DIR'] = "/sdcard/org.tribler.at3.anontunnel/.tribler" except ImportError: os.environ['TRIBLER_STATE_DIR'] = "./.tribler" import logging import logging.config import sys ...
mit
gurneyalex/OpenUpgrade
addons/resource/faces/pcalendar.py
433
28436
#@+leo-ver=4 #@+node:@file pcalendar.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softw...
agpl-3.0
repotvsupertuga/repo
script.module.urlresolver/lib/urlresolver/plugins/mystream.py
7
1160
""" OVERALL CREDIT TO: t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway urlresolver XBMC Addon Copyright (C) 2011 t0mm0 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 So...
gpl-2.0
craigcook/bedrock
tests/pages/home.py
4
1499
# 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/. from selenium.webdriver.common.by import By from pages.base import BasePage class HomePage(BasePage): _URL_TEMPL...
mpl-2.0
isandlaTech/cohorte-devtools
org.cohorte.eclipse.runner.basic/files/jython/Lib/distutils/tests/setuptools_build_ext.py
149
11489
from distutils.command.build_ext import build_ext as _du_build_ext try: # Attempt to use Pyrex for building extensions, if available from Pyrex.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext import os, sys from distutils.file_util import copy_file from di...
apache-2.0
michaelbramwell/sms-tools
lectures/06-Harmonic-model/plots-code/f0-TWM-errors-1.py
22
3586
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackman import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT import utilFunctions as UF def TWM (pfreq, p...
agpl-3.0
DNFcode/edx-platform
lms/envs/dev_ike.py
13
2330
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
agpl-3.0
ktp420/SeleniumBase
examples/my_first_test.py
1
4451
from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_basic(self): self.open('http://xkcd.com/353/') # Navigate to the web page self.assert_element('img[alt="Python"]') # Assert element on page self.click('a[rel="license"]') # Click elem...
mit
moreati/python-yubicommon
yubicommon/ctypes/__init__.py
2
1436
# Copyright (c) 2013 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
bsd-2-clause
lzw120/django
django/contrib/comments/views/comments.py
20
5433
from __future__ import absolute_import from django import http from django.conf import settings from django.contrib import comments from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirect, confirmation_view from django.core.exceptions import ObjectDoesNotExist, Validat...
bsd-3-clause
samuell/luigi
test/contrib/rdbms_test.py
2
13044
# 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 or agreed to in writing, ...
apache-2.0
nkhuyu/hypertable
src/py/ThriftClient/gen-py/hyperthrift/gen/ClientService.py
3
808474
# # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import T...
gpl-3.0
tliber/scrapy
scrapy/spidermiddlewares/urllength.py
152
1059
""" Url Length Spider Middleware See documentation in docs/topics/spider-middleware.rst """ import logging from scrapy.http import Request from scrapy.exceptions import NotConfigured logger = logging.getLogger(__name__) class UrlLengthMiddleware(object): def __init__(self, maxlength): self.maxlength ...
bsd-3-clause
cgranade/qutip
qutip/nonmarkov/transfertensor.py
2
8960
# -*- coding: utf-8 -*- # This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2015 and later, Arne L. Grimsmo # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
bsd-3-clause
dwhalen/holophrasm
nnlibrary.py
1
20675
import numpy as np """ This is a library to do pretty basic neural network computations automatically. It should be kept clean and simple. Computations are made as nodes are added to the graph and derivatives are propogated in the reverse order. There are currently just a few operations, which should be enough for ...
mit
rbailhac/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawRawSpectrum.py
41
4052
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
ericholscher/django
django/utils/functional.py
6
15587
import copy import operator from functools import wraps import sys from django.utils import six from django.utils.six.moves import copyreg # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools.partial (on # CPython) is a type and it...
bsd-3-clause
andela-ooladayo/django
django/core/cache/backends/filebased.py
428
5387
"File-based cache backend" import errno import glob import hashlib import io import os import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files.move import file_move_safe from django.utils.encoding import force_bytes try: f...
bsd-3-clause
nihilus/diaphora
pygments/formatters/terminal256.py
25
7680
# -*- coding: utf-8 -*- """ pygments.formatters.terminal256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for 256-color terminal output with ANSI sequences. RGB-to-XTERM color conversion routines adapted from xterm256-conv tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2) by Wolfg...
gpl-2.0
CredoReference/edx-platform
lms/djangoapps/bulk_enroll/views.py
16
3333
""" API views for Bulk Enrollment """ import json from edx_rest_framework_extensions.authentication import JwtAuthentication from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from bulk_enroll.serializers import BulkEnrollmentSerializer from enrollme...
agpl-3.0
xujun10110/kombu
kombu/tests/test_connection.py
7
22512
from __future__ import absolute_import import pickle import socket from copy import copy from kombu import Connection, Consumer, Producer, parse_url from kombu.connection import Resource from kombu.five import items, range from .case import Case, Mock, SkipTest, patch, skip_if_not_module from .mocks import Transpor...
bsd-3-clause
drmrd/ansible
test/sanity/validate-modules/module_args.py
50
2559
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Matt Martz <matt@sivel.net> # Copyright (C) 2016 Rackspace US, 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 ...
gpl-3.0
UnrememberMe/pants
tests/python/pants_test/base/test_cmd_line_spec_parser.py
7
3552
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pant...
apache-2.0
McNetic/couchpotato-ger
library/imdb/parser/http/searchPersonParser.py
67
3742
""" parser.http.searchPersonParser module (imdb package). This module provides the HTMLSearchPersonParser class (and the search_person_parser instance), used to parse the results of a search for a given person. E.g., when searching for the name "Mel Gibson", the parsed page would be: http://akas.imdb.com/find?q=Me...
gpl-3.0
yngfng/keepnote-0.7.8
keepnote/compat/notebook_v4.py
2
53497
""" KeepNote Notebook data structure """ # # KeepNote # Copyright (c) 2008-2009 Matt Rasmussen # Author: Matt Rasmussen <rasmus@alum.mit.edu> # # 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 Softw...
gpl-2.0
allmalaysianews/article-extractor
tests/tests/extractors/tweets.py
15
1183
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
sacharya/nova
nova/openstack/common/rpc/amqp.py
13
23620
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 - 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
apache-2.0
AmrThabet/CouchPotatoServer
couchpotato/__init__.py
14
4151
import os import time import traceback from couchpotato.api import api_docs, api_docs_missing, api from couchpotato.core.event import fireEvent from couchpotato.core.helpers.variable import md5, tryInt from couchpotato.core.logger import CPLog from couchpotato.environment import Env from tornado import template from t...
gpl-3.0
aristanetworks/arista-ovs-nova
nova/virt/libvirt/utils.py
1
15331
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyrig...
apache-2.0
tmm1/pygments.rb
vendor/pygments-main/pygments/lexers/sgf.py
2
2024
# -*- coding: utf-8 -*- """ pygments.lexers.sgf ~~~~~~~~~~~~~~~~~~~ Lexer for Smart Game Format (sgf) file format. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups from pygments.token imp...
mit
adamend/django-oscar
src/oscar/core/prices.py
61
1827
class TaxNotKnown(Exception): """ Exception for when a tax-inclusive price is requested but we don't know what the tax applicable is (yet). """ class Price(object): """ Simple price class that encapsulates a price and its tax information Attributes: incl_tax (Decimal): Price inclu...
bsd-3-clause
dob71/x2swn
skeinforge/fabmetheus_utilities/geometry/manipulation_meta/_array.py
12
5507
""" Boolean geometry array. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_tools import vertex from fab...
gpl-3.0
guardian/security_monkey
security_monkey/watchers/keypair.py
2
3570
# Copyright 2014 Netflix, 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...
apache-2.0
deandunbar/bitwave
hackathon_version/venv/lib/python2.7/site-packages/django/http/__init__.py
33
1184
from django.http.cookie import SimpleCookie, parse_cookie from django.http.request import (HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, build_request_repr) from django.http.response import ( HttpResponse, StreamingHttpResponse, FileResponse, HttpResponseRedirect, HttpResponsePermanentR...
mit
morelab/labmanager
labmanager/babel.py
6
1081
import traceback try: USE_BABELEX = True if USE_BABELEX: # Use regular Babelex instead of Babel from flask.ext.babelex import Babel as Babel_ex, gettext as gettext_ex, lazy_gettext as lazy_gettext_ex, ngettext as ngettext_ex gettext = gettext_ex ngettext = ngettext_ex ...
bsd-2-clause
lijiabogithub/QUANTAXIS
QUANTAXIS/QASpider/Engine/utils/url.py
1
1099
from hashlib import sha1 from urllib.parse import urlparse, urlencode, urlsplit, urlunsplit, quote def url_fingerprint(url): h = sha1() h.update(url.encode('utf-8')) return h.hexdigest() def safe_url(url, remove_empty_query=True): scheme, netloc, path, query, fragment = urlsplit(url) if not q...
mit
EnviroCentre/jython-upgrade
jython/lib/test/test_threading_local.py
14
3805
import unittest from doctest import DocTestSuite from test import test_support import threading import weakref import gc class Weak(object): pass def target(local, weaklist): weak = Weak() local.weak = weak weaklist.append(weakref.ref(weak)) class ThreadingLocalTest(unittest.TestCase): def test_...
mit
stefanhahmann/pybossa
pybossa/model/task_run.py
1
4983
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
agpl-3.0
donspaulding/adspygoogle
tests/adspygoogle/adwords/examples/remarketing_unittest.py
1
1751
#!/usr/bin/python # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
cloudcache/namebench
libnamebench/nameserver_test.py
175
7015
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
Botong/songtaste
lib/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## 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...
apache-2.0
lessc0de/neuroelectro_org
neuroelectro/south_migrations/0044_auto__add_field_neuronarticlemap_added_by.py
2
25758
# -*- 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 'NeuronArticleMap.added_by' db.add_column('neuroelectro_neuronarticlemap', 'added_by', ...
gpl-2.0
bop/rango
lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py
624
1426
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
gpl-2.0
jessekl/flixr
venv/lib/python2.7/site-packages/flask_wtf/file.py
4
2322
from werkzeug import FileStorage from wtforms import FileField as _FileField from wtforms import ValidationError from wtforms.validators import InputRequired, StopValidation class FileField(_FileField): """ Werkzeug-aware subclass of **wtforms.FileField** Provides a `has_file()` method to check if its da...
mit
greguu/linux-4.2.3-c3x00
scripts/rt-tester/rt-tester.py
1106
5305
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
da-ta-vinci21/faltuminds-landing
joins/migrations/0001_initial.py
2
1405
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'join' db.create_table(u'joins_join', ( (u'id'...
unlicense
theflofly/tensorflow
tensorflow/python/keras/engine/partial_batch_padding_handler.py
22
4224
# Copyright 2019 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
operepo/ope
libs/gluon/packages/dal/docs/conf.py
28
7950
# -*- coding: utf-8 -*- # # web2py documentation build configuration file, created by # sphinx-quickstart on Sun Aug 18 20:05:19 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 this # autogenerated file. # # All ...
mit
akosyakov/intellij-community
python/lib/Lib/site-packages/django/contrib/contenttypes/tests.py
87
2781
from django import db from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.contenttypes.views import shortcut from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.test...
apache-2.0
vmindru/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_tools_wait.py
39
5733
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Philippe Dellaert <philippe@dellaert.org> # 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 = { 'met...
gpl-3.0
ccomb/OpenUpgrade
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py
384
6603
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
autrilla/servo
tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py
191
1440
from os import path, listdir from hashlib import sha512, sha384, sha256, md5 from base64 import b64encode import re DIR = path.normpath(path.join(__file__, "..", "..")) ''' Yield each javascript and css file in the directory ''' def js_and_css_files(): for f in listdir(DIR): if path.isfile(f) and (f.endswith("....
mpl-2.0
chshu/openthread
tools/harness-automation/cases_R140/sed_6_3_2.py
18
1871
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
cshallue/models
research/deep_speech/decoder.py
4
3214
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
acioran/andrqrem
TESTS/main_minicap_working.py
1
9373
''' Quick and dirty android remote control through ADB Pretty slow (4-5FPSs), but works. Text writing works ok. NOTE: screen can be turned off, see latests app on phone USAGE: -left-click on screen for touch event -right-click, drag and let go for swipe -type for inputting text to the current field -C...
gpl-3.0
randynobx/ansible
lib/ansible/utils/vars.py
34
5561
# (c) 2012-2014, 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) an...
gpl-3.0
richardbolt/django-skipjack
skipjack/models.py
1
22485
"""Skipjack response models.""" import datetime from decimal import Decimal import time from django.db import models from django.db.models.signals import pre_delete, post_save from django.utils.encoding import smart_unicode from skipjack import signals RETURN_CODE_CHOICES = ( (1, 'Success'), (0, 'Comm failu...
mit
MikkelSchubert/paleomix
paleomix/pipelines/bam/config.py
1
4610
#!/usr/bin/python3 # # Copyright (c) 2013 Mikkel Schubert <MikkelSch@gmail.com> # # 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 ...
mit
memo/tensorflow
tensorflow/python/debug/cli/offline_analyzer.py
162
2565
# 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
ms-iot/python
cpython/Lib/json/__init__.py
3
13323
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally m...
bsd-3-clause
mktranstrum/ICTSSloppyModels2017
Figures/StructuralLinear/PlotStructuralLinear.py
1
1349
import numpy as np import pylab sqrt = np.sqrt fig_width = 8.0 # inches golden_mean = (sqrt(5)-1.0)/2.0 # Aesthetic ratio fig_height = fig_width*golden_mean # height in inches dpi = 600.0 # Convert inch to pt fig_size = [fig_width,fig_height] params...
mit
sexroute/commandergenius
project/jni/python/src/Lib/test/test_pow.py
61
4644
import test.test_support, unittest class PowTest(unittest.TestCase): def powtest(self, type): if type != float: for i in range(-1000, 1000): self.assertEquals(pow(type(i), 0), 1) self.assertEquals(pow(type(i), 1), type(i)) self.assertEquals(pow(t...
lgpl-2.1
robhudson/django
tests/decorators/tests.py
58
14120
from functools import update_wrapper, wraps from unittest import TestCase from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test, ) from django.http import HttpRequest, HttpResponse, HttpResponseNotA...
bsd-3-clause
HKUST-SING/tensorflow
tensorflow/contrib/learn/python/learn/datasets/base.py
125
6584
# 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
jannon/django-haystack
test_haystack/test_discovery.py
13
2411
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import django from django.test import TestCase from test_haystack.discovery.search_indexes import FooIndex from haystack import connections from haystack.utils.loading import UnifiedIndex # This is a necessary evil ...
bsd-3-clause
theguardian/headphones
lib/unidecode/x050.py
252
4682
data = ( 'Chang ', # 0x00 'Chi ', # 0x01 'Bing ', # 0x02 'Zan ', # 0x03 'Yao ', # 0x04 'Cui ', # 0x05 'Lia ', # 0x06 'Wan ', # 0x07 'Lai ', # 0x08 'Cang ', # 0x09 'Zong ', # 0x0a 'Ge ', # 0x0b 'Guan ', # 0x0c 'Bei ', # 0x0d 'Tian ', # 0x0e 'Shu ', # 0x0f 'Shu ', # 0x10...
gpl-3.0
6112/project-euler
problems/094.py
1
1223
# encoding=utf-8 ## SOLVED 2021/03/20 ## 518408346 # It is easily proved that no equilateral triangle exists with integral length # sides and integral area. However, the almost equilateral triangle 5-5-6 has an # area of 12 square units. # We shall define an almost equilateral triangle to be a triangle for which two ...
mit
rooshilp/CMPUT410Lab4
env-lab4/lib/python2.7/site-packages/werkzeug/testapp.py
294
9398
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
apache-2.0
sarvex/tensorflow
tensorflow/python/training/adagrad_da.py
21
7650
# 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
smendez/lean
paart/apps/projects/migrations/0020_auto__add_field_projectinfo_department.py
2
9640
# -*- 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 'ProjectInfo.department' db.add_column('projects_projectinfo', 'department', ...
gpl-3.0