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 |
|---|---|---|---|---|---|
kidaa/entropy | lib/entropy/db/sqlite.py | 4 | 105912 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
I{EntropySQLiteRepository} is the SQLite3 implementation of
the repository interface.
"""
import collections
import errno
import os
import hashlib
i... | gpl-2.0 |
Learningtribes/edx-platform | openedx/core/djangoapps/credit/signals.py | 11 | 4932 | """
This file contains receivers of course publication signals.
"""
import logging
from django.dispatch import receiver
from django.utils import timezone
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import SignalHandler
from openedx.core.djangoapps.credit.verification_access import upda... | agpl-3.0 |
vikkyrk/incubator-beam | sdks/python/apache_beam/examples/complete/top_wikipedia_sessions_test.py | 9 | 2304 | #
# 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 us... | apache-2.0 |
grap/OpenUpgrade | addons/hr_recruitment/wizard/__init__.py | 381 | 1095 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
cwaldbieser/txcas | sample.py | 1 | 22229 | #! /usr/bin/env python
from __future__ import print_function
import argparse
import cgi
from textwrap import dedent
from urllib import urlencode
import sys
from txcas.constants import (
VIEW_LOGIN,
VIEW_LOGIN_SUCCESS,
VIEW_LOGOUT,
VIEW_INVALID_SERVICE,
VIEW_ERROR_5XX,
VIEW_NOT_FOUND)
from tx... | gpl-3.0 |
nathanielvarona/airflow | tests/providers/apache/pinot/hooks/test_pinot.py | 1 | 9827 | #
# 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... | apache-2.0 |
richardxx/mongoctl-service | build/lib.linux-x86_64-2.7/mongoctl/commands/server/resync_secondary.py | 3 | 2014 | __author__ = 'abdul'
import mongoctl.repository as repository
import shutil
from mongoctl.mongoctl_logging import log_info
from mongoctl.errors import MongoctlException
from stop import do_stop_server
from start import do_start_server
###############################################################################
# ... | mit |
rishita/mxnet | example/reinforcement-learning/ddpg/replay_mem.py | 15 | 2476 | from __future__ import print_function
import numpy as np
class ReplayMem(object):
def __init__(
self,
obs_dim,
act_dim,
memory_size=1000000):
# allocate space for memory cells
self.obs_dim = obs_dim
self.act_dim = act_dim
self.obss = np.zeros((mem... | apache-2.0 |
AndreaCrotti/ansible | lib/ansible/utils/module_docs_fragments/aws.py | 232 | 3156 | # (c) 2014, Will Thames <will@thames.id.au>
#
# 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 |
dpshelio/scikit-image | skimage/io/tests/test_simpleitk.py | 36 | 3023 | import os.path
import numpy as np
from numpy.testing.decorators import skipif
from numpy.testing import assert_raises
from tempfile import NamedTemporaryFile
from skimage import data_dir
from skimage.io import imread, imsave, use_plugin, reset_plugins
try:
import SimpleITK as sitk
use_plugin('simpleitk')
exc... | bsd-3-clause |
insertnamehere1/maraschino | lib/sqlalchemy/ext/serializer.py | 25 | 5434 | # ext/serializer.py
# Copyright (C) 2005-2011 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
"""Serializer/Deserializer objects for usage with SQLAlchemy query structures,
allo... | mit |
jbarlow83/OCRmyPDF | tests/test_stdio.py | 1 | 3399 | # © 2019 James R. Barlow: github.com/jbarlow83
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from pathlib import Path
from subprocess import D... | gpl-3.0 |
CyanogenMod/android_external_chromium_org_third_party_skia | platform_tools/android/gyp_gen/android_framework_gyp.py | 85 | 3322 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Modified version of gyp_skia, used by gyp_to_android.py to generate Android.mk
"""
import os
import sys
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
... | bsd-3-clause |
ChopChopKodi/pelisalacarta | python/main-classic/lib/atom/http.py | 27 | 10236 | #!/usr/bin/python
#
# Copyright (C) 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 ... | gpl-3.0 |
ThirdProject/android_external_chromium_org | third_party/jinja2/runtime.py | 606 | 19558 | # -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
... | bsd-3-clause |
legacysurvey/rapala | survey/bokextract.py | 2 | 1766 | #!/usr/bin/env python
import os
import glob
import subprocess
from bass import rdxdir
def sextract(imagepath,frompv=True,redo=False,
withpsf=True,redopsf=False,psfpath=None,onlypsf=False,
xargs=[]):
cfgdir = os.path.join(os.environ['BOKPIPE'],'..','survey','config')
catpath = imagepath.repla... | bsd-3-clause |
vrenaville/OCB | addons/point_of_sale/__init__.py | 378 | 1189 | # -*- 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... | agpl-3.0 |
erikriver/eduIntelligent-cynin | src/ubify.viewlets/ubify/viewlets/browser/applicationstabs.py | 5 | 4821 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distribut... | gpl-3.0 |
grevutiu-gabriel/sympy | sympy/solvers/solvers.py | 32 | 120616 | """
This module contain solvers for all kinds of equations:
- algebraic or transcendental, use solve()
- recurrence, use rsolve()
- differential, use dsolve()
- nonlinear (numerically), use nsolve()
(you will need a good starting point)
"""
from __future__ import print_function, division
f... | bsd-3-clause |
ryandub/simpl | simpl/rest.py | 1 | 13761 | # Copyright (c) 2011-2015 Rackspace US, 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... | apache-2.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.5/django/contrib/gis/geos/libgeos.py | 91 | 5833 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import c_... | apache-2.0 |
b3j0f/debate | django/core/views.py | 1 | 3280 | """View module."""
from .models import (
Account, User, Topic, Event, Space, Vote, Tag, Media,
Stat
)
from .serializers import (
AccountSerializer, UserSerializer, TopicSerializer, MediaSerializer,
EventSerializer, VoteSerializer, TagSerializer,
SpaceSerializer, StatSerializer
)
from .permissions i... | mit |
hassanabidpk/django | tests/model_fields/test_uuid.py | 81 | 6563 | import json
import uuid
from django.core import exceptions, serializers
from django.db import IntegrityError, models
from django.test import (
SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature,
)
from .models import (
NullableUUIDModel, PrimaryKeyUUIDModel, RelatedToUUIDModel, UUIDGrandchild,... | bsd-3-clause |
openstack/networking-arista | networking_arista/tests/unit/ml2/mechanism_ha_simulator.py | 1 | 4119 | # Copyright (c) 2018 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 agreed to ... | apache-2.0 |
leeon/annotated-django | tests/test_client/tests.py | 4 | 22931 | # coding: utf-8
"""
39. Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
of t... | bsd-3-clause |
besserox/easybuild-easyconfigs | test/easyconfigs/suite.py | 8 | 2718 | #!/usr/bin/python
##
# Copyright 2012-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercul... | gpl-2.0 |
pli3/enigma2-git | lib/python/Plugins/SystemPlugins/NFIFlash/plugin.py | 57 | 1160 | from Plugins.Plugin import PluginDescriptor
from Tools.HardwareInfo import HardwareInfo
from Tools.Directories import fileExists
from downloader import NFIDownload, filescan
from flasher import NFIFlash
def NFIFlasherMain(session, tmp = None, **kwargs):
session.open(NFIDownload, "/home/root" )
def NFICallFnc(tmp = N... | gpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/elastictranscoder/__init__.py | 145 | 1723 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
yqm/sl4a | python-build/python-libs/xmpppy/xmpp/auth.py | 196 | 15633 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | apache-2.0 |
rubikloud/scikit-learn | benchmarks/bench_plot_lasso_path.py | 301 | 4003 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
hoechenberger/psychopy | psychopy/iohub/devices/daq/hw/labjack/__init__.py | 2 | 13414 | # -*- coding: utf-8 -*-
# Part of the psychopy.iohub library.
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import print_function
import sys
import numpy as N
from ... import AnalogInputDevice, MultiChannelAnalogInputEvent
f... | gpl-3.0 |
OPM/ResInsight | ThirdParty/Ert/python/ecl/gravimetry/ecl_grav_calc.py | 2 | 3182 | # Copyright (C) 2011 Equinor ASA, Norway.
#
# This file is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ... | gpl-3.0 |
leilihh/nova | nova/api/openstack/compute/contrib/quota_classes.py | 8 | 4021 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
ptrendx/mxnet | example/ssd/tools/caffe_converter/caffe_parse/parse_from_protobuf.py | 53 | 1565 | # 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 |
sbktechnology/sap_frappe | frappe/model/rename_doc.py | 20 | 11352 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint
from frappe.model.naming import validate_name
@frappe.whitelist()
def rename_doc(doctype, old, new, force=False, ... | mit |
massmutual/scikit-learn | sklearn/ensemble/base.py | 252 | 3630 | """
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..utils import _get_n_jobs
class BaseEnsemble(BaseEstimator, MetaEstimatorMixin):
"""Base cl... | bsd-3-clause |
mjbrewer/testindex | magnum/tests/unit/conductor/test_utils.py | 15 | 2532 | # Copyright 2015 Huawei Technologies Co.,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 agre... | apache-2.0 |
navrasio/mxnet | tests/python/unittest/test_kvstore.py | 3 | 10702 | # 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 |
NerdsvilleCEO/elections | tests/test_flask_irc.py | 1 | 5788 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
(c) 2014 - Copyright Joshua Santos
Author: Joshua Santos <nerdsville@nerdsville.net>
# 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, o... | gpl-2.0 |
michimussato/pypelyne2 | pypelyne2/payload/rr/7.0.29__installer/files/render_apps/scripts/kso_tcp.py | 1 | 6250 | import SocketServer
import struct
import datetime
import sys
import time
StructureID_rrCommands =0x0B03
StructureID_RRN_TCP_HeaderData_v3 = 0x0D03
Size_RRCommands = 1232
Size_RRN_TCP_HeaderData_v3 = 198
rrnData_commands = 7
log_command="print(' \\\'"
log_command_end="')"
log_command_intern_prestring=" "
log_... | gpl-2.0 |
balena/python-smime | setup.py | 1 | 1324 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.r... | apache-2.0 |
BlaXpirit/qbittorrent | src/searchengine/nova/nova2.py | 4 | 6782 | #VERSION: 1.40
# Author:
# Fabien Devaux <fab AT gnux DOT info>
# Contributors:
# Christophe Dumez <chris@qbittorrent.org> (qbittorrent integration)
# Thanks to gab #gcu @ irc.freenode.net (multipage support on PirateBay)
# Thanks to Elias <gekko04@users.sourceforge.net> (torrentreactor and isohunt search engines)... | gpl-2.0 |
jorik041/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/validatechangelogs_unittest.py | 119 | 3754 | # 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 |
moas/sketchbadges | exo/studio/users/urls.py | 1 | 2012 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from django.contrib.auth.views import (
logout_then_login, login,
password_change
)
from django.core.urlresolvers import reverse_lazy
from django.views import generic
from . import views
urlpatte... | mit |
mjirayu/sit_academy | openedx/core/djangoapps/credit/migrations/0010_add_creditrequirementstatus_history.py | 80 | 13950 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'HistoricalCreditRequirementStatus'
db.create_table('credi... | agpl-3.0 |
tcarmelveilleux/CheapDrawBot | Software/drivers/pololu_maestro.py | 1 | 1901 | #
# Basic library to interface with Pololu Maestro servo controllers
# through serial port.
#
# Limitations:
# * CRC-7 not yet supported
import serial
class PololuMaestro:
CMD_SET_TARGET = 0x04
CMD_SET_SPEED = 0x07
CMD_SET_ACCEL = 0x09
def __init__(self, port, baud_rate=9600):
self.port = por... | mit |
philanthropy-u/edx-platform | common/djangoapps/student/management/commands/bulk_unenroll.py | 3 | 2618 | import logging
import unicodecsv
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from django.db.models import Q
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from student.models import CourseEnrollment, User
logger = logg... | agpl-3.0 |
GheRivero/ansible | lib/ansible/modules/cloud/spotinst/spotinst_aws_elastigroup.py | 45 | 48701 | #!/usr/bin/python
# 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)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
sklam/numba | numba/cuda/tests/cudapy/test_idiv.py | 1 | 1061 | import numpy as np
from numba import cuda, float32, float64, int32
from numba.cuda.testing import unittest, CUDATestCase
class TestCudaIDiv(CUDATestCase):
def test_inplace_div(self):
@cuda.jit(argtypes=[float32[:, :], int32, int32])
def div(grid, l_x, l_y):
for x in range(l_x):
... | bsd-2-clause |
lesina/Hack70 | src/core/models.py | 1 | 1253 | # coding: utf-8
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser, AbstractBaseUser
from courses.models import Course
class User(AbstractUser):
avatar = models.ImageField(u'фото профиля',upload_to='avatars', blank=False, default=u'avatars/def... | gpl-3.0 |
ericzundel/pants | src/python/pants/backend/python/targets/python_requirement_library.py | 5 | 1217 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.p... | apache-2.0 |
TalShafir/ansible | lib/ansible/modules/network/routeros/routeros_facts.py | 15 | 12958 | #!/usr/bin/python
# 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'],
'support... | gpl-3.0 |
Oxygem/canaryd | canaryd_packages/click/decorators.py | 204 | 10941 | import sys
import inspect
from functools import update_wrapper
from ._compat import iteritems
from ._unicodefun import _check_for_unicode_literals
from .utils import echo
from .globals import get_current_context
def pass_context(f):
"""Marks a callback as wanting to receive the current context
object as fir... | mit |
certik/sfepy | sfepy/fem/equations.py | 1 | 10524 | from sfepy.base.base import *
from parseEq import create_bnf
from materials import Materials
from sfepy.terms import Terms, Term, term_table, DataCaches, cache_table
"""
Note:
- create found materials, variables from configuration/input file data
... no - user should be able to create objects even if they are not
... | bsd-3-clause |
tectronics/ns-3-dev-def-routing | bindings/python/apidefs/gcc-ILP32/ns3_module_stats.py | 4 | 27575 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## data-output-interface.h: ns3::DataOutputCallback [class]
module.add_class('DataOutputCallback', allow_subclassing=True)
## data-calculator.h: ns3::Statis... | gpl-2.0 |
averagehuman/django-instance | instance/cli/controller.py | 1 | 2384 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import shutil
try:
from io import BytesIO
except ImportError:
from cStringIO import StringIO as BytesIO
import logbook
from django.utils.text import slugify
from django.core.management import call_command
from instance.con... | bsd-3-clause |
davidcoallier/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/PharLapCommon.py | 61 | 5230 | """SCons.Tool.PharLapCommon
This module contains common code used by all Tools for the
Phar Lap ETS tool chain. Right now, this is linkloc and
386asm.
"""
#
# 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... | apache-2.0 |
aitormf/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit_motors.py | 45 | 4814 | #!/usr/bin/env python
'''
fit best estimate of magnetometer offsets, trying to take into account motor interference
'''
import sys, time, os, math
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--no-timestamps",dest="notimestamps", action='store_true', help="Log... | gpl-3.0 |
davidnmurray/iris | lib/iris/tests/test_coord_categorisation.py | 14 | 7923 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 License, or
# (at your option) any l... | gpl-3.0 |
kvar/ansible | lib/ansible/modules/cloud/hcloud/hcloud_rdns.py | 14 | 6766 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# 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 = {
"met... | gpl-3.0 |
SAM-IT-SA/odoo | addons/document/report/__init__.py | 444 | 1068 | # -*- 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 |
dfunckt/django | tests/model_fields/test_foreignkey.py | 42 | 3522 | from decimal import Decimal
from django.apps import apps
from django.core import checks
from django.db import models
from django.test import TestCase, skipIfDBFeature
from django.test.utils import isolate_apps
from django.utils import six
from .models import Bar, FkToChar, Foo, PrimaryKeyCharModel
class ForeignKeyT... | bsd-3-clause |
StealthMicro/OctoPi-Makerbot | env/Lib/site-packages/makerbot_driver/MachineDetector.py | 2 | 6210 | """
A MachineDetector is used to find 'probable' machines that are connected
to a computer, primarly by USB connection. It can detect multiple machines
by passing multiple machine names.
Currently machines are detected by VID/PID (vendorID/productID) of
connected USB devices, although this can be extended in the futur... | agpl-3.0 |
sgallagher/origin | .tito/lib/origin/builder/__init__.py | 22 | 4771 | """
Code for building Origin
"""
import sys
import json
from tito.common import (
get_latest_commit,
get_latest_tagged_version,
check_tag_exists,
run_command,
find_spec_file,
get_spec_version_and_release,
munge_specfile
)
from tito.builder import Builder
class OriginBuilder(Builder):
... | apache-2.0 |
heracek/django-nonrel | django/utils/simplejson/encoder.py | 430 | 15620 | """Implementation of JSONEncoder
"""
import re
c_encode_basestring_ascii = None
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(r'[\x80-\xff]')
ESCAPE_DCT = {
'\\': '\\\\',
'"': '\\"',
'\b': '\\b',
'\f': '\\f',
... | bsd-3-clause |
xarg/rview | encoder/tasks.py | 1 | 3778 | import os
from os import listdir
from os.path import join
import time
import traceback
import logging
from invoke import run, task
import dateutil.parser
import cv2
logging.basicConfig()
logger = logging.getLogger("tasks")
MEDIA_PATH = join(os.path.dirname(__file__), "static")
ENCONDE_CMD = "mencoder -nosound -ovc l... | mit |
dudonwai/dudonsblog | Lib/site-packages/gunicorn/workers/_gaiohttp.py | 39 | 3930 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import asyncio
import functools
import logging
import os
import gunicorn.workers.base as base
from aiohttp.wsgi import WSGIServerHttpProtocol
class AiohttpWorker(base.Worker):
def __in... | mit |
NL66278/OCB | addons/account/wizard/account_report_common_account.py | 371 | 1922 | # -*- 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 |
jmcorgan/gnuradio | gr-wxgui/python/wxgui/scopesink_nongl.py | 58 | 22768 | #!/usr/bin/env python
#
# Copyright 2003,2004,2006,2007,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... | gpl-3.0 |
eceglov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py | 119 | 23727 | # Copyright (C) 2011 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 f... | bsd-3-clause |
giannitedesco/kapital | monop/simplestrategy.py | 1 | 3912 | from strategy import Strategy
import gobject
class SimpleStrategy(Strategy):
def __init__(self):
super(SimpleStrategy, self).__init__()
def do_raise_cash(self, target, hand):
raised = 0
(monopolies, crap) = self.split_hand(hand)
# first try mortgage properties that are not
# part of monopolies
for e i... | gpl-3.0 |
niknow/scipy | scipy/sparse/linalg/dsolve/setup.py | 43 | 1728 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join, dirname
import sys
import os
import glob
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
... | bsd-3-clause |
yk5/incubator-airflow | airflow/contrib/operators/gcs_to_bq.py | 7 | 11904 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/idlelib/FormatParagraph.py | 82 | 5733 | # Extension to format a paragraph
# Does basic, standard text formatting, and also understands Python
# comment blocks. Thus, for editing Python source code, this
# extension is really only suitable for reformatting these comment
# blocks or triple-quoted strings.
# Known problems with comment reformatting:
# * If t... | apache-2.0 |
squirrelo/qiime | scripts/make_otu_network.py | 15 | 7699 | #!/usr/bin/env python
# File created on 09 Feb 2010
from __future__ import division
__author__ = "Julia Goodrich"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Julia Goodrich", "Jose Carlos Clemente Litran"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jose Clemente"
__email__ ... | gpl-2.0 |
tdent/pycbc | pycbc/inference/models/marginalized_gaussian_noise.py | 5 | 25814 | # Copyright (C) 2018 Charlie Hoy, Collin Capano
# 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 dis... | gpl-3.0 |
chiamingyen/pygroup_sqlite | wsgi/static/Brython2.1.4-20140810-083054/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | gpl-2.0 |
luceatnobis/youtube-dl | youtube_dl/extractor/turbo.py | 50 | 2431 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
qualities,
xpath_text,
)
class TurboIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?turbo\.fr/videos-voiture... | unlicense |
Cisco-Talos/pyrebox | volatility/volatility/plugins/overlays/windows/win8_sp0_x86_syscalls.py | 13 | 53714 | syscalls = [
[
'NtWorkerFactoryWorkerReady', # 0x0
'NtYieldExecution', # 0x1
'NtWriteVirtualMemory', # 0x2
'NtWriteRequestData', # 0x3
'NtWriteFileGather', # 0x4
'NtWriteFile', # 0x5
'NtWaitLowEventPair', # 0x6
'NtWaitHighEventPair', # 0x7
'NtWaitForWorkViaWorkerFactory', # 0x8
... | gpl-2.0 |
Elbagoury/odoo | addons/mail/mail_vote.py | 439 | 1647 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
alanquillin/quark | quark/db/migration/alembic/cli.py | 6 | 7166 | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | apache-2.0 |
ChinaQuants/bokeh | scripts/devdeps.py | 10 | 2161 | from __future__ import print_function
from os import path
try:
import colorama
def blue(text): return "%s%s%s" % (colorama.Fore.BLUE, text, colorama.Style.RESET_ALL)
def red(text): return "%s%s%s" % (colorama.Fore.RED, text, colorama.Style.RESET_ALL)
except ImportError:
def blue(text) : return text
... | bsd-3-clause |
kevin-coder/tensorflow-fork | tensorflow/contrib/eager/python/examples/linear_regression/linear_regression_test.py | 39 | 3969 | # 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 |
Mlieou/leetcode_python | leetcode/python/ex_297.py | 6 | 1185 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Codec:
def serialize(self, root):
"""Encodes a tree to a single string.
:type root: TreeNode
:rtype: str
... | mit |
vlahm/simplefc | simplefc/commands/delete_set.py | 1 | 1360 | """delete a flashcard set"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import input
from builtins import str
from future import standard_library
standard_library.install_aliases()
from .base import ... | gpl-3.0 |
marcioweck/PSSLib | reference/deap/deap/benchmarks/movingpeaks.py | 19 | 18519 | # This file is part of DEAP.
#
# DEAP 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 License, or (at your option) any later version.
#
# DEAP is distributed ... | lgpl-3.0 |
Kvoti/ditto | ditto/comments/api.py | 1 | 1717 | from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django_comments.models import Comment
from rest_framework import serializers, generics, filters
class CommentSerializer(serializers.ModelSerializer):
user = serializers.SlugRelatedField(slug_field='usernam... | bsd-3-clause |
ckirby/django | django/contrib/gis/gdal/datasource.py | 357 | 4777 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... | bsd-3-clause |
markneville/nupic | src/nupic/research/temporal_memory.py | 15 | 28377 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_4/django/contrib/localflavor/it/util.py | 436 | 1807 | from django.utils.encoding import smart_str, smart_unicode
def ssn_check_digit(value):
"Calculate Italian social security number check digit."
ssn_even_chars = {
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
'9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ... | mit |
Bergurth/anagram8 | newAnagram2.py | 1 | 6381 | import sys
import re
from substring import *
from itertools import combinations
from collections import defaultdict
if len(sys.argv) < 2: #check for whether input specified or not
print "No jumbled word specified.Please enter a jumbled word."
sys.exit(0)
input_string = sys.argv[1]
uni_input = unicode(input_... | gpl-2.0 |
chubbymaggie/reverse | plasma/lib/fileformat/relocations/__init__.py | 4 | 1184 | import sys
from .generic import Relocation
from .defines import defines
from plasma.lib.utils import warning
from . import arm64, i386, mips64, ppc64, amd64, arm, mips, ppc
ALL_RELOCATIONS = {}
complaint_log = set()
def load_relocations():
for module in [arm64, i386, mips64, ppc64, amd64, arm, mips, ppc]:
... | gpl-3.0 |
hugobowne/scikit-learn | sklearn/externals/joblib/parallel.py | 31 | 35665 | """
Helpers for embarrassingly parallel code.
"""
# Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org >
# Copyright: 2010, Gael Varoquaux
# License: BSD 3 clause
from __future__ import division
import os
import sys
import gc
import warnings
from math import sqrt
import functools
import time
import thr... | bsd-3-clause |
pedrobaeza/OpenUpgrade | addons/l10n_at/account_wizard.py | 379 | 1234 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
guoxiaolongzte/spark | examples/src/main/python/mllib/gradient_boosting_regression_example.py | 106 | 2443 | #
# 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 us... | apache-2.0 |
erudit/eruditorg | eruditorg/apps/public/site_messages/migrations/0002_auto_20190425_1305.py | 1 | 1845 | # Generated by Django 2.0.13 on 2019-04-25 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("site_message", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="TargetSite",
fields=[
... | gpl-3.0 |
danlurie/C-PAC | CPAC/cwas/tests/features/steps/step_conn-dists_connectir.py | 5 | 3112 | from base_cwas import *
@given('a connectir-based distance folder "{sdir}"')
def step(context, sdir):
bigmemory = importr('bigmemory')
# Distances
sfile = op.join(sdir, "subdist.desc")
dmats = np.array(robjects.r("as.matrix(attach.big.matrix('%s'))" % sfile))
context.nobs = n... | bsd-3-clause |
NaturalGIS/naturalgis_qgis | python/plugins/processing/gui/PointMapTool.py | 30 | 1470 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PointMapTool.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***********... | gpl-2.0 |
edx-solutions/edx-platform | openedx/core/djangoapps/password_policy/settings/common.py | 24 | 1798 | """
Default settings for the password_policy app.
"""
def plugin_settings(settings):
"""
Adds default settings for the password_policy app.
"""
# Settings for managing the rollout of password policy compliance enforcement.
settings.PASSWORD_POLICY_COMPLIANCE_ROLLOUT_CONFIG = {
# Global swi... | agpl-3.0 |
yfried/ansible | test/units/module_utils/urls/test_generic_urlparse.py | 144 | 1919 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils.urls import generic_urlparse
from ansible.module_u... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.