text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_backend_test.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| semorale/backend-test | django_backend_test/manage.py | Python | mit | 262 | 0.003817 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | beernarrd/gramps | gramps/gen/filters/rules/citation/__init__.py | Python | gpl-2.0 | 2,223 | 0 |
from django.db import models
from django.test import TestCase
from ..models.compat import YAMLField
class TestYAMLModel(models.Model):
yaml_field = YAMLField()
class TestYAMLField(TestCase):
...
def test_to_python(self):
yaml_data = """
main:
- 1
- 2
- 3
... | salexkidd/restframework-definable-serializer | definable_serializer/tests/test_compat.py | Python | mit | 985 | 0.001021 |
#!/usr/bin/env python3
from collections import namedtuple
from pdfrw import PdfName, PdfDict, PdfObject, PdfString
PageLabelTuple = namedtuple("PageLabelScheme",
"startpage style prefix firstpagenum")
defaults = {"style": "arabic", "prefix": '', "firstpagenum": 1}
styles = {"arabic": PdfN... | lovasoa/pagelabels-py | pagelabels/pagelabelscheme.py | Python | gpl-3.0 | 2,320 | 0.001293 |
import operator
from functools import reduce
from collections import namedtuple
from django.db.models import Q
from mi.models import Target
from wins.models import HVC
HVCStruct = namedtuple('HVCStruct', ['campaign_id', 'financial_year'])
def get_all_hvcs_referenced_by_targets(financial_years=None):
"""
Ge... | UKTradeInvestment/export-wins-data | fixturedb/utils/hvc.py | Python | gpl-3.0 | 1,557 | 0.004496 |
#!/usr/bin/env python
"""
NPR 2017-01-22
www.npr.org/2017/01/22/511046359/youve-got-to-comb-together-to-solve-this-one
The numbers 5,000, 8,000, and 9,000 share a property that only five integers altogether have.
Identify the property and the two other integers that have it.
"""
# The property is that they are superv... | boisvert42/npr-puzzle-python | 2017/0122_unusual_numbers.py | Python | cc0-1.0 | 2,574 | 0.029915 |
"""
Django settings for testproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | adamhaney/django-ipython-notebook-reports | testproject/testproject/settings.py | Python | mit | 1,987 | 0 |
# Copyright 2020 Makani Technologies 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 or agreed to... | google/makani | config/m600/rotor_sensors.py | Python | apache-2.0 | 1,234 | 0.001621 |
# # -*- coding: utf-8“ -*-
# from datetime import date, time, datetime, timedelta
# from dateutil.relativedelta import relativedelta
#
# from django.conf import settings
# from django.core.urlresolvers import reverse
# from django.test import TestCase
#
# from eventtools.utils import datetimeify
# from eventtools_tes... | ixc/glamkit-eventtools | eventtools/tests/views.py | Python | bsd-3-clause | 9,613 | 0.006971 |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | davidsminor/gaffer | python/GafferUI/CompoundDataPlugValueWidget.py | Python | bsd-3-clause | 7,763 | 0.064666 |
#!/usr/bin/env python
import datetime
from run_utils import *
class TestSuite(object):
def __init__(self, options, cache):
self.options = options
self.cache = cache
self.nameprefix = "opencv_" + self.options.mode + "_"
self.tests = self.cache.gatherTests(self.nameprefix + "*", self... | DamianPilot382/Rubiks-Cube-Solver | opencv/sources/modules/ts/misc/run_suite.py | Python | apache-2.0 | 6,541 | 0.005198 |
# Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... | apyrgio/synnefo | snf-cyclades-app/synnefo/volume/management/commands/snapshot-show.py | Python | gpl-3.0 | 2,301 | 0.000435 |
#!/usr/bin/env python
import re
import sys
snappy_ver = "v3.0"
html_header_string = """\
<html>
<head>
<title>Snappy Assembly</title>
<style>
BODY {
margin-bottom: 200px;
}
TABLE TD {
vertical-align: middle;
}
H2 {
margin-bottom: 5px;
margin-top: 24px;
font-size: 20pt;
}
LI.section {
font-size: 20pt;
f... | revarbat/snappy-reprap | gen_assembly_index.py | Python | gpl-2.0 | 7,135 | 0.001261 |
#!/usr/bin/python
"""
skeleton code for k-means clustering mini-project
"""
import pickle
import numpy
import matplotlib.pyplot as plt
import sys
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
def Draw(pred, features, poi, mark_poi=False, name="image.png", f1_n... | moosemaniam/learning | ud120-projects/k_means/k_means_cluster.py | Python | cc0-1.0 | 2,570 | 0.019066 |
# -*- coding: utf-8 -*-
from django.http import HttpResponse,HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404
from django.shortcuts import render_to_response
from django import forms
from django.forms import ModelForm
from django.db.models import Q, F, Avg, Max, Min, Count
from django.utils... | yejia/osl_notebook | social/views.py | Python | mit | 62,150 | 0.02148 |
import os.path
import pygame
from pygame.locals import *
from tecles import *
pygame.init()
class Joc (object):
WIDTH = 600
HEIGHT = 400
screen = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32)
background = pygame.image.load(os.path.join("Imatges","fons.jpg"))
clock = pygame.time.Clock()
dt = 0.05
pun... | heepaz/rePong | joc.py | Python | gpl-3.0 | 1,394 | 0.031564 |
"""Produces the catalogue page for the VPHAS website."""
import os
import json
import datetime
#import httplib
from astropy import log
from jinja2 import Environment, FileSystemLoader
from surveytools import SURVEYTOOLS_DATA
# Load the column definitions from the JSON file
filename_columns = os.path.join(SURVEYTOOLS_... | barentsen/surveytools | scripts/website/create-vphas-dr2-page.py | Python | mit | 1,542 | 0.000649 |
import sys
from indra import reach
from indra.assemblers import GraphAssembler
orig_txt = [ln.strip() for ln in open('ras_pathway.txt', 'rt').readlines()]
correct_txt = [ln.strip() for ln in open('correction.txt', 'rt').readlines()]
for ln in correct_txt:
if ln.startswith('<'):
remove_line = ln[2:]
... | jmuhlich/indra | models/ras_pathway/run_correction.py | Python | bsd-2-clause | 855 | 0 |
# (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | reedloden/ansible | lib/ansible/executor/task_queue_manager.py | Python | gpl-3.0 | 13,130 | 0.003427 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-30 17:53
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 = [
('wunderlist', '0011_auto_20151... | passuf/WunderHabit | wunderlist/migrations/0012_auto_20151230_1853.py | Python | mit | 631 | 0.001585 |
# 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... | psachin/swift | swift/obj/replicator.py | Python | apache-2.0 | 38,417 | 0 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py | Python | mit | 123,002 | 0.003382 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | dbentley/pants | src/python/pants/pantsd/process_manager.py | Python | apache-2.0 | 18,348 | 0.011609 |
#
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This application 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.
#
# This application is di... | MLAB-project/satellite-observer | gr-sat_observer/python/__init__.py | Python | gpl-3.0 | 1,155 | 0.002597 |
from datetime import datetime
import subprocess
import logging
import os
from flask import Flask, current_app
from flask.ext.sqlalchemy import SQLAlchemy
from jinja2 import FileSystemLoader
from werkzeug.local import LocalProxy
import yaml
from flask.ext.cache import Cache
from bitcoinrpc import AuthServiceProxy
r... | fscook/simplevert | simplecoin/__init__.py | Python | mit | 4,347 | 0.00046 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (http://tiny.be). All Rights Reserved
#
#
# This program is free software: you can redistribute it and/or modify
# ... | avanzosc/avanzosc6.1 | avanzosc_french_amortization/__init__.py | Python | agpl-3.0 | 1,037 | 0.001929 |
#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RankedChoiceRestaurants.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason.... | kc0bfv/RankedChoiceRestaurants | manage.py | Python | gpl-3.0 | 822 | 0.001217 |
#!/usr/bin/env python
##########################################################################
# run/ec2-setup/spot.py
#
# Part of Project Thrill - http://project-thrill.org
#
# Copyright (C) 2015 Matthias Stumpp <[email protected]>
#
# All rights reserved. Published under the BSD-2 license in the LICENSE file.
#####... | manpen/thrill | run/ec2-setup/spot.py | Python | bsd-2-clause | 3,829 | 0.00888 |
import logging
from unittest import TestCase
try:
# Python 3 >
from unittest.mock import patch # noqa: F401
except ImportError:
from mock import patch # noqa: F401
try:
# Python 3.3 >
from unittest.mock import MagicMock, ANY # noqa: F401
except ImportError:
from mock import MagicMock, ANY # ... | nirzari/review-rot | test/pagure_tests/test_pagure.py | Python | gpl-3.0 | 16,196 | 0.000679 |
"""Handle nice json response for error."""
from flask import jsonify
def not_found(e):
"""Send a correct json for 404."""
response = jsonify({'status': 404, 'error': 'Not found',
'message': 'Invalid resource URI'})
response.status_code = 404
return response
def method_not_su... | alkivi-sas/nefario-api | nefario/errors.py | Python | lgpl-3.0 | 804 | 0 |
"""
Method agnostic utility functions for linear progamming
"""
import numpy as np
import scipy.sparse as sps
from warnings import warn
from .optimize import OptimizeWarning
from scipy.optimize._remove_redundancy import (
_remove_redundancy, _remove_redundancy_sparse, _remove_redundancy_dense
)
from collection... | jamestwebber/scipy | scipy/optimize/_linprog_util.py | Python | bsd-3-clause | 65,452 | 0.000993 |
import unittest
import pickle
import cPickle
import StringIO
import cStringIO
import pickletools
import copy_reg
from test.test_support import TestFailed, have_unicode, TESTFN
# Tests that try a number of pickle protocols should have a
# for proto in protocols:
# kind of outer loop.
assert pickle.HIGHEST_PROTOCOL... | antb/TPT----My-old-mod | src/python/stdlib/test/pickletester.py | Python | gpl-2.0 | 39,620 | 0.001514 |
#
# Andrei Korostelev <andrei at korostelev dot net>
#
# Before using this product in any way please read the license agreement.
# If you do not agree to the terms in this agreement you are not allowed
# to use this product or parts of it. You can read this license in the
# file named LICENSE.
#
"""
CcPy project ... | kindkaktus/CcPy | ccpy/ccpyconfparser.py | Python | bsd-3-clause | 9,656 | 0.001761 |
# Sumber: LMD/models.py
from google.appengine.ext import db
class Users(db.Model):
username = db.StringProperty()
passwd = db.StringProperty()
email = db.StringProperty()
fullname = db.StringProperty()
address = db.TextProperty()
phone = db.StringProperty()
role = db.IntegerProperty(de... | rimbalinux/LMD3 | user/models.py | Python | bsd-3-clause | 383 | 0.015666 |
# Deckard, a Web based Glade Runner
# Copyright (C) 2013 Nicolas Delvaux <[email protected]>
# This program 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 version 3 of the License, o... | Malizor/deckard | libdeckard.py | Python | agpl-3.0 | 17,967 | 0.000223 |
#!/usr/bin/env python
import os
import sys
from autoprocess import autoProcessTV, autoProcessMovie, autoProcessTVSR, sonarr, radarr
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4
from deluge_client import DelugeRPCClient
import logging
from logging.config import fileConfig
logpath = '/var/log/sic... | Filechaser/sickbeard_mp4_automator | delugePostProcess.py | Python | mit | 5,303 | 0.003206 |
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from . import views
from django.views.generic.base import View
app_name = 'secapp'
urlpatterns = [
# Index view
url(r'^$', views.index, name='index'),
# List of events for a Log Source
url(r'^(?P<id_log_sour... | MGautier/security-sensor | branches/webenv/secproject/secapp/urls.py | Python | mit | 2,174 | 0.00552 |
#!python
"""
VMController Host - a general purpose host-side virtual machine controller via exposed hypervisors apis.
"""
try:
import os
import sys
import logging
import warnings
import multiprocessing
import time
import inject
from twisted.internet import reactor
from pkg_resource... | dgquintas/vmcontroller.unstable | src/vmcontroller.host/vmcontroller/host/__main__.py | Python | bsd-3-clause | 8,090 | 0.004203 |
import sys
out = sys.stdout
class Colors:
def black (self, fmt='', *args): self('\x1b[1;30m'+fmt+'\x1b[0m', *args)
def red (self, fmt='', *args): self('\x1b[1;31m'+fmt+'\x1b[0m', *args)
def green (self, fmt='', *args): self('\x1b[1;32m'+fmt+'\x1b[0m', *args)
def yellow (self, fmt='', *args): sel... | moertle/pyaas | pyaas/io.py | Python | mit | 1,515 | 0.009241 |
# -*- coding: utf-8 -*-
"""
eve.methods.get
~~~~~~~~~~~~~~~
This module implements the API 'GET' methods, supported by both the
resources and single item endpoints.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
import math
import copy
import json
fr... | bcrochet/eve | eve/methods/get.py | Python | bsd-3-clause | 21,656 | 0 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class WebofknowledgePipeline(object):
def process_item(self, item, spider):
return item
| alabarga/wos-scrapy | webofknowledge/pipelines.py | Python | gpl-2.0 | 294 | 0 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.urllib.parse import quote
import logging
from jinja2 import TemplateSyntaxError
from flexget import plugin
from flexget.event import event
from flexget.... | drwyrm/Flexget | flexget/plugins/sites/rss.py | Python | mit | 1,942 | 0.00309 |
from . import visualize_classic_binning
from . import visualize_tree_binning
from . import visualize_llh
from . import visualize_model
__all__ = ('visualize_classic_binning',
'visualize_llh',
'visualize_tree_binning',
'visualize_model')
| mbrner/funfolding | funfolding/visualization/__init__.py | Python | mit | 272 | 0 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos ([email protected]) Date: 07/10/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | InakiZabala/odoomrp-wip | product_pricelist_import/__init__.py | Python | agpl-3.0 | 966 | 0 |
import sys
import struct
import logging
import ibapi
from ibapi.client import EClient
from ibapi.wrapper import EWrapper, iswrapper
import PyQt5.Qt as qt
import PyQt5.QtNetwork as qtnetwork
import tws_async.util as util
util.allowCtrlC()
__all__ = ['TWSClientQt', 'iswrapper']
class TWSClientQt(EWrapper, EClient)... | erdewit/tws_async | tws_async/twsclientqt.py | Python | unlicense | 5,611 | 0.000535 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | lordmos/blink | Tools/Scripts/webkitpy/layout_tests/port/test.py | Python | mit | 29,134 | 0.002643 |
import socket, sys,os,re
from struct import *
mymac=sys.argv[1]
rmac=sys.argv[2]
interface=sys.argv[3]
mode=sys.argv[4]
def address (a) :
b = "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x" % (ord(a[0]) , ord(a[1]) , ord(a[2]), ord(a[3]), ord(a[4]) , ord(a[5]))
return b
try:
s = socket.socket( socket.AF_PACKET , socket.SO... | europa502/shARP_2.0 | mac_decoder.py | Python | gpl-3.0 | 1,454 | 0.055021 |
import uuid
import base64
import re
def generate_key():
"""
generates a uuid, encodes it with base32 and strips it's padding.
this reduces the string size from 32 to 26 chars.
"""
return base64.b32encode(uuid.uuid4().bytes).strip('=').lower()[0:12]
def thousand_separator(x=0, sep='.', dot=','):
"""
creates a ... | hsw5138/bis | backend/helpers.py | Python | mit | 2,048 | 0.027344 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import sys
from reset_exclusions import *
from utils import *
from viewer import *
class Cleaner(object):
"""
The Cleaner class allows users to clean up their movie, TV show and music video collection by removing watched
items. The user can apply a n... | Anthirian/script.filecleaner | default.py | Python | gpl-3.0 | 30,945 | 0.004007 |
# file openpyxl/writer/strings.py
# Copyright (c) 2010-2011 openpyxl
#
# 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, ... | sbhowmik7/PSSEcompare | ext_libs/openpyxl/writer/strings.py | Python | gpl-3.0 | 3,077 | 0.0013 |
import os
import peewee
from rivr_peewee import Database
DATABASE_URL = os.environ.get('DATABASE_URL')
if DATABASE_URL and DATABASE_URL.startswith('postgres://'):
DATABASE_URL = DATABASE_URL.replace('postgres://', 'postgres+pool://')
# disable auto connection
EXTRA_OPTIONS = 'autoconnect=false'
if '... | cocodelabs/api.palaverapp.com | palaverapi/models.py | Python | bsd-3-clause | 1,143 | 0 |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "[email protected]"
__license__ = "MIT"
import os
import mimetypes
import base64
import textwrap
import datetime
import io
from docutils.parsers.rst.directives.images import Image, Figure
from docutils.parsers.rst imp... | vangalamaheshh/snakemake | snakemake/report.py | Python | mit | 3,806 | 0.000263 |
# Copyright (c) 2015 Rackspace
# 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... | cloudbase/neutron | neutron/extensions/dns.py | Python | apache-2.0 | 9,551 | 0.000419 |
#!/usr/bin/env python
from distutils.core import setup
setup(name = "quasi",
version = "0.87",
description = "A multiple-context Python shell",
author = "Ben Last",
author_email = "[email protected]",
url = "http://quasi-shell.sourceforge.net/",
license = "BSD",
scripts = ["qua... | aur-archive/quasi | setup.py | Python | bsd-3-clause | 448 | 0.049107 |
from serial import Serial
import time
import platform
import socket
serialPort = Serial('COM3' if platform.system() == 'Windows' else '/dev/ttyUSB0', 9600)
time.sleep(2)
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('', 2222))
server.listen(1)
while True:
(client, address) = server.accept(... | Mnenmenth/RobotCode | JoystickInput/JoystickServer.py | Python | apache-2.0 | 458 | 0.026201 |
#!/usr/bin/env python3
# Copyright 2015, 2016 Endless Mobile, Inc.
# This file is part of eos-event-recorder-daemon.
#
# eos-event-recorder-daemon 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 versi... | endlessm/eos-event-recorder-daemon | tests/daemon/mock-server.py | Python | gpl-2.0 | 1,987 | 0.00151 |
#! /usr/bin/env python
#script that takes an optional argument for the date and target collection and calculates angular separation and elevation of each target from the moon.
import ephem, subprocess, operator, argparse
#host & port info
hostName="veritase.sao.arizona.edu"
portNum=""
#hostName="lucifer1.spa.umn.... | mbuchove/analysis-tools-m | python/moonDist.py | Python | mit | 5,073 | 0.027991 |
'''
This script will remove the directories if that contains only xml files.
'''
import os
srcpath = raw_input("Enter the source path : ")
for root, sub, files in os.walk(os.path.abspath(srcpath)):
if files:
files = [f for f in files if not f.endswith('.xml')]
if not files:
fpath = os... | arulalant/CMIPs-Handler | scripts/mv/rm_dirs_contains_only_if_xml.py | Python | gpl-3.0 | 427 | 0.004684 |
# -*- coding: utf-8 -*-
import argparse
import time
import socket
import sys
import json
__prog__ = 'xbmc-command'
PROG = __prog__
__version__ = '0.4.1'
VERSION = __version__
class XBMC(object):
def __init__(self, host, port):
self.address = (host, port)
self.__socket = socket.socket(socket.AF_... | mychris/xbmc-command | xbmc_command/core.py | Python | gpl-3.0 | 4,244 | 0.001649 |
##############################################################################
# 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, [email protected], All rights reserved.
# LLNL-CODE-64... | lgarren/spack | var/spack/repos/builtin/packages/r-limma/package.py | Python | lgpl-2.1 | 1,754 | 0.00114 |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | lmazuel/autorest | src/generator/AutoRest.Python.Tests/AcceptanceTests/validation_tests.py | Python | mit | 5,290 | 0.002837 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from solidspy.solids_GUI import solids_GUI
solids_GUI() | jgomezc1/FEM_PYTHON | solidspy/__main__.py | Python | mit | 119 | 0.008403 |
class Reverb:
pass
class ScatterLocation:
pass
class Chorus:
pass
class Vocoder:
pass
class ShuffleSound:
pass
| ttm/musicLegacy | musicLegacy/effects.py | Python | mit | 131 | 0.030534 |
# -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import collections
import itertools
import logging
from shot_detector.utils.dsl import DslOperatorMixin
from shot_detector.utils.dsl.dsl_kwarg... | w495/python-video-shot-detector | shot_detector/filters/dsl/dsl_filter_mixin.py | Python | bsd-3-clause | 6,383 | 0.00564 |
# -*- coding: utf-8 -*-
"""
FlowrouteNumbersLib.APIHelper
Copyright Flowroute, Inc. 2016
"""
import jsonpickle
import re
class APIHelper:
"""A Helper Class for various functions associated with API Calls.
This class contains static methods for operations that need to be
perfo... | flowroute/flowroute-numbers-python | FlowrouteNumbersLib/APIHelper.py | Python | mit | 8,902 | 0.00483 |
from setuptools import setup, find_packages
import sys, os
version = '1.3'
long_description = """The raisin.restyler package is a part of Raisin, the web application
used for publishing the summary statistics of Grape, a pipeline used for processing and
analyzing RNA-Seq data."""
setup(name='raisin.restyler',
v... | rna-seq/raisin.restyler | setup.py | Python | gpl-3.0 | 1,531 | 0.005225 |
sum = 1
curr = 3
for width in xrange(3,1002,2):
inc = width - 1
sum = sum + curr #bottom right
curr = curr + inc
sum = sum + curr #bottom left
curr = curr + inc
sum = sum + curr #top left
curr = curr + inc
sum = sum + curr #top right
curr = curr + inc + 2
print sum
| kbrose/project_euler | p20-29/p28.py | Python | unlicense | 304 | 0.032895 |
"""
Defines a class that represents a regularly sampled lightcurve
"""
import sys
import numpy as np
import splreg
import pycs.gen.spl
import copy as pythoncopy
import scipy.optimize as spopt
class rslc():
"""
A regularly sampled lightcurve, typically obtained by regression.
To make such a rslc from a usual light... | COSMOGRAIL/PyCS | pycs/spldiff/rslc.py | Python | gpl-3.0 | 8,490 | 0.049706 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/contrib/lite/toco/toco_flags.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from goog... | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/contrib/lite/toco/toco_flags_pb2.py | Python | mit | 8,125 | 0.004062 |
""" crypto.aes
AES Encryption Algorithm
The AES algorithm is just Rijndael algorithm restricted to the default
blockSize of 128 bits.
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
2002-06-01
"""
from crypto.cipher.rijndael import Rijndael
from crypto.cipher... | realms-team/basestation-fw | libs/smartmeshsdk-REL-1.3.0.1/external_libs/cryptopy/crypto/cipher/aes.py | Python | bsd-3-clause | 1,002 | 0.015968 |
from ditutils.core import setup
setup(
name = 'morpheusapi',
packages = ['morpheusapi'],
version = '2.11.1',
description = 'A python wrapper for Morpheus APIs',
author = 'Adam Hicks',
author_email = '[email protected]',
url = 'https://github.com/tadamhicks/morpheus-python',
dow... | tadamhicks/morpheus-python | setup.py | Python | mit | 480 | 0.04375 |
#! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# This module implements a loop back connection receiving itself what it sent.
#
# The purpose of this module is.. well... You can run the unit tests with it.
# and it was so easy to implement ;-)
#
# (C) 2001-2011 Chris Liecht... | masahir0y/barebox-yamada | scripts/serial/urlhandler/protocol_loop.py | Python | gpl-2.0 | 9,646 | 0.002281 |
# Import the helper gateway class
from AfricasTalkingGateway import AfricasTalkingGateway, AfricasTalkingGatewayException
from twitment.search import ClassTwitter
# Specify your login credentials
class SMS(object):
def __init__(self):
pass
def send(self,num):
sendtweet_obj = ClassTwitter()
... | crakama/bc_7_twitment | twitment/sendSMS.py | Python | mit | 1,600 | 0.005625 |
# Author: Bala Venkatesan
# License: Apache 2.0
########################################################################
# Wrote this file to separate out the loading of the data from the
# python file where the actual display happens
########################################################################
impor... | OSHADataDoor/OshaBokeh | bokehsamples/osha_files.py | Python | apache-2.0 | 2,378 | 0.004626 |
# coding: utf-8
# Copyright (c) 2012, SciELO <[email protected]>
# 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 not... | scieloorg/scielo-django-extensions | scielo_extensions/formfields.py | Python | bsd-2-clause | 1,891 | 0.006875 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSdmtools(RPackage):
"""Species Distribution Modelling Tools: Tools for processing data
... | rspavel/spack | var/spack/repos/builtin/packages/r-sdmtools/package.py | Python | lgpl-2.1 | 1,363 | 0.005869 |
#/u/Goldensights
import praw
import time
import datetime
'''USER CONFIG'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights'... | tehp/reddit | MessageArchiveSimple/messagearchivesimple.py | Python | mit | 1,943 | 0.021101 |
# Copyright 2018 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... | Bismarrck/tensorflow | tensorflow/python/ops/while_v2.py | Python | apache-2.0 | 38,134 | 0.007159 |
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import get_object_or_404
from django import forms
from django.db.models import Max, Avg, Sum
from opos.models import Customers
from opos.forms import CustomerAddForm, CustomerForm
def is_... | kradalby/O2 | opos/views.py | Python | mit | 2,687 | 0.04131 |
from ajenti.api import *
from ajenti.com import *
class DebianNetworkCfg(Plugin):
implements(IConfigurable)
name = 'Network'
id = 'network'
platform = ['Debian', 'Ubuntu']
def list_files(self):
dir = '/etc/network/'
return [dir+'*', dir+'*/*', dir+'*/*/*']
| DVSBA/ajenti | plugins/network/recovery.py | Python | lgpl-3.0 | 305 | 0.006557 |
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE','tango_with_django_project.settings')
import django
django.setup()
from rango.models import Category, Page
def populate():
# First, we will create lists of dictionaries containing the pages
# we want to add into each category.
# Then we will create... | cclai999/rango | tango_with_django_project/populate_rango.py | Python | mit | 3,340 | 0.00479 |
# -*- coding: utf-8 -*-
import codecs
all_tables = {
'ktgg': ['main'],
'zgcpwsw': ['title', 'casecode'],
#
# # 'ktgg',
# # 'cdfy_sfgk',
# # 'newktgg',
# # 'zyktgg',
# # 'zgcpwsw',
# # 'itslaw',
# # 'qyxg_zgcpwsw',
# # 'qyxg_wscpws',
#
'zhixing': ['pname', 'case_co... | mefly2012/platform | test/test.py | Python | apache-2.0 | 3,173 | 0.001891 |
#
# Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... | ging/fiware-keystone-scim | keystone_scim/contrib/scim/converter.py | Python | apache-2.0 | 6,230 | 0.000482 |
"""
Evaluates the estimated results of the Segmentation dataset against the
ground truth (human annotated data).
"""
from joblib import Parallel, delayed
import logging
import mir_eval
import numpy as np
import os
import pandas as pd
import six
import sys
# Local stuff
import msaf
import msaf.input_output as io
impor... | guiquanz/msaf | msaf/eval.py | Python | mit | 14,384 | 0.000834 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
from telemetry.core import util
from telemetry.results import buildbot_output_formatter
from telemetry.results import c... | hefen1/chromium | tools/telemetry/telemetry/results/results_options.py | Python | bsd-3-clause | 7,550 | 0.009669 |
import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'COMMITTEE NAME', 'number': '3'},
... | h4ck3rm1k3/FEC-Field-Documentation | fec/version/v2/F7.py | Python | unlicense | 1,133 | 0.001765 |
"""Test energy_profiler module."""
import unittest
from physalia.energy_profiler import AndroidUseCase
# pylint: disable=missing-docstring
class TestEnergyProfiler(unittest.TestCase):
def test_empty_android_use_case(self):
# pylint: disable=no-self-use
use_case = AndroidUseCase(
nam... | TQRG/physalia | physalia/tests/test_energy_profiler.py | Python | mit | 534 | 0.001873 |
"""
Setup file for led-controller
author: Luis Garcia Rodriguez 2017
Licence: GPLv3
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='led-controller',
version='2.0.0',
description='A simple interface for con... | PolygonalTree/Led-control | led-control/setup.py | Python | agpl-3.0 | 909 | 0.0011 |
# -*- coding: utf-8 -*-
from decimal import Decimal
from django.http import HttpResponse, HttpRequest
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from ....cart.app import cart_app
from ....car... | fusionbox/satchless | satchless/contrib/checkout/multistep/tests.py | Python | bsd-3-clause | 16,546 | 0.00278 |
from tornado.web import RequestHandler
class BaseHandler(RequestHandler):
def initialize(self):
_settings = self.application.settings
self.db = self.application.db
#self.redis = _settings["redis"]
self.log = _settings["log"]
| code-shoily/tornado-cljs | handlers/base.py | Python | mit | 264 | 0.003788 |
# Generated by Django 3.1.4 on 2020-12-06 08:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0023_auto_20201202_0349'),
]
operations = [
migrations.AlterField(
model_name='review',
name='status',
... | stencila/hub | manager/projects/migrations/0024_auto_20201206_0819.py | Python | apache-2.0 | 746 | 0.00134 |
import random
import time
from collections import OrderedDict
from plenum.common.util import randomString
try:
import ujson as json
except ImportError:
import json
import pytest
from plenum.recorder.recorder import Recorder
TestRunningTimeLimitSec = 350
def test_add_to_recorder(recorder):
last_check_... | evernym/plenum | plenum/test/recorder/test_recorder.py | Python | apache-2.0 | 6,601 | 0.001666 |
#_*_ coding: utf-8 _*_
t1 = ()
print type(t1)
t3 = 1,2,3
print type(t3)
r1 = (1)
print r1
print type(r1)
r1 = (1,)
print r1
print type(r1)
t = (1,2,3)
print t*2
print t+('aaa','bbb')
print t
print
print t[0], t[1:3]
print len(t)
print 1 in t
print range(1,3)
t= (12345,54321,'hhh')
u = t,(1,2,3,4,5)
print u
t2 ... | JaeGyu/PythonEx_1 | 20160124_1.py | Python | mit | 473 | 0.07611 |
# -*- coding: utf-8 -*-
from .__version__ import __version__
| GjjvdBurg/HugoPhotoSwipe | hugophotoswipe/__init__.py | Python | gpl-3.0 | 62 | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Animal(object):
def run(self):
print('Animal running...')
class Dog(Animal):
def run(self):
print('Dog running...')
def shout(self):
print('Dog wang wang...')
class Cat(Animal):
def run(self):
print('Cat running...')
def shout(self):
print('Cat mi... | henryneu/Python | sample/exten.py | Python | apache-2.0 | 614 | 0.034202 |
#!/usr/bin/env python
def pos_neg(a, b, negative):
if negative:
return a < 0 and b < 0
else:
return (a < 0 and b > 0) or (a > 0 and b < 0)
if __name__ == "__main__":
# run some tests if run as script
# (from the codingbat site -- not all, I got bored)
assert pos_neg(1, -1, False) ... | weidnem/IntroPython2016 | Solutions/Session01/codingbat/Warmup-1/pos_neg.py | Python | unlicense | 736 | 0.002717 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | landism/pants | src/python/pants/engine/scheduler.py | Python | apache-2.0 | 21,934 | 0.008252 |
# Copyright 2019 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... | kevin-coder/tensorflow-fork | tensorflow/python/data/experimental/kernel_tests/serialization/choose_fastest_branch_dataset_serialization_test.py | Python | apache-2.0 | 3,611 | 0.008031 |
from interfaces.labels_map import LabelsMap
from helpers.python_ext import to_str
class LTS:
def __init__(self,
init_states,
model_by_signal:dict,
tau_model:LabelsMap,
state_name:str,
input_signals,
output_signal... | 5nizza/party-elli | interfaces/LTS.py | Python | mit | 2,142 | 0.004202 |
# Copyright 2013 IBM Corp
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | nuagenetworks/tempest | tempest/tests/lib/test_decorators.py | Python | apache-2.0 | 4,381 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.