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 |
|---|---|---|---|---|---|
yunhaowang/IDP-APA | utilities/py_idpapa_sam2gpd_for_sr_polya.py | 1 | 4906 | #!/usr/bin/env python
import sys,re,time,argparse
def main(args):
# print >>sys.stdout, "Start analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
output_gpd(args.input,args.output,args.length,args.ratio)
# print >>sys.stdout, "Finish analysis: " + time.strftime("%a,%d %b %Y %H:%M:%S")
def extract_exon_length_from_c... | apache-2.0 |
GovReady/govready-q | tools/simple_sar_server/sar_etl.py | 1 | 3675 | #!/usr/bin/env python3
########################################################
#
# A simple middleware to submit a scan report
# assessment results
#
# Usage:
# python sar_etl.py <apikey> <sar_service_url> [-s <system_id>] [-d <deployment_uuid>]
#
# Example:
# python sar_etl.py eCXZbZwmBrtD5hgrJ8ptmJfvDA5vlDcc ht... | gpl-3.0 |
huggingface/transformers | scripts/fsmt/fsmt-make-tiny-model.py | 2 | 2179 | #!/usr/bin/env python
# coding: utf-8
# Copyright 2020 The HuggingFace Team. 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/LICENS... | apache-2.0 |
alkyl1978/gnuradio | gr-blocks/python/blocks/qa_throttle.py | 57 | 1201 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# ... | gpl-3.0 |
mread/buck | third-party/py/pathlib/test_pathlib.py | 1 | 77169 | import collections
import io
import os
import errno
import pathlib
import pickle
import shutil
import socket
import stat
import sys
import tempfile
import unittest
from contextlib import contextmanager
if sys.version_info < (2, 7):
try:
import unittest2 as unittest
except ImportError:
raise Imp... | apache-2.0 |
mitocw/edx-platform | common/djangoapps/course_action_state/tests/test_rerun_manager.py | 4 | 3853 | """
Tests specific to the CourseRerunState Model and Manager.
"""
from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator
from six import text_type
from course_action_state.managers import CourseRerunUIStateManager
from course_action_state.models import CourseRerunState
from student.test... | agpl-3.0 |
tonnrueter/pymca_devel | PyMca/Median2DBrowser.py | 1 | 7064 | #/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This toolkit is free software; you can redistribute it and/or m... | gpl-2.0 |
opendot/dotManager | main.py | 1 | 23979 | import sys
import random
from PyQt4 import QtGui, QtCore
from RFID import *
from DrupalConnector import *
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.initUI()
self.checkCardReader()
def initUI(self):
cWidget = QtGui.QWidget(self)
vBox = QtG... | gpl-2.0 |
cgourlay/readthedocs.org | readthedocs/projects/migrations/0002_add_vcs_type.py | 5 | 7574 | # encoding: 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):
# Adding field 'Project.repo_type'
db.add_column('projects_project', 'repo_type', self.gf('django.db.models.fields... | mit |
eudicots/Cactus | cactus/skeleton/plugins/sprites.disabled.py | 10 | 1164 | import os
import sys
import pipes
import shutil
import subprocess
"""
This plugin uses glue to sprite images:
http://glue.readthedocs.org/en/latest/quickstart.html
Install:
(Only if you want to sprite jpg too)
brew install libjpeg
sudo easy_install pip
sudo pip uninstall pil
sudo pip install pil
sudo pip install gl... | bsd-3-clause |
gregdek/ansible | lib/ansible/modules/network/junos/junos_config.py | 4 | 14862 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by 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',
... | gpl-3.0 |
neilLasrado/erpnext | erpnext/stock/stock_balance.py | 1 | 9558 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.utils import flt, cstr, nowdate, nowtime
from erpnext.stock.utils import update_bin
from erpnext.stock.stock_l... | gpl-3.0 |
dajohnso/cfme_tests | cfme/infrastructure/host.py | 1 | 22049 | # -*- coding: utf-8 -*-
"""A model of an Infrastructure Host in CFME."""
from functools import partial
from navmazing import NavigateToSibling, NavigateToAttribute
from manageiq_client.api import APIException
from selenium.common.exceptions import NoSuchElementException
from cfme.base.credential import Credential as ... | gpl-2.0 |
manhong2112/CodeColle | Python/Pygame/pygame~/examples/macosx/macfont.py | 17 | 4486 | """
EXPERIMENTAL CODE!
Here we load a .TTF font file, and display it in
a basic pygame window. It demonstrates several of the
Font object attributes. Nothing exciting in here, but
it makes a great example for basic window, event, and
font management.
"""
import pygame
import math
from pygame.locals import *
from pyg... | mit |
googleads/google-ads-python | google/ads/googleads/v6/enums/types/app_payment_model_type.py | 1 | 1113 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 o... | apache-2.0 |
ElDeveloper/scikit-learn | sklearn/datasets/tests/test_svmlight_format.py | 228 | 11221 | from bz2 import BZ2File
import gzip
from io import BytesIO
import numpy as np
import os
import shutil
from tempfile import NamedTemporaryFile
from sklearn.externals.six import b
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert... | bsd-3-clause |
bnprk/django-oscar | src/oscar/apps/customer/app.py | 48 | 10703 | from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views import generic
from oscar.core.application import Application
from oscar.core.loading import get_class
class CustomerApplication(Application):
name = 'customer'
summary_view = get_class('customer.view... | bsd-3-clause |
sergey-shandar/autorest | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/fixtures/acceptancetestslro/operations/lro_retrys_operations.py | 14 | 25071 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
cristian99garcia/pilas-activity | pilas/actores/mapa.py | 1 | 4881 | # -*- encoding: utf-8 -*-
# Pilas engine - A video game framework.
#
# Copyright 2010 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import pilas
from pilas.actores import Actor
class Mapa(Actor):
"""Representa mapas creados a partir de ... | gpl-3.0 |
pinkavaj/rstt | gr-rstt/python/nle2.py | 1 | 4939 | #!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
import sys
class Src:
def __init__(self, fname, block_size, navg = 1):
self.offs = 0
self.navg = navg
self.block_size = block_size
self.data = np.fromfile(fname, dtype=np.float32)
l = divmod(len(self.dat... | apache-2.0 |
PingPesto/BitList | bitlist/views.py | 1 | 4399 | from bitlist.models.user import User
from bitlist.models.song import Song
from bitlist.models.playlist import Playlist
import jobs
import json
import player
from pyramid.security import remember
from pyramid.security import forget
from pyramid.view import view_config
from pyramid.view import forbidden_view_config
from ... | gpl-3.0 |
sillywilly42/simian | src/simian/settings.py | 1 | 24724 | #!/usr/bin/env python
#
# Copyright 2016 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 require... | apache-2.0 |
scotthartbti/android_external_chromium_org | build/protoc_java.py | 90 | 1317 | #!/usr/bin/env python
# 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.
"""Generate java source files from protobufs
Usage:
protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}... | bsd-3-clause |
Barrog/C4-Datapack | data/jscript/quests/7_ATripBegins/__init__.py | 1 | 3040 | # Created by CubicVirtuoso
# Any problems feel free to drop by #l2j-datapack on irc.freenode.net
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
#NPCs
MIRABEL = 7146
ARI... | gpl-2.0 |
hpcloud-mon/monasca-perf | monasca_perf/influx_load.py | 1 | 2171 | from urlparse import urlparse
from threading import Thread
import httplib, sys, multiprocessing
from Queue import Queue
import simplejson
import time
import base64
num_processes = int(sys.argv[1])
num_threads = int(sys.argv[2])
num_requests = int(sys.argv[3])
num_metrics_per_request = int(sys.argv[4])
series_name = sy... | apache-2.0 |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/pywin32-219-py2.7-win32.egg/Demos/security/setuserobjectsecurity.py | 40 | 3016 | import win32security,win32api,win32con, win32process
new_privs = ((win32security.LookupPrivilegeValue('',win32security.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED),
(win32security.LookupPrivilegeValue('',win32security.SE_TCB_NAME),win32con.SE_PRIVILEGE_ENABLED),
(win32security.LookupPrivil... | mit |
torchingloom/edx-platform | common/test/acceptance/tests/test_video_module.py | 1 | 8440 | # -*- coding: utf-8 -*-
"""
Acceptance tests for Video.
"""
from .helpers import UniqueCourseTest
from ..pages.lms.video import VideoPage
from ..pages.lms.tab_nav import TabNavPage
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.lms.course_info import CourseInfoPage
from ..fixtures.course import Course... | agpl-3.0 |
shahbaz17/zamboni | mkt/search/utils.py | 11 | 2062 | from math import log10
from django.core.exceptions import ObjectDoesNotExist
from elasticsearch_dsl.search import Search as dslSearch
from statsd import statsd
from mkt.constants.base import VALID_STATUSES
class Search(dslSearch):
def execute(self):
with statsd.timer('search.execute'):
res... | bsd-3-clause |
abhidrona/gn-osc-custom | sites/demo/apps/order/migrations/0012_auto__add_field_paymentevent_reference.py | 16 | 33636 | # -*- 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):
# Adding field 'PaymentEvent.reference'
db.add_column('order_paymentevent', 'reference',
... | bsd-3-clause |
oeeagle/quantum | neutron/tests/unit/nec/test_nec_agent.py | 8 | 15285 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 NEC Corporation. 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.or... | apache-2.0 |
tyll/fas | fas/openssl_fas.py | 11 | 3067 | # Pretty much all copied from pyOpenSSL's certgen.py example and func's certs.py
# func's certs.py is GPLv2+
# pyOpenSSL is LGPL (Probably v2+)
# The pyOpenSSL examples may be under the same license but I'm not certain.
from OpenSSL import crypto
TYPE_RSA = crypto.TYPE_RSA
TYPE_DSA = crypto.TYPE_DSA
def retrieve_key_... | gpl-2.0 |
omelnic/sphinxsearch | api/test.py | 53 | 3218 | #
# $Id$
#
from sphinxapi import *
import sys, time
if not sys.argv[1:]:
print "Usage: python test.py [OPTIONS] query words\n"
print "Options are:"
print "-h, --host <HOST>\tconnect to searchd at host HOST"
print "-p, --port\t\tconnect to searchd at port PORT"
print "-i, --index <IDX>\tsearch through index(es) s... | gpl-2.0 |
40223101/w17test | static/Brython3.1.3-20150514-095342/Lib/http/cookies.py | 735 | 20810 | #!/usr/bin/env python3
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in... | gpl-3.0 |
savoirfairelinux/odoo | addons/sale_mrp/__openerp__.py | 61 | 1935 | # -*- 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 |
KanchanChauhan/erpnext | erpnext/startup/notifications.py | 4 | 1797 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
def get_notification_config():
return { "for_doctype":
{
"Issue": {"status": "Open"},
"Warranty Claim": {"status": "Open"},
"Task": {"statu... | gpl-3.0 |
eoogbe/api-client-staging | generated/python/googleapis-common-protos/google/api/system_parameter_pb2.py | 17 | 6134 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/api/system_parameter.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ... | bsd-3-clause |
fxia22/ASM_xf | PythonD/lib/python2.4/distutils/archive_util.py | 4 | 6235 | """distutils.archive_util
Utility functions for creating archive files (tarballs, zip files,
that sort of thing)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: archive_util.py,v 1.17 2004/11/10 22:23:13 loewis Exp $"
import os
from distutils.errors import DistutilsExecError
from d... | gpl-2.0 |
mattbasta/amo-validator | validator/testcases/javascript/call_definitions.py | 1 | 37806 | import math
import re
import types
import actions
import traverser as js_traverser
import predefinedentities
from jstypes import *
from validator.constants import BUGZILLA_BUG
from validator.compat import (FX6_DEFINITION, FX7_DEFINITION, FX8_DEFINITION,
FX9_DEFINITION, FX11_DEFINITION, TB... | bsd-3-clause |
pigeonflight/strider-plone | docker/appengine/lib/django-1.2/tests/regressiontests/model_regress/tests.py | 39 | 6781 | import datetime
from operator import attrgetter
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import DEFAULT_DB_ALIAS
from django.test import TestCase
from django.utils import tzinfo
from models import (Worker, Article, Party, Event, Department,
BrokenUnicodeMe... | mit |
cmbiwer/pycbc | pycbc/events/coinc.py | 4 | 43750 | # Copyright (C) 2015 Alex Nitz
#
# 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 |
CS-SI/QGIS | tests/src/python/test_qgsvectorlayer.py | 5 | 116398 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVectorLayer.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
uchuutamashi/6s096-Project | third_party/gtest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 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 o... | unlicense |
Ooblioob/collab | core/search/migrations/0001_initial.py | 5 | 1468 | # -*- 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):
# Adding model 'SearchableTool'
db.create_table('search_searchabletool', (
('id', self.gf(
... | cc0-1.0 |
vrkansagara/YouCompleteMe | python/ycm/tests/vimsupport_test.py | 17 | 21475 | #!/usr/bin/env python
#
# Copyright (C) 2015 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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... | gpl-3.0 |
Nitaco/ansible | lib/ansible/modules/web_infrastructure/acme_account.py | 5 | 10667 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.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
ANSIBLE_METADATA = {'metadata_versio... | gpl-3.0 |
ricmoo/pycoind | pycoind/util/pyaes/__init__.py | 1 | 2000 | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | mit |
pipermerriam/flex | tests/core/test_request_response_objects.py | 1 | 1186 | import json
from tests.factories import (
RequestFactory,
ResponseFactory,
)
def test_path_property():
request = RequestFactory(url='http://www.example.com/blog/25')
assert request.path == '/blog/25'
def test_query_property():
request = RequestFactory(url='http://www.example.com/api/?token=1234... | mit |
cytec/SickRage | sickbeard/metadata/helpers.py | 8 | 1427 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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... | gpl-3.0 |
Huskerboy/startbootstrap-freelancer | freelancer_env/Lib/importlib/_bootstrap_external.py | 14 | 53530 | """Core implementation of path-based import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public... | mit |
jzmq/pinot | pinot-core/src/test/resources/generate-test-data.py | 13 | 1397 | #!/usr/bin/env python
import sys
import argparse
from fastavro import writer
parser = argparse.ArgumentParser()
parser.add_argument('output_file', help='Output Avro data file')
parser.add_argument('--num_records', dest='num_records', default=1024, type=int, help='Number of records to generate (default: 1024)')
parser.... | apache-2.0 |
emilhetty/home-assistant | homeassistant/components/notify/googlevoice.py | 6 | 1966 | """
Google Voice SMS platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.google_voice/
"""
import logging
from homeassistant.components.notify import (
ATTR_TARGET, DOMAIN, BaseNotificationService)
from homeassistant... | mit |
shipci/boto | boto/sdb/queryresultset.py | 153 | 3674 | from boto.compat import six
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 t... | mit |
catsop/CATMAID | django/applications/catmaid/control/tree_util.py | 6 | 8539 | # A 'tree' is a networkx.DiGraph with a single root node (a node without parents)
from operator import itemgetter
from networkx import Graph, DiGraph
from collections import defaultdict
from math import sqrt
from itertools import izip, islice
from catmaid.models import Treenode
def find_root(tree):
""" Search and... | gpl-3.0 |
brokenjacobs/ansible | test/units/modules/network/ovs/test_openvswitch_bridge.py | 76 | 8367 | #
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
roopali8/keystone | keystone/contrib/federation/migrate_repo/versions/007_add_remote_id_table.py | 5 | 1590 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
xmendez/wfuzz | tests/filters/test_filter.py | 1 | 2559 | import pytest
@pytest.mark.parametrize(
"filter_string, expected_result",
[
("h=28 or w=6 or l=2", True),
("r.params.get.param2='2'", True),
("r.headers.response.Location", "https://wfuzz.readthedocs.io/en/latest/"),
("r.headers.response.notthere", {}),
("r.params.get.n... | gpl-2.0 |
chiviak/CouchPotatoServer | libs/bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | gpl-3.0 |
blindroot/django-configurations | configurations/importer.py | 6 | 7851 | import imp
import logging
import os
import sys
from optparse import OptionParser, make_option
from django import VERSION as DJANGO_VERSION
from django.conf import ENVIRONMENT_VARIABLE as SETTINGS_ENVIRONMENT_VARIABLE
from django.core.exceptions import ImproperlyConfigured
from django.core.management import base
from ... | bsd-3-clause |
pipermerriam/populus | populus/utils/cli.py | 1 | 8587 | from __future__ import absolute_import
import itertools
import logging
import time
import click
from populus.compilation import (
compile_project_contracts,
)
from .accounts import (
is_account_locked,
)
from .compile import (
write_compiled_sources,
)
from .contracts import (
verify_contract_byteco... | mit |
vmindru/ansible | lib/ansible/modules/cloud/google/gcp_compute_backend_service_facts.py | 9 | 15181 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
NullSoldier/django | tests/admin_inlines/tests.py | 7 | 44052 | from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from... | bsd-3-clause |
MrOrioleCashback/snippets | TPCh13.py | 1 | 2805 | import string, random
words = open("Alice's Adventures in Wonderland by Lewis Carroll.txt").read().split('\n')
xwords = open('words.txt').read().split('\n')
emma = open('Emma by Jane Austen.txt').read().split('\n')
def break_book_into_words(book):
#apostrophes are a problem, don't => dont
lower_book = ''
... | mit |
alrifqi/django | django/utils/baseconv.py | 650 | 2982 | # Copyright (c) 2010 Guilherme Gondim. All rights reserved.
# Copyright (c) 2009 Simon Willison. All rights reserved.
# Copyright (c) 2002 Drew Perttula. All rights reserved.
#
# License:
# Python Software Foundation License version 2
#
# See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF
# ... | bsd-3-clause |
pokelondon/pokeradio | web/pokeradio/history/migrations/0002_auto__add_field_artist_spotify_artist_href.py | 1 | 5505 | # -*- 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):
# Adding field 'Artist.spotify_artist_href'
db.add_column(u'history_artist', 'spotify_artist_href',
... | gpl-3.0 |
J861449197/edx-platform | lms/djangoapps/courseware/features/problems.py | 98 | 6831 | '''
Steps for problem.feature lettuce tests
'''
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import PROBLEM_DICT, answer_problem, problem_has_answer, add_problem_to_... | agpl-3.0 |
NMGRL/pychron | pychron/core/ui/display_editor.py | 2 | 1224 | # ===============================================================================
# Copyright 2013 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | apache-2.0 |
sydhenry/cookiecutter-django | cookiecutter-django/users/tests/test_admin.py | 264 | 1308 | from test_plus.test import TestCase
from ..admin import MyUserCreationForm
class TestMyUserCreationForm(TestCase):
def setUp(self):
self.user = self.make_user()
def test_clean_username_success(self):
# Instantiate the form with a new username
form = MyUserCreationForm({
... | bsd-3-clause |
sknepneklab/SAMoS | configurations/MakeConfigurations/regular_rods.py | 1 | 4354 | # * *************************************************************
# *
# * Soft Active Mater on Surfaces (SAMoS)
# *
# * Author: Rastko Sknepnek
# *
# * Division of Physics
# * School of Engineering, Physics and Mathematics
# * University of Dundee
# *
# * (c) 2013, 2014
# *
# * School of Scienc... | gpl-3.0 |
sathnaga/virt-test | virttest/libvirt_xml/network_xml.py | 2 | 14137 | """
Module simplifying manipulation of XML described at
http://libvirt.org/formatnetwork.html
"""
import logging
from virttest import virsh, xml_utils
from virttest.libvirt_xml import base, xcepts, accessors
class RangeList(list):
"""
A list of start & end address tuples
"""
def __init__(self, iterab... | gpl-2.0 |
laurent-george/weboob | modules/lcl/enterprise/browser.py | 1 | 4998 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Romain Bignon, Pierre Mazière, Noé Rubinstein
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | agpl-3.0 |
jonparrott/gcloud-python | bigtable/docs/conf.py | 3 | 10244 | # -*- coding: utf-8 -*-
#
# google-cloud-bigtable documentation build configuration file
#
# 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.
#
# All configuration values have a default; values ... | apache-2.0 |
xiandiancloud/edx-platform | lms/djangoapps/courseware/tests/test_word_cloud.py | 36 | 8306 | # -*- coding: utf-8 -*-
"""Word cloud integration tests using mongo modulestore."""
import json
from operator import itemgetter
from . import BaseTestXmodule
from xmodule.x_module import STUDENT_VIEW
class TestWordCloud(BaseTestXmodule):
"""Integration test for word cloud xmodule."""
CATEGORY = "word_cloud"... | agpl-3.0 |
mKeRix/home-assistant | homeassistant/components/wink/light.py | 21 | 3635 | """Support for Wink lights."""
import pywink
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
LightEntity,
)
from homeassistant.util import color as color_util
from homeassistant.util.color i... | mit |
OTL/rostensorflow | image_recognition.py | 1 | 1825 | import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import String
from cv_bridge import CvBridge
import cv2
import numpy as np
import tensorflow as tf
import classify_image
class RosTensorFlow():
def __init__(self):
classify_image.maybe_download_and_extract()
self._session = tf.Sessio... | apache-2.0 |
gfyoung/pandas | pandas/tests/arrays/boolean/test_logical.py | 7 | 8486 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.arrays import BooleanArray
from pandas.tests.extension.base import BaseOpsUtil
class TestLogicalOps(BaseOpsUtil):
def test_numpy_scalars_ok(self, all_logical_operators):
a = pd.array([True, Fals... | bsd-3-clause |
chrys87/orca-beep | test/keystrokes/firefox/line_nav_lists.py | 1 | 9274 | #!/usr/bin/python
"""Test of HTML list presentation."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
# Work around some new quirk in Gecko that causes this test to fail if
# run via the test harness rather than manuall... | lgpl-2.1 |
CodigoSur/cyclope | cyclope/apps/polls/admin.py | 1 | 1951 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010-2013 Código Sur Sociedad Civil.
# All rights reserved.
#
# This file is part of Cyclope.
#
# Cyclope 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 Foundat... | gpl-3.0 |
zhuyongyong/crosswalk-test-suite | apptools/apptools-android-tests/apptools/create_package_abbreviated_command.py | 11 | 10018 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
DirectXMan12/nova-hacking | nova/api/openstack/compute/contrib/availability_zone.py | 3 | 7124 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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-... | apache-2.0 |
pombredanne/cogen | setup.py | 4 | 2337 | #!/usr/bin/python
try:
import setuptools
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import sys, os
from cogen import __version__ as version
setup(
name='cogen',
version=version,
description='''
Coroutines... | mit |
timothyparez/PyBitmessage | src/bitmessagecli.py | 2 | 72448 | #!/usr/bin/python2.7
# Created by Adam Melton (.dok) referenceing https://bitmessage.org/wiki/API_Reference for API documentation
# Distributed under the MIT/X11 software license. See http://www.opensource.org/licenses/mit-license.php.
# This is an example of a daemon client for PyBitmessage 0.4.2, by .dok (Version 0.... | mit |
eonpatapon/neutron | neutron/db/l3_db.py | 2 | 66385 | # Copyright 2012 VMware, 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 a... | apache-2.0 |
junhuac/MQUIC | depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/rsa/rsa/_version200.py | 177 | 15007 | """RSA module
Module for calculating large primes, and RSA encryption, decryption,
signing and verification. Includes generating public and private keys.
WARNING: this implementation does not use random padding, compression of the
cleartext input to prevent repetitions, or other common security improvements.
Use with... | mit |
singhkays/azure-quickstart-templates | 201-vmss-bottle-autoscale/workserver.py | 103 | 1704 | # workserver.py - simple HTTP server with a do_work / stop_work API
# GET /do_work activates a worker thread which uses CPU
# GET /stop_work signals worker thread to stop
import math
import socket
import threading
import time
from bottle import route, run
hostname = socket.gethostname()
hostport = 9000
keepworking = ... | mit |
nirmeshk/oh-mainline | vendor/packages/twisted/twisted/names/dns.py | 18 | 53586 | # -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
@author: Moshe Zadka
@author: Jean-Paul Calderone
"""
__all__ = [
'IEncodable', 'IRecord',
'A'... | agpl-3.0 |
babble/babble | include/jython/Lib/tabnanny.py | 394 | 11336 | #! /usr/bin/env python
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The ... | apache-2.0 |
GodBlessPP/cadp_w12 | wsgi/pybean.py | 562 | 8617 | #coding: utf-8
import sqlite3
from pkg_resources import parse_version
__version__ = "0.2.1"
__author__ = "Mickael Desfrenes"
__email__ = "desfrenes@gmail.com"
# Yen 2013.04.08, 將 Python2 的 .next() 改為 next(), 以便在 Python 3 中使用
class SQLiteWriter(object):
"""
In frozen mode (the default), the writer will not a... | gpl-3.0 |
vritant/subscription-manager | src/subscription_manager/release.py | 3 | 6540 | #
# Subscription manager command line utility. This script is a modified version of
# cp_client.py from candlepin scripts
#
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, inc... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/docutils/docutils/utils/math/math2html.py | 106 | 174512 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# math2html: convert LaTeX equations to HTML output.
#
# Copyright (C) 2009-2011 Alex Fernández
#
# Released under the terms of the `2-Clause BSD license'_, in short:
# Copying and distribution of this file, with or without modification,
# are permitted in any m... | agpl-3.0 |
openstack/python-openstacksdk | openstack/tests/functional/cloud/test_aggregate.py | 2 | 2014 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
phase-dev/phase | libmproxy/protocol/tcp.py | 1 | 2582 | from . import ProtocolHandler
import select, socket
from cStringIO import StringIO
class TCPHandler(ProtocolHandler):
"""
TCPHandler acts as a generic TCP forwarder.
Data will be .log()ed, but not stored any further.
"""
def handle_messages(self):
self.c.establish_server_connection()
... | gpl-3.0 |
tudorbarascu/QGIS | python/plugins/processing/algs/gdal/proximity.py | 15 | 9534 | # -*- coding: utf-8 -*-
"""
***************************************************************************
proximity.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | gpl-2.0 |
beiko-lab/gengis | bin/Lib/ctypes/test/test_funcptr.py | 4 | 4029 | import os, unittest
from ctypes import *
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
lib = CDLL(_ctypes_test.__file__)
class CFuncPtrTestCase(unittest.TestCase):
def test_basic(self):
X = WINFUNCTYPE(c_int, c... | gpl-3.0 |
cfarquhar/openstack-ansible | tests/test_filesystem.py | 2 | 3423 | #!/usr/bin/env python
#
# 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, softwar... | apache-2.0 |
eandersson/amqpstorm | amqpstorm/management/basic.py | 1 | 3707 | from amqpstorm.compatibility import json
from amqpstorm.compatibility import quote
from amqpstorm.management.base import ManagementHandler
from amqpstorm.message import Message
API_BASIC_PUBLISH = 'exchanges/%s/%s/publish'
API_BASIC_GET_MESSAGE = 'queues/%s/%s/get'
class Basic(ManagementHandler):
def publish(sel... | mit |
X-dark/Flexget | flexget/plugins/search_sceneaccess.py | 5 | 11553 | from __future__ import unicode_literals, division, absolute_import
import logging
import re
from urllib import quote
from flexget import plugin
from flexget import validator
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.soup import get_soup
from flexget.utils.search import torrent... | mit |
mambocab/cassandra-dtest | jmx_auth_test.py | 1 | 3388 | from distutils.version import LooseVersion
from ccmlib.node import NodetoolError
from dtest import Tester
from jmxutils import apply_jmx_authentication
from tools import known_failure, since
@since('3.6')
class TestJMXAuth(Tester):
@known_failure(failure_source='test',
jira_url='https://issu... | apache-2.0 |
tensorflow/datasets | tensorflow_datasets/image_classification/stanford_online_products.py | 1 | 3281 | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 |
Ervii/garage-time | garage/src/python/pants/base/payload.py | 2 | 3803 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from hashlib import ... | apache-2.0 |
DrMeers/django | django/conf/locale/sr/formats.py | 394 | 2011 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.