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 |
|---|---|---|---|---|---|
uclouvain/osis | learning_unit/tests/calendar/test_learning_unit_enrollment_calendar.py | 1 | 3166 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
mcrowson/django | tests/proxy_models/tests.py | 260 | 16941 | from __future__ import unicode_literals
import datetime
from django.apps import apps
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, exceptions, management
from django.core.urlresolvers ... | bsd-3-clause |
kitsunde/ansible | lib/ansible/plugins/action/include_vars.py | 13 | 1881 | # (c) 2013-2014, Benno Joy <benno@ansible.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 later vers... | gpl-3.0 |
absoludity/servo | tests/wpt/update/fetchlogs.py | 222 | 3183 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import cStringIO
import gzip
import json
import os
import requests
import urlparse
treeherder_base = "h... | mpl-2.0 |
marctc/django | tests/admin_filters/models.py | 108 | 2105 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compa... | bsd-3-clause |
cluo512/storm | storm-multilang/python/src/main/resources/resources/storm.py | 10 | 6826 | # -*- coding: 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 License, Version 2.0 (the
# ... | apache-2.0 |
duhzecca/cinder | cinder/tests/unit/test_netapp.py | 9 | 58929 | # Copyright (c) 2012 NetApp, 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 |
cuemacro/findatapy | findatapy_examples/equitiesdata_example.py | 1 | 2756 | __author__ = 'saeedamen' # Saeed Amen
#
# Copyright 2016-2020 Cuemacro
#
# 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 |
Yawning/obfsproxy-wfpadtools | obfsproxy/managed/server.py | 3 | 5001 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from twisted.internet import reactor, error
from pyptlib.server import ServerTransportPlugin
from pyptlib.config import EnvError
import obfsproxy.transports.transports as transports
import obfsproxy.network.launch_transport as launch_transport
import obfsproxy.common.log as ... | bsd-3-clause |
angelapper/edx-platform | lms/djangoapps/notes/models.py | 6 | 3226 | import json
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.html import strip_tags
from openedx.core.djangoapps.xmodule_django.models import CourseKeyField
class Note(models.Mod... | agpl-3.0 |
hammerlab/varlens | varlens/util.py | 2 | 2981 | # Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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 |
EricSchles/regulations-parser | tests/history_delays_tests.py | 4 | 3576 | from unittest import TestCase
from regparser.history.delays import *
class HistoryDelaysTests(TestCase):
def test_modify_effective_dates(self):
outdated = {'document_number': 'outdated',
'effective_on': '2001-01-01',
'publication_date': '2000-12-12',
... | cc0-1.0 |
LIMXTEC/BitSend | contrib/linearize/linearize.py | 3 | 3351 | #!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The Bitsend developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impo... | mit |
JayVora-SerpentCS/sale-reporting | __unported__/sale_note_flow/sale.py | 5 | 1868 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com)
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
sbalde/edx-platform | lms/djangoapps/branding/models.py | 84 | 1551 | """
Model used by Video module for Branding configuration.
Includes:
BrandingInfoConfig: A ConfigurationModel for managing how Video Module will
use Branding.
"""
import json
from django.db.models import TextField
from django.core.exceptions import ValidationError
from config_models.models import Configura... | agpl-3.0 |
noroutine/ansible | lib/ansible/modules/packaging/language/composer.py | 7 | 8773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.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_versi... | gpl-3.0 |
brion/ffmpeg2theora | frontend/theoraenc/addVideoDialog.py | 3 | 15190 | # -*- coding: utf-8 -*-
# vi:si:et:sw=2:sts=2:ts=2
import os
from os.path import basename
import time
from addSubtitlesDialog import addSubtitlesPropertiesDialog, SubtitlesList
import wx
import theoraenc
class AddVideoDialog(wx.Dialog):
def __init__(
self, parent, ID, title, hasKate, hasIconv,
... | gpl-2.0 |
vpalex999/python_training | model/address.py | 1 | 3895 | # -*- coding: utf-8 -*-
import re
from sys import maxsize
class Address:
def __init__(self, name=None, mname=None, lname=None, nickname=None,\
title=None, company=None, address=None, phone=None, mobile=None, workphone=None,\
fax=None, email=None, email2=None, email3=None, homep... | apache-2.0 |
b3c/VTK-5.8 | Common/Testing/Python/TestSubClass.py | 18 | 3350 | """Test subclassing support in VTK-Python
VTK classes can be subclassed in Python. There are
some caveats, such as:
- protected items are inaccessible to the python class
- virtual method calls from C++ are not propagated to python
To be tested:
- make sure that subclassing works
- make sure that unbound supercl... | bsd-3-clause |
henriquebastos/django-decouple | decouple.py | 1 | 4877 | # coding: utf-8
import os
import sys
# Useful for very coarse version differentiation.
PY3 = sys.version_info[0] == 3
if PY3:
from configparser import ConfigParser
else:
from ConfigParser import SafeConfigParser as ConfigParser
class UndefinedValueError(Exception):
pass
class Undefined(object):
"... | mit |
hyperNURb/ggrc-core | src/ggrc_workflows/migrations/versions/20150403101250_4f9f00e4faca_fill_object_types_table_with_workflow_.py | 4 | 1454 | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
"""fill object types table with workflow models
Revision ID: 4f9f00e4faca
Revis... | apache-2.0 |
mitchcapper/mythbox | resources/lib/twisted/twisted/persisted/crefutil.py | 61 | 4644 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility classes for dealing with circular references.
"""
from twisted.python import log, reflect
try:
from new import instancemethod
except:
from org.python.core impo... | gpl-2.0 |
ApuliaSoftware/odoo | addons/crm_claim/report/crm_claim_report.py | 180 | 4664 | # -*- 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 |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/dask/array/rechunk.py | 2 | 21831 | """
The rechunk module defines:
intersect_chunks: a function for
converting chunks to new dimensions
rechunk: a function to convert the blocks
of an existing dask array to new chunks or blockshape
"""
from __future__ import absolute_import, division, print_function
import math
import heapq
fro... | gpl-3.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/errors/types/third_party_app_analytics_link_error.py | 1 | 1401 | # -*- coding: utf-8 -*-
# Copyright 2020 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 |
ocefpaf/seapy | docs/conf.py | 1 | 10409 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SeaPY documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 6 11:03:18 2015.
#
# 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
# auto... | mit |
aykol/pymatgen | pymatgen/io/abinit/qjobs.py | 10 | 17260 | # coding: utf-8
"""
Objects and methods to contact the resource manager to get info on the status of the job and useful statistics.
Note that this is not a wrapper for the C API but a collection of simple wrappers around the shell commands
provided by the resource manager (qsub, qdel and qstat for PBS, sinfo, squeue..... | mit |
TanUkkii007/openjtalk-test | gtest-1.7.0/test/gtest_xml_test_utils.py | 1815 | 8876 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
django-nonrel/django | tests/null_fk_ordering/tests.py | 150 | 2069 | from __future__ import absolute_import
from django.test import TestCase
from .models import Author, Article, SystemInfo, Forum, Post, Comment
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys... | bsd-3-clause |
kakunbsc/enigma2.2 | lib/python/Components/Converter/ConfigEntryTest.py | 27 | 1565 | from Converter import Converter
from Components.Element import cached
from Components.config import configfile
class ConfigEntryTest(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
args = argstr.split(',')
self.argerror = False
self.checkSourceBoolean = False
self.invert = ... | gpl-2.0 |
petebachant/scipy | scipy/stats/mstats.py | 37 | 1508 | """
===================================================================
Statistical functions for masked arrays (:mod:`scipy.stats.mstats`)
===================================================================
.. currentmodule:: scipy.stats.mstats
This module contains a large number of statistical functions that can
be... | bsd-3-clause |
69495/Zooarchaeologist | mstdn/mining.py | 1 | 1205 | from mastodon import Mastodon
import json
from login import login
from out_json import jsoner
'''
return_typeはjson or list
defaultはlistで返す
'''
def mining(id, return_type="list", switch=None):
print(return_type + " is selected!")
Mastodon = login(switch)
#timelineからlastestなmax_idを取得
tl = Mastodon.tim... | mit |
dragosbdi/bicreditsnew | qa/rpc-tests/listtransactions.py | 4 | 4726 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcredit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework import BitcreditTestFramework
from bitcreditrpc.aut... | mit |
agileblaze/OpenStackTwoFactorAuthentication | openstack_dashboard/dashboards/project/databases/tabs.py | 50 | 4310 | # Copyright 2013 Rackspace Hosting
#
# 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 |
GarySparrow/mFlaskWeb | venv/Lib/site-packages/sqlalchemy/orm/relationships.py | 21 | 111121 | # orm/relationships.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
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Pro... | mit |
dyn888/youtube-dl | youtube_dl/extractor/naver.py | 22 | 3756 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
ExtractorError,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)'... | unlicense |
SlimRoms/kernel_sony_msm8x60 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
goliveirab/odoo | addons/l10n_ca/__init__.py | 438 | 1056 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
solashirai/edx-platform | cms/djangoapps/contentstore/features/courses.py | 171 | 2135 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from common import *
############### ACTIONS ####################
@step('There are no courses$')
def no_courses(step):
world.clear_courses()
create_studio_user()
@st... | agpl-3.0 |
mathn/jubatus | client_test/test_gtest.py | 3 | 3474 | # -*- coding: utf-8 -*-
import os
import re
from cStringIO import StringIO
import time
from jubatest import *
from jubatest.unit import JubaSkipTest
from jubatest.remote import SyncRemoteProcess
from jubatest.process import LocalSubprocess
from jubatest.logger import log
class ClientGoogleTestBase():
@classmetho... | lgpl-2.1 |
ruslanloman/nova | nova/tests/unit/virt/libvirt/test_blockinfo.py | 7 | 46217 | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | apache-2.0 |
a-doumoulakis/tensorflow | tensorflow/contrib/saved_model/python/saved_model/utils_test.py | 29 | 4516 | # 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 |
imply/chuu | native_client_sdk/src/tools/tests/create_nmf_test.py | 53 | 7804 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(_... | bsd-3-clause |
Hani-K/H-Vitamin_trlte | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
rishibarve/incubator-airflow | airflow/contrib/hooks/databricks_hook.py | 22 | 7622 | # -*- 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 |
j-carpentier/nova | nova/db/sqlalchemy/api_models.py | 43 | 2611 | # 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 |
garvitr/sympy | sympy/printing/dot.py | 103 | 6644 | from __future__ import print_function, division
from sympy import (Basic, Expr, Symbol, Integer, Rational, Float,
default_sort_key, Add, Mul)
__all__ = ['dotprint']
default_styles = [(Basic, {'color': 'blue', 'shape': 'ellipse'}),
(Expr, {'color': 'black'})]
sort_classes = (Add, Mul)
slotClasses = (... | bsd-3-clause |
phev8/dataset_tools | experiment_handler/check_signal_availabilities.py | 1 | 1790 | from experiment_handler.imu_data_reader import get_imu_data
from experiment_handler.finder import find_all_imu_files
import os
import matplotlib.pyplot as plt
def plot_imu_signals_for_experiment(exp_root, figsize=(10, 10), reference_time="video"):
imu_files = find_all_imu_files(exp_root)
for imu_file_path in... | mit |
praekelt/sideloader2 | sideloader.build/sideloader/build/sideloader.py | 2 | 19837 | import os
import shutil
import yaml
from collections import namedtuple
from urlparse import urlparse
import deploy_types
from config_files import ConfigFiles
from utils import cmd, create_venv_paths, listdir_abs, log, rmtree_if_exists
class Workspace(object):
"""
Keeps track of the various file paths in th... | mit |
Geode/geonode | geonode/layers/populate_layers_data.py | 18 | 6643 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
minepy/mictools | mictools/utils.py | 1 | 3005 | ## Copyright 2017 MICtools Developers <davide.albanese@gmail.com>
## This file is part of MICtools.
##
## MICtools 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 |
anntzer/scipy | scipy/optimize/_shgo_lib/triangulation.py | 11 | 21463 | import numpy as np
import copy
class Complex:
def __init__(self, dim, func, func_args=(), symmetry=False, bounds=None,
g_cons=None, g_args=()):
self.dim = dim
self.bounds = bounds
self.symmetry = symmetry # TODO: Define the functions to be used
# here in init... | bsd-3-clause |
acsone/server-tools | users_ldap_push/models/res_partner.py | 16 | 1251 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
socialplanning/opencore | opencore/browser/topnav/topnav.py | 1 | 3065 | """
TopNav view classes.
"""
from Acquisition import aq_inner
from Products.CMFCore.utils import getToolByName
from Products.TeamSpace.permissions import ManageTeamMembership
from opencore.browser.base import BaseView
from opencore.browser.topnav.interfaces import ITopnavMenuItems
from opencore.i18n import _
from openc... | gpl-3.0 |
ActiveState/code | recipes/Python/577217_Routines_programmatically_authenticating_Google_/recipe-577217.py | 1 | 6516 | """
Routines for programmatically authenticating with the Google Accounts system at
Google App-Engine.
This takes two calls, one to the ClientLogin service of Google Accounts,
and then a second to the login frontend of App Engine.
User credentials are provided to the first, which responds with a token.
Passing that t... | mit |
SaganBolliger/nupic | src/nupic/encoders/multi.py | 15 | 7688 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
peoplepower/composer-sdk-python | com.ppc.Bot/devices/siren/siren_linkhigh.py | 1 | 3469 | '''
Created on March 3, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.siren.siren import SirenDevice
# For the LinkHigh siren, send all 3 parameters simultaneously:
# ppc.alarmWarn = sound id ... | apache-2.0 |
heuer/segno | tests/test_issue35_maskcheck.py | 1 | 1114 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - 2020 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Tests against issue 35
<https://github.com/heuer/segno/issues/35>
"""
from __future__ import absolute_import, unicode_literals
import pytest
from segno import consts
from segno import encoder
@py... | bsd-3-clause |
arju88nair/projectCulminate | venv/lib/python3.5/site-packages/nltk/stem/isri.py | 7 | 15040 | # -*- coding: utf-8 -*-
#
# Natural Language Toolkit: The ISRI Arabic Stemmer
#
# Copyright (C) 2001-2017 NLTK Proejct
# Algorithm: Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005)
# Author: Hosam Algasaier <hosam_hme@yahoo.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
ISRI Arabi... | apache-2.0 |
mm112287/2015cda_g8_0421 | static/Brython3.1.0-20150301-090019/Lib/ui/widget.py | 706 | 1774 | import random
from browser import doc
def getMousePosition(e):
if e is None:
e=win.event
if e.pageX or e.pageY:
return {'x': e.pageX, 'y': e.pageY}
if e.clientX or e.clientY:
_posx=e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft;
_posy=e.clientY + doc.body.scr... | gpl-3.0 |
McNetic/CouchPotatoServer-de | libs/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | gpl-3.0 |
kevin8909/xjerp | openerp/addons/mrp_repair/__init__.py | 64 | 1102 | # -*- 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... | agpl-3.0 |
Pelagicore/qface | tests/test_tags.py | 2 | 1797 | from qface.generator import FileSystem
import logging
import logging.config
from path import Path
# logging.config.fileConfig('logging.ini')
logging.basicConfig()
log = logging.getLogger(__name__)
inputPath = Path('tests/in')
log.debug('input path folder: {0}'.format(inputPath.abspath()))
def loadTuner():
pat... | mit |
Pencroff/ai-hackathon-2017 | Backend/venv/lib/python3.6/site-packages/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
opensim-org/three.js | utils/exporters/blender/addons/io_three/exporter/texture.py | 173 | 1407 | from .. import constants, logger
from . import base_classes, image, api
class Texture(base_classes.BaseNode):
"""Class that wraps a texture node"""
def __init__(self, node, parent):
logger.debug("Texture().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent, constants.TEXTUR... | mit |
nismod/energy_demand | energy_demand/plotting/fig_weather_variability_priod.py | 1 | 4091 | """Plot stacked enduses for each submodel
"""
import numpy as np
import matplotlib.pyplot as plt
#from scipy.stats import mstats
import pandas as pd
from energy_demand.technologies import tech_related
from energy_demand.plotting import basic_plot_functions
def sum_all_enduses_fueltype(
data_enduses,
f... | mit |
mitodl/xanalytics | unidecode/x070.py | 252 | 4693 | data = (
'You ', # 0x00
'Yang ', # 0x01
'Lu ', # 0x02
'Si ', # 0x03
'Jie ', # 0x04
'Ying ', # 0x05
'Du ', # 0x06
'Wang ', # 0x07
'Hui ', # 0x08
'Xie ', # 0x09
'Pan ', # 0x0a
'Shen ', # 0x0b
'Biao ', # 0x0c
'Chan ', # 0x0d
'Mo ', # 0x0e
'Liu ', # 0x0f
'Jian ', # 0x10
'P... | mit |
shaswatsunder/aakashlabs-forum | ac/get_list.py | 3 | 1609 | # Get list of rc_id, rc_name, city etc. for search.
from ac.models import AakashCentre, Project
def get_ac_name_list(max_results=0, starts_with=''):
if starts_with:
lst = AakashCentre.objects.filter(active=True,
name__icontains=starts_with)
else:
lst =... | gpl-3.0 |
jkbradley/spark | examples/src/main/python/ml/fm_classifier_example.py | 10 | 2846 | #
# 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 us... | apache-2.0 |
endlessm/chromium-browser | native_client/pnacl/driver/shelltools.py | 8 | 2070 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from driver_log import Log
import types
######################################################################
#
# Shell Utiliti... | bsd-3-clause |
DefyVentures/edx-platform | common/djangoapps/status/tests.py | 15 | 3216 | from django.conf import settings
from django.core.cache import cache
from django.test import TestCase
import os
from django.test.utils import override_settings
from tempfile import NamedTemporaryFile
import ddt
from .status import get_site_status_msg
# Get a name where we can put test files
TMP_FILE = NamedTemporaryF... | agpl-3.0 |
Akasurde/ansible | lib/ansible/playbook/role/include.py | 83 | 2605 | # (c) 2014 Michael DeHaan, <michael@ansible.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 later ve... | gpl-3.0 |
hhm0/supysonic | tests/test_manager_user.py | 1 | 4845 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2017 Alban 'spl0k' Féron
# 2017 Óscar García Amor
#
# Distributed under terms of the GNU AGPLv3 license.
from s... | agpl-3.0 |
foxwill/ol-api-tester | env/lib/python2.7/site-packages/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## 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-2.0 |
slint/zenodo | zenodo/modules/records/serializers/pidrelations.py | 2 | 4107 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | gpl-2.0 |
gcd0318/django | django/conf/project_template/project_name/settings.py | 271 | 3288 | """
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | bsd-3-clause |
kosz85/django | tests/forms_tests/widget_tests/test_passwordinput.py | 247 | 1052 | from django.forms import PasswordInput
from .base import WidgetTest
class PasswordInputTest(WidgetTest):
widget = PasswordInput()
def test_render(self):
self.check_html(self.widget, 'password', '', html='<input type="password" name="password" />')
def test_render_ignore_value(self):
sel... | bsd-3-clause |
sivel/ansible | test/units/executor/test_task_queue_manager_callbacks.py | 68 | 4502 | # (c) 2016, Steve Kuznetsov <skuznets@redhat.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 later v... | gpl-3.0 |
seandavi/pelican-plugins | pelican_comment_system/pelican_comment_system.py | 32 | 6416 | # -*- coding: utf-8 -*-
"""
Pelican Comment System
======================
A Pelican plugin, which allows you to add comments to your articles.
Author: Bernhard Scheirle
"""
from __future__ import unicode_literals
import logging
import os
import copy
logger = logging.getLogger(__name__)
from itertools import chain
f... | agpl-3.0 |
nathanaevitas/odoo | openerp/addons/hr_payroll_account/wizard/__init__.py | 433 | 1116 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
tsteward/the-blue-alliance | tests/test_datafeed_controller.py | 3 | 1879 | import unittest2
import datetime
from google.appengine.api import urlfetch
from google.appengine.ext import db
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from google.appengine.ext.webapp import Response
# from controllers.datafeed_controller import UsfirstEventDetailsGet
from model... | mit |
hectord/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/db/backends/postgis/adapter.py | 311 | 1165 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB (in string form, to allow easy pickling ... | gpl-3.0 |
akulakov/mangotrac | proj_issues/issues/views.py | 1 | 16649 | # Imports {{{
from __future__ import print_function, unicode_literals, division
from pprint import pprint
from difflib import Differ
from django.http import HttpResponse
from django.core.urlresolvers import reverse, reverse_lazy
from django.contrib.admin.views.decorators import staff_member_required
from django.forms ... | mit |
GitHublong/hue | desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/connections.py | 76 | 11777 | """
This module implements connections for MySQLdb. Presently there is
only one class: Connection. Others are unlikely. However, you might
want to make your own subclasses. In most cases, you will probably
override Connection.default_cursor with a non-standard Cursor class.
"""
from MySQLdb import cursors
fr... | apache-2.0 |
h3biomed/ansible | lib/ansible/modules/cloud/amazon/ec2_eip_facts.py | 11 | 4022 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module... | gpl-3.0 |
curtacircuitos/pcb-tools | gerber/common.py | 2 | 2148 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be>
# 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 |
lduarte1991/edx-platform | common/djangoapps/student/management/commands/change_enrollment.py | 2 | 5479 | """ Command line script to change user enrollments. """
import logging
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from student.models import CourseEnrollment, User
logger = log... | agpl-3.0 |
walkover/auto-tracking-cctv-gateway | gateway/mobile/server.py | 1 | 4360 | import json
import logging
import struct
from flask import Flask, request
from tornado import gen
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.iostream import StreamClosedError
from tornado.tcpserver import TCPServer
from tornado.wsgi import WSGIContainer
from gateway.app ... | mit |
tmclaugh/lightblue-0.4 | src/linux/_discoveryui.py | 49 | 17786 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
kingmotley/SickRage | lib/github/Legacy.py | 72 | 7248 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | gpl-3.0 |
manashmndl/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
jrslocum17/pynet_test | Week7/Show_int_eapi.py | 1 | 1178 | #!/usr/bin/env python
"""
Ex 1. Use Arista's eAPI to obtain 'show interfaces' from the switch. Parse the 'show interfaces' output to obtain the
'inOctets' and 'outOctets' fields for each of the interfaces on the switch. Accomplish this using Arista's pyeapi.
"""
import pyeapi
from pprint import pprint
def main():
... | apache-2.0 |
tigerneil/Theano-Lights | train.py | 5 | 8043 | import numpy as np
import time
from operator import add
from toolbox import *
from models import *
if __name__ == "__main__":
# Hyper-parameters
#--------------------------------------------------------------------------------------------------
hp = Parameters()
with hp:
batch_size = 1000
t... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/sessions/backends/signed_cookies.py | 37 | 2889 | from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sess... | gpl-3.0 |
waytai/networkx | networkx/algorithms/centrality/tests/test_dispersion.py | 63 | 1416 | import networkx as nx
from nose.tools import *
def small_ego_G():
"""The sample network from http://arxiv.org/pdf/1310.6753v1.pdf"""
edges=[('a','b'), ('a','c'), ('b','c'), ('b','d'),
('b', 'e'),('b','f'),('c','d'),('c','f'),('c','h'),('d','f'), ('e','f'),
('f','h'),('h','j'), ('h','k'),... | bsd-3-clause |
mickael-guene/gcc | gcc/ada/doc/share/ada_pygments.py | 27 | 7455 | """Alternate Ada and Project Files parsers for Sphinx/Rest"""
import re
from pygments.lexer import RegexLexer, bygroups
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation
def get_lexer_tokens(tag_highlighting=False, project_support=False):
"""Return the tokens ne... | gpl-2.0 |
artiya4u/thefuck | thefuck/rules/fix_file.py | 6 | 2476 | import re
import os
from thefuck.utils import memoize, wrap_settings
from thefuck import shells
# order is important: only the first match is considered
patterns = (
# js, node:
'^ at {file}:{line}:{col}',
# cargo:
'^ {file}:{line}:{col}',
# python, thefuck:
'^ Fi... | mit |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/plat-mac/lib-scriptpackages/Explorer/URL_Suite.py | 82 | 1268 | """Suite URL Suite: Standard suite for Uniform Resource Locators
Level 1, version 1
Generated from /Applications/Internet Explorer.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'GURL'
class URL_Suite_Events:
_argmap_GetURL = {
'to' : 'dest',
}
... | gpl-3.0 |
Noviat/odoo | addons/knowledge/__openerp__.py | 261 | 1738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
duducosmos/pgs4a | python-install/lib/python2.7/bsddb/db.py | 194 | 2730 | #----------------------------------------------------------------------
# Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
# and Andrew Kuchling. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.