repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QAbstractSpinBox.py | 1 | 9176 | # encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QWidget import QWidget
class QAbstractSpinBox(QWidget):
""" QAbstractSpinBox(QWidget parent=None) """
d... | gpl-2.0 | 770,578,344,612,015,000 | 36.761317 | 113 | 0.650065 | false | 4.314057 | false | false | false |
spencerpomme/coconuts-on-fire | person.py | 1 | 1237 | from classtools import AttrDisplay
class Person(AttrDisplay):
'''
Create and process person records
'''
def __init__(self, name, job=None, pay=0):
self.name = name
self.job = job
self.pay = pay
def lastName(self):
return self.name.split()[-1]
def giveRaise(self... | apache-2.0 | -7,894,379,898,848,833,000 | 21.089286 | 52 | 0.587712 | false | 3.670623 | false | false | false |
octopicorn/cloudbrain | cloudbrain/connectors/MockConnector.py | 1 | 1165 | import time
import random
from cloudbrain.connectors.ConnectorInterface import Connector
from cloudbrain.utils.metadata_info import get_num_channels
class MockConnector(Connector):
def __init__(self, publishers, buffer_size, device_name, device_port='mock_port', device_mac=None):
"""
:return:
"""
... | agpl-3.0 | -3,348,609,461,343,070,700 | 22.77551 | 135 | 0.678112 | false | 3.782468 | false | false | false |
insequent/quark | quark/cache/security_groups_client.py | 1 | 8108 | # Copyright 2014 Openstack Foundation
# 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 requ... | apache-2.0 | 9,148,292,089,688,650,000 | 37.980769 | 79 | 0.585101 | false | 4.157949 | false | false | false |
maaaks/andreas | andreas/db/model.py | 1 | 3293 | from typing import Dict, List, Optional, Tuple, Type
from playhouse import signals
from andreas.db.database import db
class Model(signals.Model):
class Meta:
database = db
schema = 'andreas'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... | mit | 6,112,106,448,212,380,000 | 37.302326 | 117 | 0.580929 | false | 4.189567 | false | false | false |
enavarro222/bblamp | webserver.py | 1 | 5293 | #!/usr/bin/python
#-*- coding:utf-8 -*-
import os
import sys
import json
# Make sure your gevent version is >= 1.0
import gevent
from gevent.wsgi import WSGIServer
from gevent.queue import Queue
from flask import Flask, Response
from flask import render_template, jsonify
from utils import ServerSentEvent
from api i... | agpl-3.0 | 1,784,097,008,131,728,100 | 29.595376 | 108 | 0.536936 | false | 3.958863 | false | false | false |
jantman/awslimitchecker | awslimitchecker/tests/test_utils.py | 1 | 19953 | """
awslimitchecker/tests/test_utils.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
##############################################################################
Copyright 2015-2018 Jason Antman <jason@jasonantman.com>
This file is part of awslimitchecker, al... | agpl-3.0 | 8,122,354,500,113,535,000 | 30.225352 | 79 | 0.481481 | false | 3.67053 | true | false | false |
DOAJ/doaj | portality/forms/application_processors.py | 1 | 46290 | import uuid
from datetime import datetime
import portality.notifications.application_emails as emails
from portality.core import app
from portality import models, constants, app_email
from portality.lib.formulaic import FormProcessor
from portality.ui.messages import Messages
from portality.crosswalks.application_form... | apache-2.0 | 428,683,396,306,092,600 | 47.62395 | 241 | 0.631475 | false | 4.450106 | false | false | false |
brainix/social-butterfly | channels.py | 1 | 6608 | #-----------------------------------------------------------------------------#
# channels.py #
# #
# Copyright (c) 2010-2012, Code A La Mode, original authors. #
... | gpl-3.0 | -4,261,593,968,478,345,000 | 45.20979 | 79 | 0.544492 | false | 4.730136 | false | false | false |
eykd/fuzzy-octo-bear | tests/test_map_loader.py | 1 | 1227 | from unittest import TestCase
from ensure import ensure
from path import path
from fuzzy.map import load_game_map
from fuzzy.rooms import Room
from fuzzy.exits import Exit
PATH = path(__file__).abspath().dirname()
class MapLoaderTests(TestCase):
def setUp(self):
self.filename = PATH / 'rooms.yaml'
... | gpl-2.0 | -8,923,510,156,966,951,000 | 29.675 | 64 | 0.647107 | false | 3.05985 | false | false | false |
adamsd5/yavalath | memorycontrol.py | 1 | 4959 | """This holds a routine for restricting the current process memory on Windows."""
import multiprocessing
import ctypes
def set_memory_limit(memory_limit):
"""Creates a new unnamed job object and assigns the current process to it.
The job object will have the given memory limit in bytes: the given process
... | mit | -2,975,399,561,159,198,700 | 39.647541 | 98 | 0.626336 | false | 4.125624 | false | false | false |
j-dasilva/COMP4350 | apartment/messaging/message.py | 1 | 1169 | from django.conf import settings
import time
class Message(object):
def __init__(self, *args, **kwargs):
vals = self.process_args(args, kwargs)
self.sender = vals['sender']
self.recipient = vals['recipient']
self.urgency = int(vals['urgency'])
self.content = vals['content']... | gpl-2.0 | 587,018,529,972,457,200 | 29 | 104 | 0.551754 | false | 4.220217 | false | false | false |
nature-python/youcai-contest | application/utils/cipherutils.py | 1 | 1513 | #!/usr/bin/python
#encoding:utf-8
#
#author:xin.xin
#since:14-5-19上午10:35
#
#
from binascii import b2a_hex, a2b_hex
from Crypto.Cipher import AES
from application import app
class CipherUtils(object):
#加密函数,如果text不足16位就用空格补足为16位,
#如果大于16当时不是16的倍数,那就补足为16的倍数。
@staticmethod
def encrypt(text):
... | apache-2.0 | 8,200,681,271,139,766,000 | 24.5625 | 94 | 0.612062 | false | 2.263838 | false | false | false |
gobstones/PyGobstones | pygobstones/gui/views/gobstonesMain.py | 1 | 21498 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gobstonesMain.ui'
#
# Created by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import sys
import resources
sys.path.append('..')
from pygobstones.commons.i18n import ... | gpl-3.0 | 4,872,066,273,332,599,000 | 54.123077 | 139 | 0.651084 | false | 4.150193 | false | false | false |
davy39/eric | Helpviewer/AdBlock/AdBlockSubscription.py | 1 | 24766 | # -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the AdBlock subscription class.
"""
from __future__ import unicode_literals
import os
import re
import hashlib
import base64
from PyQt5.QtCore import pyqtSignal, Qt, QObject, QByteArray, QDateT... | gpl-3.0 | -8,359,129,584,118,204,000 | 33.493036 | 78 | 0.519503 | false | 4.956174 | false | false | false |
ariegg/webiopi-drivers | chips/sensor/ina219/ina219.py | 1 | 22877 | # Copyright 2017 Andreas Riegg - t-h-i-n-x.net
#
# 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 ap... | apache-2.0 | -8,523,589,605,352,649,000 | 42.856863 | 147 | 0.604362 | false | 3.776952 | true | false | false |
mhorn71/StarbaseMini | instument_builder/builder.py | 1 | 1671 | __author__ = 'mark'
# StarbaseMini Staribus/Starinet Client for the British Astronomical Association Staribus Protocol
# Copyright (C) 2015 Mark Horn
#
# This file is part of StarbaseMini.
#
# StarbaseMini is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-2.0 | -8,834,807,194,172,752,000 | 32.44 | 98 | 0.692998 | false | 4.055825 | false | false | false |
mganeva/mantid | Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLReductionTest.py | 1 | 6050 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | gpl-3.0 | 7,514,569,693,448,580,000 | 45.899225 | 121 | 0.652231 | false | 3.395062 | true | false | false |
openstack/tempest | tempest/cmd/cleanup_service.py | 1 | 39207 | # Copyright 2015 Dell Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 | -4,164,139,727,326,428,000 | 33.635159 | 79 | 0.578264 | false | 4.240887 | false | false | false |
haihala/modman | cli.py | 1 | 12445 | #!/usr/bin/env python3
try:
import requests
except ImportError:
print("It looks like requests is not installed.")
print("Try: pip3 install requests")
exit(1)
import os
import sys
import subprocess
from getpass import getpass
import mod_manager
from mod_manager import server
from mod_manager.exception... | mit | 3,436,079,789,954,197,000 | 32.910082 | 179 | 0.538931 | false | 4.104551 | false | false | false |
awesto/django-shop | shop/transition.py | 1 | 3695 | from urllib.parse import urlparse
from django.contrib.auth.models import AnonymousUser
from django.db import models
from django.http.request import HttpRequest
from post_office import mail
from post_office.models import EmailTemplate
from shop.conf import app_settings
from shop.models.order import BaseOrder
from shop.... | bsd-3-clause | 40,270,448,760,447,544 | 44.617284 | 107 | 0.689851 | false | 4.39881 | false | false | false |
UKPLab/semeval2017-scienceie | code/convNet.py | 1 | 7292 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from extras import VSM, read_and_map
from representation import VeryStupidCBOWMapper, CharMapper
import sys, numpy as np,os
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_sup... | apache-2.0 | 7,097,266,528,719,987,000 | 31.995475 | 124 | 0.623149 | false | 3.310032 | false | false | false |
JaneliaSciComp/Neuroptikon | Source/library/library.py | 1 | 1804 | # Copyright (c) 2010 Howard Hughes Medical Institute.
# All rights reserved.
# Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms.
# http://license.janelia.org/license/jfrc_copyright_1_1.html
from library_item import LibraryItem
from library_frame import LibraryFrame
from pydispatc... | bsd-3-clause | 8,292,867,889,160,056,000 | 39.088889 | 177 | 0.616408 | false | 4.254717 | false | false | false |
3bot/3bot-hook | threebot_hook/models.py | 1 | 1773 | # -*- coding: utf-8 -*-
from django import dispatch
from django.contrib.sites.models import Site
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from threebot.models imp... | bsd-3-clause | -1,663,933,699,646,561,500 | 34.46 | 145 | 0.685279 | false | 3.524851 | false | false | false |
borg-project/borg | borg/tools/get_features.py | 1 | 2297 | """@author: Bryan Silverthorn <bcs@cargo-cult.org>"""
import os.path
import csv
import borg
import borg.distributors
logger = borg.get_logger(__name__, default_level = "INFO")
def features_for_path(domain, task_path):
# bring back relevant globals
import os.path
import borg
logger = borg.get_logger(... | mit | 5,014,328,690,648,508,000 | 28.831169 | 86 | 0.610361 | false | 3.686998 | false | false | false |
qsnake/gpaw | config.py | 1 | 17421 | # Copyright (C) 2006 CSC-Scientific Computing Ltd.
# Please see the accompanying LICENSE file for further information.
import os
import sys
import re
import distutils.util
from distutils.sysconfig import get_config_var, get_config_vars
from distutils.command.config import config
from glob import glob
from os.path imp... | gpl-3.0 | 1,044,954,531,353,206,300 | 33.772455 | 93 | 0.508983 | false | 3.680752 | true | false | false |
jamesabel/osnap | osnap/osnapy.py | 1 | 2772 |
import argparse
from osnap import default_python_version, get_logger, init_logger_from_args, __application_name__
import osnap.osnapy_win
import osnap.osnapy_mac
import osnap.util
LOGGER = get_logger(__application_name__)
def make_osnapy(
python_version,
application_name = None,
clea... | mit | 8,053,201,480,406,695,000 | 40.253731 | 141 | 0.643632 | false | 3.81768 | false | false | false |
oblank/pydjango-froum | xp/settings.py | 1 | 7211 | # coding: utf-8
# Django settings for xp project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME'... | mit | -2,053,450,417,403,817,500 | 33.014706 | 136 | 0.682951 | false | 3.309013 | false | false | false |
aldanor/blox | blox/utils.py | 1 | 1944 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import six
import struct
import functools
import numpy as np
try:
import ujson as json
json_dumps = json.dumps
except ImportError:
import json
json_dumps = functools.partial(json.dumps, separators=',:')
def flatten_dtype(dtype):
dty... | mit | 1,654,692,354,838,072,600 | 28.014925 | 85 | 0.629115 | false | 3.471429 | false | false | false |
basimr/snoop-dogg-number | filter_graph_by_sdn.py | 1 | 1253 | #!/usr/bin/python2
# TODO: Add description.
import psycopg2
import networkx as nx
# TODO: Create a class for storing artists' SDN and path to avoid doing this.
SDN = 0
PATH = 1
# Load graph from disk
graph = nx.read_gexf("graph/sdn-unweighted.gexf")
# Initialize dictionary with the Snoop Dogg as the base case
arti... | mit | 2,550,880,907,891,530,000 | 29.560976 | 91 | 0.676776 | false | 2.887097 | false | false | false |
kurokid/connme | connme/connme.py | 1 | 2726 | #!/usr/bin/env python2
import sip
sip.setapi('QString', 2)
from PyQt4 import QtGui, QtCore, QtNetwork
from connmeMain import connme
import sys,os
class SingleApplicationWithMessaging(QtGui.QApplication):
messageAvailable = QtCore.pyqtSignal(object)
def __init__(self, argv, key):
QtGui.QApplication._... | gpl-3.0 | -4,815,941,542,223,123,000 | 32.256098 | 73 | 0.591709 | false | 3.916667 | false | false | false |
BaseBot/Triangula | src/python/triangula/navigation.py | 1 | 1101 | class TaskWaypoint:
"""
Consists of a target Pose defining a location and orientation, and a Task which should be run when the robot reaches
the target position. The task can be None, in which case the robot won't attempt to do anything at the target point.
"""
def __init__(self, pose, task=None, s... | apache-2.0 | -6,752,106,085,634,482,000 | 46.913043 | 120 | 0.656676 | false | 4.493878 | false | false | false |
ivanlai/Kaggle-Planet-Amazon | PyTorch_models.py | 1 | 5862 | # Reference and ideas from http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
from __future__ import print_function
import torch.nn as nn
import torchvision.models as models
import warnings
warnings.filterwarnings("ignore")
##################################################################
## ... | mit | 1,453,137,191,912,408,600 | 27.740196 | 106 | 0.624019 | false | 3.75048 | false | false | false |
trozet/python-tackerclient | tackerclient/shell.py | 1 | 32048 | # Copyright 2012 OpenStack Foundation.
# 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 requ... | apache-2.0 | -3,938,062,603,018,916,000 | 38.419434 | 79 | 0.564185 | false | 4.262836 | false | false | false |
demisto/content | Packs/DNSDB/Integrations/DNSDB_v2/DNSDB_v2.py | 1 | 30136 | # Copyright (c) 2020 by Farsight Security, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | mit | -323,106,621,309,568,450 | 37.935401 | 130 | 0.525684 | false | 3.943986 | false | false | false |
codeforsanjose/calischools | schools/serializers.py | 1 | 1123 | from rest_framework import serializers
from .models import County, District, School
class CountySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = County
class CountyMixin(serializers.Serializer):
county = CountySerializer(read_only=True)
class DistrictCompactSerializer(seria... | mit | -468,564,356,021,282,600 | 23.955556 | 72 | 0.700801 | false | 4.221805 | false | false | false |
mdavoodi/konkourse-python | conversation/views.py | 1 | 4095 | from django.http import HttpResponse
from django.utils import simplejson
from account.models import UserProfile
from conversation.models import ConversationPost, ConvoWall, ConversationComment
from notification.views import notifyComment, notifyPost
def post(request):
results = {'success': False}
if request.u... | mit | -4,804,500,232,000,305,000 | 44.5 | 148 | 0.615873 | false | 4.539911 | false | false | false |
XENON1T/processing | montecarlo/fax_waveform/CreateFakeCSV.py | 1 | 4806 | #################################
## Sub-code used in WF simulation
## It creates a csv file for the input of fax
## by Qing Lin
## @ 2016-09-12
##
## HARDCODE WARNING: The FV dimensions below need to be modified
## according to the detector you wish to simulate
##
## Ref: http://xenon1t.github.io/pax... | apache-2.0 | -7,343,586,964,277,585,000 | 31.04 | 92 | 0.572201 | false | 3.114712 | false | false | false |
teheavy/AMA3D | Nh3D/3_CathTopo_uploader.py | 1 | 1726 | # Script Version: 1.0
# Author: Te Chen
# Project: AMA3D
# Task Step: 1
# This script is specially for loading CATH Node Name file and record all the topology level into database.
# CathDomainList File format: Cath Names File (CNF) Format 2.0, to find more info, please visit www.cathdb.info
import MySQLdb
import os
i... | gpl-2.0 | -5,206,685,651,074,116,000 | 33.54 | 129 | 0.637891 | false | 3.001739 | false | false | false |
pmghalvorsen/gramps_branch | gramps/plugins/view/view.gpr.py | 1 | 8180 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2009 Nick Hall
# 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 Gener... | gpl-2.0 | -9,066,584,488,088,675,000 | 26.918089 | 81 | 0.665037 | false | 3.249901 | false | false | false |
minghuascode/pyj | library/pyjamas/ui/BuilderPanel.py | 1 | 3810 | """ Pyjamas UI BuilderPanel: takes a PyJsGlade builder spec and adds widgets
requested using the methods just like in any other Panel class.
Copyright (C) 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
The purpose of this class is to be able to set up a Panel of any type
that can be dynamically created using B... | apache-2.0 | 5,191,970,841,784,223,000 | 35.990291 | 80 | 0.655643 | false | 3.915725 | false | false | false |
erikdejonge/newsrivr | daemons/python2/hn.py | 1 | 17227 | """
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.
This program is distributed in the hope that it will be useful,
but WITHOUT... | gpl-2.0 | 4,797,747,525,430,843,000 | 30.961039 | 159 | 0.565914 | false | 2.3631 | false | false | false |
olgabot/poshsplice | docs/conf.py | 1 | 8434 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# poshsplice documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 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
# ... | bsd-3-clause | 8,295,166,194,338,778,000 | 29.669091 | 76 | 0.705715 | false | 3.702371 | true | false | false |
mostaphaRoudsari/Honeybee | src/Honeybee_EnergyPlus Window Air Gap.py | 1 | 3032 | #
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 | 6,590,567,128,053,553,000 | 41.704225 | 194 | 0.716689 | false | 3.465143 | false | false | false |
jawrainey/sris | settings.py | 1 | 1602 | import os
class Config(object):
"""
The shared configuration settings for the flask app.
"""
# Service settings
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
SERVICE_ONTOLOGY = PROJECT_ROOT + '/sris/config/ontology.json'
# Database settings
CLIENT_NAME = 'cli... | mit | -7,199,926,662,232,172,000 | 29.807692 | 79 | 0.651685 | false | 3.657534 | true | false | false |
kostya0shift/SyncToGit | synctogit/Config.py | 1 | 1728 | from __future__ import absolute_import
try:
import configparser
except:
import ConfigParser as configparser
class _NotSet(object):
pass
class ConfigException(Exception):
pass
class Config:
def __init__(self, conffile):
self.conffile = conffile
self.conf = configparser.ConfigP... | mit | 587,310,397,621,717,500 | 25.584615 | 91 | 0.58044 | false | 3.945205 | true | false | false |
FiveEye/ml-notebook | dlp/ch6_2_pretrained_embedding.py | 1 | 2633 | import os
imdb_dir = '/home/han/code/data/aclImdb'
train_dir = os.path.join(imdb_dir, 'train')
# Processing the labels of the raw IMDB data
labels = []
texts = []
for label_type in ['neg', 'pos']:
dir_name = os.path.join(train_dir, label_type)
for fname in os.listdir(dir_name):
if fname[-4:] == '.t... | mit | -4,351,887,156,097,140,700 | 23.813725 | 95 | 0.692366 | false | 3.022962 | false | false | false |
seanfisk/buzzword-bingo-server | djangorestframework/status.py | 1 | 1455 | """
Descriptive HTTP status codes, for code readability.
See RFC 2616 - Sec 10: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Also see django.core.handlers.wsgi.STATUS_CODE_TEXT
"""
HTTP_100_CONTINUE = 100
HTTP_101_SWITCHING_PROTOCOLS = 101
HTTP_200_OK = 200
HTTP_201_CREATED = 201
HTTP_202_ACCEPTED = 202
HTT... | bsd-3-clause | 6,804,221,208,206,848,000 | 29.3125 | 77 | 0.768385 | false | 2.724719 | false | false | false |
dlebauer/plantcv | lib/plantcv/dev/roi_multi_objects.py | 1 | 3484 | import cv2
import numpy as np
from plantcv import print_image
### Find Objects Partially Inside Region of Interest or Cut Objects to Region of Interest
def roi_objects(img,roi_type,roi_contour, roi_hierarchy,object_contour, obj_hierarchy, device, debug=False):
# img = img to display kept objects
# roi_type = 'cutto'... | gpl-2.0 | -8,480,578,486,346,879,000 | 44.25974 | 108 | 0.683984 | false | 2.834825 | false | false | false |
jeffFranklin/iam-resttools | resttools/dao_implementation/nws.py | 1 | 2539 | """
Contains NWS DAO implementations.
"""
from resttools.mock.mock_http import MockHTTP
import re
from resttools.dao_implementation.live import get_con_pool, get_live_url
from resttools.dao_implementation.mock import get_mockdata_url
import logging
logger = logging.getLogger(__name__)
class File(object):
"""
... | apache-2.0 | 8,144,495,644,167,200,000 | 29.963415 | 88 | 0.541552 | false | 3.954829 | false | false | false |
anaruse/chainer | chainer/links/connection/deformable_convolution_2d.py | 1 | 5529 | from chainer.functions import deformable_convolution_2d_sampler
from chainer import initializers
from chainer.initializers import constant
from chainer import link
from chainer.links.connection.convolution_2d import Convolution2D
from chainer import variable
class DeformableConvolution2D(link.Chain):
"""Two-dimen... | mit | -8,680,863,434,744,701,000 | 40.261194 | 78 | 0.621993 | false | 4.157143 | false | false | false |
agermanidis/Pattern | graph/__init__.py | 1 | 46675 | #### PATTERN | GRAPH #################################################################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
##################################... | bsd-3-clause | -9,090,473,286,160,558,000 | 39.693112 | 118 | 0.526213 | false | 3.600077 | false | false | false |
pragle/craft | web/model/db_model.py | 1 | 1193 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michal Szczepanski'
from sqlalchemy.sql.schema import Column, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, String, Boolean, Binary
Base = declarative_base()
clas... | bsd-3-clause | -1,577,213,707,850,402,800 | 23.346939 | 67 | 0.694049 | false | 3.811502 | false | false | false |
wasade/picrust | picrust/ace.py | 1 | 3860 | #!/usr/bin/env python
# Author: Morgan Langille (morgan.g.i.langille@gmail.com)
# count_wagner.py
""" Application controller for the `ace' function within the R package `ape`.
File created on Feb 2012.
"""
from __future__ import division
from cogent.util.table import Table
from os.path import split, splitext
from os... | gpl-3.0 | -2,905,388,587,920,334,000 | 36.475728 | 104 | 0.673834 | false | 3.648393 | false | false | false |
frederick623/HTI | fa_util_py/HTI_ExportSIToMSS.py | 1 | 16771 | import ael
import acm
import time
import datetime
import os
import stat
import smtplib
import shutil
import string
#import HTI_DB_Functions
from datetime import date
from datetime import datetime
import shlex
#import HTI_MailFunction
import os
SEQNBR = 0
TRDNBR = 1
SETTTYPE = 2
VALUEDAY = 3
TEXT1 = 4
PRFID = 5
AMOUNT ... | apache-2.0 | -2,448,934,486,967,091,700 | 35.458696 | 245 | 0.476179 | false | 3.801224 | false | false | false |
awesto/django-shop | shop/views/auth.py | 1 | 8484 | from django.contrib.auth import logout, get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as ... | bsd-3-clause | 8,623,765,009,324,266,000 | 41.208955 | 109 | 0.660655 | false | 4.289181 | false | false | false |
charlesthk/django-nightmare-pdf | nightmare_pdf/generators.py | 1 | 2545 | import subprocess
import os
from django.core.validators import URLValidator
from nightmare_pdf.settings import pdf_settings
from django.http import (
HttpResponse,
Http404
)
from django.core.files.base import ContentFile
from .models import PdfDoc
from .utils import get_random_filename
validate_url = URLValidator(s... | mit | 8,103,723,720,229,453,000 | 22.564815 | 83 | 0.697053 | false | 3.134236 | false | false | false |
zerotired/kotori | kotori/daq/decoder/__init__.py | 1 | 1246 | # -*- coding: utf-8 -*-
# (c) 2019-2020 Andreas Motl <andreas@getkotori.org>
from kotori.daq.decoder.airrohr import AirrohrDecoder
from kotori.daq.decoder.tasmota import TasmotaSensorDecoder, TasmotaStateDecoder
from kotori.daq.decoder.schema import MessageType
class DecoderInfo:
def __init__(self):
self... | agpl-3.0 | -397,541,410,420,240,700 | 27.318182 | 80 | 0.638042 | false | 3.869565 | false | false | false |
tinyms/ArchiveX | tinyms/core/common.py | 1 | 14690 | __author__ = 'tinyms'
#coding=UTF8
import os
import sys
import re
import codecs
import hashlib
import json
#import urllib.request
#import urllib.parse
import time
import datetime
import decimal
import uuid
from imp import find_module, load_module, acquire_lock, release_lock
from tornado.template import Template
# impor... | bsd-3-clause | -1,749,095,310,060,765,400 | 27.260116 | 81 | 0.50375 | false | 3.775032 | false | false | false |
YantaiGao/learn_Python_The-Hard-Way | No38_ListOp.py | 1 | 1059 | # -*- coding:utf-8 -*-
#注意类的声明方法:
class Thing(object):
#self是需要有的 否则报错
def test(self,hi):
print hi
a = Thing()#这是声明类的一个对象
a.test("hahaha")
print "---------------------------------"
test_things = "Apple Orange Crows Telephone Light Suger"
print "There is not 10 things in that list,let's fix it."
stuff = test_t... | gpl-3.0 | -114,587,832,266,722,030 | 18.545455 | 66 | 0.630966 | false | 1.926009 | false | false | false |
jr-garcia/Engendro3D | e3d/model_management/interpolation.py | 1 | 1562 | # import numpy
# from cycgkit.cgtypes import vec3, quat
def getClosest(keys, time, chrid, sortedKeys):
def getfrom(keys1, time, ch):
try:
if ch == 'p':
return keys1[time].position
elif ch == 's':
return keys1[time].scale
else:
... | mit | -1,189,140,796,025,778,700 | 23.809524 | 80 | 0.493598 | false | 3.099206 | false | false | false |
NetApp/manila | manila/tests/share/drivers/emc/plugins/vnx/test_object_manager.py | 1 | 125573 | # Copyright (c) 2015 EMC Corporation.
# 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 requ... | apache-2.0 | 3,176,923,940,610,800,600 | 39.678005 | 79 | 0.601164 | false | 3.488042 | true | false | false |
Agiliza/AgilizaFramework | tests/agiliza/core/utils/patterns/test_singleton.py | 1 | 1894 | """
This file is part of Agiliza.
Agiliza 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.
Agiliza is distributed in the hope that it will b... | gpl-3.0 | -4,045,939,752,745,946,600 | 27.69697 | 68 | 0.69377 | false | 4.354023 | true | false | false |
dhalleine/tensorflow | tensorflow/contrib/learn/python/learn/experiment.py | 1 | 6100 | # Copyright 2016 Google 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 required by applicable law o... | apache-2.0 | 2,442,779,366,369,398,300 | 36.423313 | 80 | 0.627705 | false | 4.379038 | false | false | false |
faroit/loudness | python/tests/test_OME.py | 1 | 2084 | import numpy as np
import matplotlib.pyplot as plt
import loudness as ln
def plotResponse(freqPoints, dataPoints,
freqsInterp, responseInterp,
ylim=(-40, 10), title = ""):
if np.any(dataPoints):
plt.semilogx(freqPoints, dataPoints, 'o')
plt.semilogx(freqsInterp, resp... | gpl-3.0 | -6,410,065,352,474,172,000 | 30.104478 | 71 | 0.678503 | false | 2.843111 | false | false | false |
Boussadia/SimpleScraper | scraper.py | 1 | 6078 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import logging
import sys
import urllib
import mechanize
import cookielib
import urlparse
class Singleton(object):
_instances = {}
def __new__(class_, *args, **kwargs):
if class_ not in class_._instances:
class_._instances[class_] = super(Singleto... | mit | 2,890,036,489,779,167,000 | 29.385 | 115 | 0.666776 | false | 3.190026 | false | false | false |
awemulya/fieldsight-kobocat | onadata/apps/fsforms/models.py | 1 | 37515 | from __future__ import unicode_literals
import datetime
import os
import json
import re
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
from django.core.ur... | bsd-2-clause | 6,981,882,587,208,460,000 | 41.057175 | 195 | 0.599547 | false | 3.895639 | false | false | false |
antworteffekt/EDeN | graphprot/prepare_graphprot_seqs.py | 1 | 10394 | #!/usr/bin/env python
# draft implementation
# * TODO:
# * centering should be optional
# * viewpoint should be optional
# * check for nonunique ids and warn
# * check for bedtools version
# * write bed files for sequence coordinates
# * set rnd init for shuffling to have reproducible results
# * use my ... | mit | -1,839,607,395,871,399,200 | 38.075188 | 143 | 0.646527 | false | 3.510301 | false | false | false |
rwightman/tensorflow-litterbox | litterbox/models/sdc/model_sdc.py | 1 | 8350 | # Copyright (C) 2016 Ross Wightman. 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
# =================================... | apache-2.0 | 1,256,829,688,703,866,600 | 38.761905 | 107 | 0.582395 | false | 3.802368 | false | false | false |
mwiencek/picard | picard/ui/cdlookup.py | 1 | 3277 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | gpl-2.0 | 8,501,564,173,859,651,000 | 48.606061 | 111 | 0.66066 | false | 3.670404 | false | false | false |
p2pu/mechanical-mooc | twitter/views.py | 1 | 1825 | from django import http
from django.conf import settings
from django.views.decorators.http import require_http_methods
import json
from twitter import utils
@require_http_methods(['POST'])
def get_data(request):
if 'twitter_handle' not in request.POST.keys():
return http.HttpResponseServerError()
tw... | mit | 2,535,445,939,260,978,000 | 34.096154 | 97 | 0.667397 | false | 3.70935 | false | false | false |
OCA/carrier-delivery | base_delivery_carrier_label/models/delivery_carrier.py | 1 | 1276 | # -*- coding: utf-8 -*-
# Copyright 2012 Akretion <http://www.akretion.com>.
# Copyright 2013-2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class DeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
@api.model
def _get_carr... | agpl-3.0 | -6,199,342,651,234,206,000 | 31.717949 | 75 | 0.636364 | false | 3.962733 | false | false | false |
arocks/steel-rumors | steelrumors/settings.py | 1 | 5450 | # Django settings for steelrumors project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'da... | mit | 5,335,739,064,392,280,000 | 32.435583 | 127 | 0.688624 | false | 3.694915 | false | false | false |
heatherleaf/MCFParser.py | test/convert_mcfg_to_py.py | 1 | 1550 |
import re
import json
import fileinput
# F --> AO a [0,0;1,0] (* C --> /T,C T [0,0;1,0] *)
# A --> AL H [0,0;1,0] (* D,-case --> /N,D,-case N [0,0;1,0] *)
# I --> m [0,2;0,0][0,1] (* PastPart,-aux;-case --> +v,PastPart,-aux;-case;-v [0,2;0,0][0,1] *)
# I --> p [0,1;0,0][0,2] (* PastPart,-aux;-ca... | gpl-3.0 | -5,696,885,453,429,928,000 | 28.245283 | 110 | 0.425161 | false | 2.359209 | false | false | false |
meredith-digops/awsops | volumecleanup/volumecleanup.py | 1 | 3967 | #!/usr/bin/env python
from __future__ import print_function
import boto3
from botocore.exceptions import ClientError
from datetime import datetime
from datetime import timedelta
from datetime import tzinfo
DEFAULT_RETENTION_DAYS = None
"""If None, no default retention is applied"""
ZERO = timedelta(0)
class UTC(... | mit | -3,186,707,178,158,320,600 | 24.928105 | 89 | 0.575498 | false | 4.064549 | false | false | false |
johncosta/private-readthedocs.org | readthedocs/core/models.py | 1 | 1611 | from django.db import models
from django.db.models.signals import post_save
from django.db.utils import DatabaseError
from django.dispatch import receiver
from django.contrib.auth.models import User
STANDARD_EMAIL = "anonymous@readthedocs.org"
class UserProfile (models.Model):
"""Additional information about a Us... | mit | -9,134,461,863,259,773,000 | 33.276596 | 102 | 0.656735 | false | 3.977778 | false | false | false |
FernanOrtega/DAT210x | Module2/assignment3.py | 1 | 1065 | import pandas as pd
# TODO: Load up the dataset
# Ensuring you set the appropriate header column names
#
df = pd.read_csv('Datasets/servo.data', names=['motor', 'screw', 'pgain', 'vgain', 'class'])
print df.head()
# TODO: Create a slice that contains all entries
# having a vgain equal to 5. Then print the
# length ... | mit | 6,675,119,542,563,966,000 | 21.659574 | 92 | 0.680751 | false | 3.025568 | false | false | false |
ITNano/WikiSubtitleReader | raw_to_ass.py | 1 | 3753 | # -*- coding: utf-8 -*-
#Python class to parse lyrics on the form
#Singer 1: I am so happy, hear me sing
#And write it to an .ass file. (Advanced SubStation Alpha subtitle file)
#The string before the separator ':' is used to format the text by mapping it to
#a predefined format, the remainder is the actual text to sin... | apache-2.0 | 3,436,370,674,309,785,000 | 35.427184 | 138 | 0.598614 | false | 3.509822 | false | false | false |
ealmansi/incc-tp-final | src/gensim/tut2.py | 1 | 1637 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://radimrehurek.com/gensim/tut2.html
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
import os
from gensim import corpora, models, similarities
if (os.path.exists("/tmp/deerwester.dict")):
dictionary = ... | mit | 5,472,797,103,600,224,000 | 33.104167 | 110 | 0.735492 | false | 2.87193 | false | false | false |
milapour/palm | palm/test/test_blink_model.py | 1 | 3374 | import nose.tools
from palm.blink_factory import SingleDarkBlinkFactory,\
DoubleDarkBlinkFactory,\
ConnectedDarkBlinkFactory
from palm.blink_model import BlinkModel
from palm.blink_parameter_set import SingleDarkParameterSet,\
... | bsd-2-clause | 1,793,866,859,589,507,000 | 40.654321 | 75 | 0.65412 | false | 3.540399 | false | false | false |
tomzw11/Pydrone | route.py | 1 | 2000 | import matplotlib.pyplot as plt
import matplotlib.patches as patches
def route(root):
root_height = root[2]
coordinates = [\
[0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\
[-0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\
[-0.42*root_height+root[0],-0.15*root_height+root[1]... | mit | 8,674,524,241,058,925,000 | 26.777778 | 155 | 0.6335 | false | 2.209945 | false | false | false |
Bloomie/murano-agent | muranoagent/common/messaging/mqclient.py | 1 | 3280 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 | -1,117,816,651,737,075,100 | 31.156863 | 72 | 0.594817 | false | 4.162437 | false | false | false |
MysterionRise/fantazy-predictor | enriching_data.py | 1 | 10896 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import calendar
import os
import pandas as pd
# Правила подсчета очков:
#
# за участие в матче – 2 очка, если сыграно 10 минут и больше; 1 очко, если сыграно меньше 10 минут
#
# за победу – 3 очка (в гостях); 2 очка (дома)
#
# за поражение – минус 3 очка (дома); минуc... | mit | 7,115,765,170,995,633,000 | 34.2 | 131 | 0.562115 | false | 2.743461 | false | false | false |
Gixugif/CDRecording | Call_Detail_Record.py | 1 | 2248 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Title: Call_Detail_Record
# Description: Class for one
# CDR
# separately.
# Date: 6/9/16
# Author: Jeffrey Zic
class Call_Detail_Record:
""" Call Detail Records contain metadata for phone calls."""
def __init__(self):
self.bbx_cdr_id = ('', )
self.... | gpl-3.0 | -1,865,762,430,259,183,400 | 33.060606 | 64 | 0.483986 | false | 3.5125 | false | false | false |
kannon92/psi4 | doc/sphinxman/source/psi4doc/ext/psidomain.py | 1 | 1221 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2016 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | gpl-2.0 | 5,442,838,222,191,783,000 | 33.885714 | 128 | 0.746929 | false | 3.756923 | false | false | false |
CaptainDesAstres/Simple-Blender-Render-Manager | usefullFunctions.py | 1 | 1409 | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
import time
def now(short = True):
'''return current date in short or long form (HH:MM:SS or DD.MM.AAAA-HH:MM:SS)'''
if short == True:
return time.strftime('%H:%M:%S')
else:
return time.strftime('%d.%m.%Y-%H:%M:%S')
def columnLimit(value, limit, begin = True, sep =... | mit | -1,501,886,194,108,361,200 | 15.552941 | 82 | 0.595593 | false | 2.980932 | false | false | false |
willdecker/suds | suds/client.py | 1 | 27894 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... | mit | 582,025,390,059,082,400 | 31.816471 | 84 | 0.573098 | false | 4.163905 | false | false | false |
slub/vk2-georeference | georeference/views/user/georeferencehistory.py | 1 | 3257 | # -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Jacob Mendt
Created on 07.10.15
@author: mendt
'''
import traceback
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPInternalServerError
from sqlalchemy import desc
from georeference import LOGGER
from georeference.settings import OAI_ID_PATTE... | gpl-3.0 | -4,433,242,273,326,549,500 | 38.253012 | 162 | 0.671784 | false | 3.872771 | false | false | false |
mtpajula/ijonmap | core/project.py | 1 | 4348 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .elements.point import Point
from .elements.line import Line
from .elements.polygon import Polygon
import os
class Project(object):
def __init__(self, messages):
self.messages = messages
self.points = []
self.lines = ... | gpl-2.0 | 1,836,806,213,838,873,000 | 26.518987 | 86 | 0.49172 | false | 4.405268 | false | false | false |
pyfa-org/eos | eos/util/repr.py | 1 | 1866 | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | lgpl-3.0 | 6,969,660,614,217,755,000 | 41.409091 | 80 | 0.620579 | false | 4.464115 | false | false | false |
Ophrys-Project/Ophrys | ophrys/utils/models.py | 1 | 4817 | from django.conf.urls import patterns, url, include
from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from .views import ListView, CreateView, DetailView, UpdateView, DeleteView
class GetAbsoluteUrlMixin:
"""
Mixin to add the methods get_absolute_url() and get_absolute... | mit | 7,332,932,344,475,288,000 | 42.396396 | 98 | 0.625493 | false | 3.99751 | false | false | false |
zekearneodo/ephys-tools | zk/pca_filter.py | 1 | 4586 | __author__ = 'chris'
import logging
import tables
from scipy import signal
import numpy as np
def PCA_filter(self, rec_h5_obj, probe):
"""
Filtering based on
doi:10.1016/S0165-0270(01)00516-7
"""
data = self.run_group.data
D_all_clean = rec_h5_obj.create_carray(self.run_group,... | gpl-2.0 | -8,351,679,364,114,622,000 | 38.60177 | 121 | 0.511557 | false | 3.582813 | false | false | false |
mfalesni/python-kwargify | test_kwargify.py | 1 | 5569 | # -*- coding: utf-8 -*-
import pytest
from kwargify import kwargify
class TestFunctionWithNoArgs(object):
@pytest.fixture(scope="class")
def function(self):
@kwargify
def f():
return True
return f
def test_no_args_given(self, function):
function()
@pytest... | lgpl-3.0 | -1,896,215,505,816,903,200 | 23.318777 | 75 | 0.587718 | false | 3.459006 | true | false | false |
bmazin/SDR | Projects/ChannelizerSim/legacy/bin_width_1st_stage.py | 1 | 1524 |
import matplotlib.pyplot as plt
import scipy.signal
import numpy as np
import math
import random
from matplotlib.backends.backend_pdf import PdfPages
samples = 51200
L = samples/512
fs = 512e6
dt = 1/fs
time = [i*dt for i in range(samples)]
def pfb_fir(x):
N = len(x)
T = 4
L = 512
bin_width_scale = 2.5
dx = T*... | gpl-2.0 | 6,725,326,808,693,590,000 | 21.411765 | 93 | 0.625328 | false | 2.122563 | false | false | false |
xpostudio4/red-de-emprendimiento | app/institutions/views.py | 1 | 4872 | from django.contrib.auth import (login as django_login, authenticate,
logout as django_logout)
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import SetPasswordForm
from django.http import JsonResponse, HttpResponseRedirect
from django.shortcuts... | mit | 6,066,139,324,412,251,000 | 34.304348 | 78 | 0.650246 | false | 4.385239 | false | false | false |
noironetworks/group-based-policy | gbpservice/nfp/core/cfg.py | 1 | 1671 | # 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
# d... | apache-2.0 | 1,557,896,110,659,903,700 | 29.944444 | 78 | 0.645721 | false | 3.868056 | true | false | false |
nhoffman/opiates | opiate/utils.py | 1 | 2361 | from collections import Iterable
import os
from os import path
import shutil
import logging
from __init__ import __version__
log = logging.getLogger(__name__)
def flatten(seq):
"""
Poached from http://stackoverflow.com/questions/2158395/flatten-an-irregular-list-of-lists-in-python
Don't flatten strings ... | gpl-3.0 | -4,849,164,687,510,369,000 | 31.342466 | 104 | 0.633206 | false | 4.091854 | false | false | false |
Seekatar/pcg | Games/FineControl.py | 1 | 2743 | import base
import datetime
import random
from FixedRandomGame import FixedRandomGame as __base
# use __base, otherwise when searching for games, FixedRandomGame shows up multiple times
class FineControl(__base):
"""
Touch four plates in patterns as fast as you can.
Level 1: tight, clockwise 5 times
... | mit | 47,598,030,569,357,740 | 32.048193 | 155 | 0.574918 | false | 3.804438 | false | false | false |
DIRACGrid/COMDIRAC | Interfaces/scripts/dgetenv.py | 1 | 1529 | #! /usr/bin/env python
"""
print DCommands session environment variables
"""
import DIRAC
from COMDIRAC.Interfaces import critical
from COMDIRAC.Interfaces import DSession
if __name__ == "__main__":
from COMDIRAC.Interfaces import ConfigCache
from DIRAC.Core.Base import Script
Script.setUsageMessage( '\n'.j... | gpl-3.0 | 3,005,090,108,459,228,000 | 22.890625 | 97 | 0.517332 | false | 4.189041 | false | false | false |
RPGOne/Skynet | pytorch-master/torch/nn/modules/upsampling.py | 1 | 3469 | from numbers import Integral
from .module import Module
from .. import functional as F
from .utils import _pair
class _UpsamplingBase(Module):
def __init__(self, size=None, scale_factor=None):
super(_UpsamplingBase, self).__init__()
if size is None and scale_factor is None:
raise Val... | bsd-3-clause | -1,060,963,812,535,801,200 | 29.429825 | 89 | 0.566734 | false | 3.417734 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.