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 |
|---|---|---|---|---|---|
rubencabrera/odoo | openerp/tools/yaml_tag.py | 337 | 6256 | import yaml
import logging
class YamlTag(object):
"""
Superclass for constructors of custom tags defined in yaml file.
__str__ is overriden in subclass and used for serialization in module recorder.
"""
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __getitem__(self, key... | agpl-3.0 |
mdavidsaver/spicetools | spicetools/view/mainwin_ui.py | 1 | 8609 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'spicetools/view/mainwin.ui'
#
# Created: Sun Apr 27 13:13:01 2014
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... | gpl-3.0 |
sbalde/edxplatform | common/djangoapps/student/tests/test_login.py | 23 | 25132 | '''
Tests for student activation and login
'''
import json
import unittest
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.... | agpl-3.0 |
sbalde/edxplatform | common/djangoapps/student/admin.py | 2 | 6139 | """ Django admin pages for student app """
from django import forms
from django.contrib.auth.models import User
from ratelimitbackend import admin
from xmodule.modulestore.django import modulestore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from config_models.admin import Config... | agpl-3.0 |
ghtdak/GitPython | git/refs/reference.py | 13 | 4389 | from git.util import (
LazyMixin,
Iterable,
)
from .symbolic import SymbolicReference
__all__ = ["Reference"]
#{ Utilities
def require_remote_ref_path(func):
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
def wrapper(self, *args):
if not self.is_remot... | bsd-3-clause |
codepantry/django | django/db/backends/sqlite3/base.py | 323 | 18115 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
palashahuja/pgmpy | pgmpy/factors/CPD.py | 2 | 30662 | #!/usr/bin/env python3
"""Contains the different formats of CPDs used in PGM"""
from itertools import product
import networkx as nx
import numpy as np
from pgmpy import exceptions
from pgmpy.factors import Factor
from pgmpy.extern import tabulate
class TabularCPD(Factor):
"""
Defines the conditional probab... | mit |
leb2dg/osf.io | addons/osfstorage/apps.py | 12 | 1910 | from addons.base.apps import BaseAddonAppConfig
from website import settings
from website.util import rubeus
from addons.osfstorage import settings as addon_settings
# Ensure blinker signal listeners are connected
import addons.osfstorage.listeners # noqa
# This is defined here to avoid `AppRegistryNotReady: Apps ar... | apache-2.0 |
m2candre/ansible-modules-extras | notification/sns.py | 61 | 5715 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Michael J. Schultz <mjschultz@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 ... | gpl-3.0 |
Igalia/skia | tools/jsondiff.py | 67 | 7458 | #!/usr/bin/python
'''
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Gathers diffs between 2 JSON expectations files, or between actual and
expected results within a single JSON actual-results file,
and generates an old-vs-new diff... | bsd-3-clause |
hronoses/vispy | vispy/visuals/line/vertex.py | 2 | 7917 | VERTEX_SHADER = """
const float PI = 3.14159265358979323846264;
const float THETA = 15.0 * 3.14159265358979323846264/180.0;
// Cross product of v1 and v2
float cross(in vec2 v1, in vec2 v2) {
return v1.x*v2.y - v1.y*v2.x;
}
// Returns distance of v3 to line v1-v2
float signed_distance(in vec2 v1, in vec2 v2, in v... | bsd-3-clause |
cshallue/models | research/slim/nets/inception.py | 45 | 1676 | # 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 applicable ... | apache-2.0 |
davekennewell/geonode | geonode/catalogue/urls.py | 21 | 1121 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
gauravbose/digital-menu | digimenu2/build/lib.linux-x86_64-2.7/django/test/testcases.py | 36 | 53176 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from copy import copy
from functools import wraps
from unittest import skipIf # NOQA: Imported ... | bsd-3-clause |
kvar/ansible | lib/ansible/modules/windows/win_domain.py | 40 | 4035 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | gpl-3.0 |
mgit-at/ansible | test/units/modules/network/f5/test_bigip_firewall_dos_vector.py | 21 | 3327 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
SVoxel/R7800 | git_home/samba.git/python/examples/netbios.py | 66 | 1049 | #!/usr/bin/env python
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... | gpl-2.0 |
Jumpscale/jumpscale_portal8 | apps/portalbase/macros/page/action/3_action.py | 1 | 1083 | def main(j, args, params, tags, tasklet):
page = args.page
data = {'action': args.getTag('id'),
'class': args.getTag('class') or '',
'deleterow': args.getTag('deleterow') or 'false',
'label': args.getTag('label') or '',
}
extradata = {}
tags = j.data.tags... | apache-2.0 |
volnrok/sortable-challenge | main.py | 1 | 3683 | import json
import random
import re
from check import check_match
from encoder import Encoder
from listing import Listing
from product import Product
# We'll sort products by manufacturer first
man_lookup = {}
# List of common manufacturer aliases
aliases = {
'agfaphoto': 'agfa',
'fuji': 'fujifilm',
'hew... | mit |
emonty/deb-vhd-util | tools/python/xen/remus/save.py | 27 | 5580 | #!/usr/bin/env python
import os, select, socket, threading, time, signal, xmlrpclib
from xen.xend.XendClient import server
from xen.xend.xenstore.xswatch import xswatch
import xen.lowlevel.xc
from xen.xend.xenstore import xsutil
xc = xen.lowlevel.xc.xc()
import xen.lowlevel.checkpoint
import vm, image
XCFLAGS_LIV... | gpl-2.0 |
isyippee/nova | nova/api/ec2/cloud.py | 17 | 86865 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
yanchen036/tensorflow | tensorflow/contrib/learn/python/learn/estimators/multioutput_test.py | 136 | 1696 | # 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 |
fernandezcuesta/ansible | lib/ansible/modules/network/f5/bigip_device_ntp.py | 78 | 7567 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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
# ... | gpl-3.0 |
ExCiteS/geokey-wegovnow | geokey_wegovnow/tests/test_commands.py | 1 | 7233 | """Test all commands."""
import sys
from StringIO import StringIO
from django.conf import settings
from django.test import TestCase
from django.core import management
from django.contrib.sites.shortcuts import get_current_site
from allauth.socialaccount import providers
from allauth.socialaccount.models import Soci... | mit |
pombredanne/http-repo.gem5.org-gem5- | ext/ply/test/yacc_inf.py | 174 | 1278 | # -----------------------------------------------------------------------------
# yacc_inf.py
#
# Infinite recursion
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# Parsing... | bsd-3-clause |
kasioumis/invenio | invenio/modules/authorprofiles/views.py | 8 | 1064 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio 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... | gpl-2.0 |
Jorgesolis1989/SIVORE | corporaciones/views.py | 1 | 11935 | from django.shortcuts import render_to_response
from django.shortcuts import render ,redirect
from django.template.context import RequestContext
from corporaciones.models import Corporacion , Sede
from django.contrib.auth.decorators import permission_required
from corporaciones.forms import FormularioRegistroCorporacio... | apache-2.0 |
vmora/QGIS | tests/src/python/test_qgsfieldvalidator.py | 11 | 5208 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsFieldValidator.
.. 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""... | gpl-2.0 |
I-A-I/authorensics | app.py | 2 | 2582 | from flask import Flask,render_template,request
import scap
import vea
from profile import Profile
import re
app = Flask(__name__)
MIN_CHARACTERS = 140
@app.route("/about", methods=["GET"])
def about():
return render_template("about.html")
@app.route("/", methods=["GET","POST"])
def index():
if request.meth... | mit |
teamCarel/EyeTracker | src/shared_modules/calibration_routines/finish_calibration.py | 1 | 17482 | '''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2017 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
-----------------------------------... | lgpl-3.0 |
tumbl3w33d/ansible | lib/ansible/modules/cloud/smartos/nictagadm.py | 24 | 6162 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Bruce Smith <Bruce.Smith.IT@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_vers... | gpl-3.0 |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 360 | 11622 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
IS_PYOPENSSL = F... | gpl-3.0 |
brachyprint/brachyprint | src/mesh/__init__.py | 1 | 1496 | # Brachyprint -- 3D printing brachytherapy moulds
# Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge
#
# 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 ver... | gpl-2.0 |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | bsd-3-clause |
steynovich/ansible-modules-extras | remote_management/ipmi/ipmi_power.py | 38 | 3879 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 |
eshijia/magnum | magnum/api/controllers/v1/replicationcontroller.py | 7 | 14010 | # Copyright 2015 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 |
nfqsolutions/pylm | tests/test_services/test_subscribed_client.py | 1 | 2736 | import concurrent.futures
import time
from concurrent.futures import ThreadPoolExecutor
import zmq
from pylm.clients import Client
from pylm.parts.core import zmq_context
from pylm.parts.messages_pb2 import PalmMessage
def fake_server(messages=1):
db_socket = zmq_context.socket(zmq.REP)
db_socket.bind('inpr... | agpl-3.0 |
jymannob/CouchPotatoServer | libs/pyutil/zlibutil.py | 106 | 15919 | # Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
Making your zlib experience that much nicer!
Most importantly, this offers protection from "zlib bomb" attacks, where the
original data was maximally compressable, and a naive use of zlib would
cons... | gpl-3.0 |
somcom3x/android_kernel_motorola_msm8226-common | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
djeo94/CouchPotatoServer | libs/CodernityDB/database_super_thread_safe.py | 81 | 3903 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... | gpl-3.0 |
endolith/pyeq2 | UnitTests/Test_ModelSolveMethods.py | 3 | 3825 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import sys, os, unittest
# the pyeq2 directory is located up one level from here
if -1 != sys.path[0].find('pyeq2-master'):raise Exception('Please rename git checkout directory from "pyeq2-master" to "... | bsd-2-clause |
aidanlister/django | django/contrib/contenttypes/forms.py | 376 | 3849 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic... | bsd-3-clause |
loveshell/volatility | volatility/plugins/modscan.py | 8 | 6122 | # Volatility
# Copyright (C) 2008-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
doomsterinc/odoo | addons/account/wizard/account_fiscalyear_close.py | 222 | 15660 | # -*- 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 |
dotpmrcunha/gnuradio | gr-filter/python/filter/gui/bandgraphicsview.py | 58 | 1099 | # Copyright 2012 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)
# any later version.
#
# G... | gpl-3.0 |
jhseu/tensorflow | tensorflow/python/kernel_tests/distributions/student_t_test.py | 13 | 19400 | # 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 |
rbarlow/pulp | server/pulp/plugins/types/database.py | 7 | 11160 | """
Responsible for the storage and retrieval of content types in the database.
This module covers both the ContentType collection itself as well as any
type-specific collections that exist to suit the type needs.
"""
import logging
from pymongo import ASCENDING
from pulp.server.db import connection
from pulp.server... | gpl-2.0 |
abramhindle/marsyas-fork | scripts/createMarSystem.py | 3 | 2266 | #!/usr/bin/env python
'''
Script to generate skeleton files for a new MarSystem.
Usage:
createMarSystem.py NameOfNewMarSystem
This will create the files NameOfNewMarSystem.h and NameOfNewMarSystem.cpp
if the current directory.
'''
import os
import sys
def create_from_template(template_file, template_name, tar... | gpl-2.0 |
pwnbus/scoring_engine | scoring_engine/config_loader.py | 1 | 2625 | import configparser
import os
class ConfigLoader(object):
def __init__(self, location="../engine.conf"):
config_location = os.path.join(os.path.dirname(os.path.abspath(__file__)), location)
self.parser = configparser.ConfigParser()
self.parser.read(config_location)
self.debug = ... | mit |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/fabric/tasks.py | 9 | 15409 | from __future__ import with_statement
from functools import wraps
import inspect
import sys
import textwrap
from fabric import state
from fabric.utils import abort, warn, error
from fabric.network import to_dict, normalize_to_string, disconnect_all
from fabric.context_managers import settings
from fabric.job_queue im... | apache-2.0 |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/magic/tools/sesame.py | 1 | 3792 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
pyspeckit/pyspeckit | pyspeckit/spectrum/readers/read_class.py | 4 | 70673 | """
------------------------
GILDAS CLASS file reader
------------------------
Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock`
"""
from __future__ import print_function
from six.moves import xrange
from six import iteritems
import six
import astropy.io.fits as pyfits
import numpy
import numpy as np
from... | mit |
c0deh4xor/theharvester | theHarvester.py | 8 | 10680 | #!/usr/bin/env python
import string
import httplib, sys
from socket import *
import re
import getopt
from discovery import *
from lib import htmlExport
from lib import hostchecker
print "\n*******************************************************************"
print "* ... | gpl-2.0 |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/Crypto/PublicKey/RSA.py | 228 | 6974 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... | gpl-3.0 |
zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/settings/dashboard.py | 88 | 1074 | # Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, 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
#
# Unle... | apache-2.0 |
mrkipling/maraschino | lib/jinja2/environment.py | 111 | 44067 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... | mit |
rvalyi/OpenUpgrade | addons/hr_payroll/hr_payroll.py | 32 | 50506 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
containers-ftw/cftw | cftw/utils.py | 1 | 8502 | '''
utils.py: part of cftw package
Copyright (c) 2017 Vanessa Sochat
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, mod... | mit |
Mariaanisimova/pythonintask | IVTp/2014/Grigoriev_A_O/task_4_2.py | 2 | 1462 | #Задача 4. Вариант 2.
#Напишите программу, которая выводит имя, под которым скрывается Михаил Евграфович Салтыков. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти). Для хранения все... | apache-2.0 |
swiftstack/swift | swift/common/middleware/s3api/controllers/obj.py | 3 | 9117 | # Copyright (c) 2010-2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
odooindia/odoo | addons/product/wizard/product_price.py | 380 | 2254 | # -*- 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 |
ENCODE-DCC/chip-seq-pipeline | dnanexus/encode_map/src/encode_map.py | 2 | 16523 | #!/usr/bin/env python2
# ENCODE_map 0.0.1
import os
import subprocess
import shlex
import re
from multiprocessing import cpu_count
import dxpy
import common
import logging
logger = logging.getLogger(__name__)
logger.addHandler(dxpy.DXLogHandler())
logger.propagate = False
logger.setLevel(logging.INFO)
BWA_PATH = {
... | mit |
TheKang/kernel_lge_hammerhead | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
pepincho/playground | python/Learn-Python-The-Hard-Way/exercises11to20.py | 1 | 2190 | # exercise 11
name = input("What's your name? ") # take the name from the keyboard
print ("Your name is {}".format(name))
# exercise 15
file_again = input("Type the filename again: > ") # read the file's name from the keyboard
txt_again = open(file_again) # open the file
print (txt_again.read()) # print the file's co... | mit |
evandavid/dodolipet | yowsup/layers/protocol_iq/layer.py | 43 | 3799 | import time
import logging
from threading import Thread, Lock
from yowsup.layers import YowProtocolLayer, YowLayerEvent
from yowsup.common import YowConstants
from yowsup.layers.network import YowNetworkLayer
from yowsup.layers.auth import YowAuthenticationProtocolLayer
from .protocolentities import *
class YowIqProt... | gpl-3.0 |
ravi-sharma/python-api-library | src/kayako/tests/object/test_user.py | 4 | 11277 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2011, Evan Leis
#
# Distributed under the terms of the Lesser GNU General Public License (LGPL)
#-----------------------------------------------------------------------------
'''
Created on May 9, 2011... | bsd-2-clause |
Bysmyyr/chromium-crosswalk | tools/cr/cr/base/context.py | 103 | 6668 | # 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.
"""Application context management for the cr tool.
Contains all the support code to enable the shared context used by the cr tool.
This includes the configu... | bsd-3-clause |
0k/OpenUpgrade | openerp/osv/query.py | 380 | 7513 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
happyleavesaoc/home-assistant | homeassistant/components/device_tracker/linksys_ap.py | 5 | 3378 | """
Support for Linksys Access Points.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.linksys_ap/
"""
import base64
import logging
import threading
from datetime import timedelta
import requests
import voluptuous as vol
import homeassist... | apache-2.0 |
cloakedcode/CouchPotatoServer | couchpotato/core/notifications/growl/__init__.py | 16 | 1246 | from .main import Growl
def start():
return Growl()
config = [{
'name': 'growl',
'groups': [
{
'tab': 'notifications',
'list': 'notification_providers',
'name': 'growl',
'description': 'Version 1.4+',
'options': [
{
... | gpl-3.0 |
cchurch/ansible | lib/ansible/modules/network/ios/ios_ntp.py | 24 | 8785 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = '''
---
module: ios_ntp
e... | gpl-3.0 |
idem2lyon/persomov | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/sexykarma.py | 20 | 4313 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
parse_duration,
int_or_none,
)
class SexyKarmaIE(InfoExtractor):
IE_DESC = 'Sexy Karma and Watch Indian Porn'
_VALID_URL = r'https?://(?:www\.)?(?:sexykarma\... | gpl-3.0 |
zeroSteiner/king-phisher | tests/plugins.py | 4 | 2944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/sms.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 list of condit... | bsd-3-clause |
Shrhawk/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_mongo_call_count.py | 91 | 7866 | """
Tests to verify correct number of MongoDB calls during course import/export and traversal
when using the Split modulestore.
"""
from tempfile import mkdtemp
from shutil import rmtree
from unittest import TestCase, skip
import ddt
from xmodule.modulestore.xml_importer import import_course_from_xml
from xmodule.mod... | agpl-3.0 |
bfontaine/Teebr | teebr/features.py | 1 | 6724 | # -*- coding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals
import re
from json import dumps
from collections import defaultdict
from .log import mkLogger
from .text.utils import contains_emoji, extract_named_entities
from .text.utils import most_common_words
from .text.spam import is_spam
logg... | mit |
jabez007/Training_Helpyr | Setup/__init__.py | 1 | 7646 | import re
import os
APP_PATH = os.path.join(*os.path.split(os.path.dirname(os.path.realpath(__file__)))[:-1])
import sys
if APP_PATH not in sys.path:
sys.path.append(APP_PATH)
import MyTrack
import PowerShell
import Phonebook
import Overlord
import Log
LOGGER = Log.MyLog(name=__name__)
# # # #
"""
Special setup ... | mit |
aricaldeira/PySPED | pysped/cte/webservices_flags.py | 1 | 2161 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | lgpl-2.1 |
eliasdesousa/indico | indico/modules/rb/views/user/reservations.py | 2 | 9134 | # 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 |
fduraffourg/servo | tests/wpt/web-platform-tests/old-tests/webdriver/modal/alerts_test.py | 141 | 6347 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
from selenium.webdriver.support import wait
class AlertsTest(base_test.WebDriverBaseTest):
def setUp(self):
self.wait = wait.WebDriverWait(self.... | mpl-2.0 |
ruizeng/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/hooks.py | 101 | 11762 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
foliverkodi/repository.foliver | plugin.video.adultsonly/resources/lib/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
chouseknecht/ansible | test/units/modules/network/fortios/test_fortios_router_ripng.py | 21 | 7215 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
trishnaguha/ansible | test/units/modules/network/netvisor/test_pn_igmp_snooping.py | 14 | 2606 | # Copyright: (c) 2018, Pluribus Networks
# 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
import json
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn... | gpl-3.0 |
erickt/hue | desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/converters.py | 76 | 5312 | """MySQLdb type conversion module
This module handles all the type conversions for MySQL. If the default
type conversions aren't what you need, you can make your own. The
dictionary conversions maps some kind of type to a conversion function
which returns the corresponding value:
Key: FIELD_TYPE.* (from MySQLd... | apache-2.0 |
youdonghai/intellij-community | python/lib/Lib/site-packages/django/template/debug.py | 232 | 3797 | from django.conf import settings
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
cl... | apache-2.0 |
XTAv2/Enigma2 | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 26 | 37470 | import os
from time import strftime
from enigma import iPlayableService, eTimer, eServiceCenter, iServiceInformation, ePicLoad
from ServiceReference import ServiceReference
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Screens.InputBox impor... | gpl-2.0 |
mcus/SickRage | lib/sqlalchemy/util/deprecations.py | 79 | 4419 | # util/deprecations.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
"""Helpers related to deprecation of functions, methods, classes, other
functiona... | gpl-3.0 |
jjmachan/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/contrib/gis/geoip/libgeoip.py | 479 | 1075 | 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 |
dcroc16/skunk_works | google_appengine/lib/django-1.3/django/template/loaders/eggs.py | 229 | 1432 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.conf import settings
class Loa... | mit |
mfherbst/spack | lib/spack/spack/dependency.py | 3 | 5186 | ##############################################################################
# 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 |
sunoru/pokemon_only | stall/migrations/0001_initial.py | 1 | 6359 | # Generated by Django 2.2.2 on 2019-06-04 21:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | gpl-2.0 |
mcardillo55/django | tests/auth_tests/test_validators.py | 229 | 7546 | from __future__ import unicode_literals
import os
from django.contrib.auth.models import User
from django.contrib.auth.password_validation import (
CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator,
UserAttributeSimilarityValidator, get_default_password_validators,
get_password_val... | bsd-3-clause |
meraki-analytics/cassiopeia | cassiopeia/cassiopeia.py | 1 | 6069 | from typing import List, Set, Dict, Union, TextIO
import arrow
import datetime
from .data import Region, Queue, Season, Tier, Division, Position
from .core import Champion, Summoner, ChampionMastery, Rune, Item, Match, Map, SummonerSpell, Realms, ProfileIcon, LanguageStrings, CurrentMatch, ShardStatus, Versions, Match... | mit |
andrewsmedina/django | tests/utils_tests/test_functional.py | 57 | 1815 | from django.utils import unittest
from django.utils.functional import lazy, lazy_property, cached_property
class FunctionalTestCase(unittest.TestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
for a, b in zip(t(), range(3)):
self.assertEqual(a, b)
def te... | bsd-3-clause |
nicolieolieart/nicolieolieart.github.io | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
sk413025/tilitools | latentsvdd.py | 1 | 3222 | from cvxopt import matrix,spmatrix,sparse,uniform,normal,setseed
from cvxopt.blas import dot,dotu
from cvxopt.solvers import qp
from cvxopt.lapack import syev
import numpy as np
import math as math
from kernel import Kernel
from svdd import SVDD
from ocsvm import OCSVM
import pylab as pl
import matplotlib.pyplot as... | mit |
EliotBerriot/django | tests/test_runner/test_discover_runner.py | 210 | 6196 | import os
from contextlib import contextmanager
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... | bsd-3-clause |
sniemi/SamPy | sandbox/src1/pviewer/pviewer.py | 1 | 31336 | #!/usr/bin/env python
from tkFileDialog import *
from Tkinter import *
from tkSimpleDialog import Dialog
import tkMessageBox
from plotAscii import *
from imageUtil import *
from view2d import *
from mdaAscii import *
import Pmw
import os, string
import AppShell
global Scan
global SH # SHARED
class setupPrinter(... | bsd-2-clause |
TkkrLab/py-ledart | Ledart/Patterns/Sim.py | 2 | 4345 | import random
import time
import math
from Ledart.Tools import Graphics, BLUE, WHITE, BLACK
class Particle(object):
def __init__(self, pos, size, mass=1):
random.seed(time.time())
self.x, self.y = pos
self.size = size
self.mass = mass
self.color = WHITE
self.wall =... | gpl-2.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.2.5/django/db/models/fields/__init__.py | 119 | 43384 | import datetime
import decimal
import re
import time
import math
from itertools import tee
import django.utils.copycompat as copy
from django.db import connection
from django.db.models.fields.subclassing import LegacyConnection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
fro... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.