repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fresskarma/tinyos-1.x | tools/python/pytos/util/RoutingMessages.py | 1 | 7725 | # "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written agreement
# is hereby granted, provided that the above copyright notice, the follow... | bsd-3-clause | 4,245,047,028,988,728,300 | 36.139423 | 95 | 0.667961 | false | 3.640434 | false | false | false |
newsages/nQTrucks | ntrain/puertoct/truck2/prep.py | 1 | 5615 | #!/usr/bin/python
import os
from PIL import Image
import uuid
import shutil
import sys
WIDTH=52
HEIGHT=13
COUNTRY='trucks2'
#WIDTH=52
#HEIGHT=13
#COUNTRY='eu'
#constants
OPENCV_DIR= '/usr/bin'
SAMPLE_CREATOR = OPENCV_DIR + '/opencv_createsamples'
BASE_DIR = './'
OUTPUT_DIR = BASE_DIR + "out... | gpl-3.0 | -3,035,221,647,513,750,500 | 28.708995 | 225 | 0.636331 | false | 3.201254 | false | false | false |
marnnie/Cable-buenaventura | plugin.video.genesis/resources/lib/sources/mvsnap_mv_tv.py | 1 | 4444 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 | 2,883,124,037,299,441,000 | 31.437956 | 126 | 0.54928 | false | 3.932743 | false | false | false |
metabrainz/botbot-web | botbot/apps/plugins/core/logger.py | 1 | 2002 | import re
from botbot.apps.logs.models import Log
from botbot_plugins.base import BasePlugin
import botbot_plugins.config as config
class Config(config.BaseConfig):
ignore_prefixes = config.Field(
default=["!-"],
required=False,
help_text="""
Specify a list of regular expressi... | mit | 801,682,193,017,813,800 | 28.880597 | 77 | 0.545455 | false | 4.46875 | true | false | false |
evanmiltenburg/Dutch-corpora | overheid/scripts/make_xml_plain.py | 1 | 1350 | from bs4 import BeautifulSoup
import nltk.data
from nltk.tokenize import word_tokenize
import glob
import gzip
import sys
tokenizer = nltk.data.load('tokenizers/punkt/dutch.pickle')
def good_sentence(s):
if len(s) < 4 or s.count(',') > 4:
return False
else:
digits = filter(lambda x:x.isdigit()... | apache-2.0 | 3,827,033,118,878,343,000 | 31.926829 | 86 | 0.568148 | false | 3.452685 | false | false | false |
erikdejonge/newsrivr | daemons/oauth.py | 1 | 23551 | """
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | gpl-2.0 | 6,105,287,884,939,560,000 | 34.416541 | 86 | 0.617893 | false | 4.342799 | false | false | false |
datapythonista/pandas | pandas/core/arrays/sparse/accessor.py | 2 | 11479 | """Sparse accessor"""
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.cast import find_common_type
from pandas.core.accessor import (
PandasDelegate,
delegate_names,
)
from pandas.core.arrays.sparse.array import SparseArray
from pandas.core.arrays.sp... | bsd-3-clause | -6,695,402,877,092,622,000 | 29.287599 | 86 | 0.531492 | false | 3.959641 | false | false | false |
nkalodimas/invenio | modules/bibsched/lib/bibtask.py | 1 | 50380 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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
## ... | gpl-2.0 | 5,392,646,837,147,061,000 | 41.622673 | 228 | 0.583426 | false | 3.780296 | false | false | false |
alanmcruickshank/superset-dev | superset/connectors/druid/models.py | 1 | 45334 | # pylint: disable=invalid-unary-operand-type
from collections import OrderedDict
from copy import deepcopy
from datetime import datetime, timedelta
import json
import logging
from multiprocessing import Pool
from dateutil.parser import parse as dparse
from flask import escape, Markup
from flask_appbuilder import Model... | apache-2.0 | -5,881,308,706,200,281,000 | 35.677994 | 89 | 0.527088 | false | 4.143118 | false | false | false |
shsdev/khclass | khclarifai/khclarifai_predict.py | 1 | 1302 | #!/usr/bin/env python
# coding=UTF-8
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from math import floor
from clarifai.rest import ClarifaiApp
from config.configuration import data_path, test_set_id, clarifai_api_key, clarifai_model_name
def floored_percentage(val, digits):
... | gpl-3.0 | -7,671,868,139,313,991,000 | 34.189189 | 115 | 0.667435 | false | 3.304569 | false | false | false |
h2g2bob/ynmp-wikipedia-sync | chgparty_dot.py | 1 | 5461 | import csv
from collections import defaultdict
from collections import namedtuple
class Pty(object):
def __init__(self, ynmp, name, rank=3, color="white"):
self.ynmp = ynmp
self.name = name.replace('"', '').replace("'", "")
self.rank = rank
self.color = color
self.code = "".join(x for x in self.ynmp if x.is... | agpl-3.0 | -6,079,931,843,688,282,000 | 38.572464 | 298 | 0.680461 | false | 2.942349 | false | false | false |
underyx/TheMajorNews | main.py | 1 | 2711 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import config
import requests
from requests_oauthlib import OAuth1
from base64 import b64encode
def get_access_token():
token = config.twitter_app_key + ':' + config.twitter_app_secret
h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
... | mit | 2,091,146,900,491,236,900 | 28.467391 | 79 | 0.569532 | false | 3.683424 | true | false | false |
hunse/vrep-python | dvs-play.py | 1 | 1515 | """
Play DVS events in real time
TODO: deal with looping event times for recordings > 65 s
"""
import numpy as np
import matplotlib.pyplot as plt
import dvs
def close(a, b, atol=1e-8, rtol=1e-5):
return np.abs(a - b) < atol + rtol * b
def imshow(image, ax=None):
ax = plt.gca() if ax is None else ax
ax.i... | gpl-2.0 | 5,992,263,968,722,449,000 | 21.279412 | 81 | 0.59538 | false | 2.467427 | false | false | false |
jasonmaier/CircularEconomyBlog | db_repository/versions/013_migration.py | 1 | 1155 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
tasks = Table('tasks', pre_meta,
Column('id', INTEGER, primary_key=True, nullable=False),
Column('priority', INTEGER, nullable=False),
Column('user_id', INTEGER),
Column('ta... | bsd-3-clause | 1,869,276,016,205,127,000 | 30.216216 | 68 | 0.688312 | false | 3.799342 | false | false | false |
dwaiter/django-filebrowser-old | filebrowser/base.py | 1 | 5606 | # coding: utf-8
# imports
import os, re, datetime
from time import gmtime, strftime
# django imports
from django.conf import settings
# filebrowser imports
from filebrowser.settings import *
from filebrowser.functions import get_file_type, url_join, is_selectable, get_version_path
# PIL import
if STRICT_PIL:
fr... | bsd-3-clause | 1,552,659,356,722,771,000 | 26.082126 | 117 | 0.539422 | false | 3.987198 | false | false | false |
grengojbo/st2 | st2client/st2client/models/core.py | 1 | 11692 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 | 1,653,460,699,954,385,700 | 33.187135 | 91 | 0.595621 | false | 4 | false | false | false |
lammps/lammps-packages | mingw-cross/cmake-win-on-linux.py | 1 | 14980 | #!/usr/bin/env python
# Script to build windows installer packages for LAMMPS
# (c) 2017,2018,2019,2020 Axel Kohlmeyer <akohlmey@gmail.com>
from __future__ import print_function
import sys,os,shutil,glob,re,subprocess,tarfile,gzip,time,inspect
try: from urllib.request import urlretrieve as geturl
except: from urllib ... | mit | -3,950,353,748,060,748,000 | 38.21466 | 128 | 0.672029 | false | 2.959889 | false | false | false |
Kopachris/seshet | seshet/bot.py | 1 | 18891 | """Implement SeshetBot as subclass of ircutils3.bot.SimpleBot."""
import logging
import os
from io import StringIO
from datetime import datetime
from ircutils3 import bot, client
from .utils import KVStore, Storage, IRCstr
class SeshetUser(object):
"""Represent one IRC user."""
def __init__(self, nick... | bsd-3-clause | 1,934,334,764,152,155,100 | 34.984762 | 85 | 0.505214 | false | 4.44285 | false | false | false |
Naeka/vosae-app | www/organizer/api/resources/event.py | 1 | 10316 | # -*- coding:Utf-8 -*-
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from tastypie import fields as base_fields, http
from tastypie.utils import trailing_slash
from tastypie.validation import Validation
from tastypie_mongoengine import fields
from dateutil.parser import parse
... | agpl-3.0 | -4,812,843,896,607,923,000 | 38.830116 | 190 | 0.630186 | false | 3.926913 | false | false | false |
m-tmatma/svnmailer | src/lib/svnmailer/settings.py | 1 | 19703 | # -*- coding: utf-8 -*-
#
# Copyright 2004-2006 André Malo or his licensors, as applicable
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | apache-2.0 | 704,259,331,109,030,700 | 39.206122 | 81 | 0.526115 | false | 4.425202 | false | false | false |
polyaxon/polyaxon-api | polyaxon_lib/estimators/hooks/general_hooks.py | 1 | 2631 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import OrderedDict
from tensorflow.python.training import basic_session_run_hooks
from tensorflow.python.training import evaluation
from polyaxon_lib.estimators.hooks.utils import can_run_hook
class GlobalStep... | mit | -773,701,700,634,766,200 | 34.08 | 96 | 0.717598 | false | 3.774749 | false | false | false |
ShovanSarker/mango_office | actions/views.py | 1 | 15639 | from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from users.models import AllUsers, ACL
from status.models import Status
from task.models import Task
im... | gpl-2.0 | -5,272,535,817,592,566,000 | 53.114187 | 127 | 0.475478 | false | 4.843295 | false | false | false |
qingtech/weibome | weibome/settings.py | 1 | 5454 | # Django settings for weibome project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
import os
if 'SERVER_SOFTWARE' in os.environ:
from sae.const import (
MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB
)
else:
# Make ... | gpl-2.0 | 3,294,211,815,736,853,500 | 30.526012 | 88 | 0.688302 | false | 3.530097 | false | false | false |
vbraun/SageUI | src/sageui/view/trac_window.py | 1 | 13199 | """
Window showing a Trac Ticket
"""
##############################################################################
# SageUI: A graphical user interface to Sage, Trac, and Git.
# Copyright (C) 2013 Volker Braun <vbraun.name@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it u... | gpl-3.0 | 6,258,722,187,542,107,000 | 39.48773 | 101 | 0.608152 | false | 3.746523 | false | false | false |
berkeley-stat159/project-lambda | code/stat159lambda/utils/tests/test_parse_demographics.py | 1 | 1388 | from __future__ import absolute_import
from stat159lambda.utils import parse_demographics
import os
import csv
def prepare_for_tests():
with open('demographics.csv', 'w') as csvfile:
file_writer = csv.writer(csvfile, delimiter=',', quotechar='"')
file_writer.writerow(['id', 'gender', 'age', 'forr... | bsd-3-clause | -6,484,319,558,559,641,000 | 26.215686 | 75 | 0.676513 | false | 2.922105 | true | false | false |
trabucayre/gnuradio | gr-audio/examples/python/dial_tone_daemon.py | 1 | 1411 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2008,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gru
from gnuradio import audio
from gnuradio.eng_arg import eng_float
from argparse import ArgumentParser
import os
... | gpl-3.0 | -8,665,632,935,623,739,000 | 29.673913 | 83 | 0.61871 | false | 3.273782 | false | false | false |
mtl/svg2mod | svg2mod/svg2mod.py | 1 | 39409 | #!/usr/bin/python
from __future__ import absolute_import
import argparse
import datetime
import os
from pprint import pformat, pprint
import re
import svg2mod.svg as svg
import sys
#----------------------------------------------------------------------------
DEFAULT_DPI = 96 # 96 as of Inkscape 0.92
def main():
... | cc0-1.0 | 9,195,613,608,947,256,000 | 26.103851 | 97 | 0.414905 | false | 4.459545 | false | false | false |
mikehulluk/morphforge | src/morphforge/constants/ions.py | 1 | 1668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | bsd-2-clause | 4,506,075,776,726,834,700 | 37.790698 | 72 | 0.67446 | false | 4.448 | false | false | false |
paninetworks/neutron | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 1 | 46084 | #!/usr/bin/env python
# Copyright 2012 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | apache-2.0 | -1,381,419,549,410,301,700 | 42.230769 | 79 | 0.552578 | false | 4.317002 | false | false | false |
pyrochlore/cycles | src/blender/addon/__init__.py | 1 | 3388 | #
# Copyright 2011-2013 Blender Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | -5,977,137,211,679,149,000 | 27.957265 | 82 | 0.634002 | false | 3.789709 | false | false | false |
leppa/home-assistant | homeassistant/components/minio/__init__.py | 1 | 8056 | """Minio component."""
import logging
import os
from queue import Queue
import threading
from typing import List
import voluptuous as vol
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
from .minio_helper import MinioEventThread... | apache-2.0 | 4,996,086,234,179,014,000 | 29.4 | 85 | 0.566783 | false | 3.925926 | true | false | false |
matejsuchanek/pywikibot-scripts | fix_qualifiers.py | 1 | 4360 | #!/usr/bin/python
"""This script is obsolete!"""
import pywikibot
from pywikibot import pagegenerators
from .query_store import QueryStore
from .wikidata import WikidataEntityBot
class QualifiersFixingBot(WikidataEntityBot):
blacklist = frozenset(['P143', 'P248', 'P459', 'P518', 'P577', 'P805',
... | gpl-2.0 | 4,387,339,838,632,818,700 | 38.636364 | 92 | 0.482569 | false | 4.052045 | false | false | false |
mediatum/mediatum | workflow/addtofolder.py | 1 | 4475 | # -*- coding: utf-8 -*-
"""
mediatum - a multimedia content repository
Copyright (C) 2011 Arne Seifert <arne.seifert@tum.de>
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 ... | gpl-3.0 | 92,644,555,041,265,800 | 36.25 | 121 | 0.625056 | false | 4.365234 | false | false | false |
greggian/TapdIn | django/core/handlers/base.py | 1 | 9267 | import sys
from django import http
from django.core import signals
from django.utils.encoding import force_unicode
from django.utils.importlib import import_module
class BaseHandler(object):
# Changes that are always applied to a response (in this order).
response_fixes = [
http.fix_location... | apache-2.0 | -8,968,178,709,805,447,000 | 42.985437 | 143 | 0.604726 | false | 4.811526 | false | false | false |
luksan/kodos | modules/urlDialog.py | 1 | 1874 | # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: 0 -*-
# vi: set fileencoding=utf-8 filetype=python expandtab tabstop=4 shiftwidth=4 softtabstop=4 cindent:
# :mode=python:indentSize=4:tabSize=4:noTabs=true:
#-----------------------------------------------------... | gpl-2.0 | -2,844,676,749,710,994,000 | 28.28125 | 112 | 0.47492 | false | 4.419811 | false | false | false |
luzhuomi/collamine-client-python | scrapybot/scrapybot/spiders/hwz.py | 1 | 1627 | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from scrapybot.items import ScrapybotItem
from scrapybot.utils import normalizeFriendlyDate
import datetime
from dateutil.parser import parse
from django... | apache-2.0 | -3,216,291,927,608,126,000 | 35.977273 | 217 | 0.690227 | false | 3.70615 | false | false | false |
oudalab/phyllo | phyllo/extractors/germanicusDB.py | 1 | 3002 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
def main():
# The collection URL below.
collURL = 'http://www.thelatinlibrary.com/germanicus.html'
collOpen = urllib.request.urlopen(collURL)
collSOUP = BeautifulSoup(collOpen, 'html5lib')
autho... | apache-2.0 | -921,874,890,846,832,400 | 34.738095 | 111 | 0.476682 | false | 4.494012 | false | false | false |
kubernetes-client/python | kubernetes/client/models/v1_job_spec.py | 1 | 13937 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 | 6,172,444,438,612,771,000 | 43.244444 | 685 | 0.664705 | false | 4.175255 | true | false | false |
andrewjpage/gubbins | python/scripts/gubbins_drawer.py | 1 | 26242 | #!/usr/bin/env python3
#################################
# Import some necessary modules #
#################################
import argparse
import pkg_resources
from Bio.Nexus import Trees, Nodes
from Bio.Graphics.GenomeDiagram._Colors import ColorTranslator
from Bio.GenBank import Scanner
from Bio.GenBank import _... | gpl-2.0 | -7,902,293,239,757,884,000 | 31.198773 | 323 | 0.685657 | false | 3.227401 | false | false | false |
jupyter/jupyterlab | examples/cell/main.py | 4 | 2644 | """
An example demonstrating a stand-alone "notebook".
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
Example
-------
To run the example, see the instructions in the README to build it. Then
run ``python main.py``.
"""
import os
import json
from jupyterlab_server i... | bsd-3-clause | -5,810,901,252,969,317,000 | 28.707865 | 94 | 0.621785 | false | 3.820809 | false | false | false |
cjvogl/finite_volume_seismic_model | 3d/setplot_pwaves.py | 1 | 3701 |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
import numpy as np
import os, shutil
from mapping import Mapping
import dtopotools_horiz_okada_and_1d as dtopotools
lengt... | gpl-3.0 | -4,647,494,930,394,782,000 | 31.464912 | 90 | 0.640367 | false | 3.272325 | false | false | false |
VitorHugoAguiar/ProBot | ProBot_BeagleBone/PIDControllersFile.py | 1 | 4310 | #!/usr/bin/python
# Python Standard Library Imports
import time
# Local files
import ProBotConstantsFile
# Initialization of classes from local files
Pconst = ProBotConstantsFile.Constants()
# PID functions
class PIDControllersClass():
# Build a constructor
def __init__(self):
self.error = 0
... | agpl-3.0 | -3,683,972,053,555,202,600 | 39.280374 | 163 | 0.547796 | false | 3.420635 | false | false | false |
FarzanHajian/CreateSwap | src/createswap2.py | 1 | 4347 | #!/usr/bin/env python
# encoding: utf-8
'''
create_swap.py
A Python 2 script for creating and removing Linux swap files.
Copyright (C) 2016 Farzan Hajian
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 Foundatio... | gpl-3.0 | -7,813,304,307,696,668,000 | 30.5 | 145 | 0.635381 | false | 3.72813 | false | false | false |
hbldh/sudokuextract | sudokuextract/imgproc/binary.py | 1 | 1736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`binary`
==================
Created by hbldh <henrik.blidh@nedomkull.com>
Created on 2016-01-26
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import numpy... | mit | 2,918,771,141,372,004,400 | 24.910448 | 76 | 0.597926 | false | 3.197053 | false | false | false |
GerbenJavado/LinkFinder | linkfinder.py | 1 | 13951 | #!/usr/bin/env python
# Python 3
# LinkFinder
# By Gerben_Javado
# Fix webbrowser bug for MacOS
import os
os.environ["BROWSER"] = "open"
# Import libraries
import re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.ElementTree
from gzip import GzipFile
from string import Templ... | mit | -3,957,937,958,894,511,600 | 33.70398 | 149 | 0.514587 | false | 3.932074 | false | false | false |
ownport/ansiblite | src/ansiblite/utils/path.py | 1 | 2926 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 | -6,000,778,393,953,600,000 | 40.211268 | 141 | 0.698906 | false | 3.880637 | false | false | false |
rigdenlab/SIMBAD | simbad/command_line/simbad_full.py | 1 | 6513 | #!/usr/bin/env python
__author__ = "Adam Simpkin, and Felix Simkovic"
__contributing_authors__ = "Jens Thomas, and Ronan Keegan"
__credits__ = "Daniel Rigden, William Shepard, Charles Ballard, Villi Uski, and Andrey Lebedev"
__date__ = "05 May 2017"
__email__ = "hlasimpk@liv.ac.uk"
__version__ = "0.1"
import argparse... | bsd-3-clause | 6,700,612,757,377,132,000 | 39.70625 | 146 | 0.614617 | false | 3.560962 | false | false | false |
mdavidsaver/spicetools | spicetools/bench/fileframe.py | 1 | 2613 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Michael Davidsaver
License is GPL3+, see file LICENSE for details
"""
import logging
_log=logging.getLogger(__name__)
import os, os.path
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt
from .fileframe_ui import Ui_FileFrame
class FileFrame(QtGui.QFrame):
... | gpl-3.0 | -8,681,363,298,104,596,000 | 28.359551 | 73 | 0.606965 | false | 3.589286 | false | false | false |
zathras777/pywind | pywind/ofgem/objects.py | 1 | 8218 | # coding=utf-8
# 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 jurisdi... | unlicense | 3,872,703,660,219,905,000 | 33.970213 | 100 | 0.586152 | false | 4.258031 | false | false | false |
robertnishihara/ray | python/ray/autoscaler/_private/aws/utils.py | 1 | 4590 | from collections import defaultdict
from ray.autoscaler._private.cli_logger import cli_logger
import colorful as cf
class LazyDefaultDict(defaultdict):
"""
LazyDefaultDict(default_factory[, ...]) --> dict with default factory
The default factory is call with the key argument to produce
a new value w... | apache-2.0 | 369,375,581,428,346,560 | 34.859375 | 78 | 0.621133 | false | 3.919727 | false | false | false |
zaneveld/picrust | picrust/util.py | 1 | 16630 | #!/usr/bin/env python
# File created on 23 Nov 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2015, The PICRUSt Project"
__credits__ = ["Greg Caporaso", "Morgan Langille", "Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.1.0"
__maintainer__ = "Greg Caporaso"
__email... | gpl-3.0 | 4,356,464,400,882,689,000 | 33.936975 | 243 | 0.632111 | false | 3.734561 | false | false | false |
certik/chess | common/appenginepatch/appenginepatcher/patch.py | 1 | 9983 | # -*- coding: utf-8 -*-
from google.appengine.ext import db
import logging, os, sys
def patch_all():
patch_python()
patch_app_engine()
patch_django()
setup_logging()
def patch_python():
# Remove modules that we want to override
for module in ('httplib', 'urllib', 'urllib2', 'memcache',):
... | mit | 7,800,223,992,368,336,000 | 36.389513 | 80 | 0.650005 | false | 4.1218 | false | false | false |
ronin13/pyvolume | pyvolume/sshfs.py | 1 | 4118 | # -*- coding: utf-8 -*-
""" Module providing SSHFileSystem implementation."""
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
import os.path
from plumbum import ProcessExecutionError
from plumbum.cmd import sshfs
from plumbum.cmd import sudo
from plumbum.cmd imp... | mit | -1,407,974,807,998,446,800 | 29.279412 | 84 | 0.578679 | false | 4.089374 | false | false | false |
PhilLidar-DAD/geonode | geonode/eula/models.py | 1 | 2090 | from django.db import models
from geonode.layers.models import Layer
from geonode.documents.models import Document
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from geonode.base.models import ResourceBase
from geonode.people.models import OrganizationType
from django_enumfield i... | gpl-3.0 | 5,668,980,210,110,807,000 | 42.541667 | 114 | 0.710526 | false | 3.813869 | false | false | false |
Griger/Intel-CervicalCancer-KaggleCompetition | featureHOG.py | 1 | 1456 | from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import numpy as np
from math import pi
from keras.preprocessing.image import ImageDataGenerator
import cv2
from sklearn.cluster import KMeans
import sklearn.preprocessing as prepro
# Generamos nuevos ejemplos
'''
... | gpl-3.0 | 4,660,950,177,554,977,000 | 21.483871 | 94 | 0.665522 | false | 2.95935 | false | false | false |
m3z/HT | openstack_dashboard/api/swift.py | 1 | 9568 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | -1,708,836,969,548,699,400 | 35.10566 | 79 | 0.599289 | false | 4.248668 | false | false | false |
350dotorg/Django | django/core/mail/message.py | 1 | 10976 | import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddresses, formataddr
from django.conf im... | bsd-3-clause | 5,907,717,041,566,670,000 | 36.979239 | 122 | 0.622449 | false | 4.31277 | false | false | false |
erichaase/topcoder-python | topcoder/knights_tour.py | 1 | 2012 | """
`KnightsTour <http://community.topcoder.com/stat?c=problem_statement&pm=10577>`__
"""
def solution (board):
b, n = Board(board), 1
while b.update(): n += 1
return n
class Board:
def __init__ (self, board):
self.board = [list(row) for row in board]
def update (self):
k, t = sel... | mit | -7,622,723,604,843,863,000 | 21.863636 | 81 | 0.394135 | false | 3.451115 | false | false | false |
fupadev/FuME | fume/threads/DownloadProcessor.py | 1 | 5680 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# --------------------------------------------------------------------------
# FuME FuPa Match Explorer Copyright (c) 2017 Andreas Feldl <fume@afeldl.de>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Publi... | gpl-3.0 | -4,301,365,850,361,170,000 | 38.423611 | 121 | 0.543773 | false | 3.457369 | false | false | false |
ibc/MediaSoup | worker/deps/catch/projects/TestScripts/testRandomOrder.py | 1 | 2135 | #!/usr/bin/env python3
"""
This test script verifies that the random ordering of tests inside
Catch2 is invariant in regards to subsetting. This is done by running
the binary 3 times, once with all tests selected, and twice with smaller
subsets of tests selected, and verifying that the selected tests are in
the same r... | isc | 6,595,939,224,350,894,000 | 35.186441 | 79 | 0.640749 | false | 3.405104 | true | false | false |
arpitprogressive/arpittest | intergration_test/banner.py | 1 | 18254 | # -*- coding: utf-8 -*-
"""
banner
Description goes here...
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
import unittest
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException... | bsd-3-clause | 7,783,938,493,523,269,000 | 60.461279 | 238 | 0.7165 | false | 3.1713 | true | false | false |
alfa-addon/addon | plugin.video.alfa/channels/bloghorror.py | 1 | 5917 | # -*- coding: utf-8 -*-
# -*- Channel BlogHorror -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
import os
import re
from bs4 import BeautifulSoup
from core import httptools
from core impor... | gpl-3.0 | 5,249,670,684,535,636,000 | 28.575 | 123 | 0.572612 | false | 3.70382 | false | false | false |
NicholasHoCode/Galaxy | assets/code/GF.py | 1 | 2040 | from PIL import Image
import numpy as np
import math
from scipy import signal
def boxfilter(n):
assert (n%2 != 0),"Dimension must be odd"
a = np.empty((n, n))
a.fill(1/(n*n))
return a
def gauss1d(sigma):
arr_length = 6*sigma
if arr_length % 2 == 0:
val = ((arr_length)/2)+1
elif arr... | mit | -6,833,917,436,678,237,000 | 34.172414 | 208 | 0.659314 | false | 3.044776 | false | false | false |
Azure/azure-sdk-for-python | common/smoketest/key_vault_keys_async.py | 1 | 1475 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import uuid
from azure.keyvault.keys.aio import KeyClient
from key_vault_base_async import KeyVaultBaseAsync
class KeyVaultKeys(KeyVaultBaseAsync):
def __init__(se... | mit | 5,781,894,766,305,510,000 | 31.086957 | 75 | 0.541695 | false | 3.891821 | false | false | false |
pytroll/pygac | pygac/tests/test_calibrate_pod.py | 1 | 5529 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015 Martin Raspaud
# Author(s):
# Martin Raspaud <martin.raspaud@smhi.se>
# 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 Foundatio... | gpl-3.0 | 4,917,036,265,671,069,000 | 35.375 | 85 | 0.477302 | false | 3.748475 | true | false | false |
mind1master/aiohttp | tests/test_client_session.py | 1 | 14280 | import asyncio
import contextlib
import gc
import http.cookies
import re
import types
from unittest import mock
import pytest
from multidict import CIMultiDict, MultiDict
import aiohttp
from aiohttp import web
from aiohttp.client import ClientSession
from aiohttp.connector import BaseConnector, TCPConnector
@pytest... | apache-2.0 | 8,333,107,715,438,681,000 | 33 | 78 | 0.55112 | false | 4.27673 | true | false | false |
dnanexus/rseqc | rseqc/scripts/read_distribution.py | 1 | 11931 | #!/usr/bin/env python
'''-------------------------------------------------------------------------------------------------
Check reads distribution over exon, intron, UTR, intergenic ... etc
-------------------------------------------------------------------------------------------------'''
#import built-in modules
im... | gpl-3.0 | -9,165,150,322,009,244,000 | 39.036913 | 165 | 0.693068 | false | 2.34816 | false | false | false |
nickname456/pbots | poker.py | 1 | 5255 | #-----------------------------------------------------------#
# Heads Up Omaha Challange - Starter Bot #
#===========================================================#
# #
# Last update: 22 May, 2014 #
# ... | mit | 5,522,409,518,547,737,000 | 27.873626 | 109 | 0.479163 | false | 3.881093 | false | false | false |
cmbclh/vnpy1.7 | vnpy/trader/app/login/uiLoginWidget.py | 1 | 7055 | # encoding: UTF-8
'''
登陆模块相关的GUI控制组件
'''
import sys
sys.path.append('../')
#sys.path.append('D:\\tr\\vnpy-master\\vn.trader\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\common')
import vnpy.DAO
import vnpy.common
from vnpy.DAO import *
import pandas as pd
import Tki... | mit | 3,855,137,239,608,203,000 | 36.542857 | 260 | 0.507992 | false | 3.635307 | false | false | false |
fast90/christian | modules/hq.py | 1 | 1507 | from datetime import datetime
class HQ(object):
def __init__(self):
self.people_in_hq = 0
self.keys_in_hq = 0
self.joined_users = []
self.hq_status = 'unknown'
self.status_since = datetime.now().strftime('%Y-%m-%d %H:%M')
self.is_clean = True
self.joined_key... | gpl-3.0 | 6,626,186,680,984,100,000 | 24.542373 | 78 | 0.558062 | false | 3.24086 | false | false | false |
micbou/YouCompleteMe | python/ycm/client/completer_available_request.py | 2 | 1716 | # Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 vers... | gpl-3.0 | -4,551,042,928,777,884,700 | 33.32 | 78 | 0.726107 | false | 4.115108 | false | false | false |
vivisect/synapse | synapse/cryotank.py | 1 | 49542 | import os
import types
import shutil
import struct
import logging
import threading
import contextlib
from functools import partial, wraps
from collections import defaultdict
import lmdb # type: ignore
import synapse.lib.cell as s_cell
import synapse.lib.lmdb as s_lmdb
import synapse.lib.queue as s_queue
import synap... | apache-2.0 | -7,920,170,919,440,636,000 | 35.214912 | 120 | 0.568669 | false | 3.987605 | false | false | false |
Tufin/pytos | pytos/securetrack/xml_objects/rest/nat_rules.py | 1 | 13490 | import logging
from pytos.common.base_types import XML_List, XML_Object_Base, Comparable
from pytos.common.definitions.xml_tags import Elements
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.functions import get_xml_int_value, get_xml_text_value, get_xml_node, create_tagless_xml_objects... | apache-2.0 | -5,468,314,753,821,417,000 | 43.820598 | 132 | 0.646256 | false | 3.437819 | false | false | false |
brandonw/photo-album | photo_album/rotate_and_thumbs.py | 1 | 1245 | import os, sys
from PIL import Image, ExifTags
size = (128, 128)
for infile in os.listdir(sys.argv[1]):
inpath = os.path.join(sys.argv[1], infile)
pieces = os.path.splitext(inpath)
outpath = pieces[0] + ".thumb" + pieces[1]
if (inpath != outpath and not os.path.exists(outpath) and
'thumb' not ... | bsd-3-clause | 8,823,710,597,784,660,000 | 36.727273 | 81 | 0.526104 | false | 3.939873 | false | false | false |
innovation-cat/DeepLearningBook | cifar10 classification/py3/softmax.py | 1 | 4468 | # coding: utf-8
#
# softmax.py
#
# Author: Huang Anbu
# Date: 2017.3
#
# Description: Implementation of softmax classification
#
# Copyright©2017. All Rights Reserved.
# ===============================================================================================
from __future__ import print_function, division
fro... | mit | -4,965,939,120,042,824,000 | 33.393701 | 218 | 0.63499 | false | 2.549329 | true | false | false |
sthesing/Podstatty | db.py | 1 | 4858 | # -*- coding: utf8 -*-
## Copyright (c) 2013 Stefan Thesing
##
##This file is part of Podstatty.
##
##Podstatty 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 op... | gpl-3.0 | -6,791,800,694,305,659,000 | 37.251969 | 87 | 0.594072 | false | 4.299115 | false | false | false |
SabaFar/plc | examples/plc-ccphy-example.py | 1 | 4082 | # -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will b... | gpl-3.0 | -16,086,139,063,123,222 | 29.691729 | 84 | 0.695492 | false | 3.104183 | false | false | false |
ayepezv/GAD_ERP | addons/website_sale/models/product.py | 1 | 8355 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
class ProductStyle(models.Model):
_name = "product.style"
name = fields.Char(string='Style Name', required=True)
html_class = fields.Char(string='HTML Classes'... | gpl-3.0 | 7,746,958,657,846,388,000 | 47.017241 | 183 | 0.641412 | false | 4.07959 | false | false | false |
poldracklab/cogat | cognitive/apps/atlas/forms.py | 1 | 18517 | from django import forms
from django.core.exceptions import ValidationError
from django.urls import reverse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Div, Field, HTML, Layout, Reset, Submit
from cognitive.apps.atlas.query import Assertion, Disorder, Task, Battery, ConceptClass, Concep... | mit | -3,327,605,317,850,539,000 | 38.736052 | 96 | 0.596155 | false | 3.850489 | false | false | false |
CSAILVision/sceneparsing | evaluationCode/utils_eval.py | 1 | 1826 | import numpy as np
# This function takes the prediction and label of a single image, returns intersection and union areas for each class
# To compute over many images do:
# for i in range(Nimages):
# (area_intersection[:,i], area_union[:,i]) = intersectionAndUnion(imPred[i], imLab[i])
# IoU = 1.0 * np.sum(area_inters... | bsd-3-clause | -2,552,586,764,081,443,000 | 42.47619 | 117 | 0.727273 | false | 2.98366 | false | false | false |
hexid/WordGenerator | GenerateChain.py | 1 | 1975 | #!/bin/env python
# usage: depth , inDictionary [, outJSON]
def generateChain(depth, inFile):
import collections, re
numChar, endChar = '#', '.'
regexWord = re.compile('^[a-z]+$')
depthRange = range(depth - 1)
padStr = ' ' * (depth - 1)
chars = collections.deque(maxlen = depth) # limit to depth chars
de... | mit | -1,638,003,219,230,873,600 | 36.980769 | 127 | 0.658734 | false | 3.604015 | false | false | false |
smartforceplus/SmartForceplus | .local/share/Odoo/addons/8.0/builder/models/demo/base.py | 1 | 5437 | import json
import pickle
import os
import random
from openerp import models, api, fields, _
class GeneratorInterface(models.AbstractModel):
_name = 'builder.ir.model.demo.generator.base'
_description = 'Generator Interface'
@api.multi
def get_generator(self, field):
raise NotImplementedErro... | agpl-3.0 | 1,007,184,603,457,756,800 | 32.98125 | 130 | 0.606401 | false | 3.693614 | false | false | false |
marmarek/qubes-core-admin | qubes/vm/adminvm.py | 1 | 9608 | #
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2010-2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2013-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
# Copyright (C) 2014-2015 Wojtek Porczyk <woju@invisiblethingslab.com>... | lgpl-2.1 | 412,797,591,439,523,840 | 29.791667 | 79 | 0.596128 | false | 3.80626 | false | false | false |
danielsunzhongyuan/my_leetcode_in_python | lowest_common_ancestor_of_a_binary_tree_236.py | 1 | 1928 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
:type root: TreeNode
:type p: TreeNode
:... | apache-2.0 | -4,629,820,916,250,762,000 | 28.661538 | 95 | 0.48029 | false | 3.750973 | false | false | false |
beyondvalence/scratch | chp01.py | 1 | 1697 | # !/usr/bin/env python27
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 2 16:15:29 2016
@author: waynetliu
"""
#%%
from __future__ import division
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn" },
{ "id": 2, "name": "Sue" },
{ "id": 3, "name": "Chi" },
{... | bsd-2-clause | 5,344,159,609,228,425,000 | 27.283333 | 71 | 0.524455 | false | 2.809603 | false | false | false |
arcyfelix/ML-DL-AI | Supervised Learning/GANs/GAN.py | 1 | 3364 | # -*- coding: utf-8 -*-
""" GAN Example
Use a generative adversarial network (GAN) to generate digit images from a
noise distribution.
References:
- Generative adversarial nets. I Goodfellow, J Pouget-Abadie, M Mirza,
B Xu, D Warde-Farley, S Ozair, Y. Bengio. Advances in neural information
processing system... | apache-2.0 | 2,824,382,926,397,684,000 | 36.388889 | 82 | 0.678062 | false | 3.250242 | false | false | false |
TransportLayer/mc-id2name | id2name.py | 1 | 45678 | ###############################################################################
# Minecraft ID to Friendly Name #
# Copyright (C) 2016 TransportLayer #
# #
... | gpl-3.0 | 3,909,941,655,184,969,700 | 18.160235 | 101 | 0.520557 | false | 2.331938 | false | false | false |
IZSVenezie/VetEpiGIS-Tool | plugin/xitem_dialog.py | 1 | 1545 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'xitem_dialog_base.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# 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.... | gpl-2.0 | -5,246,522,193,695,220,000 | 39.657895 | 108 | 0.698382 | false | 3.951407 | false | false | false |
hfiguiere/abiword | tools/build_osx_release.py | 2 | 12008 | #!/usr/bin/env python
# Copyright (C) 2011 Fabiano Fidencio
#
# 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 ... | gpl-2.0 | 9,047,993,009,526,091,000 | 31.193029 | 122 | 0.541889 | false | 3.674419 | false | false | false |
Valchris/IEEEXtreme_WorkingAsIntended | 2012/AA_Alex.py | 1 | 1107 | __author__ = 'alexander'
import sys
initial_bunnies = long(sys.stdin.readline())
bunnies = dict()
bunnies['adults'] = initial_bunnies
bunnies['babies'] = long(0)
bunnies['juveniles'] = long(0)
bunnies['juveniles2'] = long(0)
for i in range(0,365,15):
if i % 2 == 0:
bunnies['babies'] = long(bunnies['babi... | mit | -221,296,799,781,316,100 | 33.625 | 101 | 0.633243 | false | 2.427632 | false | false | false |
lesina/Hack70 | env/bin/painter.py | 1 | 2129 | #!/home/oleg/Web/Hack70/env/bin/python3
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of tiles.
#
tr... | gpl-3.0 | -5,233,558,321,454,570,000 | 24.963415 | 80 | 0.573978 | false | 3.331768 | false | false | false |
RRSCDS/douban-mining | src/Python/api-oauth/oauthx.py | 1 | 2742 | # -*- coding: utf8 -*-
import urllib, urllib2
import json
# key and secret通过创建豆瓣app获得(无审核)
# http://developers.douban.com/apikey/
APIKEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
SECRET = 'xxxxxxxxxxxxxxxx'
CALLBACK_URL = 'http://www.douban.com'
GETTOKEN_URL = 'https://www.douban.com/service/auth2/token'
def getToken(cod... | mit | 1,631,758,914,176,409,900 | 29.193182 | 101 | 0.615587 | false | 3.106433 | false | false | false |
thesealion/writelightly | writelightly/main.py | 1 | 5266 | import curses
import datetime
import sys
from writelightly.calendar import Calendar
from writelightly.conf import Config
from writelightly.edit import edit_date, get_edits, clean_tmp, show_edits
from writelightly.metadata import Metadata
from writelightly.screen import ScreenManager, TextArea
from writelightly.tags im... | mit | -884,814,466,088,044,500 | 32.75641 | 79 | 0.583175 | false | 3.690259 | false | false | false |
allofhercats/whiskey | proto/literal_print.py | 1 | 1544 | def get_n_digits(value, base):
n = 0
if value == 0:
return 1
else:
while value > 0:
value //= base
n += 1
return n
def literal_int_to_string(value, base, width = 0, pad = '0', prefix = True):
rtn = ""
if base == 2 and prefix:
rtn = "0b"
elif base == 8 and prefix:
rtn = "0"
elif base == 16 and pr... | mit | 2,214,180,999,662,640,600 | 17.60241 | 76 | 0.577073 | false | 2.573333 | false | false | false |
ngageoint/scale | scale/scale/settings.py | 1 | 14209 | """
Django settings for scale_test project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import scale
import sys
import dj_database_url
def get_env... | apache-2.0 | -3,697,003,481,016,563,700 | 29.622845 | 103 | 0.661553 | false | 3.472385 | false | false | false |
TeamADEA/Hunger_Games | HG_Code/Model.py | 1 | 7064 | import numpy as np
import copy
import time
from Kat import Kat
from Visualize import Visualizer
from SimManager import sim_manager
from hg_settings import *
from Hunger_Grid import hunger_grid
import sys
import os
STEP_SIZE = 10 # 0 = only last frame,
# 1 = every frame,
# N = every N ... | mit | 4,120,856,940,087,549,000 | 37.601093 | 127 | 0.587061 | false | 3.09553 | false | false | false |
chapware/aircrack | scripts/airdrop-ng/install.py | 1 | 3800 | #!/usr/bin/env python
__version__ = "1.13.2010.21:00"
__author__ = "Bryan Chapman <bryanwchapman@gmail.com>"
'''
This is the installer file for airdrop-ng. It first checks for
different dependancies, such as make, svn, etc.
'''
import os, sys
from shutil import rmtree
if os.geteuid() != 0:
print "Installer must b... | gpl-2.0 | 3,112,824,450,673,922,600 | 30.147541 | 230 | 0.649211 | false | 2.810651 | false | false | false |
ppries/tensorflow | tensorflow/contrib/framework/python/ops/variables.py | 1 | 25287 | # Copyright 2015 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 | -135,211,928,952,083,820 | 35.701016 | 90 | 0.693835 | false | 4.16384 | false | false | false |
Daniel-Brosnan-Blazquez/DIT-100 | debugging/trajectory_planning_profiles/trapezoidal-profile.py | 1 | 7690 | import numpy
import time
from matplotlib import pyplot
def main (params):
angle = params['p0']
vel = params['v0']
sign = params['sign']
# Plan the trajectory if it is not planned
T = 0
Ta = 0
Td = 0 ... | gpl-3.0 | -1,022,844,989,781,801,000 | 23.258675 | 76 | 0.447854 | false | 3.067411 | false | false | false |
Oreder/PythonSelfStudy | Exe_18.py | 1 | 8002 | # Creating class
#
# +++ Syntax +++
# class ClassName:
# 'Optional class documentation string'
# class_suite
#
class Employee:
'common base class for all employees'
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.empCount += 1
... | mit | 4,672,089,774,815,598,000 | 32.241667 | 94 | 0.543369 | false | 3.916544 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.