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
gauribhoite/personfinder
app/pytz/zoneinfo/Portugal.py
9
8836
'''tzinfo timezone information for Portugal.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Portugal(DstTzInfo): '''Portugal timezone definition. See datetime.tzinfo for details''' zone = 'Portugal' _utc_transition_...
apache-2.0
mdrumond/tensorflow
tensorflow/python/kernel_tests/softmax_op_test.py
25
7120
# 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
GaZ3ll3/numba
numba/tests/test_usecases.py
5
8250
from __future__ import print_function import itertools import numpy as np import numba.unittest_support as unittest from numba.compiler import compile_isolated, Flags from numba import types, utils from numba.tests import usecases from .support import TestCase enable_pyobj_flags = Flags() enable_pyobj_flags.set("ena...
bsd-2-clause
zombah/android_kernel_nokia_msm8610
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
aherlihy/mongo-python-driver
test/version.py
5
2994
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
asm-products/cloudroutes-service
src/monitors/checks/cloudflare-traffic-decrease/cloudflare.py
27
5506
# Module for interacting with CloudFlare # updated for v4 of cloudflare API import requests import json baseurl = "https://api.cloudflare.com/client/v4" def validate_response(req, logger): ''' General response validation ''' logger.debug("cloudflare: CloudFlare replied with " + str(req.status_code)) if...
agpl-3.0
gramps-project/gramps
gramps/gen/filters/rules/person/_nodeathdate.py
5
2049
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at you...
gpl-2.0
pulkitpagare/Nosql-Exploitation-Framework
dbattacks/postattacks.py
6
2210
#Future platform for post based Attacks from nosqlexploitframe import redis_conn,redis_enum,couch_conn from nosqlexploitframe import main from termcolor import colored import sys #def post_couch(): def post_redis(): target=raw_input("Enter target\n") r_server=redis_conn(target,6379) try: shit=r_server.keys...
gpl-2.0
onceuponatimeforever/oh-mainline
vendor/packages/gdata/tests/gdata_tests/analytics/live_client_test.py
39
3588
#!/usr/bin/env python # # Copyright (C) 2010 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 ...
agpl-3.0
GehenHe/Recognize-Face-on-Android
tensorflow/python/layers/layers.py
19
2378
# 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
varunarya10/python-cinderclient
cinderclient/tests/v1/test_volume_backups.py
9
1923
# Copyright (C) 2013 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/LICEN...
apache-2.0
craigds/nose-moduleonly
moduleonly/plugin.py
1
1152
import os from nose.plugins import Plugin class ModuleOnly(Plugin): """ Prints only the test module instead of the full test name. Use with --collect-only to get a list of test modules. """ name = 'moduleonly' def options(self, parser, env=os.environ): super(ModuleOnly, self).option...
mit
sugarlabs/speak
chat.py
2
8407
# Copyright (C) 2009, Aleksey Lim # Copyright (C) 2014, Walter Bender (remove hippo) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any ...
gpl-3.0
gorjuce/odoo
addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
337
3443
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
dragly/conan
conans/test/integration/manifest_validation_test.py
3
12399
import unittest from conans.test.tools import TestServer, TestClient from conans.model.ref import ConanFileReference import os from conans.util.files import save, load, md5 from conans.model.ref import PackageReference from conans.paths import CONANFILE, SimplePaths class ManifestValidationTest(unittest.TestCase): ...
mit
cccfran/sympy
sympy/physics/quantum/tests/test_operatorordering.py
115
1490
from sympy.physics.quantum import Dagger from sympy.physics.quantum.boson import BosonOp from sympy.physics.quantum.fermion import FermionOp from sympy.physics.quantum.operatorordering import (normal_order, normal_ordered_form) def test_normal_order(): a = BosonOp(...
bsd-3-clause
whn09/tensorflow
tensorflow/python/kernel_tests/denormal_test.py
68
2161
# 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
nelmiux/CarnotKE
jyhton/lib-python/2.7/plat-mac/Carbon/Menus.py
81
4874
# Generated from 'Menus.h' def FOUR_CHAR_CODE(x): return x noMark = 0 kMenuDrawMsg = 0 kMenuSizeMsg = 2 kMenuPopUpMsg = 3 kMenuCalcItemMsg = 5 kMenuThemeSavvyMsg = 7 mDrawMsg = 0 mSizeMsg = 2 mPopUpMsg = 3 mCalcItemMsg = 5 mChooseMsg = 1 mDrawItemMsg = 4 kMenuChooseMsg = 1 kMenuDrawItemMsg = 4 kThemeSavvyMenuResponse ...
apache-2.0
mccheung/kbengine
kbe/res/scripts/common/Lib/asyncio/queues.py
63
9019
"""Queues""" __all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'JoinableQueue', 'QueueFull', 'QueueEmpty'] import collections import heapq from . import events from . import futures from . import locks from .tasks import coroutine class QueueEmpty(Exception): 'Exception raised by Queue.get(block=0)/...
lgpl-3.0
ModdedPA/android_external_chromium
chrome/common/extensions/docs/build/directory.py
65
24652
#!/usr/bin/python # Copyright (c) 2010 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. """Class for parsing metadata about extension samples.""" import locale import os import os.path import re import hashlib import zipfi...
bsd-3-clause
jumpstarter-io/neutron
neutron/tests/unit/test_metadata_agent.py
3
23532
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
apache-2.0
nuigroup/pymt-widgets
pymt/tools/packaging/win32/build.py
2
6313
import os, sys, shutil import zipfile from zipfile import ZipFile from urllib import urlretrieve from subprocess import Popen, PIPE from distutils.cmd import Command def zip_directory(dir, zip_file): zip = ZipFile(zip_file, 'w', compression=zipfile.ZIP_DEFLATED) root_len = len(os.path.abspath(dir)) ...
lgpl-3.0
tdyas/pants
contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_resolve_integration.py
2
3112
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os from textwrap import dedent from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest class NodeResolveIntegrationTest(PantsRunIntegrationTest): def te...
apache-2.0
matthiaskrgr/cppcheck
tools/daca2-report.py
1
7815
#!/usr/bin/env python import os import sys import re import subprocess def readdate(data): if data[:5] == 'DATE ': datepos = 0 else: datepos = data.find('\nDATE ') if datepos >= 0: datepos += 1 if datepos < 0: return None datestr = '' datepos += 5 w...
gpl-3.0
ChinaQuants/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/ascii.py
103
1298
""" Python 'ascii' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This i...
apache-2.0
tashaxe/Red-DiscordBot
lib/pip/_vendor/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## 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
theoryno3/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
moodlIMyIl/DEVTSHAKE
tg/tg-test.py
199
1450
import tgl import pprint from functools import partial our_id = 0 pp = pprint.PrettyPrinter(indent=4) binlog_done = False; def on_binlog_replay_end(): binlog_done = True; def on_get_difference_end(): pass def on_our_id(id): our_id = id return "Set ID: " + str(our_id) def msg_cb(success, msg): ...
gpl-2.0
ncoop/i3pystatus
i3pystatus/cpu_usage.py
5
3649
from collections import defaultdict from string import Formatter from i3pystatus import IntervalModule try: from natsort import natsorted as sorted except ImportError: pass class CpuUsage(IntervalModule): """ Shows CPU usage. The first output will be inacurate. Linux only .. rubric:: A...
mit
Nikoala/CouchPotatoServer
libs/chardet/mbcharsetprober.py
2924
3268
######################## 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
Ernesto99/odoo
addons/account/report/account_partner_balance.py
286
11049
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
zadgroup/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
13
123700
# pylint: disable=no-member """ Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML) """ from collections import namedtuple import datetime import logging import ddt import itertools import mimetypes from unittest import skip from uuid import uuid4 from contextlib import contextmana...
agpl-3.0
tempbottle/jsonpp
sen.py
3
12049
#!/usr/bin/env python """Python module that generates .ninja files. Some of the stuff here was borrowed from the main ninja project. However this module aims to extend the bare-bones provided with a rich python API. Note: This file is meant to be a single file for easy inclusion for existing build systems. Hence thi...
mit
ostrokach/biskit
doc/tutorial_numpy/howto.py
2
3626
from numpy import * import numpy.random as R import numpy as N from Biskit.gnuplot import * ######################################## ## creating arrays ## [array, arange, zeros] ######################################## a = array( [ [ 1,2,3,4,5 ], [6,7,8,9,10] ] ) #b = array( [ '1', '2', '3' ], int ) b = array( rang...
gpl-3.0
r-icarus/openstack_microserver
openstack_dashboard/openstack/common/fileutils.py
13
3019
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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.apac...
apache-2.0
40223226/2015cdbg8
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/display.py
603
25179
#!/usr/bin/env python '''Pygame module to control the display window and screen. This module offers control over the pygame display. Pygame has a single display Surface that is either contained in a window or runs full screen. Once you create the display you treat it as a regular Surface. Changes are not immediately ...
gpl-3.0
doganov/edx-platform
lms/djangoapps/course_api/blocks/tests/test_forms.py
7
8417
""" Tests for Course Blocks forms """ import ddt from django.http import Http404, QueryDict from urllib import urlencode from rest_framework.exceptions import PermissionDenied from opaque_keys.edx.locator import CourseLocator from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.models import ...
agpl-3.0
ExodusGear/MMOCoin
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
myhdl/myhdl
myhdl/_concat.py
4
2591
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2008 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
lgpl-2.1
BonJarber/python-saml
saml/client.py
2
2501
# -*- coding: utf-8 -*- import base64 import zlib import six from six.moves.urllib.parse import urlencode, parse_qs, unquote_plus from lxml import etree from saml import schema from saml.schema.base import _element_registry def send(uri, message, relay_state=None, protocol='redirect'): # Determine the name of pa...
mit
be-cloud-be/horizon-addons
web/web_ckeditor4/__openerp__.py
1
1543
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013-2015 Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or mod...
agpl-3.0
JavML/django
tests/model_fields/models.py
210
12155
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
bsd-3-clause
jhbradley/moose
framework/contrib/nsiqcppstyle/rules/RULE_6_5_B_do_not_use_macro_for_constants.py
43
2094
""" Do not use macro for the constants. if the constants is defined by macro. this rule reports a violation. Instead, use enum or const variables. However, it's ok to write a macro function. And.. If the macro is start with underbar, it regards this macro is defined for the special purpose and it doesn't report a viol...
lgpl-2.1
Jgarcia-IAS/ReporsitorioVacioOdoo
openerp/addons/l10n_be_coda/__openerp__.py
260
3869
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
fubecka/f5-dashboard
flask/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py
21
9943
# sql/visitors.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Visitor/traversal interface and library functions. SQLAlchemy schema and express...
apache-2.0
nttks/edx-platform
lms/djangoapps/shoppingcart/admin.py
63
5399
"""Django admin interface for the shopping cart models. """ from ratelimitbackend import admin from shoppingcart.models import ( PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration, Invoice, CourseRegistrationCodeInvoiceItem, InvoiceTransaction ) class SoftDeleteCouponAdmin(admin.M...
agpl-3.0
diarized/rss2irc
grabber.py
1
2579
import sys import time import datetime import logging import storage import threading import ConfigParser import feedparser CONFIG_FILE='feeds.cfg' REFRESH_TIME = 300 if storage.DEBUG: loglevel = logging.DEBUG else: loglevel = logging.INFO logging.basicConfig( level=loglevel, format='[%(ascti...
gpl-3.0
hanlind/nova
nova/tests/unit/virt/xenapi/image/test_bittorrent.py
1
4967
# Copyright 2013 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 requ...
apache-2.0
benjamindeleener/odoo
addons/cron/__init__.py
2
1056
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 CodUP (<http://codup.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
gpl-3.0
sivaramakrishnansr/ryu
ryu/services/protocols/bgp/info_base/vpnv6.py
52
1827
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
memsql/memsql-mesos
memsql_framework/scheduler/scheduler.py
1
18004
import logging import os import socket from threading import Thread from memsql.common import database from memsql_framework import SCHEDULER_NAME from memsql_framework.data import const from memsql_framework.scheduler import utils from memsql_framework.util import api_client, web_helpers from mesos.interface import...
apache-2.0
kustodian/ansible
lib/ansible/modules/network/f5/bigip_snat_pool.py
21
15885
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pandas/core/frame.py
7
214523
""" DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to do with the labeling information """ from __future__ import...
gpl-3.0
sernst/cauldron
cauldron/test/support/functional.py
1
1689
import tempfile import pytest import cauldron from cauldron import cli from cauldron import environ from cauldron.cli import commander from cauldron.cli.commands import close class ProjectLifecycleTester: def __init__(self): self.results_directory = None self.temp_directories = dict() def ...
mit
mortada/tensorflow
tensorflow/tools/docs/doc_generator_visitor_test.py
118
4695
# 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
PixelStereo/viscam
src/properties.py
1
2806
#! /usr/bin/python # -*- coding: utf-8 -*- from pyviscam.constants import answers from PySide2.QtCore import Qt from PySide2.QtWidgets import QGroupBox, QCheckBox, QGridLayout, QComboBox, \ QSlider, QLabel, QPushButton class Properties_UI(QGroupBox): """ A QGroupbox widget wit...
lgpl-3.0
timlinux/stream_feature_extractor
custom_logging.py
2
7263
# coding=utf-8 """ Custom logging for Stream feature extractor. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later...
gpl-2.0
gnychis/grforwarder
gr-digital/python/qa_mpsk_receiver.py
17
3984
#!/usr/bin/env python # # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) ...
gpl-3.0
nilp0inter/data-is-fun
dataisfun/transform/translators.py
1
2054
#!/usr/bin/env python # # Copyright (C) 2011 Roberto A. Martinez Perez # # This file is part of data-is-fun. # # data-is-fun 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 t...
gpl-3.0
HopefulLlama/autocomplete-service
hello/autocomplete/suggester.py
1
1219
#!/usr/bin/python class Suggester: word_map = {} def __init__(self, file_path): self.word_map = {} with open(file_path, "r") as file: for word in file: word = word.strip() current_map = self.word_map for character in word: if character not in current_map.keys(): current_map[character] ...
gpl-3.0
jonathonwalz/ansible
lib/ansible/inventory/group.py
34
5375
# (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
Waifus4Lifu/waifu-bot
draw.py
1
10622
import io import math import random import requests import textwrap from functions import * from datetime import datetime from PIL import Image, ImageFont, ImageDraw, ImageSequence def shaky_text(text): frames = [] frame = Image.new('RGBA', (1, 1)) draw = ImageDraw.Draw(frame) font_path = os.path.join...
mit
collabo-br/django-soft-delete
softdelete/managers.py
2
1149
# -*- coding: utf-8 -*- # @Date : 2015-10-29 15:49:53 # @Author : Rafael Fernandes (basask@collabo.com.br) # @Link : http://www.collabo.com.br/ from __future__ import unicode_literals from django.db import models from django.db.models.query import QuerySet class SoftDeleteQueryMixin(object): def delete(s...
mit
lmarent/network_agents_ver2_python
agents/costfunctions/NaturalLogarithmCost.py
1
1813
# -*- coding: utf-8 -*- """ Created on Tue Jun 14 10:47:21 2016 Name: LinealCost Purpose: Implements a lineal function. @author: luis """ #----------------------------------------------------------------------- # Name: Beta Probability Distribution # Purpose: Implement beta probability #-------------------...
mit
jswoboda/RadarDataSim
Test/runtest.py
2
5431
#!/usr/bin/env python """ Created on Fri Apr 15 15:00:12 2016 This script will be used to see if any changes will prevent the simulator from running. @author: John Swoboda """ from SimISR import Path import scipy as sp from SimISR.utilFunctions import readconfigfile,makeconfigfile from SimISR.IonoContainer import IonoC...
mit
ddico/server-tools
module_prototyper/__openerp__.py
23
1719
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it a...
agpl-3.0
roatienza/Deep-Learning-Experiments
versions/2020/transformer/code/vit_pytorch.py
1
3667
import torch import torch.nn.functional as F from einops import rearrange from torch import nn class Residual(nn.Module): def __init__(self, fn): super().__init__() self.fn = fn def forward(self, x, **kwargs): return self.fn(x, **kwargs) + x class PreNorm(nn.Module): def __init__(s...
mit
sammyshj/gci
modules/test_utils/assert_equal.py
44
1800
def assert_same_type(expected, actual): assert isinstance(actual, type(expected)), "%s vs. %s" % (type(expected), type(actual)) def assert_equal_sequence(expected, actual): assert len(expected) == len(actual), "length should be %i, not %i:\n%s" % ( len(expected), len(actual), actual ) for i i...
mit
lmorchard/django
tests/check_framework/test_security.py
242
17428
from django.conf import settings from django.core.checks.security import base, csrf, sessions from django.test import SimpleTestCase from django.test.utils import override_settings class CheckSessionCookieSecureTest(SimpleTestCase): @property def func(self): from django.core.checks.security.sessions i...
bsd-3-clause
bryan-lunt/pdb_tools
pdb_bfactor.py
3
4313
#!/usr/bin/env python # Copyright 2007, Michael J. Harms # This program is distributed under General Public License v. 3. See the file # COPYING for a copy of the license. __description__ = \ """ pdb_bfactor.py: Alters the bfactor column of a pdb file. If a data file is supplied, it reads residue number/value pa...
gpl-3.0
YeelerG/scrapy
scrapy/spiders/__init__.py
134
3606
""" Base class for Scrapy spiders See documentation in docs/topics/spiders.rst """ import logging import warnings from scrapy import signals from scrapy.http import Request from scrapy.utils.trackref import object_ref from scrapy.utils.url import url_is_from_spider from scrapy.utils.deprecate import create_deprecated...
bsd-3-clause
manolama/dd-agent
tests/checks/mock/test_yarn.py
8
4434
# stdlib from urlparse import urljoin # 3rd party import mock import json from tests.checks.common import AgentCheckTest, Fixtures # IDs CLUSTER_NAME = 'SparkCluster' # Resource manager URI RM_ADDRESS = 'http://localhost:8088' # Service URLs YARN_CLUSTER_METRICS_URL = urljoin(RM_ADDRESS, '/ws/v1/cluster/metrics') ...
bsd-3-clause
blumak2000/blumak_kernel_s6_5.1.1_Lollipop
scripts/rt-tester/rt-tester.py
11005
5307
#!/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
kdeloach/raster-foundry
src/rf/apps/home/urls.py
1
1864
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.conf.urls import patterns, url, include from apps.home import views slug_regex = r'[-_\w]+' username_regex = r'[\w.@+-]+' user_patterns = [ url('^/imports.json$', v...
apache-2.0
UBERTC/GCC-UBER
contrib/update-copyright.py
15
27256
#!/usr/bin/python # # Copyright (C) 2013-2016 Free Software Foundation, Inc. # # This script 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, or (at your option) # any later version. # This s...
gpl-2.0
hyiltiz/youtube-dl
youtube_dl/extractor/pinkbike.py
136
3411
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, remove_end, remove_start, str_to_int, unified_strdate, ) class PinkbikeIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkb...
unlicense
gkoelln/youtube-dl
youtube_dl/extractor/telebruxelles.py
28
2949
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class TeleBruxellesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:telebruxelles|bx1)\.be/(?:[^/]+/)*(?P<id>[^/#?]+)' _TESTS = [{ 'url': 'http://bx1.be/news/que-risque-lauteur-dune-fausse-aler...
unlicense
DC07/android_kernel_lge_dory
scripts/rt-tester/rt-tester.py
11005
5307
#!/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
alazyer/oscar
frobshop/oscar/apps/dashboard/vouchers/views.py
2
7066
import datetime from django.contrib import messages from django.core.urlresolvers import reverse from oscar.core.loading import get_model from django.http import HttpResponseRedirect from django.utils.translation import ugettext_lazy as _ from django.views.generic import (ListView, FormView, DetailView, DeleteView) f...
gpl-2.0
cbmoore/statsmodels
statsmodels/graphics/tsaplots.py
16
10392
"""Correlation plot functions.""" import numpy as np from statsmodels.graphics import utils from statsmodels.tsa.stattools import acf, pacf def plot_acf(x, ax=None, lags=None, alpha=.05, use_vlines=True, unbiased=False, fft=False, **kwargs): """Plot the autocorrelation function Plots lags on th...
bsd-3-clause
linsalrob/EdwardsLab
matplotlib graphs/3d_scatter_plot.py
1
1295
""" Plot a 3D scatter plot """ import os import random import sys import matplotlib.lines import argparse import matplotlib.colors import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import pickle if __name__ == '__main__': parser = argparse.ArgumentParser(description="Plot a 3D scatter plot"...
mit
liupfskygre/qiime
qiime/denoise_wrapper.py
15
2153
#!/usr/bin/env python from __future__ import division """Functions supporting the QIIME denoiser""" __author__ = "Jens Reeder" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Jens Reeder", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Justin Kuczynski" __email__ ...
gpl-2.0
nirvam/hackerrank
ai/astar_search/pacman_dfs.py
1
1838
#!/usr/bin/python # Head ends here def mark(x, y, grid): grid[x] = grid[x][0:y] + 'E' + grid[x][y + 1:] return grid def get_adjacent(vertex_x, vertex_y, grid): vertexex = [] if vertex_x > 0 and grid[vertex_x - 1][vertex_y] in '-.': vertexex.append((vertex_x - 1, vertex_y)) if vertex_y > 0...
mit
crosswalk-project/blink-crosswalk
Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
26
7929
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
SatoshiNXSimudrone/sl4a-damon-clone
python/src/Lib/copy.py
62
10996
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/skimage/viewer/canvastools/recttool.py
43
8886
from matplotlib.widgets import RectangleSelector from ...viewer.canvastools.base import CanvasToolBase from ...viewer.canvastools.base import ToolHandles __all__ = ['RectangleTool'] class RectangleTool(CanvasToolBase, RectangleSelector): """Widget for selecting a rectangular region in a plot. After making ...
gpl-3.0
goodfeli/pylearn2
pylearn2/corruption.py
44
12818
""" Corruptor classes: classes that encapsulate the noise process for the DAE training criterion. """ # Third-party imports from __future__ import print_function import numpy import theano from theano import tensor T = tensor from pylearn2.utils.rng import make_np_rng # Shortcuts theano.config.warn.sum_div_dimshuffle...
bsd-3-clause
kjc88/sl4a
python/src/Lib/_abcoll.py
51
13625
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
apache-2.0
nccgroup/opinel
opinel/utils/console.py
3
8742
# -*- coding: utf-8 -*- import os import re import sys import traceback ######################################## # Globals ######################################## mfa_serial_format = r'^arn:aws:iam::\d+:mfa/[a-zA-Z0-9\+=,.@_-]+$' re_mfa_serial_format = re.compile(mfa_serial_format) ############################...
gpl-2.0
noam09/kodi
script.module.israeliveresolver/lib/livestreamer/stream/concurrent/futures/_compat.py
106
4976
from keyword import iskeyword as _iskeyword from operator import itemgetter as _itemgetter import sys as _sys def namedtuple(typename, field_names): """Returns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', 'x y') >>> Point.__doc__ # docstring for the new cla...
gpl-3.0
DaanHoogland/cloudstack
test/integration/plugins/solidfire/TestManagedClusteredFilesystems.py
3
15185
# 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
h2oai/h2o-2
py/testdir_single_jvm/test_speedrf_mnist.py
9
4173
import unittest import sys import time sys.path.extend(['.','..','../..','py']) import h2o import h2o_cmd import h2o_browse as h2b import h2o_import as h2i import h2o_glm import h2o_util import h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod ...
apache-2.0
pombreda/iris-panel
iris/core/migrations/0013_add_scm_update_and_scm_check_permission.py
7
14871
# -*- coding: utf-8 -*- # This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013-2015 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundat...
gpl-2.0
AnhellO/DAS_Sistemas
Ago-Dic-2020/rodriguez-martinez-jesus-angel/primer-parcial/ejercicio_1_test.py
1
5155
import unittest from ejercicio_1 import * class PistaTest(unittest.TestCase): def test_stars(self): anime_opening = Pista('Anime opening', True, 100,'2020-01-01') anime_opening.add_star() anime_opening.add_star() anime_opening.add_star() self.assertEqual("Stars: ★★★", anime_...
mit
ujjvala-addsol/addsol_hr
openerp/addons/l10n_be_invoice_bba/__init__.py
438
1101
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
catapult-project/catapult
third_party/google-endpoints/future/backports/html/parser.py
70
19771
"""A parser for HTML and XHTML. Backported for python-future from Python 3.3. """ # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity...
bsd-3-clause
Syrcon/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_endtoend.py
449
26811
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
strets123/django-tastypie
tastypie/migrations/0001_initial.py
32
1546
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import tastypie.utils.timezone class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operation...
bsd-3-clause
rdhyee/working-open-data-2014
notebooks/Day_05_A_Geographical_Hierarchies.py
3
11920
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> # our usual pylab import %pylab --no-import-all inline # <headingcell level=1> # Goal # <markdowncell> # For background, see [Mapping Census Data](http://www.udel.edu/johnmack/frec682/census/), including the # [scan of the 10-question form](http://w...
apache-2.0
GrognardsFromHell/TemplePlus
tpdatasrc/co8infra/scr/Spell107 - Desecrate.py
1
1256
from toee import * def OnBeginSpellCast( spell ): print "Desecrate OnBeginSpellCast" print "spell.target_list=", spell.target_list print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level game.particles( "sp-evocation-conjure", spell.caster ) def OnSpellEffect( spell ): print "Desecrate OnSpell...
mit