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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
qstokkink/py-ipv8 | ipv8/dht/provider.py | 1 | 2972 | import logging
from binascii import hexlify
from socket import inet_aton, inet_ntoa
from struct import pack, unpack_from
from . import DHTError
from ..messaging.anonymization.tunnel import IntroductionPoint, PEER_SOURCE_DHT
from ..peer import Peer
from ..util import cast_to_bin
class DHTCommunityProvider(object):
... | lgpl-3.0 | -3,343,131,417,839,799,000 | 42.072464 | 125 | 0.618775 | false | 3.504717 | false | false | false |
chrislombaard/cryptopuppet | crumpet/wallet.py | 1 | 2489 | class Wallet(object):
'''
This class keeps track of the current funds that a bot can utilize in trading.
'''
def __init__(self, assets: float, currency: float, instrument: str, fee: float = 0.25):
'''
This function initializes a Classification object.
:param fee: The maximum per... | mit | -3,859,478,532,744,076,300 | 37.890625 | 116 | 0.619526 | false | 4.107261 | false | false | false |
googleinterns/smart-content-summary | lasertagger/bert_example_test.py | 1 | 6210 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | 5,754,159,743,830,170,000 | 45.343284 | 86 | 0.613205 | false | 3.389738 | true | false | false |
datalogics/scons | src/engine/SCons/Tool/Subversion.py | 2 | 2345 | """SCons.Tool.Subversion.py
Tool-specific initialization for Subversion.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obta... | mit | -224,294,009,193,633,600 | 35.076923 | 85 | 0.683582 | false | 4.28702 | false | false | false |
willsilvano/django-simplemooc | simplemooc/settings.py | 1 | 3712 | """
Django settings for simplemooc project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import... | mit | -2,041,727,766,266,100,500 | 24.784722 | 91 | 0.691002 | false | 3.329148 | false | false | false |
djpetti/isl-gaze-demo | face_tracking/VideoCapture.py | 1 | 3166 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 15:49:10 2017
@author: morepoch
"""
import cv2
import numpy as np
from threading import Thread
import landmark_detection as ld
import time
class VideoCapture(object):
def __init__(self, src=0):
# initialize the video camera stream and rea... | mit | -6,526,774,280,988,503,000 | 34 | 97 | 0.583386 | false | 4.117035 | false | false | false |
prongs/apache-dev-tool | apache_dev_tool/cleaner.py | 2 | 1613 | from __future__ import print_function
import commands
import os
import re
class Cleaner:
def __init__(self, client):
self.client = client
def clean(self):
self.clean_branches()
self.close_review_requests()
def clean_branches(self):
print("Cleaning Branches")
for b... | mit | -3,784,206,760,598,511,600 | 38.341463 | 108 | 0.570986 | false | 4.0325 | false | false | false |
bigswitch/horizon | openstack_dashboard/dashboards/project/connections/top_talkers/urls.py | 2 | 1136 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | -642,994,386,560,340,500 | 35.645161 | 78 | 0.733275 | false | 3.837838 | false | false | false |
natetrue/ReplicatorG | skein_engines/skeinforge-40/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/document.py | 2 | 3353 | """
Boolean geometry utilities.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
__author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ ... | gpl-2.0 | -4,656,588,734,455,472,000 | 28.672566 | 157 | 0.762899 | false | 3.456701 | false | false | false |
kabads/zoomr | zoomr.py | 1 | 9460 | # /bin/bash python2
# Zoomr - a pygame platform
# (c) 2014 A Cripps
# See README and LICENSE for more information
import pygame, random, sys
from pygame.locals import *
# set up some constant variables
FPS = 15
WINWIDTH = 680
WINHEIGHT = 480
BLACK = (0,0,0)
WHITE = (255,255,255)
RED = (255, 0, 0)
GREEN = (50,15... | gpl-2.0 | -8,946,680,758,752,876,000 | 30.744966 | 127 | 0.606131 | false | 3.394331 | false | false | false |
zhreshold/mxnet | example/ssd/dataset/yolo_format.py | 55 | 5795 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | 5,163,533,340,440,492,000 | 33.088235 | 96 | 0.571009 | false | 4.318182 | false | false | false |
PySide/Tools | pysideuic/properties.py | 8 | 16210 | # This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2010 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... | gpl-2.0 | -8,473,738,995,924,265,000 | 32.285421 | 103 | 0.590006 | false | 3.993594 | false | false | false |
node13h/droll | droll/blog/models.py | 1 | 3147 | # Copyright (C) 2017 Sergej Alikov <sergej.alikov@gmail.com>
# 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, or
# (at your option) any later version.
# ... | agpl-3.0 | 7,970,744,703,250,501,000 | 32.83871 | 89 | 0.665078 | false | 4.140789 | false | false | false |
mgrygoriev/CloudFerry | cloudferry_devlab/cloudferry_devlab/tests/config.py | 2 | 28117 | # Copyright 2015 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 writing,... | apache-2.0 | -1,692,074,558,200,252,200 | 39.224607 | 79 | 0.554931 | false | 2.869667 | true | false | false |
Antiun/c2c-rd-addons | chricar_account_period_sum/chricar_account_period_sum_trg.py | 4 | 12967 | # -*- coding: utf-8 -*-
# ChriCar Beteiligungs- und Beratungs- GmbH
# ChriCar Beteiligungs- und Beratungs- GmbH
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bu... | agpl-3.0 | -2,181,621,311,324,466,400 | 42.955932 | 165 | 0.522017 | false | 3.729364 | false | false | false |
marklee77/fail2ban | fail2ban/tests/misctestcase.py | 3 | 7168 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 | -4,583,681,103,324,903,400 | 32.339535 | 129 | 0.687919 | false | 3.161888 | true | false | false |
ntt-sic/heat | heat/tests/generic_resource.py | 1 | 4064 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | 1,905,875,496,220,255,000 | 33.440678 | 78 | 0.57874 | false | 4.215768 | false | false | false |
audy/cram | metacram/clc.py | 1 | 6139 | # these functions are for dealing with CLC Assembly Cell and its output
# THIS IS NO LONGER SUPPORTED. JUST HERE FOR POSTERITY!! ~ Austin
# clc_filter
# assembly_table
# reference_assemble_clc
# make_otu_coverage_table
# make_coverage_table
import re
from runner import *
from logger import *
def clc_filter(**ops):
... | bsd-3-clause | -948,321,167,427,172,700 | 27.686916 | 79 | 0.543248 | false | 3.556779 | false | false | false |
pgularski/pysm | test/test_string_parsing.py | 1 | 5639 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Test based on the code from:
# http://code.activestate.com/recipes/\
# 578344-simple-finite-state-machine-class-v2/
import string
from pysm import State, StateMachine, Event
def char(event):
return event.cargo['char']
# Simple storage object for each toke... | mit | 5,041,153,721,628,142,000 | 35.380645 | 79 | 0.566412 | false | 3.635719 | false | false | false |
ideascube/pibox-installer | ansiblecube/roles/captive_portal/files/captiveportal/portal/web.py | 1 | 9202 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
""" kiwix-hotspot captive portal
captive portal is not required for kiwix-hotspot to work.
it is deployed in order to welcome users and point them to the homepage.
1. user connects to WiFi network and receives config via DHCP
... | gpl-3.0 | -1,525,558,735,652,868,000 | 32.95572 | 87 | 0.658226 | false | 3.605799 | false | false | false |
beni55/reserbot | src/mem.py | 1 | 7891 | """
This file is part of reserbot.
reserbot 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.
reserbot is distributed... | gpl-3.0 | 624,901,134,825,155,000 | 28.447761 | 99 | 0.494361 | false | 3.194737 | false | false | false |
saucelabs/slacktalker | parse_users.py | 1 | 3722 | import json
import sys
import model
session = model.get_session()
def parse_file(filename):
with open(filename, 'rb') as f:
data = json.loads(f.read())
for item in data:
"""
{
"id": "U02HCHXGE",
"team_id": "T024TC0TE",
"name": "allison",
... | mit | 3,825,512,742,459,506,000 | 35.851485 | 106 | 0.474745 | false | 3.596135 | false | false | false |
MartinHowarth/microservice | microservice/tests/test_live_subprocess_deployment.py | 1 | 2244 | import requests
from unittest import TestCase
from microservice import initialise_interface, terminate_interface
from microservice.core import settings, deploy, microservice_logging
from microservice.tests.microservices_for_testing import (all_test_microservices, echo_as_dict, echo_as_dict2,
... | mit | 4,309,831,554,544,512,000 | 35.786885 | 117 | 0.64795 | false | 3.784148 | true | false | false |
gkc1000/pyscf | pyscf/pbc/ci/__init__.py | 2 | 1298 | # Copyright 2014-2018 The PySCF Developers. 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 appl... | apache-2.0 | -2,258,214,168,777,749,500 | 35.055556 | 74 | 0.72188 | false | 2.809524 | false | false | false |
BirkbeckCTP/janeway | src/core/migrations/0031_auto_20191103_2035.py | 1 | 1275 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-11-03 20:35
from __future__ import unicode_literals
import core.file_system
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core'... | agpl-3.0 | 6,231,927,271,073,258,000 | 37.636364 | 149 | 0.622745 | false | 3.923077 | false | false | false |
taylor-oconnell/PyFBA | PyFBA/model/build_model.py | 2 | 6471 | from __future__ import print_function
import sys
import os
import copy
import errno
import PyFBA
def roles_to_model(rolesFile, id, name, orgtype="gramnegative", verbose=False):
"""
Read in the 'assigned_functions' file from RAST and create a model.
:param rolesFile: File path to assigned functions RAST f... | mit | 1,062,044,296,982,471,300 | 31.19403 | 97 | 0.594499 | false | 3.495948 | false | false | false |
yprez/django-logentry-admin | logentry_admin/admin.py | 1 | 5273 | from django.contrib import admin
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse, NoReverseMatch
from django.utils.encoding import force_str
from django.... | isc | 9,141,495,084,816,111,000 | 30.386905 | 76 | 0.576712 | false | 4.204944 | false | false | false |
nttcom/eclcli | eclcli/dh/dhclient/v2/shell.py | 1 | 4131 | from __future__ import print_function
import logging
from ..i18n import _
from ..common import cliutils
from .. import utils
logger = logging.getLogger(__name__)
def do_server_list(cs, args):
"""List User Names for Inter Connect Gateway Service."""
servers = cs.servers.list()
columns = ["name", "vpn_en... | apache-2.0 | 6,431,781,060,044,983,000 | 26.177632 | 81 | 0.617768 | false | 3.65899 | false | false | false |
jmhobbs/sdmp-signed-yaml-python | syml/__init__.py | 1 | 1492 | # -*- coding: utf-8 -*-
import base64
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_PSS
from . import exceptions
from . import private
__all__ = ["Sign", "Verify", "exceptions"]
def Sign(document, private_key_path, private_key_passphrase=None):
with open(private_key_path, 'rb') as key_ha... | mit | -6,914,377,941,128,012,000 | 33.697674 | 91 | 0.69571 | false | 3.767677 | false | false | false |
FrancoisRheaultUS/dipy | doc/examples/reconst_forecast.py | 3 | 4264 | """
==============================================================
Crossing invariant fiber response function with FORECAST model
==============================================================
We show how to obtain a voxel specific response function in the form of
axially symmetric tensor and the fODF using the FORECA... | bsd-3-clause | -2,689,701,145,207,421,400 | 27.238411 | 79 | 0.678471 | false | 2.981818 | false | false | false |
smmbllsm/aleph | aleph/metadata/tabular.py | 3 | 1633 | from aleph.text import string_value, slugify
class TabularColumn(object):
def __init__(self, schema, data):
self.schema = schema
self.data = data
self.label = data.get('label')
self.name = data.get('name')
def __repr__(self):
return '<TabularColumn(%r,%r)>' % (self.la... | mit | 7,066,884,860,562,226,000 | 26.216667 | 65 | 0.549296 | false | 3.780093 | false | false | false |
FishPi/FishPi-POCV---Command---Control | fishpi/web/commands.py | 1 | 1694 |
#
# FishPi - An autonomous drop in the ocean
#
# Commands for RPC interface
#
from twisted.protocols.amp import Boolean, Integer, String, Float, Command
class Sum(Command):
arguments = [('a', Integer()),
('b', Integer())]
response = [('status', Integer())]
class HeartbeatCmd(Command):
... | bsd-2-clause | 2,113,782,755,539,691,000 | 22.527778 | 74 | 0.549587 | false | 4.517333 | false | false | false |
nightrune/ola | python/examples/ola_rdm_discover.py | 2 | 2593 | #!/usr/bin/env python
# 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 i... | lgpl-2.1 | -3,079,503,542,726,734,300 | 27.811111 | 79 | 0.658696 | false | 3.763425 | false | false | false |
Distrotech/libreoffice | helpcontent2/wiki-to-help/metabook.py | 2 | 4798 | import json
import xml.dom.minidom as minidom
class Article(object):
itemTag = {"content_type":"text/x-wiki","type":"article"}
#itemTag = {"content_type":"text/x-wiki","type":"article","wikiident":"lo","url":"http://asdlkf/","source-url":"http://sourceurl/","source":"http://source/"}
attributes = {}
in... | gpl-3.0 | -2,156,137,892,827,447,800 | 30.155844 | 161 | 0.567528 | false | 4.175805 | false | false | false |
ucsd-progsys/csolve-bak | demo/c2html.py | 2 | 5066 | #!/usr/bin/python
# Copyright (c) 2009 The Regents of the University of California. All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# abov... | bsd-3-clause | -3,756,184,863,494,232,600 | 26.98895 | 87 | 0.500197 | false | 3.274725 | false | false | false |
langurmonkey/gaiasky | core/scripts/gaiasky-release/gaiasky-release.py | 1 | 7422 | #!/usr/bin/env python3
"""
This script prepares Gaia Sky for a new release
:Author:
Toni Sagrista Selles
:Organization:
Astronomisches Rechen-Institut - Zentrum fur Astronomie Heidelberg - UNIVERSITAT HEIDELBERG
:Version:
0.1
"""
import argparse, os, sys, json
from tempfile import mkstemp
from shutil impor... | mpl-2.0 | -1,806,733,229,060,802,600 | 41.411429 | 249 | 0.579898 | false | 3.859594 | false | false | false |
junwucs/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_checkpoint_new_category_in_predictorGBM.py | 4 | 1098 | import sys
sys.path.insert(1,"../../../")
import h2o, tests
def checkpoint_new_category_in_predictor():
sv1 = h2o.upload_file(h2o.locate("smalldata/iris/setosa_versicolor.csv"))
sv2 = h2o.upload_file(h2o.locate("smalldata/iris/setosa_versicolor.csv"))
vir = h2o.upload_file(h2o.locate("smalldata/iris/virgi... | apache-2.0 | -4,051,705,017,228,593,000 | 39.703704 | 109 | 0.688525 | false | 3.008219 | false | false | false |
kubeflow/kfp-tekton | sdk/python/kfp_tekton/compiler/pipeline_utils.py | 1 | 2058 | # Copyright 2021 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 | 1,588,061,708,530,649,300 | 40.16 | 120 | 0.670068 | false | 3.905123 | false | false | false |
zokis/zsplitjoin | zsplitjoin/utils.py | 1 | 1708 | # coding: utf-8
import re
from unipath import Path
try:
unicode = unicode
except NameError:
basestring = (str, bytes)
def read_in_chunks(file_object, chunk_size):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
def files_iter(path):
... | mit | 8,996,499,659,223,818,000 | 23.4 | 74 | 0.526932 | false | 3.077477 | false | false | false |
willtrking/objectify | objectify/prop/base.py | 1 | 8434 | # coding: utf-8
from ..base import ObjectifyObject
class ObjectifyProperty(ObjectifyObject):
__slots__ = (
'to_type',
'__fetch_object__',
'__fetch_wrapper_func__',
'__passdown_to_fetch_object__',
'name',
'__value__',
'__value_touched__',
'__value_fe... | mit | 1,745,405,792,597,088,000 | 30.706767 | 108 | 0.540906 | false | 4.229689 | false | false | false |
google/clusterfuzz | src/local/butler/scripts/build_attributes.py | 1 | 2687 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -5,212,134,677,035,651,000 | 27.284211 | 77 | 0.643096 | false | 3.606711 | true | false | false |
BurtBiel/azure-cli | src/command_modules/azure-cli-network/azure/cli/command_modules/network/mgmt_traffic_manager_profile/lib/models/traffic_manager_profile_creation_client_enums.py | 1 | 1056 | #---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------... | mit | -6,291,593,498,677,026,000 | 26.076923 | 94 | 0.480114 | false | 5.471503 | false | false | false |
w-k-jones/brownian | test_brownian.py | 1 | 4959 | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 22 21:02:33 2016
@author: William Jones
History:
22/10/2016: WJ - Created file, replicating matlab script collisiontrial.m
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
# Define NaN array creation routine to save time
def na... | mit | 7,647,844,450,646,709,000 | 28.25 | 137 | 0.518048 | false | 2.767299 | false | false | false |
fastavro/fastavro | setup.py | 1 | 3445 | import ast
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools import Extension
# publish.sh should set this variable to 1.
try:
USE_CYTHON = int(os.getenv("FASTAVRO_USE_CYTHON"))
except TypeError:
USE_CYTHON = False
e... | mit | -1,105,859,285,110,378,400 | 30.898148 | 84 | 0.613062 | false | 3.752723 | true | false | false |
coderiot/webtrack | webtrack/guess.py | 1 | 2269 | #!/usr/bin/env python
# encoding: utf-8
from abc import ABCMeta, abstractmethod
import lxml.etree
class Guesser(object):
"""Class for guessing the parts of an RSS item from
an given HTML element."""
__metaclass__ = ABCMeta
NO_LINK = "http://"
@abstractmethod
def guess_title(self, elem):... | gpl-2.0 | 4,525,352,769,813,776,400 | 24.784091 | 67 | 0.585721 | false | 4.217472 | false | false | false |
PMBio/limix | limix/io/conversion.py | 2 | 10236 |
import h5py
import pandas
from optparse import OptionParser
import scipy as sp
import os
import pdb
import subprocess, sys, os
import limix.deprecated.io.plink as PLINK
class LIMIX_converter(object):
'''
A class to help with file conversion in LIMIX
'''
__slots__=["options","args","data", "result","i... | apache-2.0 | 1,846,605,991,888,723,000 | 45.739726 | 201 | 0.622411 | false | 3.574022 | false | false | false |
TrueSkills/django-mongo-rest | django_mongo_rest/auth.py | 1 | 1042 | from django.contrib.auth.backends import ModelBackend
from django_mongo_rest.utils import Enum
class PERMISSION(Enum):
EMAIL_UNVERIFIED = 'is_email_unverified'
LOGIN = 'is_login_required'
SUPERUSER = 'is_superuser'
_PERMISSIONS = {
PERMISSION.EMAIL_UNVERIFIED: lambda request: request.user.is_authentic... | mit | -8,651,505,091,157,380,000 | 34.931034 | 102 | 0.740883 | false | 3.902622 | false | false | false |
demikl/freeboxv5-status | freebox_v5_status/freeboxstatus.py | 1 | 11750 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import re
import six.moves.urllib as urllib
class FreeboxStatus():
def __init__( self, loadData=True, externalDataFeed=None ):
self._registerCategoryParsers()
self._registerSubCategoryParsers()
self._razInfos()
if loadDa... | mit | -5,666,043,131,076,877,000 | 39.431034 | 129 | 0.491429 | false | 3.837971 | false | false | false |
TAvant/NeuralNetwork-ZipCodeData | cubixServerCode/packages/nnTrainingFuncs.py | 1 | 12913 | #!/usr/bin/python
# imported libraries
import gzip as gz
import numpy as np
import matplotlib.pyplot as plt
# digt data function 1 of 2
def seperate_data(filename):
'''name: seperate_data
description:
dependencies:
inputs:
outputs:
'''
# get data from the file
with... | unlicense | 738,284,506,871,828,900 | 43.840278 | 134 | 0.532409 | false | 4.264531 | false | false | false |
chamaelj/tools-artbio | unstable/local_tools/includeScore.py | 4 | 1223 | #!/usr/bin/env python
#By, drosofff@gmail.com
# command: includeScore.py <tabulated_score_file> <GFF> <score_enriched_GFF> id_column score_column filter_limit
import sys
def get_foldchanges (file, id_column=1, score_column=5, skipline=200, limit=1E-5):
scoredic = {} # a dic of scores with gene_id as keys
id_colum... | mit | 3,090,762,620,473,065,000 | 25.586957 | 112 | 0.607522 | false | 2.711752 | false | false | false |
Saqel/Gallery | KAPE.py | 1 | 4111 | # A program for Task of the "Basics of programming"
# "KAPE Gallery" v. 1.1.2
# To Open your images you have to change the argument PATH_GALLERY and ADDRES
# which located on the 22 and 23 lines.
# For example: PATH_GALLERY='C:\\Users\\1\\Desktop\\фотографии\\'
# ADDRES = ' "C:\\Users\\1\\Desktop\\фотогра... | gpl-2.0 | 5,771,371,676,550,048,000 | 38.057692 | 90 | 0.614229 | false | 3.407718 | false | false | false |
Instrumental/instrumental-python | instrumental_agent/agent.py | 1 | 12041 | import os
import sys
import fcntl
import errno
import atexit
import logging
import socket
import ssl
import time
import datetime
import calendar
import re
import string
if sys.version_info[0] < 3:
from Queue import Queue, Full
else:
from queue import Queue, Full
from threading import Thread
def normalize_tim... | mit | 6,414,770,297,840,212,000 | 34.104956 | 215 | 0.549705 | false | 4.425211 | false | false | false |
anugrah-saxena/pycroscopy | pycroscopy/io/translators/forc_iv.py | 1 | 4168 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 27 17:58:35 2017
@author: Suhas Somnath
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from os import path, remove
import h5py
import numpy as np # For array operations
from scipy.io import loadmat
from .translator import Transl... | mit | 504,436,782,806,873,340 | 35.243478 | 111 | 0.544626 | false | 3.669014 | false | false | false |
anjel-ershova/python_training | test/test_edit_group.py | 1 | 1724 | # -*- coding: utf-8 -*-
from model.model_group import Group
import random
def test_edit_group_name(app2, db, check_ui):
# если число групп == 0, то делаем новую, чтобы ее можно было модифицировать
if len(db.get_group_list()) == 0:
app2.group.create(Group(name="Created name"))
# собираем старый спис... | apache-2.0 | -5,684,767,514,961,956,000 | 41.025641 | 117 | 0.67033 | false | 2.637681 | false | false | false |
zymtech/Scrapiders | lagou/lagou/spiders/compinfo.py | 1 | 4203 | # coding = utf-8
from scrapy.http.request.form import Request
from scrapy import Spider
from scrapy.selector import Selector
from scrapy.http import Request
from scrapy.crawler import Crawler
from lagou.items import LagouItem
class CompInfo(Spider):
name = "lagou"
allowed_domains = ["lagou.com"]
# start_... | mit | 4,968,328,314,271,289,000 | 67.901639 | 140 | 0.602665 | false | 3.520101 | false | false | false |
fernandozamoraj/py_sandbox | py101/my_psutil.py | 1 | 1583 | # Functions to get system values:
from psutil import cpu_percent, net_io_counters
# Functions to take a break:
from time import sleep
# Package for email services:
import smtplib
import string
def pollForAttacks():
MAX_NET_USAGE = 400000
MAX_ATTACKS = 4
attack = 0
counter = 0
while... | apache-2.0 | 801,348,075,285,044,700 | 29.7 | 91 | 0.566014 | false | 3.230612 | false | false | false |
EduPepperPDTesting/pepper2013-testing | lms/djangoapps/sso/sp.py | 1 | 32749 | from django.conf import settings
from django.db import transaction
from pytz import UTC
from django.contrib.auth import login
from django.utils.translation import ugettext as _
import datetime
import json
from pepper_utilities.utils import random_mark
from django.http import HttpResponse
from django.views.decorators.cs... | agpl-3.0 | -2,981,669,455,672,319,000 | 41.979003 | 154 | 0.56017 | false | 3.988916 | false | false | false |
GoldenCheetah/GoldenCheetah | src/Resources/python/library.py | 3 | 3622 | #
# 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-2.0 | 7,265,453,164,751,179,000 | 24.507042 | 202 | 0.678907 | false | 2.615162 | false | false | false |
yangdongsheng/autotest | client/net/basic_machine.py | 12 | 1923 | TYPE = 'BASIC'
CALIBRATION_JOB = ''
GLAG_FLAG = False
DEVICES = ['eth0']
CONNECTED_DEVICES = ['eth0']
NDLINK_SPEED = 1000
NDLINK_AUTONEG = True
NDLINK_RX = None
NDLINK_TX = False
FLOODPING_NUMPKTS = 100000
FLOODPING_CONSTRAINTS = ["rtt_max < 1.0",
"rtt_min < 0.05",
... | gpl-2.0 | 6,647,337,512,504,696,000 | 28.136364 | 69 | 0.384295 | false | 4.189542 | false | true | false |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/PyAMF-0.7.2/pyamf/tests/gateway/test_wsgi.py | 6 | 5412 | # -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
WSGI gateway tests.
@since: 0.1.0
"""
import unittest
import pyamf
from pyamf import remoting, util
from pyamf.remoting.gateway.wsgi import WSGIGateway
class WSGIServerTestCase(unittest.TestCase):
def setUp(self):
... | mit | 7,651,063,659,777,556,000 | 27.484211 | 77 | 0.599039 | false | 4.147126 | true | false | false |
BurtBiel/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/models/basic.py | 3 | 1043 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | 3,410,136,342,653,044,700 | 27.972222 | 76 | 0.517737 | false | 4.074219 | false | false | false |
jacqueswww/django-jenkins | django_jenkins/tasks/run_pyflakes.py | 3 | 2157 | # -*- coding: utf-8 -*-
import os
import re
import sys
from optparse import make_option
from pyflakes.scripts import pyflakes
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class Reporter(object):
# TODO Remove, when drop django 1.7 support
option_list = (
make... | lgpl-3.0 | -4,922,578,712,797,570,000 | 33.238095 | 117 | 0.522021 | false | 4.751101 | false | false | false |
MichaelAquilina/s3backup | s4/commands/edit_command.py | 2 | 2250 | #! -*- encoding: utf8 -*-
import os
from s4 import utils
from s4.commands import Command
class EditCommand(Command):
def run(self):
if "targets" not in self.config:
self.logger.info("You have not added any targets yet")
self.logger.info('Use the "add" command to do this')
... | mit | -4,051,793,794,031,842,000 | 38.473684 | 88 | 0.593333 | false | 3.461538 | true | false | false |
lmazuel/azure-sdk-for-python | azure-batch/azure/batch/models/environment_setting.py | 3 | 1107 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | 4,736,087,323,578,662,000 | 29.75 | 76 | 0.552846 | false | 4.555556 | false | false | false |
AggroBoy/push.py | push.py | 1 | 2660 | #! /usr/bin/env python3
import urllib.request, urllib.error, urllib.parse
import platform
import sys
import configparser
import os
from optparse import OptionParser
from time import time
def notify(username, password, sender, message):
url = 'https://boxcar.io/notifications'
values = {
'notificati... | mit | -573,948,643,135,457,900 | 35.438356 | 201 | 0.666541 | false | 3.894583 | true | false | false |
skewerr/hexchat-addons | whois.py | 1 | 2494 | import hexchat
import ctypes
import thread
__module_name__ = "whois"
__module_version__ = "0.1.7"
__module_description__ = "Part of my Python rice for HexChat."
whois = []
#Functions
def message(title, text, style):
ctypes.windll.user32.MessageBoxA(0, text, title, style)
def whois_end(word, word_eol, userdata)... | bsd-3-clause | 7,498,846,319,578,674,000 | 28.011628 | 69 | 0.672815 | false | 2.771111 | false | false | false |
SmartDeveloperHub/sdh-fragment-server | setup.py | 1 | 1881 | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... | apache-2.0 | -2,424,145,404,368,804,400 | 42.744186 | 97 | 0.603934 | false | 3.769539 | false | false | false |
camradal/ansible | lib/ansible/modules/network/iosxr/iosxr_system.py | 8 | 9141 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 | 3,275,225,732,780,757,500 | 31.763441 | 91 | 0.645772 | false | 4.039328 | true | false | false |
PHOTOX/fuase | ase/ase/ga/particle_comparator.py | 2 | 3572 | """Comparators originally meant to be used with particles"""
import numpy as np
from ase.ga.utilities import get_nnmat
class NNMatComparator(object):
"""Use the nearest neighbor matrix to determine differences
in the distribution (and to a slighter degree structure)
of atoms. As specified in
S. Lysgaa... | gpl-2.0 | -7,505,421,723,958,378,000 | 31.770642 | 78 | 0.546473 | false | 3.304348 | false | false | false |
markfinger/recipe-crawler-for-beaney | recipe_crawler.py | 1 | 4406 | import requests
from bs4 import BeautifulSoup
import os
import csv
# This is a path to a file that contains the list of urls to check.
# Each url should be on a new line
URL_FILE = os.path.join(os.path.dirname(__file__), 'urls_to_crawl.txt')
# This is the file that we will write the output to
CSV_FILE = os.path.join(... | mit | -2,018,509,137,545,261,300 | 36.982759 | 110 | 0.597594 | false | 3.919929 | false | false | false |
sancayouth/SrtModPy | main.py | 1 | 1219 | # -*- coding: utf-8 -*-
import os.path
import argparse
from srtmod.srtmod import SrtMod
def main():
parser = argparse.ArgumentParser(prog='SrtModPy',\
description='Just adjusts the timing of subtitle files')
parser.add_argument('file', help='the subtitle to be modified')
parser.add_argument('t... | mit | 1,248,248,651,776,281,300 | 34.852941 | 89 | 0.621001 | false | 3.797508 | false | false | false |
ElectronicTheatreControlsLabs/LuminosusEosEdition | src/media_server/artnet.py | 1 | 17644 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Name: luminosus.next
# Innovative node-based lighting software.
# Author: Tim Henning
#
# Copyright 2015 Tim Henning
#
# Luminosus is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or F... | mit | -5,718,956,880,961,743,000 | 36.462845 | 126 | 0.552086 | false | 3.876098 | false | false | false |
patxoca/arv.autotest | arv/autotest/validators.py | 1 | 4382 | # -*- coding: utf-8 -*-
# $Id$
"""Module defining validators and validator factories.
A validator is any callable that receives a value and performs some
test on it. If the validation succeeds the validator must return a
value, either the original value or the result of some
computation/conversion. If the check fail... | gpl-3.0 | -976,173,394,207,716,700 | 27.828947 | 85 | 0.641944 | false | 4.317241 | false | false | false |
nlaurens/SpaceAlert | ducklingScriptParser.py | 1 | 4232 | import sys
import event
class ducklingScriptParser():
#Split the timeString (mmss) from the EventString (xxx)
"""
"""
def __init__(self):
pass
@staticmethod
def splitEvent(strEvent):
"""
@param strEvent:
@return:
"""
i = 0
while strEv... | mit | -953,494,717,510,202,100 | 27.986301 | 94 | 0.540879 | false | 3.929434 | false | false | false |
ceos-seo/Data_Cube_v2 | ui/django_site_v2/data_cube_ui/apps/custom_mosaic_tool/urls.py | 1 | 1839 | # Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | apache-2.0 | 1,070,627,958,081,626,900 | 44.975 | 100 | 0.716694 | false | 3.482955 | false | false | false |
facelessuser/Rummage | rummage/lib/gui/dialogs/regex_test_dialog.py | 1 | 27659 | """
Regex Test dialog.
Licensed under MIT
Copyright (c) 2013 - 2015 Isaac Muse <isaacmuse@gmail.com>
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 limitat... | mit | -7,927,346,115,150,676,000 | 38.911977 | 117 | 0.56318 | false | 4.132527 | true | false | false |
rduivenvoorde/QGIS | python/console/console_output.py | 13 | 10797 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | gpl-2.0 | -989,245,688,809,978,400 | 40.679537 | 129 | 0.593701 | false | 4.280333 | false | false | false |
SymbiFlow/prjuray | fuzzers/002-tilegrid/rclk_dsp_intf_clkbuf/top.py | 1 | 5928 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import csv
import os
import random
random... | isc | 2,038,063,150,115,725,600 | 30.365079 | 78 | 0.560391 | false | 3.248219 | false | false | false |
dresen/praat | scripts/praatNumericParser.py | 1 | 1055 | from Tier import Tier
from Interval import Interval
def parse(filehandle):
intervalstart = False
for line in filehandle:
elems = [x.strip() for x in line.split('=')]
#print(elems[0])
# Filter useless lines
if len(elems) < 2:
continue
if not intervalstart:
if elems[0] == 'Object class':
objectcl... | mit | -6,595,266,054,865,975,000 | 20.530612 | 51 | 0.584834 | false | 2.813333 | false | false | false |
furbrain/Coherence | coherence/backends/miroguide_storage.py | 3 | 10545 | # Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Coherence backend presenting the content of the MIRO Guide catalog for on-line videos
#
# The APi is described on page:
# https://develop.participatoryculture.org/trac/democracy/wiki/MiroGuideApi
# Copyright 2009, Jean-Michel ... | mit | -4,507,803,952,506,079,000 | 41.040816 | 186 | 0.576861 | false | 4.085626 | false | false | false |
jrief/django-post_office | post_office/backends.py | 1 | 2317 | from collections import OrderedDict
from email.mime.base import MIMEBase
from django.core.files.base import ContentFile
from django.core.mail.backends.base import BaseEmailBackend
from .settings import get_default_priority
class EmailBackend(BaseEmailBackend):
def open(self):
pass
def close(self):
... | mit | 4,751,635,926,534,852,000 | 34.106061 | 80 | 0.562797 | false | 5.183445 | false | false | false |
liberorbis/libernext | env/lib/python2.7/site-packages/celery/tests/bin/test_beat.py | 6 | 5464 | from __future__ import absolute_import
import logging
import sys
from collections import defaultdict
from celery import beat
from celery import platforms
from celery.bin import beat as beat_bin
from celery.apps import beat as beatapp
from celery.tests.case import AppCase, Mock, patch, restore_logging
from kombu.tes... | gpl-2.0 | 7,552,911,778,402,874,000 | 26.877551 | 76 | 0.6056 | false | 3.709437 | true | false | false |
joke2k/faker | faker/providers/person/id_ID/__init__.py | 2 | 12909 | from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = (
'{{first_name_male}} {{last_name}}',
'{{first_name_male}} {{last_name}}',
'{{first_name_male}} {{last_name}}',
'{{first_name_male}} {{last_name}}',
'{{first_name_female}} {{last_name}}',
... | mit | 665,698,851,978,874,800 | 60.76555 | 102 | 0.544659 | false | 2.269116 | false | false | false |
kifcaliph/odoo | addons/website_forum/controllers/main.py | 4 | 36487 | # -*- coding: utf-8 -*-
import werkzeug.urls
import werkzeug.wrappers
import simplejson
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.controllers.main import login_redirect
from openerp.addons.web.http import request
from openerp.addons.website.... | agpl-3.0 | -1,829,686,373,298,471,200 | 52.657353 | 210 | 0.59687 | false | 3.792433 | false | false | false |
junzis/pyModeS | pyModeS/decoder/bds/bds50.py | 1 | 3340 | # ------------------------------------------
# BDS 5,0
# Track and turn report
# ------------------------------------------
from pyModeS import common
def is50(msg):
"""Check if a message is likely to be BDS code 5,0
(Track and turn report)
Args:
msg (str): 28 hexdigits string
Returns:
... | gpl-3.0 | -8,157,346,845,991,018,000 | 18.306358 | 72 | 0.538024 | false | 3.333333 | false | false | false |
mancoast/CPythonPyc_test | fail/310_test_gzip.py | 2 | 7237 | #! /usr/bin/env python
"""Test script for the gzip module.
"""
import unittest
from test import support
import os
import gzip
import struct
data1 = b""" int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned long start_total_out;
"""
data2 = b"""/* zlibmodule.c -- gzip-com... | gpl-3.0 | -7,697,063,974,777,025,000 | 27.948 | 80 | 0.555893 | false | 3.600498 | true | false | false |
egbertbouman/tribler-g | Tribler/Core/dispersy/crypto.py | 1 | 15926 | """
The crypto module provides a layer between Dispersy and low level crypographic features.
@author: Boudewijn Schoon
@organization: Technical University Delft
@contact: dispersy@frayja.com
"""
from hashlib import sha1, sha224, sha256, sha512, md5
from math import ceil
from random import randint
from stru... | lgpl-2.1 | -35,734,583,264,673,910 | 36.375904 | 174 | 0.579681 | false | 3.192863 | false | false | false |
tancredi/python-console-snake | snake/stage.py | 1 | 1160 |
import console
import math
import config
import parser
import themes
def init():
global size, width, height, padding, boundaries, chosen_theme
available_size = (width, height) = console.getTerminalSize()
chosen_size = config.game_sizes[parser.options.size]
if parser.options.fullscreen:
wid... | mit | 8,578,026,981,826,254,000 | 25.363636 | 65 | 0.59569 | false | 3.473054 | false | false | false |
EnTeQuAk/django-orm | django_orm/pool.py | 1 | 2079 | # -*- coding: utf-8 -*-
from Queue import Queue
import threading
from django_orm import POOLTYPE_PERSISTENT, POOLTYPE_QUEUE
class PoolError(Exception):
pass
class QueuePool(object):
"""
Psycopg2-Django ORM Queue connection pool implementation.
"""
def __init__(self, settings):
options ... | bsd-3-clause | -3,357,819,746,480,203,300 | 23.458824 | 61 | 0.574315 | false | 4.251534 | false | false | false |
AnhellO/DAS_Sistemas | Ago-Dic-2020/perez-sanchez-jose-jahir/Practica2/Practica2.py | 1 | 1254 | class Animal():
def __init__(self, edad, tamaño, peso, altura):
self.edad = edad
self.tamaño = tamaño
self.peso = peso
self.altura = altura
def __str__(self):
return f"Edad: {self.edad} años\nTamaño: {self.tamaño}\nPeso: {self.peso}kg\nAltura: {self.altura}cm"
d... | mit | -7,261,347,534,358,453,000 | 31.710526 | 145 | 0.607401 | false | 2.611345 | false | false | false |
YuL78/ecmx | ecmx.py | 1 | 25822 | # ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Youcef Lemsafer
#
# 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... | mit | -2,698,271,255,509,210,000 | 45.863884 | 119 | 0.451243 | false | 4.748437 | false | false | false |
xros/get_ecshop_link | get_ecshop_theme.py | 1 | 4675 | #!/usr/bin/env python2
"""
Copyright to Alexander Liu . Aug, 2015
You are free to use and have fun
Usage:
To get attachment download link from: http://bbs.ecshop.com/viewthread.php?tid=128540
It looks like
*****************
"http://bbs.ecshop.com/attachment.php?aid=MzY3NjV8NjNkMWQxZjN8MTQzODYzNjk0NnxkM... | mit | -2,782,090,271,778,841,000 | 52.735632 | 733 | 0.759572 | false | 2.164352 | false | false | false |
fuhrmanator/course-activity-planner | python/tests/calendar_test.py | 2 | 1555 | import unittest
import arrow
from dateutil import tz
from ics_calendar import CalendarReader, Seminar, Practicum, Laboratory, \
GenericMeeting
class TestCalendarParsing(unittest.TestCase):
calendar_path = '../data/multi-fr.ics'
def setUp(self):
self.calendar = CalendarReader(self.calendar_path... | gpl-3.0 | 1,030,318,368,946,529,200 | 32.804348 | 80 | 0.659164 | false | 3.42511 | true | false | false |
highweb-project/highweb-webcl-html5spec | chrome/app/nibs/PRESUBMIT.py | 25 | 3046 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script to verify that XIB changes are done with the right version.
See http://dev.chromium.org/developers/design-documents/mac-xib-files fo... | bsd-3-clause | -6,665,735,759,746,964,000 | 31.752688 | 79 | 0.679908 | false | 3.278794 | false | false | false |
perrygeo/Fiona | fiona/fio/cat.py | 1 | 2273 | """$ fio cat"""
import json
import logging
import warnings
import click
import cligj
import fiona
from fiona.transform import transform_geom
from fiona.fio import options
warnings.simplefilter('default')
# Cat command
@click.command(short_help="Concatenate and print the features of datasets")
@cligj.files_in_ar... | bsd-3-clause | 6,099,740,639,182,791,000 | 31.942029 | 75 | 0.543775 | false | 4.102888 | false | false | false |
farr/arfit | arfit/ar1_kalman.py | 1 | 5376 | import ar1_kalman_core as ac
import numpy as np
def logit(x, low, high):
return np.log(x-low) - np.log(high-x)
def inv_logit(y, low, high):
if y < 0:
ey = np.exp(y)
return (ey*high + low)/(1.0 + ey)
else:
ey = np.exp(-y)
return (high + ey*low)/(1.0 + ey)
def logit_log_jaco... | mit | 1,593,744,531,205,577,000 | 26.151515 | 127 | 0.527902 | false | 2.958723 | false | false | false |
allmightyspiff/softlayer-python | SoftLayer/CLI/virt/placementgroup/create.py | 3 | 1348 | """Create a placement group"""
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import helpers
from SoftLayer.managers.vs_placement import PlacementManager as PlacementManager
@click.command()
@click.option('--name', type=click.STRING, required=True, prompt=True, help="Name for this new placeme... | mit | -7,489,559,982,671,574,000 | 42.483871 | 118 | 0.646142 | false | 3.884726 | false | false | false |
kyrus/PyMyo | modules/viewstatedecode/command.py | 1 | 1057 |
###############################################################################
## File : viewstatedecode.py
## Description: Return a decoded viewstate from an encoded viewstate parameter
## :
## Created_On : Tue Sep 25 17:21:36 2012
## Created_By : Rich Smith (rich@kyr.us)
## Modified_On: Tue ... | bsd-3-clause | 4,189,564,653,409,830,400 | 31.030303 | 100 | 0.521287 | false | 3.558923 | false | false | false |
FreddieV4/DailyProgrammerChallenges | Easy Challenges/Challenge 0010 Easy/solutions/solution.py | 1 | 1781 | #Python 3.X solution for Easy Challenge #0010
#GitHub: https://github.com/Ashkore
#https://www.reddit.com/user/Ashkoree/
def validate(string):
string = list(string)
newstring = ""
for x in string:
if x != " ":
newstring+=x
string = newstring
if len(string) == 8:
valid = ... | mit | 5,761,680,996,391,812,000 | 23.75 | 66 | 0.527793 | false | 3.838362 | false | false | false |
bplower/cssef | docs/ext/apidoc.py | 1 | 1222 | # https://github.com/openstack/deb-python-pycadf/blob/master/doc/ext/apidoc.py
import os.path as path
from sphinx import apidoc
run_already = False
def run_apidoc(app):
global run_already
if run_already:
return
run_already = True
# Build CssefServer
package_dir = path.abspath(path.join(... | gpl-3.0 | -2,433,233,921,663,370,000 | 39.766667 | 94 | 0.6473 | false | 3.133333 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.