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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s-store/sstore-soft | tools/runinputclient.py | 1 | 11523 | import sys, argparse
import os, datetime
import re
import math
from array import *
def generateReport(benchmark_result):
anlyze_result = []
#clearing to get pure json snippet
strbegin = "<json>"
strend = "</json>"
output = re.compile('<json>(.*?)</json>', re.DOTALL | re.IGNORECASE).findall(benchmark_result)
j... | gpl-3.0 | 1,755,967,509,122,243,000 | 41.208791 | 155 | 0.713269 | false | 2.875717 | false | false | false |
owlabs/incubator-airflow | airflow/contrib/hooks/gcp_api_base_hook.py | 1 | 13481 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 | 8,777,412,994,223,459,000 | 37.738506 | 108 | 0.605741 | false | 4.6152 | false | false | false |
nijel/odorik | setup.py | 1 | 2391 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Odorik <https://github.com/nijel/odorik>
#
# 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 ... | gpl-3.0 | 1,745,834,329,186,759,400 | 33.085714 | 75 | 0.65549 | false | 3.670769 | false | false | false |
timpalpant/calibre | src/calibre/gui2/store/stores/woblink_plugin.py | 1 | 3888 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 12 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2016, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import urllib
from base64 im... | gpl-3.0 | -1,230,205,543,006,418,200 | 37.475248 | 117 | 0.626608 | false | 3.1364 | false | false | false |
devilry/devilry-django | setup.py | 1 | 1988 | import json
from setuptools import setup, find_packages
with open('devilry/version.json') as versionfile:
version = json.load(versionfile)
setup(
name="devilry",
version=version,
url='http://devilry.org',
license='BSD',
zip_safe=False,
author=('Tor Johansen, Espen Angell Kristiansen, Bend... | bsd-3-clause | 5,513,387,655,744,590,000 | 29.584615 | 110 | 0.518612 | false | 2.949555 | false | false | false |
hawkrives/stolaf-ubersicht-widgets | lib/get_printers.py | 1 | 6305 | # Created by Phinehas Bynum on 10/1/14.
# Ported to Python by Hawken Rives on 10/12/14.
from concurrent.futures import ThreadPoolExecutor
from subprocess import check_output, CalledProcessError, DEVNULL
from .data_helpers import load_data, needs_reload, persist_data
from .functions import group_by
from sys import stde... | mit | -606,605,441,022,629,900 | 26.294372 | 81 | 0.589532 | false | 3.006676 | false | false | false |
googleapis/googleapis-gen | google/devtools/clouderrorreporting/v1beta1/devtools-clouderrorreporting-v1beta1-py/google/cloud/errorreporting_v1beta1/services/error_stats_service/client.py | 1 | 27701 | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | 8,173,058,289,651,148,000 | 42.215289 | 106 | 0.610953 | false | 4.65563 | false | false | false |
joeyoung658/A-Level_2016-18 | Other/A453 - 2014/Task3Read_Old.py | 1 | 3842 | #Joseph Young - 1413
def one(): # makes a sub program
try:
file = open("Scores class one.txt", "r")#opens the class one file
lines = file.readlines()#reads the lines in the file
li = int(input("How many lines are in the file that you are requesting to see?"))
file.close()#closes the... | gpl-3.0 | -7,590,185,409,043,771,000 | 40.311828 | 191 | 0.544508 | false | 3.557407 | false | false | false |
kivy/python-for-android | pythonforandroid/recipes/boost/__init__.py | 1 | 3660 | from pythonforandroid.util import current_directory, build_platform
from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import shprint
from os.path import join, exists
from os import environ
import shutil
import sh
"""
This recipe bootstraps Boost from source to build Boost.Build
including python b... | mit | -5,460,580,152,348,241,000 | 32.577982 | 78 | 0.600546 | false | 3.856691 | false | false | false |
telwertowski/Books-Mac-OS-X | Versions/Books_3.0b5/Amazon (DE).plugin/Contents/Resources/amazon.py | 126 | 16017 | """Python wrapper
for Amazon web APIs
This module allows you to access Amazon's web APIs,
to do things like search Amazon and get the results programmatically.
Described here:
http://www.amazon.com/webservices
You need a Amazon-provided license key to use these services.
Follow the link above to get one. These f... | mit | 4,054,451,557,669,713,000 | 42.524457 | 189 | 0.67984 | false | 3.557752 | false | false | false |
Clyde-fare/cclib | test/testnuclear.py | 1 | 1511 | # This file is part of cclib (http://cclib.github.io), a library for parsing
# and interpreting the results of computational chemistry packages.
#
# Copyright (C) 2007-2014, the cclib development team
#
# The library is free software, distributed under the terms of
# the GNU Lesser General Public version 2.1 or later. ... | lgpl-2.1 | -1,917,572,934,941,211,100 | 30.479167 | 83 | 0.710126 | false | 3.410835 | true | false | false |
istb-mia/miapy | miapy/data/creation/callback.py | 1 | 5332 | import os
import numpy as np
import miapy.data.indexexpression as expr
import miapy.data.conversion as conv
import miapy.data.subjectfile as subj
import miapy.data.definition as df
from . import writer as wr
class Callback:
def on_start(self, params: dict):
pass
def on_end(self, params: dict):
... | apache-2.0 | -8,336,300,980,201,748,000 | 34.785235 | 118 | 0.644411 | false | 3.824964 | false | false | false |
python-control/python-control | control/matlab/wrappers.py | 2 | 7012 | """
Wrappers for the MATLAB compatibility module
"""
import numpy as np
from ..statesp import ss
from ..xferfcn import tf
from ..ctrlutil import issys
from ..exception import ControlArgument
from scipy.signal import zpk2tf
from warnings import warn
__all__ = ['bode', 'nyquist', 'ngrid', 'dcgain']
def bode(*args, **k... | bsd-3-clause | 1,444,372,909,782,574,300 | 29.620087 | 80 | 0.593411 | false | 3.780054 | false | false | false |
hchauvet/RootStemExtractor | Mac_Rootstemextractor.app/Contents/Resources/new_libgravimacro.py | 2 | 57637 | # -*- coding: utf-8 -*-
"""
Éditeur de Spyder
Portagee de la detection de tige de Olivier (en matlab) vers python
Regroupe les differentes fonctions pour le traitements des images de la manip
du gravitron.
Version: 3.1
Date: 19/04/2018
Modif
-----
13/10/2016 Hugo: Clean the file libgravimacro to only keep one metho... | gpl-3.0 | -8,763,681,593,650,503,000 | 32.710942 | 144 | 0.549642 | false | 3.270807 | false | false | false |
osDanielLee/SelfThinkingRobot | AnalyzeData/tests/test_parsing.py | 1 | 5766 | # -*- coding: utf-8 -*-
from unittest import TestCase
from datetime import timedelta, date, datetime
from chatterbot.utils.parsing import datetime_parsing, this_week_day, previous_week_day, next_week_day, dateFromDuration
"""
Output of the parser is an array of tuples
[match, value, (start, end)]
"""
class DateTi... | bsd-3-clause | 6,941,096,719,294,143,000 | 41.094891 | 132 | 0.662851 | false | 3.270562 | false | false | false |
CLVsol/clvsol_odoo_addons | clv_family_aux/models/family_aux.py | 1 | 2171 | # -*- coding: utf-8 -*-
# Copyright 2008 Luis Falcon <lfalcon@gnusolidario.org>
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
import logging
from odoo import api, fields, models
from odoo.modules import get_module_resource
_logger = logging.getLogger(__name__)
cla... | agpl-3.0 | 5,102,734,400,065,564,000 | 26.833333 | 72 | 0.542607 | false | 3.711111 | false | false | false |
MadeiraCloud/salt | sources/salt/states/grains.py | 1 | 4672 | # -*- coding: utf-8 -*-
'''
Manage grains on the minion
===========================
This state allows for grains to be set.
Grains set or altered this way are stored in the 'grains'
file on the minions, by default at: /etc/salt/grains
Note: This does NOT override any grains set in the minion file.
'''
def present(n... | apache-2.0 | -518,684,695,337,762,700 | 27.839506 | 110 | 0.542808 | false | 3.798374 | false | false | false |
akrherz/iem | htdocs/plotting/auto/scripts100/p185.py | 1 | 4171 | """Precip days to accumulate"""
import datetime
import os
import numpy as np
import geopandas as gpd
from pyiem import iemre, util
from pyiem.plot import get_cmap
from pyiem.plot.geoplot import MapPlot
from pyiem.grid.zs import CachingZonalStats
from pyiem.exceptions import NoDataFound
def get_description():
"""... | mit | 3,065,704,254,582,159,000 | 30.598485 | 79 | 0.570367 | false | 3.543755 | false | false | false |
nofdev/playback | playback/nova.py | 2 | 12110 | import argparse
import os
import sys
from fabric.api import *
from fabric.colors import red
from fabric.contrib import files
from fabric.network import disconnect_all
from playback import __version__, common
from playback.templates.nova_conf import conf_nova_conf
class Nova(common.Common):
"""
... | mit | 2,341,143,356,181,000,000 | 51.114035 | 245 | 0.561519 | false | 3.95235 | false | false | false |
OpenRuhr/mobil-bei-uns | webapp/util.py | 1 | 4593 | # encoding: utf-8
"""
Copyright (c) 2012 - 2015, Ernesto Ruge
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, this list of condit... | bsd-3-clause | 6,634,063,907,008,564,000 | 38.230769 | 755 | 0.721569 | false | 3.672 | false | false | false |
GennadiyZakharov/locotrack | src/ltgui/errordetectorwidget.py | 1 | 3331 | '''
Created on 10.10.2013
@author: gena
'''
from __future__ import division
from PyQt4 import QtCore, QtGui
from ltgui.actionbutton import ActionButton
from ltcore.ltactions import createAction
class ErrorDetectorWidget(QtGui.QWidget):
'''
classdocs
'''
def __init__(self, errorDetector, parent=None)... | lgpl-3.0 | -8,526,512,617,558,417,000 | 43.426667 | 105 | 0.72801 | false | 4.298065 | false | false | false |
atodorov/lorax | src/composer/cli/status.py | 5 | 1972 | #
# Copyright (C) 2018 Red Hat, Inc.
#
# 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 ... | gpl-2.0 | 3,230,143,259,067,427,300 | 34.214286 | 71 | 0.644523 | false | 3.792308 | false | false | false |
Toto-Azero/Wikipedia | pywikibot/stats_bistro.py | 1 | 2356 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Statistiques fixes dans la section [[#Aujourd.27hui.2C_dans_Wikip.C3.A9dia|#Aujourd'hui, dans Wikipédia]] du bistro du jour.
Voir cette discussion :
http://fr.wikipedia.org/w/index.php?oldid=77299088#Stat.E2.80.99_globales_live
"""
#
# (C) Framawiki, 2019
# (C) Toto Azé... | gpl-3.0 | 5,073,125,321,187,180,000 | 37.95 | 190 | 0.69662 | false | 2.568132 | false | false | false |
cesarali/Tag2Hierarchy | tag2hierarchy/utils/utilsTS.py | 1 | 2406 | '''
Created on Jul 26, 2016
@author: cesar
'''
import numpy as np
import pandas as pd
def pandasTSfromBag(datetimeBag,date0=None,datef=None,pandasSeries=None):
"""
creates a time series from a bag i.e. a list like
@param pandasSeries
@param datetimeBag: [date0,date1,date2,...]
@retu... | mit | 4,171,311,251,599,083,500 | 27.987952 | 94 | 0.576891 | false | 3.422475 | false | false | false |
anselmobd/fo2 | src/estoque/views/lista_docs_mov.py | 1 | 2285 | from pprint import pprint
from django.db.models import Q
from django.shortcuts import render
from django.urls import reverse
from django.views import View
from fo2.connections import db_cursor_so
from utils.functions.views import (cleanned_fields_to_context,
context_to_form_post)
... | mit | -5,800,058,311,785,222,000 | 33.029851 | 70 | 0.604386 | false | 3.596215 | false | false | false |
dawran6/flask | tests/test_templating.py | 1 | 12180 | # -*- coding: utf-8 -*-
"""
tests.templating
~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import logging
from jinja2 import TemplateNotFound
def test_context_processing(app):
@app... | bsd-3-clause | -1,692,658,688,778,724,000 | 27.064516 | 82 | 0.611494 | false | 3.643434 | true | false | false |
oktie/linkedct | ctdjango/databrowse/plugins/objects.py | 1 | 2792 | #
# Copyright 2009-2015 Oktie Hassanzadeh
#
# 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 ... | apache-2.0 | -650,727,016,140,446,300 | 43.31746 | 229 | 0.639327 | false | 3.84573 | false | false | false |
moas/carbooking | booking/companies/migrations/0001_initial.py | 1 | 2358 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-29 12:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('cities_light', '0006_compensate_for_0003... | mit | 4,598,240,592,302,163,500 | 38.3 | 119 | 0.553859 | false | 4.334559 | false | false | false |
cshallue/models | research/lstm_object_detection/tf_sequence_example_decoder.py | 1 | 11323 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -448,975,401,820,375,000 | 41.890152 | 80 | 0.662634 | false | 4.045373 | false | false | false |
kenb123/Basic-Expression-Lexicon-Variation-Algorithms-BELVA | src/threadQueue/aptQueueControlSystem.py | 1 | 3562 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------------------------------
# pyOwaspBELVA - Contextual custom dictionary builder with character and word variations for pen-testers
# Copyright (C) 2016 OWASP Foundation / Kenneth F. Belva
#
... | gpl-3.0 | -9,107,596,221,603,234,000 | 42.439024 | 131 | 0.563448 | false | 4.156359 | false | false | false |
ugoertz/django-familio | books/gedcom.py | 1 | 13402 | # -*- coding: utf8 -*-
import datetime
from collections import OrderedDict
from functools import wraps
from itertools import chain
from django.contrib.sites.models import Site
from genealogio.models import Family, Name, Person
class Writer(object):
"""
Abstract base class for exporting database.
"""
... | bsd-3-clause | 4,142,388,709,777,065,000 | 32.758186 | 79 | 0.495822 | false | 3.523134 | false | false | false |
nolram/NewsReader-Django | Crawler/utils.py | 1 | 4830 | import django
import requests
import feedparser as fp
from Crawler.models import LinksRSS, Postagens, TagsPostagens, Tags
from Crawler.rssmodel import RSSModel
from requests.exceptions import ConnectionError, TooManyRedirects
from django.db.utils import IntegrityError
from django.utils import timezone
from django.db... | mit | 9,102,220,637,260,991,000 | 44.895238 | 115 | 0.424569 | false | 4.585157 | false | false | false |
shugaoye/virt-manager | virtManager/console.py | 1 | 51360 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
# Copyright (C) 2010 Marc-André Lureau <marcandre.lureau@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-2.0 | -6,053,457,818,239,004,000 | 33.702027 | 83 | 0.584377 | false | 4.014931 | true | false | false |
erudit/zenon | tests/functional/apps/userspace/journal/editor/test_forms.py | 1 | 1186 | import pytest
from django.contrib.contenttypes.models import ContentType
from erudit.test.factories import JournalFactory
from base.test.factories import UserFactory
from core.authorization.defaults import AuthorizationConfig as AC
from core.authorization.models import Authorization
from apps.userspace.journal.edito... | gpl-3.0 | 5,948,516,910,540,530,000 | 27.238095 | 70 | 0.725126 | false | 3.850649 | true | false | false |
gmt/portage | pym/portage/module.py | 3 | 5531 | # Copyright 2005-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
from portage import os
from portage.exception import PortageException
from portage.cache.mappings import ProtectedDict
class InvalidModuleName(PortageException):
"""An i... | gpl-2.0 | -5,406,984,028,987,881,000 | 27.219388 | 66 | 0.692461 | false | 3.407887 | false | false | false |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/openstack/compute/v2/_proxy.py | 3 | 22070 | # 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, software
# distributed under t... | mit | 7,871,402,433,494,983,000 | 42.964143 | 79 | 0.600317 | false | 4.689758 | false | false | false |
knub/master-thesis | code/python/knub/thesis/spearmint_analogy_reasoning/analogy_reasoning.py | 1 | 1326 | import logging
import mkl
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
from knub.thesis.word2vec_eval import eval_word2vec
def analogy_reasoning(size, window, negative, sample, job_id):
logging.info("Training word2vec")
sentences = LineSentence("/data/wikipedia/2016-06-2... | apache-2.0 | -5,940,315,797,968,224,000 | 40.4375 | 102 | 0.64178 | false | 3.55496 | false | false | false |
plewis/phycas | src/python/commands/MCMC.py | 1 | 14612 | from phycas.utilities.PhycasCommand import *
from phycas.utilities.CommonFunctions import CommonFunctions
from phycas import model, partition, randomtree, P
from phycas.commands.MCMCImpl import MCMCImpl
#from phycas.probdist import Beta, Exponential, InverseGamma
import copy
class MCMC(PhycasCommand):
def __init__... | mit | 3,895,475,477,255,496,700 | 97.067114 | 431 | 0.651793 | false | 4.130017 | false | false | false |
sunlightlabs/django-locksmith | locksmith/hub/migrations/0001_initial.py | 1 | 6512 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Api'
db.create_table('locksmith_hub_api', (
(u'id', self.gf('django.db.models.fi... | bsd-3-clause | -6,492,601,639,675,842,000 | 57.675676 | 131 | 0.576781 | false | 3.550709 | false | false | false |
gexahedron/cycle-double-covers | unit_vector_flows/sphere_plot.py | 1 | 3473 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import time
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_aspect('equal')
radius = -1
points = []
xx, yy, zz... | mit | -6,988,149,236,978,146,000 | 35.946809 | 168 | 0.562626 | false | 2.527656 | false | false | false |
modsy/incubator-airflow | airflow/operators/python_operator.py | 5 | 5614 | from builtins import str
from datetime import datetime
import logging
from airflow.models import BaseOperator, TaskInstance
from airflow.utils.state import State
from airflow.utils.decorators import apply_defaults
from airflow import settings
class PythonOperator(BaseOperator):
"""
Executes a Python callable... | apache-2.0 | -8,424,437,444,647,794,000 | 39.681159 | 79 | 0.649804 | false | 4.556818 | false | false | false |
ContainerSolutions/argus-gephi-connector | argus-gephi-connector.py | 1 | 9777 | #!/usr/bin/env python
import time
from threading import Thread, Condition, RLock, Timer
import pygephi
import sys
import json
import pprint
import socket
import mock
from ipwhois import IPWhois
import operator
from cachetools import LRUCache, cachedmethod
def synchronized(method):
# from http://stackoverflow.com/... | apache-2.0 | -4,252,456,343,479,633,400 | 32.030405 | 102 | 0.535849 | false | 4.245332 | false | false | false |
Comunitea/CMNT_004_15 | project-addons/stock_deposit/models/sale_order.py | 1 | 2960 | ##############################################################################
#
# Author: Santi Argüeso
# Copyright 2014 Pexego Sistemas Informáticos S.L.
#
# 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... | agpl-3.0 | -342,745,713,585,763,600 | 36.443038 | 91 | 0.613252 | false | 3.928287 | false | false | false |
ray-project/ray | doc/examples/plot_pong_example.py | 4 | 10569 | # flake8: noqa
"""
Learning to Play Pong
=====================
In this example, we'll train a **very simple** neural network to play Pong using
the OpenAI Gym.
At a high level, we will use multiple Ray actors to obtain simulation rollouts
and calculate gradient simultaneously. We will then centralize these
gradients ... | apache-2.0 | 1,428,547,633,107,826,200 | 34.585859 | 84 | 0.621913 | false | 3.635707 | false | false | false |
natalianik/python_training | fixture/contact.py | 1 | 5038 | __author__ = 'Natalia.Nikonova'
# -*- coding: utf-8 -*-
class ContactHelper:
def __init__(self, app):
self.app = app
def fill_contact_form(self, contact):
wd = self.app.wd
self.change_field_value("firstname", contact.firstname)
self.change_field_value("middlename", ... | apache-2.0 | -5,621,851,835,878,770,000 | 45.54717 | 105 | 0.615125 | false | 3.508357 | false | false | false |
UoE-macOS/app-approval | server/jssapproval/approvers.py | 1 | 1196 | import json
import urllib2
import base64
class Approvers(object):
""" Wrapper for getting & returning approvers
"""
def __init__(self, url, user, password):
if url[:7] == "file://":
with open(url[7:], 'r') as f:
self.approvers = json.load(f)
else:
r... | gpl-3.0 | 7,576,665,041,640,988,000 | 29.666667 | 92 | 0.527592 | false | 3.973422 | false | false | false |
SylvainCecchetto/plugin.video.catchuptvandmore | plugin.video.catchuptvandmore/resources/lib/channels/wo/euronews.py | 1 | 2283 | # -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2017 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... | gpl-2.0 | -1,027,884,492,062,803,700 | 32.086957 | 80 | 0.660534 | false | 3.664526 | false | false | false |
hbiyik/tribler | src/tribler-core/tribler_core/modules/libtorrent/torrentdef.py | 1 | 19967 | """
Author(s): Arno Bakker
"""
import logging
import time
from hashlib import sha1
import aiohttp
import libtorrent as lt
from libtorrent import bencode
from tribler_common.simpledefs import INFOHASH_LENGTH
from tribler_core.utilities import maketorrent, path_util
from tribler_core.utilities.torrent_utils import cr... | lgpl-3.0 | 872,931,993,516,702,200 | 35.771639 | 119 | 0.565333 | false | 4.334057 | false | false | false |
mattgruter/picture_clerk | picture_clerk/connector.py | 1 | 9262 | """
@author: Matthias Grueter <matthias@grueter.name>
@copyright: Copyright (c) 2012 Matthias Grueter
@license: GPL
"""
import os
import urlparse
import logging
import errno
import contextlib
import paramiko
from abc import ABCMeta, abstractmethod
log = logging.getLogger('pic.connector')
class NotConnectedError(... | gpl-3.0 | -8,027,920,786,165,960,000 | 26.647761 | 80 | 0.563377 | false | 4.334113 | false | false | false |
bstroebl/xplanplugin | XPImport.py | 1 | 71079 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
XPImport
A QGIS plugin
Fachschale XPlan für XPlanung
-------------------
begin : 2018-07-04
copyright : (C) 2018 by Bernhard Stroebl, KIJ/DV
email ... | gpl-2.0 | -3,832,820,848,147,152,400 | 42.341062 | 163 | 0.519089 | false | 3.576298 | false | false | false |
cheral/orange3 | Orange/widgets/model/owknn.py | 2 | 2199 | from AnyQt.QtCore import Qt
from Orange.data import Table
from Orange.modelling import KNNLearner
from Orange.widgets import gui
from Orange.widgets.settings import Setting
from Orange.widgets.utils.owlearnerwidget import OWBaseLearner
class OWKNNLearner(OWBaseLearner):
name = "kNN"
description = "Predict ac... | bsd-2-clause | -4,892,894,172,337,082,000 | 33.359375 | 75 | 0.640291 | false | 3.733447 | false | false | false |
Codeidea/budget-tracker | apps/tracking/migrations/0001_initial.py | 1 | 1535 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
m... | mit | -7,000,373,039,351,875,000 | 33.886364 | 114 | 0.564169 | false | 4.398281 | false | false | false |
jonge-democraten/hemres | hemres/templatetags/hemres_email.py | 1 | 2390 | from django import template
from django.contrib.staticfiles import finders
from django.core.files.storage import default_storage
from django.core.mail import make_msgid
from email.mime.image import MIMEImage
register = template.Library()
@register.simple_tag(takes_context=True, name="emailimage_static")
def emailima... | mit | 6,198,496,061,671,751,000 | 26.471264 | 84 | 0.61046 | false | 3.716952 | false | false | false |
mariodebian/tcosmonitor | tcosmonitor/extensions/audiortp.py | 1 | 25512 | # -*- coding: UTF-8 -*-
# TcosMonitor version __VERSION__
#
# Copyright (c) 2006-2011 Mario Izquierdo <mariodebian@gmail.com>
#
# This package 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 ... | gpl-2.0 | 7,615,296,810,201,622,000 | 46.064576 | 288 | 0.573915 | false | 3.615221 | false | false | false |
john-wang-metro/metro-openerp | metro_mrp_id_stock/__openerp__.py | 2 | 1807 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can red... | agpl-3.0 | 7,927,185,397,518,595,000 | 42.02381 | 103 | 0.602656 | false | 3.928261 | false | false | false |
eallrich/avdl-magic | app.py | 1 | 3701 | """avdl-magic: A perhaps not-so-magical audio/video download assistant.
Copyright (C) 2015 Evan Allrich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your o... | gpl-3.0 | -4,154,329,553,212,968,000 | 28.373016 | 93 | 0.649284 | false | 3.708417 | false | false | false |
niteoweb/libcloud | libcloud/compute/drivers/onapp.py | 30 | 12022 | import json
from libcloud.compute.base import Node, NodeDriver
from libcloud.common.onapp import OnAppConnection
from libcloud.utils.networking import is_private_subnet
from libcloud.compute.providers import Provider
__all__ = [
"OnAppNodeDriver"
]
"""
Define the extra dictionary for specific resources
"""
RESO... | apache-2.0 | -5,567,203,655,991,875,000 | 28.610837 | 78 | 0.481534 | false | 4.107277 | false | false | false |
spaceone/pyjs | pygtkweb/demos/058-colorbutton.py | 13 | 1030 | #!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class ColorButtonExample:
def __init__(self):
window = gtk.Window()
window.connect('destroy', lambda w: gtk.main_quit())
hbox = gtk.HBox()
window.add(hbox)
label = gtk.Label('Foreground Color:')
hbox... | apache-2.0 | -1,106,991,236,220,803,200 | 26.837838 | 70 | 0.600971 | false | 3.626761 | false | false | false |
robotfinance/BIX | bixpy/okc/websocket/tests/test_websocket.py | 12 | 26208 | # -*- coding: utf-8 -*-
#
import six
import sys
sys.path[0:0] = [""]
import os
import os.path
import base64
import socket
try:
from ssl import SSLError
except ImportError:
# dummy class of SSLError for ssl none-support environment.
class SSLError(Exception):
pass
if sys.version_info[0] == 2 and s... | mit | 740,518,297,568,565,000 | 38.540909 | 165 | 0.605165 | false | 3.264982 | true | false | false |
marcusramberg/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/system/at.py | 28 | 6404 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.com>
#
# 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 versi... | mit | -1,881,615,504,702,092,300 | 31.02 | 113 | 0.623204 | false | 3.800593 | false | false | false |
pabloxxl/revi | reddit/comments.py | 1 | 3482 | from request import request
from rObject import rObject
from rObject import sortType
from rObject import typeStr
import logging as lg
class comment:
def __init__(self, author, text):
self.author = author
self.text = text
# lg.debug("link::__init__ " + author + " " + text[:25])
class com... | gpl-2.0 | -4,457,130,892,765,146,600 | 28.016667 | 78 | 0.535899 | false | 4.067757 | false | false | false |
christopher-gillies/VCFScripts | illumina_to_plink_lgen.py | 1 | 9236 | #!/usr/bin/python
import argparse
import re
import os
class Sample:
def __init__(self,id,file):
self.id = id
self.file = file
def process_input():
##############
# INPUT PROCESSSING
##############
calling_dir = os.path.dirname(os.path.realpath(__file__))
print "#####################################... | apache-2.0 | 620,078,735,026,517,500 | 29.281967 | 165 | 0.661542 | false | 2.914484 | false | false | false |
quentin-xia/Maticv | common/pattern.py | 1 | 4126 | #/usr/bin/env python
#-*- coding:utf-8 -*-
import os,time
from utils import Utils
from match import Match
#from action import Action
import gl
import platform
if platform.system() is "Windows":
try:
import maticv.common.opencv.x32.cv2 as cv2
except:
import maticv.common.opencv.x64.cv2 as cv2
els... | mit | -5,543,099,916,431,662,000 | 27.771429 | 71 | 0.488332 | false | 3.796418 | false | false | false |
hollance/YOLO-CoreML-MPSNNGraph | Convert/nngraph.py | 1 | 2138 | # Conversion script for tiny-yolo-voc to Metal.
# Needs Python 3 and Keras 1.2.2
import os
import numpy as np
import keras
from keras.models import Sequential, load_model
model_path = "yad2k/model_data/tiny-yolo-voc.h5"
dest_path = "../TinyYOLO-NNGraph/Parameters"
# Load the model that was exported by YAD2K.
model =... | mit | 6,292,052,782,626,031,000 | 35.237288 | 74 | 0.691768 | false | 3.015515 | false | false | false |
dev-alberto/Bachelor2017 | Code/FastArithmetic/scalar_multiplication.py | 1 | 6845 | from Code.util import w_NAF, NAF, mods, right_to_left_scalar_mul
from Code.DataStructures.interfaces import AbstractPoint
class ScalarMultiplication:
def __init__(self, point, w):
assert isinstance(point, AbstractPoint)
self.point = point
#precom stage
self.w = w
m = 2 * ((... | apache-2.0 | 6,573,135,349,503,789,000 | 31.287736 | 131 | 0.420307 | false | 3.495914 | false | false | false |
opengovfoundation/chicagocode | htdocs/admin/parseTitles.py | 2 | 41004 | #!/usr/bin/env python
import sys
import os
import re
import shutil
import codecs
from HTMLParser import HTMLParser
from optparse import OptionParser
def countIndent(indent):
count = 0
for c in indent:
if c =='\t':
count += 2
else:
count += 1
return count
def is... | gpl-3.0 | -4,154,662,482,830,484,500 | 33.631757 | 139 | 0.509706 | false | 3.933615 | false | false | false |
trec-kba/streamcorpus-pipeline | streamcorpus_pipeline/keywords.py | 1 | 1146 | '''rudimentary command-line interface for keyword search functionality
.. This software is released under an MIT/X11 open source license.
Copyright 2012-2014 Diffeo, Inc.
'''
from __future__ import absolute_import
from streamcorpus_pipeline._kvlayer_table_names import STREAM_ITEM_TABLE_DEFS
from streamcorpus_pipeli... | mit | -7,845,330,482,910,931,000 | 37.2 | 237 | 0.747818 | false | 3.82 | false | false | false |
alexlib/Qt-Python-Binding-Examples | layout/layout_in_grid.py | 2 | 1228 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
lay out in Gird demo
Tested environment:
Mac OS X 10.6.8
"""
import sys
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
from PyQt4 import QtCore
from PyQt4 import QtGui
class Demo(QtGui.QWidget):
def __init__(self):
... | bsd-3-clause | -2,515,469,842,038,429,000 | 19.466667 | 46 | 0.574104 | false | 3.498575 | false | false | false |
GeosoftInc/gxpy | geosoft/gxapi/GXCHIMERA.py | 1 | 76319 | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... | bsd-2-clause | -4,037,526,591,093,132,000 | 43.34631 | 456 | 0.547858 | false | 3.514737 | false | false | false |
BanzaiTokyo/akihabara-tokyo | askapp/rules_light_registry.py | 2 | 3423 | import rules_light
from askapp.models import ThreadLike, PostLike
from datetime import datetime, timedelta
def can_edit_thread(user, rule, thread):
return user.is_staff or thread.user == user
def can_delete_thread(user, rule, thread):
return user.is_staff
def can_reply_thread(user, rule, thread):
retur... | apache-2.0 | 3,720,758,472,545,968,600 | 37.897727 | 133 | 0.716039 | false | 3.278736 | false | false | false |
pajlada/pajbot | pajbot/modules/duel.py | 2 | 15808 | import logging
from datetime import timedelta
import random
from pajbot import utils
from pajbot.managers.db import DBManager
from pajbot.managers.handler import HandlerManager
from pajbot.managers.schedule import ScheduleManager
from pajbot.models.command import Command
from pajbot.models.command import CommandExam... | mit | 9,153,087,724,522,039,000 | 37.650367 | 174 | 0.553391 | false | 3.926478 | false | false | false |
krystism/jekyllclient | jekyllclient/v1_1/shell.py | 1 | 5781 | #!/usr/bin/python
#coding=utf-8
from __future__ import print_function
import sys
import time
import glob
import os
from jekyllclient import utils
from jekyllclient.post import Post
from jekyllclient.config import CONF
@utils.arg('--disable-comments',
dest='comments',
action='store_false',
help... | mit | -899,481,303,255,068,000 | 32.224138 | 101 | 0.557862 | false | 3.520706 | false | false | false |
telwertowski/Books-Mac-OS-X | Export Plugins/WhatsOnMyBookShelf Exporter/SOAPpy/Server.py | 2 | 27136 | """
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck@gst.com)
#
##########################... | mit | 5,037,496,942,282,027,000 | 37.436261 | 83 | 0.470851 | false | 4.88321 | true | false | false |
joejcollins/Ordbok | read_epub.py | 1 | 1097 | # -*- coding: utf-8 -*-
__author__ = 'User'
import epub
import re
from xml.etree import ElementTree
from cStringIO import StringIO
class AllEntities:
def __getitem__(self, key):
# key is your entity, you can do whatever you want with it here
if key == "nbsp":
return ""
return k... | mit | 2,202,538,205,073,148,200 | 24.465116 | 73 | 0.672146 | false | 3.443396 | false | false | false |
OpenTreeOfLife/ottreeindex | otindex/add_update_studies.py | 3 | 8446 | from pyramid.httpexceptions import HTTPNotFound
from sqlalchemy.orm import aliased
import re, json, logging
from peyotl.api import PhylesystemAPI
from peyotl.nexson_syntax import get_nexml_el
from peyotl.nexson_proxy import NexsonProxy
from peyotl.manip import iter_trees
from peyotl import gen_otu_dict, iter_node
fr... | bsd-2-clause | 153,917,804,659,358,940 | 32.515873 | 99 | 0.587734 | false | 3.413905 | false | false | false |
p-l-/miasm | test/core/graph.py | 1 | 2092 | from miasm2.core.graph import *
g = DiGraph()
g.add_node('a')
g.add_node('b')
g.add_edge('a', 'b')
g.add_edge('a', 'c')
g.add_edge('a', 'c')
g.add_edge('c', 'c')
print g
print [x for x in g.successors('a')]
print [x for x in g.predecessors('a')]
print [x for x in g.predecessors('b')]
print [x for x in g.predecessor... | gpl-2.0 | 772,331,271,091,523,500 | 25.481013 | 65 | 0.429254 | false | 2.702842 | false | false | false |
schwa-lab/gigacluster | gigacluster/model.py | 1 | 3843 | from schwa import dr
ENC = 'utf-8'
sentence_on_tokens = dr.decorators.reverse_slices('sentences', 'tokens', 'span', 'sentence')
tokens_on_sentences = dr.decorators.materialize_slices('sentences', 'tokens', 'span', 'tokens')
prev_next_tokens = dr.decorators.add_prev_next('tokens', index_attr='index')
prev_next_sentenc... | mit | -6,693,107,311,469,946,000 | 31.846154 | 152 | 0.610981 | false | 3.341739 | false | false | false |
JackKelly/neuralnilm_prototype | scripts/experiment028.py | 2 | 5529 | from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import theano
import theano.tensor as T
import lasagne
"""
INPUT: quantized mains fdiff
OUTPUT: appliance fdiff
"""
theano.config.compute_test_value = 'raise'
# Sequence length
LENGTH = 400
# Number of units in the hidden (recurrent) l... | mit | -2,914,110,145,575,130,000 | 32.107784 | 122 | 0.640984 | false | 3.177586 | false | false | false |
nicolashernandez/PyRATA | pyrata/compiled_pattern.py | 1 | 52972 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyRATA
#
# Authors:
# Nicolas Hernandez <nicolas.hernandez@gmail.com>
# Guan Gui 2014-08-10 13:20:03 https://www.guiguan.net/a-beautiful-linear-time-python-regex-matcher-via-nfa
# URL:
# https://github.com/nicolashernandez/PyRATA/
#
#
# Copyri... | apache-2.0 | -1,624,878,182,893,678,300 | 48.684803 | 276 | 0.515907 | false | 4.090439 | false | false | false |
Horta/limix | limix/io/bgen.py | 1 | 3354 | def read(filepath, size=50, verbose=True, metadata_file=True, sample_file=None):
r"""Read a given BGEN file.
Parameters
----------
filepath : str
A BGEN file path.
size : float, optional
Chunk size in megabytes. Defaults to ``50``.
verbose : bool, optional
``True`` to sh... | apache-2.0 | 3,813,315,614,898,631,000 | 32.207921 | 108 | 0.6452 | false | 4.140741 | false | false | false |
ubuntuslave/omnistereo_sensor_design | omnistereo/covariance_ellipsoid.py | 1 | 8706 | # -*- coding: utf-8 -*-
# covariance_ellipsoid.py
# Copyright (c) 20012-2016, Carlos Jaramillo
# Produced at the Laboratory for Robotics and Intelligent Systems of the City College of New York
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | gpl-3.0 | 7,371,170,291,628,409,000 | 40.855769 | 203 | 0.653343 | false | 3.046186 | false | false | false |
kinpa200296/HierarchyManager | Client/FolderProperties.py | 1 | 1302 | #!/usr/bin/python2.7
from PyQt4 import QtGui, QtCore, QtSql, uic
class FolderProperties(QtGui.QDialog):
def __init__(self, parent, parentFolder, user, folder = 0):
QtGui.QDialog.__init__(self, parent)
self.ui = uic.loadUi("FolderProperties.ui", self)
self.FolderID = parentFolder
sel... | mit | -2,599,105,947,389,528,600 | 42.433333 | 101 | 0.612135 | false | 3.586777 | false | false | false |
KanoComputing/kano-profile | kano_avatar_gui/ImageView.py | 1 | 1206 | #
# ImageView.py
#
# Copyright (C) 2015 - 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk
# TODO: Make into a fixed and put the environment behind?
class ImageView(G... | gpl-2.0 | 7,177,448,832,515,403,000 | 24.125 | 80 | 0.594527 | false | 3.536657 | false | false | false |
harrijs/gns3-server | gns3server/modules/dynamips/nios/nio_udp.py | 1 | 2947 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 | 8,129,139,481,080,382,000 | 29.071429 | 117 | 0.501527 | false | 4.722756 | false | false | false |
CiscoSystems/os-sqe | lab/monitors/nexus.py | 1 | 1298 | import lab.nodes.n9
def start(lab, log, args):
import validators
name_or_ip = args.get('name_or_ip', 'from_lab')
is_show_details = args.get('is_show_details', False)
if validators.ipv4(name_or_ip):
n9k_ip = name_or_ip
n9k_username = args['username']
n9k_password = args['passw... | apache-2.0 | 3,976,682,432,640,946,000 | 37.176471 | 131 | 0.570878 | false | 3.046948 | false | false | false |
espadrine/opera | chromium/src/tools/grit/grit/format/policy_templates/writers/admx_writer.py | 9 | 14568 | #!/usr/bin/env python
# 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.
from xml.dom import minidom
from grit.format.policy_templates.writers import xml_formatted_writer
def GetWriter(config):
'''Fac... | bsd-3-clause | 1,342,541,451,570,730,500 | 38.16129 | 80 | 0.648888 | false | 4.118745 | true | false | false |
MungoRae/home-assistant | homeassistant/components/device_tracker/tomato.py | 7 | 4092 | """
Support for Tomato routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tomato/
"""
import json
import logging
import re
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassist... | apache-2.0 | 1,304,790,178,702,115,800 | 34.275862 | 79 | 0.608016 | false | 4.275862 | true | false | false |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/blueprints/browser/sprintattendance.py | 1 | 7116 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Views for SprintAttendance."""
__metaclass__ = type
__all__ = [
'SprintAttendanceAttendView',
'SprintAttendanceRegisterView',
]
from datetime import timedelta... | agpl-3.0 | -3,929,492,016,487,482,400 | 39.20339 | 78 | 0.624227 | false | 3.986555 | false | false | false |
RetailMeNotSandbox/dart | tools/vagrant/vagrant_scripts/deployment_generator.py | 1 | 5067 | import os
def render_dart_template(paramaters, template, container_cmd="", work_dir="/", dart_role="web", additional_run_steps=[], export_port=""):
result = template.render(flask_webapp=paramaters['flask_webapp'],
webapp_port=paramaters['webapp_port'],
database_c... | mit | 3,936,761,877,698,514,000 | 43.06087 | 146 | 0.605289 | false | 3.838636 | false | false | false |
Avsecz/concise | concise/utils/pwm.py | 2 | 10205 | import numpy as np
import copy
from concise.preprocessing.sequence import DNA, _get_vocab_dict
from io import StringIO
import gzip
from concise.utils.plot import seqlogo, seqlogo_fig
import matplotlib.pyplot as plt
DEFAULT_LETTER_TO_INDEX = _get_vocab_dict(DNA)
DEFAULT_INDEX_TO_LETTER = dict((DEFAULT_LETTER_TO_INDEX[... | mit | 337,171,811,681,356,200 | 32.349673 | 123 | 0.605488 | false | 3.375786 | false | false | false |
jmarcelogimenez/petroFoam | solutionModeling.py | 1 | 5289 | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 13:08:19 2015
@author: jgimenez
"""
from PyQt4 import QtGui, QtCore
from solutionModeling_ui import Ui_solutionModelingUI
import os
from tracers import *
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
... | gpl-2.0 | 8,402,864,466,863,095,000 | 35.232877 | 118 | 0.620911 | false | 3.926503 | false | false | false |
sagz/Your-Very-Own-Yelp | User Rating Prediction/python programs/lda/itm.py | 1 | 11285 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# [Hu, Boyd-Graber and Satinoff ACL2011] Interactive Topic Modeling
# This code is available under the MIT License.
# (c)2011 Nakatani Shuyo / Cybozu Labs Inc.
import numpy
class ITM:
def __init__(self, K, alpha, beta, eta, docs, V, smartinit=True):
self.K = ... | gpl-3.0 | 7,449,945,222,528,196,000 | 37.515358 | 118 | 0.516792 | false | 3.099423 | false | false | false |
geoffmomin/ScratchPad | Python/tryExceptError.py | 1 | 1200 | """
Sometimes we need the user to submit data. There might be errors. To fix, we can use the try/fix method:
try:
<statement that may cause an error>
except:
<statement to run if error occurs>
else:
<statement to execute if no error occurs>
So, taking the guessTheNumber.py as an ex... | gpl-3.0 | -87,709,209,168,453,740 | 25.666667 | 129 | 0.6425 | false | 3.821656 | false | false | false |
georgetown-analytics/classroom-occupancy | dataset_builder/COPP_Utils.py | 1 | 3824 | import pandas as pd
import numpy as np
def appendFeature(base_df, ext_series, drop_col_name, fill_value = None):
'''Concatenates a Series to a DataFrame. If after concatenating data
the first row of a given day in ext_series is nan, it could be replaced
by fill_value (as long as a fill_value is supplied). ... | mit | 8,211,221,592,492,123,000 | 40.11828 | 102 | 0.683577 | false | 3.544022 | false | false | false |
diox/amo-validator | validator/compat.py | 1 | 1034 | from validator.decorator import version_range
from validator.constants import (FIREFOX_GUID, FENNEC_GUID,
THUNDERBIRD_GUID as TB_GUID, ANDROID_GUID)
# Compatibility app/version ranges:
def _build_definition(maj_version_num, firefox=True, fennec=True,
thunderbird... | bsd-3-clause | -7,541,150,952,486,523,000 | 34.655172 | 75 | 0.640232 | false | 3.335484 | false | false | false |
xypan1232/libdeep-python | examples/iris/iris.py | 1 | 1266 | #!/usr/bin/python
import deeplearn
# The number of iris species to classify
no_of_classes = 3
# Reads a number of data samples from a CSV file
# where the expected output value is the fifth field (index 4)
noOfSamples = deeplearn.readCsvFile("iris.data", 16, 3, [4], no_of_classes)
print str(noOfSamples) + " samples ... | bsd-3-clause | 1,797,897,852,678,995,200 | 26.521739 | 78 | 0.753555 | false | 3.296875 | false | false | false |
estnltk/estnltk-vislcg3 | setup.py | 1 | 2171 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages, Extension
import os
import sys
os.environ['CC'] = 'g++'
os.environ['CXX'] = 'g++'
def get_sources(src_dir='src', ending='.cpp'):
"""Function to get a list of files ending with `ending` in `src_dir`."""
return [os.path.join(src_dir, fnm) for... | gpl-3.0 | -4,037,039,057,984,324,600 | 35.183333 | 94 | 0.547674 | false | 3.802102 | false | false | false |
oVirt/ovirt-hosted-engine-ha | ovirt_hosted_engine_ha/broker/notifications.py | 1 | 3213 | from email.parser import Parser
from email.utils import formatdate
import socket
import smtplib
try:
import configparser
except ImportError:
import ConfigParser as configparser
import re
import os
import logging
from . import constants
from ..env import config
__author__ = 'msivak'
# regular expression used... | lgpl-2.1 | 7,616,670,574,238,937,000 | 30.194175 | 79 | 0.638344 | false | 4.295455 | true | false | false |
klebercode/canaa | canaa/talents/forms.py | 1 | 1102 | # coding: utf-8
from django import forms
from django.template.loader import render_to_string
from django.core.mail import EmailMultiAlternatives
from canaa.talents.models import Talent
from canaa.talents.models import SEX_CHOICES, FORMATION_CHOICES
from canaa.core.models import STATE_CHOICES
class TalentForm(forms.M... | mit | 6,193,290,302,340,227,000 | 33.4375 | 78 | 0.618875 | false | 3.710438 | false | false | false |
jmfranck/pyspecdata | notebook/forgui.py | 1 | 16680 | from pyspecdata import *
from string import rstrip
from scipy.io import savemat,loadmat
from os.path import exists as path_exists
from scipy.optimize import leastsq
from scipy.signal import fftconvolve
from pyspecdata.nmr import *
from pyspecdata.load_files import *
# this file should be like fornotebook, except that t... | bsd-3-clause | -1,673,221,134,153,275,000 | 36.483146 | 183 | 0.677578 | false | 2.546565 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.