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 |
|---|---|---|---|---|---|
jitka/weblate | weblate/trans/management/commands/auto_translate.py | 1 | 3306 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... | gpl-3.0 |
harbichidian/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
joeyjojo/django_offline | src/django/template/loader_tags.py | 96 | 10137 | from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class ExtendsError(Excepti... | mit |
catapult-project/catapult | third_party/gsutil/gslib/vendored/boto/tests/test.py | 25 | 2922 | #!/usr/bin/env python
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
#
# 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 rig... | bsd-3-clause |
gravyboat/streamlink | src/streamlink/buffers.py | 2 | 3954 | from collections import deque
from io import BytesIO
from threading import Event, Lock
class Chunk(BytesIO):
"""A single chunk, part of the buffer."""
def __init__(self, buf):
self.length = len(buf)
BytesIO.__init__(self, buf)
@property
def empty(self):
return self.tell() == ... | bsd-2-clause |
Endika/odoo | addons/l10n_be_hr_payroll/__init__.py | 438 | 1072 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
svenfraeys/sftoolbox | sftoolbox/panels.py | 1 | 6255 | import os
import uuid
import sftoolbox.utils
class Panel(object):
"""panel to display elements in
"""
def __init__(self, project):
"""construct the panel
"""
project.add(self)
self.project = project
self.label = None
self.description = None
self.idn... | mit |
xyproto/b-tk.core | Testing/Python/_TDDBasicFilters.py | 4 | 1411 | import unittest
import AcquisitionUnitConverterTest
import AnalogOffsetRemoverTest
import DownsampleFilterTest
import ForcePlatformsExtractorTest
import GroundReactionWrenchFilterTest
import IMUsExtractorTest
import MergeAcquisitionFilterTest
import SeparateKnownVirtualMarkersFilterTest
import SubAcquisitionFilterTest... | bsd-3-clause |
ibotty/ansible-modules-core | cloud/amazon/ec2_elb_lb.py | 40 | 36068 | #!/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 |
talau/ns-3.18-wifi-queue-red | doc/tutorial/source/conf.py | 6 | 7055 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | gpl-2.0 |
abtink/openthread | tools/harness-automation/cases_R140/router_5_1_3.py | 18 | 1877 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
inderpartap/ham-or-spam | ham-or-spam/train.py | 1 | 7693 | # -*- coding: utf-8 -*-
# @Author: Inderpartap Cheema
# @Date: 2017-02-10
# @Last Modified by: Inderpartap Cheema
# @Last Modified time: 2017-04-16 19:30:00
# @GPLv3 License
import os
import string
import re
import codecs
import mimetypes
import logging
import bs4
from termcolor import colored
# specify the fo... | gpl-3.0 |
piffey/ansible | lib/ansible/modules/packaging/os/opkg.py | 14 | 5235 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# 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... | gpl-3.0 |
was4444/chromium.src | build/android/pylib/utils/argparse_utils.py | 26 | 1802 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
class CustomHelpAction(argparse.Action):
'''Allows defining custom help actions.
Help actions can run even when the parser would other... | bsd-3-clause |
SimonBussy/C-mix | QNEM/history.py | 1 | 3730 | # -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
import numpy as np
from collections import defaultdict
def n_iter_func(n_iter=0, **kwargs):
return n_iter
def obj_func(obj=0, **kwargs):
return obj
def rel_obj_func(rel_obj=0, **kwargs):
return rel_obj
def spars_func(coeffs=None,... | mit |
kouaw/CouchPotatoServer | couchpotato/core/downloaders/qbittorrent_.py | 22 | 7943 | from base64 import b16encode, b32decode
from hashlib import sha1
import os
from bencode import bencode, bdecode
from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList
from couchpotato.core.helpers.encoding import sp
from couchpotato.core.helpers.variable import cleanHost
from couchpotat... | gpl-3.0 |
tianzhihen/python-mode | pymode/libs/pylama/lint/pylama_pylint/pylint/__pkginfo__.py | 17 | 3038 | # pylint: disable=W0622,C0103
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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; eith... | lgpl-3.0 |
BeegorMif/HTPC-Manager | lib/sqlalchemy/event/registry.py | 77 | 7468 | # event/registry.py
# Copyright (C) 2005-2014 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
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
B... | gpl-3.0 |
synctree/synctree-awsebcli | ebcli/objects/solutionstack.py | 2 | 2801 | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | apache-2.0 |
Hodorable/0602 | openstack_dashboard/dashboards/admin/volumes/snapshots/tests.py | 34 | 4219 | # 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 t... | apache-2.0 |
spaceone/pyjs | examples/jsonrpc/public/services/jsonrpc/proxy.py | 24 | 2475 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later ... | apache-2.0 |
Oslandia/vizitown_plugin | zope/interface/ro.py | 31 | 2120 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | gpl-2.0 |
anant-dev/django | django/http/request.py | 154 | 20254 | from __future__ import unicode_literals
import copy
import re
import sys
from io import BytesIO
from itertools import chain
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.files import uploadhandler
from django.h... | bsd-3-clause |
pyprism/Hiren-Movie | movie/migrations/0002_auto_20161115_1957.py | 2 | 1643 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-15 13:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('movie', '0001_initial'),
]
operations = [
... | mit |
steedos/odoo | addons/mail/mail_vote.py | 439 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
moodpulse/l2 | users/management/commands/employee_rmis_login.py | 1 | 1342 | from django.core.management.base import BaseCommand
from openpyxl import load_workbook
from users.models import DoctorProfile
class Command(BaseCommand):
def add_arguments(self, parser):
"""
:param path - файл с кодами МКБ10.2019 + расшифровка
"""
parser.add_argument('path', type=... | mit |
espressomd/espresso | testsuite/python/dawaanr-and-bh-gpu.py | 2 | 5278 | # Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 |
mbrubeck/servo | tests/wpt/update/update.py | 224 | 1348 | # 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 os
from wptrunner.update.base import Step, StepRunner
from wptrunner.update.update import LoadConfig, SyncFromUp... | mpl-2.0 |
jusdng/odoo | addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py | 301 | 14179 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c):
#
# 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de)
# 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be)
#
# This program is free software: you can redistribute it and/or ... | agpl-3.0 |
ijzer/cwbot-ndy | cwbot/kolextra/request/ClanRaidLogRequest.py | 1 | 6222 | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
import re
from datetime import datetime
import kol.Error
def decomma(num_str):
return "".join(num_str.split(","))
class ClanRaidLogRequest(GenericRequest):
"""
This class retrieves a list of old raid logs that th... | bsd-3-clause |
Sravan2j/DIGITS | tools/download_data/cifar100.py | 17 | 5215 | # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
import os
import tarfile
import cPickle
import PIL.Image
from downloader import DataDownloader
class Cifar100Downloader(DataDownloader):
"""
See details about the CIFAR100 dataset here:
http://www.cs.toronto.edu/~kriz/cifar.html
"""
... | bsd-3-clause |
huongttlan/statsmodels | examples/python/discrete_choice_overview.py | 25 | 2620 |
## Discrete Choice Models Overview
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
# ## Data
#
# Load data from Spector and Mazzeo (1980). Examples follow Greene's Econometric Analysis Ch. 21 (5th Edition).
spector_data = sm.datasets.spector.load()
spector_data.exog = sm.add_c... | bsd-3-clause |
alawnchen/djangoproject.com | aggregator/admin.py | 10 | 1206 | from django.contrib import admin
from .models import APPROVED_FEED, DENIED_FEED, Feed, FeedItem, FeedType
def mark_approved(modeladmin, request, queryset):
for item in queryset.iterator():
item.approval_status = APPROVED_FEED
item.save()
mark_approved.short_description = "Mark selected feeds as a... | bsd-3-clause |
ligaturee/ansible-modules-extras | cloud/cloudstack/cs_user.py | 14 | 13559 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
jgabriellima/yowsup | yowsup/layers/protocol_notifications/protocolentities/notification_picture_set.py | 70 | 1405 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .notification_picture import PictureNotificationProtocolEntity
class SetPictureNotificationProtocolEntity(PictureNotificationProtocolEntity):
'''
<notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="picture"
... | gpl-3.0 |
brokenjacobs/ansible | lib/ansible/plugins/inventory/script.py | 8 | 7894 | # (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 |
beswarm/django-social-auth | social_auth/utils.py | 95 | 1402 | from django.conf import settings
from django.db.models.loading import get_model
def get_custom_user_model_for_migrations():
user_model = getattr(settings, 'SOCIAL_AUTH_USER_MODEL', None) or \
getattr(settings, 'AUTH_USER_MODEL', None) or \
'auth.User'
if user_model != 'auth.U... | bsd-3-clause |
lewiskan/heron | heron/common/src/python/utils/misc/pplan_helper.py | 8 | 10054 | # Copyright 2016 Twitter. 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 applicable law or agree... | apache-2.0 |
jaywreddy/django | tests/view_tests/tests/test_static.py | 337 | 5470 | from __future__ import unicode_literals
import mimetypes
import unittest
from os import path
from django.conf.urls.static import static
from django.http import FileResponse, HttpResponseNotModified
from django.test import SimpleTestCase, override_settings
from django.utils.http import http_date
from django.views.stat... | bsd-3-clause |
xaviercobain88/framework-python | build/lib.linux-i686-2.7/openerp/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py | 52 | 8708 | # -*- 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 |
marmyshev/transitions | tests/functional/openlp_core_lib/test_registry.py | 1 | 1910 | """
Package to test the openlp.core.lib package.
"""
import os
from unittest import TestCase
from mock import MagicMock
from openlp.core.lib import Registry
TESTPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), u'..', u'..', u'resources'))
class TestRegistry(TestCase):
def registry_basic_test(s... | gpl-2.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/copyreg.py | 165 | 6833 | """Helper to provide extensibility for pickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_typ... | mit |
simonwydooghe/ansible | lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_info.py | 20 | 4336 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 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
#... | gpl-3.0 |
skyoo/jumpserver | apps/assets/serializers/asset_user.py | 1 | 3183 | # -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext as _
from rest_framework import serializers
from common.drf.serializers import AdaptedBulkListSerializer
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from ..models import AuthBook, Asset
from ..backends import AssetUserManag... | gpl-2.0 |
bencharb/AutobahnPython | examples/asyncio/wamp/pubsub/options/backend.py | 2 | 2568 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
robwarm/gpaw-symm | gpaw/test/ralda_energy_Si.py | 1 | 1208 | from ase import *
from ase.lattice import bulk
from ase.dft.kpoints import monkhorst_pack
from gpaw import *
from gpaw.mpi import serial_comm
from gpaw.test import equal
from gpaw.xc.rpa import RPACorrelation
from gpaw.xc.fxc import FXCCorrelation
import numpy as np
a0 = 5.43
cell = bulk('Si', 'fcc', a=a0).get_cell()
... | gpl-3.0 |
alirizakeles/zato | code/zato-common/test/zato/common/test_common.py | 1 | 1541 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from unittest import TestCase
# Nose
from nose.tools import eq_
# Zato... | gpl-3.0 |
hose314/cs.betlabs.ru | AAA/HackerRankAPI/api.py | 1 | 1176 | import requests
class API:
__token = ''
_host = 'http://www.hackerrank.com/x/api/v2/'
_endpoints = {
"tests": _host + "tests",
}
_default_headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
_payload = {
"access_token": __token
... | mit |
yosi-dediashvili/SubiT | src/UserAgents.py | 2 | 322495 |
#===============================================================================
# This file was auto-generated by create_useragents.py. The purpose of this
# file is to supply a random user agent for SubiT.
# The list is taken from: www.useragentstring.com. The User-Agents are the 3
# most popular user-agents out ... | gpl-3.0 |
sviehb/binwalk | src/binwalk/modules/hashmatch.py | 26 | 11722 | # Performs fuzzy hashing against files/directories.
# Unlike other scans, this doesn't produce any file offsets, so its results are not applicable to
# some other scans, such as the entropy scan.
# Additionally, this module currently doesn't support certian general options (length, offset, swap, etc),
# as the libfuzz... | mit |
bigzz/big-LITTLE-MP | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
uki1/Print | printrun/graph.py | 3 | 17315 | #!/usr/bin/env python
# This file is part of the Printrun suite.
#
# Printrun 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.
#
# Prin... | gpl-3.0 |
sv-dev1/odoo | addons/product/pricelist.py | 154 | 26498 | # -*- 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 |
Emilgardis/falloutsnip | Vendor/IronPython/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | gpl-3.0 |
oliverhuangchao/thunder | thunder/rdds/keys.py | 7 | 3583 | """Helper functions and classes for working with keys"""
from numpy import mod, ceil, cumprod, append, size, inf, subtract
class Dimensions(object):
""" Class for estimating and storing dimensions of data based on the keys """
def __init__(self, values=[], n=3):
self.min = tuple(map(lambda i: inf, r... | apache-2.0 |
qbit/node-gyp | gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py | 74 | 1306 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies inclusion of $HOME/.gyp/include.gypi works properly with relocation
and with regeneration.
"""
import os
import TestGyp
# Reg... | mit |
Bysmyyr/chromium-crosswalk | tools/telemetry/telemetry/timeline/trace_data.py | 17 | 5741 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
class NonSerializableTraceData(Exception):
"""Raised when raw trace data cannot be serialized to TraceData."""
pass
def _ValidateRawData(r... | bsd-3-clause |
xbash/LabUNAB | 07_listas/14_ListasTuplasDiccionarios.py | 1 | 1112 |
#Se declara lista
a = [1,2,3,4,5,6,7,8]
#imprimir lista completa
print(a)
#imprimir posicion 0
print(a[0])
#imprimir longitud de la lista
print(len(a))
#recorrer e imprimr la lista
for x in range(0,len(a)):
print (a[x])
pass
#segunda opcion para recorrer e imprimir la lista
for x in a:
print(x)
pass
#insertar elem... | gpl-3.0 |
tsunaminoai/YouTubeToPodcast | youtube-to-podcast.py | 1 | 9924 | #!/usr/bin/env python
from __future__ import unicode_literals
from feedgen.feed import FeedGenerator
from mutagen.mp3 import MP3
from mutagen import MutagenError
from collections import OrderedDict
from PIL import Image
from dominate.tags import *
import dominate
import dateutil.parser
import mutagen.id3
import Confi... | mit |
chdecultot/erpnext | erpnext/crm/doctype/contract/contract.py | 9 | 3040 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate, now_datetime, nowdate
... | gpl-3.0 |
AndrewHanSolo/CMP | lib/General.py | 1 | 6104 | #General Functions File
from TrackClassGlobals import *
import TrackClassGlobals as TCG
from TrackClass import *
import TrackClass as TC
from math import *
import re, sys, traceback
import pylab as P
import _pickle as pickle
import xlsxwriter
import os
#imports, preprocesses, and saves all data from ... | mit |
dannyperry571/theapprentice | script.module.mutagen/lib/mutagen/trueaudio.py | 16 | 2120 | # True Audio support for Mutagen
# Copyright 2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""True Audio audio stream information and tags.
True Audio is a ... | gpl-2.0 |
ljnutal6/media-recommend | app/virtualenvs/recommedia/lib/python2.7/site-packages/pip/vendor/distlib/_backport/shutil.py | 1002 | 25650 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... | gpl-2.0 |
quxiaolong1504/django | tests/template_tests/syntax_tests/test_url.py | 17 | 11508 | # coding: utf-8
from django.core.urlresolvers import NoReverseMatch
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils.deprecation import RemovedInDjango110Warning
from ..utils import setup
@override_settings(ROOT_URLCONF='temp... | bsd-3-clause |
SatoshiNXSimudrone/sl4a-damon-clone | python/src/Demo/curses/xmas.py | 34 | 25499 | # asciixmas
# December 1989 Larry Bartz Indianapolis, IN
#
# $Id: xmas.py 46623 2006-06-03 22:59:23Z andrew.kuchling $
#
# I'm dreaming of an ascii character-based monochrome Christmas,
# Just like the ones I used to know!
# Via a full duplex communications channel,
# At 9600 bits per second,
# Ev... | apache-2.0 |
nicko96/Chrome-Infra | appengine/experimental/milo-linear/feebas.py | 1 | 5560 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Cloud Endpoints for Buildbot Endpoints.
This provides an appengine caching layer for buildbot endpoints.
"""
import json
import endpoints
import os
impo... | bsd-3-clause |
Bysmyyr/blink-crosswalk | Source/core/inspector/CodeGeneratorInspectorStrings.py | 6 | 28554 | # Copyright (c) 2013 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 |
pplatek/odoo | addons/l10n_in_hr_payroll/report/payslip_report.py | 340 | 3978 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
oihane/odoo-addons | fleet_route_support/models/fleet_route_support.py | 2 | 4624 | # Copyright 2019 Adrian Revilla - Avanzosc S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
ISSUE_TYPE = [("high", "High"),
("low", "Low"),
("change", "Change"),
("note", "... | agpl-3.0 |
Wingless-Archangel/OWASP-ZSC | module/readline_windows/pyreadline/lineeditor/history.py | 4 | 10838 | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#***... | gpl-3.0 |
isaac-philip/loolu | common/django/contrib/gis/geos/point.py | 403 | 4253 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... | mit |
chkoster/hillary-clinton-emails | scripts/bodyText.py | 6 | 1586 | import os
import re
from subprocess import call
def filter_body(text):
patterns = [r"\x0c",
r"(\n|^)UNCLASSIFIED.*",
r"(\n|^)CONFIDENTIAL.*",
r"(\n|^)Classified by.*",
r"(\n|^)Attachments:.*"]
for repeat in range(3):
for pattern in pattern... | mit |
Drahflow/lymph | lymph/core/monitoring/pusher.py | 3 | 1268 | import logging
import time
import gevent
import msgpack
import zmq.green as zmq
from lymph.core.components import Component
from lymph.utils.sockets import bind_zmq_socket
logger = logging.getLogger(__name__)
class MonitorPusher(Component):
def __init__(self, container, aggregator, endpoint='127.0.0.1', inter... | apache-2.0 |
ky822/scikit-learn | examples/model_selection/plot_roc.py | 96 | 4487 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
donckers/ansible | lib/ansible/module_utils/database.py | 401 | 5839 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
a-parhom/edx-platform | openedx/core/djangoapps/theming/templatetags/theme_pipeline.py | 18 | 2750 | """
Theme aware pipeline template tags.
"""
from django import template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from pipeline.templatetags.pipeline import StylesheetNode, JavascriptNode
from pipeline.utils import guess_type
from openedx.core.djangoapps.themin... | agpl-3.0 |
JKatzwinkel/mps-youtube | mps_youtube/config.py | 2 | 12373 | import os
import re
import copy
import pickle
import collections
from urllib.request import urlopen
from urllib.error import HTTPError
from urllib.parse import urlencode
import pafy
from . import g, c
from .paths import get_default_ddir
from .util import get_mpv_version, has_exefile, dbg, list_update
mswin = os.nam... | gpl-3.0 |
dbs/schemaorg | lib/rdflib/plugins/serializers/nt.py | 22 | 2372 | """
N-Triples RDF graph serializer for RDFLib.
See <http://www.w3.org/TR/rdf-testcases/#ntriples> for details about the
format.
"""
from rdflib.term import Literal
from rdflib.serializer import Serializer
from rdflib.py3compat import b
import warnings
__all__ = ['NTSerializer']
class NTSerializer(Serializer):
""... | apache-2.0 |
edulramirez/nova | nova/api/openstack/api_version_request.py | 14 | 6744 | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
jtattermusch/grpc | src/python/grpcio/grpc/framework/foundation/logging_pool.py | 15 | 2277 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
yamt/tempest | tempest/api/compute/servers/test_instance_actions_negative.py | 11 | 2004 | # Copyright 2013 NEC Corporation
# 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 |
spaceone/pyjs | examples/raphael/events.py | 6 | 7565 | import pyjd
from pyjamas.raphael.raphael import Raphael
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.TabPanel import TabPanel
from pyjamas.ui.SimplePanel import SimplePanel
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.Label import Label
from pyjamas.ui.HTML import HTML
from pyjamas... | apache-2.0 |
willhess/aima-python | submissions/Haller/myBayes.py | 15 | 2780 | import traceback
from submissions.Haller import school_scores
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
mathSATScores = DataFrame()
'''
Extract data from the CORGIS School Scores.
'''
joint = {}
scores = school_scores.get_all()
for state in scores:
try:
... | mit |
vaygr/ansible | test/units/modules/network/netscaler/test_netscaler_gslb_service.py | 39 | 27775 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 |
citrix-openstack-build/trove | trove/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py | 2 | 3515 | # 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.apach... | apache-2.0 |
reinaH/osf.io | website/project/views/tag.py | 29 | 1534 | import httplib as http
from flask import request
from modularodm.exceptions import ValidationError
from framework.auth.decorators import collect_auth
from website.project.model import Tag
from website.project.decorators import (
must_be_valid_project, must_have_permission, must_not_be_registration
)
# Disabled ... | apache-2.0 |
joshlk/scrapy | scrapy/tests/test_utils_misc/__init__.py | 15 | 3077 | import sys
import os
import unittest
from cStringIO import StringIO
from scrapy.item import Item, Field
from scrapy.utils.misc import load_object, arg_to_iter, walk_modules
__doctests__ = ['scrapy.utils.misc']
class UtilsMiscTestCase(unittest.TestCase):
def test_load_object(self):
obj = load_object('scr... | bsd-3-clause |
EvanK/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_group.py | 14 | 5618 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 |
Bharath-J/Mezzanine | mezzanine/template/loader_tags.py | 28 | 6335 | from __future__ import unicode_literals
from future.builtins import map
import os
from django.template import Template, TemplateSyntaxError, TemplateDoesNotExist
from django.template.loader_tags import ExtendsNode
from mezzanine import template
register = template.Library()
class OverExtendsNode(ExtendsNode):
... | bsd-2-clause |
cysnake4713/odoo | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
linjoahow/2015cda_lego | static/Brython3.1.3-20150514-095342/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | agpl-3.0 |
adishjain/youtube-dl | youtube_dl/extractor/tudou.py | 47 | 3422 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
class TudouIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tudou\.com/(?:listplay|programs(?:/view)?|albumplay)/.*?/(?P<id>[^/?#]+?)(?:\.html)?/?(?:$|[?#])'
_TESTS = [{
'url': 'http:... | unlicense |
tchellomello/home-assistant | homeassistant/components/owntracks/messages.py | 5 | 12148 | """OwnTracks Message handlers."""
import json
import logging
from nacl.encoding import Base64Encoder
from nacl.secret import SecretBox
from homeassistant.components import zone as zone_comp
from homeassistant.components.device_tracker import (
SOURCE_TYPE_BLUETOOTH_LE,
SOURCE_TYPE_GPS,
)
from homeassistant.co... | apache-2.0 |
masschallenge/django-accelerator | accelerator_abstract/models/base_application_answer.py | 1 | 1041 | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import swapper
from django.db import models
from accelerator_abstract.models.accelerator_model import AcceleratorModel
class BaseApplicationAnswer(AcceleratorModel):
application = models.ForeignKey(to=swapper.get_mod... | mit |
nvoron23/brython | site/tests/unittests/test/test_osx_env.py | 112 | 1342 | """
Test suite for OS X interpreter environment variables.
"""
from test.support import EnvironmentVarGuard, run_unittest
import subprocess
import sys
import sysconfig
import unittest
@unittest.skipUnless(sys.platform == 'darwin' and
sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'),
... | bsd-3-clause |
EPDCenterSpain/bq-DC-v2 | tools/perf/python/twatch.py | 3213 | 1338 | #! /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 |
Tejal011089/fbd_erpnext | erpnext/crm/doctype/newsletter/newsletter.py | 22 | 5127 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.utils
from frappe import throw, _
from frappe.model.document import Document
from frappe.email.bulk import check_bulk_limit... | agpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/py-goatools/package.py | 5 | 2106 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/ops/linalg_ops.py | 3 | 21265 | # 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... | mit |
d3m3vilurr/node-gyp | legacy/tools/gyp/gyptest.py | 43 | 7324 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.