repo_name stringlengths 5 92 | path stringlengths 4 232 | copies stringclasses 19
values | size stringlengths 4 7 | content stringlengths 721 1.04M | 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 15 997 | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|
conan-io/conan | conans/test/functional/scm/tools/test_git.py | 1 | 15486 | # coding=utf-8
import os
import re
import subprocess
import unittest
import pytest
import six
from mock import patch
from parameterized import parameterized
from conans.client import tools
from conans.client.tools.scm import Git
from conans.errors import ConanException
from conans.test.utils.scm import create_local_g... | mit | 4,983,789,114,326,910,000 | 36.405797 | 113 | 0.597959 | false |
iceout/python_koans_practice | python2/koans/about_new_style_classes.py | 1 | 2171 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... | mit | 4,223,123,889,923,677,000 | 34.016129 | 79 | 0.58176 | false |
praveenkumar/ansible | lib/ansible/plugins/strategies/linear.py | 1 | 14325 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License, or
# (at your option) an... | gpl-3.0 | 7,524,632,294,346,595,000 | 45.209677 | 179 | 0.548063 | false |
The-Compiler/qutebrowser | tests/helpers/messagemock.py | 1 | 2576 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 | 6,713,423,093,732,650,000 | 27 | 75 | 0.667314 | false |
mholgatem/GPIOnext | config/menus.py | 1 | 4183 | import time
from config.constants import *
from config import SQL
from cursesmenu import *
from cursesmenu.items import *
import curses
'''
---------------------------------------------------------
This script handles menu navigation
RETURNS: dictionary containing device name,
number of buttons, number of axis
-... | mit | -1,539,677,668,419,638,800 | 27.346939 | 109 | 0.63067 | false |
Statoil/libres | python/tests/res/enkf/data/test_custom_kw.py | 1 | 4935 | import os
import pytest
from res.enkf.enums import EnkfRunType
from res.enkf import ErtRunContext
from res.enkf.config import CustomKWConfig
from res.enkf.data import CustomKW
from res.enkf.enkf_simulation_runner import EnkfSimulationRunner
from res.enkf.export import custom_kw_collector
from res.enkf.export.custom_k... | gpl-3.0 | 4,995,426,904,428,600,000 | 33.51049 | 150 | 0.604458 | false |
kashefy/nideep | nideep/iow/test_read_img.py | 1 | 5461 | '''
Created on Oct 30, 2015
@author: kashefy
'''
from nose.tools import assert_equal, assert_almost_equals
from mock import patch
import os
import tempfile
import shutil
import numpy as np
import cv2 as cv2
import read_img as r
class TestReadImage:
@classmethod
def setup_class(self):
self.dir_tmp = ... | bsd-2-clause | 3,508,980,782,283,328,000 | 32.29878 | 102 | 0.449551 | false |
mahim97/zulip | zerver/management/commands/set_default_streams.py | 8 | 1912 |
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from typing import Any, Dict, Text
from zerver.lib.actions import set_default_streams
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """Set default streams for a realm
Users created under this realm ... | apache-2.0 | -3,494,797,348,858,399,000 | 36.490196 | 81 | 0.648536 | false |
endlessm/chromium-browser | third_party/shaderc/src/glslc/test/option_dash_M.py | 3 | 33038 | # Copyright 2015 The Shaderc 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 applicable... | bsd-3-clause | -7,187,553,513,730,992,000 | 42.816976 | 82 | 0.602004 | false |
OpenPathView/batchPanoMaker | opv_import/helpers/udev_observer.py | 1 | 1433 | # coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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,850,746,572,900,994,000 | 43.8125 | 142 | 0.753664 | false |
superclass/superwas | nagios.py | 1 | 12906 | #!/usr/bin/python
# This file is part of Superwas.
#
# Superwas 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.
#
# Superwas is dist... | gpl-2.0 | -9,097,531,912,660,383,000 | 36.086207 | 159 | 0.707423 | false |
wichert/rest_toolkit | tests/ext/test_colander.py | 1 | 1039 | import pytest
from pyramid.httpexceptions import HTTPBadRequest
from rest_toolkit.abc import EditableResource
from rest_toolkit.ext.colander import ColanderSchemaValidationMixin
import colander
class AccountSchema(colander.Schema):
email = colander.SchemaNode(colander.String())
password = colander.SchemaNode(... | bsd-2-clause | 5,855,686,844,315,270,000 | 27.081081 | 87 | 0.725698 | false |
robinbach/adv-loop-perf | 04modelPython/Regression.py | 1 | 4435 | from sklearn import svm
from sklearn import linear_model
from sklearn.kernel_ridge import KernelRidge
import numpy as np
import sys
import random
import matplotlib.pyplot as plt
numTrain = 11
def readFile(fPath):
data = np.genfromtxt(fPath, delimiter=',')
random.shuffle(data)
performance = data.T[-2]
distortion ... | mit | 5,522,304,864,581,364,000 | 37.912281 | 104 | 0.773393 | false |
yaelelmatad/EtsyApiTest | findSimilarShopsAllShopsByPopularity.py | 1 | 6336 | from __future__ import division
import json
import sys
import math
import random
#hard coded number of similar stores to spit out since HW said 5, could always add to command line
nSimilarStores = 5
maxBonus = 0.0005
class vectors:
def __init__(self, featureVectorName, multiplier, shopVectors):
self.mult... | gpl-3.0 | -9,196,436,886,653,949,000 | 40.142857 | 360 | 0.652778 | false |
ZeitOnline/zeit.content.article | src/zeit/content/article/edit/browser/tests/test_rawxml.py | 1 | 1493 | import zeit.content.article.edit.browser.testing
class Form(zeit.content.article.edit.browser.testing.BrowserTestCase):
block_type = 'raw'
def test_inline_form_saves_values(self):
self.get_article(with_empty_block=True)
b = self.browser
b.open('editable-body/blockname/@@edit-rawxml?s... | bsd-3-clause | -7,119,949,674,202,443,000 | 33.72093 | 82 | 0.616879 | false |
yeleman/snisi | snisi_maint/management/commands/update-cluster-from-std-csv.py | 1 | 3120 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
import os
from django.core.management.base import BaseCommand
from optparse import make_option
from py3compat import... | mit | -835,938,490,400,088,200 | 31.842105 | 73 | 0.501923 | false |
mbartling/TAMU_senior_design | Python/get_xbee_servo.py | 1 | 4195 | #! /usr/bin/env python
import serial
import sys
import os
import MySQLdb
from subprocess import call
from datetime import date
FORCE_WRITE = 0
HORIZONTAL = 0
VERTICAL = 90
today = date.today()
try:
address_array = []
# open data base
db = MySQLdb.connect(host="localhost", user="", passwd="team05", db="xbee_teensy"... | mit | -2,135,066,010,321,820,200 | 26.598684 | 164 | 0.615256 | false |
Syncleus/apex | src/apex/kiss/kiss_serial.py | 1 | 3486 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""KISS Core Classes."""
# These imports are for python3 compatibility inside python2
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import serial
import six
from apex.kiss import constants as... | apache-2.0 | -7,112,238,142,381,846,000 | 30.690909 | 95 | 0.626219 | false |
khertan/gedit_flake8 | gedit_flake8/__init__.py | 1 | 14861 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""gedit-flake8 : A plugin for gedit
to display error and warning from flake8."""
__author__ = "Benoît HERVIER"
__copyright__ = "Copyright 2012 " + __author__
__license__ = "GPLv3"
__version__ = "0.7.0"
__maintainer__ = "Benoît HERVIER"
__email__ = "khertan@khertan.net... | gpl-3.0 | 2,962,702,410,115,638,000 | 29.95625 | 77 | 0.553671 | false |
schocco/mds-web | mds_website/settings.py | 1 | 8687 | # -*- coding: utf-8 -*-
# Django settings for mds_website project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_DIR = os.path.dirname(__file__)
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.pos... | mit | -8,026,578,457,532,090,000 | 33.200787 | 127 | 0.687234 | false |
micjabbour/AndroidGuard-WebApp | AndroidGuard/models.py | 1 | 3073 | from . import db
from .config import AppConfig
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from sqlalchemy import desc
from itsdangerous import Serializer, BadSignature
class Location(db.Model):
id = db.Column(db.Integer... | unlicense | 256,992,587,173,349,120 | 31.691489 | 96 | 0.649528 | false |
noironetworks/neutron | neutron/db/rbac_db_mixin.py | 1 | 6467 | # Copyright (c) 2015 Mirantis, Inc.
# 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 requir... | apache-2.0 | 5,662,070,589,634,627,000 | 43.909722 | 79 | 0.613422 | false |
graik/biskit | archive_biskit2/Biskit/deprecated/ChainSeparator.py | 1 | 19962 | ## numpy-oldnumeric calls replaced by custom script; 09/06/2016
## Automatically adapted for numpy-oldnumeric Mar 26, 2007 by alter_code1.py
## class ChainSeperator:
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## This program is... | gpl-3.0 | -7,084,247,818,275,736,000 | 35.694853 | 612 | 0.551598 | false |
eyurtsev/FlowCytometryTools | FlowCytometryTools/core/docstring.py | 1 | 2522 | from __future__ import print_function
import string
from matplotlib import inspect
class FormatDict(dict):
"""Adapted from http://stackoverflow.com/questions/11283961/partial-string-formatting"""
def __missing__(self, key):
return "{" + key + "}"
class DocReplacer(object):
"""Decorator object... | mit | 8,740,734,155,669,062,000 | 30.135802 | 102 | 0.560666 | false |
simodalla/django-custom-email-user | setup.py | 1 | 1526 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import custom_email_user
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = custom_email_user.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("Y... | bsd-3-clause | -4,183,705,017,668,472,000 | 26.745455 | 66 | 0.610092 | false |
greggian/TapdIn | django/contrib/gis/tests/relatedapp/tests.py | 1 | 15132 | import os, unittest
from django.contrib.gis.geos import *
from django.contrib.gis.db.backend import SpatialBackend
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_spatialite
from django.conf import settings
from models im... | apache-2.0 | -1,316,497,183,138,970,000 | 48.272425 | 155 | 0.629923 | false |
ceph/ceph-deploy | docs/source/conf.py | 1 | 8511 | # -*- coding: utf-8 -*-
#
# ceph-deploy documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 21 09:32:42 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | mit | -1,458,653,863,186,704,100 | 30.757463 | 79 | 0.70873 | false |
fbradyirl/home-assistant | homeassistant/components/zha/core/channels/__init__.py | 1 | 12998 | """
Channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
from concurrent.futures import TimeoutError as Timeout
from enum import Enum
from functools import wraps
import logging
from random im... | apache-2.0 | 7,062,243,123,169,791,000 | 30.548544 | 88 | 0.585859 | false |
opencobra/cobrapy | src/cobra/test/test_sampling/test_optgp.py | 1 | 1936 | """Test functionalities of OptGPSampler."""
from typing import TYPE_CHECKING
import numpy as np
import pytest
from cobra.sampling import OptGPSampler
if TYPE_CHECKING:
from cobra import Model
from cobra.sampling import ACHRSampler
@pytest.fixture(scope="function")
def optgp(model: "Model") -> OptGPSample... | gpl-2.0 | 5,998,137,731,282,568,000 | 28.784615 | 84 | 0.673037 | false |
JustFixNYC/who-owns-what | wow/tests/conftest.py | 1 | 1024 | import pytest
import psycopg2
import dbtool
@pytest.fixture(scope='session')
def django_db_setup(django_db_setup, django_db_blocker):
from django.conf import settings
wow = settings.DATABASES['wow']
with django_db_blocker.unblock():
db = dbtool.DbContext(
host=wow['HOST'],
... | gpl-3.0 | -1,612,363,369,483,214,000 | 29.117647 | 70 | 0.553711 | false |
jemdwood/cs234_proj | pretrain-atari.py | 1 | 11760 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: train-atari.py
# Original Author (we/jemdwood@gmail.com editted): Yuxin Wu <ppwwyyxxc@gmail.com>
import numpy as np
import os
import sys
import time
import random
import uuid
import argparse
import multiprocessing
import threading
import cv2
import tensorflow as t... | mit | -4,611,083,490,077,505,500 | 36.571885 | 105 | 0.598469 | false |
borgaster/SpaceWarsEvolved | main.py | 1 | 16816 | import time
from animation import *
from asteroidField import *
from background import *
from loader import *
from physics import *
from player import *
from powerup import *
import pygame
from pygame.locals import *
from rotatingMenu_img import *
from spacemenu import *
from starField import *
# teclas dos jogadore... | mit | -5,715,220,330,823,720,000 | 33.178862 | 110 | 0.506185 | false |
kgullikson88/GSSP_Analyzer | gsspy/fitting.py | 1 | 19991 | from __future__ import print_function, division, absolute_import
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import subprocess
from astropy.io import fits
from astropy import time
import DataStructures
from ._utils import combine_orders, read_grid_points, ensure_dir
from .analyzer import ... | mit | -6,591,718,950,300,025,000 | 43.523385 | 97 | 0.516182 | false |
gussmith23/babble_bot | mangle.py | 1 | 3519 | import random
import configparser
from enum import Enum
import googletrans
# get config
config = configparser.ConfigParser()
config.read("babble_bot.cfg")
class MangleMethod(Enum):
flipflop = 1
straight = 2
manual = 3
def __str__(self):
if self == MangleMethod.flipflop:
return "f... | gpl-3.0 | 7,179,359,425,777,197,000 | 36.042105 | 90 | 0.539926 | false |
JuBra/GEMEditor | GEMEditor/database/ui/MetaboliteEntryDisplayWidget.py | 1 | 8059 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\MetaboliteEntryDisplayWidget.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MetaboliteEntryDisplayWidget(object):
def set... | gpl-3.0 | 1,646,370,832,036,293,600 | 61.960938 | 106 | 0.755056 | false |
kickstandproject/wildcard | wildcard/dashboards/settings/password/tests.py | 1 | 3365 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Centrin Data Systems Ltd.
#
# 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/LIC... | apache-2.0 | 1,859,885,490,701,099,800 | 38.588235 | 78 | 0.615156 | false |
highlander12rus/whatsupmoscow.ru | demon/main.py | 1 | 3580 | # -*- coding: utf-8 -*-
__author__ = 'meanwhile'
import ssl
import time
import socket
import sys
import logging
import vkontakte
import ProvaderStorage
import Constants
import FileWriter
import ProccessingResponce
import daemon
class VkParserDemon(daemon.Daemon):
def run(self):
#read code for method vk... | apache-2.0 | 35,188,145,789,785,108 | 34.58 | 119 | 0.540472 | false |
rmac75/mboxparser | mbox.py | 1 | 3399 | #!/usr/bin/python2
#--------------------------------
#Takes in mbox, spits out csv with email info and basic geolocation, plus other header fields.
#--------------------------------
#This product includes GeoLite2 data created by MaxMind, available from
#<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
i... | gpl-2.0 | -8,993,837,695,608,072,000 | 28.556522 | 204 | 0.657546 | false |
enriquecoronadozu/HMPy | src/borrar/modificar/hmpy.py | 1 | 6228 | #!/usr/bin/env python
"""@See preprocessed data
"""
from numpy import*
import matplotlib.pyplot as plt
from GestureModel import*
from Creator import*
from Classifier import*
def plotResults(gr_points,gr_sig, b_points,b_sig,name_model):
from scipy import linalg
import matplotlib.pyplot as plt
gr_points ... | gpl-3.0 | -8,411,053,304,711,118,000 | 25.278481 | 77 | 0.617213 | false |
jendrikseipp/rednotebook-elementary | rednotebook/util/markup.py | 1 | 16346 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
# Copyright (c) 2009 Jendrik Seipp
#
# RedNotebook 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 vers... | gpl-2.0 | 8,180,963,156,431,701,000 | 32.743802 | 107 | 0.578802 | false |
SportySpice/Collections | src/file/File.py | 1 | 3600 | import xbmc
import xbmcvfs
import Folder
import urllib
import urlparse
NAME_QUERY = 'fileName'
FOLDER_NAME_QUERY = 'folderName'
FOLDER_PATH_QUERY = 'folderPath'
class File(object):
def __init__(self, name, folder):
self.name = name
self.folder = folder
self.path = folder.fullpath
... | gpl-2.0 | 3,374,206,890,298,877,400 | 21.36646 | 72 | 0.556667 | false |
ZhangJun-GitHub/Cycle | dialogs.py | 1 | 20748 | #====================================================
# Cycle - calendar for women
# Distributed under GNU Public License
# Original author: Oleg S. Gints
# Maintainer: Matt Molyneaux (moggers87+git@moggers87.co.uk)
# Home page: http://moggers.co.uk/cgit/cycle.git/about
#==================================... | gpl-2.0 | 7,211,397,491,379,076,000 | 35.852575 | 100 | 0.502699 | false |
rolobio/sshm | sshm/main.py | 1 | 5215 | #! /usr/bin/env python3
"""
This module allows the console to use SSHM's functionality.
This module should only be run by the console!
"""
from __future__ import print_function
import sys
try: # pragma: no cover version specific
from lib import sshm
except ImportError: # pragma: no cover version specific
from... | gpl-2.0 | 6,128,735,719,583,437,000 | 33.536424 | 135 | 0.595781 | false |
jmathai/elodie | elodie/tests/config_test.py | 1 | 3912 | from __future__ import absolute_import
# Project imports
import os
import sys
import unittest
from mock import patch
from tempfile import gettempdir
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))))
from elodie import constants
from elodie.config im... | apache-2.0 | 2,237,664,676,632,507,000 | 28.862595 | 114 | 0.652607 | false |
pthatcher/psync | src/history/__init__.py | 1 | 1996 | # Copyright (c) 2011, Peter Thatcher
# 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 conditi... | bsd-3-clause | -8,313,958,480,378,426,000 | 54.444444 | 80 | 0.784068 | false |
dparaujo/projeto | app_inscricoes/questionarios/migrations/0002_auto_20170220_2126.py | 1 | 1224 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-02-21 00:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questionarios', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | gpl-3.0 | -3,572,128,225,930,525,000 | 36.090909 | 237 | 0.588235 | false |
crespyl/pcre2 | maint/MultiStage2.py | 1 | 23077 | #! /usr/bin/python
# Multistage table builder
# (c) Peter Kankowski, 2008
##############################################################################
# This script was submitted to the PCRE project by Peter Kankowski as part of
# the upgrading of Unicode property support. The new code speeds up property
# matching... | gpl-3.0 | 2,237,033,308,509,130,800 | 41.894052 | 143 | 0.604325 | false |
leebird/legonlp | annotation/align.py | 1 | 2062 | # -*- coding: utf-8 -*-
import os
import sys
import re
import codecs
from alignment import Alignment,Hirschberg
from readers import AnnParser
from writers import AnnWriter
writer = AnnWriter()
def get_phrase(text):
p = re.compile(ur'[a-zA-Z]+|[0-9]+|\s+|[.,;!\(\)]+')
lista = []
pre = 0
for m in p.fin... | gpl-2.0 | -4,057,926,957,120,265,700 | 27.638889 | 76 | 0.548497 | false |
khalim19/gimp-plugin-export-layers | export_layers/tests/test_placeholders.py | 1 | 2548 | # -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2019 khalim19 <khalim19@gmail.com>
#
# Export Layers 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 t... | gpl-3.0 | -1,541,752,391,555,362,800 | 35.927536 | 95 | 0.730377 | false |
dmych/cn | utils.py | 1 | 3805 | # This file is part of Coffee Notes project
#
# Coffee Notes is a crossplatform note-taking application
# inspired by Notational Velocity.
# <https://github.com/dmych/cn>
#
# Copyright (c) Dmitri Brechalov, 2011
#
# Coffee Notes is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | gpl-3.0 | -7,858,388,737,307,353,000 | 26.178571 | 71 | 0.578975 | false |
cloudburst/libheap | libheap/pydbg/pygdbpython.py | 1 | 4894 | import sys
from functools import wraps
from libheap.frontend.printutils import print_error
try:
import gdb
except ImportError:
print("Not running inside of GDB, exiting...")
sys.exit()
def gdb_is_running(f):
"decorator to make sure gdb is running"
@wraps(f)
def _gdb_is_running(*args, **kwa... | mit | -2,558,321,440,610,970,000 | 29.397516 | 76 | 0.53964 | false |
Panos512/inspire-next | inspirehep/modules/records/receivers.py | 1 | 12132 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015, 2016 CERN.
#
# INSPIRE 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 optio... | gpl-2.0 | -3,472,888,303,116,580,000 | 40.406143 | 105 | 0.585889 | false |
so-sure/tagged-route53 | tagged-route53.py | 1 | 10149 | #!/usr/bin/python
import requests
import boto3
import argparse
class Dns(object):
# Default constructor of the class.
def __init__(self):
self.ec2_client = boto3.client('ec2')
self.dns_client = boto3.client('route53')
self.role = None
self.env = None
self.instance_id = ... | apache-2.0 | -2,124,829,672,126,975,700 | 38.034615 | 185 | 0.549611 | false |
OpenBfS/dokpool-plone | Plone/src/docpool.config/docpool/config/local/elan_de.py | 1 | 8161 | # -*- coding: utf-8 -*-
from ..utils import set_local_roles
from datetime import datetime
from docpool.base.content.documentpool import APPLICATIONS_KEY
from docpool.config import _
from docpool.config.general.elan import connectTypesAndCategories
from docpool.config.local.base import CONTENT_AREA
from docpool.config.u... | gpl-3.0 | 5,981,266,725,301,240,000 | 30.631783 | 107 | 0.62039 | false |
diegojromerolopez/djanban | src/djanban/apps/password_reseter/email_sender.py | 1 | 1645 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from crequest.middleware import CrequestMiddleware
from django.core.mail import send_mail
from django.template.loader import get_template
from django.conf import settings
from django.urls import reverse
def send_password_request_link(password_request, u... | mit | -3,453,166,151,156,797,000 | 43.459459 | 112 | 0.743465 | false |
seanxwzhang/LeetCode | 148 Sort List/solution.py | 1 | 1263 | #! /usr/bin/env python
# Sort a linked list in O(n log n) time using constant space complexity.
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
# a merge sort implementation
class Solution(object):
def sortList(self, head... | mit | 6,358,962,998,563,687,000 | 33.162162 | 72 | 0.568488 | false |
crazcalm/chat-server | server.py | 1 | 11418 | import help_text
import asyncio
import argparse
import logging
from random import randint
clients = []
class SimpleChatClientProtocol(asyncio.Protocol):
"""
This class is the heart of the Chat Server. For each client that
connects to the server, an instance of this class is created. These
instances ... | mit | 894,940,125,265,857,700 | 32.881306 | 79 | 0.532055 | false |
jonwright/ImageD11 | ImageD11/sparseframe.py | 1 | 10124 |
from __future__ import print_function, division
import time, sys
import h5py, scipy.sparse, numpy as np, pylab as pl
from ImageD11 import cImageD11
# see also sandbox/harvest_pixels.py
NAMES = {
"filename" : "original filename used to create a sparse frame",
"intensity" : "corrected pixel values",
"nla... | gpl-2.0 | 6,007,533,981,669,690,000 | 34.398601 | 86 | 0.55077 | false |
nksheridan/elephantAI | test_Deter_as_Server_and_Play_Audio.py | 1 | 1414 | # DETER DEVICE
# this is test code for putting the deter device into server mode, and getting a message via bluetooth from the detection device, and
# then going ahead and playing scare sounds. You need to determine your MAC address. It is for the server in this case, so the MAC address
# of the deter device. You also ... | mit | 6,251,672,956,260,858,000 | 27.857143 | 138 | 0.737624 | false |
tyler-cromwell/Acid | client.py | 1 | 2439 | #!/usr/bin/python3
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The MIT License (MIT)
Copyright (c) 2016 Tyler Cromwell
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 th... | mit | -3,025,028,006,687,815,700 | 30.675325 | 80 | 0.621976 | false |
xenserver/auto-cert-kit | autocertkit/status.py | 1 | 3793 | #!/usr/bin/python
# Copyright (c) Citrix 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:
#
# * Redistributions of source code must retain the above
# copyright notice, this l... | bsd-2-clause | 7,740,039,314,793,611,000 | 32.866071 | 125 | 0.660691 | false |
metwit/django-fulmine | fulmine/forms.py | 1 | 2406 | from django import forms
from django.core.exceptions import ValidationError
from fulmine.models import parse_scope
class SeparatedValuesField(forms.CharField):
def __init__(self, *args, **kwargs):
self.separator = kwargs.pop('separator', ' ')
super(SeparatedValuesField, self).__init__(*args, **kwa... | bsd-3-clause | -1,758,042,214,765,443,600 | 24.870968 | 71 | 0.618869 | false |
gitcoinco/web | app/marketing/management/commands/no_applicants_email.py | 1 | 1922 | '''
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | agpl-3.0 | 4,106,764,754,830,823,400 | 39.041667 | 132 | 0.689386 | false |
kwikteam/klusta | klusta/kwik/tests/test_model.py | 1 | 12258 | # -*- coding: utf-8 -*-
"""Tests of Kwik file opening routines."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
import numpy as np
from numpy.testing import assert_array_... | bsd-3-clause | 1,594,561,297,690,360,600 | 32.400545 | 79 | 0.556535 | false |
MikeLing/treeherder | treeherder/log_parser/parsers.py | 1 | 19774 | import json
import logging
import re
from HTMLParser import HTMLParser
import jsonschema
from django.conf import settings
from treeherder.etl.buildbot import RESULT_DICT
logger = logging.getLogger(__name__)
class ParserBase(object):
"""
Base class for all parsers.
"""
def __init__(self, name):
... | mpl-2.0 | 743,858,351,912,040,100 | 38.469062 | 105 | 0.557904 | false |
karlwithak/nowradio | nowradio/stationInfoUpdater.py | 1 | 1896 | import requests
import ourUtils
from dbManager import Queries, get_connection
# This program goes through the list of stations in the db and updates information such as
# current listeners, max listeners, peak listeners, status(up or not)
def worker(id_url_list, connection):
cur = connection.cursor()
for ... | mit | 3,592,722,863,100,787,000 | 34.111111 | 90 | 0.533228 | false |
dplepage/logbook | tests/test_logbook.py | 1 | 59981 | # -*- coding: utf-8 -*-
from .utils import (
LogbookTestCase,
activate_via_push_pop,
activate_via_with_statement,
capturing_stderr_context,
get_total_delta_seconds,
make_fake_mail_handler,
missing,
require_module,
require_py3,
)
from contextlib import closing, contextmanager
from dat... | bsd-3-clause | 4,229,163,377,748,149,000 | 39.432906 | 162 | 0.589857 | false |
scavallero/mydomus | auth.py | 1 | 3792 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MyDomus - Polling Service
# Copyright (c) 2016 Salvatore Cavallero (salvatoe.cavallero@gmail.com)
# https://github.com/scavallero/mydomus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | gpl-3.0 | -3,929,618,149,276,053,000 | 26.882353 | 86 | 0.531909 | false |
arunkgupta/gramps | gramps/gui/merge/__init__.py | 1 | 1096 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eithe... | gpl-2.0 | 1,824,475,253,137,855,000 | 30.314286 | 75 | 0.751825 | false |
Stanford-Online/edx-analytics-data-api | analytics_data_api/v0/views/__init__.py | 1 | 10029 | from itertools import groupby
from django.db import models
from django.db.models import Q
from django.utils import timezone
from rest_framework import generics, serializers
from opaque_keys.edx.keys import CourseKey
from analytics_data_api.v0.exceptions import CourseNotSpecifiedError
from analytics_data_api.v0.view... | agpl-3.0 | 8,010,458,603,060,841,000 | 36.561798 | 109 | 0.626683 | false |
vvoZokk/dnn | dnn_project/generate_protos.py | 1 | 4557 | #!/usr/bin/env python
import os
import argparse
import re
from collections import defaultdict
import sys
KNOWN_TYPES = {
"double" : "double",
"int" : "int32",
"size_t" : "uint32",
"float" : "float",
"string" : "string",
"bool" : "bool",
"complex<double>" : "double",
... | mit | 8,567,659,111,309,439,000 | 43.242718 | 126 | 0.432521 | false |
yasserglez/pytiger2c | packages/pytiger2c/dot.py | 1 | 2786 | # -*- coding: utf-8 -*-
"""
Clases utilizadas en la generación de un archivo Graphviz DOT con el
árbol de sintáxis abstracta creado a partir de un programa Tiger.
"""
class DotGenerator(object):
"""
Clase utilizada para la generación de grafos en formato Graphviz DOT.
"""
def __init__(self):
... | mit | -712,239,282,687,048,000 | 33.575 | 74 | 0.574476 | false |
CLVsol/odoo_addons | clv_medicament/clv_annotation/clv_annotation.py | 1 | 2262 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 | 2,606,340,208,862,698,500 | 52.857143 | 80 | 0.396994 | false |
dstanek/keystone | keystone/tests/unit/test_backend_sql.py | 1 | 40921 | # -*- coding: utf-8 -*-
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 | -6,386,833,707,063,816,000 | 40.084337 | 79 | 0.584751 | false |
Arzaroth/virtualnetwork | network/mapParser.py | 1 | 4727 | #!/usr/bin/python3.3 -O
from pyrser import grammar,meta
from pyrser.directives import ignore
from network import Host, Router
import sys
def insensitiveCase(s):
return "[" + " ".join("['" + "'|'".join(x) + "']" for x in map((lambda each: [each.lower(), each.upper()]), s)) + "]"
class MapParser(grammar.Grammar):
... | gpl-3.0 | 5,205,902,679,381,287,000 | 31.826389 | 121 | 0.533108 | false |
qma/pants | src/python/pants/backend/jvm/tasks/resources_task.py | 1 | 3335 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | apache-2.0 | 8,281,013,611,547,203,000 | 37.333333 | 99 | 0.704648 | false |
opennode/waldur-mastermind | src/waldur_core/structure/managers.py | 1 | 4844 | from django.db import models
from waldur_core.core.managers import GenericKeyMixin
def get_permission_subquery(permissions, user):
subquery = models.Q()
for entity in ('customer', 'project'):
path = getattr(permissions, '%s_path' % entity, None)
if not path:
continue
if p... | mit | 4,239,172,662,321,143,000 | 31.293333 | 94 | 0.579067 | false |
pytorch/fairseq | tests/test_online_backtranslation.py | 1 | 7650 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import tempfile
import unittest
from pathlib import Path
from typing import Any, Dict, Sequence
import fairseq.data.indexed_dataset as indexe... | mit | 6,307,616,552,569,338,000 | 36.135922 | 86 | 0.570458 | false |
mkocka/galaxytea | modeling/domcek/plots.py | 1 | 4294 | import matplotlib.pyplot as plt
from numpy import *
###List of variables
# r_in [10**10 cm] innder radius
# r_out [10**10 cm] outer radius
# step [10**10 cm] step of plot
# alfa [] parameter of accretion
# M_16 [10**16 g.s**(-1)] accretion flow
# m_1 [solar mass] mass of compact object
# R_hv [10**1... | mit | 4,655,926,774,987,794,000 | 29.671429 | 109 | 0.608058 | false |
MobSF/Mobile-Security-Framework-MobSF | mobsf/StaticAnalyzer/views/ios/view_source.py | 1 | 5000 | # -*- coding: utf_8 -*-
"""iOS View Source."""
import io
import json
import logging
import ntpath
import os
from pathlib import Path
import biplist
from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils.html import escape
from mobsf.MobSF.f... | gpl-3.0 | 7,384,499,573,915,808,000 | 31.258065 | 72 | 0.4996 | false |
alexandrevicenzi/pycompat | tests/test.py | 1 | 2225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# These tests run only under Linux and Python 2.x +
# This is the Travis CI environment.
#
from pycompat import python as py
from pycompat import system
import sys
import unittest
class TestPyCompat(unittest.TestCase):
def test_python_is_64bits(self):
se... | mit | -7,611,998,995,524,017,000 | 27.525641 | 100 | 0.649888 | false |
mitsuhiko/zine | zine/utils/exceptions.py | 1 | 1632 | # -*- coding: utf-8 -*-
"""
zine.utils.exceptions
~~~~~~~~~~~~~~~~~~~~~
Exception utility module.
:copyright: (c) 2010 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from zine.i18n import _
class ZineException(Exception):
"""Baseclass for all... | bsd-3-clause | -1,362,887,440,807,812,400 | 24.5 | 72 | 0.579657 | false |
kasperschmidt/TDOSE | tdose_extract_spectra.py | 1 | 43824 | # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
import numpy as np
import sys
import astropy.io.fits as afits
import collections
import tdose_utilities as tu
import tdose_extract_spectra as tes
import tdose_build_mock_cube as tbmc
import pdb
import scipy.ndi... | mit | 2,141,411,611,090,954,000 | 50.925355 | 143 | 0.5421 | false |
bmcfee/gordon | scripts/mbrainz_import.py | 1 | 6643 | #! /usr/bin/env python
# Copyright (C) 2010 Douglas Eck
#
# This file is part of Gordon.
#
# Gordon 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 l... | gpl-3.0 | 8,949,096,639,798,875,000 | 33.780105 | 113 | 0.646094 | false |
tboyce021/home-assistant | tests/components/config/test_automation.py | 1 | 5030 | """Test Automation config panel."""
import json
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from tests.async_mock import patch
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa
async def test_get_device_config(hass, hass_client)... | apache-2.0 | 774,325,679,850,653,300 | 29.301205 | 87 | 0.57495 | false |
mbeyeler/pulse2percept | examples/implants/plot_custom_electrode_array.py | 1 | 6434 | """
============================================================================
Creating your own electrode array
============================================================================
This example shows how to create a new
:py:class:`~pulse2percept.implants.ElectrodeArray` object.
As the base class for all el... | bsd-3-clause | 1,638,808,666,672,022,800 | 35.765714 | 84 | 0.614081 | false |
asterix135/whoshouldivotefor | explorer/migrations/0008_auto_20170627_0253.py | 1 | 1741 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-27 06:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('explorer', '0007_auto_20170626_0543'),
]
operation... | mit | 2,262,988,717,029,549,800 | 34.530612 | 138 | 0.589316 | false |
Geoportail-Luxembourg/geoportailv3 | geoportal/geoportailv3_geoportal/scripts/db2es.py | 1 | 3233 | # -*- coding: utf-8 -*-
from pyramid.paster import bootstrap
import psycopg2
from psycopg2.extras import DictCursor
import sys
import getopt
import json
from elasticsearch import helpers
from elasticsearch.helpers import BulkIndexError
from elasticsearch.exceptions import ConnectionTimeout
from geoportailv3_geoportal.... | mit | 1,212,416,682,987,955,200 | 28.390909 | 91 | 0.534488 | false |
dlsun/symbulate | symbulate/index_sets.py | 1 | 1353 | import numbers
class IndexSet(object):
def __init__(self):
return
def __getitem__(self, t):
if t in self:
return t
else:
raise KeyError("Time %.2f not in index set." % t)
def __contains__(self, value):
return False
def __eq__(self, other):
... | mit | 5,717,099,780,918,022,000 | 18.328571 | 61 | 0.503326 | false |
regisf/Strawberry | strawberrylib/blueprints/__init__.py | 1 | 1171 | # -*- coding: utf-8 -*-
# Strawberry Blog Engine
#
# Copyright (c) 2014 Regis FLORET
#
# 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 ri... | mit | -8,769,378,438,249,852,000 | 47.791667 | 80 | 0.766866 | false |
MungoRae/home-assistant | homeassistant/components/ecobee.py | 1 | 3654 | """
Support for Ecobee.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ecobee/
"""
import logging
import os
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import ... | apache-2.0 | 4,711,755,110,755,043,000 | 28.467742 | 76 | 0.681445 | false |
sfischer13/python-arpa | tests/test_model_base.py | 1 | 2958 | import arpa
from arpa.models.base import ARPAModel
from arpa.models.simple import ARPAModelSimple
import pytest
from test_arpa import PARSERS
from test_arpa import TEST_ARPA
def test_manual_log_p_unk():
lm = arpa.loadf(TEST_ARPA)[0]
assert lm.log_p('UnladenSwallow') == -1.995635
def test_manual_p():
l... | mit | -8,238,129,910,528,234,000 | 23.245902 | 60 | 0.613252 | false |
MPBAUnofficial/cmsplugin_image_gallery | cmsplugin_image_gallery/models.py | 1 | 4086 | import threading
from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from inline_ordering.models import Orderable
from filer.fields.image import FilerImageField
from django.core.exceptions import ValidationError
import utils
localdata = threading.loca... | bsd-2-clause | -7,195,980,818,986,026,000 | 37.186916 | 117 | 0.453255 | false |
eyzhou123/python-games | tetris.py | 1 | 10241 | #tetris.py
from Tkinter import *
import random
def tetrisMousePressed(canvas,event):
tetrisRedrawAll(canvas)
def tetrisKeyPressed(canvas,event):
if event.keysym == "r":
tetrisInit(canvas)
if (canvas.data.isTetrisGameOver == False):
if event.keysym == "Left":
moveFallingPiece(c... | mit | 5,614,054,969,684,136,000 | 36.375912 | 91 | 0.671224 | false |
KeserOner/where-artists-share | was/artists/models.py | 1 | 1280 | from django.contrib.auth.models import User
from django.db import models
from django.dispatch.dispatcher import receiver
class Artists(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
artist_image = models.ImageField(
verbose_name="Artist's profile image",
null=True,... | mit | 6,011,123,594,670,129,000 | 25.666667 | 83 | 0.646094 | false |
zinid/mrim | src/protocol.py | 1 | 19357 | from mmptypes import *
import utils
import UserDict
import cStringIO
import socket
import struct
import email
from email.Utils import parsedate
wp_request = {}
wp_request_reversed = {}
for k,v in [(key, locals()[key]) for key in locals().keys() if key.startswith('MRIM_CS_WP_REQUEST_PARAM')]:
wp_request[v] = k
for ... | gpl-3.0 | -3,714,155,334,947,474,000 | 26.613409 | 107 | 0.631916 | false |
gw280/skia | tools/test_pictures.py | 1 | 6084 | '''
Compares the rendererings of serialized SkPictures to expected images.
Launch with --help to see more information.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import ... | bsd-3-clause | -5,432,955,374,800,524,000 | 33.179775 | 80 | 0.609796 | false |
cfhamlet/os-urlpattern | src/os_urlpattern/pattern_maker.py | 1 | 4225 | """Pattern clustering procedure APIs.
"""
from .compat import itervalues
from .config import get_default_config
from .definition import BasePattern
from .parse_utils import EMPTY_PARSED_PIECE, ParsedPiece
from .parser import fuzzy_digest, parse
from .pattern_cluster import cluster
from .piece_pattern_node import PieceP... | mit | -7,779,818,026,958,898,000 | 32.531746 | 74 | 0.586746 | false |
nosix/PyCraft | src/pycraft/service/composite/entity/monster.py | 1 | 1206 | # -*- coding: utf8 -*-
from pycraft.service.const import EntityType
from pycraft.service.primitive.geometry import Size
from .base import MobEntity
from .player import PlayerEntity
class MonsterEntity(MobEntity):
def has_hostile(self, entity):
return isinstance(entity, PlayerEntity)
class Zombie(M... | lgpl-3.0 | 2,602,586,687,267,260,000 | 18.451613 | 51 | 0.64262 | false |
diofant/diofant | diofant/core/function.py | 1 | 77992 | """
There are three types of functions implemented in Diofant:
1) defined functions (in the sense that they can be evaluated) like
exp or sin; they have a name and a body:
f = exp
2) undefined function which have a name but no body. Undefined
functions can be defined using a Function c... | bsd-3-clause | -4,774,232,828,554,274,000 | 32.3727 | 107 | 0.553057 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.