repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
quimaguirre/diana | diana/toolbox/network_utilities.py | 1 | 93563 | """
Copyright (C) 2009 Emre Guney, Javier Garcia-Garcia
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.
... | mit |
vipulroxx/sympy | sympy/integrals/tests/test_failing_integrals.py | 8 | 3732 | # A collection of failing integrals from the issues.
from __future__ import division
from sympy import (
integrate, Integral, exp, oo, pi, sign, sqrt, sin, cos,
tan, S, log, gamma, sinh,
)
from sympy.utilities.pytest import XFAIL, SKIP, slow, skip, ON_TRAVIS
from sympy.abc import x, k, c, y, R, b, h, a, m
... | bsd-3-clause |
danakj/chromium | tools/metrics/histograms/update_bad_message_reasons.py | 31 | 1275 | # 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.
"""Updates the various BadMessage enums in histograms.xml file with values read
from the corresponding bad_message.h files.
If the file was pretty-printed, ... | bsd-3-clause |
Unow/edx-platform | common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py | 9 | 14097 | """
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 |
apache/ignite | modules/ducktests/tests/ignitetest/services/utils/decorators.py | 3 | 1335 | # 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 use ... | apache-2.0 |
hehaoslj/globalhealth | site/app/metroui.py | 1 | 18271 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import random
color_templ="""black white lime green emerald teal blue cyan cobalt indigo violet pink magenta crimson red orange amber yellow brown olive steel mauve taupe gray dark darker darkBrown darkCrimson darkMagenta darkIndigo darkCyan darkCobalt darkTeal darkEm... | mit |
calvingit21/h2o-2 | py/h2o_os_util.py | 30 | 5521 |
import subprocess
import getpass
def kill_process_tree(pid, including_parent=True):
parent = psutil.Process(pid)
for child in parent.get_children(recursive=True):
child.kill()
if including_parent:
parent.kill()
def kill_child_processes():
me = os.getpid()
kill_process_tree(me, inc... | apache-2.0 |
snnn/tensorflow | tensorflow/contrib/keras/api/keras/preprocessing/__init__.py | 132 | 1094 | # 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 |
sbbic/core | pyuno/qa/pytests/testcollections_XCellRange.py | 4 | 11605 | #!/usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# 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 unittest
import uno
from testcollect... | gpl-3.0 |
acsone/account-financial-tools | account_asset_management_xls/report/__init__.py | 34 | 1037 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
root-mirror/root | tutorials/legacy/pyroot/file.py | 22 | 4326 | ## \file
## \ingroup tutorial_pyroot_legacy
## \notebook
## This macro displays the physical ROOT file structure
##
## \macro_image
## \macro_code
##
## \author Wim Lavrijsen
from ROOT import TCanvas, TPaveLabel, TPave, TLine, TArrow, TText, TPaveText
from ROOT import gROOT
c1 = TCanvas( 'c1', 'ROOT File description'... | lgpl-2.1 |
shsingh/ansible | test/units/modules/network/fortios/test_fortios_system_dscp_based_priority.py | 21 | 7853 | # 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 |
KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_effects/effect/profile_COMMON/technique/constant/transparent/_ref_const_trans_rgbzero_alpha1/_ref_const_trans_rgbzero_alpha1.py | 28 | 3721 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
frenchfrywpepper/ansible-modules-extras | monitoring/zabbix_screen.py | 45 | 17177 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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 |
savoirfairelinux/OpenUpgrade | addons/account_asset/wizard/wizard_asset_compute.py | 382 | 2518 | # -*- 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 t... | agpl-3.0 |
mcsalgado/ansible | contrib/inventory/cloudstack.py | 111 | 8221 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | gpl-3.0 |
bigbrozer/monitoring.nagios | tests/t_SSH_plugin.py | 1 | 4926 | # -*- coding: utf-8 -*-
# Copyright (C) Vincent BESANCON <besancon.vincent@gmail.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... | mit |
Ali-aqrabawi/ezclinic | lib/django/contrib/admin/tests.py | 113 | 7451 | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import modify_settings
from django.test.selenium import SeleniumTestCase
from django.utils.deprecation import MiddlewareMixin
from django.utils.translation import ugettext as _
class CSPMiddleware(MiddlewareMixin):
"""The adm... | mit |
chouseknecht/ansible | lib/ansible/modules/net_tools/nios/nios_mx_record.py | 68 | 4314 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
nmayorov/scikit-learn | sklearn/gaussian_process/kernels.py | 18 | 66251 | """Kernels for Gaussian process regression and classification.
The kernels in this module allow kernel-engineering, i.e., they can be
combined via the "+" and "*" operators or be exponentiated with a scalar
via "**". These sum and product expressions can also contain scalar values,
which are automatically converted to... | bsd-3-clause |
Maspear/odoo | addons/anonymization/__openerp__.py | 260 | 2129 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
40223143/cda-w15 | static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/__init__.py | 693 | 4380 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... | agpl-3.0 |
tersmitten/ansible | lib/ansible/config/manager.py | 8 | 22711 | # Copyright: (c) 2017, 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
import io
import os
import os.path
import sys
import stat
import tempfile
import traceback
from co... | gpl-3.0 |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/BaseHTTPServer.py | 59 | 21972 | """HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: ... | gpl-2.0 |
pelle/talk.org | appengine_django/__init__.py | 3 | 15505 | #!/usr/bin/python2.4
#
# Copyright 2008 Google 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... | gpl-3.0 |
roguefalcon/rpi_docker_images | hackmt_2018_code/mobileapi/mobileapi/notification.py | 1 | 2559 | #!/usr/bin/python3
from mobileapi import app
from flask import jsonify
from flask import request
from flask import g
from flask import Flask
#BREAD
#Browse
@app.route('/api/1.0/notification', methods=['GET'])
def notification_browser():
# The active flag shows only the 'non-deleted' items
# If you want to see... | gpl-3.0 |
abhilashnta/edx-platform | lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py | 114 | 7638 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'StudentModuleHistory.version'
db.alter_column('courseware_studentmodulehistory', 'version... | agpl-3.0 |
SoloVeniaASaludar/mycroft-core | mycroft/client/text/main.py | 1 | 26397 | # Copyright 2017 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... | gpl-3.0 |
minhphung171093/GreenERP_V7 | openerp/__init__.py | 56 | 2227 | # -*- 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 |
lachenmayer/hyde | hyde.py | 3 | 3961 | #!/usr/bin/env python
import os
import sys
import threading
from optparse import OptionParser
from hydeengine import Generator, Initializer, Server
#import cProfile
PROG_ROOT = os.path.dirname(os.path.abspath( __file__ ))
def main(argv):
parser = OptionParser(usage="%prog [-f] [-q]", version="%prog 0.3b")
... | mit |
onceuponatimeforever/oh-mainline | vendor/packages/oauthlib/oauthlib/oauth1/rfc5849/endpoints/signature_only.py | 42 | 2885 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.signature_only
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the signing logic of OAuth 1.0 RFC 5849.
"""
from __future__ import absolute_import, unicode_literals
import logging
from .base import BaseEndpoint
from .... | agpl-3.0 |
takis/django | django/contrib/contenttypes/admin.py | 273 | 5345 | from __future__ import unicode_literals
from functools import partial
from django.contrib.admin.checks import InlineModelAdminChecks
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.forms impo... | bsd-3-clause |
google/llvm-propeller | lldb/test/API/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py | 15 | 1028 | class myIntSynthProvider(object):
def __init__(self, valobj, dict):
self.valobj = valobj
self.val = self.valobj.GetChildMemberWithName("theValue")
def num_children(self):
return 0
def get_child_at_index(self, index):
return None
def get_child_index(self, name):
... | apache-2.0 |
joyaether/zxing | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/packaging/__init__.py | 34 | 10758 | """SCons.Tool.Packaging
SCons Packaging Tool.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 ... | apache-2.0 |
haddocking/pdb-tools | pdbtools/pdb_reres.py | 2 | 5489 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# 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
#
# Unl... | apache-2.0 |
ronekko/chainer | chainer/links/connection/convolution_nd.py | 1 | 4194 | from chainer.functions.connection import convolution_nd
from chainer import initializers
from chainer import link
from chainer.utils import conv_nd
from chainer import variable
class ConvolutionND(link.Link):
"""N-dimensional convolution layer.
This link wraps the :func:`~chainer.functions.convolution_nd` fu... | mit |
open-craft/xblock-drag-and-drop-v2 | tests/integration/test_custom_data_render.py | 2 | 1535 | from .test_base import BaseIntegrationTest
class TestCustomDataDragAndDropRendering(BaseIntegrationTest):
PAGE_TITLE = 'Drag and Drop v2'
PAGE_ID = 'drag_and_drop_v2'
def setUp(self):
super(TestCustomDataDragAndDropRendering, self).setUp()
scenario_xml = self._get_custom_scenario_xml("da... | agpl-3.0 |
PaulGrimal/peach | peach/nn/rbfn.py | 6 | 11973 | ################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: nn/nn.py
# Basic topologies of neural networks
################################################################################
# Doc string, reStructur... | lgpl-2.1 |
chipsCode/CocosBuilder | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 92 | 106483 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
ColumbiaCMB/kid_readout | apps/data_taking_scripts/old_scripts/mmw_source_sweep_140825_0813fx.py | 1 | 5820 | import time
import sys
import numpy as np
from kid_readout.roach import baseband
from kid_readout.utils import data_file, sweeps
from kid_readout.analysis.resonator import fit_best_resonator
from kid_readout.equipment import hittite_controller, lockin_controller
# fg = FunctionGenerator()
hittite = hittite_controll... | bsd-2-clause |
mihailignatenko/erp | addons/account/project/wizard/account_analytic_balance_report.py | 378 | 2136 | # -*- 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 |
13scoobie/choices | vendor/github.com/prometheus/client_model/python/prometheus/client/model/metrics_pb2.py | 250 | 20064 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: metrics.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _m... | apache-2.0 |
drayside/kodkod | libs/.waf-1.6.6-c57dd0fa119e23d36c23d598487c6880/waflib/Tools/gxx.py | 4 | 2964 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Configure,Options,Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
def find_gxx(conf):
cxx=conf.find_program(['g++'... | mit |
rosmo/ansible | contrib/inventory/apstra_aos.py | 52 | 20460 | #!/usr/bin/env python
#
# (c) 2017 Apstra Inc, <community@apstra.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... | gpl-3.0 |
sauliusl/scipy | scipy/ndimage/utils/generate_label_testvectors.py | 73 | 1672 | import numpy as np
from scipy.ndimage import label
def generate_test_vecs(infile, strelfile, resultfile):
"test label with different structuring element neighborhoods"
def bitimage(l):
return np.array([[c for c in s] for s in l]) == '1'
data = [np.ones((7, 7)),
bitimage(["1110111",
... | bsd-3-clause |
couchbaselabs/litmus | lib/pymongo/common.py | 2 | 8659 | # Copyright 2009-2011 10gen, 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 agreed to in writing... | apache-2.0 |
bigplus/thefuck | tests/functional/test_performance.py | 5 | 1628 | from pexpect import TIMEOUT
import pytest
import time
from tests.functional.utils import spawn, functional, bare
dockerfile = u'''
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -yy python3 python3-pip python3-dev git
RUN pip3 install -U setuptools
RUN ln -s /usr/bin/pip3 /usr/bin/pip
RUN adduser --disabled... | mit |
dschoepe/notmuch-lazysync | setup.py | 1 | 1173 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='notmuch-lazysync',
version='0.1a',
description='A tool for notmuch tag synchronization',
url='https://github.com/dschoepe/notmuch-lazysync',
author='Dani... | gpl-2.0 |
rhelmer/socorro-lib | socorro/lib/datetimeutil.py | 2 | 4651 | # 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 re
import datetime
import isodate # 3rd party
import json
UTC = isodate.UTC
def datetimeFromISOdateString(s):... | mpl-2.0 |
handroissuazo/tensorflow | venv/lib/python2.7/site-packages/setuptools/config.py | 67 | 16050 | from __future__ import absolute_import, unicode_literals
import io
import os
import sys
from collections import defaultdict
from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from six import string_types
def read_configu... | apache-2.0 |
MarkWh1te/xueqiu_predict | p3_env/lib/python3.5/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | 3532 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... | mit |
ShadowPower/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
savi-dev/nova | nova/api/openstack/compute/contrib/hypervisors.py | 11 | 9693 | # Copyright (c) 2012 OpenStack, LLC.
# 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 requi... | apache-2.0 |
sensysnetworks/uClinux | user/python/Lib/distutils/sysconfig.py | 4 | 13516 | """Provide access to Python's configuration information. The specific names
defined in the module depend heavily on the platform and configuration.
Written by: Fred L. Drake, Jr.
Email: <fdrake@acm.org>
Initial date: 17-Dec-1998
"""
__revision__ = "$Id: sysconfig.py,v 1.28 2000/09/17 00:53:02 gward Exp $"
... | gpl-2.0 |
bsa11b/mtasa-blue | vendor/google-breakpad/src/tools/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | gpl-3.0 |
doismellburning/edx-platform | common/lib/xmodule/xmodule/library_root_xblock.py | 47 | 5037 | """
'library' XBlock (LibraryRoot)
"""
import logging
from xmodule.studio_editable import StudioEditableModule
from xblock.fields import Scope, String, List, Boolean
from xblock.fragment import Fragment
from xblock.core import XBlock
log = logging.getLogger(__name__)
# Make '_' a no-op so we can scrape strings
_ = ... | agpl-3.0 |
pfarnach/altvote | server/views.py | 1 | 8902 | from __future__ import division
from copy import deepcopy
import uuid, random
from flask import (Flask, Blueprint, jsonify, make_response, send_from_directory,
request, abort, render_template)
from app import db, app
from server import models
from server.email_notify import send_email
from server.utils.countUtils ... | gpl-3.0 |
balrok/Flashget | setup.py | 1 | 1850 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import os
import sys
import io
import flashget
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = [
'flashget',... | mit |
abdoosh00/edraak | common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | 3 | 86194 | """
Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc).
Representation:
* course_index: a dictionary:
** '_id': a unique id which cannot change,
** 'org': the org's id. Only used for searching not identity,
** 'offering': the course's catalog number an... | agpl-3.0 |
mitodl/xanalytics | unidecode/x0f9.py | 253 | 4567 | data = (
'Kay ', # 0x00
'Kayng ', # 0x01
'Ke ', # 0x02
'Ko ', # 0x03
'Kol ', # 0x04
'Koc ', # 0x05
'Kwi ', # 0x06
'Kwi ', # 0x07
'Kyun ', # 0x08
'Kul ', # 0x09
'Kum ', # 0x0a
'Na ', # 0x0b
'Na ', # 0x0c
'Na ', # 0x0d
'La ', # 0x0e
'Na ', # 0x0f
'Na ', # 0x10
'Na ', ... | mit |
Themaister/mplayer2-kms | TOOLS/matroska.py | 6 | 13908 | #!/usr/bin/env python3
"""
Generate C definitions for parsing Matroska files.
Can also be used to directly parse Matroska files and display their contents.
"""
#
# This file is part of MPlayer.
#
# MPlayer is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-3.0 |
fcecin/infinitum | qa/rpc-tests/merkle_blocks.py | 1 | 3965 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test merkleblock fetch/validation
#
from test_framework.test_framework import InfinitumTestFramework... | mit |
glyph/txsni | setup.py | 1 | 1184 |
import os
from setuptools import setup
base_dir = os.path.dirname(__file__)
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
setup(
name="TxSNI",
description="easy-to-use SNI endpoint for twisted",
packages=[
"txsni",
"txsni.test",
"txsni.tes... | mit |
enigmamarketing/csf-allow-domains | usr/local/csf/bin/csf-allow-domains/dns/rcode.py | 100 | 3105 | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | mit |
XiaodunServerGroup/xiaodun-platform | i18n/dummy.py | 6 | 7961 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate test translation files from human-readable po files.
Dummy language is specified in configuration file (see config.py)
two letter language codes reference:
see http://www.loc.gov/standards/iso639-2/php/code_list.php
Django will not localize in languages that... | agpl-3.0 |
dav1x/ansible | lib/ansible/modules/net_tools/haproxy.py | 31 | 14003 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@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 Lice... | gpl-3.0 |
xiaolonginfo/decode-Django | Django-1.5.1/django/db/models/manager.py | 4 | 10074 | import copy
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
这个函数确保每一个 model 都有一个管理器
def ensure_default_manager(sender, **kwargs):
"""
Ensures that a Mode... | gpl-2.0 |
bileto/transitfeed | transitfeed/gtfsobjectbase.py | 8 | 4383 | #!/usr/bin/python2.5
# Copyright (C) 2007 Google 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 la... | apache-2.0 |
nextgis/ngq_compulink | qgis-plugin/src/plugin_settings.py | 2 | 1294 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Plugins settings
A QGIS plugin
Compulink QGIS tools
-------------------
begin : 2014-10-31
git sha : $Forma... | gpl-2.0 |
muddyfish/PYKE | node/floor_divide.py | 1 | 2595 | #!/usr/bin/env python
import datetime
from itertools import product
import ephem
import nodes
from nodes import Node
from type.type_infinite_list import DummyList
def all_combinations():
g_contents = nodes.nodes["alphabet"].contents
i = 0
while 1:
i += 1
yield from map("".join, product(g... | mit |
dol-sen/gentoolkit | pym/gentoolkit/sets.py | 3 | 1226 | # Copyright(c) 2010, Gentoo Foundation
#
# Licensed under the GNU General Public License, v2 or higher
#
# $Header$
"""Provides access to Portage sets api"""
__docformat__ = 'epytext'
import portage
try:
import portage.sets
_sets_available = True
SETPREFIX = portage.sets.SETPREFIX
except ImportError:
_sets_avail... | gpl-2.0 |
captain-pool/GSOC | E3_Distill_ESRGAN/libs/models/student_residual.py | 1 | 2224 | """ Module containing ResNet architecture as a student Network """
import tensorflow as tf
from libs.models import abstract
from libs import settings
from functools import partial
class ResidualStudent(abstract.Model):
""" ResNet Student Network Model """
def init(self):
self.student_settings = settings.Sett... | mit |
adelina-t/neutron | neutron/plugins/brocade/tests/noscli.py | 46 | 2874 | #!/usr/bin/env python
#
# Copyright (c) 2013 Brocade Communications Systems, 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... | apache-2.0 |
ast0815/remu | docs/examples/04/do_mcmc.py | 2 | 4292 | from six import print_
import numpy as np
from matplotlib import pyplot as plt
from remu import binning
from remu import plotting
from remu import likelihood
from remu import likelihood_utils
import emcee
with open("../01/reco-binning.yml", 'rt') as f:
reco_binning = binning.yaml.full_load(f)
with open("../01/opti... | mit |
harnesscloud/remyroy-pyopenssl-shutdown-fix | examples/proxy.py | 64 | 1863 | #!/usr/bin/env python
#
# This script demostrates how one can use pyOpenSSL to speak SSL over an HTTP
# proxy
# The challenge here is to start talking SSL over an already connected socket
#
# Author: Mihai Ibanescu <misa@redhat.com>
#
# $Id: proxy.py,v 1.2 2004/07/22 12:01:25 martin Exp $
import sys, socket, string
fr... | apache-2.0 |
mmottahedi/neuralnilm_prototype | scripts/e326.py | 2 | 6706 | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mit |
savoirfairelinux/django | django/contrib/gis/db/backends/base/models.py | 131 | 3962 | from django.contrib.gis import gdal
class SpatialRefSysMixin:
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redundant code.
"""
@property
def srs(self):
"""
Return a GDAL SpatialReference object.
"""
# TODO:... | bsd-3-clause |
Thierry46/CalcAl | gui/CalculatorFrame.py | 1 | 41674 | # -*- coding: utf-8 -*-
"""
************************************************************************************
Class : CalculatorFrame
Author : Thierry Maillard (TMD)
Date : 31/3/2016 - 4/12/2016
Role : Define food calculator frame content.
Licence : GPLv3
Copyright (c) 2016 - Thierry Maillard
This file is part ... | gpl-3.0 |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/tests/get_object_or_404/models.py | 64 | 1135 | """
35. DB-API Shortcuts
``get_object_or_404()`` is a shortcut function to be used in view functions for
performing a ``get()`` lookup and raising a ``Http404`` exception if a
``DoesNotExist`` exception was raised during the ``get()`` call.
``get_list_or_404()`` is a shortcut function to be used in view functions for... | apache-2.0 |
vidyacraghav/pagseguro-python | pagseguro/__init__.py | 1 | 1724 | # -*- coding: utf-8 -*-
'''
Created on Nov 7, 2013
@author: ricardo
'''
from pagseguro.api.v2.payment import Payment as PaymentV2
class Payment(object):
'''
Utilize esta classe para instanciar o objeto que fara a conexão
com o PagSeguro
:param: email: O email do comprador no PagSeguro
:param... | apache-2.0 |
tillrohrmann/flink | flink-python/docs/conf.py | 17 | 7150 | ################################################################################
# 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... | apache-2.0 |
chubbymaggie/Mobile-Security-Framework-MobSF | DynamicAnalyzer/tools/adb/windows/systrace/systrace.py | 148 | 10843 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Android system-wide tracing utility.
This is a tool for capturing a trace that includes data from both userland and
the kernel... | gpl-3.0 |
DanielShangHai/python | burness/0002/save_to_mysql.py | 40 | 1463 | #-*- coding: utf-8-*-
import mysql.connector
config = {
'user': 'root',
'password': 'root',
'host': '127.0.0.1',
'database': 'test',
'raise_on_warnings': True,
}
class save_keys_to_mysql:
def __init__(self,path):
self.path=path
print(self.path)
def __conn(self,**conf):
try:
conn=mysql.connector.... | mit |
jounex/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/tests/management_command.py | 36 | 3331 | # -*- coding: utf-8 -*-
import sys
import logging
try:
from cStringIO import StringIO # NOQA
except ImportError:
from io import StringIO # NOQA
try:
import importlib # NOQA
except ImportError:
from django.utils import importlib # NOQA
from django.core.management import call_command
from django.te... | apache-2.0 |
konstruktoid/ansible-upstream | lib/ansible/plugins/action/win_template.py | 269 | 1198 | # (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 |
ryanmockabee/golfr | flask/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py | 33 | 4403 | # util/deprecations.py
# Copyright (C) 2005-2017 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
functio... | mit |
Pgans/yii2a-devices | vendor/almasaeed2010/adminlte/bower_components/jvectormap/converter/converter.py | 129 | 10451 | #
# jVectorMap version 2.0.4
#
# Copyright 2011-2013, Kirill Lebedev
#
import sys
import shapely.geometry
import shapely.wkb
import shapely.affinity
from osgeo import ogr
from osgeo import osr
import json
import codecs
import copy
class Map:
def __init__(self, name, language):
self.paths = {}
self.name = na... | gpl-3.0 |
sassoftware/rmake | rmake/lib/pluginlib.py | 2 | 12144 | #
# Copyright (c) SAS Institute 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 agreed to in w... | apache-2.0 |
Fusion-Rom/android_external_chromium_org | gpu/tools/check_gpu_bots.py | 37 | 20249 | #!/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 argparse
import datetime
import getpass
import json
import os
import smtplib
import sys
import time
import urllib
import urllib... | bsd-3-clause |
LG-V10/LGV10__pplus_msm8992_kernel | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
titasakgm/brc-stock | openerp/addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/db/backends/mysql/introspection.py | 25 | 4326 | from django.db.backends import BaseDatabaseIntrospection
from MySQLdb import ProgrammingError, OperationalError
from MySQLdb.constants import FIELD_TYPE
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseI... | agpl-3.0 |
idrogeno/FusionOE | tests/enigma.py | 59 | 7002 | # fake-enigma
class slot:
def __init__(self):
self.list = [ ]
def get(self):
return self.list
def __call__(self):
for x in self.list:
x()
timers = set()
import time
from events import eventfnc
##################### ENIGMA BASE
class eTimer:
def __init__(self):
self.timeout = slot()
self.next_ac... | gpl-2.0 |
chubbymaggie/cle | tests/test_stream.py | 1 | 1333 | #!/usr/bin/env python
import os
import nose
import cle
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
def test_stream():
dirpath = os.path.join(test_location, "i386")
filepath = os.path.join(dirpath, "fauxware")
lib1path = os.path.join(dirpath, "lib... | bsd-2-clause |
sam-tsai/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 |
shsingh/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_notification.py | 21 | 13834 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2018, Samuel Carpentier <samuelcarpentier0@gmail.ca>
# 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': ... | gpl-3.0 |
safchain/contrail-controller | src/config/utils/provision_vrouter.py | 9 | 5841 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import time
import argparse
import ConfigParser
from vnc_api.vnc_api import *
from cfgm_common.exceptions import *
class VrouterProvisioner(object):
def __init__(self, args_str=None):
self._args = None
... | apache-2.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/importlib/test/abc.py | 86 | 2471 | import abc
import unittest
class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta):
"""Basic tests for a finder to pass."""
@abc.abstractmethod
def test_module(self):
# Test importing a top-level module.
pass
@abc.abstractmethod
def test_package(self):
# Test importi... | apache-2.0 |
ChanduERP/odoo | addons/crm/res_config.py | 361 | 4156 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-TODAY OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Eric-Gaudiello/tensorflow_dev | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/numpy/random/tests/test_random.py | 74 | 31896 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
assert_warns)
from numpy import random
from numpy.compat import asbytes
import sys
class TestSeed(TestCase):
def test_sc... | gpl-3.0 |
chuck-aka-ben/TripodPi | testServo.py | 1 | 6093 | import os
import time
from Servo import Servo
from csvFile import csvFile
servo_max = 100
servo_min = -100
servo = Servo(0, servo_max, servo_min)
servo.maxABSVelocity = 20
servo.maxABSacceleration = 5
csvHeader = 'time,position,velocity'
def generateImage(csv, image, title):
os.system('python graph.py {0} {1} ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.