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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EclipseXuLu/DataHouse | DataHouse/jobcn/jobcn_spider.py | 1 | 6201 | import os
import time
import shutil
import requests
from lxml import etree
from openpyxl import Workbook
JOBCN_DATA_DIR = '../../DataSet/jobcn/'
base_url = 'http://www.jobcn.com/search/listalljob_servlet.ujson'
user_agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.... | mit | -219,106,271,899,237,340 | 36.128049 | 123 | 0.563804 | false | 3.015849 | false | false | false |
Axelrod-Python/Axelrod-fingerprint | update_fingerprints.py | 1 | 8815 | """
A script to obtain the Ashlock Fingerprints of all strategies in the Axelrod
library.
This writes a hash of the source code of each strategy to file: db.csv.
If the source code of a strategy changes **or** a new strategy is introduced
then the fingerprint is regenerated for that strategy.
"""
import inspect
impo... | mit | 3,406,321,965,420,544,500 | 26.720126 | 195 | 0.630062 | false | 3.768705 | false | false | false |
hwp-kiel/opencali | src/ui/mplwidget.py | 1 | 1403 | # Python Qt4 bindings for GUI objects
from PyQt4 import QtGui
# import the Qt4Agg FigureCanvas object, that binds Figure to
# Qt4Agg backend. It also inherits from QWidget
from matplotlib.backends.backend_qt4agg \
import FigureCanvasQTAgg as FigureCanvas
# Matplotlib Figure object
from matplotlib.figure import Figure
... | gpl-2.0 | 3,067,225,847,199,053,300 | 35 | 61 | 0.679971 | false | 4.238671 | false | false | false |
harry-7/addons-server | src/olympia/constants/reviewers.py | 1 | 6664 | from django.utils.translation import ugettext_lazy as _
# Reviewer Tools
REVIEWER_VIEWING_INTERVAL = 8 # How often we ping for "who's watching?"
REVIEWER_REVIEW_LOCK_LIMIT = 3 # How many pages can a reviewer "watch"
# Types of Canned Responses for reviewer tools.
CANNED_RESPONSE_ADDON = 1
CANNED_RESPONSE_THEME = 2... | bsd-3-clause | 1,205,564,029,379,759,400 | 33.174359 | 79 | 0.686224 | false | 2.903704 | false | false | false |
trailofbits/iverify-oss | vendor/iphone-dataprotection/python_scripts/crypto/aeswrap.py | 1 | 3161 | import struct
from Crypto.Cipher import AES
"""
http://www.ietf.org/rfc/rfc3394.txt
quick'n'dirty AES wrap implementation
used by iOS 4 KeyStore kernel extension for wrapping/unwrapping encryption keys
"""
def unpack64bit(s):
return struct.unpack(">Q",s)[0]
def pack64bit(s):
return struc... | bsd-2-clause | -9,087,806,445,580,642,000 | 43.157143 | 259 | 0.636191 | false | 2.500791 | false | false | false |
mmagnus/rna-pdb-tools | rna_tools/tools/ClashCalc/ClashCalc.py | 1 | 2343 | #!/usr/bin/python
from Bio.PDB import NeighborSearch, PDBParser, Selection, Atom
from numpy import array
def check_clash(str_name, v=True):
"""check_clash, fract of clashes!
if zero contacts then error -> fix ->
Problem, contacts, str_name: 311 505 na-prot_13536.pdb
Sterical clashes ... | gpl-3.0 | 4,982,397,807,123,278,000 | 33.455882 | 93 | 0.502774 | false | 3.766881 | false | false | false |
YannThorimbert/ThorPy-1.4.3 | thorpy/elements/clickable.py | 1 | 1761 | from pygame.event import post, Event
from thorpy.elements.pressable import Pressable
from thorpy.elements.hoverable import Hoverable
from thorpy.miscgui.constants import STATE_NORMAL, STATE_PRESSED, EVENT_PRESS, THORPY_EVENT
class Clickable(Pressable, Hoverable):
"""Clickable Element (Pressable and hoverable)"""... | mit | 2,201,228,198,744,322,300 | 32.226415 | 91 | 0.578648 | false | 3.878855 | false | false | false |
asavonic/traftrack | traftrack/yamaps.py | 1 | 2009 | import image
import logging
import tempfile
from os import path
DEBUG = False
def make_map_url(ty, coord, area_size, zoom):
return \
('https://static-maps.yandex.ru/1.x/?lang=ru_RU'
'&ll={lat}%2C{lon}'
'&z={zoom}&l={ty}&size={size_x},{size_y}'
).format(
ty=ty,
... | mit | -6,032,079,998,426,408,000 | 25.090909 | 77 | 0.561473 | false | 3.410866 | false | false | false |
seraphlnWu/observer | observer/node/controller.py | 1 | 13942 | # coding=utf8
'''
controller 节点
controller 节点负责字节点注册,数据任务分发
'''
import socket
import time
from uuid import uuid4
from collections import deque
from twisted.spread import pb
from twisted.internet.defer import (
inlineCallbacks,
returnValue,
Deferred,
succeed,
)
from twisted.internet import rea... | gpl-2.0 | -4,159,788,212,689,429,500 | 29.253275 | 102 | 0.556221 | false | 4.184838 | false | false | false |
Parnassos/Eupheme | eupheme/config.py | 1 | 3763 | """Configuration module.
This module deals with the config object used by the Application class to
make some parts of the application's behaviour configurable.
"""
import yaml
import eupheme.mime as mime
class Config:
"""Config class.
A slightly neater way of accessing the yaml config file instead of
... | bsd-3-clause | -2,609,194,535,855,000,000 | 24.425676 | 73 | 0.62211 | false | 4.195095 | true | false | false |
catalpainternational/OIPA | OIPA/geodata/migrations/0001_initial.py | 1 | 10087 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('iati', '0001_initial'),
]
operations = [
migrations.CreateModel(
name... | agpl-3.0 | 8,997,692,114,947,381,000 | 55.668539 | 123 | 0.564885 | false | 3.966575 | false | false | false |
OCA/stock-logistics-barcode | stock_scanner/models/scanner_scenario_transition.py | 1 | 3439 | # © 2011 Sylvain Garancher <sylvain.garancher@syleam.fr>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import sys
import traceback
from odoo import models, api, fields, exceptions
from odoo import _
import logging
logger = logging.getLogger('stock_scanner')
class ScannerScenarioTransition(mod... | agpl-3.0 | 3,440,874,921,048,147,000 | 31.130841 | 81 | 0.528505 | false | 4.620968 | false | false | false |
rckclmbr/pyportify | pyportify/pkcs1/keys.py | 1 | 5665 | import fractions
from . import primitives
from . import exceptions
from .defaults import default_crypto_random
from .primes import get_prime, DEFAULT_ITERATION
class RsaPublicKey(object):
__slots__ = ('n', 'e', 'bit_size', 'byte_size')
def __init__(self, n, e):
self.n = n
self.e = e
... | apache-2.0 | -4,043,512,826,432,681,500 | 31.745665 | 79 | 0.538394 | false | 3.47973 | false | false | false |
SimonSapin/tinycss | tinycss/decoding.py | 2 | 9175 | # coding: utf-8
"""
tinycss.decoding
----------------
Decoding stylesheets from bytes to Unicode.
http://www.w3.org/TR/CSS21/syndata.html#charset
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import operator
impo... | bsd-3-clause | 8,937,828,354,006,947,000 | 35.256917 | 78 | 0.539736 | false | 3.357613 | false | false | false |
kasmith/cbmm-project-christmas | SimulationModels/get_sim_data_v2.py | 1 | 5112 | from __future__ import division, print_function
from physicsTable import *
from physicsTable.constants import *
from physicsTable.models import PointSimulation
import os, json, glob
KAP_V_NORM = 20 # simulation for conditions with motion (small noise in velocity)
KAP_V_NOMOT = 1e-10 # simulation for no motion conditio... | mit | -7,143,892,807,414,389,000 | 38.022901 | 149 | 0.530516 | false | 2.982497 | false | false | false |
rmrector/script.artwork.beef | lib/advancedsettings.py | 1 | 4861 | import xbmc
import xbmcgui
import xbmcvfs
import xml.etree.ElementTree as ET
from contextlib import closing
from lib.libs.pykodi import log, localize as L
FILENAME = 'special://userdata/advancedsettings.xml'
FILENAME_BAK = FILENAME + '.beef.bak'
ROOT_TAG = 'advancedsettings'
VIDEO_TAG = 'videolibrary'
MUSIC_TAG = 'm... | mit | 9,046,435,007,444,909,000 | 35.276119 | 103 | 0.637112 | false | 3.440198 | false | false | false |
dr-jpk/saltefficiency | weekly/weekly_summary_plots.py | 1 | 8536 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 9 10:06:20 2015
@author: jpk
ToDo: automate the subsystems check. A query that checks all the subsystems in
case things change in the future should prevent issues with the pis chart
colours
"""
import sys
import os
import pandas as pd
import pandas.io.sql as psql
impor... | bsd-3-clause | -7,651,931,648,000,412,000 | 34.566667 | 137 | 0.526828 | false | 3.4144 | false | false | false |
googlefonts/ufo2ft | Lib/ufo2ft/filters/base.py | 1 | 7630 | import logging
from types import SimpleNamespace
from fontTools.misc.loggingTools import Timer
from ufo2ft.util import _GlyphSet, _LazyFontName
logger = logging.getLogger(__name__)
class BaseFilter:
# tuple of strings listing the names of required positional arguments
# which will be set as attributes of ... | mit | 3,577,641,209,452,104,700 | 35.859903 | 88 | 0.553342 | false | 4.613059 | false | false | false |
apanda/modeling | tests/examples/ContentCacheTest.py | 1 | 1667 | import components
def ContentCacheTest ():
"""Learning firewall test"""
ctx = components.Context (['a', 'b', 'c', 'd', 'cc'],\
['ip_a', 'ip_b', 'ip_c', 'ip_d', 'ip_cc'])
net = components.Network (ctx)
a = components.EndHost(ctx.a, net, ctx)
b = components.EndHost(ctx.b... | bsd-3-clause | -5,992,749,475,282,901,000 | 39.658537 | 72 | 0.472705 | false | 3.163188 | false | false | false |
HyperloopTeam/FullOpenMDAO | cantera-2.0.2/interfaces/python/Cantera/stoich.py | 1 | 1370 | from Cantera import exceptions
from Cantera.num import array
from Cantera.elements import elementMoles
def det3(A):
"""Determinant of a 3x3 matrix."""
return (A[0,0]*(A[1,1]*A[2,2] - A[1,2]*A[2,1])
- A[0,1]*(A[1,0]*A[2,2] - A[1,2]*A[2,0])
+ A[0,2]*(A[1,0]*A[2,1] - A[2,0]*A[1,1]))
def s... | gpl-2.0 | -2,443,989,361,483,333,000 | 29.444444 | 91 | 0.584672 | false | 2.477396 | false | false | false |
goedzo/PokemonGo-Bot | pokemongo_bot/inventory.py | 1 | 52151 | from __future__ import print_function
import json
import logging
import os
from collections import OrderedDict
from pokemongo_bot.base_dir import _base_dir
from pokemongo_bot.services.item_recycle_worker import ItemRecycler
'''
Helper class for updating/retrieving Inventory data
Interesting info and formulas:
https:... | mit | 5,517,166,461,981,990,000 | 31.553683 | 173 | 0.602769 | false | 3.684541 | false | false | false |
openstack/heat | heat/engine/parameters.py | 1 | 20706 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 | 5,806,063,626,160,475,000 | 33.858586 | 79 | 0.585772 | false | 4.453861 | false | false | false |
marshallmcdonnell/interactive_plotting | TraitsUI/examples/FileEditor_demo.py | 1 | 1168 | #!/usr/bin/env python
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.
"""
Implementation of a FileEditor demo plugin for Traits UI demo program.
This demo shows each of the four styles of the FileEditor
"""
# Imports:
from traits.api \
import HasTraits, File
from traitsui.api \
import Item, G... | mit | -8,845,989,099,445,362,000 | 21.461538 | 70 | 0.607877 | false | 3.74359 | false | false | false |
EdinburghGenomics/clarity_scripts | scripts/generate_hamilton_input_uct.py | 1 | 2391 | #!/usr/bin/env python
from EPPs.common import GenerateHamiltonInputEPP, InvalidStepError
class GenerateHamiltonInputUCT(GenerateHamiltonInputEPP):
""""Generate a CSV containing the necessary information for the KAPA make libraries method"""
_use_load_config = False # prevent the loading of the config
cs... | mit | 5,375,435,361,011,427,000 | 45.882353 | 121 | 0.637808 | false | 4.115318 | false | false | false |
OCA/l10n-brazil | l10n_br_nfe/models/product_product.py | 1 | 2017 | # Copyright 2020 Akretion (Raphaël Valyi <raphael.valyi@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# The generateDS prod mixin (prod XML tag) cannot be injected in
# the product.product object because the tag includes attributes from the
# Odoo fiscal document line. So a part of the ... | agpl-3.0 | 2,735,946,614,346,512,400 | 35.654545 | 85 | 0.550099 | false | 3.580817 | false | false | false |
gurneyalex/odoo | addons/mail/models/mail_activity.py | 4 | 44705 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
import logging
import pytz
from odoo import api, exceptions, fields, models, _
from odoo.tools.mi... | agpl-3.0 | -903,450,253,741,445,000 | 48.617092 | 188 | 0.616441 | false | 4.122176 | false | false | false |
nullzero/wpcgi | wpcgi/tools/wikitranslator/form.py | 1 | 1097 | #!/data/project/nullzerobot/python/bin/python
from flask.ext.wtf import Form
import wtforms.validators as v
from wtforms import TextField, TextAreaField, HiddenField, SubmitField
from messages import msg
class WikiTranslatorForm(Form):
pass
def getForm():
FormCl = WikiTranslatorForm
FormCl.title = TextFi... | mit | -4,713,215,222,985,740,000 | 42.92 | 78 | 0.614403 | false | 4.093284 | false | false | false |
endlessm/chromium-browser | third_party/angle/third_party/VK-GL-CTS/src/scripts/verify/message.py | 7 | 1372 | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# Vulkan CTS
# ----------
#
# Copyright (c) 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | bsd-3-clause | 2,389,402,020,114,998,300 | 31.666667 | 82 | 0.642128 | false | 3.92 | false | false | false |
yeyanchao/calibre | src/calibre/gui2/preferences/emailp.py | 1 | 7877 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from PyQt4.Qt import QAbstractTableModel, QVariant, QFont, Qt
from calibre.gui2.preferences import Confi... | gpl-3.0 | -4,766,216,360,129,009,000 | 35.637209 | 95 | 0.59477 | false | 3.936532 | true | false | false |
endlos99/xdt99 | test/dg-checkimg.py | 1 | 3903 | #!/usr/bin/env python
import os
import random
from config import Dirs, Files
from utils import xdg, xga, error, check_files_eq, count_bytes, check_bytes
# Main test
def runtest():
"""check cross-generated output against native reference files"""
# run disassembler
for srcfile, dopts, aopts in [
... | gpl-2.0 | 8,020,362,520,169,591,000 | 41.423913 | 113 | 0.500641 | false | 3.044462 | false | false | false |
adfinis-sygroup/timed-backend | timed/projects/views.py | 1 | 2618 | """Viewsets for the projects app."""
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
from rest_framework_json_api.views import PreloadIncludesMixin
from timed.permissions import IsAuthenticated, IsReadOnly, IsReviewer, IsSuperUser
from timed.projects import filters, models, serializers
class ... | agpl-3.0 | 3,538,262,605,159,621,600 | 29.8 | 82 | 0.694041 | false | 4.437288 | false | false | false |
GeoCat/QGIS | python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py | 1 | 16947 | # -*- coding: utf-8 -*-
"""
***************************************************************************
FieldsMappingWidget.py
---------------------
Date : October 2014
Copyright : (C) 2014 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
**... | gpl-2.0 | 8,780,736,930,080,279,000 | 32.164384 | 93 | 0.586593 | false | 4.293641 | false | false | false |
tribut/vdirsyncer | vdirsyncer/storage/memory.py | 1 | 2008 | # -*- coding: utf-8 -*-
import random
import vdirsyncer.exceptions as exceptions
from vdirsyncer.storage.base import Storage
def _random_string():
return '{:.9f}'.format(random.random())
class MemoryStorage(Storage):
'''
Saves data in RAM, only useful for testing.
'''
def __init__(self, file... | mit | -8,198,893,486,883,892,000 | 26.888889 | 72 | 0.583167 | false | 3.921875 | false | false | false |
alandmoore/qtscrot | qtscrot.py | 1 | 5340 | """
QTScrot is a gui for the scrot screenshot utility.
Written by Alan D Moore, c 2014.
Written by Alan D Moore, c 2014.
Released under the GPL v. 3.0
Requires scrot and QT5.
"""
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from collections import namedtuple
from functools impor... | gpl-3.0 | 7,572,024,369,834,528,000 | 36.342657 | 141 | 0.62191 | false | 3.776521 | false | false | false |
citrix-openstack-build/cinder | cinder/volume/drivers/solidfire.py | 1 | 18015 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | apache-2.0 | 5,604,339,479,747,918,000 | 35.840491 | 78 | 0.56181 | false | 4.202239 | false | false | false |
tonnrueter/pymca_devel | PyMca/Object3D/Object3DRedBookFont.py | 1 | 9580 | import Object3DQt as qt
import SceneGLWidget
import OpenGL.GL as GL
import numpy
rasters = numpy.array([
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
[0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18],
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,... | gpl-2.0 | 4,970,306,696,342,846,000 | 57.060606 | 101 | 0.639248 | false | 1.636767 | true | false | false |
amueller/advanced_training | plots/plot_interactive_tree.py | 1 | 2695 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO # doctest: +SKIP
from sklearn.tree import export_graphviz
from scipy.misc import imread
from scipy import ndimage
import os
import re
... | bsd-2-clause | 2,661,079,370,298,128,400 | 32.271605 | 84 | 0.586642 | false | 2.907228 | false | false | false |
pavanky/arrayfire-python | arrayfire/tests/simple/array_test.py | 1 | 2068 | #!/usr/bin/python
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
####################################... | bsd-3-clause | -1,466,352,537,016,812,500 | 30.815385 | 82 | 0.571567 | false | 2.868239 | false | false | false |
andrewiggins/Textbook-Price-Aggregator | src/server/search.py | 1 | 2644 | #!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: search.py
# Purpose: Contains all Request Handlers relating to generic search
# functions
#
# Author: Andre Wiggins
#
# Created: 04/07/2011
# Copyright: (c) Jacob Marsh, And... | apache-2.0 | -3,334,603,341,803,677,000 | 36.785714 | 98 | 0.58472 | false | 4.190174 | false | false | false |
waveform80/compoundfiles | compoundfiles/mmap.py | 1 | 7498 | #!/usr/bin/env python
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# A library for reading Microsoft's OLE Compound Document format
# Copyright (c) 2014 Dave Jones <dave@waveform.org.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | mit | 2,056,833,574,935,714,600 | 33.081818 | 79 | 0.537743 | false | 4.21236 | false | false | false |
fmichea/bracoujl | bracoujl/processor/gb_z80.py | 1 | 9775 | # gb_z80.py - GameBoy z80 Disassembler + configuration.
import struct
import re
from functools import partial as P
class GBZ80Disassembler:
def __init__(self):
def _disassemble_cb(op):
return self._cb_ops[op // 8] + self._cb_regs[op % 8]
def r(reg): return '%{reg}'.format(reg=reg)
... | bsd-3-clause | 271,786,114,187,145,340 | 36.596154 | 91 | 0.467519 | false | 2.788873 | false | false | false |
indautgrp/erpnext | erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py | 1 | 3777 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_colu... | gpl-3.0 | -7,740,807,535,441,435,000 | 33.972222 | 139 | 0.664813 | false | 2.964678 | false | false | false |
dekked/dynamodb-mock | ddbmock/database/item.py | 1 | 9060 | # -*- coding: utf-8 -*-
from ddbmock.errors import ConditionalCheckFailedException, ValidationException
from ddbmock import config
from decimal import Decimal
from math import ceil
from . import comparison
def _decode_field(field):
return field.items()[0]
class ItemSize(int):
def __add__(self, value):
... | lgpl-3.0 | -7,427,540,030,551,715,000 | 37.88412 | 176 | 0.579249 | false | 4.36837 | false | false | false |
perfectsearch/sandman | code/sadm/repoinfo.py | 1 | 4090 | #!/usr/bin/env python
# -*- coding: utf-8 -*
from __future__ import print_function
import os
import sys
try:
from standardoptions import set_up_logging, add_standard_arguments
except:
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'buildscripts'))
from standardoptions im... | mit | -8,831,123,763,097,423,000 | 30.204724 | 103 | 0.62934 | false | 3.738574 | false | false | false |
yashdsaraf/scancode-toolkit | src/cluecode/finder.py | 1 | 15886 | #
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | apache-2.0 | -7,716,903,587,129,529,000 | 29.201521 | 85 | 0.600403 | false | 3.835345 | false | false | false |
rsheftel/pandas_market_calendars | tests/test_bse_calendar.py | 1 | 1192 | import datetime
import pandas as pd
import pytz
from pandas_market_calendars.exchange_calendar_bse import BSEExchangeCalendar, BSEClosedDay
def test_time_zone():
assert BSEExchangeCalendar().tz == pytz.timezone('Asia/Calcutta')
assert BSEExchangeCalendar().name == 'BSE'
def test_holidays():
bse_calend... | mit | -823,092,407,218,533,600 | 29.564103 | 98 | 0.703859 | false | 3.348315 | false | false | false |
dipanjanS/text-analytics-with-python | Old-First-Edition/Ch04_Text_Classification/classifier_evaluation_demo.py | 1 | 3277 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 02 12:36:55 2016
@author: DIP
"""
from sklearn import metrics
import numpy as np
import pandas as pd
from collections import Counter
actual_labels = ['spam', 'ham', 'spam', 'spam', 'spam',
'ham', 'ham', 'spam', 'ham', 'spam',
'spam', 'ham',... | apache-2.0 | -7,227,046,085,735,694,000 | 36.25 | 91 | 0.46567 | false | 4.300525 | false | false | false |
awesto/django-shop | shop/forms/auth.py | 1 | 7249 | from django.conf import settings
from django.contrib.auth import get_user_model, authenticate, login, password_validation
from django.contrib.auth.forms import PasswordResetForm
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMultiAlternatives
from django.core.exceptions im... | bsd-3-clause | -4,549,912,536,911,705,000 | 42.668675 | 113 | 0.653883 | false | 4.116411 | false | false | false |
webbers/dongle.net | bld/libs/builder/src/steps/copyfilesstep.py | 1 | 1151 | import os
import shutil
from steps.abstractstep import *
def copyfile(filename1, filename2):
if not os.path.exists(os.path.dirname(filename2)):
os.makedirs(os.path.dirname(filename2))
shutil.copy( filename1, os.path.dirname(filename2) )
if os.path.isfile (filename2): return True
return False
... | mit | 7,843,665,492,706,745,000 | 30.135135 | 87 | 0.596003 | false | 3.712903 | false | false | false |
lmazuel/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/auto_heal_triggers.py | 1 | 1747 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -7,658,815,519,248,362,000 | 42.675 | 103 | 0.63194 | false | 4.034642 | false | false | false |
Lapeth/timeline | Timeline/data/migrations/0002_auto_20150823_0913.py | 1 | 1872 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def lang(apps, schema_editor):
Language = apps.get_model("Timeline_data", "Language")
en = Language()
en.id = 1
en.code = 'en'
en.indexing = 1
en.name = "English"
en.save()
da = Lan... | apache-2.0 | -8,127,956,987,461,323,000 | 27.8 | 114 | 0.532585 | false | 4.254545 | false | false | false |
amaurywalbert/twitter | net_structure/ks_test/ks_test_models.py | 1 | 5706 | # -*- coding: latin1 -*-
################################################################################################
#
#
import snap, datetime, sys, time, json, os, os.path, shutil, time, struct, random
reload(sys)
sys.setdefaultencoding('utf-8')
#################################################################... | gpl-3.0 | -8,505,254,690,200,277,000 | 45.532787 | 172 | 0.350423 | false | 4.293495 | true | false | false |
endlisnis/weather-records | winterAverages.py | 1 | 4494 | #!/usr/bin/python3
import time, posix, daily, gnuplot, linear, sys, datetime
from dailyFilters import *
from monthName import monthName
START_MONTH=7
START_DAY=1
END_MONTH=7
END_DAY=1
def START_DATE(year):
return datetime.date(year,START_MONTH,START_DAY)
def END_DATE(year):
return datetime.date(year+1,END_MO... | gpl-3.0 | 8,903,026,221,375,308,000 | 29.780822 | 87 | 0.568981 | false | 3.420091 | false | false | false |
krislig/rumblepad2py | pad.py | 1 | 1240 | import usb.core
import usb.util
from time import sleep
dev = usb.core.find(idVendor=0x046d, idProduct=0xc218)
if dev is None:
raise ValueError('Device not found')
interface = 0
endpoint = dev[0][(0,0)][0]
if dev.is_kernel_driver_active(interface) is True:
dev.detach_kernel_driver(interface)
usb.util.claim_inter... | mit | 2,519,202,103,770,096,600 | 23.313725 | 71 | 0.698387 | false | 2.689805 | false | false | false |
jolyonb/edx-platform | lms/djangoapps/badges/backends/badgr.py | 1 | 6775 | """
Badge Awarding backend for Badgr-Server.
"""
from __future__ import absolute_import
import hashlib
import logging
import mimetypes
import requests
import six
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from eventtracking import tracker
from lazy import lazy
from reques... | agpl-3.0 | 3,786,731,688,811,023,400 | 35.820652 | 115 | 0.600886 | false | 4.118541 | false | false | false |
JMSkelton/Transformer | Transformer/IO/_VASP.py | 1 | 5760 | # Transformer/IO/_VASP.py
# -------
# Imports
# -------
import warnings;
from Transformer import Constants;
from Transformer import Structure;
from Transformer.Utilities import StructureTools;
# ---------
# Functions
# ---------
def ReadPOSCARFile(inputReader, atomicSymbolLookupTable = None):
# Variables to ... | gpl-3.0 | -6,654,405,562,310,765,000 | 30.304348 | 169 | 0.660764 | false | 4.059197 | false | false | false |
Jeff1995/oj | judge/ojroot.py | 1 | 1215 | #!/usr/bin/env python
import ConfigParser
import socket
import os
import json
def main():
cf = ConfigParser.ConfigParser()
cf.read("conf/oj.conf")
judge_host = cf.get('sandbox', 'judgeHost')
userid = int(cf.get('sandbox', 'userid'))
server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
... | apache-2.0 | 2,691,872,429,397,832,000 | 32.75 | 138 | 0.622222 | false | 3.139535 | false | false | false |
FiratGundogdu/dagitik | odeve05/message_server.py | 1 | 8494 | __author__ = 'firatlepirate'
import socket
import threading
import Queue
import time
import errno
class WriteThread (threading.Thread):
def __init__(self, name, cSocket, address,fihrist,threadQueue, logQueue ):
threading.Thread.__init__(self)
self.name = name
self.cSocket = cSocket
... | gpl-2.0 | -7,592,662,664,281,051,000 | 32.050584 | 122 | 0.494467 | false | 3.954376 | false | false | false |
nlhepler/freetype-py3 | examples/glyph-vector-2.py | 1 | 3414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ---------------------------------------------------------------... | bsd-3-clause | 3,459,714,015,790,568,400 | 32.80198 | 90 | 0.52812 | false | 3.438066 | false | false | false |
victorvde/dota2_nohats | binary.py | 1 | 9922 | # Copyright (c) Victor van den Elzen
# Released under the Expat license, see LICENSE file for details
from struct import pack, unpack, calcsize
from collections import OrderedDict
def getbytes(s, n):
b = s.read(n)
assert len(b) == n, "Unexpected EOF"
return b
def getbyte(s):
return getbytes(s, 1)
cl... | mit | 739,687,719,123,784,300 | 23.559406 | 72 | 0.551199 | false | 3.561378 | false | false | false |
siliconsmiley/QGIS | python/plugins/GdalTools/tools/doPctRgb.py | 1 | 6670 | # -*- coding: utf-8 -*-
"""
***************************************************************************
doPctRgb.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
*******************... | gpl-2.0 | 2,120,766,154,415,502,600 | 39.920245 | 172 | 0.647526 | false | 4.117284 | false | false | false |
widowild/messcripts | exercice/python3/solutions_exercices/exercice_10_33.py | 1 | 1110 | #! /usr/bin/env python
# -*- coding:Utf8 -*-
## Cette variante utilise une liste de listes ##
## (que l'on pourrait aisément remplacer par deux listes distinctes)
# La liste ci-dessous contient deux éléments qui sont eux-mêmes des listes.
# l'élément 0 contient les nombres de jours de chaque mois, tandis que
# l'élém... | gpl-3.0 | 3,744,835,426,236,196,400 | 40.807692 | 77 | 0.586937 | false | 2.337634 | false | false | false |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/internet/tcp.py | 1 | 31318 | # -*- test-case-name: twisted.test.test_tcp -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Various asynchronous TCP/IP classes.
End users shouldn't use this module directly - use the reactor APIs instead.
Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
"... | bsd-3-clause | 375,367,185,941,382,200 | 34.268018 | 175 | 0.598729 | false | 4.401687 | false | false | false |
jonmaur/draggin-framework | tools/scons_zip.py | 1 | 1497 | import os
import os.path
import glob
import shutil
import datetime
from fnmatch import fnmatch
PROJECT_NAME = "draggin"
if 'PROJECT_NAME' in ARGUMENTS:
PROJECT_NAME = ARGUMENTS["PROJECT_NAME"]
env = Environment(tools = [])
#the full path to this SConscript file
this_sconscript_file = (lambda x:x).func_code.co_filen... | mit | 7,152,029,935,408,573,000 | 24.372881 | 102 | 0.654643 | false | 3.144958 | false | false | false |
MorellatoAriel/PyGobstones | interpreter/vgbs/__init__.py | 1 | 2114 | from ..interpreterWorker import *
from common.tools import tools
from lang.gbs_board import Board
import common.utils
import common.i18n as i18n
import lang
import logging
class GUIGobstonesApi(lang.GobstonesApi):
def __init__(self, communicator):
self.comm = communicator
def read(self):
self.c... | gpl-3.0 | 6,555,255,423,196,050,000 | 40.470588 | 109 | 0.614475 | false | 3.78853 | false | false | false |
jberci/resolwe | resolwe/flow/managers/workload_connectors/slurm.py | 1 | 2517 | """.. Ignore pydocstyle D400.
===============
Slurm Connector
===============
"""
import logging
import os
import shlex
import subprocess
from django.conf import settings
from resolwe.utils import BraceMessage as __
from .base import BaseConnector
logger = logging.getLogger(__name__) # pylint: disable=invalid-na... | apache-2.0 | 1,765,178,422,453,275,600 | 33.479452 | 103 | 0.581645 | false | 4.086039 | false | false | false |
stmobo/Machine-Learning | OpenAI-Gym/agents/dqn.py | 1 | 2613 | import tensorflow as tf
import numpy as np
from agents import mixed_network, spaces
tensorType = tf.float32
class DeepQNetwork:
def __init__(self, graph, session, state_in, netGen, \
target_mix_factor=0.001, gradient_clipping=None,\
discount_factor=0.99, learning_rate=0.001, prefix... | mit | -1,506,260,545,065,428,500 | 37.426471 | 134 | 0.603521 | false | 3.550272 | false | false | false |
mzdaniel/django-selenium-test-runner | dstest/test_runner.py | 1 | 13197 | """Django Selenium test runner.
Incorporate functional testing into Django's manage.py test subcommand
using Selenium web testing tools."""
__author__ = 'Daniel Mizyrycki'
__copyright__ = 'Copyright 2009, Daniel Mizyrycki'
__license__ = 'BSD'
__version__ = '0.1.0'
__maintainer__ = __author__
__email__... | bsd-3-clause | 8,599,218,500,867,330,000 | 38.75 | 80 | 0.626582 | false | 4.134398 | true | false | false |
idegtiarov/ceilometer | ceilometer/network/floatingip.py | 1 | 2715 | # Copyright 2016 Sungard Availability Services
# Copyright 2016 Red Hat
# Copyright 2012 eNovance <licensing@enovance.com>
# Copyright 2013 IBM Corp
# 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 obtai... | apache-2.0 | 4,804,211,110,120,645,000 | 32.9375 | 75 | 0.622468 | false | 4.052239 | false | false | false |
miyucy/oppia | core/domain/stats_domain.py | 1 | 4522 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 | -6,014,838,141,142,006,000 | 35.467742 | 79 | 0.654135 | false | 4.25 | false | false | false |
avanzosc/avanzosc6.1 | avanzosc_tire_management/wizard/wizard_scratch.py | 1 | 11421 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com>
# 28/03/2012
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | -8,667,324,019,660,210,000 | 41.136531 | 156 | 0.463917 | false | 3.834117 | false | false | false |
pizzapanther/Church-Source | churchsource/configuration/migrations/0003_face_search.py | 1 | 1152 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from churchsource.configuration.models import Setting
class Migration(DataMigration):
def forwards(self, orm):
s = Setting(skey='FACE_SEARCH_ENABLE', name='When True, enables check-in... | gpl-3.0 | 844,289,280,137,038,200 | 37.4 | 130 | 0.591146 | false | 3.716129 | false | false | false |
ECP-CANDLE/Benchmarks | Pilot2/P2B1/pilot2_datasets.py | 1 | 1104 | data_sets = {
'3k_Disordered' : ('3k_run10_10us.35fs-DPPC.10-DOPC.70-CHOL.20.dir', 'ece75b704ec63ac9c39afd74b63497dc'),
'3k_Ordered' : ('3k_run32_10us.35fs-DPPC.50-DOPC.10-CHOL.40.dir', '211e1bcf46a3f19a978e4af63f067ce0'),
'3k_Ordered_and_gel' : ('3k_run43_10us.35fs-DPPC.70-DOPC.10-CHOL.20.dir', '87032ff78e4d0173... | mit | 3,668,649,857,986,627,600 | 45 | 112 | 0.653986 | false | 2.152047 | false | false | false |
polyaxon/polyaxon | core/polyaxon/deploy/schemas/auth.py | 1 | 1238 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | 7,205,230,924,192,353,000 | 30.74359 | 74 | 0.727787 | false | 3.880878 | false | false | false |
iarna/joe-editor | tests/joefx/rcfile.py | 1 | 13393 |
import os
from .exceptions import *
GLOBAL_OPTS = set([
'help_is_utf8', 'mid', 'marking', 'asis', 'force', 'nolocks', 'nomodcheck', 'nocurdir',
'nobackups', 'nodeadjoe', 'break_hardlinks', 'break_links', 'lightoff', 'exask', 'beep',
'nosta', 'keepup', 'pg', 'undo_keep', 'csmode', 'backpath', 'floatmouse',... | gpl-2.0 | 3,460,974,747,108,257,300 | 31.987685 | 103 | 0.519749 | false | 3.965946 | false | false | false |
mihaip/streamspigot | app/tweetdigest/data.py | 1 | 8085 | import calendar
import datetime
import itertools
import os
import re
import time
import zlib
from base.constants import CONSTANTS
from datasources import thumbnails, twitter, twitterappengine, twitterdisplay
from datasources.oauth_keys import SERVICE_PROVIDERS
TWITTER_SERVICE_PROVIDER = SERVICE_PROVIDERS['tweetdigest... | apache-2.0 | -2,630,944,226,292,411,400 | 31.34 | 80 | 0.624861 | false | 3.729244 | false | false | false |
alexryndin/ambari | ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/livy_server.py | 1 | 5572 | #!/usr/bin/python
"""
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... | apache-2.0 | -8,514,305,504,603,228,000 | 37.427586 | 133 | 0.727925 | false | 3.762323 | false | false | false |
kernt/linuxtools | gnome3-shell/nautilus-scripts/applications/multimedia/audio/Play-In-XMMS.py | 1 | 1810 | #!/usr/bin/python
#
# simple script to recurse a subtree, find all the mp3 and queue them to
# XMMS.
#
# Please modify this script! My python is rusty at best.
#
# Travis Hume -- travis@usermail.com
# Thu Oct 24 11:06:54 2002
#
# Barak Korren - ifireball@yahoo.com
# Sat Apr 03 2004
# Some bugfixes, now preserves alp... | gpl-3.0 | -3,455,724,984,299,591,000 | 26.014925 | 73 | 0.576796 | false | 3.169877 | false | false | false |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.4/Lib/warnings.py | 1 | 8772 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import sys, types
import linecache
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings"]
# filters conta... | mit | -8,630,744,983,485,260,000 | 33.4 | 79 | 0.604423 | false | 4.193117 | false | false | false |
jepler/linuxcnc-mirror | configs/by_machine/plasmac/plasmac_stats.py | 2 | 14411 | #!/usr/bin/env python
'''
plasmac_stats.py
Copyright (C) 2019 Phillip A Carter
Inspired by and some parts copied from the work of John
(islander261 on the LinuxCNC forum)
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
F... | lgpl-2.1 | -3,141,769,740,846,787,000 | 44.749206 | 131 | 0.598779 | false | 3.306792 | false | false | false |
whiskeysierra/paper-cut | papercut/core.py | 1 | 2458 | from __future__ import unicode_literals
import os
from clint.textui import colored, indent, puts
from glob import glob
from wand.image import Image
sizes = {
'A0': (841.0, 1189.0),
'A1': (594.0, 841.0),
'A2': (420.0, 594.0),
'A3': (297.0, 420.0),
'A4': (210.0, 297.0),
'A5': (148.0, 210.0),
... | mit | -1,643,918,188,222,615,000 | 31.786667 | 90 | 0.454841 | false | 3.674141 | false | false | false |
luisgg/germinate | germinate/tests/test_archive.py | 1 | 3426 | #! /usr/bin/env python
"""Unit tests for germinate.archive."""
# Copyright (C) 2012 Canonical Ltd.
#
# Germinate 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, or (at your option) any
# lat... | gpl-2.0 | 2,343,314,905,086,168,600 | 38.37931 | 78 | 0.624051 | false | 3.979094 | true | false | false |
youngjun0528/moheeto | BaekjoonOnlineJudge/acmicpc_2615.py | 1 | 6033 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 오목
# https://www.acmicpc.net/problem/2615
import sys
import copy
if __name__ == '__main__':
matrix = []
for cnt in range(19):
row_data = [int(x) for x in sys.stdin.readline().strip().replace(' ','')]
matrix.append(row_data)
# 1이 이기는 경우
... | apache-2.0 | 1,503,235,518,156,774,100 | 35.496933 | 96 | 0.353673 | false | 3.741509 | false | false | false |
btgoodwin/apgRasPi | server/UIs/Tornado/pi_server.py | 1 | 9178 | #!/usr/bin/env python
import os
import sys
import time
import pdb
import json
import socket
import argparse
import tornado.web
import tornado.websocket
import tornado.httpserver
import tornado.ioloop
from threading import Timer
from heapq import merge
from ossie.utils import redhawk
from ossie.utils.redhawk.channels... | lgpl-3.0 | 3,179,455,331,251,596,300 | 38.390558 | 119 | 0.569296 | false | 3.684464 | false | false | false |
fugitifduck/exabgp | lib/exabgp/bgp/message/update/attribute/community/community.py | 1 | 2080 | # encoding: utf-8
"""
community.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from struct import pack
from struct import unpack
# ==================================================================== Community
#
class Community (object):
NO_EXPORT ... | bsd-3-clause | -291,284,668,875,226,200 | 24.679012 | 90 | 0.659615 | false | 3.151515 | false | false | false |
UNICT-DMI/Telegram-DMI-Bot | module/commands/lezioni.py | 1 | 10829 | # -*- coding: utf-8 -*-
"""/lezioni command"""
import logging
import re
from typing import Tuple
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import CallbackContext
from module.data import Lesson
from module.shared import check_log, send_message
logging.basicConfig(format='... | gpl-3.0 | 4,424,277,043,675,171,300 | 45.021277 | 154 | 0.678225 | false | 3.331793 | false | false | false |
tensorflow/probability | tensorflow_probability/python/experimental/mcmc/sample_fold_test.py | 1 | 18337 | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 | 5,906,248,424,636,624,000 | 37.202083 | 82 | 0.670557 | false | 3.393227 | true | false | false |
JesseBuesking/clocked | clocked/decorators.py | 1 | 3351 | """ Decorator support for clocked. """
import inspect
import new
from clocked.profiler_provider import ProfilerProvider
def _create_function_wrapper(obj, name):
def wrapper(*args, **kwargs):
profiler = ProfilerProvider.get_current_profiler()
if profiler is None:
return obj(*args, **k... | mit | 8,303,731,516,610,316,000 | 32.51 | 80 | 0.509997 | false | 4.444297 | false | false | false |
Titulacion-Sistemas/PythonTitulacion-EV | Lib/site-packages/pylint/test/functional/abstract_class_instantiated_py3.py | 1 | 1178 | """Check that instantiating a class with
`abc.ABCMeta` as metaclass fails if it defines
abstract methods.
"""
# pylint: disable=too-few-public-methods, missing-docstring
# pylint: disable=abstract-class-not-used, abstract-class-little-used
# pylint: disable=abstract-method
__revision__ = 0
import abc
class GoodClas... | mit | 8,542,265,376,761,066,000 | 23.541667 | 69 | 0.689304 | false | 3.775641 | false | false | false |
sequarius/DockerCenter | client/dockerc.py | 1 | 6400 | import sys
from idl.ttypes import CommandDTO
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from idl import CenterSynRPCService
from Command import Command
from prettytable import PrettyTable
sys.path.append("./idl")
d... | mit | 9,125,652,749,247,856,000 | 33.978142 | 115 | 0.60375 | false | 3.909591 | false | false | false |
nOkuda/activetm | activetm/labeled.py | 1 | 3406 | """LabeledDataset for labeled datasets"""
import numpy as np
import ankura.pipeline
def get_labels(filename):
"""Since labels are assumed to be normalized from 0 to 1 in computing the
augmented Q matrix, this function will scale all labels to fit this range
"""
smallest = float('inf')
largest = fl... | gpl-3.0 | -1,385,774,416,320,325,000 | 41.575 | 95 | 0.630945 | false | 4.103614 | false | false | false |
Fost/django-boot | config/settings.py | 1 | 5558 | """
Django settings for {{ project_name }} project.
Common settings for all environments. Don't directly use this settings file,
use environments/development.py or environments/production.py and import this
file from there.
"""
import sys
from path import path
from django.conf import global_settings
PROJECT_NAME = "B... | mit | 3,567,302,115,650,525,000 | 30.76 | 88 | 0.685498 | false | 3.833103 | false | false | false |
maistrovas/Internet-Store | Internet_store/home/views.py | 1 | 1180 | from django.shortcuts import render
from django.conf import settings
from django.core.mail import send_mail
from django.shortcuts import render
from Internet_store.products.models import ProductFeatured, Product
def home(request):
title = 'Sign up now!'
featured_image = ProductFeatured.objects.filter(active=... | mit | 1,821,171,190,496,549,000 | 30.052632 | 72 | 0.607627 | false | 3.586626 | false | false | false |
syci/domsense-agilebg-addons | account_vat_on_payment/account.py | 1 | 13339 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This progra... | gpl-2.0 | -3,210,202,336,083,480,600 | 55.521186 | 290 | 0.54022 | false | 4.032346 | false | false | false |
willre/homework | day02/shopping.py | 1 | 6490 | #!/usr/bin/env python
# encoding: utf-8
"""
@version:
@author: Will
@license:
@contact:
@site: http://www.timesnotes.com
@file: shopping.py
@time: 15-11-3 上午8:48
"""
from collections import OrderedDict
########################################
# 预算金额
while True:
tmp_yusuan = raw_input("预算金额(最小单位:元):")
if... | gpl-2.0 | -1,441,964,848,486,135,300 | 33.934524 | 147 | 0.57805 | false | 2.473862 | false | false | false |
LEX2016WoKaGru/pyClamster | gui/region.py | 1 | 5174 | # -*- coding: utf-8 -*-
"""
Created on 09.06.16
Created for pyclamster-gui
Copyright (C) {2016}
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
... | gpl-3.0 | -3,441,065,994,838,054,400 | 37.61194 | 113 | 0.591998 | false | 3.370684 | false | false | false |
gogetdata/ggd-cli | ggd/search.py | 1 | 22038 | # -------------------------------------------------------------------------------------------------------------
## Import Statements
# -------------------------------------------------------------------------------------------------------------
from __future__ import print_function
import sys
from .utils import get_b... | mit | -37,952,016,967,056,370 | 36.038655 | 181 | 0.493602 | false | 4.354475 | false | false | false |
django-oscar/django-oscar-mws | oscar_mws/test/factories.py | 1 | 4670 | import factory
from time import time
from decimal import Decimal as D
from django.utils.timezone import now
from django.db.models import get_model
from oscar.core.loading import get_class
from oscar_mws import MWS_MARKETPLACE_US
Selector = get_class('partner.strategy', 'Selector')
class UserFactory(factory.Djang... | bsd-3-clause | -2,751,810,532,007,086,000 | 29.324675 | 76 | 0.701285 | false | 3.398836 | false | false | false |
chop-dbhi/serrano | serrano/resources/field/dims.py | 1 | 7254 | from decimal import Decimal
from django.db.models import Q, Count
from django.utils.encoding import smart_unicode
from restlib2.http import codes
from restlib2.params import Parametizer, StrParam, BoolParam, IntParam
from modeltree.tree import MODELTREE_DEFAULT_ALIAS, trees
from avocado.events import usage
from avocado... | bsd-2-clause | 3,394,574,782,945,426,000 | 33.056338 | 78 | 0.546319 | false | 4.614504 | false | false | false |
vecnet/vecnet.azure | VM_Mock.py | 1 | 5058 | from settings_local import SUBSCRIPTION_ID, STORAGE_ACCOUNT_NAME, STORAGE_ACCOUNT_KEY, EMAIL_USERNAME, EMAIL_PASSWORD
__author__ = 'Natalie Sanders'
__author__ = 'Natalie Sanders'
from azure.servicemanagement import *
from azure.storage import *
from subprocess import call
from os import chdir
import os
import socke... | mpl-2.0 | -3,948,261,241,863,998,000 | 33.408163 | 128 | 0.574931 | false | 3.855183 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.