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 |
|---|---|---|---|---|---|
SathyaBhat/spotify-dl | spotify_dl/youtube.py | 1 | 3746 | import urllib.request
from os import path
import mutagen
import youtube_dl
from mutagen.easyid3 import EasyID3
from mutagen.id3 import APIC, ID3
from mutagen.mp3 import MP3
from spotify_dl.scaffold import log
from spotify_dl.utils import sanitize
def default_filename(song):
return sanitize(f"{song.get('artist')... | mit |
smartforceplus/SmartForceplus | openerp/tools/amount_to_text_en.py | 441 | 5103 | # -*- 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... | agpl-3.0 |
ondrejmular/pcs | pcs_test/tier1/cib_resource/test_group_ungroup.py | 3 | 9883 | from unittest import TestCase
from lxml import etree
from pcs_test.tools.cib import get_assert_pcs_effect_mixin
from pcs_test.tools.misc import (
get_test_resource as rc,
get_tmp_file,
write_data_to_tmpfile,
)
from pcs_test.tools.pcs_runner import PcsRunner
from pcs_test.tools.xml import XmlManipulation
... | gpl-2.0 |
vv1133/home_web | django/contrib/sites/managers.py | 118 | 1983 | from django.conf import settings
from django.db import models
from django.db.models.fields import FieldDoesNotExist
class CurrentSiteManager(models.Manager):
"Use this to limit objects to those associated with the current site."
def __init__(self, field_name=None):
super(CurrentSiteManager, self).__ini... | bsd-3-clause |
ncoghlan/dnf | tests/test_selector.py | 13 | 1510 | # Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will... | gpl-2.0 |
dysya92/monkeys | flask/lib/python2.7/site-packages/migrate/versioning/repository.py | 32 | 7930 | """
SQLAlchemy migrate repository management.
"""
import os
import shutil
import string
import logging
from pkg_resources import resource_filename
from tempita import Template as TempitaTemplate
from migrate import exceptions
from migrate.versioning import version, pathed, cfgparse
from migrate.versioning.template... | bsd-3-clause |
1200wd/1200wd_addons | account_bank_match/__openerp__.py | 1 | 2272 | # -*- coding: utf-8 -*-
##############################################################################
#
# Account Bank Match
# Copyright (C) 2016 May
# 1200 Web Development
# http://1200wd.com/
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | agpl-3.0 |
xin3liang/platform_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/style/checkers/png.py | 170 | 3914 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... | bsd-3-clause |
sugartom/tensorflow-alien | tensorflow/examples/learn/mnist.py | 45 | 3999 | # 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 appl... | apache-2.0 |
summermk/dragonfly | dragonfly/actions/__init__.py | 5 | 1444 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 3... | lgpl-3.0 |
serialx/pexpect-u | examples/hive.py | 14 | 18065 | #!/usr/bin/env python
"""hive -- Hive Shell
This lets you ssh to a group of servers and control them as if they were one.
Each command you enter is sent to each host in parallel. The response of each
host is collected and printed. In normal synchronous mode Hive will wait for
each host to return the shell command lin... | mit |
TeachAtTUM/edx-platform | cms/djangoapps/contentstore/features/problem-editor.py | 19 | 12793 | # disable missing docstring
# pylint: disable=missing-docstring
import json
from lettuce import step, world
from nose.tools import assert_equal, assert_true
from advanced_settings import ADVANCED_MODULES_KEY, change_value
from common import open_new_course, type_in_codemirror
from course_import import import_file
D... | agpl-3.0 |
40223209/test111 | static/Brython3.1.1-20150328-091302/Lib/collections/abc.py | 739 | 16026 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | gpl-3.0 |
Debian/dput-ng | dput/uploaders/sftp.py | 1 | 10474 | # -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# Copyright (c) 2012 dput authors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | gpl-2.0 |
thedrow/cython | Demos/benchmarks/richards.py | 23 | 10520 | # based on a Java version:
# Based on original version written in BCPL by Dr Martin Richards
# in 1981 at Cambridge University Computer Laboratory, England
# and a C++ version derived from a Smalltalk version written by
# L Peter Deutsch.
# Java version: Copyright (C) 1995 Sun Microsystems, Inc.
# Translation fr... | apache-2.0 |
artkolev/QuizBot | src/bot.py | 1 | 16410 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Skype4Py
import datetime
import time
import random
import logging
import sqlite3
from hashlib import sha1
from collections import deque
FORMAT=u'%(name)s %(thread)d %(levelname)s: %(message)s'
logging.basicConfig(format=FORMAT, level=logging.INFO)
logging.getLogg... | gpl-2.0 |
yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/netappfiles/tests/latest/test_account_backup_commands.py | 1 | 7184 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | mit |
anbasile/flask_sample | flask/lib/python2.7/site-packages/werkzeug/debug/repr.py | 254 | 9354 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | mit |
yb-kim/gemV | src/arch/x86/isa/insts/system/halt.py | 91 | 2172 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
muffl0n/ansible | lib/ansible/playbook/block.py | 6 | 13430 | # (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 |
GheRivero/ansible | test/units/modules/source_control/test_gitlab_project.py | 36 | 2704 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
from ansible.compat.tests.mock import MagicMock
from ansible.modules.source_control import gitlab_project
import py... | gpl-3.0 |
Leila20/django | django/conf/locale/sl/formats.py | 504 | 2118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
ksmyth/protobuf | gtest/test/gtest_env_var_test.py | 2408 | 3487 | #!/usr/bin/env python
#
# Copyright 2008, 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... | bsd-3-clause |
onitake/ansible | lib/ansible/plugins/cliconf/ce.py | 18 | 3132 | #
# (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 d... | gpl-3.0 |
shikigit/python-phonenumbers | python/tests/testdata/region_AR.py | 7 | 3016 | """Auto-generated file, do not edit by hand. AR metadata"""
from phonenumbers.phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_AR = PhoneMetadata(id='AR', country_code=54, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[1-3689]\\d{9,10}', possible_n... | apache-2.0 |
salceson/PJN | lab8/main.py | 1 | 6484 | # coding: utf-8
import pickle
import sys
from heapq import nlargest, nsmallest
from operator import itemgetter
from pprint import pprint
from gensim import corpora, models
from utils import calculate_lda, calculate_lsi, cosine_metric, preprocess_data, create_tfidf
__author__ = "Michał Ciołczyk"
_DATA_FILE = 'data/pa... | mit |
waliens/sldc | sldc/merger.py | 1 | 10691 | # -*- coding: utf-8 -*-
import numpy as np
from shapely.geometry import JOIN_STYLE, Polygon
from shapely.ops import cascaded_union
__author__ = "Begon Jean-Michel <jm.begon@gmail.com>"
__contributor__ = ["Romain Mormont <romainmormont@hotmail.com>"]
__version = "0.1"
class Graph(object):
"""A class for represent... | mit |
baylee-d/osf.io | admin_tests/utilities.py | 30 | 1197 | """
Utilities to help run Django tests
* setup_view - replaces as_view
"""
from osf_tests.factories import UserFactory
def setup_view(view, request, *args, **kwargs):
"""Mimic as_view() returned callable, but returns view instance
http://tech.novapost.fr/django-unit-test-your-views-en.html
"""
view.r... | apache-2.0 |
kittiu/sale-workflow | sale_quotation_sourcing/tests/__init__.py | 34 | 1037 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 |
katstalk/android_external_chromium_org | tools/json_schema_compiler/idl_schema.py | 23 | 15958 | #! /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 itertools
import json
import os.path
import re
import sys
from json_parse import OrderedDict
# This file is a peer to jso... | bsd-3-clause |
nuigroup/kivy | kivy/tools/pep8checker/pep8.py | 3 | 71426 | #!/usr/bin/env python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net>
#
# 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 ... | lgpl-3.0 |
catapult-project/catapult-csm | dashboard/dashboard/edit_anomalies.py | 3 | 3546 | # 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.
"""URI endpoint for nudging Anomaly entities and updating alert bug IDs."""
import json
from google.appengine.api import users
from google.appengine.ext im... | bsd-3-clause |
ducksboard/libsaas | libsaas/services/github/service.py | 4 | 3826 | import json
from libsaas import http
from libsaas.filters import auth
from libsaas.services import base
from . import authorizations, gists, issues, organizations, repos, teams, users
class GitHub(base.Resource):
"""
"""
def __init__(self, token_or_username, password=None, apiroot='https://api.github.co... | mit |
almann/ion-python | tests/test_core_multimap.py | 1 | 1665 | from amazon.ion.core import Multimap, record
import six
from tests import parametrize
class _P(record('pairs', 'expected_all_values', 'expected_single_value', 'expected_total_len')):
def __str__(self):
return '{name}'.format(name=self.pairs)
ALL_DATA = _P(
pairs=[('a', 1), ('a', 2), ('a', 3), ('a',... | apache-2.0 |
Distrotech/yum-utils | plugins/fastestmirror/fastestmirror-asyncore/fastestmirror-asyncore.py | 8 | 11637 | #!/usr/bin/python
# This is a threadless prototype version of fastestmirror
#
# Version: 0.3.2
#
# A plugin for the Yellowdog Updater Modified which sorts each repo's
# mirrorlist by connection speed prior to download.
#
# To install this plugin, just drop it into /usr/lib/yum-plugins, and
# make sure you have 'plugins... | gpl-2.0 |
stewaoi/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 |
ejpbruel/servo | tests/wpt/web-platform-tests/service-workers/tools/blink-import.py | 88 | 6816 | import os
import re
import shutil
import glob
import tempfile
import sys
from collections import defaultdict
here = os.path.abspath(os.path.split(__file__)[0])
def get_extra_files(chromium_root):
return [(os.path.join(chromium_root, "LayoutTests", "http", "tests", "resources", "testharness-helpers.js"),
... | mpl-2.0 |
eliasdesousa/indico | indico/modules/events/contributions/lists.py | 2 | 8282 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
TobiasLundby/UAST | Module1/exercise41/utm.py | 1 | 7035 | #!/usr/bin/env python
#*****************************************************************************
# Universal Transverse Mercator (UTM) conversion
# Copyright (c) 2013-2015, Kjeld Jensen <kjeld@frobomind.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification... | bsd-3-clause |
trafi/gyp | pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | bsd-3-clause |
sogis/Quantum-GIS | python/plugins/processing/algs/qgis/PostGISExecuteSQL.py | 10 | 3187 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PostGISExecuteSQL.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya and Carterix Geomatics
Email : volayaf at gmail dot c... | gpl-2.0 |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/pip/_vendor/packaging/requirements.py | 448 | 4327 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pip._vendor.pyparsing import (
stringSta... | mit |
seanwestfall/django | django/db/backends/postgresql_psycopg2/base.py | 165 | 10458 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.base import BaseDatabaseWrapper
from djan... | bsd-3-clause |
freakboy3742/django | django/db/migrations/writer.py | 59 | 11293 |
import os
import re
from importlib import import_module
from django import get_version
from django.apps import apps
# SettingsReference imported for backwards compatibility in Django 2.2.
from django.conf import SettingsReference # NOQA
from django.db import migrations
from django.db.migrations.loader import Migrati... | bsd-3-clause |
harrysocool/ear_recognition | ear_recognition/generate_files.py | 1 | 6623 | import csv
import os
import random
import numpy as np
import pandas as pd
import matlab_wrapper
from lib.utils.timer import Timer
from tools.ear_recog import get_gt, ROI_boxes
import scipy.io as sio
def listdir_no_hidden(path):
list1 = []
for f in sorted(os.listdir(path)):
if not f.startswith('.'):
... | mit |
jordanemedlock/psychtruths | temboo/core/Library/EnviroFacts/UVForecast/HourlyUVByZipCode.py | 5 | 3319 | # -*- coding: utf-8 -*-
###############################################################################
#
# HourlyUVByZipCode
# Retrieves EPA hourly Ultraviolet (UV) Index readings in a given zip code.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 ... | apache-2.0 |
zzicewind/nova | nova/tests/functional/v3/test_lock_server.py | 3 | 2139 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 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... | apache-2.0 |
Endika/hr | hr_worked_days_activity/__init__.py | 24 | 1041 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 |
marqueedev/django | tests/template_backends/test_django.py | 32 | 1984 | from template_tests.test_response import test_processor_name
from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.test import RequestFactory, ignore_warnings
from django.utils.deprecation import RemovedInDjango20Warning
from .test_dummy import TemplateStri... | bsd-3-clause |
nazo/ansible | lib/ansible/plugins/callback/debug.py | 137 | 1190 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
class CallbackModule(CallbackModule_default): # pylint: disable=too-few-public-methods,no-init
'''
Override for the default callback m... | gpl-3.0 |
pk400/catering | myvenv/lib/python3.4/site-packages/django/db/migrations/operations/fields.py | 362 | 11142 | from __future__ import unicode_literals
from django.db.models.fields import NOT_PROVIDED
from django.utils import six
from django.utils.functional import cached_property
from .base import Operation
class AddField(Operation):
"""
Adds a field to a model.
"""
def __init__(self, model_name, name, fiel... | mit |
caphrim007/ansible | lib/ansible/modules/remote_management/redfish/redfish_command.py | 12 | 8144 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
... | gpl-3.0 |
mattf-horton/metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/slave.py | 2 | 3033 | #!/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
"License");... | apache-2.0 |
borysiasty/inasafe | safe/gui/tools/batch/scenario_runner.py | 10 | 6112 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Helper module for gui script functions.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | gpl-3.0 |
joone/chromium-crosswalk | components/cronet/tools/extract_from_jars.py | 10 | 1559 | #!/usr/bin/env python
#
# 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 fnmatch
import optparse
import os
import sys
REPOSITORY_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__), '... | bsd-3-clause |
proversity-org/edx-platform | lms/djangoapps/debug/management/commands/dump_xml_courses.py | 17 | 2416 | """
Export all xml courses in a diffable format.
This command loads all of the xml courses in the configured DATA_DIR.
For each of the courses, it loops through all of the modules, and dumps
each as a separate output file containing the json representation
of each of its fields (including those fields that are set as ... | agpl-3.0 |
moskytw/clime | tests/test.py | 4 | 1786 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from clime import Command
from clime.util import *
class TestClime(unittest.TestCase):
def test_util_autotype(self):
cases = ('string', '100', '100.0', None)
answers = ('string', 100 , 100.0 , None)
for case, answer in zip(... | mit |
aioue/ansible | lib/ansible/modules/windows/win_iis_website.py | 72 | 4032 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
ovilab/atomify | libs/lammps/examples/ELASTIC/compliance.py | 27 | 2053 | #!/usr/bin/env python
# This file reads in the file log.lammps generated by the script ELASTIC/in.elastic
# It prints out the 6x6 tensor of elastic constants Cij
# followed by the 6x6 tensor of compliance constants Sij
# It uses the same conventions as described in:
# Sprik, Impey and Klein PRB (1984).
# The units ... | gpl-3.0 |
Greennut/ostproject | django/core/management/base.py | 78 | 13744 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
from __future__ import with_statement
import os
import sys
from optparse import make_option, OptionParser
import traceback
import django
from django.core.exceptions import Imprope... | bsd-3-clause |
40223134/0512 | static/Brython3.1.1-20150328-091302/Lib/sre_constants.py | 692 | 7172 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... | gpl-3.0 |
Cerfoglg/cattle | tests/integration-v1/cattletest/core/test_svc_api_validation.py | 3 | 14604 | from common import * # NOQA
from cattle import ApiError
def _create_stack(client):
env = client.create_environment(name=random_str())
env = client.wait_success(env)
assert env.state == "active"
return env
def test_create_duplicated_services(client, context):
env = _create_stack(client)
ima... | apache-2.0 |
mosra/m.css | plugins/m/test/test_alias.py | 1 | 1775 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>
#
# 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, inc... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/types/test_io.py | 7 | 4785 | # -*- coding: utf-8 -*-
import numpy as np
import pandas.lib as lib
import pandas.util.testing as tm
from pandas.compat import long, u
class TestParseSQL(tm.TestCase):
def test_convert_sql_column_floats(self):
arr = np.array([1.5, None, 3, 4.2], dtype=object)
result = lib.convert_sql_column(arr... | gpl-3.0 |
shengdie/simon_kernel_l01f_kk | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
olsaki/ansible-modules-extras | cloud/misc/ovirt.py | 32 | 14190 | #!/usr/bin/python
# (c) 2013, Vincent Van der Kussen <vincent at vanderkussen.org>
#
# 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,... | gpl-3.0 |
kenwang815/KodiPlugins | script.module.oceanktv/lib/youtube_dl/extractor/roxwel.py | 180 | 1965 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://www\.roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passionpit... | gpl-2.0 |
SiPiggles/djangae | djangae/contrib/pagination/decorators.py | 14 | 3382 | import random
from functools import partial
from djangae.fields import ComputedCharField
from django.db.models.fields import FieldDoesNotExist
NULL_CHARACTER = u"\0"
def generator(fields, instance):
"""
Calculates the value needed for a unique ordered representation of the fields
we are paginatin... | bsd-3-clause |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/prompt_toolkit/layout/prompt.py | 23 | 3236 | from __future__ import unicode_literals
from six import text_type
from prompt_toolkit.enums import IncrementalSearchDirection, SEARCH_BUFFER
from prompt_toolkit.token import Token
from .utils import token_list_len
from .processors import Processor, Transformation
__all__ = (
'DefaultPrompt',
)
class DefaultPr... | gpl-3.0 |
jpush/jbox | Server/venv/lib/python3.5/site-packages/click/_bashcomplete.py | 64 | 2423 | import os
import re
from .utils import echo
from .parser import split_arg_string
from .core import MultiCommand, Option
COMPLETION_SCRIPT = '''
%(complete_func)s() {
COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
%(autocomplete_var)s=complete $1... | mit |
yaoshanliang/markdown-preview.vim | pythonx/markdown_preview.py | 1 | 3976 | #!/usr/bin/env python
# encoding: utf-8
import socket
import vim
import markdown_parser
import webbrowser
import os, platform
import commands
import markdown_server
import markdown_lib
def markdownPreviewWithDefaultCodeStyle():
cssName = vim.eval("a:args1")
currentpath = commands.getstatusoutput("pwd")[1]
... | mit |
52ai/django-ccsds | django/utils/dates.py | 590 | 2296 | "Commonly-used date structures"
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
WEEKDAYS = {
0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'),
5: _('Saturday'), 6: _('Sunday')
}
WEEKDAYS_ABBR = {
0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),... | bsd-3-clause |
eduardosan/window-manager | gwmanager/utils.py | 1 | 1379 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from glob import glob
from subprocess import check_output, CalledProcessError
def get_usb_devices():
"""
Lista dispositivos USB conectados
:return:
"""
sdb_devices = map(os.path.realpath, glob('/sys/block/sd*'))
usb_devices = (dev for de... | gpl-3.0 |
liberorbis/libernext | apps/frappe/frappe/utils/email_lib/receive.py | 35 | 7591 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import time
import poplib
import frappe
from frappe.utils import extract_email_id, convert_utc_to_user_timezone, now, cint
from frappe.utils.scheduler import log
class EmailS... | gpl-2.0 |
kjc88/sl4a | python/src/Tools/scripts/hotshotmain.py | 100 | 1483 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
Run a Python script under hotshot's control.
Adapted from a posting on python-dev by Walter Dörwald
usage %prog [ %prog args ] filename [ filename args ]
Any arguments after the filename are used as sys.argv for the filename.
"""
import sys
import optparse
imp... | apache-2.0 |
kevinpt/symbolator | nucanvas/color/sinebow.py | 1 | 1400 | # -*- coding: utf-8 -*-
# Copyright © 2017 Kevin Thibedeau
# Distributed under the terms of the MIT license
import math
from math import sin, pi
import colorsys
def sinebow(hue):
'''Adapted from http://basecase.org/env/on-rainbows'''
hue = -(hue + 0.5) # Start at red rotating clockwise
rgb = sin(pi * hue), sin(p... | mit |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Google/Picasa/ListAlbums.py | 5 | 4608 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListAlbums
# List all albums created in a Google Picasa account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | apache-2.0 |
thomashaw/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/distutils/sysconfig.py | 13 | 17666 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | gpl-3.0 |
robbiev/pytelemeter | pytelemeter/config.py | 1 | 3703 | """
pytelemeter config file handler
"""
import os
import sys
import ConfigParser
from parser import Account
# exceptions
class ConfigError(Exception): pass
class MissingConfigFile(ConfigError): pass
class MalformedConfigFile(ConfigError): pass
class StockCredentials(ConfigError): pass
class NoSuchAccount(ConfigEr... | gpl-2.0 |
SAVeselovskiy/KFU_Visual_Tracking | Tracking/detection.py | 1 | 10566 | __author__ = 'IVMIT KFU: Gataullin Ravil & Veselovkiy Sergei'
from copy import copy
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from time import time
import warnings
warnings.filterwarnings("ignore")
from sklearn.cross_validation import train_test_split
from structure import Position
class... | mit |
clonetwin26/buck | test/com/facebook/buck/cli/bootstrapper/class_loader_test.py | 21 | 1086 | import os
import shutil
import subprocess
import sys
import tempfile
import unittest
from project_workspace import ProjectWorkspace
class ClassLoaderTest(unittest.TestCase):
def test_should_not_pollute_classpath_when_processor_path_is_set(self):
"""
Tests that annotation processors get their own ... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/twisted/test/test_log.py | 12 | 36259 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.log}.
"""
from __future__ import division, absolute_import, print_function
from twisted.python.compat import _PY3, NativeStringIO as StringIO
import os
import sys
import time
import logging
import warnings
import ... | gpl-2.0 |
mediawiki-utilities/python-mwevents | mwevents/types/events/revisions_deleted.py | 3 | 1806 | from ... import configuration
from .event import Event
from .match import Match
class RevisionsDeleted(Event):
MATCHES = [Match("delete", "revision", True, "log")]
__slots__ = ('revision',)
def initialize(self, timestamp, user, comment, rev_ids):
super().initialize(timestamp, user, comment)
... | mit |
oberlin/django | tests/migrations/models.py | 386 | 1780 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps.registry import Apps
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class CustomModelBase(models.base.ModelBase):
pass
class ModelWithCustomBase(six.with_met... | bsd-3-clause |
XXMrHyde/android_external_chromium_org | win8/util/check_sdk_patch.py | 68 | 1559 | #!/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.
"""Script to check that the Windows 8 SDK has been appropriately patched so that
it can be used with VS 2010.
In practice, t... | bsd-3-clause |
yask123/scikit-learn | sklearn/linear_model/tests/test_least_angle.py | 98 | 20870 | from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.cross_validation import train_test_split
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing impor... | bsd-3-clause |
chrisndodge/edx-platform | common/lib/xmodule/xmodule/video_module/video_handlers.py | 108 | 14344 | """
Handlers for video module.
StudentViewHandlers are handlers for video module instance.
StudioViewHandlers are handlers for video descriptor instance.
"""
import json
import logging
from datetime import datetime
from webob import Response
from xblock.core import XBlock
from xmodule.exceptions import NotFoundErro... | agpl-3.0 |
codoo/vertical-community | __unreviewed__/project_marketplace/__openerp__.py | 4 | 1831 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron. Copyright Yannick Buron
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... | agpl-3.0 |
adityacs/ansible | lib/ansible/module_utils/f5_utils.py | 7 | 10346 | #
# Copyright 2016 F5 Networks 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.
#
# An... | gpl-3.0 |
IllusionRom-deprecated/android_platform_tools_idea | python/lib/Lib/grp.py | 110 | 2305 | """
Access to the Unix group database.
Group entries are reported as 4-tuples containing the following fields
from the group database, in order:
name - name of the group
passwd - group password (encrypted); often empty
gid - numeric ID of the group
mem - list of members
The gid is an integer, name an... | apache-2.0 |
density215/d215-miniblog | unidecode/x016.py | 252 | 4140 | data = (
'kka', # 0x00
'kk', # 0x01
'nu', # 0x02
'no', # 0x03
'ne', # 0x04
'nee', # 0x05
'ni', # 0x06
'na', # 0x07
'mu', # 0x08
'mo', # 0x09
'me', # 0x0a
'mee', # 0x0b
'mi', # 0x0c
'ma', # 0x0d
'yu', # 0x0e
'yo', # 0x0f
'ye', # 0x10
'yee', # 0x11
'yi', # 0x12
'ya... | bsd-3-clause |
joerocklin/gem5 | tests/configs/tsunami-o3-dual.py | 6 | 2273 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
blaggacao/OpenUpgrade | openerp/addons/test_impex/tests/test_export.py | 158 | 19124 | # -*- coding: utf-8 -*-
import itertools
import openerp.modules.registry
import openerp
from openerp.tests import common
class CreatorCase(common.TransactionCase):
model_name = False
def __init__(self, *args, **kwargs):
super(CreatorCase, self).__init__(*args, **kwargs)
self.model = None
... | agpl-3.0 |
linkedin/indextank-service | api/boto/pyami/scriptbase.py | 3 | 1429 | import os, sys, time, traceback
import smtplib
from boto.utils import ShellCommand, get_ts
import boto
import boto.utils
class ScriptBase:
def __init__(self, config_file=None):
self.instance_id = boto.config.get('Instance', 'instance-id', 'default')
self.name = self.__class__.__name__
self... | apache-2.0 |
sathnaga/virt-test | virttest/virt_vm.py | 1 | 42907 | import logging, time, glob, os, re
from autotest.client.shared import error
import utils_misc, utils_net, remote
class VMError(Exception):
pass
class VMCreateError(VMError):
def __init__(self, cmd, status, output):
VMError.__init__(self, cmd, status, output)
self.cmd = cmd
self.statu... | gpl-2.0 |
timthelion/FreeCAD | src/Mod/Ship/shipAreasCurve/__init__.py | 60 | 1809 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2016 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
edxnercel/edx-platform | lms/djangoapps/courseware/features/staff_debug_info.py | 173 | 1472 | """
Steps for staff_debug_info.feature lettuce tests
"""
from django.contrib.auth.models import User
from lettuce import world, step
from common import create_course, course_id
from courseware.courses import get_course_by_id
from instructor.access import allow_access
@step(u'i am staff member for the course "([^"]*)... | agpl-3.0 |
Alwnikrotikz/visvis | functions/meshWrite.py | 3 | 2154 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis as vv
def ssdfWrite(fname, mesh, name='', bin='unused'):
""" Simple function that writes a mesh to the ssdf file format.
... | bsd-3-clause |
joshloyal/scikit-learn | benchmarks/bench_plot_lasso_path.py | 84 | 4005 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
MarcJoan/django | django/http/__init__.py | 341 | 1103 | from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (
HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
)
from django.http.response import (
BadHeaderError, FileResponse, Http404, HttpResponse,
HttpResponseBadRequest, HttpResponseForbidden, HttpResponse... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.