repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values | var_hash int64 -9,223,186,179,200,150,000 9,223,291,175B | doc_hash int64 -9,223,304,365,658,930,000 9,223,309,051B | line_mean float64 3.5 99.8 | line_max int64 13 999 | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
132nd-etcher/EMFT | emft/gui/tab_about.py | 1 | 1269 | # coding=utf-8
from emft.core import constant
from emft.core.logging import make_logger
from emft.gui.base import GridLayout, HSpacer, Label, VLayout, VSpacer
from emft.gui.main_ui_tab_widget import MainUiTabChild
LOGGER = make_logger(__name__)
class TabChildAbout(MainUiTabChild):
def tab_clicked(self):
... | gpl-3.0 | 780,620,645,744,232,400 | -6,537,607,988,053,126,000 | 27.2 | 82 | 0.502758 | false |
jfinkels/networkx | networkx/readwrite/graph6.py | 3 | 7803 | # Original author: D. Eppstein, UC Irvine, August 12, 2003.
# The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain.
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# Tomas Gavenciak <gavento@ucw.cz>
... | bsd-3-clause | 8,297,269,426,694,884,000 | -3,826,876,541,812,963,000 | 25.09699 | 80 | 0.570934 | false |
imply/chuu | ppapi/generators/idl_lexer.py | 62 | 9292 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Lexer for PPAPI IDL """
#
# IDL Lexer
#
# The lexer is uses the PLY lex library to build a tokenizer which understands
# WebID... | bsd-3-clause | 5,317,699,096,860,631,000 | 7,263,202,688,237,150,000 | 25.624642 | 80 | 0.622901 | false |
sanger-pathogens/gff3toembl | gff3toembl/EMBLConverter.py | 3 | 1946 | import gff3toembl
from gt import CustomVisitor
from gff3toembl.EMBLContig import EMBLContig
class EMBLConverter(CustomVisitor):
def __init__(self, locus_tag=None, translation_table=11):
CustomVisitor.__init__(self)
self.contigs = {}
self.locus_tag = locus_tag
self.translation_table... | gpl-3.0 | 1,926,829,460,692,399,900 | -708,487,220,745,068,800 | 46.463415 | 156 | 0.633607 | false |
SanPen/GridCal | src/GridCal/Engine/Sparse/utils.py | 1 | 2463 | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | gpl-3.0 | 6,019,726,522,540,913,000 | -995,721,098,688,405,400 | 33.208333 | 113 | 0.587089 | false |
trashkalmar/omim | tools/python/mwm/dump_mwm.py | 10 | 1418 | #!/usr/bin/python
import sys, os.path, random
import json
from mwm import MWM
if len(sys.argv) < 2:
print('Dumps some MWM structures.')
print('Usage: {0} <country.mwm>'.format(sys.argv[0]))
sys.exit(1)
mwm = MWM(open(sys.argv[1], 'rb'))
mwm.read_types(os.path.join(os.path.dirname(sys.argv[0]), '..', '..',... | apache-2.0 | -1,666,888,041,325,059,300 | -4,498,748,573,651,022,000 | 34.45 | 97 | 0.631171 | false |
vergecurrency/electrum-xvg | gui/qt/version_getter.py | 2 | 4598 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | gpl-3.0 | 9,210,067,497,314,935,000 | -5,745,468,158,435,431,000 | 35.784 | 125 | 0.645063 | false |
lambeau/ansible-modules-core | cloud/openstack/_quantum_router.py | 37 | 7032 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... | gpl-3.0 | 7,256,300,803,703,418,000 | 1,436,887,258,766,311,400 | 31.256881 | 122 | 0.625427 | false |
regionbibliotekhalland/digitalasagor | edittabvideo.py | 1 | 4897 | # Copyright 2013 Regionbibliotek Halland
#
# This file is part of Digitala sagor.
#
# Digitala sagor 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 | -5,058,063,836,021,137,000 | 7,373,712,909,376,517,000 | 35.669231 | 112 | 0.603226 | false |
devalbo/mm_anywhere | google/protobuf/internal/encoder.py | 484 | 25695 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | agpl-3.0 | 5,709,194,657,205,806,000 | 732,076,512,618,822,400 | 32.413524 | 80 | 0.67663 | false |
ciudadanointeligente/lobby_cplt | lobby/csv_reader.py | 1 | 1655 | from lobby.models import Active, Audiencia, Passive
from popolo.models import Identifier
import uuid
import unicodedata
from datetime import datetime
class ActivosCSVReader():
def parse_line(self, line):
active = Active()
active.name = unicode(line[3] + " " + line[4])
active.save()
... | agpl-3.0 | 8,336,952,305,327,993,000 | 2,831,408,640,563,105,000 | 30.826923 | 87 | 0.607855 | false |
marcelocure/django | django/core/management/sql.py | 399 | 1890 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
"""
Returns a list of the SQL statements used to flush the database.
If only_django is True, then only table n... | bsd-3-clause | -2,561,690,969,595,645,400 | -735,251,645,773,106,600 | 36.8 | 101 | 0.667196 | false |
johanvdw/rasterio | examples/concurrent-cpu-bound.py | 6 | 3361 | """concurrent-cpu-bound.py
Operate on a raster dataset window-by-window using a ThreadPoolExecutor.
Simulates a CPU-bound thread situation where multiple threads can improve performance.
With -j 4, the program returns in about 1/4 the time as with -j 1.
"""
import concurrent.futures
import multiprocessing
import ti... | bsd-3-clause | -2,754,200,184,191,004,700 | 153,778,353,819,631,900 | 34.378947 | 86 | 0.551026 | false |
Alwnikrotikz/micolog2 | plugins/wapblog/wapblog.py | 2 | 8001 | # -*- coding: utf-8 -*-
from micolog_plugin import *
import logging
import urllib
from model import *
from google.appengine.api import users
from google.appengine.api import memcache
from base import BaseRequestHandler,request_cache
from google.appengine.ext import webapp
from datetime import datetime, timedelta
def u... | gpl-3.0 | -1,066,156,452,368,180,400 | 3,483,973,721,551,884,300 | 37.685279 | 206 | 0.677339 | false |
labordoc/labordoc-next | modules/webtag/lib/webtag_forms.py | 3 | 7394 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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
## License, or (at your option) a... | gpl-2.0 | -5,501,008,173,432,027,000 | 1,721,646,194,088,208,100 | 34.893204 | 80 | 0.620638 | false |
buguelos/odoo | addons/point_of_sale/controllers/main.py | 243 | 1576 | # -*- coding: utf-8 -*-
import logging
import simplejson
import os
import openerp
import time
import random
import werkzeug.utils
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import module_boot, login_redirect
_logger = logging.getLogger(__name__)
class PosContr... | agpl-3.0 | 5,845,252,346,859,807,000 | 5,118,021,337,117,765,000 | 31.833333 | 123 | 0.593274 | false |
JFriel/honours_project | networkx/networkx/algorithms/shortest_paths/dense.py | 42 | 5102 | # -*- coding: utf-8 -*-
"""Floyd-Warshall algorithm for shortest paths.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """Aric Hagberg <aric.h... | gpl-3.0 | -2,716,379,292,489,024,500 | 5,749,162,952,149,643,000 | 31.291139 | 78 | 0.635045 | false |
kafan15536900/shadowsocks | shadowsocks/eventloop.py | 51 | 7513 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 | 1,007,031,284,025,270,000 | 5,920,291,187,102,049,000 | 28.120155 | 77 | 0.562891 | false |
indhub/mxnet | example/recommenders/randomproj.py | 14 | 6041 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 | -8,505,338,246,276,671,000 | 1,213,403,182,864,530,700 | 39.273333 | 97 | 0.652044 | false |
nschneid/pyutil | ds/set.py | 4 | 2535 | '''
OrderedSet implementation, from http://stackoverflow.com/questions/1653970/does-python-have-an-ordered-set/1653978#1653978
The index() method and a few unit tests have been added.
@author: Nathan Schneider (nschneid)
@since: 2010-08-11
'''
# Strive towards Python 3 compatibility
from __future__ import print_func... | mit | -8,520,959,205,549,158,000 | -8,972,021,700,080,776,000 | 26.554348 | 122 | 0.584615 | false |
Dave-ts/Sigil | src/Resource_Files/plugin_launchers/python/sigil_bs4/builder/_lxml.py | 5 | 10167 | from __future__ import unicode_literals, division, absolute_import, print_function
import sys
PY3 = sys.version_info[0] == 3
if PY3:
text_type = str
binary_type = bytes
unicode = str
else:
range = xrange
text_type = unicode
binary_type = str
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTr... | gpl-3.0 | -4,622,860,858,907,824,000 | 8,587,186,473,691,638,000 | 35.053191 | 93 | 0.618963 | false |
ossdemura/django-miniblog | src/Lib/site-packages/django/contrib/gis/db/backends/postgis/pgraster.py | 491 | 5071 | import binascii
import struct
from django.forms import ValidationError
from .const import (
GDAL_TO_POSTGIS, GDAL_TO_STRUCT, POSTGIS_HEADER_STRUCTURE, POSTGIS_TO_GDAL,
STRUCT_SIZE,
)
def pack(structure, data):
"""
Pack data into hex string with little endian format.
"""
return binascii.hexli... | mit | -6,334,916,719,069,067,000 | 6,177,857,146,261,548,000 | 30.496894 | 79 | 0.626504 | false |
RootForum/magrathea | magrathea/cli/commands/version.py | 1 | 1239 | # -*- coding: utf-8 -*-
"""
magrathea.cli.commands.version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the RootForum.org team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
import magrathea
from ..base import BaseCommand
class VersionCommand(BaseCommand):
"""
... | mit | 7,474,105,363,412,676,000 | -3,523,605,944,312,882,700 | 30.769231 | 95 | 0.603713 | false |
2014c2g4/c2g4 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | gpl-2.0 | 5,377,505,398,410,937,000 | 8,219,255,604,507,200,000 | 31.831461 | 84 | 0.612252 | false |
ratnania/pigasus | doc/manual/include/demo/test_neumann_quartcircle.py | 1 | 2730 | #! /usr/bin/python
# ...
try:
from matplotlib import pyplot as plt
PLOT=True
except ImportError:
PLOT=False
# ...
import numpy as np
from pigasus.gallery.poisson import *
import sys
import inspect
filename = inspect.getfile(inspect.currentframe()) # script filename (usually with path)
# ...... | mit | -6,280,085,234,493,662,000 | -8,082,561,401,385,837,000 | 17.322148 | 97 | 0.456044 | false |
aroig/offlineimap | test/OLItest/globals.py | 12 | 1373 | #Constants, that don't rely on anything else in the module
# Copyright (C) 2012- Sebastian Spaeth & contributors
#
# 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 th... | gpl-2.0 | 7,658,065,020,478,947,000 | 4,414,208,022,772,053,000 | 31.690476 | 78 | 0.748725 | false |
wsilva/fdp-folha-de-ponto-ach2077 | fdp/settings/base.py | 1 | 2384 | """
Django settings for fdp 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/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | gpl-3.0 | 7,745,456,355,557,954,000 | 6,094,693,808,234,647,000 | 23.326531 | 71 | 0.713926 | false |
flyher/pymo | symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/cp1253.py | 593 | 13350 | """ Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | mit | 9,088,449,105,050,500,000 | -4,117,290,232,040,372,700 | 42.485342 | 119 | 0.545843 | false |
antonioguirola/webpy-base | forms.py | 1 | 4418 | # -*- coding: utf-8 -*-
from web import form
import re
import db
# Expresiones regulares necesarias:
#formatoVisa=re.compile(r'[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}')
# Funciones necesarias para las validaciones
def fooFunction():
pass
"""
EJEMPLO DE FORMULARIO PARA DARSE DE ALTA
formularioInscripcion = form.... | gpl-3.0 | -5,111,416,543,373,467,000 | -6,007,240,353,605,437,000 | 33.155039 | 121 | 0.433727 | false |
hehongliang/tensorflow | tensorflow/contrib/tensorrt/custom_plugin_examples/inc_op.py | 37 | 1215 | # Copyright 2018 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 | 325,638,944,133,152,600 | -8,517,909,292,822,585,000 | 36.96875 | 79 | 0.700412 | false |
binghongcha08/pyQMD | sys_bath/bilinear/sys_bath_lqf.py | 2 | 10991 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 25 09:42:22 2016
@author: bing
"""
import numpy as np
#import scipy
import numba
import sys
import math
bohr_angstrom = 0.52917721092
hartree_wavenumber = 219474.63
#hartree_wavenumber = scipy.constants.value(u'hartree-inverse meter relationship') / 1e2
def M... | gpl-3.0 | -6,172,904,489,373,398,000 | 1,340,156,213,176,367,600 | 20.136538 | 96 | 0.459467 | false |
estaban/pyload | module/plugins/accounts/FileserveCom.py | 1 | 2261 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | gpl-3.0 | 902,533,730,763,959,600 | -213,686,237,428,314,900 | 37.982759 | 116 | 0.597523 | false |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 25