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 |
|---|---|---|---|---|---|
rsunder10/PopularityBased-SearchEngine | lib/python3.4/site-packages/setuptools/command/bdist_egg.py | 306 | 17184 | """setuptools.command.bdist_egg
Build .egg distributions"""
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwrap
from pkg_resources import get_build_platform, Distri... | mit |
dancingdan/tensorflow | tensorflow/contrib/receptive_field/python/util/examples/csv_to_markdown_table.py | 36 | 2847 | # 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 |
cloudpbl-senrigan/combinator | tools/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py | 164 | 1699 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""
Make sure overwriting read-only files works as expected (via win-tool).
"""
import TestGyp
import filecmp
import os
import stat
import... | mit |
Jeongseob/xen-coboost-sched | tools/xm-test/lib/XmTestLib/Console.py | 37 | 9322 | #!/usr/bin/python
"""
XmConsole.py - Interact with a xen console, getting return codes and
output from commands executed there.
Copyright (C) International Business Machines Corp., 2005
Author: Dan Smith <danms@us.ibm.com>
This program is free software; you can redistribute it and/or modify
it un... | gpl-2.0 |
ftomassetti/intellij-community | python/lib/Lib/encodings/iso2022_jp_3.py | 816 | 1061 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
bcoca/ansible | lib/ansible/utils/galaxy.py | 38 | 3566 | # (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 |
sassoftware/anaconda | pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 | 36125 | # Datetime configuration spoke class
#
# 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 i... | gpl-2.0 |
hashworks/CouchPotatoServer | libs/pyasn1/type/constraint.py | 382 | 7279 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... | gpl-3.0 |
WoLpH/EventGhost | eg/Classes/MessageDialog.py | 1 | 3694 | # -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 versio... | gpl-2.0 |
xujun10110/golismero | thirdparty_libs/django/template/loader.py | 112 | 7927 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | gpl-2.0 |
vmindru/ansible | lib/ansible/modules/cloud/docker/docker_login.py | 4 | 10367 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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_func... | gpl-3.0 |
ATIX-AG/ansible | lib/ansible/modules/cloud/rackspace/rax_facts.py | 102 | 3923 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
matbu/ansible-modules-extras | cloud/profitbricks/profitbricks_nic.py | 11 | 8932 | #!/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 |
KAsante95/osf.io | scripts/migration/migrate_profile_dates.py | 64 | 4803 | """Changes existing profile education and employment dates from
YYYY-MM-DD formatted dates to "Month Year" format
Log:
Run on production by SL on 2014-10-14 at 19:11 EST. 269 users were migrated.
"""
import logging
from website.app import init_app
from website import models
from datetime import datetime
from tes... | apache-2.0 |
yamingd/argo | bootstrap/mapping.py | 2 | 3492 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
java_types = {
'int': 'Integer',
'tinyint': 'Integer',
'smallint': 'Integer',
'mediumint': 'Integer',
'bigint': 'Long',
'bit': 'Integer',
'float': 'Float',
'decimal': 'Double',
'double': 'Double',
'text': 'String',
'varchar': '... | apache-2.0 |
kfox1111/horizon | openstack_dashboard/dashboards/admin/volumes/volume_types/tests.py | 29 | 8693 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | apache-2.0 |
manfromnn/kernel-roamer2 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
vertigo235/Sick-Beard-XEM | lib/unidecode/x07e.py | 252 | 4682 | data = (
'Xia ', # 0x00
'Yuan ', # 0x01
'Zong ', # 0x02
'Xu ', # 0x03
'Nawa ', # 0x04
'Odoshi ', # 0x05
'Geng ', # 0x06
'Sen ', # 0x07
'Ying ', # 0x08
'Jin ', # 0x09
'Yi ', # 0x0a
'Zhui ', # 0x0b
'Ni ', # 0x0c
'Bang ', # 0x0d
'Gu ', # 0x0e
'Pan ', # 0x0f
'Zhou ', # 0x1... | gpl-3.0 |
brenton/openshift-ansible | roles/lib_openshift/library/oc_scale.py | 5 | 61968 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | apache-2.0 |
Polyconseil/django-pagination | setup.py | 3 | 2870 | #!/usr/bin/env python
# Copyright (c) 2008, Eric Florenzano
# Copyright (c) 2010, 2011 Linaro Limited
# 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 mus... | bsd-3-clause |
elky/django | tests/forms_tests/field_tests/test_decimalfield.py | 25 | 8938 | import decimal
from django.forms import DecimalField, NumberInput, ValidationError, Widget
from django.test import SimpleTestCase, override_settings
from django.utils import formats, translation
from . import FormFieldAssertionsMixin
class DecimalFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_de... | bsd-3-clause |
newerthcom/savagerebirth | libs/python-2.72/Stackless/test/test_pickle.py | 1 | 1069 | import sys, cPickle, pickle
from stackless import *
def run_pickled(func, *args):
t = tasklet(func)(*args)
print "starting tasklet"
t.run()
print "pickling"
# hack for pickle
if pickl == pickle:
t.tempval = None
pi = pickl.dumps(t)
t.remove()
#print pi
file("temp.pickl... | gpl-2.0 |
inovtec-solutions/OpenERP | openerp/addons/idea/idea.py | 53 | 3165 | # -*- 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 |
bdastur/pyvim | .vim/bundle/python-mode/pymode/libs3/rope/base/project.py | 28 | 11958 | import pickle
import os
import shutil
import sys
import warnings
import rope.base.fscommands
from rope.base import exceptions, taskhandle, prefs, history, pycore, utils
from rope.base.resourceobserver import *
from rope.base.resources import File, Folder, _ResourceMatcher
class _Project(object):
def __init__(se... | apache-2.0 |
felixma/nova | nova/tests/unit/api/openstack/compute/test_security_group_default_rules.py | 26 | 16223 | # Copyright 2013 Metacloud, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
dims/cinder | cinder/replication/api.py | 2 | 4219 | # 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 |
junhuac/MQUIC | depot_tools/ENV/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 22 | 1288 | import calendar
from email.utils import formatdate, parsedate
from datetime import datetime, timedelta
class BaseHeuristic(object):
def warning(self):
"""
Return a valid 1xx warning header value describing the cache adjustments.
"""
return '110 - "Response is Stale"'
def up... | mit |
maandree/rotd | src/xkcd.py | 1 | 2150 | # -*- python -*-
# See LICENSE file for copyright and license details.
def xkcd(index = None, abort_timer = 2):
'''
Get XKCD comic
@param index:int? The index comic, `None` for the last one
@param abort_timer:int The number of seconds to wait before giving up
@return :(index:int, i... | isc |
openstack/tempest-lib | tempest_lib/services/compute/quota_classes_client.py | 1 | 1880 | # Copyright 2012 NTT Data
# 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 |
PongPi/isl-odoo | addons/decimal_precision/decimal_precision.py | 233 | 3728 | # -*- encoding: 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 G... | agpl-3.0 |
surligas/gnuradio | docs/exploring-gnuradio/fm_demod.py | 53 | 3367 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... | gpl-3.0 |
Acurus/Kyrdalen | nvdb_graph/datakatalog_visJS.py | 1 | 3497 | import pnvdb
import logging
import json
def build_graph_from_nvdb(objekt_typer):
seen = []
black_list = [297, 446, 762, 507, 761, 294, 794]
node_data = [] # {"id": 50, "label": "Node 50"}
edge_data = [] # {"from": 50, "to": 3}
for objekt_type in objekt_typer:
objID = int(obj... | mit |
mantidproject/mantid | qt/python/mantidqt/plotting/test/test_figuretype.py | 3 | 2627 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py | 1 | 5537 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
Alecto3-D/testable-greeter | bb-master/sandbox/lib/python3.5/site-packages/automat/_test/test_trace.py | 6 | 3279 | from unittest import TestCase
from .._methodical import MethodicalMachine
class SampleObject(object):
mm = MethodicalMachine()
@mm.state(initial=True)
def begin(self):
"initial state"
@mm.state()
def middle(self):
"middle state"
@mm.state()
def end(self):
"end state... | mit |
Hrabal/TemPy | tests/test_css.py | 1 | 8530 | # -*- coding: utf-8 -*-
"""
@author: Federico Cerchiari <federicocerchiari@gmail.com>
"""
import os
import unittest
from copy import copy
from collections import Counter
from tempy import Css
from tempy.tags import A, Div
from tempy.exceptions import WrongContentError, AttrNotFoundError, WrongArgsError
class TestTag... | apache-2.0 |
mancoast/CPythonPyc_test | crash/279_test_re.py | 14 | 56159 | # -*- coding: utf-8 -*-
from test.test_support import verbose, run_unittest, import_module
from test.test_support import precisionbigmemtest, _2G, cpython_only
from test.test_support import captured_stdout, have_unicode, requires_unicode, u
import locale
import re
from re import Scanner
import sre_constants
import sys
... | gpl-3.0 |
fnz/googletest | scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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 |
krafczyk/spack | var/spack/repos/builtin/packages/py-pyqi/package.py | 2 | 1728 | ##############################################################################
# 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 |
devendermishrajio/nova | nova/api/openstack/compute/legacy_v2/contrib/migrations.py | 52 | 2491 | # 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 |
mixturemodel-flow/tensorflow | tensorflow/compiler/tests/lstm_test.py | 130 | 12982 | # 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 |
sachinkum/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/requests/structures.py | 615 | 3012 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
from .compat import OrderedDict
class CaseInsensitiveDict(collections.MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
`... | gpl-3.0 |
croneter/PlexKodiConnect | resources/lib/library_sync/fanart.py | 2 | 5858 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
from logging import getLogger
from ..plex_api import API
from ..plex_db import PlexDB
from ..kodi_db import KodiVideoDB
from .. import backgroundthread, utils
from .. import itemtypes, plex_functions as PF, variables as v, app
... | gpl-2.0 |
tlakshman26/cinder-https-changes | cinder/volume/drivers/hitachi/hbsd_fc.py | 20 | 20078 | # Copyright (C) 2014, Hitachi, Ltd.
#
# 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 |
TheCentralLimit/TopSecret | src/classifier.py | 1 | 4248 | """
"""
from __future__ import division, print_function
import numpy as np
from matplotlib import pyplot as plt
from sklearn.svm import LinearSVC
from sklearn import grid_search
from astroML.utils import completeness_contamination
from os import path
import gw
def classifier(m_1, m_2, M_c, s,
ax_pd... | mit |
zrzka/blackmamba | blackmamba/lib/flake8/utils.py | 6 | 11267 | """Utility methods for flake8."""
import collections
import fnmatch as _fnmatch
import inspect
import io
import os
import platform
import re
import sys
import tokenize
DIFF_HUNK_REGEXP = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$')
COMMA_SEPARATED_LIST_RE = re.compile(r'[,\s]')
LOCAL_PLUGIN_LIST_RE = re.c... | mit |
yashu-seth/networkx | networkx/algorithms/bipartite/tests/test_generators.py | 13 | 7227 | #!/usr/bin/env python
from nose.tools import *
from networkx import *
from networkx.algorithms.bipartite.generators import *
"""Generators - Bipartite
----------------------
"""
class TestGeneratorsBipartite():
def test_complete_bipartite_graph(self):
G=complete_bipartite_graph(0,0)
assert_true(i... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/resources/lib/plugins/unidecode/x1d4.py | 248 | 3839 | data = (
'A', # 0x00
'B', # 0x01
'C', # 0x02
'D', # 0x03
'E', # 0x04
'F', # 0x05
'G', # 0x06
'H', # 0x07
'I', # 0x08
'J', # 0x09
'K', # 0x0a
'L', # 0x0b
'M', # 0x0c
'N', # 0x0d
'O', # 0x0e
'P', # 0x0f
'Q', # 0x10
'R', # 0x11
'S', # 0x12
'T', # 0x13
'U', # 0... | gpl-2.0 |
NMGRL/pychron | pychron/hardware/valve.py | 2 | 3032 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | apache-2.0 |
ramcn/demo3 | venv/lib/python3.4/site-packages/django/contrib/gis/geoip/libgeoip.py | 106 | 1081 | import os
from ctypes import CDLL
from ctypes.util import find_library
from django.conf import settings
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETTINGS = {key: getattr(settings, key)
for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY')
... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/scons-2.1.0/SCons/Tool/g77.py | 21 | 2492 | """engine.SCons.Tool.g77
Tool-specific initialization for g77.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Fou... | gpl-2.0 |
EBI-Metagenomics/emgapi | emgcli/middleware.py | 1 | 1765 | import logging
from django.conf import settings
from django.middleware.common import BrokenLinkEmailsMiddleware
from django.utils.encoding import force_text
logger = logging.getLogger(__name__)
try:
from django_slack import slack_message
except ImportError:
logger.error("Cannot resolve 'django_slack.log.Sla... | apache-2.0 |
kupferlauncher/kupfer | oldplugins/zim.py | 2 | 12834 | # -*- coding: UTF-8 -*-
__kupfer_name__ = _("Zim")
__kupfer_sources__ = ("ZimPagesSource", )
__kupfer_actions__ = (
"CreateZimPage",
"CreateZimPageInNotebook",
"CreateZimQuickNote",
)
__description__ = _("Access to Pages stored in Zim - "
"A Desktop Wiki and Outliner")
... | gpl-3.0 |
sekikn/incubator-airflow | tests/providers/google/cloud/operators/test_mlengine_utils.py | 6 | 8532 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
Arundhatii/erpnext | erpnext/support/doctype/issue/issue.py | 14 | 3333 | # 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 json
from frappe import _
from frappe.model.document import Document
from frappe.utils import now
from frappe.utils.user import is... | gpl-3.0 |
robmagee/django-cms | menus/base.py | 47 | 1651 | # -*- coding: utf-8 -*-
from django.utils.encoding import smart_str
class Menu(object):
namespace = None
def __init__(self):
if not self.namespace:
self.namespace = self.__class__.__name__
def get_nodes(self, request):
"""
should return a list of NavigationNode instan... | bsd-3-clause |
willm/DDEXUI | file_parser.py | 1 | 1314 | from DDEXUI.ddex.file_metadata import *
from mutagenx.mp3 import MP3
from PIL import Image
import hashlib
import os
class FileParser():
def parse(self, file_path):
hash = self.__get_hash(file_path)
path = os.path.split(file_path)[1]
extension = self.get_extension(file_path)
if(ext... | gpl-2.0 |
Maximilian-Reuter/SickRage | lib/rtorrent/file.py | 174 | 3566 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
Carreau/readthedocs.org | readthedocs/core/migrations/0003_create_user_profiles.py | 20 | 4354 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
users_without_profiles = orm['auth.User'].objects.filter(profile=None)
... | mit |
neiudemo1/django | django/core/checks/model_checks.py | 525 | 2390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
for model in apps.get_models():
if app_co... | bsd-3-clause |
tanghaibao/jcvi | jcvi/apps/cdhit.py | 1 | 7279 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Using CD-HIT to remove duplicate reads.
"""
import os.path as op
import sys
import logging
from collections import defaultdict
from jcvi.formats.base import LineFile, read_block, must_open
from jcvi.formats.fastq import fasta
from jcvi.utils.cbook import percentage
f... | bsd-2-clause |
jamesbeebop/CouchPotatoServer | libs/subliminal/services/tvsubtitles.py | 106 | 6240 | # -*- coding: utf-8 -*-
# Copyright 2012 Nicolas Wack <wackou@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 of the Licen... | gpl-3.0 |
Dev-Engine/PDFMiner | pdfminer/runserver.py | 1 | 5234 | """."""
import os
import time
import urllib
import json
import xmltodict
from flask import (Flask, request, session, redirect, url_for,
render_template, flash, make_response)
from werkzeug.utils import secure_filename
from werkzeug.security import generate_password_hash, check_password_hash
from mo... | mit |
zhreshold/mxnet | python/mxnet/gluon/data/sampler.py | 6 | 5006 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
robocoreio/edison-kernel | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
qrsforever/workspace | python/learn/base/class/callable.py | 1 | 1237 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
class MyClass(object):
"""Docstring for MyClass. """
def __init__(self):
"""TODO: to be defined1. """
def __call__(self):
print("__call__ called")
pass
def __getattr__(self, method):
print("call", method)
return lam... | mit |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py | 121 | 3076 | # Copyright (c) 2009 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 |
jazzTheJackRabbit/blog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/other.py | 197 | 170951 | # -*- coding: utf-8 -*-
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
thi... | mit |
tvansteenburgh/PerfKitBenchmarker | perfkitbenchmarker/benchmarks/cassandra_stress_benchmark.py | 6 | 10759 | # Copyright 2014 Google 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 by applicable law or agr... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_2/django/utils/cache.py | 44 | 9146 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | mit |
a40223217/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | 55779 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | gpl-3.0 |
Cojacfar/Maker | comm/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/test_forms.py | 111 | 8973 | from __future__ import unicode_literals
from django import forms, http
from django.conf import settings
from django.db import models
from django.test import TestCase
from django.template.response import TemplateResponse
from django.utils.importlib import import_module
from django.contrib.auth.models import User
from... | gpl-2.0 |
ar4s/django | django/core/paginator.py | 141 | 5021 | import collections
from math import ceil
from django.utils import six
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0,
allow_empty_first... | bsd-3-clause |
KokareIITP/django | django/contrib/staticfiles/handlers.py | 581 | 2328 | from django.conf import settings
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
from django.core.handlers.wsgi import WSGIHandler, get_path_info
from django.utils.six.moves.urllib.parse import urlparse
from django.utils.six.moves.urllib.request import url2pathname
clas... | bsd-3-clause |
sumanthha/kannadaflix | django/contrib/formtools/tests/wizard/wizardtests/tests.py | 78 | 15534 | from __future__ import with_statement
import os
from django import forms
from django.test import TestCase
from django.test.client import RequestFactory
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.formtools.wizard.views import CookieWizardView
from django.contrib.for... | bsd-3-clause |
mfherbst/spack | var/spack/repos/builtin/packages/r-aneufinderdata/package.py | 2 | 1666 | ##############################################################################
# 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 |
yourcelf/btb | scanblog/btb/tests/live/account_tests.py | 2 | 4048 | from .base import BtbLiveServerTestCase, NoSuchElementException
from django.contrib.auth.models import User
from profiles.models import Organization
from scanning.models import Document
from comments.models import Comment
class TestAccounts(BtbLiveServerTestCase):
def test_sign_in(self):
self.sign_in("tes... | agpl-3.0 |
citrix-openstack-build/ironic | ironic/db/sqlalchemy/migrate_repo/versions/005_drop_deploy_driver.py | 1 | 1151 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
#... | apache-2.0 |
jewettaij/moltemplate | moltemplate/postprocess_coeffs.py | 1 | 13429 | #!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# License: MIT License (See LICENSE.md)
# Copyright (c) 2017, California Institute of Technology
# All rights reserved.
man_page_text = """
Usage (example):
postprocess_coeffs.py ttree_assignments.txt < file.template > file_new.template
Moltempla... | mit |
redhataccess/rhi-pool | insights/ui/browser.py | 1 | 2639 | import logging
from insights.configs import settings
from selenium import webdriver
LOGGER = logging.getLogger(__name__)
class NotSupportedBrowser(Exception):
"""
Raise this exception if browser passed is not supported
Supported browser are : firefox, chrome
"""
#class Firefox(webdriver.Firefox)... | gpl-3.0 |
Turbo87/skylines | skylines/schemas/fields.py | 3 | 1545 | from marshmallow import ValidationError
from marshmallow.fields import * # NOQA
from marshmallow.fields import Field
from marshmallow.fields import String as _String
from geoalchemy2.shape import to_shape
from shapely.geometry import Polygon, Point
class String(_String):
def __init__(self, strip=False, *args, *... | agpl-3.0 |
CMPUT410W15T02/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/contrib/staticfiles/views.py | 78 | 1302 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.http import Http404
from django.utils.six.moves.urllib.parse import unquote
from django.views impo... | gpl-2.0 |
quintusdias/glymur | tests/test_callbacks.py | 1 | 2140 | """
Test suite for openjpeg's callback functions.
"""
# Standard library imports ...
from io import StringIO
import warnings
import unittest
from unittest.mock import patch
# Local imports ...
import glymur
from . import fixtures
@unittest.skipIf(fixtures.OPENJPEG_NOT_AVAILABLE,
fixtures.OPENJPEG_NO... | mit |
sqlalchemy/sqlalchemy | test/sql/test_update.py | 3 | 50403 | import itertools
import random
from sqlalchemy import bindparam
from sqlalchemy import column
from sqlalchemy import exc
from sqlalchemy import exists
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy import MetaData
from sqlalch... | mit |
Vrturo/FrontEndLabz | techTutorials/webpack/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # 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
class Writer(object):
"""Visual Studio XML tool file writer."""
... | mit |
natanielruiz/android-yolo | jni-build/jni/include/tensorflow/contrib/opt/python/training/external_optimizer_test.py | 15 | 5484 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
guewen/OpenUpgrade | addons/crm/crm_lead.py | 21 | 52859 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
amith01994/intellij-community | python/lib/Lib/glob.py | 92 | 2010 | """Filename globbing utility."""
import os
import fnmatch
import re
__all__ = ["glob", "iglob"]
def glob(pathname):
"""Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la fnmatch.
"""
return list(iglob(pathname))
def iglob(pathname):
""... | apache-2.0 |
Manishearth/servo | tests/wpt/harness/wptrunner/wptlogging.py | 57 | 3870 | # 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 logging
import sys
import threading
from StringIO import StringIO
from multiprocessing import Queue
from mozlog ... | mpl-2.0 |
drptbl/king-phisher | tests/client/application.py | 1 | 2313 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/application.py
#
# 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... | bsd-3-clause |
pataquets/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py | 123 | 7067 | # Copyright (c) 2010, 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 |
spadae22/odoo | openerp/addons/base/tests/test_views.py | 24 | 40700 | # -*- encoding: utf-8 -*-
from functools import partial
import itertools
import unittest2
from lxml import etree as ET
from lxml.builder import E
from psycopg2 import IntegrityError
from openerp.osv.orm import modifiers_tests
from openerp.exceptions import ValidationError
from openerp.tests import common
import ope... | agpl-3.0 |
ralph-mikera/RouteFlow-1 | pox/pox/lib/recoco/examples.py | 26 | 2758 | # Copyright 2011 Colin Scott
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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 lat... | apache-2.0 |
psawaya/Mental-Ginger | django/contrib/contenttypes/models.py | 307 | 4052 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... | bsd-3-clause |
ogajduse/spacewalk | backend/cdn_tools/candlepin_api.py | 8 | 8030 | # Copyright (c) 2017 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of G... | gpl-2.0 |
wumch/shadowsocks | utils/autoban.py | 1033 | 2156 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | apache-2.0 |
zubair-arbi/edx-platform | common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py | 14 | 15286 | """
Tests for the wrapping layer that provides the XBlock API using XModule/Descriptor
functionality
"""
# For tests, ignore access to protected members
# pylint: disable=protected-access
import webob
import ddt
from factory import (
BUILD_STRATEGY,
Factory,
lazy_attribute,
LazyAttributeSequence,
p... | agpl-3.0 |
nikhilprathapani/python-for-android | python-modules/twisted/twisted/python/_inotify.py | 57 | 2830 | # -*- test-case-name: twisted.internet.test.test_inotify -*-
# Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Very low-level ctypes-based interface to Linux inotify(7).
ctypes and a version of libc which supports inotify system calls are
required.
"""
import ctypes
import ctypes.util
... | apache-2.0 |
ojii/readthedocs.org | readthedocs/builds/models.py | 1 | 6173 | from django.db import models
from django.utils.translation import ugettext_lazy as _, ugettext
from guardian.shortcuts import assign, get_objects_for_user
from projects.models import Project
from projects import constants
from .constants import BUILD_STATE, BUILD_TYPES
class VersionManager(models.Manager):
def ... | mit |
prakritish/ansible | lib/ansible/parsing/vault/__init__.py | 2 | 28207 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
# (c) 2016, Adrian Likins <alikins@redhat.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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, eit... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.