repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
SaberMod/binutils-saber | gdb/python/lib/gdb/command/explore.py | 126 | 26824 | # GDB 'explore' command.
# Copyright (C) 2012-2014 Free Software Foundation, 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 late... | gpl-2.0 |
sbalde/edxplatform | cms/djangoapps/contentstore/tests/test_transcripts_utils.py | 109 | 23402 | # -*- coding: utf-8 -*-
""" Tests for transcripts_utils. """
import unittest
from uuid import uuid4
import copy
import textwrap
from mock import patch, Mock
from django.test.utils import override_settings
from django.conf import settings
from django.utils import translation
from nose.plugins.skip import SkipTest
fro... | agpl-3.0 |
mtlchun/edx | lms/djangoapps/class_dashboard/views.py | 41 | 3837 | """
Handles requests for data, returning a json
"""
import logging
import json
from django.http import HttpResponse
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from courseware.courses import get_course_with_access
from courseware.access import has_access
from class_dashboard import dashboard_data
... | agpl-3.0 |
schieb/angr | angr/analyses/reaching_definitions/atoms.py | 1 | 3742 |
class Atom:
"""
This class represents a data storage location manipulated by IR instructions.
It could either be a Tmp (temporary variable), a Register, a MemoryLocation, or a Parameter.
"""
def __repr__(self):
raise NotImplementedError()
class GuardUse(Atom):
def __init__(self, targ... | bsd-2-clause |
hpe-storage/python-3parclient | hpe3parclient/http.py | 2 | 14843 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2012-2015 Hewlett Packard Enterprise Development LP
# 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 ... | apache-2.0 |
jmartinm/invenio-master | modules/websearch/lib/search_engine_summarizer.py | 18 | 15860 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011, 2012 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 (a... | gpl-2.0 |
WhireCrow/openwrt-mt7620 | staging_dir/host/lib/python2.7/test/test_doctest.py | 18 | 83664 | # -*- coding: utf-8 -*-
"""
Test script for doctest.
"""
import sys
from test import test_support
import doctest
# NOTE: There are some additional tests relating to interaction with
# zipimport in the test_zipimport_support test module.
######################################################################
## ... | gpl-2.0 |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/account/migrations/0002_initial.py | 2 | 12387 | # -*- 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 'Account'
db.create_table(u'account_account', (
... | mit |
wrshoemaker/ffpopsim | examples/genetic_drift.py | 2 | 2160 | '''
author: Richard Neher, Fabio Zanini
date: 11/07/12
content: Example on genetic drift using haploid_highd
'''
# Import modules (setting the path should not be necessary when the module is
# installed in the PYTHONPATH)
import sys
sys.path.insert(0, '../pkg/python')
import numpy as np
from matplotlib im... | gpl-3.0 |
ntrrgc/snorky | snorky/services/pubsub.py | 1 | 3143 | # 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/.
from snorky.services.base import RPCService, RPCError, rpc_command
from snorky.types import MultiDict
class PubSubServ... | mpl-2.0 |
palaniyappanBala/rekall | rekall-core/rekall/plugins/darwin/common.py | 1 | 26327 | # Rekall Memory Forensics
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 v... | gpl-2.0 |
swayf/pyLoad | module/plugins/hoster/Xdcc.py | 2 | 8399 | # -*- coding: utf-8 -*-
"""
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 distri... | agpl-3.0 |
sinkpoint/dipy | dipy/reconst/odf.py | 15 | 2057 | from __future__ import division, print_function, absolute_import
from .base import ReconstModel, ReconstFit
import numpy as np
# Classes OdfModel and OdfFit are using API ReconstModel and ReconstFit from
# .base
class OdfModel(ReconstModel):
"""An abstract class to be sub-classed by specific odf models
All ... | bsd-3-clause |
jspraul/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/gdata/test_data.py | 103 | 348233 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... | apache-2.0 |
acsone/purchase-workflow | purchase_fiscal_position_update/purchase.py | 23 | 2878 | # -*- coding: utf-8 -*-
#############################################################################
#
# Purchase Fiscal Position Update module for Odoo
# Copyright (C) 2011-2014 Julius Network Solutions SARL <contact@julius.fr>
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Mathieu Vate... | agpl-3.0 |
bblay/iris | lib/iris/experimental/animate.py | 3 | 4670 | # (C) British Crown Copyright 2013, 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 later ve... | gpl-3.0 |
amenonsen/ansible | lib/ansible/module_utils/network/frr/providers/cli/config/bgp/process.py | 38 | 5183 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
import re
from ansible.module_utils.six import iteritems
from ansible.module_utils.network.common.utils import to_list
from ansible.module_utils.network.frr.providers.providers import re... | gpl-3.0 |
7WebPages/coveragepy | tests/test_results.py | 3 | 3022 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Tests for coverage.py's results analysis."""
from coverage.results import Numbers
from tests.coveragetest import CoverageTest
class NumbersTest(CoverageTest):... | apache-2.0 |
MichaelNedzelsky/intellij-community | python/testData/inspections/PyStringFormatInspection/src/string-format.py | 39 | 3852 | '#%(language)s has %(#)03d quote types.' % {'language': "Python", "#": 2} #ok
'%d %s' % 5 #Too few arguments for format string
'Hello world' % 25 #Too many arguments for format string
"%(name)f(name)" % {'name': 23.2} #ok
"%()s" % {'': "name"} #ok
'test%(name)' % {'name': 23} #There are no format specifier character
... | apache-2.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/pipes.py | 46 | 9377 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | apache-2.0 |
SlimSaber/android_external_gtest | test/gtest_test_utils.py | 397 | 10437 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
maitesin/forner.io | post/urls.py | 1 | 1371 | from django.conf.urls import url, handler404
from . import views
urlpatterns = [
url(r'^$', views.IndexPostListView.as_view(), name="Blog"),
url(r'^(?P<year>[0-9]{4})/?$', views.YearPostListView.as_view(), name="Year"),
url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/?$', views.MonthPostListView.as_view(), ... | gpl-2.0 |
sbidoul/odoo | addons/survey_crm/survey.py | 385 | 2051 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
sekikn/incubator-airflow | airflow/providers/google/cloud/operators/kubernetes_engine.py | 7 | 13403 | #
# 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 |
tdsmith/ponysay | src/colourstack.py | 3 | 5198 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
ponysay - Ponysay, cowsay reimplementation for ponies
Copyright (C) 2012, 2013, 2014 Erkin Batu Altunbaş et al.
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 Softw... | gpl-3.0 |
yitian134/chromium | ppapi/generators/idl_option.py | 178 | 2662 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import getopt
import sys
from idl_log import ErrOut, InfoOut, WarnOut
OptionMap = { }
def GetOption(name):
if name not in OptionMap:
raise Runt... | bsd-3-clause |
AdrieleD/gr-mac1 | docs/doxygen/doxyxml/text.py | 19 | 1837 | #
# Copyright 2010 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.
#... | gpl-3.0 |
khs26/rotamer_library | rotamer/library/old_rotamer_data.py | 1 | 5430 | import numpy as np
import tables as ts
import playground.group_rotation.amino_acids as amino
import pele.amber.read_amber as ra
import playground.group_rotation.chirality as chir
import networkx as nx
class RotamerGroupTemplate(ts.IsDescription):
"""
A compound data type for interoperating with ROTAMER_GROUP_... | mit |
krafczyk/spack | var/spack/repos/builtin/packages/gslib/package.py | 2 | 3232 | ##############################################################################
# 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 |
Sabayon/entropy | server/eit/commands/repo.py | 1 | 7196 | # -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Infrastructure Toolkit}.
"""
import sys
import argparse
from entropy.i18n import _
from entropy.output import blue, darkgreen, purple, teal
f... | gpl-2.0 |
ifduyue/django | tests/forms_tests/field_tests/test_charfield.py | 14 | 6327 | from django.forms import (
CharField, HiddenInput, PasswordInput, Textarea, TextInput,
ValidationError,
)
from django.test import SimpleTestCase
from . import FormFieldAssertionsMixin
class CharFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_charfield_1(self):
f = CharField()
... | bsd-3-clause |
code-sauce/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/operator_pd_full_test.py | 33 | 2355 | # 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 |
garnaat/boto | boto/cloudhsm/__init__.py | 111 | 1654 | # Copyright (c) 2015 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 |
michael-weinstein/GATKbyDirectory | GATKbyDirectory0.1.py | 1 | 10718 | #!/usr/bin/env python3
import os
import re
def checkargs(): #subroutine for validating commandline arguments
import argparse #loads the required library for reading the commandline
parser = argparse.ArgumentParser()
parser.add_argument ("-T", "--analysis_type", help = "Which tool to run?") #tells the par... | gpl-3.0 |
flyfei/python-for-android | python3-alpha/python3-src/Lib/idlelib/CodeContext.py | 128 | 8353 | """CodeContext - Extension to display the block context above the edit window
Once code has scrolled off the top of a window, it can be difficult to
determine which block you are in. This extension implements a pane at the top
of each IDLE edit window which provides block structure hints. These hints are
the lines w... | apache-2.0 |
sanbinabu/Wox | PythonHome/Lib/site-packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
wzyuliyang/scrapy | scrapy/utils/benchserver.py | 130 | 1312 | import random
from six.moves.urllib.parse import urlencode
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
isLeaf = True
def getChild(self, name, request):
return self
def render(self, request):
tot... | bsd-3-clause |
cheral/orange3 | Orange/widgets/utils/overlay.py | 2 | 20113 | """
Overlay Message Widget
----------------------
A Widget to display a temporary dismissable message over another widget.
"""
import sys
import enum
import functools
import operator
from collections import namedtuple
from AnyQt.QtWidgets import (
QHBoxLayout, QPushButton, QLabel, QSizePolicy, QStyle, QAbstract... | bsd-2-clause |
IPVL/swift-kilo | swift/common/middleware/proxy_logging.py | 11 | 13396 | # Copyright (c) 2010-2011 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 agree... | apache-2.0 |
styxit/CouchPotatoServer | libs/requests/__init__.py | 68 | 1856 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('http://python.org')
>>> r.sta... | gpl-3.0 |
qiankunshe/sky_engine | testing/legion/rpc_methods.py | 15 | 2301 | # 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.
"""Defines the task RPC methods."""
import logging
import os
import sys
import threading
#pylint: disable=relative-import
import common_lib
import process
... | bsd-3-clause |
gerrit-review/gerrit | tools/version.py | 1 | 1745 | #!/usr/bin/env python
# Copyright (C) 2014 The Android Open Source Project
#
# 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 b... | apache-2.0 |
romain-li/edx-platform | common/lib/xmodule/xmodule/tests/test_textannotation.py | 83 | 3037 | # -*- coding: utf-8 -*-
"Test for Annotation Xmodule functional logic."
import unittest
from mock import Mock
from lxml import etree
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.textannotation_module import TextAnnotationModule
from . import get_test_system
class Tex... | agpl-3.0 |
0k/OpenUpgrade | openerp/tools/cache.py | 100 | 5907 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP (<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 |
nate-rcl/support-tools | wiki_to_md/wiki2gfm_test.py | 136 | 31840 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
pavelchristof/gomoku-ai | tensorflow/contrib/distributions/python/kernel_tests/bijectors/power_transform_test.py | 72 | 2610 | # 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 |
andreivasiliu2211/mraa | tests/mock/i2c_checks_read_byte_data.py | 21 | 2029 | #!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko.
#
# 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, includin... | mit |
itamarst/crochet | examples/downloader.py | 3 | 1415 | #!/usr/bin/python
"""
A flask web application that downloads a page in the background.
"""
import logging
from flask import Flask, session, escape
from crochet import setup, run_in_reactor, retrieve_result, TimeoutError
# Can be called multiple times with no ill-effect:
setup()
app = Flask(__name__)
@run_in_reacto... | mit |
davidharrigan/django | django/contrib/staticfiles/management/commands/findstatic.py | 463 | 1745 | from __future__ import unicode_literals
import os
from django.contrib.staticfiles import finders
from django.core.management.base import LabelCommand
from django.utils.encoding import force_text
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
label = 'static file... | bsd-3-clause |
numb3r3/kombu | examples/complete_send.py | 31 | 1152 | """
Example producer that sends a single message and exits.
You can use `complete_receive.py` to receive the message sent.
"""
from kombu import Connection, Producer, Exchange, Queue
#: By default messages sent to exchanges are persistent (delivery_mode=2),
#: and queues and exchanges are durable.
exchange = Exchan... | bsd-3-clause |
CT-Data-Collaborative/ctdata-wagtail-cms | ctdata_wagtail/users/migrations/0001_initial.py | 265 | 3054 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.contrib.auth.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
... | mit |
prezi/gunicorn | gunicorn/app/base.py | 37 | 5568 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from __future__ import print_function
import os
import sys
import traceback
from gunicorn._compat import execfile_
from gunicorn import util
from gunicorn.arbiter import Arbiter
from gunicorn... | mit |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/setuptools/command/build_ext.py | 27 | 13173 | import os
import sys
import itertools
import imp
from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler, get_config_var
from distutils.errors import DistutilsError
from d... | gpl-3.0 |
robbarnsley/macro_image_analysis | camera.py | 1 | 2666 | import os
import gphoto2 as gp
class CameraInterface():
def __init__(self, logger):
self.logger = logger
camera = None
context = None
def _captureImage(self):
'''
Takes an image and returns the corresponding path instance on the camera
SD card.
... | mit |
zvezdan/pip | src/pip/_vendor/distlib/scripts.py | 22 | 16585 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2015 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, detect_encoding, ZipFi... | mit |
tfeagle/mitmproxy | libmproxy/script.py | 9 | 5930 | from __future__ import absolute_import
import os
import traceback
import threading
import shlex
import sys
class ScriptError(Exception):
pass
class ScriptContext:
"""
The script context should be used to interact with the global mitmproxy state from within a
script.
"""
def __init__(self, ma... | mit |
sneaker-rohit/PI2-ns-3 | src/visualizer/visualizer/plugins/wifi_intrastructure_link.py | 182 | 4933 | import math
import ns.wifi
import ns.network
import goocanvas
from visualizer.base import Link, transform_distance_canvas_to_simulation
class WifiLink(Link):
def __init__(self, parent_canvas_item, sta, dev):
self.node1 = sta
self.dev = dev
self.node2 = None # ap
self.canvas_item = g... | gpl-2.0 |
sstoma/CellProfiler | cellprofiler/modules/tests/test_filterobjects.py | 2 | 91690 | '''test_filterbyobjectmeasurements.py: Test FilterByObjectMeasurements module
CellProfiler is distributed under the GNU General Public License.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad Institute
All rights reserved.
Plea... | gpl-2.0 |
xiaojingyi/tushare | tushare/internet/boxoffice.py | 7 | 7205 | # -*- coding:utf-8 -*-
"""
电影票房
Created on 2015/12/24
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
import pandas as pd
from tushare.stock import cons as ct
from tushare.util import dateu as du
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen... | bsd-3-clause |
ocefpaf/biggus | biggus/tests/unit/init/test_mean.py | 2 | 4693 | # (C) British Crown Copyright 2014, Met Office
#
# This file is part of Biggus.
#
# Biggus 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 late... | gpl-3.0 |
iABC2XYZ/abc | PIC4/ConfigLattice.py | 1 | 5266 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: Peiyong Jiang
作者: 姜培勇
jiangpeiyong@impcas.ac.cn
本文件解释:
"""
from ConfigInput import X,PX,Y,PY,Z,PZ,Q,M,QReal,freq
from Input import *
from Field import FieldAdd,FieldInter_2D,FieldInter_3D,FieldExtern_Drift
from Field import FieldExtern_AllPart
from Wi... | gpl-3.0 |
hilgroth/fiware-IoTAgent-Cplusplus | third_party/mosquitto-1.3.5/test/broker/03-pattern-matching.py | 25 | 3088 | #!/usr/bin/env python
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfo... | agpl-3.0 |
mrknow/filmkodi | plugin.video.fanfilm/resources/lib/libraries/f4mproxy/utils/rsakey.py | 148 | 8833 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Abstract class for RSA."""
from .cryptomath import *
class RSAKey(object):
"""This is an abstract base class for RSA keys.
Particular implementations of RSA keys, such as
L{openssl_rsakey.OpenSSL_RSAKey}... | apache-2.0 |
eonpatapon/contrail-controller | src/container/cni/cni/common/interface.py | 3 | 6506 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
"""
Module to manage interface inside a container
class Interface is base class. It is further derived to provide implementation
for veth-pair and macvlan interfaces
"""
import ctypes
import errno
import js... | apache-2.0 |
MTASZTAKI/ApertusVR | plugins/assetImporter/assimpAssetLoader/3rdParty/assimp/port/PyAssimp/pyassimp/postprocess.py | 3 | 23548 | # <hr>Calculates the tangents and bitangents for the imported meshes.
#
# Does nothing if a mesh does not have normals. You might want this post
# processing step to be executed if you plan to use tangent space calculations
# such as normal mapping applied to the meshes. There's a config setting,
# <tt>#AI_CONFIG_P... | mit |
chengdh/openerp-ktv | openerp/pychart/line_style.py | 15 | 5786 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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 vers... | agpl-3.0 |
py4a/peewee | playhouse/read_slave.py | 25 | 1449 | """
Support for using a dedicated read-slave. The read database is specified as a
Model.Meta option, and will be used for SELECT statements:
master = PostgresqlDatabase('master')
read_slave = PostgresqlDatabase('read_slave')
class BaseModel(ReadSlaveModel):
class Meta:
database = master
read_slav... | mit |
georgeke/caravel | caravel/data/countries.py | 20 | 51525 | """This module contains data related to countries and is used for geo mapping"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
countries = [
{
"name": "Angola",
"area": 1246700,
"cioc": "A... | apache-2.0 |
BillGuard/cabot | cabot/cabotapp/views.py | 1 | 23464 | from django.template import RequestContext, loader
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.core.urlresolvers import reverse_lazy
from django.conf import settings
from mod... | mit |
GovReady/govready-q | controls/migrations/0015_elementcommoncontrol.py | 1 | 1613 | # Generated by Django 3.0.7 on 2020-06-07 19:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('controls', '0014_auto_20200504_0003'),
]
operations = [
migrations.CreateModel(
name='ElementCo... | gpl-3.0 |
mcclung/pacemaker | shell/modules/xmlutil.py | 1 | 24547 | # Copyright (C) 2008 Dejan Muhamedagic <dmuhamedagic@suse.de>
#
# 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.1 of the License, or (at your option) any later version.
#
# ... | gpl-2.0 |
epitron/youtube-dl | youtube_dl/extractor/ndtv.py | 16 | 4606 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote_plus
)
from ..utils import (
parse_duration,
remove_end,
unified_strdate,
urljoin
)
class NDTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?ndt... | unlicense |
petemoore/git-repo | git_config.py | 12 | 19430 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 |
daniko/support-tools | wiki_to_md/impl/converter.py | 34 | 42218 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
motion2015/a3 | lms/djangoapps/mobile_api/social_facebook/friends/views.py | 85 | 2439 | """
Views for friends info API
"""
from rest_framework import generics, status
from rest_framework.response import Response
from opaque_keys.edx.keys import CourseKey
from student.models import CourseEnrollment
from ...utils import mobile_view
from ..utils import get_friends_from_facebook, get_linked_edx_accounts,... | agpl-3.0 |
moto-timo/ironpython3 | Src/StdLib/Lib/test/test_shutil.py | 3 | 74111 | # Copyright (C) 2003 Python Software Foundation
import unittest
import unittest.mock
import shutil
import tempfile
import sys
import stat
import os
import os.path
import errno
import functools
import subprocess
from contextlib import ExitStack
from shutil import (make_archive,
register_archive_form... | apache-2.0 |
kvar/ansible | test/units/modules/network/fortios/test_fortios_system_virtual_wire_pair.py | 21 | 8685 | # 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 |
Nikea/VisTrails | contrib/NumSciPy/ArrayIO.py | 6 | 12854 | import core.modules
import core.modules.module_registry
from core.modules.vistrails_module import Module, ModuleError
import numpy
import scipy
import scipy.io
import pylab
from Array import *
from Matrix import *
class ArrayIOModule(object):
my_namespace = 'numpy|io'
class NrrdHelper(object):
def __init__(se... | bsd-3-clause |
tasoc/photometry | notes/pixelcoord_of_camera_centre.py | 1 | 1673 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
.. codeauthor:: Rasmus Handberg <rasmush@phys.au.dk>
"""
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
import h5py
from astropy.wcs import WCS
import itertools
import os.path
from tqdm import trange
if __name__ == '__main__':
root... | gpl-3.0 |
Anonymouslemming/ansible | lib/ansible/plugins/lookup/passwordstore.py | 36 | 7799 | # (c) 2017, Patrick Deelman <patrick@patrickdeelman.nl>
#
# 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 l... | gpl-3.0 |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans_test.py | 23 | 14710 | # 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 |
Blizzard/heroprotocol | heroprotocol/versions/protocol49278.py | 27 | 25984 | #!/usr/bin/env python
#
# Copyright 2015-2021 Blizzard Entertainment. Subject to the MIT license.
# See the included LICENSE file for more information.
#
import six
from heroprotocol.decoders import CorruptedError, BitPackedBuffer, BitPackedDecoder, VersionedDecoder
# Decoding instructions for each protocol type.
t... | mit |
agx/linux-wpan-next | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
windj007/bulbs | docs/conf.py | 2 | 7426 | # -*- coding: utf-8 -*-
#
# Bulbflow documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 7 02:02:14 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | bsd-3-clause |
shahar-stratoscale/nova | nova/api/openstack/compute/plugins/v3/certificates.py | 15 | 2966 | # Copyright (c) 2012 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 ... | apache-2.0 |
pinry/pinry | core/models.py | 1 | 3376 | import requests
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db import models
from django.dispatch import receiver
from django_images.models import Image as BaseImage, Thumbnail
from taggit.managers import TaggableManager
from us... | bsd-2-clause |
mariaantoanelam/Licenta | Lib/test/test_thread.py | 7 | 2494 | # Very rudimentary test of thread module
# Create a bunch of threads, let each do some work, wait until all are done
from test_support import *
import whrandom
import thread
import time
print_test('thread (test_thread.py)', 1)
mutex = thread.allocate_lock()
whmutex = thread.allocate_lock() # for calls to whrandom
r... | mit |
gregdek/ansible | lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py | 26 | 107417 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
moniqx4/bite-project | deps/gdata-python-client/src/gdata/tlslite/SessionCache.py | 358 | 3470 | """Class for caching TLS sessions."""
import thread
import time
class SessionCache:
"""This class is used by the server to cache TLS sessions.
Caching sessions allows the client to use TLS session resumption
and avoid the expense of a full handshake. To use this class,
simply pass a SessionCache ins... | apache-2.0 |
Andrew-McNab-UK/DIRAC | DataManagementSystem/scripts/dirac-dms-user-lfns.py | 1 | 5368 | #!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
"""
Get the list of all the user files.
"""
__RCSID__ = "$Id$"
from DIRAC.Core.Base import Script
days = 0
months = 0
years = 0
wildcard = ... | gpl-3.0 |
noox-/stbgui-1 | lib/python/Components/opkg.py | 1 | 1470 | import os
def enumFeeds():
for fn in os.listdir('/etc/opkg'):
if fn.endswith('-feed.conf'):
try:
for feed in open(os.path.join('/etc/opkg', fn)):
yield feed.split()[1]
except IndexError:
pass
except IOError:
pass
def enumPlugins(filter_start=''):
for feed in enumFeeds():
package = None... | gpl-2.0 |
StratusLab/client | api/code/src/test/python/ConfigHolderTest.py | 1 | 2592 | #
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2011, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | apache-2.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/scipy/io/arff/arffread.py | 25 | 19838 | #! /usr/bin/env python
# Last Change: Mon Aug 20 08:00 PM 2007 J
from __future__ import division, print_function, absolute_import
import re
import itertools
import datetime
from functools import partial
import numpy as np
from scipy._lib.six import next
"""A module to read arff files."""
__all__ = ['MetaData', 'lo... | gpl-3.0 |
Stranger6667/pytest-browserstack | setup.py | 1 | 2618 | #!/usr/bin/env python
# coding: utf-8
import sys
import platform
from setuptools import setup
from setuptools.command.test import test as TestCommand
PYPY = hasattr(sys, 'pypy_translation_info')
PYPY3 = PYPY and sys.version_info[0] == 3
JYTHON = platform.system() == 'Java'
class PyTest(TestCommand):
user_optio... | mit |
honglioslo/NorwayIndexFlood | General10.py | 1 | 10720 | # -*- coding: latin_1 -*-
# General.py
#-----------------------------------------------------------------------------------
# Opprettet: 26.09.2008, IOPE
# Revidert:
#-----------------------------------------------------------------------------------
# Beskrivelse:
# Module for forkjellige generelle funksjoner
... | gpl-3.0 |
evanbiederstedt/RRBSfun | scripts/repeat_finder_scripts/faster_repeats/temp_RRBS_NormalBCD19pcell45_66.py | 1 | 1380 | import glob
import pandas as pd
import numpy as np
df1 = pd.read_csv("repeats_hg19.csv")
RRBS_files = glob.glob("RRBS_NormalBCD19pcell45_66*")
df_dict = {group : df for group, df in df1.groupby(by="chr")}
# In[11]:
from numpy import nan
def between_range(row, group_dict):
# get sub dataframe from dictionary... | mit |
bright-sparks/wpull | wpull/item.py | 1 | 8298 | # encoding=utf-8
'''URL items.'''
import collections
import gettext
import logging
from wpull.backport.logging import BraceMessage as __
from wpull.url import URLInfo
_ = gettext.gettext
_logger = logging.getLogger(__name__)
class Status(object):
'''URL status.'''
todo = 'todo'
'''The item has not yet ... | gpl-3.0 |
Mozu/mozu-python-sdk | mozurestsdk/commerce/catalog/admin/pricelists/pricelistentry.py | 1 | 8239 |
"""
This code was generated by Codezu.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
"""
from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozure... | apache-2.0 |
5outh/nanoscope-site | _site/bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 372 | 89149 | # Copyright (c) 2013 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.
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
import gyp.common
impo... | apache-2.0 |
dockeroo/dockeroo | dockeroo/docker/gentoo_diskimage.py | 1 | 7879 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016, Giacomo Cariello. 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
#
# Un... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.