repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
guptachetan1997/Episodes | tvshow/migrations/0001_initial.py | 1 | 2641 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-27 10:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | mit | 6,079,971,946,640,756,000 | 40.265625 | 114 | 0.554714 | false | 4.350906 | false | false | false |
amznlabs/amazon-dsstne | python/encoder/encoder.py | 1 | 6255 | '''
Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accom... | apache-2.0 | 2,924,462,601,732,345,000 | 42.137931 | 269 | 0.76275 | false | 3.492462 | false | false | false |
MC-Notes/backend | zenodo_upload_doi.py | 1 | 3465 | import yaml, requests, sys, json, os
argv = sys.argv[1:]
try:
url, access_token, metadata_file, notebook, requirements = argv
except:
print('Usage: python zenodo_upload_doi.py zenodo_url zenodo_access_token metadata_file executed_notebook_file requirements_file \n upload to zenodo url with access token with m... | bsd-3-clause | -2,847,382,097,853,239,300 | 36.268817 | 228 | 0.607215 | false | 3.782751 | false | false | false |
tlatzko/spmcluster | .tox/docs/lib/python2.7/site-packages/sphinx/make_mode.py | 5 | 10500 | # -*- coding: utf-8 -*-
"""
sphinx.make_mode
~~~~~~~~~~~~~~~~
sphinx-build -M command-line handling.
This replaces the old, platform-dependent and once-generated content
of Makefile / make.bat.
This is in its own module so that importing it is fast. It should not
import the main Sphinx m... | bsd-2-clause | 7,218,175,953,279,905,000 | 36.769784 | 89 | 0.57019 | false | 3.900446 | true | false | false |
sinkovit/parse-modules | gensoft.py | 1 | 17849 | import os
import re
# Get rid of intel-dependent modules using "module purge" command and
# then capture list of available modules in single column format
stream = os.popen("module purge; module avail -t 2>&1 >/dev/null")
# Print header
print 'Name,Version,Default,Type,Domain,Handle Type,Handle Key,Description'
# Se... | gpl-3.0 | -3,637,631,161,217,170,000 | 40.800937 | 254 | 0.563113 | false | 3.625635 | false | false | false |
thenetcircle/dino | bin/kafka_to_rabbitmq.py | 1 | 11103 | import json
import logging
import os
import time
import traceback
import yaml
from kafka import KafkaConsumer
from kombu import Connection
from kombu import Exchange
from kombu import Queue
from kombu.pools import producers
logger = logging.getLogger(__name__)
logging.getLogger('kafka').setLevel(logging.WARNING)
logg... | apache-2.0 | -5,821,324,151,827,471,000 | 31.655882 | 108 | 0.585968 | false | 3.851197 | true | false | false |
lnribeiro/scrobbles_importer | scrobbles_importer/utils.py | 1 | 3864 | from lxml import html
from dateutil.relativedelta import relativedelta
import datetime
import requests
import csv
def process_timestamp(timestamp, now=None):
if now == None:
now = datetime.datetime.now()
timestamp_split = timestamp.split()
if timestamp_split[1] == 'minute' or \
timestamp_... | mit | 3,585,621,364,581,686,300 | 31.2 | 99 | 0.581004 | false | 3.611215 | false | false | false |
Transkribus/TranskribusDU | TranskribusDU/ObjectModel/sequenceAPI.py | 1 | 2667 | # -*- coding: utf-8 -*-
"""
object class
Hervé Déjean
cpy Xerox 2009
a class for object
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
class sequenceAPI():
def __init__(self):
# how to crea... | bsd-3-clause | 6,144,799,410,225,956,000 | 27.655914 | 111 | 0.577111 | false | 4.390445 | false | false | false |
elliterate/capybara.py | capybara/tests/app/__init__.py | 1 | 5113 | import flask
from flask import Flask, render_template, request
import json
import time
app = Flask(__name__)
form_post_count = 0
# Ensure application exceptions are raised.
app.debug = True
class AppError(Exception):
pass
@app.route("/")
def hello():
resp = flask.make_response("""Hello world! <a href="wi... | mit | 1,718,382,216,002,752,300 | 21.327511 | 102 | 0.641698 | false | 3.417781 | false | false | false |
jkandasa/integration_tests | cfme/tests/ansible/test_embedded_ansible_services.py | 1 | 15460 | # -*- coding: utf-8 -*-
import fauxfactory
import json
import pytest
from widgetastic_patternfly import BootstrapSelect
from cfme import test_requirements
from cfme.automate.buttons import Button, ButtonGroup
from cfme.services.catalogs.ansible_catalog_item import AnsiblePlaybookCatalogItem
from cfme.services.catalog... | gpl-2.0 | -6,889,566,518,769,227,000 | 37.457711 | 100 | 0.686934 | false | 3.746063 | true | false | false |
codesyntax/cs.zestreleaser.changelog | setup.py | 1 | 1922 | from setuptools import setup, find_packages
import os
version = '1.2.dev0'
setup(
name='cs.zestreleaser.changelog',
version=version,
description="Dump the last commit logs into the CHANGES file",
long_description=open("README.rst").read() + "\n" +
open(os.path.join("docs", "HISTOR... | gpl-2.0 | -6,762,087,700,557,787,000 | 35.961538 | 71 | 0.608221 | false | 4.063425 | false | true | false |
Etenil/anvil | model/bug.py | 1 | 3700 | import web
from anvillib.avatar import avatar, logo
import common
import user
import project
def get_bugs(project=None, user=None, open_only=True):
where = ""
if project != None:
if where != "":
where += " AND "
where = "project=" + web.db.sqlquote(project)
if user != None:
... | mit | -7,456,756,256,054,742,000 | 34.576923 | 92 | 0.517838 | false | 4.115684 | false | false | false |
srio/shadow3-scripts | CONICS/conic_viewer.py | 1 | 13459 |
import numpy
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtWidgets import QDialog, QWidget, QLabel, QSizePolicy
from oasys.widgets import gui as oasysgui
from orangewidget import gui, widget
from matplotlib import cm
from matplotlib.figure import Figure
from matpl... | mit | -3,223,666,265,856,852,500 | 43.717608 | 146 | 0.498403 | false | 2.978314 | false | false | false |
Skippern/GV-scraper | lib/commons.py | 2 | 3694 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Common functions
debugMe = False
def uniq(values):
output = []
seen = set()
for value in values:
if value not in seen:
output.append(value)
seen.add(value)
return output
def lower_capitalized_master(input):
newString = ... | gpl-3.0 | -6,985,711,536,309,698,000 | 33.083333 | 358 | 0.570769 | false | 2.923749 | false | false | false |
hftools/hftools | hftools/file_formats/config.py | 1 | 13743 | # -*- coding: ISO-8859-1 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2014, HFTools Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------------------... | bsd-3-clause | -8,329,595,045,311,821,000 | 30.520642 | 93 | 0.570254 | false | 3.69237 | false | false | false |
huggingface/pytorch-transformers | scripts/check_tokenizers.py | 2 | 5547 | from collections import Counter
import datasets
import transformers
from transformers.convert_slow_tokenizer import SLOW_TO_FAST_CONVERTERS
from transformers.utils import logging
logging.set_verbosity_info()
TOKENIZER_CLASSES = {
name: (getattr(transformers, name), getattr(transformers, name + "Fast")) for name ... | apache-2.0 | -641,955,050,474,739,000 | 31.822485 | 117 | 0.565531 | false | 3.46471 | true | false | false |
urschrei/pyzotero | pre-deploy.py | 1 | 1297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pre-deploy.py
Created by Stephan Hügel on 2017-06-06
A simple check to ensure that the tag version and the library version coincide
Intended to be called before a Wheel is written using "upload"
"""
import os
import sys
import subprocess
import re
import io
if sys.v... | mit | -8,477,441,430,571,577,000 | 25.44898 | 88 | 0.635031 | false | 3.375 | false | false | false |
jofomah/rules | testpy/fraud.py | 1 | 2890 | from durable.lang import *
import random
import time
import json
with ruleset('fraud_detection'):
@when_all(span(10),
(m.t == 'debit_cleared') | (m.t == 'credit_cleared'))
def handle_balance(c):
debit_total = 0
credit_total = 0
if c.s.balance == None:
c.s.balanc... | mit | 4,569,572,407,031,186,400 | 38.067568 | 137 | 0.49654 | false | 3.077742 | false | false | false |
davidyezsetz/kuma | vendor/packages/ipython/IPython/usage.py | 7 | 31160 | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#**********... | mpl-2.0 | -6,625,725,745,857,754,000 | 47.310078 | 79 | 0.641303 | false | 4.47123 | true | false | false |
RuanAragao/peach | tutorial/fuzzy-logic/norms-conorms.py | 6 | 3359 | ################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: tutorial/norms-conorms.py
# How to use t-norms and s-norms (norms and conorms)
####################################################################... | lgpl-2.1 | 3,166,185,819,710,080,000 | 36.170455 | 80 | 0.6234 | false | 2.938758 | false | false | false |
kastnerkyle/pachet_experiments | datasets.py | 1 | 33639 | # Author: Kyle Kastner
# License: BSD 3-clause
# pulled from pthbldr
# Ideas from Junyoung Chung and Kyunghyun Cho
# See https://github.com/jych/cle for a library in this style
from music21 import converter, interval, pitch, harmony, analysis, spanner, midi, meter
import numpy as np
from collections import Counter
from... | bsd-3-clause | -8,299,911,535,359,946,000 | 35.248922 | 155 | 0.553524 | false | 3.630761 | false | false | false |
kshitij10496/goodquotes | goodquotes/parser.py | 1 | 1511 | import requests
from bs4 import BeautifulSoup
from .quote import Quote
# 1. Handle search operation
# 2. Create a soup from the response and send it to the parser
def search_quotes(book_title):
''' Searches for the top quotes of a book as on Goodreads.
Parameters
==========
book_title : str
T... | mit | -7,462,122,594,789,870,000 | 31.148936 | 117 | 0.619457 | false | 3.76808 | false | false | false |
beni55/reserbot | src/conv.py | 1 | 2726 | """
This file is part of reserbot.
reserbot 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.
reserbot is distributed... | gpl-3.0 | 8,553,266,125,033,916,000 | 28.630435 | 86 | 0.584373 | false | 4.142857 | false | false | false |
kovidgoyal/html5-parser | build.py | 1 | 10912 | #!/usr/bin/env python
# vim:fileencoding=utf-8
# License: Apache 2.0 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (absolute_import, division, print_function, unicode_literals)
import argparse
import errno
import glob
import os
import re
import shlex
import shutil
import subprocess
imp... | apache-2.0 | 7,929,690,151,683,214,000 | 35.373333 | 100 | 0.606488 | false | 3.210356 | true | false | false |
fbsder/openthread | tests/scripts/thread-cert/Cert_5_3_03_AddressQuery.py | 1 | 7164 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause | -2,101,855,857,143,839,700 | 42.156627 | 114 | 0.676438 | false | 3.360225 | true | false | false |
chouseknecht/ansible | lib/ansible/modules/network/nos/nos_command.py | 73 | 7281 | #!/usr/bin/python
# Copyright: (c) 2018, Extreme Networks Inc.
# 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)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 | 7,901,426,297,986,718,000 | 31.36 | 109 | 0.637138 | false | 4.323634 | true | false | false |
ahaberlie/MCS | mcs/utils/refl_std_calc.py | 1 | 6914 | import sys, getopt
from scipy.ndimage import imread
import numpy as np
import pickle
import pandas as pd
from multiprocessing import Pool
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
feature_list = ['area', 'convex_area', 'eccentricity',
'intense_... | mit | -1,094,610,160,401,149,200 | 30.148649 | 175 | 0.486549 | false | 3.151322 | false | false | false |
rfleschenberg/django-shop | shop/models/customer.py | 1 | 12897 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import string
from importlib import import_module
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.signals import user_logged_in, user_logged_out
f... | bsd-3-clause | -2,996,134,155,261,087,000 | 33.300532 | 120 | 0.630922 | false | 4.288992 | false | false | false |
dan-boa/lidea | places/models.py | 1 | 3884 | from django.db import models
from django.contrib import admin
class Attribute(models.Model):
osm_id =models.IntegerField(primary_key=True)
lat = models.CharField(max_length=20)
lon = models.CharField(max_length=20)
name = models.CharField(max_length=300)
display_name = models.CharField(max_length=3... | bsd-3-clause | 6,851,334,874,663,260,000 | 48.164557 | 62 | 0.718589 | false | 3.24207 | false | false | false |
rsk-mind/rsk-mind-framework | rsk_mind/utils/utils.py | 1 | 2384 | """Utils.
This file provides functions as utilities.
It makes sense if something can be written
in one method rather than creating a class
then this is the file one can add his/her
method.
"""
def separate_data_from_class(dataset):
"""Separate features from classes.
This method separates feature vectors
... | mit | 2,661,165,919,855,487,000 | 26.72093 | 89 | 0.643037 | false | 4.089194 | false | false | false |
vikingMei/mxnet | example/rnn/nce/src/loader/vocab.py | 2 | 1352 | #!/usr/bin/env python
# coding: utf-8
#
# Usage:
# Author: wxm71(weixing.mei@aispeech.com)
import os
import json
class Vocab(object):
'''
wrd dictionary
'''
PAD = '<pad>'
UNK = '<unk>'
BOS = '<s>'
EOS = '</s>'
PAD_ID = 0
UNK_ID = 1
BOS_ID = 2
EOS_ID = 3
FIRST_VALID_I... | apache-2.0 | -1,289,868,028,489,807,600 | 18.882353 | 53 | 0.533284 | false | 2.68254 | false | false | false |
htgoebel/jinja2rst | setup.py | 1 | 1394 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from jinja2rst import __version__
long_description = "\n\n".join([
open("README.rst").read(),
])
setup(
name="jinja2rst",
version=__version__,
description="""A Simple Tool for Documenting Jinja2 Template-Files""",
long_descr... | gpl-3.0 | -6,395,842,940,200,122,000 | 35.684211 | 85 | 0.651363 | false | 3.937853 | false | false | false |
zeroq/kraut_salad | kraut_parser/management/commands/load_stix.py | 1 | 98651 | # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
import sys, json, re, pytz, os, time, shutil
from dateutil.parser import parse as date_parser
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from stix.utils.parser import EntityParser
# import database models
from... | gpl-2.0 | 5,308,871,253,114,354,000 | 59.708308 | 338 | 0.529027 | false | 4.67762 | false | false | false |
davemc84/bitcoin-payable-black-scholes | bs.py | 1 | 1318 | import json
from flask import Flask, request
from two1.lib.wallet import Wallet
from two1.lib.bitserv.flask import Payment
from scipy.stats import norm
from math import *
app = Flask(__name__)
wallet = Wallet()
payment = Payment(app, wallet)
@app.route('/bs')
@payment.required(10)
def BlackScholes():
data = {}
... | mit | 5,563,092,982,682,979,000 | 28.954545 | 86 | 0.590288 | false | 2.436229 | false | false | false |
ProjectSWGCore/NGECore2 | scripts/mobiles/talus/lost_aqualish_bomber.py | 2 | 1661 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 | 7,402,207,435,354,539,000 | 33.382979 | 126 | 0.803733 | false | 3.328657 | false | false | false |
tykling/tlsscout | src/tlsscout/environment_settings.py | 1 | 1146 | # local settings for this tlsscout installation,
# the {{ foo }} bits should be replaced with real values (by Ansible or by hand)
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hemmelig'
# debug settings - remember to set allowed_hosts if debug is disabled
DEBUG=True
ALLOWED_HOSTS = ... | bsd-3-clause | 3,028,426,428,391,514,000 | 27.65 | 113 | 0.708551 | false | 3.312139 | false | false | false |
annarev/tensorflow | tensorflow/python/ops/op_selector.py | 9 | 13924 | # Copyright 2017 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 | 4,533,258,257,521,256,000 | 32.231504 | 104 | 0.66073 | false | 3.592363 | false | false | false |
ADicksonLab/wepy | src/wepy/runners/openmm.py | 1 | 46448 | """OpenMM molecular dynamics runner with accessory classes.
OpenMM is a library with support for running molecular dynamics
simulations with specific support for fast GPU calculations. The
component based architecture of OpenMM makes it a perfect fit with
wepy.
In addition to the principle OpenMMRunner class there ar... | mit | 5,271,212,579,456,178,000 | 33.07777 | 100 | 0.612621 | false | 4.477779 | false | false | false |
cloudnull/turbolift | turbolift/executable.py | 1 | 1877 | #!/usr/bin/env python
# =============================================================================
# Copyright [2015] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its accuracy
# using the code ... | gpl-3.0 | -9,120,789,592,492,369,000 | 28.793651 | 79 | 0.602557 | false | 4.125275 | false | false | false |
IanLewis/django-lifestream | lifestream/models.py | 1 | 4378 | #:coding=utf-8:
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.db.models import permalink as model_permalink
from django.utils.translation import ugettext_lazy as _
DEFAULT_PLUGINS = (
('lifestream.pl... | mit | 3,687,435,665,807,425,500 | 43.222222 | 165 | 0.670854 | false | 3.73231 | false | false | false |
jithinbp/SEELablet | SEEL/Peripherals.py | 1 | 66680 | from __future__ import print_function
import commands_proto as CP
import numpy as np
import time,inspect
class I2C():
"""
Methods to interact with the I2C port.
.. code-block:: python
#Code Example : Read Values from an HMC5883L 3-axis Magnetometer(compass) [GY-273 sensor] connected to the I2C port
ADDRE... | gpl-3.0 | -6,027,455,906,853,746,000 | 32.190642 | 201 | 0.546176 | false | 3.180842 | false | false | false |
istvanzk/RasPiConnectServer | RasPilib/BuildResponse.py | 1 | 1225 | #!/usr/local/bin/python3
# Filename: BuildResponse.py
# Version 1.0 03/17/13 RV MiloCreek
# Version 3.0 04.04.2016 IzK (Python3.4+)
import xml.etree.ElementTree as ET
import Config
def buildHeader(root):
objectServerID = root.find("./OBJECTSERVERID").text
objectID = root.find("./OBJECTID").text
objectType = root... | gpl-3.0 | 2,517,438,708,442,274,300 | 19.081967 | 52 | 0.698776 | false | 3.284182 | false | false | false |
shiny-fortnight/reverse_search | modules/OpenCNAMAPI.py | 1 | 1838 | #!/bin/python
# coding: utf-8
"""
Python API to retrieve Caller ID from phone number using OpenCNAM api.
"""
import requests
from bs4 import BeautifulSoup
import json
import phonenumbers
from flask import Markup
from config import OPEN_CNAM_KEY, OPEN_CNAM_SECRET
class OpenCNAMAPI(object):
"""
OpenCNAMAP... | apache-2.0 | -8,410,313,618,679,996,000 | 29.633333 | 133 | 0.597933 | false | 3.683367 | false | false | false |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/io/registry.py | 1 | 15224 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import re
import sys
import numpy as np
from ..utils import OrderedDict
from ..extern import six
from ..extern.six.moves import zip
__all__ = ... | mit | 3,126,788,729,992,629,000 | 35.247619 | 91 | 0.588544 | false | 4.202043 | false | false | false |
suutari-ai/shoop | shuup/admin/modules/products/views/edit.py | 3 | 8816 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
... | agpl-3.0 | 9,131,972,575,533,516,000 | 34.405622 | 113 | 0.616606 | false | 4.062673 | false | false | false |
cedadev/jasmin_cis | cis/test/unit/colocate/test_GridCellBinIndex.py | 3 | 3890 | import unittest
from hamcrest import *
from cis.collocation import data_index
from cis.data_io.hyperpoint import HyperPoint
from cis.collocation.col_implementations import make_coord_map, BinnedCubeCellOnlyConstraint
from cis.test.util.mock import *
from cis.time_util import convert_datetime_to_std_time
class TestG... | gpl-3.0 | 5,422,176,945,822,419,000 | 56.205882 | 117 | 0.619023 | false | 3.628731 | true | false | false |
mar77i/pygame-coloring | coloring.py | 1 | 6269 | #!/usr/bin/env python3
# What is this? Where Am I?
#
# This is the Python3 script which was used to create the album in [0]
# - Python is an interpreted programming language that is widely available
# - Pygame is a game engine based on SDL, which I'm not sure how well its
# python3-based version ports to non-Linux p... | isc | -1,741,865,867,718,174,200 | 25.790598 | 79 | 0.626416 | false | 2.704487 | false | false | false |
kupferlauncher/kupfer | kupfer/plugin/chromium.py | 1 | 1629 | __kupfer_name__ = _("Chromium Bookmarks")
__kupfer_sources__ = ("BookmarksSource", )
__description__ = _("Index of Chromium bookmarks")
__version__ = ""
__author__ = "Francesco Marella <francesco.marella@gmail.com>"
from kupfer.objects import Source
from kupfer.objects import UrlLeaf
from kupfer import config
from kup... | gpl-3.0 | -8,736,671,796,709,256,000 | 33.659574 | 87 | 0.645795 | false | 3.973171 | false | false | false |
fikr4n/iclib-python | iclib/formula.py | 1 | 6016 | # Copyright (C) 2015 Fikrul Arif
#
# 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 | 953,751,752,289,468,500 | 28.635468 | 77 | 0.638797 | false | 2.541614 | false | false | false |
onlytiancai/warning-agent | src/loggers/default.py | 1 | 1878 | # -*- coding: utf-8 -*-
import logging
import logging.handlers
import json
from datetime import datetime
from log_watcher import LogWatcher
class Logger(object):
'Logger插件类,必须使用Logger作为类名'
log_caches = []
def __init__(self, options):
'插件初始化方法,options是插件配置数据'
self.log_filename = options[... | mit | 4,283,336,998,327,853,600 | 28.118644 | 117 | 0.613504 | false | 3.181481 | false | false | false |
lewisodriscoll/sasview | src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py | 1 | 5960 | import wx
import wx.lib.newevent
from parameters_panel_slicer import SlicerParameterPanel
from sas.sasgui.guiframe.utils import format_number
from sas.sasgui.guiframe.panel_base import PanelBase
from sas.sasgui.guiframe.events import (SlicerParameterEvent, EVT_SLICER_PARS,
EVT_SL... | bsd-3-clause | 2,599,453,730,093,126,000 | 39.27027 | 80 | 0.490101 | false | 3.944408 | false | false | false |
varunarya10/oslo.utils | tests/test_strutils.py | 1 | 26836 | # -*- coding: utf-8 -*-
# Copyright 2011 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/LICE... | apache-2.0 | -2,133,576,033,340,230,100 | 44.158249 | 79 | 0.576536 | false | 3.835836 | true | false | false |
edx/edx-app-ios | Pods/NewRelicAgent/NewRelic.xcframework/Resources/urllib3/util/url.py | 15 | 13964 | from __future__ import absolute_import
import re
from collections import namedtuple
from ..exceptions import LocationParseError
from ..packages import six
url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]
# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs withou... | apache-2.0 | -7,555,533,897,626,720,000 | 31.474419 | 88 | 0.544328 | false | 3.511189 | false | false | false |
lukess/heron | integration-test/src/python/integration_test/topology/test_topology_main.py | 6 | 3381 | # copyright 2016 twitter. 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 or agree... | apache-2.0 | 882,803,147,863,989,500 | 44.689189 | 89 | 0.769891 | false | 3.311459 | true | false | false |
mneedham91/PyPardot4 | pypardot/objects/lists.py | 1 | 2321 | class Lists(object):
"""
A class to query and use Pardot lists.
List field reference: http://developer.pardot.com/kb/object-field-references/#list
"""
def __init__(self, client):
self.client = client
def query(self, **kwargs):
"""
Returns the lists matching the specifie... | mit | -3,936,822,104,668,460,500 | 34.166667 | 112 | 0.585523 | false | 4.064799 | false | false | false |
mcalmer/spacewalk | spacewalk/certs-tools/sslToolCli.py | 5 | 18404 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 | -7,139,792,451,302,659,000 | 41.8 | 313 | 0.649098 | false | 3.717229 | false | false | false |
uclouvain/osis | education_group/ddd/domain/_address.py | 1 | 1666 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 | 4,784,884,297,978,212,000 | 42.815789 | 87 | 0.643243 | false | 4.111111 | false | false | false |
rutube/django-cacheops | cacheops/jinja2.py | 7 | 2335 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from jinja2 import nodes
from jinja2.ext import Extension
import cacheops
from cacheops.utils import carefully_strip_whitespace
class CacheopsExtension(Extension):
tags = ['cached_as', 'cached']
def parse(self, parser):
lineno = parser.... | bsd-3-clause | -7,490,557,314,794,779,000 | 32.357143 | 94 | 0.589722 | false | 4.169643 | false | false | false |
ibackus/diskpy | diskpy/ICgen/pos_class.py | 1 | 13918 | # -*- coding: utf-8 -*-
"""
Defines a function to randomly generate particle positions according to
the desired surface density profile (sigma vs r) and the vertical profile
(rho vs r,z).
Created on Mon Jan 27 18:48:04 2014
@author: ibackus
"""
__version__ = "$Revision: 1 $"
# $Source$
__iversion__ = int(filter(st... | mit | -4,025,516,964,958,830,000 | 33.367901 | 91 | 0.538439 | false | 3.7085 | false | false | false |
phil65/script.maps.browser | resources/lib/imagetags.py | 2 | 1887 | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
from __future__ import absolute_import
from __future__ import unicode_literals
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary... | gpl-2.0 | -8,061,429,016,687,185,000 | 32.105263 | 114 | 0.605193 | false | 3.07329 | false | false | false |
makeyourowntextminingtoolkit/makeyourowntextminingtoolkit | text_mining_toolkit/word_processing.py | 1 | 1891 | # module apply processing to text (not word lists)
import collections
import pandas
import re
# keep words longer than minimum
def keep_words_min_length(input_words_list, min_length):
output_words_list = [word for word in input_words_list if (len(word) >= min_length)]
return output_words_list
# count word ... | gpl-2.0 | -8,726,895,892,279,821,000 | 34.037037 | 93 | 0.692226 | false | 3.413357 | false | false | false |
TomAugspurger/pandas | asv_bench/benchmarks/gil.py | 1 | 7432 | import numpy as np
from pandas import DataFrame, Series, date_range, factorize, read_csv
from pandas.core.algorithms import take_1d
from .pandas_vb_common import tm
try:
from pandas import (
rolling_median,
rolling_mean,
rolling_min,
rolling_max,
rolling_var,
rolli... | bsd-3-clause | -5,894,324,168,940,892,000 | 23.447368 | 87 | 0.560011 | false | 3.776423 | true | false | false |
nephila/django-filer | filer/fields/folder.py | 3 | 5039 | #-*- coding: utf-8 -*-
from django.template.loader import render_to_string
import inspect
import warnings
from django import forms
from django.conf import settings
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
from django.contrib.admin.sites import site
from django.core.urlresolvers import reverse
from... | bsd-3-clause | -669,460,041,636,375,300 | 36.051471 | 82 | 0.595158 | false | 3.955259 | false | false | false |
rebeccabilbro/machine-learning | code/knn.py | 3 | 1815 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn import neighbors, datasets
k = 15 # Number of neighbors
h = .02 # step size in the mesh
# Create color maps
cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA', '#AAAAFF'])
cmap_bold = ListedColormap(['#FF00... | mit | 5,141,801,847,949,297,000 | 32 | 78 | 0.564187 | false | 3.229537 | false | false | false |
noironetworks/horizon | openstack_dashboard/dashboards/identity/users/tabs.py | 1 | 1067 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | -7,834,945,866,833,353,000 | 30.382353 | 75 | 0.718838 | false | 3.996255 | false | false | false |
GjjvdBurg/DoelenCalendar | dedoelen/core/scraper.py | 1 | 4336 |
"""
In this file all functions related to scraping are defined.
"""
import cookielib
import feedparser
import logging
import mechanize
import time
from httplib import IncompleteRead
from urllib2 import URLError
from dedoelen.core.conf import settings
from dedoelen.utils.progress import ophaal_progress
logger = log... | gpl-2.0 | -3,238,095,630,227,440,600 | 34.252033 | 80 | 0.616006 | false | 3.956204 | false | false | false |
smashwilson/strac | setup.py | 1 | 1673 | from setuptools import setup, find_packages
setup(
name='Strac',
description='Trac bindings for the Store version control system.',
author='Ash Wilson',
author_email='smashwilson@gmail.com',
keywords='trac plugin store smalltalk visualworks',
url='http://azurefire.net',
version='0.2',
... | mit | 6,065,949,757,541,722,000 | 39.804878 | 77 | 0.747759 | false | 4.345455 | false | false | false |
arpadpe/plover | plover/log.py | 1 | 5003 | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""A module to handle logging."""
import os
import sys
import logging
import traceback
from logging.handlers import RotatingFileHandler
from logging import DEBUG, INFO, WARNING, ERROR
from plover.oslayer.config import CONFIG_DIR
LOG_FORMAT = '%(asct... | gpl-2.0 | 8,268,895,377,276,110,000 | 32.13245 | 76 | 0.641615 | false | 3.976948 | false | false | false |
taotaocoule/stock | learn/see.py | 1 | 4428 | import numpy as np
import pandas as pd
import tushare as ts
import matplotlib.pyplot as plt
data=ts.get_k_data("600000")
data['value']=100*(data.close.shift(-10)-data.close)/data.close
def ma(data,column,type,name='MA_'):
for i in type:
data[name+str(i)]=pd.rolling_mean(data[column],i)
... | mit | 8,334,354,829,499,971,000 | 32.169492 | 115 | 0.679901 | false | 2.251397 | false | false | false |
nortikin/sverchok | nodes/modifier_change/subdivide_to_quads.py | 1 | 5948 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 | 8,997,392,186,806,361,000 | 40.02069 | 129 | 0.651143 | false | 3.715178 | false | false | false |
UI-DataScience/summer2014 | hw6/sqlcensus.py | 1 | 2064 | #!/usr/bin/python
# Week 6 Problem 2
# Do not delete the comments.
# Do not chnage the functions names, do not change the input parameters.
# Do not change the return types of the functions.
# Your code goes to the part where it says your code goes here.
# Do not change anything else other than the part where it says ... | mit | 4,480,019,971,165,332,500 | 28.927536 | 84 | 0.631783 | false | 3.73913 | false | false | false |
neozhaoliang/pywonderland | src/misc/modulargroup.py | 1 | 7413 | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Draw the hyperbolic tiling of the Poincare upper plane
by fundamental domains of the modular group PSL_2(Z).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A short introduction to the math behind this script:
PSL_2(Z) is an inf... | mit | -4,316,297,907,170,782,700 | 29.24898 | 87 | 0.569019 | false | 3.120421 | false | false | false |
saltstack/salt-pylint | saltpylint/blacklist.py | 1 | 25781 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2017 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
saltpylint.blacklist
~~~~~~~~~~~~~~~~~~~~
Checks blacklisted imports and code usage ... | apache-2.0 | 495,328,092,537,732,000 | 44.307557 | 144 | 0.511947 | false | 4.549144 | true | false | false |
xiaq/chat | main.py | 1 | 14033 | #!/bin/sh
# Polyglot hack to ensure we execute the correct Python.
''':'
pythons='python2.7 python2 python'
for p in $pythons; do
hash $p 2>/dev/null && exec $p "$0" "$@"
done
echo >&2 "None of $pythons found"
exit 1
#'''
import re
import sys
import json
import os.path
from PyQt4.QtCore import Qt
from PyQt4.QtGui ... | bsd-2-clause | 899,870,807,859,217,200 | 30.534831 | 78 | 0.532317 | false | 3.873309 | true | false | false |
woodymit/millstone | genome_designer/genome_finish/assembly.py | 1 | 21159 | import datetime
import os
import pickle
import subprocess
import re
from Bio import SeqIO
from celery import group
from celery import task
from django.conf import settings
from genome_finish.graph_contig_placement import graph_contig_placement
from genome_finish.millstone_de_novo_fns import add_paired_mates
from geno... | mit | 3,070,510,125,418,985,000 | 34.741554 | 79 | 0.641713 | false | 3.491008 | false | false | false |
twitterdev/twitter-python-ads-sdk | tests/test_line_item.py | 1 | 1968 | import responses
import unittest
from tests.support import with_resource, with_fixture, characters
from twitter_ads.account import Account
from twitter_ads.campaign import LineItem
from twitter_ads.client import Client
from twitter_ads.cursor import Cursor
from twitter_ads import API_VERSION
@responses.activate
def... | mit | 1,406,167,168,076,983,300 | 28.373134 | 86 | 0.613821 | false | 4.032787 | false | false | false |
centrofermi/e3pipe | config/__dqm__.py | 1 | 2875 | #!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... | gpl-3.0 | 3,552,880,437,226,547,000 | 39.492958 | 74 | 0.582261 | false | 3.267045 | false | false | false |
Brainbuster/openpli-buildumgebung | openembedded-core/meta/lib/oe/cachedpath.py | 9 | 8006 | #
# Based on standard python library functions but avoid
# repeated stat calls. Its assumed the files will not change from under us
# so we can cache stat calls.
#
import os
import errno
import stat as statmod
class CachedPath(object):
def __init__(self):
self.statcache = {}
self.lstatcache = {}
... | gpl-2.0 | -6,546,598,062,595,758,000 | 33.360515 | 100 | 0.557582 | false | 4.126804 | false | false | false |
rizumu/bootmachine | bootmachine/contrib/distros/rackspace_ubuntu_1304.py | 1 | 3471 | import time
from fabric.api import env, run, sudo
from fabric.contrib.files import append, sed, uncomment
from fabric.context_managers import settings as fabric_settings
from fabric.operations import reboot
import settings
DISTRO = "UBUNTU_1304"
SALT_INSTALLERS = ["ppa"]
def bootstrap():
"""
Bootstrap Ubu... | mit | 4,256,796,410,000,675,000 | 32.375 | 118 | 0.634976 | false | 3.396282 | false | false | false |
tic-ull/ufc | models.py | 1 | 2730 | # -*- coding: utf-8 -*-
from sqlalchemy import Table, Column, Integer, String, DateTime, MetaData
from sqlalchemy.orm import mapper
import datetime
metadata = MetaData()
tabla_log = Table('log', metadata,
Column('id', Integer, primary_key=True, nullable=False, autoincrement=True),
Column('helo_name', String(... | gpl-3.0 | 8,346,693,289,831,993,000 | 43.032258 | 277 | 0.665934 | false | 3.468869 | false | false | false |
0xDCA/marshmallow | examples/flask_example.py | 1 | 4063 | from datetime import datetime
from flask import Flask, jsonify, request
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import IntegrityError
from marshmallow import Schema, fields, ValidationError
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:////tmp/quotes.db'
db = SQLAlchemy... | mit | 4,277,321,946,767,642,600 | 30.742188 | 80 | 0.643859 | false | 3.576585 | false | false | false |
carlgao/lenga | images/lenny64-peon/usr/share/python-support/mercurial-common/mercurial/osutil.py | 1 | 1031 | import os, stat
def _mode_to_kind(mode):
if stat.S_ISREG(mode): return stat.S_IFREG
if stat.S_ISDIR(mode): return stat.S_IFDIR
if stat.S_ISLNK(mode): return stat.S_IFLNK
if stat.S_ISBLK(mode): return stat.S_IFBLK
if stat.S_ISCHR(mode): return stat.S_IFCHR
if stat.S_ISFIFO(mode): return stat.S_I... | mit | 1,000,682,701,105,348,000 | 26.864865 | 65 | 0.620757 | false | 3.114804 | false | false | false |
napsternxg/gensim | gensim/models/word2vec.py | 1 | 91385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Shiva Manne <manneshiva@gmail.com>
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the word2vec family of algorithms, using highly optimized C routines,
data stre... | gpl-3.0 | 7,090,123,018,778,917,000 | 44.26003 | 120 | 0.617695 | false | 4.02183 | false | false | false |
andrejborstnik/lvr | prevedbe.py | 1 | 11901 | from booli import *
from re import sub
from util import primer
def prazna(n):
"""Naredi prazno tabelo nxn."""
return [[0]*n for i in range(n)]
def barvanje(g,k):
"""Prevede problem barvanja grafa g s k barvami na SAT."""
def sprem(v,b):
return Spr("\""+str(v)+"\""+","+str(b))
#vsako ... | gpl-2.0 | 8,473,260,383,679,752,000 | 35.486154 | 202 | 0.512903 | false | 2.214793 | false | false | false |
Lorwp/afch-rewrite | scripts/release.py | 1 | 2580 | """
release.py: release a new version of afch-rewrite. Updates files,
commits them, adds a new tag in git, and uploads it all to the remote.
(C) 2014 Theopolisme <theopolismewiki@gmail.com>
Usage
=====
Run from the main afch-rewrite directory and follow instructions:
>>> python scripts/release.py
"""
import re
impo... | gpl-3.0 | 2,703,377,019,937,028,000 | 27.351648 | 110 | 0.684109 | false | 3.154034 | false | false | false |
buildingenergy/buildingenergy-platform | seed/exporter.py | 1 | 4531 | """
:copyright: (c) 2014 Building Energy Inc
:license: see LICENSE for more details.
"""
import os
import tempfile
import unicodecsv as csv
import xlwt
from django.db.models.fields import FieldDoesNotExist
from django.db.models import Manager
from django.db.models.fields.related import (
ForeignRelatedObjectsDescri... | apache-2.0 | -761,200,422,622,874,100 | 26.969136 | 79 | 0.623483 | false | 3.985048 | false | false | false |
turbulenz/turbulenz_local | turbulenz_local/lib/deploy.py | 1 | 37875 | # Copyright (c) 2010-2014 Turbulenz Limited
"""
Controller class for deploying a game
"""
from urllib3.exceptions import HTTPError, SSLError
from simplejson import dump as json_dump, load as json_load, loads as json_loads, JSONDecodeError
from os import stat, sep, error, rename, remove, makedirs, utime, access, R_OK, ... | mit | -3,223,949,303,822,132,000 | 39.508021 | 120 | 0.464264 | false | 4.585351 | false | false | false |
xjw1001001/IGCexpansion | reconstruction_data/SR_Thornton/ERaERbprocessor.py | 1 | 2857 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 07 21:43:37 2017
@author: xjw1001001
"""
from Bio import SeqIO
seq_dictprotein = SeqIO.to_dict(SeqIO.parse('./ER/ERpreprocess/processed alignmentER.fasta', "fasta" ))
seq_dictnucleotide = SeqIO.to_dict(SeqIO.parse( './ER/ERpreprocess/ERaERb.fasta', "fasta" ))
seq_dictpro... | gpl-3.0 | 813,197,413,143,417,100 | 31.83908 | 103 | 0.644382 | false | 2.471453 | false | false | false |
kugg/wifirssi | wifirssi/map.py | 1 | 2716 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2015 by Christoffer Jerkeby <kugghjul@gmail.com>
#
# This file is a demonstration of wifi overlap
#
# 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 Sof... | gpl-3.0 | -3,676,496,556,156,119,000 | 31.333333 | 77 | 0.652062 | false | 3.705321 | false | false | false |
TravisFSmith/SweetSecurity | install/kibana.py | 1 | 5570 | import json
import os
import shutil
import sys
from time import sleep
import hashCheck
def install(chosenInterfaceIP):
kibanaLatest = '5.5.1'
cpuArch = os.uname()[4]
cwd = os.getcwd()
# Install Kibana
kibanaInstalled = False
if os.path.isfile('/opt/kibana/bin/kibana'):
kibanaVersion ... | apache-2.0 | 2,205,868,907,990,341,400 | 44.284553 | 119 | 0.627648 | false | 3.22338 | false | false | false |
baygeldin/gdb-js | src/scripts/context.py | 1 | 1230 | import gdb
from builtins import str
class ContextCommand(BaseCommand):
"""Lists all symbols in the current context."""
def __init__(self):
super(ContextCommand, self).__init__("context")
def action(self, arg, from_tty):
frame = gdb.selected_frame()
block = frame.block()
n... | mpl-2.0 | -2,940,325,397,646,687,700 | 33.166667 | 67 | 0.477236 | false | 5.020408 | false | false | false |
GeoscienceAustralia/PF3D | source/aim/logmodule.py | 1 | 1418 | import logging, sys, time
class StreamLogger(object):
def __init__(self, stream, log, echo=True):
self.stream = stream
self.data = ''
self.log = log
self.echo = echo
def write(self, data):
if self.echo:
self.stream.write(data)
self.stream.flush(... | gpl-3.0 | -7,148,585,846,924,369,000 | 25.259259 | 100 | 0.588152 | false | 3.906336 | false | false | false |
xouillet/RendezMoiMesPlumes | pigeon/weights/migrations/0002_auto_20170708_1733.py | 1 | 2665 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-08 17:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('weights', '0001_initial'),
]
operations = [
migrations.AlterField(
... | gpl-3.0 | -1,397,764,478,889,547,800 | 32.3125 | 75 | 0.553096 | false | 4.333333 | false | false | false |
desihub/desitarget | py/desitarget/mock/sky.py | 1 | 2356 | import numpy as np
import healpy as hp
def _random_theta_phi(nside, pix):
theta, phi = hp.pix2ang(nside, pix, nest=True)
dpix = np.sqrt(hp.nside2pixarea(nside))
theta += np.random.uniform(-dpix/2, dpix/2, size=len(theta))
phi += np.random.uniform(-dpix/2, dpix/2, size=len(phi)) * np.cos(np.pi/2 - theta... | bsd-3-clause | 1,450,849,925,161,240,600 | 34.69697 | 86 | 0.633277 | false | 3.404624 | false | false | false |
jacksonLighten/JASE | src/clearqueries.py | 1 | 1702 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from query import Query
from stemming.porter2 import stem
import string
def apply_stemming(query_list):
clean_queries = []
for query in query_list:
query.text = [stem(w) for w in query.text]
clean_queries.append(query)
return clean_queries
de... | mit | 1,818,001,939,718,419,200 | 23.285714 | 75 | 0.619412 | false | 3.497942 | false | false | false |
amaxwell/datatank_py | datatank_py/DTPyCoreImage.py | 1 | 6438 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
# NB: loading all of the bridged modules up front results in a
# pretty huge performance hit (~ 1 second just in importing).
import numpy as np
def __interleaved_rgb_from_planes(red, green, blue):
... | bsd-3-clause | -3,509,370,535,737,964,500 | 37.550898 | 274 | 0.678627 | false | 3.413574 | false | false | false |
LCAV/pyroomacoustics | pyroomacoustics/sync.py | 1 | 2954 | from __future__ import division
import numpy as np
try:
import mkl_fft._numpy_fft as fft
except:
from numpy import fft
def tdoa(signal, reference, interp=1, phat=False, fs=1, t_max=None):
'''
Estimates the shift of array signal with respect to reference
using generalized cross-correlation
Pa... | mit | 2,937,118,617,201,474,000 | 23.823529 | 69 | 0.604604 | false | 3.231947 | false | false | false |
radiasoft/pykern | pykern/pkjson.py | 1 | 1794 | # -*- coding: utf-8 -*-
u"""JSON wrapper
:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import json
#: how bytes are encoded
ENCODING = 'utf-8'
class Encoder(json.JSON... | apache-2.0 | 357,937,379,750,395,260 | 24.628571 | 109 | 0.633222 | false | 3.82516 | false | false | false |
submergerock/avatar-hadoop | build/hadoop-0.20.1-dev/contrib/hod/hodlib/Common/socketServers.py | 182 | 24140 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... | apache-2.0 | 8,200,861,974,760,917,000 | 37.872786 | 124 | 0.537862 | false | 4.122972 | false | false | false |
pprakhar30/MOQA | documents.py | 1 | 2397 | import gzip
import json
import nltk
import numpy as np
from collections import defaultdict
from nltk.stem import SnowballStemmer
from utils import check_sent, normalize
from nltk.tokenize import RegexpTokenizer
tokenizer = RegexpTokenizer(r'\w+')
stemmer = SnowballStemmer("english")
class QAdoc:
def __init__(s... | mit | 7,389,190,616,030,479,000 | 24.231579 | 127 | 0.705882 | false | 2.908981 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.