repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mousetail/WOAIII-mousetail | enemy.py | 2 | 5122 | import random, math
import pygame
import basic_shape
import coin
class Enemy(basic_shape.Shape):
def explode(self, bullet):
coins = []
for i in range(self.numcoins):
angle = random.randint(0, 360)
coins.append(
coin.Coin(self.position, self.GUI.coin_img, ang... | mit | 261,686,933,896,914,530 | 30.423313 | 120 | 0.540609 | false | 3.477257 | false | false | false |
quantmind/pulsar | pulsar/apps/http/stream.py | 1 | 1645 | import asyncio
class StreamConsumedError(Exception):
"""Same name as request error"""
pass
class HttpStream:
"""An asynchronous streaming body for an HTTP response
"""
def __init__(self, response):
self._response = response
self._streamed = False
self._queue = asyncio.Que... | bsd-3-clause | -458,601,757,087,649,540 | 21.847222 | 59 | 0.538602 | false | 4.295039 | false | false | false |
jgraef/pyNXT | anxt/NXT.py | 1 | 10914 | # anxt/NXT.py
# pyNXT - Python wrappers for aNXT
# Copyright (C) 2011 Janosch Gräf <janosch.graef@gmx.net>
#
# This program 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 3 of the ... | lgpl-3.0 | -571,397,953,144,734,000 | 33.644444 | 143 | 0.536974 | false | 3.634033 | false | false | false |
x007007007/myblog | myblog/ajaxWtforms/views.py | 1 | 1657 | from __future__ import unicode_literals
from flask import Blueprint, request, url_for
from flask import render_template
from wtforms.fields import Field
import pprint
import json
ajax_wtforms_bp = Blueprint('ajax_wtforms', __name__, template_folder="templates", static_folder='static', static_url_path='/static/ajaxform... | mit | 4,205,927,895,975,046,700 | 31.490196 | 143 | 0.592637 | false | 4.041463 | false | false | false |
A92hm/multi-armed-bandit | demo.py | 1 | 1550 | """
Author: Ali Hajimirza (ali@alihm.net)
Copyright Ali Hajimirza, free for use under MIT license.
"""
import numpy as np
from algorithm.softmax import softmax
from algorithm.epsilon_greedy import epsilon_greedy
import matplotlib.pyplot as plt
def simulator(algorithm, arg, mean_arms, std=1, num_sim=2000, num_steps=10... | mit | -2,214,319,224,120,123,000 | 32.695652 | 184 | 0.704516 | false | 2.777778 | false | false | false |
mcolom/ipolDevel | ipol_demo/modules/demoinfo/model.py | 1 | 27990 | # -*- coding:utf-8 -*-
"""
DATA MODEL
This module will encapsulate all the DB operations
It has the creation scrript, DAOs to encapsulte sql and ,
a few helper clases that represent the objects modeld
in the DB that will be used by the webservices,
"""
import datetime
import sqlite3 as lite
#####################
... | agpl-3.0 | 3,443,441,717,809,015,000 | 28.808307 | 116 | 0.512862 | false | 4.162082 | false | false | false |
jnez71/aLQR | alqr/planner.py | 1 | 12747 | """
Class for planning with an augmented linear-quadratic regulator (aLQR)
on a given system and associated with a given cost field.
The system must be linearizable, time-invarient, and control affine:
xdot = f(x) + B(x)*u with jac(f)|x_i = A_i such that
xdot = A_i*x + B(x_i)*u is accurate near x_i.
After running... | mit | -7,410,992,972,254,290,000 | 34.705882 | 121 | 0.645642 | false | 2.7243 | false | false | false |
hackerspace-ntnu/coap-iot | src/server.py | 1 | 2922 | import logging
import time
import copy
from nordicnode import Nordicnode
from SECRET import SECRET_KEY
from SERVCONFIG import SERVER_HOST,SERVER_PORT
from flask_socketio import *
app = flask.Flask(__name__,static_folder="../static",static_url_path="/static",template_folder="../templates")
app.config['SECRET_KEY'] = ... | mit | -2,315,262,563,875,152,400 | 25.554545 | 110 | 0.645327 | false | 3.144241 | false | false | false |
TheStackBox/xuansdk | Automation/automationApp/module/deviceManager/virtualActivityControllerModule.py | 1 | 6034 | ##############################################################################################
# Copyright 2014-2015 Cloud Media Sdn. Bhd.
#
# This file is part of Xuan Automation Application.
#
# Xuan Automation Application is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 | 4,313,313,291,423,156,700 | 51.415929 | 129 | 0.645675 | false | 4.20781 | false | false | false |
kurainooni/nw.js | test/remoting/issue4184-no-opener/test.py | 2 | 1409 | import time
import os
import subprocess
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common import utils
chrome_options = Options()
chrome_optio... | mit | 6,784,161,942,924,301,000 | 30.311111 | 152 | 0.721079 | false | 3.354762 | false | false | false |
noironetworks/aci-integration-module | aim/api/tree.py | 1 | 2218 | # Copyright (c) 2017 Cisco Systems
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 | 6,164,328,256,708,781,000 | 26.04878 | 78 | 0.611812 | false | 3.630115 | false | false | false |
dol-sen/catalyst | arch/x86.py | 1 | 5365 |
import builder,os
from catalyst_support import *
class generic_x86(builder.generic):
"abstract base class for all x86 builders"
def __init__(self,myspec):
builder.generic.__init__(self,myspec)
if self.settings["buildarch"]=="amd64":
if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux... | gpl-2.0 | 1,686,649,570,494,139,000 | 34.065359 | 93 | 0.672134 | false | 2.421029 | false | false | false |
tomasdelvechio/py-net-dev | Protocolos/10 - cristian client/cristian_server.py | 1 | 1153 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket, re, select, os, json
from datetime import datetime
class TimeServer:
def __init__(self, host = '', port = 8081):
self.host = host
self.port = port
self.sock_server = socket.socket(socket.AF_INET, socket.SOCK_DGRA... | gpl-3.0 | -3,028,056,237,181,597,000 | 31.027778 | 78 | 0.503903 | false | 3.792763 | false | false | false |
unrza72/qplotutils | tests/qplotutils/test_player.py | 1 | 2168 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
==========================
Test for qplotutils.player
==========================
Autogenerated package stub.
"""
import unittest
import logging
import sys
import os
import numpy as np
from qtpy.QtCore import *
from qtpy.QtGui import *
from qtpy.QtOpenGL import *
fr... | mit | -5,500,140,090,238,841,000 | 20.058252 | 73 | 0.590406 | false | 3.479936 | true | false | false |
Mesitis/community | sample-code/Python/01 Admin/get_partner_admin_users.py | 1 | 1841 | '''
- login and get token
- process 2FA if 2FA is setup for this account
- Get list of child accounts for a parent user
'''
import requests
import json
get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/"
validate_otp_url = "https://api.canopy.cloud:443/api/v1/sessions/otp/validate.json" #calling the pr... | mit | 2,945,030,914,990,292 | 33.092593 | 137 | 0.730038 | false | 3.185121 | false | false | false |
dgzzhb/GAOthello | player.py | 1 | 1546 | #!/usr/bin/env python
""" player.py Humberto Henrique Campos Pinheiro
Human and Computer classes
"""
from evaluator import Evaluator
from config import WHITE, BLACK
from minimax import Minimax
import random
def change_color ( color ):
if color == BLACK:
return WHITE
else:
return BLACK
... | mit | 56,426,762,448,709,464 | 26.122807 | 95 | 0.593144 | false | 3.923858 | false | false | false |
scottgigante/nanomod | nanomod/scripts/list_bam_reads.py | 1 | 1278 | #!/usr/bin/python
# Usage: python list_bam_reads.py in1.bam [in2.bam ...] in.fasta
"""
A script for listing filenames of all reads in a bamfile
"""
import pysam
import sys
import os
import shutil
import multiprocessing
import functools
import itertools
from Bio import SeqIO
def loadRef(fasta):
"""
Create a ... | gpl-3.0 | -7,381,394,498,573,507,000 | 26.191489 | 142 | 0.690923 | false | 3.417112 | false | false | false |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/logging_options/config/__init__.py | 1 | 12773 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 | -6,327,587,046,209,675,000 | 38.915625 | 387 | 0.596571 | false | 4.267624 | true | false | false |
mas-dse-greina/neon | luna16/old_code/LUNA16_inferenceTesting_ResNet.py | 1 | 4360 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2017 Nervana Systems 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
#... | apache-2.0 | 1,161,641,553,766,834,000 | 32.282443 | 94 | 0.677752 | false | 3.463066 | true | false | false |
Cadasta/cadasta-platform | cadasta/questionnaires/validators.py | 1 | 10066 | import re
from functools import partial
from django.conf import settings
from django.utils.translation import ugettext as _
from core.messages import SANITIZE_ERROR
from core.validators import sanitize_string
from .choices import QUESTION_TYPES, XFORM_GEOM_FIELDS
from .exceptions import InvalidQuestionnaire
def valid... | agpl-3.0 | -1,318,371,151,160,856,600 | 31.366559 | 79 | 0.598848 | false | 4.12541 | false | false | false |
ktan2020/legacy-automation | win/Lib/ctypes/test/test_callbacks.py | 1 | 8245 | import unittest
from ctypes import *
import _ctypes_test
class Callbacks(unittest.TestCase):
functype = CFUNCTYPE
## def tearDown(self):
## import gc
## gc.collect()
def callback(self, *args):
self.got_args = args
return args[-1]
def check_type(self, typ, ... | mit | 1,000,723,505,215,285,800 | 31.245968 | 79 | 0.552213 | false | 3.614643 | true | false | false |
qurioust/StudyInterpreter | calc1.py | 1 | 4666 | # Token types
#
# EOF (end-of-file) token is used to indicate that
# there is no more input left for lexical analysis
INTEGER, OPERATOR, PLUS, MINUS, EOF = 'INTEGER', 'OPERATOR',\
'PLUS', 'MINUS', 'EOF'
class Token(object):
def __init__(self, type, value):
# token type: INTEGER, PLUS, or EOF
s... | mit | -5,042,599,363,946,606,000 | 29.900662 | 69 | 0.564081 | false | 4.300461 | false | false | false |
TsinghuaX/edx-platform | common/lib/xmodule/xmodule/conditional_module.py | 1 | 9276 | """Conditional module is the xmodule, which you can use for disabling
some xmodules by conditions.
"""
import json
import logging
from lazy import lazy
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.modulestore import Location
from xmodule.seq_module... | agpl-3.0 | 3,437,756,615,915,732,000 | 36.707317 | 116 | 0.577727 | false | 4.567208 | false | false | false |
fisele/slimta-abusix | slimta/system.py | 1 | 4772 | # Copyright (c) 2012 Ian C. Good
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | mit | 1,100,777,063,778,634,200 | 29.589744 | 79 | 0.649413 | false | 3.986633 | false | false | false |
soccermetrics/soccermetrics-client-py | soccermetrics/rest/resources/base.py | 1 | 12074 | from easydict import EasyDict
import requests
from soccermetrics import SoccermetricsRestException
from soccermetrics import __api_version__ as API_VERSION
class Resource(object):
"""
Represents interactions with a REST API resource.
Sets the high-level (versioning) endpoint for the API resource.
:p... | mit | 7,992,929,171,068,071,000 | 32.173077 | 94 | 0.527663 | false | 4.638494 | false | false | false |
emory-libraries/pidman | pidman/pid/management/commands/datamigrate.py | 1 | 9396 | import sys
from distutils.util import strtobool
from django.db import transaction
from django.db.utils import IntegrityError
from django.core import serializers
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.... | apache-2.0 | 7,029,692,759,876,979,000 | 41.709091 | 99 | 0.621115 | false | 4.161205 | false | false | false |
ericchill/gnofract4d | fract4dgui/gtkgradient.py | 1 | 17671 | import gtk
import dialog
import utils
import random
from fract4d import gradient
def show_gradients(parent,f):
GradientDialog.show(parent,f)
class GradientDialog(dialog.T):
def __init__(self,main_window,f):
global userPrefs
dialog.T.__init__(
self,
_("Gradients"),
... | bsd-3-clause | 2,925,749,149,845,129,700 | 38.979638 | 133 | 0.541169 | false | 3.571342 | false | false | false |
plumgrid/plumgrid-nova | nova/servicegroup/drivers/db.py | 1 | 4198 | # Copyright 2012 IBM Corp.
#
# 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, sof... | apache-2.0 | 5,128,132,706,661,929,000 | 39.757282 | 79 | 0.629586 | false | 4.168818 | false | false | false |
EBI-Metagenomics/emgapi | emgapi/migrations/0007_split_run.py | 1 | 7178 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-24 08:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def populate_status(apps, schema_editor):
Status = apps.get_model("emgapi", "Status")
st = (
(1, "draft"),
... | apache-2.0 | -8,815,306,035,724,135,000 | 36.19171 | 185 | 0.549178 | false | 4.05079 | false | false | false |
brynpickering/calliope | calliope/core/preprocess/lookup.py | 1 | 10678 | """
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
lookup.py
~~~~~~~~~~~~~~~~~~
Functionality to create DataArrays for looking up string values between loc_techs
and loc_tech_carriers, to avoid string operations during backend operations.
""... | apache-2.0 | 4,899,294,421,289,023,000 | 37.970803 | 97 | 0.620435 | false | 3.507884 | true | false | false |
OzBonus/LPTHW | ex35.py | 1 | 6052 | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""
Learn Python the Hard Way - Exercise 35
Branches and Functions
This is pretty similar to what's in the book, but I added another room and toyed
around for a bit with exception handling. The new death function is pretty
cool, too.
"""
from sys import exit
def start():
"... | unlicense | -1,063,138,685,989,453,300 | 29.877551 | 80 | 0.409617 | false | 3.808685 | false | false | false |
ElricleNecro/LibThese | scripts/animation.py | 1 | 8169 | #! /usr/bin/env python3
# -*- coding:Utf8 -*-
import matplotlib as ml
ml.use('agg')
import os
import argparse as ap
import logging as log
import numpy as np
from LibThese import Carte as c
from LibThese.Plot import Animate as an
from LibThese.Plot import hdf5 as h
class FromHDF5(... | lgpl-3.0 | -3,620,484,079,222,266,000 | 19.733503 | 115 | 0.604603 | false | 2.611573 | false | false | false |
PnX-SI/GeoNature | contrib/occtax/backend/utils.py | 1 | 2412 | from flask import current_app
from urllib.parse import urljoin
# nomenclatures fields
counting_nomenclatures = [
"id_nomenclature_life_stage",
"id_nomenclature_sex",
"id_nomenclature_obj_count",
"id_nomenclature_type_count",
"id_nomenclature_valid_status",
]
occ_nomenclatures = [
"id_nomenclat... | gpl-3.0 | 5,279,955,531,874,626,000 | 29.923077 | 100 | 0.636401 | false | 3.295082 | false | false | false |
malkavi/lutris | lutris/runners/browser.py | 1 | 1049 | # -*- coding: utf-8 -*-
from lutris.runners.runner import Runner
class browser(Runner):
"""Runner for browser games"""
human_name = "Browser"
executable = "xdg-open"
platform = "Web based games"
description = "Run games in the browser"
game_options = [
{
"option": "main_fil... | gpl-3.0 | -5,106,044,268,784,394,000 | 28.971429 | 79 | 0.531935 | false | 3.943609 | false | false | false |
michaelMinar/limbo | limbo/plugins/phab_diffs.py | 1 | 4035 | """Attach meta data to phab diffs posted in Slack
Wants these environment variables:
PHAB_HOST -- the hostname where your phabricator lives
PHAB_API_TOKEN -- a valid api token for some phabricator bot account
PHAB_FILE_HOST -- hostname for instance of https://github.com/emarschner/phabricator-file-proxy
... | mit | -4,127,171,925,487,468,000 | 32.07377 | 115 | 0.64114 | false | 3.365304 | false | false | false |
xalt/xalt | old/python/xalt_run_submission.py | 1 | 13177 | # -*- python -*-
#
# Git Version: @git@
#-----------------------------------------------------------------------
# XALT: A tool that tracks users jobs and environments on a cluster.
# Copyright (C) 2013-2014 University of Texas at Austin
# Copyright (C) 2013-2014 University of Tennessee
#
# This library is free softw... | lgpl-2.1 | -8,811,500,944,917,399,000 | 28.947727 | 129 | 0.580405 | false | 3.480454 | false | false | false |
Rambatino/CHAID | tests/setup_tests.py | 1 | 1483 | """
This module provides helper functions for the rest of the testing module
"""
from collections import Iterable
import os
import sys
from math import isnan
import numpy as np
ROOT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
sys.path = [ROOT_FOLDER] + sys.path
np.seter... | apache-2.0 | 186,268,665,436,612,480 | 31.955556 | 110 | 0.650708 | false | 2.954183 | false | false | false |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_document_merge_info.py | 1 | 5168 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit | 906,366,393,798,433,700 | 32.341935 | 109 | 0.588816 | false | 4.428449 | true | false | false |
ActiveState/code | recipes/Python/577556_gopytranslte_script_google/recipe-577556.py | 1 | 3023 | #!/usr/bin/python3
# Python gopytranslte
# Author : namakukingkong
# Site : namakukingkong[dot]kandangbuaya[dot]com
# Email : namakukingkong[at]gmail[dot]com
# dependency : linux,windows, python3, internet
# gopytranslte
# .....|___gopytranslte.py
# .....|___log-translate.txt
# $mkdir gopytranslte
# $cd gop... | mit | -834,119,816,352,338,400 | 32.588889 | 108 | 0.533576 | false | 3.19556 | false | false | false |
normanjaeckel/THHome | THHome/migrations/0002_about.py | 1 | 1221 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-06-08 20:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('THHome', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | mit | 7,667,831,212,975,023,000 | 39.633333 | 217 | 0.588187 | false | 3.693939 | false | false | false |
k0pernicus/PyFTP | src/prompt.py | 1 | 1104 | class prompt(object):
"""
Classe permettant d'afficher un prompt.
Ce prompt permettra à l'utilisateur de savoir sur quel serveur et quel dossier\
il se trouve
"""
def __init__(self, login, serveur, chemin = "~"):
"""
Constructeur du prompt
login : login de l'utilisateur... | gpl-2.0 | 2,537,156,798,828,644,000 | 27.894737 | 89 | 0.57377 | false | 3.378462 | false | false | false |
danielreed/python-hpOneView | hpOneView/resources/settings/firmware_bundles.py | 1 | 2953 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 limi... | mit | 4,896,147,919,376,708,000 | 38.373333 | 114 | 0.712157 | false | 4.224607 | false | false | false |
serverboards/serverboards | plugins/core-extractors/serverboards-extractors.py | 1 | 6214 | #!/usr/bin/python3
import serverboards_aio as serverboards
import curio
import asks
import re
from serverboards import print
asks.init('curio')
@serverboards.rpc_method
def serverboards_extractor(config, table, quals, columns):
if table == "service":
return service_extractor(quals, columns)
if table ... | apache-2.0 | 7,902,818,338,142,781,000 | 22.9 | 83 | 0.515288 | false | 3.795968 | true | false | false |
Hutspace/odekro | mzalendo/hansard/models/alias.py | 1 | 3478 | import re
import datetime
from django.db import models
from hansard.models.base import HansardModelBase
from core.models import Person
class AliasQuerySet(models.query.QuerySet):
def unassigned(self):
"""
Limit to aliases that have not been assigned.
"""
return self.filter(person_... | agpl-3.0 | -4,108,658,098,933,847,000 | 31.212963 | 93 | 0.548016 | false | 4.058343 | false | false | false |
nicoddemus/pytest | scripts/update-plugin-list.py | 1 | 2960 | import datetime
import pathlib
import re
import packaging.version
import requests
import tabulate
FILE_HEAD = r"""Plugins List
============
PyPI projects that match "pytest-\*" are considered plugins and are listed
automatically. Packages classified as inactive are excluded.
"""
DEVELOPMENT_STATUS_CLASSIFIERS = (
... | mit | -602,373,420,787,450,500 | 33.418605 | 102 | 0.567568 | false | 4.105409 | false | false | false |
landryb/psutil | psutil/_psbsd.py | 1 | 12394 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""FreeBSD platform implementation."""
import errno
import functools
import os
import sys
from collections import namedtuple
from ... | bsd-3-clause | -6,845,531,133,759,220,000 | 30.861183 | 79 | 0.614087 | false | 3.560471 | false | false | false |
ddico/odoo | addons/website_project/controllers/rating.py | 1 | 4824 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.exceptions import NotFound
from odoo import http
from odoo.http import request
class RatingProject(http.Controller):
@http.route(['/project/rating'], type='http', auth="public", website=True, sitema... | agpl-3.0 | 2,790,613,335,742,636,000 | 48.22449 | 148 | 0.569237 | false | 4.060606 | false | false | false |
uclouvain/osis | base/tests/business/test_learning_unit_deletion.py | 1 | 23601 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 | 9,197,838,440,479,958,000 | 55.312649 | 120 | 0.653232 | false | 4.051339 | true | false | false |
esander91/NamespacePollution | Code/PythonCode/sqlalchemy_schema.py | 1 | 1723 | from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy import Index
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
# sets up Base as a basic table class for SQLalchemy
Base = declarative_base()
# This is the schema for the R package database
class... | gpl-2.0 | -7,141,175,519,199,869,000 | 32.784314 | 73 | 0.689495 | false | 4.035129 | false | false | false |
anigaj/widget-manager | usr/share/widgetManager/qml/widgets.py | 1 | 16602 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jolla Ltd.
# Contact: Jussi Pakkanen <jussi.pakkanen@jolla.com>
# All rights reserved.
#
# You may use this file under the terms of BSD license as follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, ar... | gpl-2.0 | 578,980,566,807,963,400 | 67.603306 | 440 | 0.463679 | false | 5.183266 | false | false | false |
feruxmax/ml_sophie | feature_extraction.py | 1 | 4887 | import pandas as pd
import numpy as np
import datetime as dt
def to_platform_indep(data, platform):
if platform=='android':
data.drop(['ios_ifa', 'ios_ifv', 'google_aid'], axis=1, inplace=True)
# rename cols
names = data.columns.tolist()
names[names.index('android_id')] = 'id'
... | mit | -7,683,527,654,138,860,000 | 34.165468 | 95 | 0.622263 | false | 3.331288 | false | false | false |
chengsoonong/crowdastro-projects | ATLAS-CDFS/scripts/plot_examples.py | 1 | 6330 | """Plots examples of where classifiers are wrong.
Matthew Alger <matthew.alger@anu.edu.au>
Research School of Astronomy and Astrophysics
The Australian National University
2017
"""
import logging
import astropy.io.ascii
import astropy.io.fits
import astropy.visualization
import astropy.visualization.wcsaxes
import a... | mit | 8,300,272,526,829,215,000 | 41.2 | 174 | 0.634597 | false | 3.392283 | false | false | false |
saviaga/crowdsource-platform | crowdsourcing/viewsets/project.py | 1 | 7856 | __author__ = 'elsabakiu, neilthemathguy, dmorina'
from rest_framework import status, viewsets
from rest_framework.response import Response
from crowdsourcing.serializers.project import *
from rest_framework.decorators import detail_route, list_route
from crowdsourcing.models import Module, Category, Project, Requeste... | mit | -4,402,278,944,080,445,400 | 42.40884 | 131 | 0.693228 | false | 4.362021 | false | false | false |
LEX2016WoKaGru/pyClamster | scripts/calibration/fe4/FE4_straight_calib.py | 1 | 2283 | #!/usr/bin/env python3
import pyclamster
import numpy as np
import logging
import pickle
logging.basicConfig(level=logging.DEBUG)
imgshape = (1920,1920)
###################################################
### Read times and sun positions from filenames ###
###################################################
sun_rea... | gpl-3.0 | 8,420,132,079,694,189,000 | 30.708333 | 79 | 0.686816 | false | 3.337719 | false | false | false |
ToxicFrog/bup | lib/bup/bloom.py | 1 | 11000 | """Discussion of bloom constants for bup:
There are four basic things to consider when building a bloom filter:
The size, in bits, of the filter
The capacity, in entries, of the filter
The probability of a false positive that is tolerable
The number of bits readily available to use for addressing filter bits
There is... | lgpl-2.1 | -1,738,329,360,173,287,200 | 42.307087 | 79 | 0.647909 | false | 2.863092 | false | false | false |
gaberger/pybvc | samples/samplenetconf/cmds/show_nodeinfo.py | 1 | 2712 | #!/usr/bin/python
"""
Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,... | bsd-3-clause | 958,508,910,003,634,300 | 31.285714 | 76 | 0.713127 | false | 3.970717 | false | false | false |
QISKit/qiskit-sdk-py | qiskit/pulse/timeslots.py | 1 | 13794 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | apache-2.0 | -4,743,011,261,028,549,000 | 31.533019 | 89 | 0.589967 | false | 4.480026 | false | false | false |
nikhilgk/SimpleCV | SimpleCV/examples/display/animatedgifstation/animation_station.py | 1 | 1200 | #!/usr/bin/python
from time import sleep
from pyfirmata import Arduino, util
from images2gif import writeGif
from SimpleCV import *
pyrinter_url = "http://localhost:8080/printtext/"
flickr_user = "foo"
flickr_tags = "ingenuitas"
animation_file = "./animation.gif"
c = Camera()
board = Arduino("/dev/ttyUSB0")
it = u... | bsd-3-clause | -1,597,685,478,510,621,200 | 22.076923 | 49 | 0.6625 | false | 2.836879 | false | false | false |
xzenzza/Python_Code | Test_code_SMS_V1.py | 1 | 11306 | #!/usr/bin/env python
from __future__ import division
from subprocess import PIPE, Popen
import psutil,time
import RPi.GPIO as GPIO
import smbus
import time,spidev
import urllib2
import simplejson as json # pip install simplejson
import ast
import sqlite3
import decimal
import os
import glob
import psut... | gpl-3.0 | -5,342,163,957,370,462,000 | 33.442006 | 122 | 0.505307 | false | 3.29237 | false | false | false |
gdesmott/politube | plenary/dieren.py | 1 | 2129 | import urllib2
import json
from plenary.models import Deputy, Party
LIMIT = 200
def party_json_to_model(j):
v= {}
v['dieren_id'] = j['id']
v['name'] = j['name']
return v
def sync_parties():
url = "http://www.dierentheater.be/api/v1/party/?format=json&limit=%d" % (LIMIT)
data = urllib2.urlop... | agpl-3.0 | 7,766,233,959,621,692,000 | 27.013158 | 85 | 0.525599 | false | 3.032764 | false | false | false |
trivedigaurav/pharma-c | server.py | 1 | 2331 | from flask import Flask, render_template, request, redirect, url_for
from database import *
import flask_login, json, re
from bson.objectid import ObjectId
from jinja2 import evalcontextfilter, Markup, escape
from api import *
from questions import *
import random, time
app = Flask(__name__)
app.secret_key = '80e48d13... | mit | -5,845,801,163,826,443,000 | 23.291667 | 121 | 0.589447 | false | 3.171429 | false | false | false |
hiker/stan | AOR/Declaration.py | 1 | 37631 | #!/usr/bin/env python
import string
from types import TupleType
from AOR.DoubleList import DoubleList
from AOR.BasicStatement import BasicStatement, BasicRepr
from AOR.Statements import Assignment
# ==============================================================================
# Well, thi... | gpl-3.0 | -4,707,259,919,243,086,000 | 46.815756 | 84 | 0.431586 | false | 4.508326 | false | false | false |
GPNMilano/PyPRPImporter | PyPRPImport/alcm5crypt.py | 1 | 5607 | #
# $Id: alcm5crypt.py 539 2006-07-19 17:17:06Z Robert The Rebuilder $
#
# Copyright (C) 2005-2008 Alcugs PyPRP Project Team and 2008 GoW PyPRP Project Team
# See the file AUTHORS for more info about the team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of t... | gpl-2.0 | -7,749,541,111,514,407,000 | 26.218447 | 134 | 0.566256 | false | 3.053922 | false | false | false |
trygveaa/python-tunigo | tunigo/playlist.py | 1 | 3914 | from __future__ import unicode_literals
import tunigo
from tunigo import utils
class Playlist(object):
def __init__(
self,
created=0,
description='',
id='',
image='',
location='',
main_genre=None,
main_genre_template... | apache-2.0 | -325,434,058,248,106,240 | 25.808219 | 78 | 0.509964 | false | 4.373184 | false | false | false |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/lib/tool_shed/repository_types/repository_suite_definition.py | 1 | 1745 | import logging
from tool_shed.repository_types.metadata import TipOnly
import tool_shed.repository_types.util as rt_util
from tool_shed.util import basic_util
from galaxy import eggs
eggs.require( 'mercurial' )
from mercurial import hg
from mercurial import ui
log = logging.getLogger( __name__ )
class RepositorySuit... | gpl-3.0 | -2,292,779,964,664,107,800 | 41.560976 | 104 | 0.659026 | false | 4.184652 | false | false | false |
mkorman9/framepy | framepy/client.py | 1 | 6015 | import random
import requests
from framepy import modules
import cherrypy
HTTP_SERVER_ERRORS_BORDER = 500
PROTOCOL = 'http://'
class Module(modules.Module):
def before_setup(self, properties, arguments, beans):
beans['http_template'] = HttpTemplate()
def after_setup(self, properties, arguments, cont... | mit | -8,442,624,980,916,435,000 | 48.303279 | 115 | 0.675644 | false | 4.553369 | false | false | false |
awd4/spnss | spnss/nbc.py | 1 | 11216 | ''' Naive Bayes Clustering '''
import numpy as np
import random
from spnss.mathutil import argmax_fair, argmin_fair, logsumexp, log
import knobs
from fast import nbmix_likelihood_from_model as fast_nbmix_likelihood_from_model
from history import best_index
def nbmix_model(data, nvals, qa, smooth=0.1):
data = d... | mit | 6,382,970,886,419,357,000 | 29.644809 | 143 | 0.529957 | false | 3.123364 | false | false | false |
jsj2008/kdegames | kajongg/src/predefined.py | 1 | 21844 | # -*- coding: utf-8 -*-
"""Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg is free software you can redistribute it and/or modifys
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... | gpl-2.0 | 2,737,684,372,865,246,700 | 64.011905 | 120 | 0.674831 | false | 3.399844 | false | false | false |
desihub/desitarget | py/desitarget/randoms.py | 1 | 65732 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
desitarget.randoms
==================
Monte Carlo Legacy Surveys imaging at the pixel level to model the imaging footprint
"""
import os
import numpy as np
import astropy.io.fits as fits
from astropy.wcs import WCS
from time im... | bsd-3-clause | -4,469,367,194,779,342,000 | 42.358839 | 104 | 0.604622 | false | 3.510575 | false | false | false |
benhoyt/scandir | test/test_scandir.py | 1 | 12030 | """Tests for scandir.scandir()."""
from __future__ import unicode_literals
import os
import shutil
import sys
import time
import unittest
try:
import scandir
has_scandir = True
except ImportError:
has_scandir = False
FILE_ATTRIBUTE_DIRECTORY = 16
TEST_PATH = os.path.abspath(os.path.join(os.path.dirname... | bsd-3-clause | 3,193,638,761,835,304,000 | 37.312102 | 95 | 0.596841 | false | 3.704958 | true | false | false |
WilsonWangTHU/neural_graph_evolution | environments/multitask_env/walkers.py | 1 | 15916 | #!/usr/bin/env python2
# -----------------------------------------------------------------------------
# @brief:
# Several Walkers
# @author:
# Tingwu (Wilson) Wang, Nov. 22nd, 2017
# -----------------------------------------------------------------------------
import numpy as np
from gym import utils
... | mit | -8,605,378,863,806,239,000 | 30.832 | 96 | 0.593868 | false | 3.123847 | false | false | false |
Heufneutje/PyMoronBot | CommandInterface.py | 1 | 1050 | # -*- coding: utf-8 -*-
from moronbot import MoronBot
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
class CommandInterface(object):
triggers = []
acceptedTypes = ['PRIVMSG']
help = '<no help defined (yet)>'
runInThread = False
priority = 0
def __init... | mit | -5,194,758,183,876,619,000 | 22.333333 | 94 | 0.574286 | false | 4.216867 | false | false | false |
persandstrom/home-assistant | homeassistant/components/homekit/type_locks.py | 2 | 2779 | """Class to hold all lock accessories."""
import logging
from pyhap.const import CATEGORY_DOOR_LOCK
from homeassistant.components.lock import (
ATTR_ENTITY_ID, DOMAIN, STATE_LOCKED, STATE_UNLOCKED, STATE_UNKNOWN)
from homeassistant.const import ATTR_CODE
from . import TYPES
from .accessories import HomeAccessory... | apache-2.0 | 461,050,968,249,763,300 | 37.597222 | 77 | 0.630083 | false | 3.576577 | false | false | false |
svalenti/agnkey | trunk/src/agnkey/agnabsphotdef.py | 1 | 52649 | def deg2HMS(ra='', dec='', round=False):
import string
RA, DEC= '', ''
if dec:
if string.count(str(dec),':')==2:
dec00=string.split(dec,':')
dec0,dec1,dec2=float(dec00[0]),float(dec00[1]),float(dec00[2])
if '-' in str(dec0): DEC=(-1)*((dec2/60.... | mit | -690,957,344,061,526,800 | 49.333652 | 202 | 0.531653 | false | 2.87668 | false | false | false |
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_policy_set_definitions_operations.py | 1 | 32791 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit | -4,460,960,425,632,557,600 | 48.161919 | 228 | 0.64722 | false | 4.294264 | true | false | false |
campadrenalin/EJTP-lib-python | ejtp/router.py | 1 | 4185 | '''
This file is part of the Python EJTP library.
The Python EJTP library is free software: you can redistribute it
and/or modify it under the terms of the GNU Lesser Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
the Python EJTP ... | lgpl-3.0 | 6,737,040,065,496,525,000 | 30 | 89 | 0.601912 | false | 3.978137 | false | false | false |
velezj425/what-to-make-site | what2make/search/models.py | 1 | 1307 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
# ingredient type model
class Ing_Type(models.Model):
name = models.CharField(max_length=10)
def __str__(self):
return self.name
# ingredient model
class Ingredient(models.Model):
name... | mit | -1,735,113,689,992,681,700 | 29.395349 | 69 | 0.709258 | false | 3.744986 | false | false | false |
thricehex/thricemangle | thricemangle.py | 1 | 8106 | #!/usr/bin/env python3
__author__ = 'thricehex'
__version__ = '7.3.15'
# Script for generating password wordlists by mangling keywords, numbers,
# or existing wordlists into common password structures.
# Author: Garrett Smith(ThriceHex)
# Version: 7.3.15
import argparse
import os
import subprocess
descript = 'Gene... | gpl-2.0 | -2,885,668,252,407,171,000 | 38.735294 | 164 | 0.627807 | false | 3.686221 | false | false | false |
huku-/pyxed | tests/test_decode.py | 1 | 2160 | import pytest
import pyxed
def test_decode_invalid_instruction(xed32):
xed32.itext = b"\xff"
with pytest.raises(pyxed.InvalidInstructionError):
xed32.decode()
def test_decode_invalid_offset(xed32):
xed32.itext = b"\xc3"
xed32.itext_offset = 2
with pytest.raises(pyxed.InvalidOffsetError... | bsd-2-clause | 7,286,809,739,988,972,000 | 27.051948 | 78 | 0.646296 | false | 2.706767 | true | false | false |
hewittc/goldfish | proc/stat.py | 1 | 3773 | #
# Copyright (C) 2015 Christopher Hewitt
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publ... | mit | -2,366,602,971,270,785,000 | 37.896907 | 82 | 0.578055 | false | 3.731949 | false | false | false |
pdl30/rnaseq_misc | stop_codon_analysis.py | 1 | 1827 | #!/usr/bin/python
########################################################################
# 9 Jan 2015
# Patrick Lombard, Centre for Stem Stem Research
# Core Bioinformatics Group
# University of Cambridge
# All right reserved.
########################################################################
import argparse
... | gpl-2.0 | 3,056,716,882,466,971,000 | 25.492754 | 123 | 0.569239 | false | 2.613734 | false | false | false |
FPAL-Stanford-University/FloATPy | floatpy/utilities/data_reshaper.py | 1 | 4970 | import numpy
class DataReshaper(object):
def __init__(self, dimension, data_order='F'):
if dimension < 1 or dimension > 3:
raise ValueError("Number of dimensions should be between 1 and 3!")
self._dim = dimension
if data_order != 'C' and \
... | lgpl-3.0 | -4,283,810,559,916,288,000 | 37.230769 | 116 | 0.503421 | false | 4.505893 | false | false | false |
HazyResearch/snorkel | snorkel/vis/tree_structs.py | 1 | 4294 | import json
import os
import re
import lxml.etree as et
from snorkel.utils import corenlp_cleaner
directory = os.path.abspath(os.path.dirname(__file__))
# Load IPython display functionality libs if possible i.e. if in IPython
try:
from IPython.core.display import display_html, HTML, display_javascript, Javascript
e... | apache-2.0 | -6,988,357,913,014,187,000 | 32.811024 | 108 | 0.656497 | false | 3.333851 | false | false | false |
Nefry/taurus | tests/mocks.py | 1 | 5148 | """ test """
import logging
import os
import tempfile
import sys
import random
from bzt.engine import Engine, Configuration, FileLister
from bzt.utils import load_class
from bzt.engine import Provisioning, ScenarioExecutor, Reporter, AggregatorListener
from bzt.modules.aggregator import ResultsReader
from tests import... | apache-2.0 | 3,385,400,502,487,022,600 | 25.536082 | 104 | 0.566822 | false | 4.034483 | false | false | false |
pklaus/python-inwx-xmlrpc | example.dyndns.py | 1 | 2738 | #!/usr/bin/env python2.7
# -*- encoding: UTF8 -*-
# author: Philipp Klaus, philipp.klaus →AT→ gmail.com
# author: Markus Roth, mail →AT→ rothmark.us
# This file is part of python-inwx-xmlrpc.
#
# python-inwx-xmlrpc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | gpl-3.0 | 1,844,439,016,193,785,900 | 39.147059 | 120 | 0.660073 | false | 3.573298 | false | false | false |
rosenvladimirov/addons | account_asset_management_bg_v3/models/account_asset.py | 1 | 51255 | # -*- coding: utf-8 -*-
# Copyright 2009-2017 Noviat
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import calendar
from datetime import datetime
from dateutil.relativedelta import relativedelta
import logging
from sys import exc_info
from traceback import format_exception
from openerp import api, fi... | agpl-3.0 | -6,084,505,130,521,618,000 | 42.107653 | 122 | 0.529802 | false | 4.190239 | false | false | false |
TNick/pyl2extra | pyl2extra/scripts/show_weights.py | 1 | 2406 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The application allows you to show the weights of a class
that inherits from pylearn2's Model.
To start, goto File > Open pickled model... and select the
file that has your saved mode. Loading might take a while
and the window will look frozen while loading.
Once the ... | bsd-3-clause | 2,361,575,124,443,841,500 | 24.595745 | 70 | 0.702826 | false | 3.650986 | false | false | false |
Compositional/orders-aws | test/container.py | 1 | 4871 | import argparse
import sys
import unittest
import os
from util.Api import Api
from time import sleep
from util.Docker import Docker
from util.Dredd import Dredd
class ServiceMock:
container_name = ''
hostname = ''
def start_container(self):
command = ['docker', 'run', '-d',
'--... | apache-2.0 | 7,471,264,352,763,497,000 | 37.65873 | 136 | 0.564976 | false | 3.931396 | true | false | false |
mgax/airship | airship/core.py | 1 | 8257 | import os
import sys
import logging
import json
import random
import string
from pipes import quote as shellquote
from path import path
import yaml
from kv import KV
import pkg_resources
import blinker
from .daemons import Supervisor
from . import deployer
log = logging.getLogger(__name__)
CFG_LINKS_FOLDER = 'active'... | bsd-2-clause | -984,668,476,783,880,200 | 28.808664 | 79 | 0.619595 | false | 3.428987 | true | false | false |
K4zuki/mbed | workspace_tools/upload_results.py | 1 | 6420 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 | 7,804,318,430,020,577,000 | 35.067416 | 143 | 0.627726 | false | 3.687536 | true | false | false |
nrc/rustc-perf | collector/benchmarks/cranelift-codegen/cranelift-codegen/meta-python/base/instructions.py | 2 | 62503 | """
Cranelift base instruction set.
This module defines the basic Cranelift instruction set that all targets
support.
"""
from __future__ import absolute_import
from cdsl.operands import Operand, VARIABLE_ARGS
from cdsl.typevar import TypeVar
from cdsl.instructions import Instruction, InstructionGroup
from base.types ... | mit | -7,390,072,463,605,613,000 | 29.578767 | 79 | 0.58242 | false | 3.71158 | false | false | false |
th0mmeke/thesis | model/runner-for-results-819350e-stable-environment.py | 1 | 3223 | import os
import random
import itertools
import model
#experiments = [[1, 1, 1, 1, 1, 1]]
def dist_a(source, correlation):
return max(0.0,min(1.0, random.gauss(source, 1.0-correlation)))
def dist_b(source, correlation):
x = random.gauss(source, 1.0-correlation)
while x < 0.0 or x > 1.0:
x = ... | gpl-2.0 | 314,472,225,541,171,700 | 36.045977 | 186 | 0.575861 | false | 3.465591 | false | false | false |
hailinzeng/zhuaxia | zhuaxia/i18n/msg_cn.py | 2 | 7738 | # -*- coding:utf-8 -*-
head_xm = u'[虾]'
head_163 = u'[易]'
#summary
fmt_summary_skip_title = u'增量下载忽略列表:'
fmt_summary_skip_header = u'来源\t 最后下载时间 \t歌曲名\t保存路径'
fmt_summary_success_title = u'成功下载列表:'
fmt_summary_success_header = u'歌曲名\t保存路... | mit | -3,345,620,565,306,967,000 | 36.708609 | 95 | 0.47471 | false | 1.760668 | false | true | false |
CiscoDevNet/coding-skills-sample-code | coding102-REST-python-dcloud/manage-users.py | 1 | 5294 | # Example of calling REST API from Python to manage APIC-EM users/roles using APIC-EM APIs.
# * THIS SAMPLE APPLICATION AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
# * OF ANY KIND BY CISCO, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
# * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PA... | apache-2.0 | 6,717,940,767,170,355,000 | 37.369565 | 110 | 0.740839 | false | 3.46466 | false | false | false |
yardstick17/menu_parser | build/lib/menu_parser/read_image.py | 1 | 4962 | import operator
import re
import cv2
from PIL import Image
import pytesser
import reading_white_text
import smooth_image
INVERT_COLOR_THRESHOLD = 128
def make_string_alphanmeric(lines):
s = re.sub('[^0-9a-zA-Z\n]+', ' ', lines)
return s
def greyscale_image_mean(file_name):
size = 128, 128
im = Im... | mit | -4,252,909,431,922,263,000 | 25.253968 | 115 | 0.563886 | false | 3.095446 | false | false | false |
eallik/spinoff | spinoff/util/http.py | 1 | 2866 | import base64
from zope.interface import implements
from twisted.internet import reactor, defer, protocol
from twisted.internet.defer import inlineCallbacks, returnValue, succeed
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
from twisted.web.iweb import IBodyProducer
class receiv... | bsd-2-clause | 6,940,835,037,128,578,000 | 26.557692 | 75 | 0.679693 | false | 4.202346 | false | false | false |
Schevo/schevo | schevo/store/tests/test_store_persistent.py | 1 | 1979 | """
$URL: svn+ssh://svn/repos/trunk/durus/test/utest_persistent.py $
$Id: utest_persistent.py 27079 2005-07-25 20:54:05Z dbinger $
"""
from cPickle import dumps, loads
from schevo.store.connection import Connection
from schevo.store.file_storage import TempFileStorage
from schevo.store.persistent import Persiste... | mit | 5,094,368,412,979,079,000 | 27.984848 | 66 | 0.550783 | false | 3.559353 | true | false | false |
hsoft/moneyguru | core/model/oven.py | 1 | 3911 | # Copyright 2019 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from datetime import date
from ._ccore import oven_cook_txns
class Oven:
... | gpl-3.0 | 3,079,686,459,639,464,400 | 45.559524 | 100 | 0.625927 | false | 4.274317 | false | false | false |
secnot/uva-onlinejudge-solutions | 10037 - Bridge/main.py | 1 | 2153 | import sys
from heapq import heappush, heappop, heapify
BEFORE = True
AFTER = False
def load_num():
line = sys.stdin.readline()
if line == ' ' or line == '\n':
return None
return int(line)
def load_case():
npeople = load_num()
people = []
for p in range(npeople):
people.app... | mit | -6,432,722,989,349,239,000 | 20.316832 | 56 | 0.464004 | false | 3.893309 | false | false | false |
jimstorch/netboa | netboa/websocket/ws_service.py | 1 | 3660 | #------------------------------------------------------------------------------
# netboa/websocket/ws_service.py
# Copyright 2012 Jim Storch
# 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 Licen... | apache-2.0 | -7,630,492,887,478,344,000 | 38.782609 | 80 | 0.656831 | false | 4.026403 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.