code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# to calculate metrics, perform factor analysis, and generate visualizations.
import sys
sys.path.append("../")
import bandicoot as bc
import csv
import glob
import os
#Metrics, FA, Tensor, Visualization
def metrics():
records_path = 'records/'
antenna_file = 'antennas.csv'
indicators = []
for f in glob.glob(r... | shreya2111/PersonalityPrediction | src/analysis.py | Python | mit | 726 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-24 00:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('kiffel', '0001_initial'),
... | d120/kifplan | kiffel/migrations/0002_auto_20160424_0237.py | Python | agpl-3.0 | 1,734 |
#!/usr/bin/python
#
# Copyright (C) 2006-2014 Wyplay, All Rights Reserved.
# This file is part of xintegtools.
#
# xintegtools 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, o... | frogbywyplay/genbox_xintegtools | tests/test_xbump_target_ebuild.py | Python | gpl-2.0 | 5,455 |
# -*- coding: utf-8 -*-
GENDER = ((u'男',u'男'),(u'女',u'女'))
| youtaya/knight | fuzzybee/utils/constant.py | Python | mit | 67 |
# -*- coding: UTF-8 -*-
import pytest
from binascii import a2b_hex as a2b
try:
from unittest.mock import patch, call, MagicMock
except ImportError:
from mock import patch, call, MagicMock
from implib2.imp_bus import Bus, BusError
from implib2.imp_device import Device, DeviceError # noqa
from implib2.imp_com... | mhubig/implib2 | tests/test_bus.py | Python | mit | 14,029 |
#!/usr/bin/env python
""" Set up the node. A first startup consists of giving the command
'python manage'. This will create an empty settings file. Copy&paste
variables you want to change from settings_default.py to setup your
node. Next define your models. You'll need to add the folder containing
the 'models' dire... | ivh/VAMDC-VALD | nodes/xstardb/manage.py | Python | gpl-3.0 | 3,909 |
import socket
import sys
import netifaces
from time import sleep
import ctypes
import fcntl
import select
from struct import unpack
import event
#testing ----
from datagram import ipv4datagram
#----
class interfaces(object):
"""Returns interfaces list and fetches IPs associated with them"""
_interface_list =... | guptaarchit/nacsniff | sniffer_socket.py | Python | gpl-2.0 | 11,607 |
#!/usr/bin/env python
"""Handles decoders"""
from .. import config
import os
from glob import glob
import sys
import imp
#Decoders
import flac
import mp3
import oggVorbis
import speex
import wave
import wavpack
modules = [flac, mp3, oggVorbis, speex, wave, wavpack]
handlers = { }
for m in modules:
for type in m.H... | jeffayle/Transcode | audioTranscode/decoders/__init__.py | Python | isc | 859 |
from ds.vortex.core import baseNode
from ds.vortex.core import plug as plugs
class StringNode(baseNode.BaseNode):
def __init__(self, name):
"""
:param name: str, the name of the node
"""
baseNode.BaseNode.__init__(self, name)
def initialize(self):
baseNode.BaseNode.ini... | dsparrow27/vortex | src/ds/vortex/nodes/string/string.py | Python | mit | 1,090 |
import datetime
import json
import logging
import md5
import random
import tba_config
import urllib
import uuid
import webapp2
from google.appengine.api import urlfetch
from google.appengine.ext import deferred
from google.appengine.ext import ndb
from consts.auth_type import AuthType
from controllers.base_controller... | synth3tk/the-blue-alliance | controllers/api/api_base_controller.py | Python | mit | 8,512 |
import logging
from autotest.client import utils
from autotest.client.shared import error
from virttest import libvirt_xml
from virttest import virsh
from virttest import utils_misc
from virttest import utils_test
from virttest import utils_libvirtd
def run(test, params, env):
"""
Test vcpupin while numad i... | will-Do/tp-libvirt | libvirt/tests/src/numa/numad_vcpupin.py | Python | gpl-2.0 | 2,804 |
'''
Copyright 2013 Neil Borle and Paul Lu
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... | NBor/SkyPython | src/views/WidgetFader.py | Python | apache-2.0 | 1,449 |
#!/usr/bin/env python
# coding=utf-8
class BinanceAPIException(Exception):
def __init__(self, response):
json_res = response.json()
self.status_code = response.status_code
self.response = response
self.code = json_res['code']
self.message = json_res['msg']
self.requ... | doubleDragon/QuantBot | quant/api/binance_exceptions.py | Python | mit | 1,872 |
'''Train a memory network on the bAbI dataset.
References:
- Jason Weston, Antoine Bordes, Sumit Chopra, Tomas Mikolov, Alexander M. Rush,
"Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks",
http://arxiv.org/abs/1502.05698
- Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus,
"E... | daviddiazvico/keras | examples/babi_memnn.py | Python | mit | 8,097 |
from datetime import datetime, timedelta
import dateutil
import os
from django.test import TestCase
import json
from casexml.apps.case.models import CommCareCase
from corehq.apps.domain.models import Domain
from corehq.apps.hqadmin.dbaccessors import get_all_forms_in_all_domains
from corehq.apps.users.models import Com... | puttarajubr/commcare-hq | custom/_legacy/pact/tests/dot_submission.py | Python | bsd-3-clause | 22,865 |
from __future__ import unicode_literals
from django.db import models
from .indian_states import STATE_CHOICES
from django.contrib.auth.models import User
class Market(models.Model):
"""
Market details, it consists of just Indian states
"""
class Meta:
unique_together = ('latitude', 'longitude'... | sachinkumar123/approprate | cloudApp/interface/models.py | Python | mit | 1,688 |
#-------------------------------------------------------------------------------
#
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | Buggaboo/gimp-plugin-export-layers | export_layers/pygimplib/objectfilter.py | Python | gpl-3.0 | 11,296 |
import unittest
import numpy as np
from numpy.testing import assert_array_equal
from dgw.evaluation.resampling import extend_point, shrink_to_a_single_point
class TestExtending(unittest.TestCase):
def test_extend_point(self):
a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
ans = np.array([0, 1, ... | lukauskas/dgw | dgw/evaluation/tests/test_resampling.py | Python | gpl-3.0 | 1,877 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Brian McClure
#
# django-media-helper is free software under terms of the MIT License.
#
# Fork of django-cleanup
from setuptools import setup, find_packages
description = """# **django-media-helper** #
When dealing with content from unacquainted... | brmc/django-media-helper | setup.py | Python | mit | 1,794 |
#============================================================================
# Name : circ-pic.py
# Author : Luke Mondy
# ============================================================================
#
# Copyright (C) 2012 Mondy Luke
#
# This program is free software: you can redistribute it and/or modify
#... | OlympusMonds/PyCircleriser | PyCircleriser.py | Python | gpl-3.0 | 8,228 |
# Copyright (C) 2013 Che-Liang Chiou.
'''Compatibility layer of libclang cindex module.'''
from ctypes import c_uint
import clang.cindex as _cindex
from clang.cindex import (Index,
Cursor,
CursorKind,
Diagnostic,
R... | anthrotype/ctypes-binding-generator | cbind/clang_cindex.py | Python | gpl-3.0 | 1,859 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import json
import gc
from bottle import Bottle, request, response
from bottle.ext.mongo import MongoPlugin
from pandas import DataFrame
from mining.settings import PROJECT_PATH
from mining.utils import conf
from mining.utils... | mlgruby/mining | mining/controllers/export.py | Python | mit | 3,368 |
x=raw_input("Enter the value\n")
x=int(x)
print "1",
a=1
b=0
for i in range(1,x):
c=a+b
b=a
a=c
print c,
| parichitran/py-hw | Fibonacci.py | Python | apache-2.0 | 109 |
from __future__ import absolute_import
import jinja2
from flask import request, session, current_app
from wtforms.ext.csrf.session import SessionSecureForm
from wtforms.fields import HiddenField
class Form(SessionSecureForm):
"Implements a SessionSecureForm using app.SECRET_KEY and flask.session obj"
def __i... | simonz05/flask-wtf | flask_wtf/forms.py | Python | bsd-3-clause | 1,675 |
# -*- coding: utf-8 -*-
'''
Provides the :class:`Arrow <arrow.arrow.Arrow>` class, an enhanced ``datetime``
replacement.
'''
from __future__ import absolute_import
from datetime import datetime, timedelta, tzinfo
from dateutil import tz as dateutil_tz
from dateutil.relativedelta import relativedelta
import calendar
... | wri/gfw-api | lib/arrow/arrow.py | Python | gpl-2.0 | 26,941 |
#!/usr/bin/env python
'''
log2cef
Main module
Copyright 2013 J.R. Murray (jr.murray@gmail.com)
This program is distributed under the terms of the GNU General Public License version 3.0.
Tested with Python 2.7 on Windows 8
Configuration files:
1. User input
Log file sources
Parser agent to use
2. Parser configurati... | jrzmurray/log2cef | log2cef.py | Python | gpl-3.0 | 11,270 |
"""
kombu.transport.beanstalk
=========================
Beanstalk transport.
:copyright: (c) 2010 - 2012 by David Ziegler.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import beanstalkc
import socket
from anyjson import loads, dumps
from Queue import Empty
from kombu.exc... | depop/kombu | kombu/transport/beanstalk.py | Python | bsd-3-clause | 3,697 |
from gettext import gettext as _
import sys
import pulp.common.tags as tag_utils
from pulp.bindings.exceptions import PulpServerException
from pulp.client import parsers
from pulp.client.extensions.extensions import PulpCliSection, PulpCliFlag, PulpCliOption
# Guidance for render_document_list on how to display task... | credativ/pulp | client_admin/pulp/client/admin/tasks.py | Python | gpl-2.0 | 10,673 |
# -*- coding: utf-8 -*-
# Generated by Anselmo on 2019-06-25 12:42
from __future__ import unicode_literals
from django.db import migrations, models
def load_mod_passado_from_fixture(apps, schema_editor):
from django.core.management import call_command
call_command("loaddata", "0002_fo2_mod_passado_loaddata")... | anselmobd/fo2 | src/comercial/migrations/0002_fo2_mod_passado_loaddata.py | Python | mit | 702 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC Corporation
#
# 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/lic... | openstack/nova | nova/network/neutron.py | Python | apache-2.0 | 185,923 |
from nupic.encoders import (LogEncoder, DateEncoder, MultiEncoder, ScalarEncoder)
from nupic.data import FunctionSource
from nupic.frameworks.prediction.callbacks import displaySPCoincidences, printSPCoincidences
from nupic.data.dictutils import DictObj
nCoincidences = 30
iterationCount = 10000
nRandomFields = 1
ra... | chetan51/nupic | examples/prediction/experiments/generated_data/description.py | Python | gpl-3.0 | 4,064 |
from os import path
from enigma import iPlayableService, iServiceInformation, eTimer
from Screens.Screen import Screen
from Components.About import about
from Components.SystemInfo import SystemInfo
from Components.ConfigList import ConfigListScreen
from Components.config import config, configfile, getConfigListEntry... | oe-alliance/oe-alliance-enigma2 | lib/python/Screens/VideoMode.py | Python | gpl-2.0 | 18,622 |
# -*- coding: utf-8 -*-
'''Public section, including homepage and signup.'''
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session, jsonify, redirect, request, current_app,
abort)
from flask.ext.login import login_user, login_required, logout_u... | ltrc/TranslatorsDesk | translatorsdesk/public/views.py | Python | bsd-3-clause | 8,582 |
# Project: PyUsbLamp
# Author: onelife
import sys
from six.moves.queue import Queue, Empty
from threading import Thread, Event
import usb.core
import usb.backend.libusb1
from usb.core import USBError
if sys.version_info >= (3,):
from .applog import AppLog
else:
from applog import AppLog
DEBUG = 0
STEPS = 3... | onelife/PyUsbLamp | pyusblamp/pyusblamp.py | Python | gpl-3.0 | 6,105 |
# -*- coding: utf-8 -*-
###############################################################################################
#
# MediaPortal for Dreambox OS
#
# Coded by MediaPortal Team (c) 2013-2015
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed... | n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/MediaPortal/resources/update.py | Python | gpl-2.0 | 6,241 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Bootstraps gn.
It is done by first building it manually in a temporary directory, then building
it with its own BUILD.gn to the fin... | mou4e/zirconium | tools/gn/bootstrap/bootstrap.py | Python | bsd-3-clause | 13,743 |
"""
WSGI config for munsell project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | HalescodeLLC/django-munsell | munsell/munsell/wsgi.py | Python | mit | 1,562 |
"""Native adapter for serving CherryPy via its builtin server."""
import logging
import sys
import io
import cheroot.server
import cherrypy
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import httputil
from ._cpcompat import tonative
class NativeGateway(cheroot.server.Gateway):
"""Nati... | JonnyWong16/plexpy | lib/cherrypy/_cpnative_server.py | Python | gpl-3.0 | 6,677 |
#Example oper.py
from numpy import *
a = array([[2,3], [4,5]])
b = array([[1,2], [3,0]])
print a + b
print a * b
| csparkresearch/eyes-online | app/static/scripts/Maths/oper.py | Python | gpl-3.0 | 114 |
# 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 req... | nash-x/hws | neutron/extensions/loadbalancer.py | Python | apache-2.0 | 25,293 |
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'inventory',
'USER': 'inventory',
'PASSWORD': 'inventory',
'HOST': 'localhost',
'PORT': '',
}
}
#KEY_PREFIX = 'prod'
#KEY_FUNCTION = 'testsite.common.cachi... | cnobile2012/inventory | inventory/settings/production.py | Python | mit | 1,254 |
from sqlalchemy.sql import text
avatar = text(
"UPDATE users SET "
"info = COLUMN_DELETE(info, "
"'usecustomavatar', "
"'customavatarurl'"
") "
"WHERE id=:username"
";"
)
contactemail = text(
"UPDATE users SET "
"info = COLUMN_DELETE(info, "
"'contactemail', "
"'pgpmirror'... | evrom/genitag | libraries/delete.py | Python | gpl-2.0 | 1,478 |
import numpy as np
import vigra
from lazyflow.request import RequestPool
from lazyflow.graph import Graph
from lazyflow.roi import roiToSlice
from lazyflow.operators.opUnblockedArrayCache import OpUnblockedArrayCache
from lazyflow.utility.testing import OpArrayPiperWithAccessCount
import logging
logger = logging.getL... | jakirkham/lazyflow | tests/testOpUnblockedArrayCache.py | Python | lgpl-3.0 | 3,770 |
import datetime
import json
import re
import types
from afs.model.Project import Project
from afs.model.ProjectSpread import ProjectSpread
from afs.service.BaseService import BaseService
from afs.service.ProjectServiceError import ProjectServiceError
from afs.service.FSService import FSService
from afs.service.VolumeS... | openafs-contrib/afspy | afs/service/ProjectService.py | Python | bsd-2-clause | 30,997 |
from __future__ import absolute_import
__version__ = '0.1.9b1'
import sporco.cdict
import sporco.util
import sporco.plot
import sporco.linalg
import sporco.metric
import sporco.prox
import sporco.admm
| alphacsc/alphacsc | alphacsc/other/sporco/sporco/__init__.py | Python | bsd-3-clause | 203 |
from random import Random
from time import time
import inspyred
import math
# Define an additional "necessary" function for the evaluator
# to see how it must be handled when using pp.
def my_squaring_function(x):
return x**2
def generate_rastrigin(random, args):
size = args.get('num_inputs', 10)
return [... | hishnash/inspyred | examples/advanced/logging_example.py | Python | mit | 2,170 |
__author__ = 'christianurich'
from dm_sei import *
from dm_wtp_extreme_heat import *
from dm_wtp_recreational_value import *
from dm_wtp_stream_health import *
from dm_wtp_water_restrictions import *
from convert_cscol import *
from mikewhisperer import *
from scale_demand import * | iut-ibk/DynaMind-ToolBox | DynaMind-Performance-Assessment/scripts/DMPerformance/__init__.py | Python | gpl-2.0 | 283 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | forkbong/qutebrowser | qutebrowser/browser/webkit/webpage.py | Python | gpl-3.0 | 22,693 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
import os
import json
from fx_de... | cstipkovic/spidermonkey-research | testing/mozharness/scripts/b2g_desktop_build.py | Python | mpl-2.0 | 2,835 |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_eq... | Cocosoft/bitcoin | qa/rpc-tests/rpcnamedargs.py | Python | mit | 1,437 |
# Webservices python tester
| zealhydra/Webservices | websec.py | Python | gpl-2.0 | 29 |
from django import forms
from django.conf.global_settings import LANGUAGES
from liqpay.constants import CURRENCIES, ACTIONS
class ApiForm(forms.Form):
version = forms.IntegerField()
public_key = forms.CharField(max_length=20, min_length=5)
action = forms.ChoiceField(choices=ACTIONS)
amount = for... | pmaigutyak/mp-shop | liqpay/forms.py | Python | isc | 904 |
# Copyright (c) 2010-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 law or agree... | swiftstack/swift | swift/obj/auditor.py | Python | apache-2.0 | 23,402 |
import squeakspace.common.util as ut
import squeakspace.common.util_http as ht
import squeakspace.proxy.server.db_sqlite3 as db
import squeakspace.common.squeak_ex as ex
import config
def post_handler(environ):
query = ht.parse_post_request(environ)
cookies = ht.parse_cookies(environ)
user_id = ht.get_re... | eek6/squeakspace | www/proxy/scripts/proxy/message.py | Python | gpl-3.0 | 4,132 |
import httplib
import json
import urlparse
import error
from six import text_type
"""Implements HTTP transport for the WebDriver wire protocol."""
class Response(object):
"""
Describes an HTTP response received from a remote end whose
body has been read and parsed as appropriate.
"""
def __ini... | danlrobertson/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/transport.py | Python | mpl-2.0 | 5,652 |
import state as st
import yaml
class Graph:
'''
This class represents a graph by a list of states (its nodes) and a list of
the letters (the alphabet) from which it is constructed. As the states
contain the information about the edges, a list of them fully describe a
graph.
There are methods t... | franchenstein/master_project | graph.py | Python | mit | 7,296 |
"""Base material for signature backends."""
from django.urls import reverse
class SignatureBackend(object):
"""Encapsulate signature workflow and integration with vendor backend.
Here is a typical workflow:
* :class:`~django_anysign.models.SignatureType` instance is created. It
encapsulates the ba... | novafloss/django-anysign | django_anysign/backend.py | Python | bsd-3-clause | 5,255 |
'''
Created on Jul 14, 2011
@author: mkiyer
chimerascan: chimeric transcript discovery using RNA-seq
Copyright (C) 2011 Matthew Iyer
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 ... | madhavsuresh/chimerascan | chimerascan/pipeline/process_input_reads.py | Python | gpl-3.0 | 4,077 |
import pygame
import random
# Window dimensions
width = 640
height = 400
screen = pygame.display.set_mode((width, height))
clock = pygame.time.Clock()
running = True
while running:
x = random.randint(0, width-1)
y = random.randint(0, height-1)
red = random.randint(0, 255)
green = random.randint(0, 25... | vicente-gonzalez-ruiz/YAPT | multimedia/Pygame/test_examples/random_pixel.py | Python | cc0-1.0 | 553 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import nowdate, cstr, flt, cint, now, getdate
from frappe import throw, _
from frappe.utils import formatdate
# import... | shreyasp/erpnext | erpnext/accounts/utils.py | Python | gpl-3.0 | 26,822 |
# -*- coding: utf-8 -*-
"""
Photo Catalog v 1.0 (photocat)
Copyright (c) Karol Będkowski, 2004-2007
This file is part of Photo Catalog
"""
__author__ = 'Karol Będkowski'
__copyright__ = 'Copyright (C) Karol Będkowski 2006'
__revision__ = '$Id$'
class TreeItem(object):
def __init__(self):
self.tree_node = None... | KarolBedkowski/photocat | photocat/model/gui.py | Python | gpl-2.0 | 488 |
# -*- coding: utf-8 -*-
import os, time, pygame
from pygame.locals import *
class ResManager:
def __init__(self,
data_dir = 'data',
image_dir= 'image',
sound_dir= 'sound',
music_dir= 'music'):
self.data_dir = data_dir
self.image_di... | azon1272/War-for-cookies-v2 | Base view/ResManager.py | Python | bsd-3-clause | 802 |
'''
.. module:: retrieve
High level API to retrieve cleaned files
.. moduleauthor:: Christopher Phillippi <c_phillippi@mfe.berkeley.edu>
'''
from itertools import chain
from os import listdir
import cleaner.settings as settings
import cleaner.schema as schema
import csv
import datetime
import os.path
... | ccphillippi/AFP | afp/cleaner/retrieve.py | Python | mit | 6,187 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Daniel Carvalho <idnael@pegada.net>
#
# 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 Lice... | idnael/ctxsearch | ctxsearch/old/old_web.py | Python | gpl-2.0 | 3,446 |
from piliko import *
print
print 'example 5'
v1,v2 = vector(3,0),vector(0,4)
print 'vectors v1, v2:', v1, v2
print ' v1 + v2, v1 - v2: ', v1 + v2, v1 - v2
print ' v1 * 5/4:', v1 * Fraction(5,4)
print ' v1 perpendicular v1? ', v1.perpendicular( v1 )
print ' v1 perpendicular v2? ', v1.perpendicular( v2 )
print ' v2 perp... | donbright/piliko | examples/example05.py | Python | bsd-3-clause | 1,688 |
from __future__ import absolute_import
from celery import Celery
app = Celery('align',
broker='amqp://idigphylo:idppass9@elk.acis.ufl.edu//',
include=['align.align'])
# Optional configuration, see the application user guide.
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_R... | mjcollin/idigphylo | workers/align/celery.py | Python | mit | 419 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | nikesh-mahalka/cinder | cinder/utils.py | Python | apache-2.0 | 34,822 |
#!/usr/bin/env python3
import boto3
import logging
import logging.handlers
import time
import watchtower
import requests
from botocore.credentials import InstanceMetadataProvider, InstanceMetadataFetcher
from redo import retriable #https://github.com/mozilla-releng/redo
logger = logging.getLogger('Orchestrator') #The ... | tangerinedream/AWS_EC2_Scheduler | Utils.py | Python | gpl-3.0 | 4,356 |
from . import views
from django.conf.urls import include, url
from django.contrib.auth.views import login
app_name = 'store'
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^login/$', login, name='login'),
url(r'^logout/$', views.logout.as_view(), name='logout'),
url(r'^register/$', views.U... | dcabalas/UNI | SN/Django/MySocks/store/urls.py | Python | gpl-3.0 | 809 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | lnielsen/invenio | invenio/modules/pidstore/upgrades/pidstore_2014_08_22_initial.py | Python | gpl-2.0 | 3,270 |
__author__ = 'pankaj'
def getPallindromeCount(string):
mid=0
right=0
left=0
counter =0
longest_length=0
while mid < len(string):
right=mid
left=mid
found = True
while right >=0 and left < len(string):
if string[right] == string[left]:
... | pankajanand18/python-tests | trees/pallindrome_count.py | Python | mit | 1,211 |
"""
Module to define url helpers functions
"""
from urllib import urlencode
from django.urls import reverse
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.search import navigation_index, path_to_location
def get_redirect_url(course_key, usage_key):
""" Returns the redirect url back ... | a-parhom/edx-platform | lms/djangoapps/courseware/url_helpers.py | Python | agpl-3.0 | 1,773 |
#!/usr/bin/python
# The purpose of this script is to email users when an automated build breaks.
# Caveats:
# - it has a few hardcoded spots that require the build user to be cndrauto.
# - it only works for builds. I think tests are too flaky and would generate too much mail
#
# Written by Scot Kronenfeld 2011-06
... | djw8605/htcondor | nmi_tools/glue/build/email_on_failure.py | Python | apache-2.0 | 7,280 |
# -*- coding: utf-8 -*-
"""Deletes all feedback that have a description that's an empty
string.
"""
from __future__ import unicode_literals
import sys
from django.db import models, migrations
def delete_feedback(apps, schema_editor):
"""Delete all feedback with an empty description"""
Response = apps.get_... | staranjeet/fjord | fjord/feedback/migrations/0003_delete_empty_desc_feedback.py | Python | bsd-3-clause | 783 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | sunu/oh-missions-oppia-beta | core/domain/stats_services_test.py | Python | apache-2.0 | 18,587 |
# __all__ = ['KnowledgeModel', 'MongoAccessor', 'GridFSModel']
| deleidos/de-visualization-wizard | language-processing-service/modeler/modelerserver/knowledgemodeler/__init__.py | Python | apache-2.0 | 63 |
# -*- 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):
# Deleting field 'TweetChunk.tweet'
db.delete_column(u'map_tweetchunk', '... | michaelbrooks/twitter-feels | twitter_feels/apps/map/migrations/0014_auto__del_field_tweetchunk_tweet.py | Python | mit | 3,927 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
#url(r'^home/','analytics.views.home')
url(r'^valid/','analytics.views.valid_check'),
ur... | CSC-ORG/Dynamic-Dashboard-2015 | engine/api/analytics/urls.py | Python | mit | 465 |
##############################################################################
# Copyright (c) 2013-2017, 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... | TheTimmy/spack | var/spack/repos/builtin/packages/libffi/package.py | Python | lgpl-2.1 | 1,904 |
#!/usr/bin/env python
# ----------------------------------------------------------------
# Copyright 2017 Cisco Systems
#
# 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.apac... | psykokwak4/ydk-gen | test/tcp_proxy_server.py | Python | apache-2.0 | 8,117 |
import megamenu
| OdooCommunityWidgets/website_navigation_megamenu | __init__.py | Python | mit | 16 |
"""Test cloudbridge.security modules."""
import cloudbridge.base.helpers as cb_helpers
from cloudbridge.interfaces.exceptions import DuplicateResourceException
from cloudbridge.interfaces.resources import KeyPair
from cloudbridge.interfaces.resources import TrafficDirection
from cloudbridge.interfaces.resources import ... | gvlproject/libcloudbridge | tests/test_security_service.py | Python | mit | 9,831 |
from examples_shared import init_parser, init_client, print_response
def list_product_configurations(client):
"""
List product specific configurations for this reseller.
"""
return client.reseller.product_configuration()
if __name__ == "__main__":
parser = init_parser(description='Domain relate... | duct-tape/resello | examples/reseller.py | Python | bsd-3-clause | 462 |
from __future__ import unicode_literals
from django.db import models
from django.test import TestCase
from django.utils import six
from .models import (
First, Third, Parent, Child, Category, Record, Relation, Car, Driver)
class ManyToOneRegressionTests(TestCase):
def test_object_creation(self):
Thi... | ericholscher/django | tests/many_to_one_regress/tests.py | Python | bsd-3-clause | 5,426 |
import json
import re
from lib.validators import RegexValidator
from lib import util
class Properties:
def __init__(self, script_root, property_file):
self.__script_root = script_root
self._property_file = property_file
self.__load_properties()
msg = "Version number does not mat... | dgarlitt/release_notes_generator | lib/properties.py | Python | mit | 4,032 |
import numpy as np
from numpy.testing import *
from skimage.transform import *
def test_frt():
SIZE = 59
try:
import sympy.ntheory as sn
assert sn.isprime(SIZE) == True
except ImportError:
pass
# Generate a test image
L = np.tri(SIZE, dtype=np.int32) + np.tri(SIZE, dtype=... | emmanuelle/scikits.image | skimage/transform/tests/test_finite_radon_transform.py | Python | bsd-3-clause | 413 |
from __future__ import absolute_import
import mimetypes
from os import path
from django.conf import settings
from django.conf.urls.static import static
from django.test import TestCase
from django.http import HttpResponseNotModified
from django.views.static import STREAM_CHUNK_SIZE
from .. import urls
from ..urls im... | smartfile/django-1.4 | tests/regressiontests/views/tests/static.py | Python | bsd-3-clause | 4,749 |
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
conv_cfg = dict(type='ConvWS')
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
backbone=dict(
conv_cfg=conv_cfg,
norm_cfg=norm_cfg,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://jhu/... | open-mmlab/mmdetection | configs/gn+ws/faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py | Python | apache-2.0 | 577 |
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit
# for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2021 by the BurnMan team, released under the GNU
# GPL v2 or later.
from __future__ import absolute_import
import importlib
import numpy as np
from sympy import Rational
from fracti... | bobmyhill/burnman | burnman/classes/polytope.py | Python | gpl-2.0 | 14,930 |
import sys
import csv
import logging
from collections import defaultdict
from functools import lru_cache
from path import path
import flask
from flask.ext.script import Manager
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
placenames_manager = Manager()
def fix_comma_below(text):
return (te... | mgax/mptracker | mptracker/placenames.py | Python | mit | 4,418 |
from wptserve.handlers import json_handler
@json_handler
def main(request, response):
key = request.GET.first(b"key")
return request.server.stash.take(key, b'/fetch/range/')
| scheib/chromium | third_party/blink/web_tests/external/wpt/fetch/range/resources/stash-take.py | Python | bsd-3-clause | 184 |
#
class Abc:
@staticmethod
def def_ghi(jkl):
#
| general-language-syntax/GLS | test/integration/StaticFunctionDeclareStart/public one parameter.py | Python | mit | 55 |
from django.utils import six
if six.PY2:
import urlparse
from urllib import urlencode, quote_plus, quote
from urllib2 import urlopen, Request, HTTPError
else:
from urllib import parse as urlparse
from urllib.parse import urlencode, quote_plus, quote
from urllib.request import urlopen, Request
... | uptown/django-town | django_town/utils/with3.py | Python | mit | 357 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)
| ui/django-cached_authentication_middleware | test_project/test_project/urls.py | Python | mit | 186 |
import unittest
from unittest.mock import Mock, patch
from tests.test_api import TestAPIStatus
from yams_api.plugins.dev.aws.methods import AWSPublicResource
class TestAWSAPI(TestAPIStatus):
def test_aws_endpoint_reachable(self):
resp = self.client.get("/plugins/aws/")
self.assertEqual(resp.statu... | tristanfisher/yams | tests/test_plugins/test_aws.py | Python | gpl-3.0 | 1,949 |
import psycopg2
from Vertex import Vertex
from Graph import Graph
from GeoCode import GeoCode
from distCal import lonlat2ID, cor2ID, distanceCal, calPathDis, R
def createMiniWorld(miniGraph, startPt, endPt):
#define the boundary of the miniworld
padding = 0.005
minLng = min(startPt[0], endPt[0])-padding
... | SummerZheng/iRun_YN | app/static/py/TestPath.py | Python | mit | 2,206 |
def extractWwwComegatranslationsCom(item):
'''
Parser for 'www.comegatranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if "WATTT" in item['tags']:
return buildReleaseMessageWithType(item, "W... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwComegatranslationsCom.py | Python | bsd-3-clause | 381 |
"""Extension argument processing code
"""
__all__ = [
'Message', 'NamespaceMap', 'no_default', 'registerNamespaceAlias',
'OPENID_NS', 'BARE_NS', 'OPENID1_NS', 'OPENID2_NS', 'SREG_URI',
'IDENTIFIER_SELECT'
]
import copy
import warnings
import urllib.request
import urllib.error
from openid import oidutil
fr... | necaris/python3-openid | openid/message.py | Python | apache-2.0 | 22,680 |
import click
# --------------------------------------------
# Call koheron-server
# --------------------------------------------
class ConnectionType(object):
def __init__(self, host="", unixsock=""):
self.host = host
@click.group()
@click.option('--host', default='', help='Host ip address', envvar='HOST... | Koheron/zynq-sdk | python/koheron/cli.py | Python | mit | 1,924 |
# Copyright 2015 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... | jbedorf/tensorflow | tensorflow/python/kernel_tests/reverse_sequence_op_test.py | Python | apache-2.0 | 6,952 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.