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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
katholt/Kleborate | kleborate/kaptive.py | 1 | 7371 | """
Copyright 2020 Kat Holt
Copyright 2020 Ryan Wick (rrwick@gmail.com)
https://github.com/katholt/Kleborate/
This file is part of Kleborate. Kleborate 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 versi... | gpl-3.0 | -157,071,924,926,960,350 | 42.105263 | 100 | 0.598019 | false | 3.622113 | false | false | false |
glennhickey/hal | stats/halStats.py | 1 | 4185 | #!/usr/bin/env python3
#Copyright (C) 2012 by Glenn Hickey
# Copyright (C) 2012-2019 by UCSC Computational Genomics Lab
#
#Released under the MIT license, see LICENSE.txt
#!/usr/bin/env python3
"""Little python halStats wrapper.
"""
import argparse
import os
import sys
import copy
import subprocess
from multiprocessi... | mit | -575,556,338,276,000,830 | 34.168067 | 106 | 0.622939 | false | 3.739946 | false | false | false |
tweemeterjop/thug | thug/DOM/W3C/Events/EventTarget.py | 1 | 7305 | #!/usr/bin/env python
from .Event import Event
from .HTMLEvent import HTMLEvent
from .MouseEvent import MouseEvent
import logging
log = logging.getLogger("Thug")
# Introduced in DOM Level 2
class EventTarget(object):
def __init__(self):
if log.ThugOpts.Personality.isIE() and log.ThugOpts.Personality.bro... | gpl-2.0 | -6,001,028,342,717,685,000 | 39.810056 | 138 | 0.641889 | false | 4.222543 | false | false | false |
blaskovic/systemd-rhel | test/sysv-generator-test.py | 1 | 15903 | # systemd-sysv-generator integration test
#
# (C) 2015 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the... | gpl-2.0 | -4,595,265,438,169,582,600 | 39.672634 | 95 | 0.589511 | false | 3.820082 | true | false | false |
OCA/l10n-italy | l10n_it_withholding_tax_payment/migrations/12.0.1.0.0/pre-migrate.py | 1 | 1432 | # Copyright 2019 Matteo Bilotta
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from datetime import datetime
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT
_logger = logging.getLogger(__name__)
def _fix_date_field(cr):
cr.execute("SELECT id, date FROM withholding_ta... | agpl-3.0 | -6,940,392,497,620,026,000 | 30.130435 | 79 | 0.594972 | false | 4.045198 | false | false | false |
muffato/pyEnsemblRest | ensembl/genome.py | 1 | 8089 |
from . import _pyrest_core
class Identifier(_pyrest_core.BaseObject):
""""""
class Sequence(_pyrest_core.BaseObject):
""""""
class Feature(_pyrest_core.BaseObject):
""""""
seq_region_name = property(_pyrest_core.fget("_seq_region_name"), None, None, """Name of the chromosome, scaffold, etc the feat... | apache-2.0 | -8,566,040,569,722,162,000 | 34.47807 | 187 | 0.64767 | false | 3.790534 | false | false | false |
mylokin/servy | servy/utils/dsntool.py | 1 | 4496 | import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlsplit
It exposes the following attributes:
... | mit | -2,946,799,996,985,439,700 | 27.636943 | 100 | 0.554493 | false | 4.143779 | false | false | false |
niekas/dakis | dakis/website/migrations/socialaccount/0002_auto_20150906_0741.py | 1 | 1831 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('socialaccount', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='OpenIDNonce',
fields... | agpl-3.0 | -8,892,894,586,342,326,000 | 38.804348 | 175 | 0.54178 | false | 4.543424 | false | false | false |
supernifty/mgsa | mgsa/bio/sam.py | 1 | 37497 |
import collections
import datetime
#pypy import numpy
import random
import re
import struct
import subprocess
import sys
import zlib
import bio
import fasta
import features
import statistics
import vcf
SOFT_CLIP_CONFIDENCE = 0.0
class SamToMultiChromosomeVCF(object):
def __init__( self, sam, multi_fasta_reference... | mit | -1,149,161,500,572,779,000 | 43.375148 | 307 | 0.57754 | false | 3.196403 | false | false | false |
thandal/passe-partout | pp/pp_parse.py | 1 | 1809 | # The following parse_* methods are from bitcoin-abe
import base58
def parse_TxIn(vds):
d = {}
d['prevout_hash'] = vds.read_bytes(32)
d['prevout_n'] = vds.read_uint32()
d['scriptSig'] = vds.read_bytes(vds.read_compact_size())
d['sequence'] = vds.read_uint32()
return d
def parse_TxOut(vds):
d = {}
d['... | mit | 8,646,349,602,328,694,000 | 26.830769 | 83 | 0.622996 | false | 2.558699 | false | false | false |
plxaye/chromium | src/chrome/common/extensions/docs/server2/file_system.py | 1 | 2415 | # 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.
import os
class FileNotFoundError(Exception):
def __init__(self, filename):
Exception.__init__(self, filename)
class StatInfo(object):
'''The r... | apache-2.0 | -7,073,593,924,408,705,000 | 33.014085 | 80 | 0.668737 | false | 4.018303 | false | false | false |
bswartz/manila | manila/db/migrations/alembic/versions/e9f79621d83f_add_cast_rules_to_readonly_to_share_instances.py | 1 | 3557 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | apache-2.0 | 8,912,947,635,243,359,000 | 34.929293 | 77 | 0.640708 | false | 4.112139 | false | false | false |
julienmalard/Tinamit | tinamit/mod/modelo.py | 1 | 13165 | import datetime as ft
import pickle
from multiprocessing import Pool as Reserva
from warnings import warn as avisar
import numpy as np
from tinamit.config import _, conf_mods
from .corrida import Corrida, Rebanada
from .extern import gen_extern
from .res import ResultadosGrupo, ResultadosSimul
from .vars_mod import V... | gpl-3.0 | -1,577,589,425,477,654,000 | 31.049261 | 119 | 0.577851 | false | 3.356203 | true | false | false |
ebroecker/canmatrix | src/canmatrix/formats/fibex.py | 1 | 14339 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Eduard Broecker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that
# the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this lis... | bsd-2-clause | -2,854,157,748,033,763,000 | 43.949843 | 150 | 0.61392 | false | 3.488808 | false | false | false |
e0ne/cinder | cinder/volume/drivers/netapp/nfs.py | 1 | 65195 | # Copyright (c) 2012 NetApp, 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.0
#
# Unless required... | apache-2.0 | 4,086,502,029,736,078,000 | 42.579545 | 79 | 0.549613 | false | 4.092593 | true | false | false |
rwl/PyCIM | CIM15/IEC62325/MarketRole.py | 1 | 4085 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, publish... | mit | -2,918,207,340,452,052,000 | 50.0625 | 499 | 0.717503 | false | 4.185451 | false | false | false |
zielmicha/torrent-workshops | downloader.py | 1 | 7757 | import torrent
import bencode
import sys
import socket
import os
import struct
import math
import hashlib
import random
import locks
import threading
from protocol import protocol_header, header_reserved, message_types, PeerBase
class LoggingFile(object):
def __init__(self, file, path):
self.file = file
... | gpl-3.0 | 902,006,854,948,713,100 | 29.182879 | 88 | 0.561815 | false | 3.769193 | false | false | false |
jcfr/girder | girder/api/api_main.py | 1 | 1856 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 | -8,329,281,273,154,330,000 | 30.457627 | 79 | 0.633082 | false | 3.84265 | false | false | false |
suutari-ai/shoop | shuup/testing/soup_utils.py | 3 | 1839 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
SIMPLE_INPUT_TYPES = ('t... | agpl-3.0 | 8,655,336,477,004,699,000 | 29.147541 | 106 | 0.578575 | false | 4.059603 | false | false | false |
yordan-desta/QgisIns | python/plugins/processing/algs/lidar/lastools/LAStoolsUtils.py | 1 | 2037 | # -*- coding: utf-8 -*-
"""
***************************************************************************
LAStoolsUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 | -2,122,443,644,075,665,700 | 37.433962 | 104 | 0.508591 | false | 4.737209 | false | false | false |
maxf/home | monitor-with-pir-and-piface.py | 1 | 4249 | import RPi.GPIO as GPIO
import time
import pifacedigitalio
import picamera
import datetime
import json
import sys
import os
media_directory = 'home-server/public/images/media'
data_directory = 'home-server/public/data/'
schedule = json.loads(open(data_directory + 'schedule.json').read())
in_hours = False
previous_stat... | mit | 9,101,339,688,224,264,000 | 36.9375 | 97 | 0.578724 | false | 3.740317 | false | false | false |
piotrmaslanka/satella | satella/coding/deleters.py | 1 | 6711 | import collections
import copy
import typing as tp
from satella.coding.typing import T
ITER_KEYS = 0
ITER_VALUES = 1
ITER_ITEMS = 2
class DictDeleter:
"""
Having problems deleting entries from your dict while iterating on them? No problem. Just swap
the following:
>>> keys_to_delete = []
>>> fo... | bsd-3-clause | -2,039,670,965,496,659,200 | 31.57767 | 98 | 0.601103 | false | 3.929157 | false | false | false |
Zearin/python-ietflib | pyietflib/rfc6350/property.py | 1 | 16972 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""`vCard Property <http://tools.ietf.org/html/rfc6350#section-6>`_"""
__version__ = '1.0'
__copyright__ = """Copyright 2011 Lance Finn Helsten (helsten@acm.org)"""
__license__ = """
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | apache-2.0 | 6,465,395,164,945,987,000 | 29.879562 | 116 | 0.591183 | false | 3.180827 | false | false | false |
wtsi-hgi/irobot | irobot/irods/_api.py | 1 | 4842 | """
Copyright (c) 2017 Genome Research Ltd.
Author: Christopher Harrison <ch12@sanger.ac.uk>
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-3.0 | -2,746,057,474,322,888,700 | 29.840764 | 111 | 0.621437 | false | 3.765163 | false | false | false |
D8TM/railtracker | mapfeed/models.py | 1 | 3634 | from django.db import models
from fields import ListField, ColourField
# Create your models here.
class MapCity(models.Model):
#Creation date
create_date = models.DateTimeField('Date Created', auto_now_add=True)
#Name of the city
city_name = models.CharField(max_length=200)
#Local rail name
rail_na... | apache-2.0 | -5,882,769,476,731,179,000 | 25.333333 | 97 | 0.661805 | false | 3.793319 | false | false | false |
shawnleo001/Pythonoob | email/email_1mysmtpImage.py | 1 | 1911 | #! /Library/Frameworks/Python.framework/Versions/3.5/bin/python3
# -*- coding: utf-8 -*-
# 163服务器地址:
# POP3服务器: pop.163.com
# SMTP服务器: smtp.163.com
# IMAP服务器: imap.163.com
# sina服务器地址:
# POP3服务器:pop.sina.com
# SMTP服务器:smtp.sina.com
from email import encoders
from email.header import Header
from email.mime.multipart ... | gpl-3.0 | -8,990,539,315,569,352,000 | 26.460317 | 77 | 0.677848 | false | 2.398058 | false | false | false |
cantora/mozz | mozz/adapter/__init__.py | 1 | 6897 | # Copyright 2013 anthony cantor
# This file is part of mozz.
#
# mozz 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.
#
# mozz is di... | gpl-3.0 | 591,013,774,502,349,400 | 26.698795 | 92 | 0.686965 | false | 3.210894 | false | false | false |
chrismattmann/girder | tests/js_coverage_tool.py | 1 | 5307 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 | -4,655,488,888,105,926,000 | 32.588608 | 79 | 0.574901 | false | 4.101236 | false | false | false |
chubbymaggie/barf-project | tests/arch/x86/test_x86translator.py | 1 | 96331 | # Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | bsd-2-clause | -3,071,820,661,781,798,000 | 32.436654 | 107 | 0.584755 | false | 3.00546 | true | false | false |
madisonflaherty/Food | oldTests/pyqueryTest2.py | 1 | 1139 | """
Test 2.
"""
from pyquery import PyQuery as pq
from lxml import etree
import urllib
import pprint
def parser(d):
p = d(".current .menu-day-content").items()
for each in p:
thing = str(each.html())
thing2 = thing.replace("\t", "").strip()
lst = thing2.split("\n")
lst2 = []
for item in lst:
if len(i... | mit | 2,532,917,396,390,747,600 | 21.333333 | 68 | 0.641791 | false | 2.869018 | false | false | false |
nshearer/nansible | src/nansible/RootSourceFolder.py | 1 | 1144 | import os
import gflags
from SourceFolder import SourceFolder
class RootSourceFolder(SourceFolder):
'''The root of the source tree'''
def __init__(self, path):
super(RootSourceFolder, self).__init__(
parent = None,
path = os.path.abspath(path),
source_tree... | gpl-2.0 | -1,272,952,370,172,934,100 | 25.022727 | 73 | 0.572552 | false | 4.316981 | false | false | false |
AndrejMaris/facefit | facefit/esr/fern.py | 1 | 5211 | r"""
Implementation of a random fern, used for regression.
The fern is learnt a mapping from vectors of pixels to corresponding
vectorial delta shapes.
"""
import numpy as np
import cv2
from facefit.base import RegressorBuilder, Regressor
from facefit.util import rand_unit_vector
class FernBuilder(RegressorBuilder)... | mit | 5,822,777,940,132,318,000 | 42.066116 | 120 | 0.596239 | false | 3.695745 | false | false | false |
vzhong/semeval | train.py | 1 | 4303 | #!/usr/bin/env python
"""train.py
Usage:
train.py [--n_mem=<dim>] [--dropout=<p>]
Options:
--n_mem=<dim> Dimension of LSTM [default: 300]
--dropout=<p> strength of dropout [default: 0.3]
"""
import theano
import logging
import numpy as np
import pprint
import json
import cPickle as pkl
from collec... | mit | 4,745,451,878,912,980,000 | 31.847328 | 120 | 0.642807 | false | 3.662128 | true | false | false |
wdzhou/mantid | scripts/test/SANS/gui_logic/state_gui_model_test.py | 1 | 28778 | from __future__ import (absolute_import, division, print_function)
import unittest
import mantid
from sans.gui_logic.models.state_gui_model import StateGuiModel
from sans.user_file.settings_tags import (OtherId, event_binning_string_values, DetectorId, det_fit_range)
from sans.common.enums import (ReductionDimensiona... | gpl-3.0 | -6,519,253,081,323,784,000 | 56.671343 | 120 | 0.525436 | false | 4.140719 | true | false | false |
khs26/rotamer_library | rotamer/topology/chirality.py | 1 | 7386 | #!/usr/bin/python
import read_amber_prmtop as ra
import networkx as nx
import itertools
class GhostAtom(ra.Atom):
pass
valences = {"H": 1,
"C": 4,
"N": 3,
"O": 2,
"S": 2,
"Se": 2,
"P": 5}
def tetravalent_atoms(atoms):
"""
Identif... | mit | -7,720,001,500,430,127,000 | 39.360656 | 119 | 0.607636 | false | 3.375686 | false | false | false |
BrandonSmithJ/tensorflow-double-DQN | Double-DQN/double_dqn.py | 1 | 5967 | import sys
sys.path.append('tensorflow-deepq')
from tf_rl.controller.discrete_deepq import DiscreteDeepQ
import tensorflow as tf
import random
import numpy as np
class DDQN(DiscreteDeepQ):
target_update_frequency = 1e4
def create_variables(self):
self.target_network_update_rate = 1.0
self.target_network_upda... | mit | -8,140,536,817,905,413,000 | 39.876712 | 130 | 0.679403 | false | 3.204619 | false | false | false |
mileistone/test | vedanet/data/_dataset_brambox.py | 1 | 3273 | #
# Lightnet dataset that works with brambox annotations
# Copyright EAVISE
#
import os
import copy
import logging as log
from PIL import Image
import random
import brambox.boxes as bbb
from ._dataloading import Dataset
__all__ = ['BramboxDataset']
class BramboxDataset(Dataset):
""" Dataset for any brambox... | mit | 7,297,279,314,681,247,000 | 37.05814 | 163 | 0.624809 | false | 4.030788 | false | false | false |
BV-DR/foamBazar | ideFoam/ofMesher.py | 1 | 1353 | from ideFoam.ofCase import OfCase
class OfMesher( OfCase ):
additionalFiles = [
"blockMeshDict",
"snappyHexMeshDict",
"extrudeMeshDict",
"surfaceFeatureExtractDict"
]
handledFiles = OfCase... | gpl-3.0 | 7,719,516,701,069,975,000 | 28.413043 | 66 | 0.521064 | false | 4.832143 | false | false | false |
bithinalangot/ecidadania-dev | src/apps/thirdparty/userprofile/forms.py | 1 | 5278 | from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth.models import User
from apps.thirdparty.userpro... | gpl-3.0 | -206,664,159,644,386,240 | 35.4 | 137 | 0.654225 | false | 4.480475 | false | false | false |
stevenjoelbrey/PMFutures | Python/GFED4s_to_nc.py | 1 | 16988 | #!/usr/bin/env python2
###############################################################################
# ------------------------- Description ---------------------------------------
###############################################################################
# The purpose of this script is read the hdf5 GFED4s dat... | mit | -1,524,544,030,473,700,000 | 33.528455 | 89 | 0.633035 | false | 3.24013 | false | false | false |
t-neumann/slamdunk | slamdunk/alleyoop.py | 1 | 34869 | #!/usr/bin/env python
#ALLEYOOP:
#Additional sLamdunk heLpEr tools for anY diagnOstics Or Plots
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder.
#
# This file is part of Slamdunk.
#
# Slamdunk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | agpl-3.0 | -2,971,469,504,791,087,000 | 56.825871 | 306 | 0.677995 | false | 3.707496 | false | false | false |
peterhogan/python | kafka/archived_scripts/get_rss_feeds.py | 1 | 2580 | #######################################
############### Imports ###############
#######################################
import urllib.request
import shutil
import re
import os, errno
############################################
############### Inital setup ###############
############################################... | mit | -526,627,491,305,510,660 | 33.4 | 99 | 0.53876 | false | 3.975347 | false | false | false |
zynthian/zynthian-sys | sbin/zynthian-pwm-fan.py | 1 | 2147 | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
import os
import signal
#Configuration Items
fan_pin = 13
fan_freq = 100
fan_startup = 30.
fan_min = 30.
poll_sec = 1
#Linear interpolation from 2 points upper_temp, lower_temp, upper_speed, lower_speed
temp_1 = 70.
temp_2 = 30.
speed_1 = 100.
speed_2 = 1.
smoot... | gpl-3.0 | -6,960,056,384,332,398,000 | 26.883117 | 115 | 0.637634 | false | 2.893531 | false | false | false |
AlexSafatli/DataMiningImplementations | id3/id3.py | 1 | 10411 | #!/bin/python
# id3.py
# -------------------------
# Winter 2013; Alex Safatli
# -------------------------
# A program that carries out
# the ID3 algorithm on a
# given data file.
#
# Usage: python id3.py
# Imports
import os, sys
from math import log
# Constants
RULES_FILE = 'RULES'
# ID3 Class(es)
class id3:
... | gpl-2.0 | 3,804,403,123,362,943,500 | 30.077612 | 80 | 0.51388 | false | 4.039969 | false | false | false |
oerb/immotask | contacts/models.py | 1 | 2508 | # encoding: utf-8
from django.db import models
from django.contrib.auth.models import User, Group
class Address(models.Model):
"""
Address Model
contains just searchname and E-Mail. Rest is configurable by
Contactdata
"""
adr_searchname = models.CharField(verbose_name=u'Name', max_length=255)... | gpl-3.0 | -5,145,461,542,175,490,000 | 28.174419 | 117 | 0.668262 | false | 3.593123 | false | false | false |
baffolobill/mb_test_1 | src/mbtest1/erp_client/forms/servers.py | 1 | 6927 | # coding: utf-8
from django import forms
from django.utils.translation import ugettext as _
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from erp_test.models import S... | mit | 8,801,305,419,401,469,000 | 33.462687 | 108 | 0.492998 | false | 4.381404 | false | false | false |
emsrc/daeso-framework | lib/daeso/string/similar.py | 1 | 6919 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2013 by Erwin Marsi and TST-Centrale
#
# This file is part of the DAESO Framework.
#
# The DAESO Framework 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 ... | gpl-3.0 | -5,080,684,089,036,617,000 | 27.130081 | 85 | 0.580142 | false | 4.155556 | false | false | false |
COLORFULBOARD/revision | revision/history.py | 1 | 3139 | # -*- coding: utf-8 -*-
"""
revision.history
~~~~~~~~~~~~~~~~
:copyright: (c) 2018 by SENSY Inc.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import
import os
from revision.data import Revision
from revision.exceptions import InvalidArgType
__all__ = (
"Histo... | mit | -7,796,899,242,910,527,000 | 23.716535 | 69 | 0.538069 | false | 4.465149 | false | false | false |
alihanniba/tornado-awesome | django-site/pysite/urls.py | 1 | 1400 | """pysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | apache-2.0 | 1,952,563,015,229,749,500 | 30.840909 | 82 | 0.703571 | false | 3.655352 | false | false | false |
chfoo/notaol | notaol/extra/process_tokens.py | 1 | 7640 | '''Process the token HTML and TXT files.'''
import re
import string
import lxml.html
import collections
import pprint
import textwrap
HTML_DB_FILENAMES = tuple(
['token_!.html', 'token_0-9.html'] +
['token_{}.html'.format(char) for char in string.ascii_lowercase]
)
TokenMetadata = collections.namedtupl... | gpl-3.0 | 7,655,825,246,073,413,000 | 33.727273 | 105 | 0.54123 | false | 4.085561 | false | false | false |
JohnsonZhao/bdyun | src/config/config.py | 1 | 3126 | # when the system starts, load all the configuration
import xml.etree.ElementTree as ET
"""
@author zhb
this class contains the information which is saved in the
configuration file.
key: developer's application key
uname: store the account user name
upass: store the account user passwd
access_token: authority ... | apache-2.0 | -6,699,435,496,020,833,000 | 26.182609 | 59 | 0.6865 | false | 3.15121 | true | false | false |
craig8196/classifier | train_classifier.py | 1 | 1919 | # train_classifier.py
import os
import re
import codecs
from classifier import Classifier
TRAINING_FILE = "assignment2/pnp-train.txt"
VALIDATE_FILE = "assignment2/pnp-validate.txt"
TEST_FILE = "assignment2/pnp-test.txt"
TRAINING_FILE_OUTPUT = 'trained.json'
TOKEN_REGEX = r"."
TOKEN_PATTERN = re.compile(TOKEN_REGEX)... | mit | 6,314,568,017,485,389,000 | 29.951613 | 74 | 0.60396 | false | 3.648289 | false | false | false |
larryjgonzalez/getfinancialdata | function.py | 1 | 1281 | from datetime import datetime
from urllib.request import urlopen
from subprocess import check_output
######################
# DOWNLOAD FUNCTIONS #
######################
#url -> html
def get_html(url):
html = ''
try:
html = check_output(['wget', '-qO-', url]).decode()
except Exception as e:
print(e)
r... | mit | 9,025,492,871,178,633,000 | 21.473684 | 64 | 0.57377 | false | 3.101695 | false | false | false |
perfectsearch/sandman | code/buildscripts/builders/maven.py | 1 | 3285 | #!/usr/bin/env python
#
# $Id: mask_ip.py 9318 2011-06-10 02:37:10Z nathan_george $
#
# Proprietary and confidential.
# Copyright $Date:: 2011#$ Perfect Search Corporation.
# All rights reserved.
import os
import shutil
import sandbox
from common import *
_UBER_BUILD_SCRIPT = 'pom.xml'
def _remove_with_chmod(path):
... | mit | 1,295,794,023,486,500,600 | 37.197674 | 160 | 0.588737 | false | 3.528464 | true | false | false |
Cinntax/home-assistant | homeassistant/components/persistent_notification/__init__.py | 1 | 7118 | """Support for displaying persistent notifications."""
from collections import OrderedDict
import logging
from typing import Any, Mapping, MutableMapping, Optional
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.core import HomeAssistant, callback
from homeassistant.exce... | apache-2.0 | -3,741,012,386,444,532,000 | 29.681034 | 86 | 0.639927 | false | 4.026018 | false | false | false |
quidtech/quidte.ch | data/migrations/0001_initial.py | 1 | 4330 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Game',
fields=[
('id', models.AutoField(verbose... | mit | -3,815,711,292,877,707,000 | 33.64 | 114 | 0.498614 | false | 4.601488 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #1 - Equation Group Cyber Weapons Auction - Invitation/EQGRP-Free-File/Firewall/BUZZDIRECTION/BUZZ_1210/LP/Scripts/Lp_CursesDriver.py | 1 | 28442 | #!/usr/bin/env python
import curses , traceback , os
class textBox:
def __init__(self,text,row,col,maxC):
self.dispText=text
self.dispRow=row
self.dispCol=col
self.maxChars=maxC
self.strPos=0
class CursesDriver:
def __init__(self,variables,numVars,sT):
try: ... | unlicense | 6,851,166,835,889,488,000 | 45.172078 | 129 | 0.460376 | false | 4.229923 | false | false | false |
trendelkampschroer/PyEMMA | pyemma/datasets/api.py | 1 | 1042 | from __future__ import absolute_import
__author__ = 'noe'
def load_2well_discrete():
from .double_well_discrete import DoubleWell_Discrete_Data
return DoubleWell_Discrete_Data()
def get_bpti_test_data():
""" Returns a dictionary containing C-alpha coordinates of a truncated
BTBI trajectory.
Notes... | bsd-2-clause | -5,876,872,601,903,437,000 | 29.647059 | 89 | 0.653551 | false | 3.496644 | false | false | false |
UweSonderhoff/stage5-api-project | ascii-chan-ipnd-complete/main.py | 1 | 2547 | import os
import re
import sys
import urllib2
from xml.dom import minidom
from string import letters
import webapp2
import jinja2
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir),
auto... | mit | 1,670,752,035,309,368,600 | 25.53125 | 92 | 0.682764 | false | 2.920872 | false | false | false |
arthursoprano/vpipe-flow | source/python/vpipe_flow_calc/solver/abstract_solver.py | 1 | 4458 | import numpy as np
from vpipe_flow_calc.interpolation import face_interp
def calculate_wall_friction_factor_colebrook_white_explicit(
Re,
D,
ε
):
# We are doing a linear interpolation on the relative roughness to calculate the Reynolds number of the transition
# between laminar and turbulent ... | mit | -1,493,026,861,265,867,800 | 31.622222 | 122 | 0.605132 | false | 2.812261 | false | false | false |
bjornwallner/proq2-server | apps/modeller9v8/modlib/modeller/__init__.py | 1 | 3802 | """MODELLER, a package for protein structure modeling
See U{http://salilab.org/modeller/} for further details.
@author: Andrej Sali
@copyright: 1989-2010 Andrej Sali
"""
__all__ = ['energy_data', 'io_data', 'environ', 'group_restraints',
'ModellerError', 'FileFormatError', 'StatisticsError',
... | gpl-3.0 | 1,123,469,508,338,605,600 | 30.163934 | 79 | 0.652025 | false | 3.580038 | true | false | false |
s0lst1c3/eaphammer | core/hostapd_mac_acl.py | 1 | 1668 | import os
import shutil
import sys
class HostapdMACACL(object):
def __init__(self,
settings,
options):
self.debug = options['debug']
assert not (options['mac_whitelist'] is not None and options['mac_blacklist'] is not None)
if options['mac_whitelist'] is ... | gpl-3.0 | 8,498,091,442,486,171,000 | 26.344262 | 98 | 0.570743 | false | 4.128713 | false | false | false |
state-hiu/cybergis-scripts | lib/cybergis/gs/_geoserver_publish_layers.py | 1 | 3368 | from base64 import b64encode
from optparse import make_option
import json
import urllib
import urllib2
import argparse
import time
import os
import subprocess
def make_request(url, params, auth=None, data=None, contentType=None):
"""
Prepares a request from a url, params, and optionally authentication.
"""... | mit | 1,252,792,588,231,008,800 | 28.54386 | 115 | 0.603622 | false | 4.004756 | false | false | false |
GoogleCloudPlatform/datacatalog-connectors-bi | google-datacatalog-qlik-connector/tests/google/datacatalog_connectors/qlik/qlik2datacatalog_cli_test.py | 1 | 3241 | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# 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 ag... | apache-2.0 | 9,071,826,225,352,331,000 | 41.090909 | 79 | 0.656279 | false | 3.530501 | true | false | false |
jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_optimize02.py | 1 | 1132 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause | 2,236,120,607,954,541,300 | 25.325581 | 93 | 0.585689 | false | 3.85034 | true | false | false |
olix0r/pub | lib/client/list_entities.py | 1 | 1526 |
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.plugin import IPlugin
from twisted.python.usage import UsageError
from zope.interface import implements
from pub.client import cli
from pub.iface import EntityNotFound
class Command(cli.Command):
def _getMaxLen(self, fields):
... | bsd-3-clause | -7,765,145,465,670,782,000 | 20.8 | 68 | 0.561599 | false | 3.943152 | false | false | false |
zarrabeitia/adolpy | adolpy/__init__.py | 1 | 1378 | # Adolpy - Algorithmic Differentiation Through Operator Overloading on
# Python using the Forward Method.
#
# Copyright (C) 2008 Luis Zarrabeitia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | gpl-3.0 | -2,501,550,923,113,978,000 | 39.529412 | 76 | 0.682148 | false | 3.524297 | false | false | false |
Tancata/phylo | ancestral/2comp_binary_reconstruct.py | 1 | 1294 | var.nexus_allowAllDigitNames = True # put it somewhere else
var.doCheckForDuplicateSequences = False
t = var.trees[0]
a = var.alignments[0]
t.data = Data()
t.model.dump()
print('\nAfter optimizing, the composition of the model for the non-root nodes is:')
print(t.model.parts[0].comps[0].val)
print('...and the com... | mit | 3,181,870,988,539,689,000 | 32.179487 | 104 | 0.669243 | false | 2.684647 | false | false | false |
aeklant/scipy | scipy/integrate/_quad_vec.py | 3 | 20184 | import sys
import copy
import heapq
import collections
import functools
import numpy as np
from scipy._lib._util import MapWrapper
class LRUDict(collections.OrderedDict):
def __init__(self, max_size):
self.__max_size = max_size
def __setitem__(self, key, value):
existing_key = (key in self)... | bsd-3-clause | 9,022,230,861,534,303,000 | 31.398074 | 102 | 0.584968 | false | 3.2975 | false | false | false |
Hwesta/advent-of-code | aoc2017/day22.py | 1 | 8626 | #!/usr/bin/env python
"""
--- Day 22: Sporifica Virus ---
Diagnostics indicate that the local grid computing cluster has been contaminated with the Sporifica Virus. The grid computing cluster is a seemingly-infinite two-dimensional grid of compute nodes. Each node is either clean or infected by the virus.
To prevent ... | mit | -171,238,847,074,224,860 | 31.674242 | 346 | 0.550661 | false | 3.004528 | false | false | false |
tomik/akimot | other/tagui/main.py | 1 | 6586 | #!/usr/bin/python
import sys
from os.path import isfile
from PyQt4 import QtGui
from PyQt4 import QtCore
from main_window import Ui_MainWindow
sys.path.append('..')
from aei.aei import StdioEngine, EngineController
from aei import board
ERROR = -1
AKIMOT_CMD = 'bots/akimot -c bots/default.cfg -l'
from board_wi... | gpl-3.0 | -4,481,656,595,069,440,000 | 30.361905 | 111 | 0.567871 | false | 3.70208 | false | false | false |
cathywu/flow | flow/benchmarks/figureeight1.py | 1 | 2710 | """Benchmark for figureeight1.
Trains a fraction of vehicles in a ring road structure to regulate the flow of
vehicles through an intersection. In this example, every other vehicle in the
network is an autonomous vehicle.
- **Action Dimension**: (7, )
- **Observation Dimension**: (28, )
- **Horizon**: 1500 steps
"""
... | mit | 385,664,434,824,249,200 | 29.795455 | 79 | 0.667897 | false | 3.753463 | false | false | false |
chengdh/openerp-ktv | openerp/addons/ktv_sale/fee_type.py | 1 | 2880 | # -*- coding: utf-8 -*-
from osv import fields, osv
import ktv_helper
import decimal_precision as dp
class fee_type(osv.osv):
#计费方式定义
#只收包厢费
FEE_TYPE_ONLY_ROOM_FEE = "only_room_fee"
#只收钟点费
FEE_TYPE_ONLY_HOURLY_FEE = "only_hourly_fee"
#包厢费+钟点费
FEE_TYPE_ROOM_FEE_PLUS_HOURLY_FEE = "room_fee_pl... | agpl-3.0 | -586,353,402,938,598,900 | 35.676923 | 138 | 0.611158 | false | 2.008425 | false | false | false |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/en_de/ddlspot.py | 1 | 5142 | # -*- 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-2.0 | -5,529,226,025,553,757,000 | 35.992806 | 161 | 0.497277 | false | 4.246078 | false | false | false |
aldebaran/qibuild | python/qisrc/test/test_git_config.py | 1 | 3969 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Git Config """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ impo... | bsd-3-clause | -3,323,717,777,454,986,000 | 29.068182 | 84 | 0.626354 | false | 3.472441 | true | false | false |
santicalvo/extract_from_doc | src/guion_parser/guion_videos_chapisteria.py | 1 | 2178 | # -*- coding:utf-8 -*-
import re
import guion_videos
from curso_toxml.xmlcreator import CursoSeatXmlMinidom
#CursoSeatXmlMinidom =
#TODO: ARREGLAR MÉTODOS!!!!!
ParserError = guion_videos.ParserError
class LectorGuionChapisteria(guion_videos.LectorGuionVideos):
def __init__(self, path, nombre_xml="curso"):
... | gpl-3.0 | -3,251,148,648,748,494,300 | 28.432432 | 78 | 0.553055 | false | 3.318598 | false | false | false |
lc-soft/GitDigger | app/workers/user_worker.py | 1 | 1832 | from app import worker, db, app
from app.models.task import Task
from app.models.user import User
from celery.utils.log import get_task_logger
from datetime import datetime, timedelta
import requests
logger = get_task_logger(__name__)
def get_profile(username):
url = 'https://api.github.com/users/%s' % username
... | agpl-3.0 | -1,744,602,078,244,693,500 | 31.714286 | 91 | 0.608624 | false | 3.746421 | false | false | false |
Pylons/kai | kai/controllers/error.py | 1 | 1709 | import cgi
import os.path
from paste.urlparser import StaticURLParser
from pylons import tmpl_context as c, request
from pylons.controllers.util import abort, forward
from pylons.middleware import error_document_template, media_path
from webhelpers.html.builder import literal
from kai.lib.base import BaseController, ... | bsd-3-clause | -5,006,110,415,375,571,000 | 36.152174 | 84 | 0.67993 | false | 4.011737 | false | false | false |
probcomp/bayeslite | tests/test_bqlmath.py | 1 | 2540 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | apache-2.0 | 42,451,257,085,848,300 | 31.151899 | 76 | 0.68189 | false | 3.46049 | false | false | false |
bdfoster/blumate | blumate/components/frontend/__init__.py | 1 | 3083 | """Handle the frontend for Home Assistant."""
import os
from . import version, mdi_version
from blumate.components import api
from blumate.components.http import BluMateView
DOMAIN = 'frontend'
DEPENDENCIES = ['api']
def setup(hass, config):
"""Setup serving the frontend."""
hass.wsgi.register_view(IndexVie... | mit | 1,909,359,192,019,925,500 | 29.524752 | 77 | 0.596173 | false | 3.714458 | false | false | false |
aricaldeira/PySPED | pysped/cte/processador_cte.py | 1 | 5554 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | lgpl-2.1 | 2,337,262,963,122,575,000 | 35.642384 | 107 | 0.662932 | false | 2.946219 | false | false | false |
StefanRijnhart/odoo | addons/account/account_invoice.py | 1 | 78888 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | 3,686,992,551,924,090,400 | 46.956231 | 303 | 0.570733 | false | 4.035605 | false | false | false |
jeanmask/pagseguro-sdk | pagseguro/client.py | 1 | 3523 | # encoding: utf-8
from __future__ import unicode_literals
from functools import wraps
import requests
import xmltodict
class PagseguroApiError(Exception):
pass
class PagseguroClient(object):
HTTP_METHODS = ['get', 'post']
API = 'https://ws.pagseguro.uol.com.br'
API_SANDBOX = 'https://ws.sandbox.p... | mit | -6,828,985,672,690,033,000 | 31.009091 | 79 | 0.582505 | false | 3.890608 | false | false | false |
yeyanchao/calibre | src/calibre/gui2/add_wizard/welcome_ui.py | 1 | 4447 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/add_wizard/welcome.ui'
#
# Created: Thu Oct 25 16:54:55 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
t... | gpl-3.0 | -4,309,010,294,527,442,000 | 56.753247 | 272 | 0.699798 | false | 3.660082 | false | false | false |
mmessmore/papply | papply.py | 1 | 11442 | #!/usr/bin/env python
"""
Sad attempt at a drop-in replacement for KSB's excellent xapply
"""
import os
import subprocess
import signal
import sys
import argparse
import time
VERSION = 0.1
class Dicer(object):
"""
Emulate KSB's dicer
Working on de-uglying it
"""
def __init__(self, fmat="", escape... | bsd-3-clause | -2,865,186,731,869,547,500 | 27.821159 | 80 | 0.478937 | false | 4.133671 | false | false | false |
ingadhoc/sale | sale_order_type_automation/models/sale_order_type.py | 1 | 5725 | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api, _
from odoo.exceptions import Valid... | agpl-3.0 | -1,047,411,615,961,810,300 | 39.316901 | 79 | 0.590218 | false | 4.231338 | false | false | false |
openstack/python-zaqarclient | zaqarclient/queues/v1/iterator.py | 1 | 3669 | # Copyright (c) 2014 Rackspace
#
# 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,... | apache-2.0 | 6,634,069,264,903,521,000 | 32.66055 | 76 | 0.619787 | false | 4.540842 | false | false | false |
Statoil/sunbeam | python/sunbeam/sunbeam.py | 1 | 1299 | from __future__ import absolute_import
class _delegate(object):
def __init__(self, name, attr):
self._name = name
self._attr = attr
def __get__(self, instance, _):
if instance is None: return self
return getattr(self.delegate(instance), self._attr)
def __set__(self, insta... | gpl-3.0 | -5,693,439,699,565,493,000 | 28.522727 | 79 | 0.546574 | false | 3.889222 | false | false | false |
soutys/freshmail-python | doc/source/conf.py | 1 | 9310 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# FreshMail API documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 13 17:01:53 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... | mit | -8,957,438,854,137,246,000 | 30.993127 | 79 | 0.706552 | false | 3.679842 | true | false | false |
heineman/algorithms-nutshell-2ed | PythonCode/adk/hashtable.py | 1 | 2881 | """
Hashtable Implementations with open addressing and linear probing.
For set semantics, you have to ensure add checks if value has already been inserted.
"""
def defaultHash(value, size):
return hash(value) % size
class Hashtable:
def __init__(self, b=1009, hashFunction=None, probeFun... | mit | -5,432,246,247,250,312,000 | 30.393258 | 108 | 0.505727 | false | 4.452859 | false | false | false |
MithileshCParab/Algorithms | Python/Data Structure/LinkedLists /DoublyLinkedList.py | 1 | 2768 | class _DoublyLinkedListBase:
""" A base class providing a doubly linked list representation """
#--------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------
class _Node:
""" Lightweight, non pu... | apache-2.0 | -1,811,315,320,674,960,400 | 45.133333 | 91 | 0.387283 | false | 5.154562 | false | false | false |
sandow-digital/django-mptt-sandow | tests/myapp/models.py | 1 | 2252 | from django.db import models
from mptt2.models import MPTTModel
from mptt2.managers import TreeManager
class CustomTreeManager(TreeManager):
pass
class Category(MPTTModel):
name = models.CharField(max_length=50)
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
def... | mit | 4,310,724,202,037,889,500 | 24.590909 | 86 | 0.670959 | false | 3.673736 | false | false | false |
carragom/modoboa | modoboa/lib/validators.py | 1 | 1885 | """Field validators."""
import re
from django.core.exceptions import ValidationError
from django.core.validators import EmailValidator, URLValidator
from django.utils.translation import ugettext_lazy
class HostnameValidator(object):
"""Validator for fqdn."""
message = ugettext_lazy("Enter a valid domain n... | isc | -7,883,282,863,950,225,000 | 28.920635 | 93 | 0.619629 | false | 3.638996 | false | false | false |
ghorn/debian-casadi | docs/tutorials/python/src/symbolics/sx.py | 1 | 3256 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | lgpl-3.0 | -3,188,649,703,243,112,000 | 32.22449 | 112 | 0.671683 | false | 3.45281 | false | false | false |
Haabb/pwnfork | pwn/hashes.py | 1 | 1053 | import hashlib
for _algo in hashlib.algorithms:
def _closure():
hash = hashlib.__dict__[_algo]
def file(p):
h = hash()
fd = open(p)
while True:
s = fd.read(4096)
if not s: break
h.update(s)
fd.close()
... | mit | -7,554,251,904,856,691,000 | 35.310345 | 87 | 0.501425 | false | 3.581633 | false | false | false |
mozilla/navras | navras/conversions/tests/__init__.py | 1 | 1057 | import factory
from factory import fuzzy
from navras.base.models import Source, Area, Product, Point
class SourceFactory(factory.django.DjangoModelFactory):
title = fuzzy.FuzzyText()
url = fuzzy.FuzzyText()
class Meta:
model = Source
class AreaFactory(factory.django.DjangoModelFactory):
t... | mpl-2.0 | 1,952,300,631,811,841,500 | 21.041667 | 59 | 0.672658 | false | 4.145098 | false | false | false |
araichev/gtfstk | gtfstk/shapes.py | 1 | 8064 | """
Functions about shapes.
"""
from typing import Optional, List, Dict, TYPE_CHECKING
import pandas as pd
from pandas import DataFrame
import numpy as np
import utm
import shapely.geometry as sg
from . import constants as cs
from . import helpers as hp
# Help mypy but avoid circular imports
if TYPE_CHECKING:
fr... | mit | 2,220,037,798,470,830,000 | 27.4947 | 77 | 0.581597 | false | 3.70418 | false | false | false |
efiop/dvc | dvc/stage/loader.py | 1 | 6852 | import logging
from collections.abc import Mapping
from copy import deepcopy
from itertools import chain
from funcy import cached_property, get_in, lcat, once, project
from dvc import dependency, output
from dvc.hash_info import HashInfo
from dvc.parsing import FOREACH_KWD, JOIN, DataResolver, EntryNotFound
from dvc.... | apache-2.0 | 6,170,062,880,210,804,000 | 32.753695 | 79 | 0.597344 | false | 3.764835 | false | false | false |
ethanfrey/aiojson | aiojson/backends/tests/test_parse.py | 1 | 1183 | # -*- coding:utf-8 -*-
from aiojson.backends.python import Buffer, get_tokens
from .data import RAW_DATA, RAW_TOKENS
def test_get_tokens_all():
buf = Buffer(RAW_DATA)
parser = get_tokens(buf, more_data=False)
tokens = list(parser)
assert len(tokens) == len(RAW_TOKENS)
assert tokens == RAW_TOKENS
... | bsd-3-clause | 7,276,078,385,343,544,000 | 26.511628 | 65 | 0.663567 | false | 3.104987 | false | false | false |
JulyKikuAkita/PythonPrac | cs15211/MovingAverageFromDataStream.py | 1 | 2640 | __source__ = 'https://leetcode.com/problems/moving-average-from-data-stream/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/moving-average-from-data-stream.py
# Time: O(1)
# Space: O(w)
#
# Description: Leetcode # 346. Moving Average from Data Stream
#
# Given a stream of integers and a window size, calcul... | apache-2.0 | -3,252,882,414,292,869,600 | 22.157895 | 92 | 0.577273 | false | 3.375959 | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.