Dataset Viewer
Auto-converted to Parquet Duplicate
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
End of preview. Expand in Data Studio

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

CodeParrot Dataset

This is the validation split of the CodeParrot dataset. It contains Python files used to train the code generation model in Chapter 10: Training Transformers from Scratch in the NLP with Transformers book. You can find the full code in the accompanying Github repository.

See the full dataset for more information.

Downloads last month
32