repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
rosudrag/eve-wspace | evewspace/Alerts/migrations/0001_initial.py | 20 | 7215 | # -*- 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 model 'SubscriptionGroup'
db.create_table('Alerts_subscriptiongroup', (
('id', self.gf(... | gpl-3.0 |
Blake-Latchford/Bugs2 | rules/hexgrid.py | 1 | 1215 | from rules.hexcell import HexCell
class HexGrid:
"""A grid of HexCells.
Registered cells are preserved. As this represents the entire infinite hex
plane, any cell can be gotten. However, only registered cells are guaranteed
to be identical on future calls.
"""
def __init__(self):
self... | gpl-3.0 |
Optimus-L90/caf-kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
hesseltuinhof/mxnet | example/ssd/tools/caffe_converter/convert_model.py | 16 | 5232 | from __future__ import print_function
import sys
import os.path as osp
sys.path.insert(0, osp.join(osp.dirname(__file__), '..'))
import find_mxnet
import mxnet as mx
import numpy as np
import argparse
import re
from convert_symbol import proto2symbol
caffe_flag = True
try:
import caffe
except ImportError:
impo... | apache-2.0 |
eclipse-ease-addons/engines | jython/org.jython/Lib/Queue.py | 188 | 8561 | """A multi-producer, multi-consumer queue."""
from time import time as _time
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
from collections import deque
import heapq
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
class Empty(Exception):
"... | epl-1.0 |
ollej/shoutbridge | src/bridges/XmppPyBridge.py | 1 | 7001 | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2010 Olle Johansson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | mit |
nlu90/heron | heron/tools/tracker/src/python/handlers/containerfilehandler.py | 5 | 6770 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
Diti24/python-ivi | ivi/agilent/agilent437B.py | 1 | 14103 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 Alex Forencich
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... | mit |
adnanh/zulip | api/integrations/svn/zulip_svn_config.py | 124 | 2363 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, Inc.
#
# 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
#... | apache-2.0 |
anilmuthineni/tensorflow | tensorflow/python/ops/gradients_impl.py | 3 | 35591 | # 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 |
kittolau/selepy | web_helper/name_generator/english_name_generator.py | 1 | 33021 | from web_helper.name_generator.abstract_name_generator import AbstractNameGenerator
from random import randint
class EnglishNameGenerator(AbstractNameGenerator):
#name pool from http://fantasynamegenerators.com/english_names.php
femaleFirstnames1 = ["Abbie","Abby","Abigail","Aimee","Alexandra","Alice","Alicia"... | mit |
Event38/MissionPlanner | Lib/site-packages/numpy/lib/utils.py | 54 | 36175 | import os
import sys
import types
import re
from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype
from numpy.core import product, ndarray, ufunc
__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype', 'issubdtype',
'deprecate', 'deprecate_with_doc', 'get_numarray_include',
'ge... | gpl-3.0 |
PLyczkowski/Sticky-Keymap | 2.74/python/lib/encodings/mac_roman.py | 272 | 13480 | """ Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... | gpl-2.0 |
LogicalDash/kivy | kivy/tests/test_uix_stacklayout.py | 55 | 4058 | '''
uix.stacklayout tests
=====================
'''
import unittest
from kivy.uix.stacklayout import StackLayout
from kivy.uix.widget import Widget
class UixStackLayoutTest(unittest.TestCase):
def test_stacklayout_no_children(self):
sl = StackLayout()
sl.do_layout()
def test_stacklayout_de... | mit |
CSysTeam/SecurityPackage | MainAlgorithms/Monoalphabetics/Monoalphabetic.py | 1 | 3288 |
class Monoalphabetic:
""" Frequency Information:
E 12.51%
T 9.25
A 8.04
O 7.60
I 7.26
N 7.09
S 6.54
R 6.12
H 5.49
L 4.14
D 3.99
C 3.06
U 2.71
M 2.53
F 2.30
P 2.00
... | gpl-3.0 |
samnazarko/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.networking/resources/lib/CompLogger.py | 51 | 2076 | import time
from functools import wraps
TEST_LOG_BOOL = True
def test_logger(msg):
print 'test-' + msg
def comprehensive_logger(logger=None, logging=True, maxlength=25, nowait=False):
'''
Decorator to log the inputs and outputs of functions, as well as the time taken
to run the function.
Requires: time, fun... | gpl-2.0 |
crazcalm/Py3.4_exploration | DataStructures/Trees/PriorityQueue.py | 1 | 8766 | """
Priority Queue with Binary Heaps:
---------------------------------
Introduction:
------------
A priority queue acts like a queue in that you can dequeue and item by
removing it from the front. However, in a priority queue the logical order
of items inside the queu... | mit |
xen0l/ansible | lib/ansible/modules/packaging/os/swupd.py | 37 | 8830 | #!/usr/bin/python
# (c) 2017, Alberto Murillo <alberto.murillo.silva@intel.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.2/django/contrib/auth/__init__.py | 44 | 3953 | import datetime
from warnings import warn
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
SESSION_KEY = '_auth_user_id'
BACKEND_SESSION_KEY = '_auth_user_backend'
REDIRECT_FIELD_NAME = 'next'
def load_backend(path):
i = path.rfind('.')
module, attr = pa... | mit |
ifduyue/sentry | src/sentry/tsdb/dummy.py | 2 | 5101 | """
sentry.tsdb.dummy
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
""... | bsd-3-clause |
Paul-Ezell/cinder-1 | cinder/image/cache.py | 7 | 9215 | # Copyright (C) 2015 Pure Storage, 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 la... | apache-2.0 |
muro/Cinnamon | files/usr/lib/cinnamon-desktop-editor/cinnamon-desktop-editor.py | 12 | 20676 | #!/usr/bin/env python2
import sys
import os
import gettext
import glob
from gi.repository import GLib, Gtk, Gio, CMenu, GdkPixbuf
from optparse import OptionParser
import shutil
sys.path.insert(0,'/usr/lib/cinnamon-menu-editor')
from cme import util
sys.path.insert(0,'/usr/lib/cinnamon-settings')
from bin import Xle... | gpl-2.0 |
averainy/averainy | python/wechat_test.py | 1 | 7797 | #!/usr/bin/python
#coding=utf-8
import xml.dom.minidom
def get_tagname():
doc = xml.dom.minidom.parseString(input_xml_string)
class msg_parse:
def __init__(self,msg):
self.doc = xml.dom.minidom.parseString(msg)
def _getData(self,tagName):
nodes=self.doc.getElementsByTagName(tagName)
... | gpl-2.0 |
arifsetiawan/edx-platform | common/lib/xmodule/xmodule/modulestore/draft_and_published.py | 116 | 4797 | """
This module provides an abstraction for Module Stores that support Draft and Published branches.
"""
import threading
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from . import ModuleStoreEnum
# Things w/ these categories should never be marked as version=DRAFT
DIRECT_ONLY_CATEGOR... | agpl-3.0 |
xfguo/pysnmp | pysnmp/entity/rfc3413/mibvar.py | 7 | 2726 | #
# THESE FUNCTIONS ARE OBSOLETE AND MUST NOT BE USED!
# USE pysnmp.entity.rfc3413.oneliner.mibvar INSTEAD
#
# MIB variable pretty printers/parsers
from pyasn1.type import univ
from pysnmp.smi.error import NoSuchObjectError
# Name
def mibNameToOid(mibView, name):
if isinstance(name[0], tuple):
f = lambda ... | bsd-3-clause |
nelmiux/CarnotKE | jyhton/Lib/test/test_dict.py | 10 | 22663 | import unittest
from test import test_support
from java.util import Map
from java.util.concurrent import ConcurrentMap
import UserDict, random, string
import gc, weakref
class DictTest(unittest.TestCase):
_class = None
def _make_dict(self, pydict):
return pydict if not self._class else self._class(... | apache-2.0 |
russell/fairy-slipper | config.py | 2 | 2149 | # Copyright (c) 2015 Russell Sim <russell.sim@gmail.com>
#
# 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 |
slevenhagen/odoo | addons/l10n_si/account_wizard.py | 255 | 1120 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
rduivenvoorde/QGIS | python/plugins/processing/gui/MultipleFileInputDialog.py | 45 | 4865 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MultipleExternalInputDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
(C) 2013 by CS Systemes d'informatio... | gpl-2.0 |
Athrun29/horizon | openstack_dashboard/test/test_data/trove_data.py | 6 | 9541 | # Copyright 2013 Rackspace Hosting.
# Copyright 2015 HP Software, 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
#
# Un... | apache-2.0 |
ttanner/kryptomime | docs/conf.py | 1 | 8229 | # -*- coding: utf-8 -*-
#
# kryptomime documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 20 12:30:16 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.
#
# ... | lgpl-3.0 |
hamiltont/CouchPotatoServer | libs/git/exceptions.py | 122 | 2527 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
p4datasystems/CarnotKEdist | dist/Lib/test/test_mhlib.py | 11 | 11192 | """
Tests for the mhlib module
Nick Mathewson
"""
### BUG: This suite doesn't currently test the mime functionality of
### mhlib. It should.
import unittest
from test.test_support import is_jython, run_unittest, TESTFN, import_module
import os, StringIO
import sys
mhlib = import_module('mhlib', deprecated... | apache-2.0 |
XiliangSong/freebase-python | freebase/fcl/fbutil.py | 5 | 3619 | # ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, 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:
# * Redistribut... | bsd-2-clause |
churchlab/vdj | bin/explode_imgt.py | 2 | 1040 | #! /usr/bin/env python
# Copyright 2014 Uri Laserson
#
# 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 o... | apache-2.0 |
h2oai/h2o-2 | py/testdir_single_jvm/test_big_sum_fail.py | 8 | 1981 | import unittest, random, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_util, h2o_import as h2i
import h2o_exec as h2e
UNNECESSARY = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global SEED... | apache-2.0 |
gstoner/gpudb | SQL2XML/antlr3/dfa.py | 117 | 7631 | """ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# 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 ... | apache-2.0 |
saurvs/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 136 | 16506 | import base64
import cgi
import Cookie
import os
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about... | mpl-2.0 |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/models.py | 109 | 1890 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
from django.utils.encoding import python_2_unicode_compatible
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
@python_2_unicode_compatible
class Country(models.Model):
name = models.Ch... | apache-2.0 |
shakamunyi/nova | nova/api/openstack/compute/plugins/v3/migrations.py | 10 | 2207 | # 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
# d... | apache-2.0 |
IvanGavran/scrapy | tests/test_dupefilters.py | 15 | 1661 | import hashlib
import unittest
from scrapy.dupefilters import RFPDupeFilter
from scrapy.http import Request
from scrapy.utils.python import to_bytes
class RFPDupeFilterTest(unittest.TestCase):
def test_filter(self):
dupefilter = RFPDupeFilter()
dupefilter.open()
r1 = Request('http://scr... | bsd-3-clause |
amenonsen/ansible | test/units/modules/network/fortios/test_fortios_vpn_ssl_web_host_check_software.py | 21 | 9924 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
merwok-forks/facepy | docs/source/conf.py | 6 | 7058 | # -*- coding: utf-8 -*-
#
# Facepy documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 27 20:26:42 2011.
#
# 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 |
mjordan/pkppln | server.py | 1 | 1777 | #!/usr/bin/env python
import sys
import bottle
from bottle import Bottle, request, error, response, Response
from os.path import abspath, dirname
import logging
sys.path.append(dirname(abspath(__file__)))
import pkppln
from webapp.admin.terms_server import TermsApp
from webapp.sword.sword_server import SwordServer
fr... | gpl-3.0 |
2uller/LotF | App/Lib/site-packages/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-2.0 |
nzjrs/conduit | conduit/Module.py | 2 | 12388 | """
Classes associated with dynamic module loading
Copyright: John Stowers, 2006
License: GPLv2
"""
import gobject
import os, os.path
import traceback
import pydoc
import logging
log = logging.getLogger("Module")
import conduit.dataproviders
import conduit.ModuleWrapper as ModuleWrapper
import conduit.Knowledge as K... | gpl-2.0 |
switchboardOp/ansible | lib/ansible/modules/cloud/azure/azure.py | 8 | 24636 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
egoid/baytree | lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py | 508 | 2309 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import base
from ..constants import voidElements, namespaces
class T... | mit |
marshallmcdonnell/interactive_plotting | matplotlib/draggable_legend_code.py | 1 | 3140 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as _plt
class DraggableLegend:
def __init__(self, legend):
self.legend = legend
self.gotLegend = False
legend.figure.canvas.mpl_connect('motion_notify_event', self.on_motion)
legend.figure.canvas.mpl_connect('pick_ev... | mit |
gromitsun/sim-xrf | python/snr/pysnip.py | 1 | 2468 | import numpy as np
from scipy.optimize import curve_fit
def FWHM(x, noise=100, fano=0.114):
sigma = np.sqrt((noise / 2.3548) ** 2 + 3.58 * fano * x)
return 2.3548 * sigma
def fit_FWHM(x, F):
def _FWHM(x, noise, fano):
return (noise / 2.3548) ** 2 + 3.58 * fano * x
popt, pcov = curve_fit(_FW... | mit |
lz1988/company-site | django/db/models/sql/aggregates.py | 195 | 3977 | """
Classes to represent the default SQL aggregate functions
"""
from django.db.models.fields import IntegerField, FloatField
# Fake fields used to identify aggregate types in data-conversion operations.
ordinal_aggregate_field = IntegerField()
computed_aggregate_field = FloatField()
class Aggregate(object):
"""... | bsd-3-clause |
dhanunjaya/neutron | neutron/db/migration/alembic_migrations/versions/4119216b7365_add_tenant_id_idx.py | 47 | 1466 | # Copyright 2015 OpenStack Foundation
#
# 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 |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/tests/modeltests/model_forms/tests.py | 7 | 9017 | import datetime
from django.test import TestCase
from django import forms
from models import Category, Writer, Book, DerivedBook, Post
from mforms import (ProductForm, PriceForm, BookForm, DerivedBookForm,
ExplicitPKForm, PostForm, DerivedPostForm, CustomWriterForm)
class IncompleteCategoryFormWit... | apache-2.0 |
dmsurti/mayavi | mayavi/sources/metadata.py | 5 | 10449 | """
Metadata for all sources.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2008, Prabhu Ramachandran Enthought, Inc.
# License: BSD Style.
# Local imports.
from mayavi.core.metadata import SourceMetadata
from mayavi.core.pipeline_info import PipelineInfo
BASE = 'mayavi.sources'
open_3ds... | bsd-3-clause |
le9i0nx/ansible | lib/ansible/plugins/action/ios_config.py | 13 | 4169 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
mrquim/mrquimrepo | script.module.nanscrapers/lib/nanscrapers/scraperplugins/flenix.py | 6 | 1943 | import re
import requests
import xbmc
import urllib
from ..scraper import Scraper
from ..common import clean_title, random_agent, clean_search
requests.packages.urllib3.disable_warnings()
session = requests.Session()
User_Agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2... | gpl-2.0 |
philanthropy-u/edx-platform | common/lib/xmodule/xmodule/studio_editable.py | 17 | 2291 | """
Mixin to support editing in Studio.
"""
from xmodule.x_module import AUTHOR_VIEW, STUDENT_VIEW, module_attr
class StudioEditableBlock(object):
"""
Helper methods for supporting Studio editing of XBlocks.
This class is only intended to be used with an XBlock!
"""
has_author_view = True
de... | agpl-3.0 |
funson/rt-xen | tools/python/xen/xend/XendDmesg.py | 49 | 1379 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
Xeralux/tensorflow | tensorflow/python/keras/activations/__init__.py | 74 | 1856 | # 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 |
tjwei/jedi | jedi/evaluate/analysis.py | 33 | 10812 | """
Module for statical analysis.
"""
from jedi import debug
from jedi.parser import tree
from jedi.evaluate.compiled import CompiledObject
CODES = {
'attribute-error': (1, AttributeError, 'Potential AttributeError.'),
'name-error': (2, NameError, 'Potential NameError.'),
'import-error': (3, ImportError, ... | mit |
TeachAtTUM/edx-platform | lms/djangoapps/course_goals/models.py | 3 | 2051 | """
Course Goals Models
"""
from django.contrib.auth.models import User
from django.db import models
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from opaque_keys.edx.django.models import CourseKeyField
from model_utils import Choices
from .api import add_course_goal, re... | agpl-3.0 |
promptworks/horizon | openstack_dashboard/test/integration_tests/tests/test_user_settings.py | 37 | 2540 | # 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
# d... | apache-2.0 |
wesm/statsmodels | scikits/statsmodels/sandbox/tsa/examples/ex_mle_garch.py | 1 | 10649 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 01:01:50 2010
Author: josef-pktd
latest result
-------------
all are very close
garch0 has different parameterization of constant
ordering of parameters is different
seed 2780185
h.shape (2000,)
Optimization terminated successfully.
Current function value: ... | bsd-3-clause |
JCardenasRdz/Machine-Learning-4-MRI | Infection_vs_Inflammation/Code/Process_Data.py | 1 | 2713 | # Import Modules as needed
import numpy as np
#import seaborn as sn
import pandas as pd
from pylab import *
from mylocal_functions import *
# ======== T2 MSME============= #
# Make list of all T2.txt files
T2_list = get_ipython().getoutput('ls ../Study_03_CBA/*T2.txt')
# Allocate variables needed for analysis
T2DF=pd... | mit |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | apache-2.0 |
areski/django | docs/_ext/djangodocs.py | 17 | 11772 | """
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util.console import bold
from s... | bsd-3-clause |
laborautonomo/poedit | deps/boost/tools/build/v2/test/source_locations.py | 51 | 1125 | #!/usr/bin/python
# Copyright (C) Craig Rodrigues 2005.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test that projects with multiple source-location directories are handled OK.
import BoostBuild
t = Bo... | mit |
coolbombom/CouchPotatoServer | couchpotato/core/providers/torrent/torrentday/main.py | 9 | 2189 | from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class TorrentDay(TorrentProvider):
urls = {
'test': 'http://... | gpl-3.0 |
s-tar/just-a-chat | modules/chat/chat.py | 1 | 5141 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'mr.S'
from kernel.module import Module
from kernel.server import app
from bottle import jinja2_template as template, request
from entities.s_chat import Chat
from entities.s_message import Message
from kernel.validator import Validator
from kernel.socket impor... | mit |
BeataBak/project-euler-problems | 008.py | 1 | 3404 | """
Project Euler Problem 8
=======================
Find the greatest product of thirteen consecutive digits in the 1000-digit
number.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
858615607891129494954595017379583319528532088... | mit |
CMUSV-VisTrails/WorkflowRecommendation | vistrails/db/versions/v1_0_0/domain/log.py | 1 | 3092 | ###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | bsd-3-clause |
hemikak/andes | modules/andes-core/tools/bin/testkit.py | 25 | 10380 | #!/usr/bin/env python
#
# 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
# ... | apache-2.0 |
kcpawan/django | django/contrib/sites/migrations/0001_initial.py | 276 | 1096 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | bsd-3-clause |
Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_mouse_action.py | 1 | 4981 | # 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 marionette_driver.by import By
from marionette_driver.keys import Keys
from marionette_driver.marionette import Act... | mpl-2.0 |
alikins/ansible | lib/ansible/modules/cloud/profitbricks/profitbricks_datacenter.py | 27 | 7537 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
sanketloke/scikit-learn | sklearn/gaussian_process/gpr.py | 43 | 18642 | """Gaussian processes regression. """
# Authors: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
from operator import itemgetter
import numpy as np
from scipy.linalg import cholesky, cho_solve, solve_triangular
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base im... | bsd-3-clause |
tmenjo/cinder-2015.1.0 | cinder/tests/test_backup.py | 3 | 33268 | # Copyright (C) 2012 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 |
pforai/easybuild-framework | easybuild/toolchains/cgmpolf.py | 4 | 1769 | ##
# Copyright 2013-2015 Ghent University
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the... | gpl-2.0 |
abadger/ansible-modules-core | network/nxos/nxos_snmp_location.py | 5 | 12483 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
domenicosolazzo/practice-django | venv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py | 279 | 3541 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import os
import collections
from itertools import islice
class IteratorProxy(object):
"""docstring for IteratorProxy"""
def __init__(self, i):
self.i = i
# self.i = chain.from_iter... | mit |
jollyroger/debian-buildbot | buildbot/test/unit/test_db_users.py | 2 | 18708 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
pypa/warehouse | warehouse/utils/db/windowed_query.py | 1 | 2050 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 |
52ai/django-ccsds | tests/reserved_names/tests.py | 405 | 1686 | from __future__ import unicode_literals
import datetime
from django.test import TestCase
from .models import Thing
class ReservedNameTests(TestCase):
def generate(self):
day1 = datetime.date(2005, 1, 1)
Thing.objects.create(when='a', join='b', like='c', drop='d',
alter='e', having='... | bsd-3-clause |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/boto/iam/summarymap.py | 151 | 1660 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# withou... | bsd-3-clause |
UfSoft/ISPManCCP | extra-packages/pyperl-1.0.1d/t/apply.py | 1 | 2941 | import perl
#if (perl.MULTI_PERL):
# print "1..0"
# raise SystemExit
print "1..14"
def ok(a, b=None):
return "a=" + str(a) + ", b=" + str(b)
perl.eval("""
use Python qw(apply);
$| = 1;
sub {
my $f = shift;
# First some tests that are expected to blow up
eval {
apply($f);
};
#... | bsd-3-clause |
2014c2g14/w17test2 | static/Brython3.1.1-20150328-091302/Lib/locale.py | 624 | 1918 | def getdefaultlocale():
return __BRYTHON__.language,None
def localeconv():
""" localeconv() -> dict.
Returns numeric and monetary locale-specific parameters.
"""
# 'C' locale default values
return {'grouping': [127],
'currency_symbol': '',
... | agpl-3.0 |
andim27/magiccamp | django/contrib/gis/gdal/libgdal.py | 147 | 3378 | import os, re, sys
from ctypes import c_char_p, CDLL
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
# Custom library path set?
try:
from django.conf import settings
lib_path = settings.GDAL_LIBRARY_PATH
except (AttributeError, EnvironmentError, ImportError):
lib... | bsd-3-clause |
zhenzhai/edx-platform | cms/djangoapps/contentstore/views/error.py | 25 | 1641 | # pylint: disable=missing-docstring,unused-argument
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound)
from edxmako.shortcuts import render_to_string, render_to_response
import functools
from openedx.core.djangolib.js_utils import dump_js_escaped_json
__all_... | agpl-3.0 |
yangbh/dpkt | dpkt/netflow.py | 6 | 14791 | # $Id: netflow.py 23 2006-11-08 15:45:33Z dugsong $
# -*- coding: utf-8 -*-
"""Cisco Netflow."""
import itertools
import struct
import dpkt
class NetflowBase(dpkt.Packet):
"""Base class for Cisco Netflow packets."""
__hdr__ = (
('version', 'H', 1),
('count', 'H', 0),
('sys_uptime', '... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/tests/messages_tests/test_fallback.py | 7 | 6524 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_messages_count
from .test_session import set_session_data... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/323_test_datetime.py | 122 | 1854 | import unittest
import sys
from test.support import import_fresh_module, run_unittest
TESTS = 'test.datetimetester'
# XXX: import_fresh_module() is supposed to leave sys.module cache untouched,
# XXX: but it does not, so we have to save and restore it ourselves.
save_sys_modules = sys.modules.copy()
try:
pure_tes... | gpl-3.0 |
FHannes/intellij-community | python/testData/inspections/PyNumpyType/ReturnOptional.py | 79 | 1681 | def unique(ar, return_index=False, return_inverse=False, return_counts=False):
"""
Find the unique elements of an array.
Returns the sorted unique elements of an array. There are two optional
outputs in addition to the unique elements: the indices of the input array
that give the unique values, and... | apache-2.0 |
snasoft/QtCreatorPluginsPack | Bin/3rdParty/vera/bin/lib/test/test_codecencodings_iso2022.py | 71 | 1464 | #!/usr/bin/env python
#
# Codec encoding tests for ISO 2022 encodings.
from test import test_support
from test import test_multibytecodec_support
import unittest
COMMON_CODEC_TESTS = (
# invalid bytes
(b'ab\xFFcd', 'replace', u'ab\uFFFDcd'),
(b'ab\x1Bdef', 'replace', u'ab\x1Bdef'),
(b'... | lgpl-3.0 |
qgis/QGIS | python/plugins/processing/algs/qgis/EliminateSelection.py | 25 | 9096 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EliminateSelection.py
---------------------
Date : January 2017
Copyright : (C) 2017 by Bernhard Ströbl
Email : bernhard.stroebl@jena.de
*******************... | gpl-2.0 |
soumith/fbthrift | thrift/test/py/TValidatorTest.py | 14 | 6097 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
openlmi/openlmi-scripts | commands/storage/lmi/scripts/storage/cmd/thinlv.py | 2 | 4741 | # coding=utf-8
# Storage Management Providers
#
# Copyright (C) 2014 Red Hat, 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:
#
# 1. Redistributions of source code must retain the above copyrig... | bsd-2-clause |
jdgillespie91/trackerSpend | data/expenditure/submit_automated_expenditure.py | 1 | 8161 | # This script adds any spend that occurs regularly on a monthly basis.
import datetime
import gspread
import json
import logging
import os
import requests
import smtplib
import sys
from configs import config
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from oauth2client.client im... | mit |
christianeisendle/linux | scripts/analyze_suspend.py | 1537 | 120394 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | gpl-2.0 |
retomerz/intellij-community | python/lib/Lib/UserDict.py | 117 | 5729 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... | apache-2.0 |
fhaoquan/kbengine | kbe/src/lib/python/Lib/test/test_collections.py | 60 | 63093 | """Unit tests for collections.py."""
import unittest, doctest, operator
from test.support import TESTFN, forget, unlink
import inspect
from test import support
from collections import namedtuple, Counter, OrderedDict, _count_elements
from test import mapping_tests
import pickle, copy
from random import randrange, shuf... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.