repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
stone5495/NewsBlur | vendor/feedvalidator/demo/src/rdflib/exceptions.py | 18 | 2379 |
class Error(Exception):
"""Base class for rdflib exceptions."""
def __init__(self, msg=None):
Exception.__init__(self, msg)
self.msg = msg
class TypeCheckError(Error):
"""Parts of assertions are subject to type checks."""
def __init__(self, node):
Error.__init__(self, node)
... | mit | -3,535,963,390,637,901,000 | 29.113924 | 85 | 0.577554 | false | 3.874593 | false | false | false |
sirex/Misago | misago/users/views/admin/warnings.py | 8 | 2683 | from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from misago.admin.views import generic
from misago.users.models import WarningLevel
from misago.users.forms.admin import WarningLevelForm
class WarningsAdmin(generic.AdminBaseMixin):
root_link = 'misago:admin:users:warni... | gpl-2.0 | -7,912,987,130,653,455,000 | 36.263889 | 79 | 0.654864 | false | 4.179128 | false | false | false |
Driste/Freyr | validate.py | 1 | 1956 | import re
import regex
class Rule(dict):
''' breaks the rule into its parts along with validating it '''
def __init__(self, rule):
''' self['valid'] will be changed at any point to show whether the rule is valid or not. Error will tell you where.'''
self['valid'] = True
self['error... | bsd-2-clause | 3,603,745,722,846,058,500 | 25.093333 | 126 | 0.529652 | false | 4.188437 | false | false | false |
Akasurde/ansible | lib/ansible/plugins/doc_fragments/files.py | 23 | 4100 | # -*- coding: utf-8 -*-
# Copyright: (c) 2014, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# Standard files docume... | gpl-3.0 | 5,775,242,545,966,777,000 | 47.235294 | 125 | 0.707317 | false | 4.047384 | false | false | false |
kirillsimin/ling720csce500 | dt-stats.py | 1 | 3474 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 27 23:52:51 2015
@author: Kirill
"""
import sys
#from nltk.parse import stanford
from collections import defaultdict
import essayclasses.allessaysfile
import essayclasses.anessay
import essayclasses.asentence
exportedDB = 'data/all-essays.csv'
allEssaysFile = es... | gpl-2.0 | 8,683,535,123,587,791,000 | 21.712418 | 69 | 0.570524 | false | 3.079787 | false | false | false |
DedMemez/ODS-August-2017 | parties/DistributedPartyDanceActivity.py | 1 | 1307 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.parties.DistributedPartyDanceActivity
from toontown.parties import PartyGlobals
from toontown.parties.DistributedPartyDanceActivityBase import DistributedPartyDanceActivityBase
from toontown.toonbase import TTLocalizer
class DistributedPartyDance... | apache-2.0 | -7,339,450,117,566,262,000 | 44.75 | 131 | 0.714614 | false | 3.889881 | false | false | false |
kr41/ggrc-core | test/integration/ggrc/services/test_search.py | 7 | 2305 | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Test /search REST API
"""
from ggrc.models import Control
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.generator import ObjectGenerator
class... | apache-2.0 | -8,425,788,867,269,844,000 | 31.013889 | 78 | 0.62256 | false | 3.629921 | true | false | false |
domenicosolazzo/jroc | tests/jroc/nlp/input/cleaning/test_datacleaner.py | 1 | 2640 | from . import DataCleaner
import unittest
import os
class DataCleanerTestCase(unittest.TestCase):
dataCleaner = None
currentDirectory = currentDirectory = "%s" % (os.path.dirname(os.path.realpath(__file__)), )
testTextsDirectory = "%s/../../../data/text/" % (currentDirectory, )
def setUp(self):
... | gpl-3.0 | -6,571,025,352,266,535,000 | 33.285714 | 107 | 0.647727 | false | 4 | true | false | false |
UManPychron/pychron | pychron/options/define_equilibration.py | 2 | 1394 | # ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | apache-2.0 | -7,801,087,472,446,347,000 | 35.684211 | 81 | 0.638451 | false | 4.237082 | false | false | false |
otaviobp/eyeD3 | src/eyeD3/binfuncs.py | 6 | 3558 | ################################################################################
#
# Copyright (C) 2002-2005 Travis Shirk <travis@pobox.com>
# Copyright (C) 2001 Ryan Finne <ryan@finnie.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | gpl-2.0 | 6,598,213,499,006,175,000 | 25.161765 | 80 | 0.55593 | false | 3.279263 | false | false | false |
tensorflow/tpu | models/official/detection/projects/fashionpedia/dataloader/tf_example_decoder.py | 1 | 7709 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -6,247,439,793,533,594,000 | 42.553672 | 122 | 0.636918 | false | 3.679714 | false | false | false |
MCLConsortium/mcl-site | src/jpl.mcl.site.knowledge/src/jpl/mcl/site/knowledge/tests/test_setup.py | 1 | 1263 | # encoding: utf-8
u'''MCL Site Knowledge — setup tests'''
from jpl.mcl.site.knowledge.testing import JPL_MCL_SITE_KNOWLEDGE_INTEGRATION_TESTING
import unittest, plone.api
class SetupTest(unittest.TestCase):
layer = JPL_MCL_SITE_KNOWLEDGE_INTEGRATION_TESTING
def setUp(self):
super(SetupTest, self).se... | apache-2.0 | -8,871,059,834,431,624,000 | 37.212121 | 91 | 0.666931 | false | 3.687135 | true | false | false |
eustislab/horton | doc/update_hf_dft_examples.py | 1 | 1727 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | gpl-3.0 | 7,490,750,100,571,261,000 | 34.244898 | 83 | 0.68095 | false | 3.474849 | false | false | false |
DigitalPublishingToolkit/Society-of-the-Query-Reader | scripts/index_documents.py | 1 | 1267 | import os
import html5lib
from xml.etree import ElementTree as etree
from whoosh.index import open_dir
ix = open_dir("index")
with ix.writer() as writer:
for root, dirs, files in os.walk('essays'):
# print root, files
if 'index.html' in files:
fp = os.path.join(root, 'index.html')
... | gpl-3.0 | -1,969,048,108,103,752,200 | 36.264706 | 125 | 0.53749 | false | 3.839394 | false | false | false |
barisumog/pyllage | pyllage/__init__.py | 1 | 1917 | #
# -*- coding: utf-8 -*-
#
# pyllage
#
# Copyright (C) 2013 barisumog at gmail.com
#
# 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 l... | gpl-3.0 | 4,734,646,366,030,803,000 | 29.444444 | 81 | 0.684924 | false | 3.454054 | false | false | false |
vhaupert/mitmproxy | mitmproxy/proxy/protocol/http2.py | 1 | 30035 | import threading
import time
import functools
from typing import Dict, Callable, Any, List, Optional # noqa
import h2.exceptions
from h2 import connection
from h2 import events
import queue
from mitmproxy import connections # noqa
from mitmproxy import exceptions
from mitmproxy import http
from mitmproxy.proxy.prot... | mit | 6,689,100,719,969,246,000 | 40.143836 | 136 | 0.610488 | false | 4.001999 | true | false | false |
yuxans/badgirl | src/fortune.py | 1 | 1513 | #!/usr/bin/env python
# Copyright (c) 2003 Daniel DiPaolo
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This p... | gpl-2.0 | -9,076,864,932,055,481,000 | 30.520833 | 77 | 0.716457 | false | 3.332599 | false | false | false |
ActiveState/code | recipes/Python/93025_Speech_recognitiWindows_using_MS_Speech/recipe-93025.py | 1 | 3325 | from win32com.client import constants
import win32com.client
import pythoncom
"""Sample code for using the Microsoft Speech SDK 5.1 via COM in Python.
Requires that the SDK be installed; it's a free download from
http://microsoft.com/speech
and that MakePy has been used on it (in PythonWin,
sel... | mit | -1,125,464,779,408,658,200 | 48.626866 | 92 | 0.686015 | false | 4.074755 | false | false | false |
ThreeSixtyGiving/prototype-tools | scripts/gen-docs.py | 1 | 4111 | # This script generates an intermediate representation of the data model ready for translation into CSV
import json
import operator # Used in sorting
from sets import Set
from genmodel import generateModel, getName
# Change final parameter to False / True depending on whether you want roll-ups or not.
# Note to self: ... | mit | 4,512,297,391,196,105,700 | 35.070175 | 144 | 0.511068 | false | 3.849251 | false | false | false |
lvdongbing/bilean | bilean/engine/clients/os/nova.py | 1 | 10976 | #
# 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
# ... | apache-2.0 | -7,248,169,001,603,073,000 | 36.333333 | 79 | 0.545645 | false | 4.476346 | false | false | false |
openstack/python-magnumclient | magnumclient/osc/v1/stats.py | 1 | 1441 | # Copyright 2015 NEC 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 required ... | apache-2.0 | -6,872,251,423,533,257,000 | 34.146341 | 78 | 0.653713 | false | 4.16474 | false | false | false |
intuition-io/intuition | tests/api/test_datafeed.py | 1 | 9643 | '''
Tests for intuition.api.datafeed
'''
import unittest
from nose.tools import raises, ok_, eq_, nottest
import random
import pytz
import datetime as dt
import pandas as pd
import intuition.api.datafeed as datafeed
from intuition.data.universe import Market
from intuition.errors import InvalidDatafeed
import dna.test... | apache-2.0 | 4,866,306,927,844,752,000 | 32.137457 | 79 | 0.579488 | false | 3.647126 | true | false | false |
apple/swift-lldb | packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py | 5 | 3717 | """
Test C++ virtual function and virtual inheritance.
"""
from __future__ import print_function
import os
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
def Msg(expr, val):
return "'expression %s' matches the output (from ... | apache-2.0 | -5,776,541,678,099,727,000 | 35.087379 | 104 | 0.62685 | false | 4.062295 | true | false | false |
Jordan-Zhu/RoboVision | unsorted/part1.py | 1 | 5653 | # Import the necessary packages
import cv2
import scipy.io as sio
import numpy as np
import util as util
import edge_detect as ed
from lineseg import lineseg
from drawedgelist import drawedgelist
from python.Lseg_to_Lfeat_v4 import create_linefeatures
from python.merge_lines_v4 import merge_lines
from pytho... | gpl-3.0 | 1,339,291,607,766,705,700 | 31.850299 | 105 | 0.616487 | false | 3.126659 | false | false | false |
tileung/DrugsInCPGs | src/ngc/IncludedGLs_byCUI_byTargetPop.py | 1 | 1638 | ## Created: 09/29/15
## Adapted from IncludedGL_byCUI.pt
## Purpose: final list of included CPGs and their disease categories/GUIs
import os
import sys
import csv
## Set path
path = "C:\\Users\\tileung\\Dropbox\\Py Stuffs - Drugs in CPGs\\SeptCode\\"
## Initiate file to save results
fName = path + "IncludedGLs_byCU... | gpl-2.0 | -8,420,446,462,738,579,000 | 25.852459 | 157 | 0.567155 | false | 2.838821 | false | false | false |
nwjs/chromium.src | tools/chrome_proxy/webdriver/variations_combinations.py | 2 | 4059 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import io
import os
import platform
import sys
import time
import unittest
import common
sys.path.append(os.path.joi... | bsd-3-clause | -3,198,790,310,492,998,700 | 32.825 | 80 | 0.697216 | false | 3.832861 | true | false | false |
JamesShaeffer/QGIS | python/plugins/processing/ProcessingPlugin.py | 17 | 14208 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingPlugin.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... | gpl-2.0 | 4,166,624,066,782,921,000 | 38.554318 | 114 | 0.661549 | false | 4.400372 | false | false | false |
apg/phizer | phizer/cache.py | 1 | 1726 | try:
from collections import OrderedDict
except ImportError:
from phizer.ordereddict import OrderedDict
import operator
import sys
from collections import namedtuple
cached_image = namedtuple('cached_image',
['body', 'content_type', 'size'])
class SizedLRUCache(object):
def ... | gpl-3.0 | 3,875,298,408,586,498,600 | 25.553846 | 72 | 0.588065 | false | 3.861298 | false | false | false |
ethz-asl/segmatch | tools/remap_bag.py | 1 | 1995 | #!/usr/bin/python
import rospy
import rosbag
import os
import sys
import argparse
import yaml
def remove_tf(inbag,outbag,prefix):
print ' Processing input bagfile: ', inbag
print ' Writing to output bagfile: ', outbag
print ' Adding prefix: ', prefix
outbag = rosbag.Bag(outbag,'w')
for topi... | bsd-3-clause | -5,955,480,741,586,399,000 | 30.68254 | 136 | 0.637093 | false | 3.487762 | false | false | false |
AshwinChandlapur/robocomp | tools/rcmonitor/examples/rois.py | 5 | 2917 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 by RoboLab - University of Extremadura
#
# This file is part of RoboComp
#
# RoboComp is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version... | gpl-3.0 | -6,665,536,062,208,809,000 | 29.072165 | 90 | 0.66541 | false | 2.698427 | false | false | false |
willametteuniversity/webcirc2 | website/tests/registration_tests.py | 1 | 10731 | '''
This file contains tests that test the new user registration system.
'''
from os.path import abspath, dirname
import sys
project_dir = abspath(dirname(dirname(__file__)))
sys.path.insert(0, project_dir)
from django.core.urlresolvers import resolve
from django.test import TestCase
from django.test.client import Cl... | apache-2.0 | 774,319,112,822,900,600 | 44.088235 | 120 | 0.546641 | false | 4.803491 | true | false | false |
expfactory/expfactory | expfactory/utils.py | 1 | 8093 | """
utils.py: part of expfactory package
Copyright (c) 2017-2021, Vanessa Sochat
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... | bsd-3-clause | -5,226,687,665,466,102,000 | 30.737255 | 82 | 0.612628 | false | 4.341738 | false | false | false |
oogles/django-goodies | djem/forms/bases.py | 2 | 1058 | from django import forms
class CommonInfoForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
user = kwargs.pop('user', None)
super(CommonInfoForm, self).__init__(*args, **kwargs)
# User is required for bound forms
if self.is_bound and not use... | bsd-3-clause | 1,173,975,838,051,884,500 | 33.129032 | 109 | 0.584121 | false | 4.483051 | false | false | false |
showerst/openstates | scripts/setup_openstates_ubuntu.py | 1 | 3711 | '''
This script sets up a virtualenv with openstates on ubunt.
usage: python setup_openstates_ubuntu.py myvirtualenv [whenIputmycode]
If you don't specify a second argument, the code goes in the virtualenv.
'''
import sys
import os
from os import chdir as cd
from os.path import join, abspath
import subprocess
import ... | gpl-3.0 | 2,655,673,413,212,256,000 | 23.414474 | 77 | 0.606575 | false | 3.606414 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-machinelearningcompute/azure/mgmt/machinelearningcompute/models/update_system_services_response.py | 2 | 1875 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | 2,685,939,778,419,291,600 | 37.265306 | 80 | 0.620267 | false | 4.411765 | false | false | false |
ForTozs/py3radar | setup.py | 1 | 3447 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 - 2013
# Matías Herranz <matiasherranz@gmail.com>
# Joaquín Tita <joaquintita@gmail.com>
#
# https://github.com/PyRadar/pyradar
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-3.0 | -7,754,382,193,126,658,000 | 27.708333 | 83 | 0.509144 | false | 4.206349 | false | false | false |
partofthething/home-assistant | homeassistant/components/freebox/config_flow.py | 1 | 3656 | """Config flow to configure the Freebox integration."""
import logging
from freebox_api.exceptions import AuthorizationError, HttpRequestError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from .const import DOMAIN # pylint: disable=unused-imp... | mit | -216,270,256,415,174,750 | 31.353982 | 88 | 0.594365 | false | 4.14983 | true | false | false |
Sevenops/TurkAnime-Downloader | turkanime.py | 1 | 2485 | import os
import re
import httpx
import base64
from urllib.parse import unquote
import hashlib
cookies = {
"yew490": "1",
"_ga": "GA1.2.284686093.1564216182",
"_gid": "GA1.2.1256976049.1564216182",
"__PPU_SESSION_1_1683592_false": "1564216202929|1|1564216202929|1|1",
"_gat": "1",
}
headers = {
... | apache-2.0 | 995,729,462,240,999,400 | 31.285714 | 135 | 0.543662 | false | 3.008475 | false | false | false |
dpwe/dp_python | dp.py | 1 | 2187 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
%matplotlib inline
# <codecell>
cd /Users/dpwe/projects/millionsong/python/midi-dataset
# <codecell>
import numpy as np
import matplotlib.pyplot as plt
import dpcore
# <codecell>
reload(dpcore)
# <codecell>
M = np.random.rand(50,50)
plt.imshow(M,... | mit | -7,173,430,211,191,840,000 | 17.533898 | 109 | 0.660265 | false | 2.163205 | false | false | false |
QuantCrimAtLeeds/PredictCode | open_cp/gui/run_analysis.py | 1 | 17795 | """
run_analysis
~~~~~~~~~~~~
Model / Controller for running the actual analysis.
TODO: The random `print` statements are to try to catch a rare deadlock
condition.
"""
import open_cp.gui.tk.run_analysis_view as run_analysis_view
import open_cp.gui.predictors as predictors
from open_cp.gui.common import CoordType
... | artistic-2.0 | -4,478,037,561,749,926,400 | 34.661323 | 114 | 0.599494 | false | 4.040645 | false | false | false |
geoenvo/opendims | opendims/automaticweathersystem/migrations/0004_auto_20160529_2145.py | 1 | 2278 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-29 14:45
from __future__ import unicode_literals
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('au... | gpl-3.0 | -5,753,898,316,951,615,000 | 41.981132 | 194 | 0.638718 | false | 4.119349 | false | false | false |
decvalts/landlab | landlab/components/soil_moisture/soil_moisture_field.py | 1 | 8877 | #################################################################
##
## 'Field' concept is implemented for Soil Moisture component.
##
## Sai Nudurupati and Erkan Istanbulluoglu - 15May2014
#################################################################
from landlab import Component
import numpy as np
_VALID_MET... | mit | 1,385,547,615,883,129,000 | 36.774468 | 123 | 0.494086 | false | 3.130113 | false | false | false |
ggiuffre/DBNsim | DBNsite/DBNsite/settings.py | 1 | 3304 | """
Django settings for DBNsite project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | mit | 4,501,313,335,069,155,000 | 25.645161 | 93 | 0.684927 | false | 3.434511 | false | false | false |
COMU/calibre-cloud-plugin | gui/error.py | 1 | 2052 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.ui'
#
# Created by: PyQt5 UI code generator 5.7
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectNa... | gpl-3.0 | 272,182,076,008,607,520 | 36.163636 | 112 | 0.681996 | false | 3.518072 | false | false | false |
IMSGlobal/openbadges-validator-core | openbadges/verifier/tasks/crypto.py | 2 | 5183 | from Crypto.PublicKey import RSA
from jose import jwk, jws, exceptions as joseexceptions
import json
import six
from ..actions.graph import patch_node
from ..actions.tasks import add_task
from ..actions.validation_report import set_validation_subject
from ..exceptions import TaskPrerequisitesError
from ..state import ... | apache-2.0 | -191,745,458,210,994,750 | 37.392593 | 113 | 0.64808 | false | 3.562199 | false | false | false |
lgray/HGCanalysis | scripts/submitLocalAnalysis.py | 3 | 2483 | #!/usr/bin/env python
import os,sys
import optparse
import commands
import time
cmsswBase=os.environ['CMSSW_BASE']
cmsswVersion=os.environ['CMSSW_VERSION']
usage = 'usage: %prog [options]'
parser = optparse.OptionParser(usage)
parser.add_option('-q', '--queue' , dest='queue' , help='batch queue'... | gpl-3.0 | 8,585,814,696,060,641,000 | 49.673469 | 182 | 0.593637 | false | 3.050369 | false | false | false |
espeed/lightsocket | lightsocket/resources/example.py | 1 | 1880 | # -*- coding: utf-8 -*-
#
# Copyright 2011 James Thornton (http://jamesthornton.com)
# BSD License (see LICENSE for details)
#
import random
from lightsocket.server import Resource, Response, Router
class ExampleProxy(Resource):
# This example class is used in composition of the primary resource (below).
# ... | bsd-3-clause | 4,494,054,666,551,457,000 | 29.322581 | 81 | 0.651064 | false | 4.025696 | false | false | false |
Erikun/elogy | elogy/api/attachments.py | 2 | 1693 | from datetime import datetime
import json
from flask import jsonify, url_for
from flask_restful import Resource, reqparse
from werkzeug import FileStorage
from ..attachments import save_attachment
from ..utils import get_utc_datetime
attachments_parser = reqparse.RequestParser()
attachments_parser.add_argument(
... | gpl-3.0 | 1,923,343,569,552,397,800 | 35.804348 | 67 | 0.600118 | false | 4.93586 | false | false | false |
MLAB-project/sensor-ui | src/SensorServer/scripts/ROSpymlabServer.py | 1 | 4252 | #!/usr/bin/env python
import rospy
import pymlab
from pymlab import config
import sys
import sensor_server
from std_msgs.msg import String
from std_msgs.msg import Float32
import std_msgs
from sensor_server.srv import *
from sensor_server.msg import *
def server(req):
print req
print "Returning [%s + %s]"%(r... | gpl-2.0 | 7,482,300,904,354,415,000 | 33.024 | 96 | 0.516463 | false | 3.558159 | true | false | false |
arcivanov/pybuilder | src/unittest/python/plugins/python/install_dependencies_plugin_tests.py | 3 | 8170 | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... | apache-2.0 | 2,477,966,878,217,443,300 | 44.642458 | 105 | 0.564994 | false | 4.0667 | true | false | false |
sheagcraig/python-jss | tests/test_jamf_software_server.py | 1 | 1302 | from __future__ import absolute_import
import pytest
import os.path
import jss
from jss import JSS, QuerySet
from xml.etree import ElementTree
from jss.exceptions import GetError
def mock_expanduser(path):
return path
class TestJSS(object):
def test_construct_without_jssprefs(self, jss_prefs_dict):
... | gpl-3.0 | 7,726,659,739,758,076,000 | 30.02381 | 120 | 0.645161 | false | 3.364341 | true | false | false |
RudoCris/horizon | openstack_dashboard/dashboards/router/nexus1000v/tables.py | 30 | 3496 | # 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 | 4,554,167,554,533,875,700 | 34.313131 | 78 | 0.639874 | false | 4.397484 | false | false | false |
geodynamics/specfem3d | utils/dynamic_rupture/curved_fault_mesh/create_semisphere_mesh.py | 1 | 14359 | #!python
# Create 3D mesh files.
# Huihui Weng (Geoazur, 2018)
#
# ======================================================================
from __future__ import print_function
import numpy
import os
import sys
# Please set up the path for CUBIT (or Trelis) and GEOCUBIT in your system.
# Instead, you could set up the p... | gpl-3.0 | -3,311,555,830,420,008,400 | 43.317901 | 195 | 0.515913 | false | 3.61051 | false | false | false |
TheRedFireFox/AnimeSubBot | src/messages/msg_processor.py | 1 | 50108 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# standard lib
import re
import json
import datetime
# The custom modules
from . import message # imports in the same folder (module)
from . import emojis
class MessagePreProcessor(object):
"""
This class is used as the user message preanalyser.
This class will p... | gpl-2.0 | 2,357,790,934,075,367,400 | 37.005311 | 171 | 0.495638 | false | 5.296151 | false | false | false |
brutasse/django-ses | django_ses/utils.py | 2 | 6526 | import base64
import logging
from io import StringIO
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import smart_str
from django_ses import settings
logger = logging.getLogger(__name__)
... | mit | 7,059,662,298,711,280,000 | 33.712766 | 110 | 0.562059 | false | 4.746182 | false | false | false |
DomBennett/pG-lt | tests/test_stages_phylogeny.py | 1 | 3743 | #! /bin/usr/env python
# D.J. Bennett
# 26/05/2014
"""
Test phylogeny stage.
"""
import unittest
import os
import shutil
import pickle
from pglt.stages import phylogeny_stage as pstage
from Bio import AlignIO
from Bio import Phylo
from cStringIO import StringIO
from pglt.tools.phylogeny_tools import raxml
# DIRS
work... | gpl-2.0 | 6,822,975,506,853,362,000 | 29.933884 | 76 | 0.610473 | false | 3.356951 | true | false | false |
benhoff/microphone | microphone/pyaudio_.py | 1 | 10383 | import io
import sys
import time
import wave
import logging
import argparse
import contextlib
from os import path
import pyaudio
import zmq
from vexmessage import create_vex_message, decode_vex_message
from microphone.command_manager import CommandManager
PYAUDIO_BIT_MAPPING = {8: pyaudio.paInt8,
... | gpl-3.0 | 4,754,117,668,439,196,000 | 35.689046 | 83 | 0.522007 | false | 4.444777 | false | false | false |
doctori/OpenBicycleDatabase | webScrapping/openBicycleDatabase/testVeloBase.py | 1 | 2785 | import scrapy
import time
from scrapy.selector import Selector
from selenium import webdriver
import traceback
class VeloBaseScrapper(scrapy.Spider):
name = 'velobase'
start_urls = ['http://velobase.com/ListComponents.aspx?ClearFilter=true']
def __init__(self):
self.driver = webdriver.Firefox()
... | gpl-2.0 | 8,169,897,393,561,473,000 | 41.846154 | 192 | 0.576302 | false | 3.783967 | false | false | false |
losonczylab/Zaremba_NatNeurosci_2017 | enrichment_model/enrichment_model_plotting.py | 1 | 7208 | import matplotlib.pyplot as plt
import cPickle as pkl
import numpy as np
import seaborn.apionly as sns
from lab.plotting import histogram
def enrichment(positions):
distances = np.abs(positions[np.isfinite(positions)])
return np.mean(distances), np.std(distances) / np.sqrt(len(distances))
def calc_enrichme... | mit | -686,580,195,003,819,100 | 31.468468 | 104 | 0.602109 | false | 2.927701 | false | false | false |
hakujyo/chessplaying_robot | s.py | 1 | 3258 | import cv2
import numpy as np
import time
from matplotlib import pyplot as plt
cap = cv2.VideoCapture(1) # 读入视频文件
#timeF = 0 #计时器
start=False
if cap.isOpened(): # 判断是否正常打开
rval, frame = cap.read()
start = True
else:
rval = False
time1 = time.time() #计时器
while start: # 循环读取视频帧
... | gpl-3.0 | 3,384,259,414,345,706,500 | 26.740741 | 78 | 0.484536 | false | 2.900935 | false | false | false |
hepochen/py-discount | setup.py | 1 | 1675 | #coding: utf8
import os
import shutil
import subprocess
import glob
from distutils.core import setup
def install_discount():
root = os.path.dirname(os.path.abspath(__file__))
os.chdir('_discount')
subprocess.call('chmod 755 configure.sh'.split())
subprocess.call(
['./configure.sh',
'--... | bsd-3-clause | -4,911,564,756,195,660,000 | 26.032258 | 98 | 0.613731 | false | 3.841743 | false | false | false |
google-research/torchsde | torchsde/_core/methods/tableaus/srid2.py | 1 | 1225 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -7,428,444,745,646,069,000 | 21.685185 | 108 | 0.568163 | false | 2.663043 | false | false | false |
josiahw/pyrover | src/Mapping/BresenhamAlgorithms.py | 1 | 5482 | """
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | bsd-2-clause | 5,967,930,163,098,792,000 | 40.530303 | 105 | 0.643013 | false | 3.487277 | false | false | false |
Johnetordoff/osf.io | api_tests/nodes/views/test_node_contributors_list.py | 6 | 109793 | # -*- coding: utf-8 -*-
from datetime import datetime
import mock
import pytest
import random
from nose.tools import * # noqa:
from api.base.settings.defaults import API_BASE
from api.nodes.serializers import NodeContributorsCreateSerializer
from framework.auth.core import Auth
from osf_tests.factories import (
f... | apache-2.0 | 3,798,452,324,951,407,000 | 35.60987 | 124 | 0.522419 | false | 4.196178 | true | false | false |
ashgillman/Evolution-Plot | evolution-plot.py | 1 | 3868 | #!/usr/bin/env python3
"""Plots the evolution of an algorithm(s) by defining the
relationships between them.
"""
import os
from collections import defaultdict
from functools import partial
import argparse
from textwrap import wrap
import yaml
from graphviz import Digraph
# TODO: remove
from pprint import pprint
__l... | apache-2.0 | 5,106,822,965,566,527,000 | 29.456693 | 70 | 0.585315 | false | 3.84493 | false | false | false |
xesscorp/skidl | docs/_site/files/a-taste-of-hierarchy/intfc_brd.py | 2 | 4256 | from skidl import *
@SubCircuit
def osc(osc1, osc2, gnd,
crystal = Part("Device", 'Crystal', footprint='Crystal:Crystal_HC49-U_Vertical', dest=TEMPLATE),
cap = Part("Device", 'C', value='10pf', footprint='Capacitors_SMD:C_0603', dest=TEMPLATE) ):
'''Attach a crystal and two caps to the osc1 and o... | mit | -1,018,157,882,274,345,600 | 37.690909 | 105 | 0.639333 | false | 2.502058 | false | false | false |
viswimmer1/PythonGenerator | data/python_files/33222291/services.py | 1 | 9740 | import socket, time, os, pprint, pickle, sys
from time import mktime
from datetime import datetime, timedelta
# import os.path
from libs.dbconnect import dbConnector
import libs.utils
global cnf, db
cnf = "door.cnf"
# outpath = "%s/output" % os.path.dirname(__file__)
outpath = "%s/output" % sys.path[0]
def main():... | gpl-2.0 | -2,251,436,603,034,342,100 | 24.167959 | 214 | 0.666016 | false | 2.707812 | false | false | false |
he0x/FIR | fir_nuggets/models.py | 3 | 1271 | # -*- coding: utf-8 -*-
import datetime
from django.db import models
from django import forms
from django.contrib.auth.models import User
from incidents.models import Incident
class Nugget(models.Model):
date = models.DateTimeField(default=datetime.datetime.now, blank=True)
raw_data = models.TextField()
source ... | gpl-3.0 | 722,873,372,476,681,100 | 33.351351 | 123 | 0.718332 | false | 3.416667 | false | false | false |
attm2x/m2x-python-mqtt | m2x_mqtt/v2/commands.py | 1 | 1545 | from m2x_mqtt.v2.resource import Resource
class Command(Resource):
""" Wrapper for AT&T M2X `Commands API <https://m2x.att.com/developer/documentation/v2/commands>`_
"""
COLLECTION_PATH = 'devices/{device_id}/commands'
ITEM_PATH = 'devices/{device_id}/commands/{id}'
ITEMS_KEY = 'commands'
def ... | mit | 8,717,984,222,571,933,000 | 43.142857 | 165 | 0.671197 | false | 3.652482 | false | false | false |
cvast/arches | tests/ui/pages/form_page.py | 1 | 1876 | import re
from base_page import BasePage, script_returns_true
from page_locators import FormPageLocators as locators
from selenium.webdriver.support import expected_conditions as EC
from arches.urls import uuid_regex
class FormPage(BasePage):
"""
class to initialize the form-manager page
"""
def __in... | agpl-3.0 | 4,862,483,298,900,809,000 | 31.344828 | 103 | 0.513859 | false | 4.234763 | false | false | false |
nuagenetworks/vspk-python | vspk/v6/nupgexpressiontemplate.py | 1 | 9684 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause | -2,133,729,240,394,213,600 | 29.07764 | 175 | 0.584056 | false | 4.747059 | false | false | false |
bepo13/destinydb-stl-generator-v0 | src/DataParse.py | 1 | 1078 | import io
import struct
import numpy as np
class DataParseClass:
def __init__(self, byteData):
self.data = io.BytesIO(byteData)
return
def readUTF(self):
length = int.from_bytes(self.data.read(2), byteorder='little')
return self.data.read(length).decode('utf-8')
... | mit | -6,224,637,056,171,936,000 | 31.69697 | 112 | 0.62616 | false | 3.641892 | false | false | false |
ptphp/PyLib | src/sniffer/pyhttp/link_base.py | 1 | 3799 | #encoding=UTF-8
"""
@author ideawu@163.com
@link http://www.ideawu.net/
"""
import new, socket
from buffer import *
LINK_ROLE_SERVER = 1
LINK_ROLE_CLIENT = 2
LINK_ROLE_ACCEPT = 3
class LinkBase:
def __init__(self, sock=None):
self.id = -1
self.fd = None
self.sock = None
self.local_addr = '' # ip:port
self.... | apache-2.0 | 7,084,317,711,486,573,000 | 20.39521 | 61 | 0.653792 | false | 2.394772 | false | false | false |
GeographicaGS/urbo-pgsql-connector | scripts/delete_subscr_list.py | 1 | 3879 | # -*- coding: utf-8 -*-
#
# Copyright 2017 Telefónica Digital España S.L.
#
# This file is part of URBO PGSQL connector.
#
# URBO PGSQL connector 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,... | agpl-3.0 | -1,041,767,896,036,808,600 | 31.308333 | 98 | 0.640186 | false | 3.695901 | false | false | false |
CenterForOpenScience/isp | scripts/drag_scripts/drag_cat9_helper.py | 1 | 4011 | import time
import pyautogui
HESITATE = 3 # time to wait before starting clickstorm
pyautogui.PAUSE = .06 # going faster may cause issues with placement
SPEED = .1
positions = []
print("If you have a dual monitor set up, make sure the browser window is "
"located on your main monitor.\n If you are using a s... | apache-2.0 | 9,005,574,204,654,823,000 | 44.579545 | 79 | 0.695836 | false | 3.527704 | false | false | false |
youknowone/transtool | transtooltests/test_dictionary.py | 1 | 1718 |
#-*- coding: utf-8 -*-
from transtool.dictionary import INILoader
from transtool.dictionary.models import KoreanPackage
from transtool.dictionary.exc import WordNotFound, MultipleCandidates
def assertlog(cond, *logitems):
try:
assert cond
except AssertionError as e:
if logitems:
fo... | gpl-3.0 | 1,862,279,873,957,463,800 | 28.309091 | 83 | 0.640199 | false | 2.818182 | false | false | false |
rougier/dana | doc/examples/chapter-4/example-3.py | 1 | 2413 | w#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright INRIA
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
#
# DANA is a computing framework for the simulation of distributed,
# asynchronous, numerical and adaptive model... | bsd-3-clause | 3,493,214,056,072,307,700 | 41.333333 | 79 | 0.67385 | false | 3.384292 | false | false | false |
kajackdfw/flaskirover | hardware_drivers/motor/raspirobot_board_v3.py | 1 | 1736 | from rrb3 import *
from time import sleep
class Motor:
settings = {}
try:
rr = RRB3(8, 6)
settings['drive'] = 'active'
uis['drive'] = 'active'
except NameError:
print(" - No RaspiRover library available.")
settings['drive'] = 'disabled'
uis['drive'] = 'disa... | gpl-3.0 | -299,814,461,353,550,800 | 31.754717 | 92 | 0.534562 | false | 3.773913 | false | false | false |
NMGRL/pychron | pychron/dvc/dvc_persister.py | 1 | 29201 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 | -5,685,082,766,605,887,000 | 36.341432 | 121 | 0.512517 | false | 4.1256 | false | false | false |
SalehHindi/DC-Killer | SMS_backend.py | 1 | 1532 | '''
This portion of the program sends an SMS
message to the given number. This is one
way the program will communicate with the
user. Another potential way is through
a push notification to a phone if this
was a phone app. I noticed that Chrome
supports browser based push notifications
that are really nice and non obtr... | gpl-2.0 | 4,377,318,372,772,337,000 | 36.390244 | 108 | 0.710836 | false | 3.656325 | false | false | false |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/login.py | 2 | 1507 | """this module makes the connection to fenixedu information and ScheduleMaker"""
import webbrowser
from datetime import datetime
import fenixedu
class Login():
""" Login - asks authorization from user and his code"""
def __init__(self):
config = fenixedu.FenixEduConfiguration.fromConfigFile('fenixed... | bsd-2-clause | 2,121,949,577,441,245,200 | 27.980769 | 87 | 0.587923 | false | 3.884021 | false | false | false |
hadim/fiji_scripts | src/main/resources/script_templates/Hadim_Scripts/Wounding/3_Wounding_Analyzer.py | 2 | 3148 | # @Float(label="Pixel Size (um)", required=false, value=1) pixel_size
# @Float(label="Duration between Two Frames", required=false, value=1) dt
# @String(label="Time unit", required=false, value='s', choices={'sec', 'min', 'hours'}) time_unit
# @Dataset data
# @ImagePlus imp
# @ImageJ ij
import os
import sys
from jav... | bsd-3-clause | 5,236,868,259,599,146,000 | 35.616279 | 117 | 0.773189 | false | 3.306723 | false | false | false |
PROBIC/tigreBrowser | tigreBrowser/results.py | 2 | 13555 | from tigreBrowser.database import *
import xdrlib
class Results:
"""This class is responsible for getting the results from the database
using functions in database.py.
"""
def __init__(self, db, experiment_set, regulator, target_set, experiment, filters, supplementary_options, search_genes):
""... | agpl-3.0 | -7,790,328,812,109,092,000 | 37.183099 | 156 | 0.583401 | false | 3.858525 | false | false | false |
andreimaximov/algorithms | leetcode/algorithms/edit-distance/solution.py | 1 | 1443 | #!/usr/bin/env python
class Solution(object):
def minDistance(self, a, b):
"""
Returns the edit distance between strings a and b.
"""
n = len(a)
m = len(b)
# If either string is empty, we need to add all characters from other
# string.
if n == 0 or ... | mit | -18,678,275,532,948,184 | 31.066667 | 79 | 0.417186 | false | 3.536765 | false | false | false |
jakesyl/pychess | lib/pychess/Players/PyChessFICS.py | 20 | 17313 | from __future__ import print_function
import email.Utils
from gi.repository import Gtk
import math
import pychess
import random
import signal
import subprocess
from threading import Thread
from pychess.compat import urlopen, urlencode
from pychess.Players.PyChess import PyChess
from pychess.System.prefix import addDa... | gpl-3.0 | -6,922,454,449,462,359,000 | 40.123515 | 121 | 0.540923 | false | 3.905482 | false | false | false |
mtu-most/MOST-delta-stage | Welder.py | 1 | 3113 | #Name: Welder
#Info: Mangle GCode to work on welder (2014-02-10)
#Depend: GCode
#Type: postprocess
#Param: speed(float:10) target extruder speed (mm/s)
#Param: mindist(float:1) minimum travel distance to switch off welder (mm)
#Param: ON1(str:G4 P0) Command to insert after travel (line 1)
#Param: ON2(str:M42 P2 ... | gpl-3.0 | 8,612,901,917,585,751,000 | 27.367925 | 89 | 0.596531 | false | 2.502412 | false | false | false |
MSMBA/msmba-workflow | msmba-workflow/srclib/wax/examples/more/fileviewer.py | 1 | 2245 | # fileviewer.py
# Skeleton for a simple file viewer.
from wax import *
from wax.tools.dirview import DirView
def isimage(path):
EXTENSIONS = [".jpg", ".png", ".gif", ".ico", ".bmp"]
path = path.lower()
for ext in EXTENSIONS:
if path.endswith(ext):
return True
return Fal... | gpl-2.0 | -7,461,295,372,494,172,000 | 30.536232 | 72 | 0.565256 | false | 3.938596 | false | false | false |
benjimons/FIR | fir_relations/views.py | 4 | 1626 | from json import dumps
from django.contrib.auth.decorators import login_required, user_passes_test
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from fir_relations.models import Relation
from incidents.views import is_in... | gpl-3.0 | -7,668,384,517,257,130,000 | 45.457143 | 109 | 0.659902 | false | 4.256545 | false | false | false |
coshkun/6.00.1x-MITx-Course-Training-Lab-Notes | snippets/deep-reverse-funtion.midterm-exam-Problem7.py | 1 | 1186 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 13 19:04:45 2017
@author: coskun
Midterm Exam > Problem 6
15.0 points possible (graded)
Implement a function that meets the specifications below.
For example, if L = [[1, 2], [3, 4], [5, 6, 7]]
then deep_reverse(L) mutates L to be [[7, 6, 5], [4, 3], [2, 1]]
"""
#Sam... | mit | 2,050,933,538,805,303,000 | 24.804348 | 69 | 0.616358 | false | 3.137566 | false | false | false |
tjake/cassandra-dtest | paxos_tests.py | 2 | 7208 | # coding: utf-8
from dtest import Tester
from tools import since, no_vnodes
from assertions import assert_unavailable
from cassandra import ConsistencyLevel, WriteTimeout
from cassandra.query import SimpleStatement
import time
from threading import Thread
from ccmlib.cluster import Cluster
@since('2.0.6')
class Test... | apache-2.0 | -6,002,720,541,554,961,000 | 38.604396 | 126 | 0.516232 | false | 4.355287 | true | false | false |
hpparvi/PyTransit | notebooks/contamination/src/blendlpf.py | 1 | 3425 | # PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | gpl-2.0 | -3,812,059,101,771,225,600 | 41.283951 | 111 | 0.623358 | false | 3.060769 | false | false | false |
reimandlab/ActiveDriverDB | website/imports/sites/uniprot/importer.py | 1 | 8466 | import gzip
from abc import abstractmethod
from types import SimpleNamespace
from warnings import warn
from pandas import read_table, to_numeric, DataFrame, read_csv, concat
from helpers.parsers import parse_fasta_file
import imports.protein_data as importers
from imports.sites.site_importer import SiteImporter
cla... | lgpl-2.1 | -4,429,928,574,217,603,600 | 33.983471 | 115 | 0.637491 | false | 3.887052 | false | false | false |
shadyueh/pyranking | ranking/settings.py | 1 | 3310 | """
Django settings for ranking project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... | mit | 4,699,871,452,040,584,000 | 25.062992 | 91 | 0.687009 | false | 3.525027 | false | false | false |
rokgerzelj/taskifier-cortex | model.py | 1 | 2685 | '''
Sentence model, inspired by the Keras VAE tutorial.
Reference: "Auto-Encoding Variational Bayes" https://arxiv.org/abs/1312.6114
'''
import numpy as np
import tensorflow as tf
from keras.layers import Input, Embedding, Dense, Lambda, LSTM, RepeatVector, TimeDistributed
from keras.models import Model
fro... | mit | 9,200,981,815,651,468,000 | 32.87013 | 110 | 0.692365 | false | 2.853348 | false | false | false |
zygmuntz/kaggle-bestbuy_big | train.py | 1 | 1402 | 'http://fastml.com/best-buy-mobile-contest-big-data/'
import sys, csv, re
from collections import defaultdict
def prepare( query ):
query = re.sub( r'\W', '', query )
query = query.lower()
return query
input_file = sys.argv[1]
test_file = sys.argv[2]
benchmark_file = sys.argv[3]
output_file = sys.argv[4]
i = ope... | mpl-2.0 | -5,028,400,967,993,399,000 | 16.759494 | 78 | 0.616262 | false | 2.660342 | false | false | false |
NSLS-II-CHX/ipython_ophyd | startup/10-optics.py | 2 | 10609 | from ophyd import (EpicsMotor, PVPositioner, Device, EpicsSignal,
EpicsSignalRO,PVPositionerPC)
from ophyd import (Component as Cpt, FormattedComponent,
DynamicDeviceComponent as DDC)
#gap
#und_gap = 'SR:C11-ID:G1{IVU20:1-Mtr:2}' #SR:C11-ID:G1{IVU20:1-Mtr:2}Inp:Pos ??
class M... | bsd-2-clause | -1,814,696,963,466,167,600 | 33.898026 | 175 | 0.639551 | false | 2.339876 | false | false | false |
zergov/flashcards | tests/test_study.py | 1 | 2997 | import unittest
import mock
from flashcards.sets import StudySet
from flashcards.cards import StudyCard
from flashcards import study
from flashcards.study import BaseStudySession
from flashcards.study import ShuffledStudySession
def create_study_set():
""" Create a simple study set for test purposes. """
ca... | mit | 3,765,280,307,964,986,000 | 27.817308 | 79 | 0.650651 | false | 3.628329 | true | false | false |
VitalPet/c2c-rd-addons | survey_multi_lang/survey.py | 4 | 3889 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>)
#
# Thi... | agpl-3.0 | -3,906,373,471,924,969,000 | 38.282828 | 115 | 0.620468 | false | 3.648218 | false | false | false |
angr/angr | angr/analyses/decompiler/optimization_passes/__init__.py | 1 | 1733 | # pylint:disable=import-outside-toplevel
from typing import Optional, Union
from archinfo import Arch
from .optimization_pass import OptimizationPassStage
from .stack_canary_simplifier import StackCanarySimplifier
from .base_ptr_save_simplifier import BasePointerSaveSimplifier
from .multi_simplifier import MultiSimpl... | bsd-2-clause | -8,471,061,842,043,066,000 | 28.372881 | 86 | 0.720138 | false | 3.687234 | false | false | false |
edx/ecommerce-worker | ecommerce_worker/cache.py | 1 | 1699 | """
This file contains a primitive cache
"""
from __future__ import absolute_import
import threading
import time
lock = threading.Lock() # pylint: disable=invalid-name
class CacheObject:
"""Object saved in cache"""
def __init__(self, value, duration):
self.value = value
self.expire = time.ti... | agpl-3.0 | -3,115,333,913,301,735,400 | 24.358209 | 88 | 0.537964 | false | 4.591892 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.