repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thomas-schmid-ubnt/avocado | selftests/unit/test_jsonresult.py | 1 | 3924 | import unittest
import os
import json
import argparse
import tempfile
import shutil
from avocado import Test
from avocado.core import job
from avocado.core.result import Result
from avocado.plugins import jsonresult
class FakeJob(object):
def __init__(self, args):
self.args = args
self.unique_id... | gpl-2.0 | -3,485,709,407,126,933,500 | 33.725664 | 72 | 0.591743 | false | 3.629972 | true | false | false |
mspublic/openair4G-mirror | openair3/OPENAIRMME/S1AP/MESSAGES/ASN1/asn1tostruct.py | 1 | 24205 | import re, os, sys, string
import datetime
import getopt
import getpass
version = "0.5"
lines = ""
iesDefs = {}
ieofielist = {}
outdir = './'
filenames = []
verbosity = 0
prefix = ""
FAIL = '\033[91m'
WARN = '\033[93m'
ENDC = '\033[0m'
fileprefix = ""
def printFail(string):
sys.stderr.write(FAIL + string + EN... | gpl-3.0 | 7,354,189,997,787,154,000 | 46.183236 | 214 | 0.519521 | false | 3.071701 | false | false | false |
spudmind/parlparse | pyscraper/wrans/filterwranssections.py | 1 | 9532 | # vim:sw=8:ts=8:et:nowrap
import sys
import re
import os
import string
import mx.DateTime
from miscfuncs import ApplyFixSubstitutions
from splitheadingsspeakers import SplitHeadingsSpeakers
from splitheadingsspeakers import StampUrl
from clsinglespeech import qspeech
from parlphrases import parlPh... | agpl-3.0 | -2,826,320,471,134,514,000 | 38.735043 | 147 | 0.624528 | false | 3.318942 | false | false | false |
lummyare/lummyare-lummy | py/selenium/common/exceptions.py | 8 | 4338 | # Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 | 5,668,327,940,438,856,000 | 33.704 | 95 | 0.727755 | false | 4.467559 | false | false | false |
CodeShark/bitcoin | qa/rpc-tests/test_framework/comptool.py | 48 | 16305 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more bitcoinds to ... | mit | 3,819,665,319,953,845,000 | 42.713137 | 145 | 0.590494 | false | 4.125759 | true | false | false |
notfoundsam/raspberry | app/helpers.py | 1 | 17532 | import logging
from app.models import Rc, Button, Node, Arduino, Radio
from app import db
from datetime import datetime
class RcHelper:
def __init__(self, rc_id = None):
self.set(rc_id)
def get(self):
return self.rc
def set(self, rc_id):
self.rc = Rc.query.filter_by(id = rc_id).f... | unlicense | 525,952,836,392,164,860 | 28.173045 | 101 | 0.489277 | false | 3.830457 | false | false | false |
flaymond/tempter | temperature.py | 1 | 4752 | # A temperature class for gxconv
# License: GPL2.0
# Author: Flaymond Darius
# NOTE: Please refer to the LICENSE file for further informations about the,
# license.
class Temperature_Class():
def celToFah(self):
print("\nCelsius to Fahrenheit")
# this will loop the prompt again and again
while True:
# sa... | gpl-3.0 | 707,006,578,414,299,900 | 22.524752 | 84 | 0.639941 | false | 2.623965 | false | false | false |
jubatus/jubakit | example/classifier_sklearn_grid_search.py | 1 | 1937 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
Grid Search with scikit-learn
=============================
In this example, we show how to use scikit-learn wrapper.
"""
import sklearn
from operator import itemgetter
from jubakit.... | mit | 5,215,970,416,025,012,000 | 31.830508 | 112 | 0.692824 | false | 3.49639 | false | false | false |
ivanamihalek/progesterone | 08_tads_pic.py | 1 | 5665 | #!/usr/bin/python3
#
# This file is part of Progesterone pipeline.
#
# Progesterone pipeline 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 v... | gpl-2.0 | 7,257,189,170,770,640,000 | 30.298343 | 93 | 0.652074 | false | 3.026175 | false | false | false |
stephenhelms/WormTracker | python/wormtracker/config.py | 1 | 6613 | import h5py
import os
import yaml
import wormtracker as wt
import wormtracker.parallel as wtp
import wormtracker.postprocess as wtpp
import wormtracker.analysis as wta
def saveWormVideo(video, f):
systemSettings = getSystemConfigDict()
videoSettings = getVideoConfigDict(video)
regionSettings = [getRegionCo... | apache-2.0 | 6,925,951,792,925,640,000 | 34.175532 | 88 | 0.642674 | false | 3.913018 | true | false | false |
jck/myhdl | myhdl/conversion/_toVHDL.py | 1 | 80991 | # This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2015 Jan Decaluwe
#
# The myhdl library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by t... | lgpl-2.1 | -9,157,050,079,741,536,000 | 32.274856 | 109 | 0.514823 | false | 3.706003 | false | false | false |
quijot/gea | migrations/0001_initial.py | 1 | 19878 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import gea.models
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Antecedente',
... | bsd-2-clause | -3,109,785,908,529,686,500 | 47.002415 | 155 | 0.541036 | false | 3.969043 | false | false | false |
IdeaSolutionsOnline/ERP4R | core/objs/reconciliacao_banco.py | 1 | 8101 | # !/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
ERP+
"""
__author__ = 'António Anacleto'
__credits__ = []
__version__ = "1.0"
__maintainer__ = "António Anacleto"
__status__ = "Development"
__model_name__ = 'reconciliacao_banco.ReconciliacaoBanco'
import auth, base_models
from orm import *
from form import *
try:
... | mit | 6,822,298,839,810,645,000 | 47.987879 | 401 | 0.585426 | false | 3.308637 | false | false | false |
AASHE/hub | hub/apps/content/management/commands/thumbnail_report.py | 1 | 1044 | from hub.apps.content.models import Image
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Report how many images have been thumbnailed successfully"
def handle(self, *args, **options):
total_images = Image.objects.count()
broken_small_th... | mit | -9,069,012,348,964,172,000 | 37.666667 | 70 | 0.621648 | false | 3.866667 | false | false | false |
ninjaotoko/django-skeleton | djangoskeleton/templatetags/plugins/google.py | 1 | 3857 | # -*- coding:utf-8 -*-
import json
import re
from django.template import Context, Template
from djangoskeleton.templatetags.skeleton_tags import register, skeleton
skeleton.set_head_script('https://maps.googleapis.com/maps/api/js?v=3.exp', **{'data-src': 'skeleton'})
# Google Map marks
@register.inclusion_tag('plugin... | bsd-3-clause | -9,169,331,309,067,415,000 | 31.411765 | 103 | 0.520353 | false | 3.903846 | false | false | false |
iamutkarshtiwari/Browse-fiddleFeature | linkbutton.py | 3 | 5391 | # Copyright (C) 2007, One Laptop Per Child
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is ... | gpl-2.0 | 3,306,460,754,467,434,000 | 35.924658 | 76 | 0.635504 | false | 3.672343 | false | false | false |
rupertsmall/moonshot | trajectory_statistics.py | 1 | 3818 | # some functions to give statistics on the satellite's orbit, based on the coordinate data
# which is given as output from the moonshot_cartesian.py program
from math import sqrt
#does satellite hit earth
def hits_earth():
radius_earth = 6371000.0
radius_moon = 1737100.0
d = 3840000000.0 #distance bet... | mit | -395,063,635,254,621,800 | 30.816667 | 120 | 0.611839 | false | 3.355009 | false | false | false |
ijzer/cwbot-ndy | kol/bot/BotManager.py | 4 | 1340 | """
This is a simple module to help facilitate running multiple bots in the same
process. It handles a few common actions, like handling keyboard interrupts
for halting the bots, setting the socket default timeout to something
reasonable, and initializing the random number generator.
"""
from kol.database import ItemD... | bsd-3-clause | 6,607,551,539,849,711,000 | 22.103448 | 76 | 0.702239 | false | 3.872832 | false | false | false |
mauget/ipchecker | props_template.py | 1 | 1445 | #!/usr/bin/python
# encoding: utf-8
"""
props.py
Created by Lou Mauget on 2013-05-17.
MIT License
Copyright (c) 2013 Louis E. Mauget, mauget@mindspring.com
Rename file to props.py and set values for your environment
"""
import logging
# Target DNS
dns_name = ['DNS name to be monitored', 'somedns.org', 'somedns.com'... | mit | 70,693,882,430,261,350 | 21.230769 | 73 | 0.70519 | false | 2.844488 | false | false | false |
leVirve/dcard-spider | dcard/cli.py | 1 | 2604 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import time
import argparse
import dcard
from dcard.dcard import Dcard
parser = argparse.ArgumentParser()
parser.add_argument(
'mode', help='download / meta mode')
parser.add_argument(
'-f', '--forum', help='Specific which forum... | mit | -1,295,089,132,974,766,300 | 32.842105 | 108 | 0.659409 | false | 3.424767 | false | false | false |
ENCODE-DCC/pipeline-container | src/pool.py | 1 | 1045 | #!/usr/bin/env python
# pool 0.0.1
from os.path import splitext
import common
import logging
import sys
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
logger.propagate = False
logger.setLevel(logging.INFO)
# inputs are files of gzip format
def main(inputs, prefix=None):
input_fi... | mit | -1,535,764,011,003,565,800 | 22.75 | 109 | 0.615311 | false | 3.370968 | false | false | false |
aranzgeo/properties | properties/__init__.py | 1 | 1951 | """Properties
Giving structure (and documentation!) to the properties you use in your
code avoids confusion and allows users to interact flexibly and provide
multiple styles of input, have those inputs validated, and allow you as a
developer to set expectations for what you want to work with.
import properties
class ... | mit | -4,291,647,868,606,637,000 | 18.316832 | 73 | 0.667863 | false | 3.957404 | false | false | false |
schieb/angr | angr/analyses/variable_recovery/variable_recovery_base.py | 2 | 6483 |
import logging
from collections import defaultdict
from ailment.expression import BinaryOp, StackBaseOffset
from ...keyed_region import KeyedRegion
from ...sim_variable import SimStackVariable, SimRegisterVariable
from ..analysis import Analysis
l = logging.getLogger(name=__name__)
def parse_stack_pointer(sp):
... | bsd-2-clause | -5,718,203,860,930,853,000 | 32.076531 | 109 | 0.588462 | false | 4.155769 | false | false | false |
underbluewaters/marinemap | lingcod/bookmarks/models.py | 3 | 2450 | from django.contrib.gis.db import models
from lingcod.features import register
from lingcod.features.models import Feature
from django.utils.html import escape
from django.conf import settings
class Bookmark(Feature):
description = models.TextField(default="", null=True, blank=True)
latitude = models.FloatFiel... | bsd-3-clause | 6,075,878,414,708,376,000 | 32.561644 | 104 | 0.538776 | false | 3.94525 | false | false | false |
HiSPARC/sapphire | sapphire/tests/test_esd.py | 1 | 7560 | import os
import unittest
import tables
from mock import ANY, MagicMock, patch, sentinel
from sapphire import api, esd
from sapphire.tests.esd_load_data import (create_tempfile_path, perform_download_coincidences,
perform_esd_download_data, perform_load_coincidences,
... | gpl-3.0 | -5,719,679,551,341,374,000 | 45.097561 | 105 | 0.562037 | false | 3.822042 | true | false | false |
Curahelper/Cura | cura/MachineActionManager.py | 4 | 7064 | # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.PluginRegistry import PluginRegistry # So MachineAction can be added as plugin type
from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Settings.DefinitionContainer impo... | agpl-3.0 | -3,156,958,735,093,648,000 | 47.383562 | 141 | 0.66761 | false | 4.368584 | false | false | false |
DailyActie/Surrogate-Model | 01-codes/pyDOE-master/pyDOE/var_regression_matrix.py | 1 | 1448 | """
This code was originally published by the following individuals for use with
Scilab:
Copyright (C) 2012 - 2013 - Michael Baudin
Copyright (C) 2012 - Maria Christopoulou
Copyright (C) 2010 - 2011 - INRIA - Michael Baudin
Copyright (C) 2009 - Yann Collette
Copyright (C) 2009 - CEA - Jean-Marc Mart... | mit | 4,083,519,085,296,924,000 | 26.846154 | 84 | 0.616713 | false | 3.367442 | false | false | false |
40323230/Pyslvs-PyQt5 | pyslvs_ui/widgets/canvas_base.py | 1 | 28927 | # -*- coding: utf-8 -*-
"""This module contains the functions that main canvas needed."""
from __future__ import annotations
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2021"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from typing import TYPE_CHECKING, Tuple, List, Deque, Sequence, Dict
fr... | agpl-3.0 | 695,206,435,205,881,000 | 38.195122 | 79 | 0.50885 | false | 3.888426 | false | false | false |
HelloFax/hellosign-python-sdk | hellosign_sdk/tests/functional_tests/test_team.py | 1 | 5622 | from hellosign_sdk.tests.functional_tests import BaseTestCase
from hellosign_sdk.resource import Team
from hellosign_sdk.utils import NotFound, HSException, BadRequest
from time import time
#
# The MIT License (MIT)
#
# Copyright (C) 2014 hellosign.com
#
# Permission is hereby granted, free of charge, to any person ... | mit | -3,882,213,353,487,656,000 | 33.919255 | 140 | 0.600854 | false | 4.278539 | true | false | false |
lordakshaya/pyexcel | tests/test_sheets.py | 1 | 16196 | import pyexcel as pe
from _compact import OrderedDict
from nose.tools import raises
class TestFormattableSheet:
def setUp(self):
self.data = [
[1, 2, 3, 4, 5, 6, 7, 8],
["1", "2", "3", "4", "5", "6", "7", "8"],
[1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8],
[... | bsd-3-clause | -6,374,701,238,190,194,000 | 31.719192 | 80 | 0.499074 | false | 3.076163 | true | false | false |
psychopy/psychopy | psychopy/tests/data/correctScript/python/correctSoundComponent.py | 1 | 6538 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.0),
on May 10, 2019, at 11:15
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Neur... | gpl-3.0 | 5,468,677,273,751,211,000 | 40.379747 | 100 | 0.703579 | false | 3.47951 | false | false | false |
NYU-NEWS/janus | test_run.py | 1 | 2489 | #!/usr/bin/env python3
from subprocess import call
import subprocess
from time import time
import argparse
import resource
import os
import sys
run_app_ = "build/deptran_server"
config_path_ = "config/"
modes_ = [
"none",
"tpl_ww",
"occ",
"tpl_ww_paxos",
"occ_paxos",
"tapir",
"rococo",... | gpl-3.0 | -1,336,712,708,636,841,500 | 23.643564 | 105 | 0.51145 | false | 2.924794 | true | false | false |
3dfxsoftware/cbss-addons | ir_actions_report_xml_multicompany/__openerp__.py | 1 | 1888 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) Vauxoo (<http://vauxoo.com>).
# All Rights Reserved
###############Credits#########################################... | gpl-2.0 | 6,807,367,553,172,577,000 | 40.021739 | 83 | 0.532061 | false | 4.221477 | false | false | false |
giannitedesco/kapital | monop/client.py | 1 | 10641 | import gobject, glib
from linesock import LineSock
from xmlhelper import parse_xml_string
from collections import namedtuple
from simplestrategy import SimpleStrategy
from gametype import GameType
from gameobj import GameObj
from fieldtype import *
from game import Game
from player import Player
from estategroup impo... | gpl-3.0 | 197,053,804,902,844,640 | 24.335714 | 71 | 0.625035 | false | 2.690518 | true | false | false |
jiaxiaolei/pycate | pycate/handlers/link_handler.py | 1 | 7317 | # # -*- coding:utf-8 -*-
#
# import tornado.web
#
# import libs.upload
# from pycate.model.catalog_model import MCatalog
# from pycate.model.link_model import MLink
# import core.base_handler as base_handler
#
#
# class LinkHandler(base_handler.PycateBaseHandler):
# def initialize(self, hinfo=''):
# self.in... | mit | -2,981,054,824,444,194,300 | 34.990099 | 104 | 0.496905 | false | 2.922799 | false | false | false |
pegasus-isi/pegasus | test/core/blackdiamond/blackdiamond.py | 1 | 3654 | #!/usr/bin/env python
import sys
import ConfigParser
from Pegasus.DAX3 import *
import os
if len(sys.argv) != 3:
print "Usage: %s PEGASUS_HOME test-directory" % (sys.argv[0])
sys.exit(1)
config = ConfigParser.ConfigParser({'input_file': '', 'workflow_name': 'diamond', 'executable_installed':"False"})
config.read(... | apache-2.0 | 264,042,285,017,802,800 | 37.463158 | 134 | 0.704707 | false | 2.806452 | true | true | false |
BradAJ/satclass | neural_nets/nolearn.py | 1 | 3964 | import pickle as pkl
from matplotlib.image import imread
from skimage.color import rgb2gray
import glob
import os
import numpy as np
import sys
from lasagne.layers import DenseLayer
from lasagne.layers import InputLayer
from lasagne.layers import DropoutLayer
from lasagne.layers import Conv2DLayer
from lasagne.layers i... | mit | -3,358,861,726,155,009,500 | 33.469565 | 100 | 0.631685 | false | 3.146032 | false | false | false |
hpsilva/profitpy | profit/strategydesigner/main.py | 18 | 39269 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
from cPickle import dump, load
from os.path import split
from PyQt4.QtCore import QVariant, Qt, pyqtSignature
from PyQt4.QtGui import QApplication, QComboBox
f... | gpl-2.0 | 1,000,561,173,162,773,800 | 33.206446 | 83 | 0.589243 | false | 4.48481 | false | false | false |
mitrofun/kids2 | src/apps/common/forms.py | 1 | 1660 | # -*- coding: utf-8 -*-
from django import forms
from children.functions import get_last_date
from dictionaries.models import Dictionary
class FilterForm(forms.Form):
MODE_CHOICES = [(0, 'С любым статусом из списка'),
(1, 'Такие статусы входят в условие'),
(2, 'Только все... | mit | 3,431,485,537,660,343,000 | 27.240741 | 72 | 0.620984 | false | 3.344298 | false | false | false |
codedstructure/rpcpdb | rpcpdb/termsock.py | 1 | 3487 |
import socket
import errno
import sys
import select
import time
import os
PERM_ERR_MSG = """
No permission to access {0}.
Try using the '--sock {0}' option with sufficient access rights."""
# equivalent of 'socat - UNIX:/path/to/socket'
class TermSock(object):
# docs for python 2.7 select reference select.PIPE... | mit | -4,664,398,154,444,918,000 | 29.587719 | 73 | 0.519644 | false | 3.713525 | false | false | false |
popgengui/negui | agestrucne/genepopfilelociinfo.py | 1 | 6214 | '''
Description
2017_01_27
Class to give users an interface to get information about the loci
in a genepop file.
Motivation: calculate allele frequencies from a genpop file. The
fastest implementation would be to add the program genepop to our
dependancies, but for now, that it's only use would be to caluclate
allel... | agpl-3.0 | -8,183,740,873,234,764,000 | 30.866667 | 109 | 0.689733 | false | 2.921486 | false | false | false |
olemis/sqlalchemy | lib/sqlalchemy/engine/result.py | 39 | 44040 | # engine/result.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define result set constructs including :class:`.ResultProxy`
and :class:`.RowPro... | mit | 8,407,685,877,697,063,000 | 33.595444 | 79 | 0.570322 | false | 4.683612 | false | false | false |
trishume/MacRanger | ranger/container/history.py | 2 | 4034 | # Copyright (C) 2009-2013 Roman Zimbelmann <hut@lepus.uberspace.de>
# This software is distributed under the terms of the GNU GPL version 3.
# TODO: rewrite to use deque instead of list
class HistoryEmptyException(Exception):
pass
class History(object):
def __init__(self, maxlen=None, unique=True):
... | gpl-3.0 | -5,171,347,681,685,411,000 | 29.104478 | 72 | 0.519088 | false | 4.219665 | false | false | false |
mobarski/sandbox | embed/embed.py | 1 | 9296 | from __future__ import print_function
# TODO normalize X
# TODO NN
# TODO transformacja tf-idf
# TODO transformacja log(TF)
# TODO KNN zamiast cosine_similarity
# DONE dict of METHOD specific arguments
# DONE PMI
# DONE NPMI = PMI w zakresie -1 do 1 -> slabo dziala
# DONE log(PMI)
# DONE normalizacja,standaryzacja
# ... | mit | 8,057,970,227,876,628,000 | 29.478689 | 131 | 0.609294 | false | 2.643914 | false | false | false |
kgadek/evogil | algorithms/JGBL/JGBL.py | 1 | 4617 | import random
from algorithms.NSGAII.NSGAII import NSGAII
class JGBL(NSGAII):
def __init__(self,
population,
dims,
fitnesses,
mating_population_size,
mutation_eta,
crossover_eta,
mutation_rate,
... | gpl-3.0 | 6,362,251,864,275,694,000 | 34.244275 | 129 | 0.54256 | false | 3.309677 | false | false | false |
vgrem/Office365-REST-Python-Client | office365/sharepoint/views/view_field_collection.py | 1 | 2347 | from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.sharepoint.base_entity_collection import BaseEntityCollection
class ViewFieldCollection(BaseEntityCollection):
"""Represents a collection of Field resources."""
def __init__(self, context, resource_path=None):
... | mit | -4,879,980,485,358,625,000 | 31.150685 | 106 | 0.630592 | false | 4.259528 | false | false | false |
P-Daddy/pyjade | pyjade/nodes.py | 8 | 4172 | from collections import deque
import six
class Node(object):
debug = False
def __str__(self):
return self.__dict__.__str__()
class BlockComment(Node):
def __init__(self,val,block,buffer):
self.block = block
self.val = val
self.buffer = buffer
class Block(Node):
def __init__(self,node=None):
self.nodes =... | mit | 5,763,085,548,863,895,000 | 22.438202 | 103 | 0.653883 | false | 2.929775 | false | false | false |
taknira/certificate-transparency | python/ct/crypto/verify_rsa.py | 24 | 2444 | from ct.crypto import error
from ct.crypto import pem
from ct.proto import client_pb2
import Crypto.Hash.SHA256
import Crypto.PublicKey.RSA
import Crypto.Signature.PKCS1_v1_5
class RsaVerifier(object):
"""Verifies RSA signatures."""
# The signature algorithm used for this public key.
SIGNATURE_ALGORITHM ... | apache-2.0 | -3,622,200,946,825,491,000 | 34.42029 | 77 | 0.60802 | false | 4.086957 | false | false | false |
colinsullivan/AuditionManager | auditionapp/auditions/models.py | 1 | 2950 | from django.db import models
from django.contrib.localflavor.us.models import USStateField, PhoneNumberField
from auditionapp.productions.models import Production
class Actor(models.Model):
"""An Actor or Actress"""
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128... | mit | -8,252,649,334,695,883,000 | 32.146067 | 208 | 0.634237 | false | 3.478774 | false | false | false |
icve/liv-Ard | hostscripts/run.py | 1 | 3632 | #!/mnt/usb/wk/jpt/py/bin/python
#TODO logging lib
import time
from serial import Serial
from sys import argv, exit
from lib.runner import Runner
from animations.matrix_animation import Led_clock_pointer, Led_clock_flasher
from lib import lcdControl
from lib.sev_seg_dp import Sev_seg_dp
from lib.motion_sensor import ... | mit | -669,286,973,921,779,700 | 26.308271 | 77 | 0.628579 | false | 3.064979 | false | false | false |
thomdixon/elasticsearch-py | elasticsearch/client/snapshot.py | 3 | 7600 | from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class SnapshotClient(NamespacedClient):
@query_params('master_timeout', 'wait_for_completion')
def create(self, repository, snapshot, body=None, params=None):
"""
Create a snapshot in repository
`<http://www.ela... | apache-2.0 | -7,279,656,787,753,812,000 | 44.238095 | 98 | 0.641053 | false | 4.794953 | false | false | false |
saseumn/website | saseumn/models.py | 1 | 4360 | from datetime import datetime
from flask import url_for
from passlib.hash import bcrypt
from sqlalchemy.ext.hybrid import hybrid_property
from flask_security import UserMixin, RoleMixin
from saseumn.objects import login_manager
from saseumn.objects import db
from saseumn.util import random_string
attendance = db.Tab... | mit | 7,234,567,017,309,039,000 | 29.704225 | 103 | 0.661009 | false | 3.524656 | false | false | false |
pongad/api-client-staging | generated/python/grpc-google-iam-v1/google/iam/v1/policy_pb2.py | 3 | 13468 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/iam/v1/policy.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 reflect... | bsd-3-clause | 1,379,878,164,484,793,000 | 35.204301 | 934 | 0.673448 | false | 3.40101 | false | false | false |
FujiMakoto/tumdlr | tumdlr/api.py | 1 | 4719 | import urllib
from requests import Session
from yurl import URL
from tumdlr import __version__
from tumdlr.containers import TumblrPost, TumblrPhotoSet, TumblrVideoPost
from tumdlr.errors import TumdlrParserError
class TumblrBlog:
def __init__(self, url, session=None, **kwargs):
"""
Tumblr blog... | mit | 7,032,786,704,575,043,000 | 31.321918 | 102 | 0.515999 | false | 4.050644 | false | false | false |
edx/django-openid-auth | django_openid_auth/auth.py | 1 | 18519 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2008-2013 Canonical Ltd.
#
# 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 ... | bsd-2-clause | 1,486,169,813,853,917,400 | 41.18451 | 79 | 0.619742 | false | 4.445271 | false | false | false |
briney/seqtools | translate_fasta.py | 2 | 1128 | #!/usr/bin/python
# filename: translate_fasta.py
'''
Simple script that translates a FASTA file of nucleotide sequences. Output is a single file containing
the translated sequences.
Dependancies: biopython, python >=2.7
'''
import argparse
from Bio import SeqIO
parser = argparse.ArgumentParser("Translates a FAS... | gpl-2.0 | -7,468,622,859,492,713,000 | 24.636364 | 120 | 0.707447 | false | 3.142061 | false | false | false |
pipex/gitbot | app/webhooks.py | 1 | 3315 | from __future__ import absolute_import
from __future__ import unicode_literals
from flask.views import MethodView
from flask import request
from .util import camel_to_underscore
from werkzeug.exceptions import NotImplemented
from logging import getLogger
import six
class WebHook(MethodView):
def __init__(self, ... | apache-2.0 | -569,158,802,995,079,360 | 29.136364 | 107 | 0.588235 | false | 4.344692 | false | false | false |
thexiao77/twitterBot | Tweet mining/exporter to sql.py | 1 | 1292 | import re
import csv
import sqlite3
def readCSV():
with open('@KosmonavtRed_tweets.csv', 'r', encoding='utf-8') as csvfile:
reader = csv.DictReader(csvfile)
tweets = []
for row in reader:
tweets.append(row['text'])
# print(row['text'])
return tweets
def re... | gpl-3.0 | -2,866,728,039,970,337,000 | 23.377358 | 85 | 0.537152 | false | 3.43617 | false | false | false |
DinoTools/dionaea | tests/printer/tests/__init__.py | 1 | 1282 | # This file is part of the dionaea honeypot
#
# SPDX-FileCopyrightText: 2019 Michael Neu
#
# SPDX-License-Identifier: GPL-2.0-or-later
import socket
class PrinterConnection(object):
def __init__(self):
self.connection = None
self.connect()
def __del__(self):
self.disconnect()
de... | gpl-2.0 | 8,442,448,741,166,222,000 | 22.309091 | 75 | 0.574103 | false | 3.826866 | false | false | false |
knoguchi/acc | acc/entry.py | 1 | 1471 | # from acc.account import Account, AccountingTransaction
class Entry(object):
"""
Entry object.
< Date | Account | EntryType | Amount >
See page 23
"""
def __init__(self, amount, entry_date,
account=None,
entry_type=None,
transaction=None):... | apache-2.0 | 3,029,451,175,517,207,600 | 27.843137 | 138 | 0.613868 | false | 4.2149 | false | false | false |
idoerg/BOA | src/format/faa.py | 1 | 1499 | """
Data structure that stores faa entries
"""
import os,sys,site
import numpy
base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
for directory_name in os.listdir(base_path):
site.addsitedir(os.path.join(base_path, directory_name))
import fasta
import argparse
import hmmer
from Bio.Seq import ... | gpl-3.0 | 921,440,356,025,230,800 | 25.785714 | 75 | 0.63042 | false | 3.301762 | false | false | false |
kreopt/aioweb | generators/crud/controller.py | 1 | 2068 | import aioweb.core
from aioweb.core.controller.decorators import default_layout, before_action, template, layout, redirect_on_success
##from aioweb.middleware.csrf.decorators import csrf_exempt
from aiohttp import web
from app.models.MODEL import MODEL_CLASS
async def set_model(ctrl):
ctrl.model = MODEL_CLASS.find... | mit | -3,010,563,074,306,769,400 | 34.050847 | 114 | 0.644584 | false | 3.590278 | false | false | false |
TheCatMan2000/Discord-Selfbot | cogs/fc.py | 2 | 1913 | import discord
from discord.ext import commands
from cogs.utils.dataIO import dataIO
import json
from requests.structures import CaseInsensitiveDict
class FriendCodes:
def __init__(self, bot):
self.bot = bot
try:
with open("settings/fc.json", encoding='utf-8') as fc:
... | gpl-3.0 | 3,791,152,608,370,801,700 | 36.3 | 111 | 0.579195 | false | 4.035865 | false | false | false |
lxzhu/ehow | src/knn.py | 1 | 1177 | from numpy import tile
from numpy import array
from numpy import zeros
import operator
def createDataSet():
group=array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]])
labels=['A','A','B','B']
return group, labels
def classify0(x,dataset,labels,k):
print dataset
size=dataset.shape[0]
print size
deltaM... | mit | -54,189,363,759,309,980 | 28.45 | 91 | 0.667799 | false | 3.401734 | false | false | false |
wavemoth/wavemoth | examples/bench.py | 1 | 1663 | #!/usr/bin/env python
from __future__ import division
# Stick .. in PYTHONPATH
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from wavemoth.butterfly import *
from wavemoth.healpix import *
from wavemoth.benchmark_utils import *
from wavemoth.fastsht import ShtPlan
from wavemot... | gpl-2.0 | -3,719,021,638,904,485,000 | 23.820896 | 65 | 0.65003 | false | 2.48209 | false | false | false |
christiancarballo/bha | bha/bha.py | 1 | 5070 | from __future__ import absolute_import, division, print_function
import os
import numpy as np
import bha
data_path = os.path.join(bha.__path__[0], 'data')
#from .due import due, Doi
#
#
## Use duecredit (duecredit.org) to provide a citation to relevant work to
## be cited. This does nothing, unless the user has duecre... | mit | -3,981,557,117,561,869,300 | 30.886792 | 114 | 0.629191 | false | 3.391304 | false | false | false |
crdoconnor/strictyaml | strictyaml/yamlpointer.py | 1 | 8412 | from strictyaml.ruamel.comments import CommentedSeq, CommentedMap
from strictyaml.ruamel import dump, RoundTripDumper
from copy import deepcopy
import sys
if sys.version_info[0] == 3:
unicode = str
class YAMLPointer(object):
"""
A sequence of indexes/keys that look up a specific chunk of a YAML document... | mit | -1,417,276,357,295,225,900 | 34.344538 | 88 | 0.525678 | false | 4.333849 | false | false | false |
dimagi/rapidsms-contrib-apps-dev | handlers/app.py | 5 | 1033 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from rapidsms.apps.base import AppBase
from .utils import get_handlers
class App(AppBase):
def start(self):
"""
Spiders all apps, and registers all available handlers.
"""
self.handlers = get_handlers()
if len(self.hand... | bsd-3-clause | -6,594,748,786,389,012,000 | 30.30303 | 78 | 0.600194 | false | 4.035156 | false | false | false |
LukeM12/samba | lib/testtools/testtools/matchers/_higherorder.py | 12 | 8403 | # Copyright (c) 2009-2012 testtools developers. See LICENSE for details.
__all__ = [
'AfterPreprocessing',
'AllMatch',
'Annotate',
'MatchesAny',
'MatchesAll',
'Not',
]
import types
from ._impl import (
Matcher,
Mismatch,
MismatchDecorator,
)
class MatchesAny(object):
... | gpl-3.0 | -4,348,180,499,618,021,000 | 28.076125 | 79 | 0.60288 | false | 4.367464 | false | false | false |
yohn89/pythoner.net | pythoner/home/forms.py | 3 | 1055 | #encoding:utf-8
"""
pythoner.net
Copyright (C) 2013 PYTHONER.ORG
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.
Th... | gpl-3.0 | 2,361,561,247,157,625,300 | 33.233333 | 69 | 0.729858 | false | 4.089147 | false | false | false |
lordtangent/arsenalsuite | cpp/lib/PyQt4/examples/widgets/windowflags.py | 20 | 12025 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | gpl-2.0 | 6,785,271,515,483,258,000 | 41.946429 | 99 | 0.672599 | false | 4.184064 | false | false | false |
project-oak/hafnium-verification | experiments/ownership-inference/infer/infer/lib/python/report.py | 1 | 1738 | #!/usr/bin/env python2.7
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __... | apache-2.0 | 2,460,442,823,345,098,000 | 38.5 | 79 | 0.627158 | false | 4.032483 | false | false | false |
tigerneil/chainer | cupy/creation/from_data.py | 7 | 4530 | import ctypes
import numpy
import cupy
from cupy import cuda
from cupy import elementwise
def array(obj, dtype=None, copy=True, ndmin=0):
"""Creates an array on the current device.
This function currently does not support the ``order`` and ``subok``
options.
Args:
obj: cupy.ndarray object ... | mit | 4,309,732,189,439,508,000 | 25.491228 | 79 | 0.629139 | false | 3.691932 | false | false | false |
ldoktor/avocado-vt | setup.py | 2 | 4324 | # 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.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-2.0 | -8,985,365,927,531,946,000 | 34.735537 | 79 | 0.595745 | false | 3.740484 | true | false | false |
vlcvboyer/GoldenCheetah | src/Resources/python/library.py | 3 | 2076 | #
# Python class library loaded when the interpreter
# is installed by PythonEmbed
#--------------------------------------------------
# API for accessing GC data
#--------------------------------------------------
# basic activity data
def __GCactivity(join="repeat", activity=None):
rd={}
for x in range(0,GC.s... | gpl-3.0 | 6,972,672,585,839,514,000 | 22.066667 | 54 | 0.649326 | false | 2.513317 | false | false | false |
tcalmant/demo-ipopo-nao | python_on_nao/shell/speech.py | 1 | 1599 | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
MQTT Hue message sender
"""
# Internals
import internals.constants
# Pelix
from pelix.ipopo.decorators import ComponentFactory, Provides, Requires, \
Instantiate
import pelix.shell
# Standard library
import logging
# -----------------------------------------... | gpl-2.0 | -5,450,115,187,274,010,000 | 23.984375 | 80 | 0.574734 | false | 4.207895 | false | false | false |
ingadhoc/odoo-infrastructure | infrastructure/wizard/restore_database_wizard.py | 1 | 4644 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, api, models, _
from op... | agpl-3.0 | 4,904,464,046,221,991,000 | 33.4 | 79 | 0.571921 | false | 4.098853 | false | false | false |
hltbra/pyhistorian | specs/story_pt_br.py | 1 | 1999 | # coding: utf-8
'''
>>> CalculadoraBrasileira.rodar()
True
>>> print OUTPUT.getvalue()
História: Calculadora brasileira
Como um matemático preguiçoso
Eu quero usar uma calculadora
Para que eu descanse minha mente
<BLANKLINE>
Cenário 1: Somando 1 e 1
Dado que eu tenho uma calculadora ... OK
Quando eu entro com 1 +... | mit | -7,279,403,054,138,013,000 | 26.246575 | 69 | 0.687783 | false | 2.698779 | false | false | false |
abhijo89/django-cbv-inspector | cbv/tests.py | 1 | 2030 | from django.core.urlresolvers import reverse
from django.test import TestCase
from .factories import InheritanceFactory, KlassFactory, ProjectVersionFactory
from .views import Sitemap
class SitemapTest(TestCase):
def test_200(self):
ProjectVersionFactory.create()
response = self.client.get(revers... | bsd-2-clause | 1,681,734,950,405,090,800 | 29.757576 | 83 | 0.59803 | false | 3.711152 | true | false | false |
jrlusby/backup-zipper | FTPSync.py | 1 | 2207 | #! /usr/bin/env python3
"""
John R Lusby 2014
MIT License in file LICENSE
"""
import sys, os, re
#settings
local_dir = "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"
max_backups = 14
#ftp settings
destination =
username =
password =
target_dir = 'BACKUPs/spiceworks'
# FOR THE RECORD - an error in the... | mit | 157,527,986,761,588,580 | 30.528571 | 79 | 0.673312 | false | 3.475591 | false | false | false |
sileht/deb-openstack-quantum | quantum/plugins/ryu/nova/linux_net.py | 1 | 2786 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# <yamahata at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | apache-2.0 | 1,683,006,263,508,995,000 | 38.239437 | 79 | 0.633884 | false | 3.665789 | false | false | false |
pypa/virtualenv | src/virtualenv/create/via_global_ref/builtin/cpython/common.py | 4 | 2392 | from __future__ import absolute_import, unicode_literals
from abc import ABCMeta
from collections import OrderedDict
from six import add_metaclass
from virtualenv.create.describe import PosixSupports, WindowsSupports
from virtualenv.create.via_global_ref.builtin.ref import RefMust, RefWhen
from virtualenv.util.path ... | mit | -8,693,797,237,481,428,000 | 35.8 | 118 | 0.701505 | false | 3.973422 | false | false | false |
rlworkgroup/metaworld | metaworld/policies/sawyer_shelf_place_v1_policy.py | 1 | 1977 | import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerShelfPlaceV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'block_pos... | mit | -6,370,340,119,863,894,000 | 29.890625 | 89 | 0.510369 | false | 3.168269 | false | false | false |
GaloisInc/saw-script | saw-remote-api/python/saw_client/__init__.py | 1 | 18969 | from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from typing import List, Optional, Set, Union, Tuple, Any, IO
import uuid
import sys
import time
import atexit
from distutils.spawn import find_executable
import cryptol
from cryptol import cryptoltypes
from . import connection
from argo_client... | bsd-3-clause | 8,031,073,839,455,982,000 | 35.291188 | 98 | 0.601826 | false | 4.236136 | false | false | false |
embaldridge/retriever | scripts/bbs.py | 1 | 9628 | #retriever
"""Retriever script for Breeding Bird Survey
"""
import os
import urllib
import zipfile
from decimal import Decimal
from retriever.lib.templates import Script
from retriever.lib.models import Table, Cleanup, no_cleanup, correct_invalid_value
VERSION = '0.5'
class main(Script):
def __init__(self, **kw... | mit | 7,499,294,335,900,418,000 | 46.900498 | 108 | 0.414624 | false | 4.352622 | false | false | false |
ozknightwalker/testing_101 | base/models.py | 1 | 1468 | from __future__ import unicode_literals
from datetime import date
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
owner = models.OneToOneField(User, related_name='profile')
birthdate = models.DateField(null=True, blank=True)
full_name = models.CharFi... | bsd-2-clause | 4,522,597,397,889,244,000 | 27.230769 | 62 | 0.638283 | false | 3.873351 | false | false | false |
matthewalbani/scipy | scipy/special/_mptestutils.py | 21 | 12362 | from __future__ import division, print_function, absolute_import
import sys
import time
import numpy as np
from numpy.testing import dec, assert_
from scipy._lib.six import reraise
from scipy.special._testutils import assert_func_equal
try:
import mpmath
except ImportError:
pass
# ------------------------... | bsd-3-clause | 3,723,907,605,736,188,000 | 30.535714 | 93 | 0.500162 | false | 3.632677 | false | false | false |
saratonite/Salk | salklib.py | 1 | 6956 | #-------------------------------------------------------------------------------
# Name: DeNiro
# Purpose: Keylogger by sarath
# Version: 0.0.2
# Author: Sarath
#
# Created: 19/08/2012
# Copyright: (c) Sarath 2012
# Licence: <your licence>
#-------------------------------------------------... | mit | 2,801,930,111,140,386,000 | 41.944444 | 203 | 0.576337 | false | 3.914463 | false | false | false |
YDnepr/practicalcourse | PythonStarterApp/main.py | 1 | 2616 | from flask import jsonify, request
from PythonStarterApp import app, readHtmlFile
import datetime
import database
import gui
import HTMLParser
##########################################################################
############################### Web Server ###############################
@app.route('/')
def sel... | apache-2.0 | 6,724,108,240,358,326,000 | 27.747253 | 94 | 0.592508 | false | 3.774892 | false | false | false |
siemens/django-mantis-authoring | mantis_authoring/cybox_object_transformers/dnsrecord.py | 1 | 1857 | from .__object_base__ import transformer_object, ObjectFormTemplate
from cybox.common import StructuredText, String
from cybox.objects import dns_record_object, address_object
from django import forms
from django.templatetags.static import static
class DISABLEDTEMPLATE_Default(transformer_object):
# Disabled -... | gpl-2.0 | 6,915,298,705,359,151,000 | 38.510638 | 137 | 0.641896 | false | 4.173034 | false | false | false |
daedelus-j/shorterly | apps/base/models.py | 1 | 1354 | from django.db import models
import random
import string
from libs import model_helpers
class Url(models.Model):
url_id = models.CharField(max_length=7,
blank=True,
null=True,
db_index=True)
class DeviceUrl(models.Model):
... | mit | 1,958,999,492,203,888,600 | 30.488372 | 74 | 0.477105 | false | 4.668966 | false | false | false |
a10networks/a10sdk-python | a10sdk/core/dnssec/dnssec_oper.py | 2 | 5458 | from a10sdk.common.A10BaseClass import A10BaseClass
class Oper(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param ptr_memory: {"type": "number", "format": "number"}
:param total_memory: {"type": "number", "format": "number"}
:param reference_objects: {"type":... | apache-2.0 | 2,168,114,227,702,283,300 | 37.43662 | 116 | 0.570355 | false | 3.503209 | false | false | false |
dave-tucker/spectrometer | spectrometer/processor/rcs.py | 3 | 6861 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 | -5,558,374,158,981,945,000 | 32.79803 | 79 | 0.528932 | false | 4.219557 | false | false | false |
jiahaoliang/group-based-policy | gbpservice/nfp/service_vendor_agents/haproxy/haproxy-agent/src/keepalived_config_driver.py | 1 | 4198 | import keepalived_cfg
import constants
import commands
import logging
HAPROXY_BINARY_PATH = '/usr/sbin/keepalived'
KEEPALIVED_CONFIG_FILE_ABS_PATH = '/etc/keepalived/keepalived.conf'
HAPROXY_PID_FILE_ABS_PATH = '/var/run/haproxy.pid'
class KeepalivedDriver:
def __init__(self, logger):
self.logger = logg... | apache-2.0 | 2,123,209,176,065,159,200 | 40.156863 | 101 | 0.5798 | false | 4.032661 | true | false | false |
ashishbaghudana/mthesis-ashish | resources/tees/Utils/InteractionXML/MergeNamedEntityTypes.py | 2 | 1447 | import sys, os
try:
import xml.etree.cElementTree as ET
except ImportError:
import cElementTree as ET
import Utils.ElementTreeUtils as ETUtils
if __name__=="__main__":
print >> sys.stderr, "##### Merge named entity types #####"
from optparse import OptionParser
optparser = OptionParser(usage="%prog... | mit | 5,547,289,025,449,584,000 | 38.108108 | 96 | 0.63027 | false | 3.7979 | false | false | false |
harikishen/addons-server | src/olympia/legacy_api/views.py | 1 | 17206 | """
API views
"""
import hashlib
import itertools
import json
import random
import urllib
from datetime import date, timedelta
from django.core.cache import cache
from django.db.transaction import non_atomic_requests
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.utils.decorators impor... | bsd-3-clause | -809,385,561,182,121,700 | 33.2749 | 79 | 0.587411 | false | 3.992111 | false | false | false |
ionutvmi/sublimePacks | copy_line.py | 1 | 3312 | # Based on to http://stackoverflow.com/a/25345286/1579481
"""
Copy a line by number where the cursor is
Example inputs:
For a single line: 25
For line 25 and next 2 lines: 25:2
For line 25 till 27: 25-27
"""
import sublime_plugin
import re
_line = re.compile('^\d+$')
_line_next = re.compile('^\d+\:\d+$')
... | mit | -6,138,825,946,255,610,000 | 28.309735 | 69 | 0.520229 | false | 3.67184 | false | false | false |
yoseforb/lollypop | src/player_radio.py | 1 | 3637 | #!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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 opti... | gpl-3.0 | 7,181,592,396,292,688,000 | 28.811475 | 76 | 0.576024 | false | 4.0011 | false | false | false |
modera/mcloud | mcloud/sync.py | 1 | 5675 | from copy import copy
import inject
import os
import subprocess
from mcloud.application import Application
import re
# from mcloud.application import Application
from twisted.internet.defer import inlineCallbacks, Deferred
from twisted.python import filepath
class VolumeNotFound(ValueError):
pass
def get_storag... | apache-2.0 | 8,774,167,869,438,493,000 | 30.88764 | 113 | 0.561057 | false | 4.056469 | false | false | false |
taige/PyTools | simcity/shop.py | 1 | 6833 |
from simcity.factories import *
class Shop(Factories):
def __str__(self):
return self.cn_name
@property
def seq(self):
return self.get('seq', 0)
@property
def pending_timing(self):
if not self.is_busying:
return 0
timing = 0
for i in sorted(r... | apache-2.0 | 8,308,450,898,339,677,000 | 40.850649 | 171 | 0.529868 | false | 2.813182 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.