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
fiam/blangoblog
blango/forms.py
1
1444
from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.contrib.auth.models import User from django import forms from blango.models import Comment from blango.jsforms import JSModelForm # This violates the DRY principe, but it's the only # way I found for editing ...
bsd-3-clause
-577,320,069,726,871,300
31.088889
136
0.668975
false
4.03352
false
false
false
stryder199/RyarkAssignments
Assignment2/web2py/applications/cqg/question/hamming.py
1
4192
import os import file_util import html_util import hamming_util # table properties BORDER = 1 MIN_CELL_WIDTH = 36 MIN_CELL_HEIGHT = 16 # superclass for our two question types class hamming: def __init__(self,question_library_path,question_path): self.question_library_path = question_library_path self.question_pa...
mit
5,480,421,653,543,299,000
28.111111
66
0.671756
false
2.952113
true
false
false
gwct/core
core2/isofilter.py
1
9979
#!/usr/bin/python ######################################################################################## #Script to filter out isoforms from peptide files in FASTA ENSEMBL or NCBI format. This #script can also add an easier to read species label to each sequence within the file. # #Sample ENSEMBL usage: python isofor...
gpl-3.0
8,496,657,265,609,689,000
32.712838
573
0.605772
false
2.78044
false
false
false
dodger487/MIST
data/makeSnippets.py
1
5346
#!/usr/bin/env python # Chris Riederer # Google, Inc # 2014-07-25 import test_detect import numpy as np import os import json import random import sys def makeNegativeSnippets(runData, number, snipPrefixTime=100000000, snipPostfixTime=500000000): return makeSnippets(runData, True, numberNegative=number, snipPrefi...
apache-2.0
-2,253,044,168,712,271,600
39.195489
123
0.721848
false
3.568758
true
false
false
rhildred/rhildred.github.io
tag_generator.py
1
1427
#!/usr/bin/env python ''' tag_generator.py Copyright 2017 Long Qian Contact: lqian8@jhu.edu This script creates tags for your Jekyll blog hosted by Github page. No plugins required. ''' import glob import os import re post_dir = '_posts/' tag_dir = 'tag/' filenames = glob.glob(post_dir + '*') total_tags = [] for...
mit
1,607,549,321,355,180,300
25.924528
274
0.573931
false
3.272936
false
false
false
Samfox2/motioneye
motioneye/v4l2ctl.py
1
11312
# Copyright (c) 2013 Calin Crisan # This file is part of motionEye. # # motionEye 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. # #...
gpl-3.0
-9,183,610,515,678,452,000
26.062201
129
0.573285
false
3.825499
false
false
false
Atush/py_learning
generator/contact.py
1
1799
from model.contact import Contact import random import string import os.path import jsonpickle import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", 'file']) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "data/contacts.json" for o, ...
apache-2.0
-7,085,304,235,291,700,000
39.909091
466
0.679266
false
3.343866
false
false
false
BBN-Q/Auspex
src/auspex/instruments/hall_probe.py
1
1712
# Copyright 2016 Raytheon BBN Technologies # # 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 import numpy as np class HallProbe(object): ...
apache-2.0
-244,677,329,928,552,860
37.909091
97
0.620327
false
4.07619
false
false
false
avastjohn/maventy_new
registration/urls.py
1
3567
""" URLConf for Django user registration and authentication. If the default behavior of the registration views is acceptable to you, simply use a line like this in your root URLConf to set up the default URLs for registration:: (r'^accounts/', include('registration.urls')), This will also automatically set up th...
bsd-3-clause
-5,240,740,255,448,144,000
45.324675
99
0.540791
false
5.132374
false
false
false
chenders/deadonfilm
app/deadonfilm.py
1
3643
import imdb import json import os import logging from logging.handlers import RotatingFileHandler from urllib.parse import urlparse from flask import ( Flask, redirect, make_response, request, send_from_directory, render_template ) import psycopg2.extras url = urlparse(os.environ.get('IMDB_DB...
mit
-4,903,017,006,393,662,000
27.912698
92
0.59429
false
3.643
false
false
false
admk/soap
soap/parser/program.py
1
1972
import re import sh from soap.datatype import type_cast from soap.expression import is_variable from soap.program import ProgramFlow, PragmaInputFlow, PragmaOutputFlow from soap.parser.common import _lift_child, _lift_dontcare, CommonVisitor from soap.parser.expression import DeclarationVisitor, ExpressionVisitor fro...
mit
7,840,282,045,129,042,000
32.423729
73
0.698783
false
3.734848
false
false
false
beeftornado/sentry
src/sentry/templatetags/sentry_avatars.py
2
2789
from __future__ import absolute_import from django import template from django.conf import settings from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from six.moves.urllib.parse import urlencode from sentry.models import User, UserAvatar from sentry.utils.avatar import get_ema...
bsd-3-clause
8,308,949,113,032,601,000
31.057471
85
0.66583
false
3.499373
false
false
false
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/system/filesystem.py
1
11234
# Copyright (C) 2010 Google Inc. 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 list of conditions and the ...
gpl-2.0
-5,104,576,357,975,560,000
35.23871
140
0.619904
false
4.324095
false
false
false
ekadhanda/bin
python/coda-scrip.py
1
9971
#! /usr/bin/env python # Written by Vasaant S/O Krishnan Friday, 19 May 2017 # Run without arguments for instructions. import sys usrFile = sys.argv[1:] if len(usrFile) == 0: print "" print "# Script to read in file of the CODA format and perform some basic" print "# statistical computations. An index.tx...
mit
5,365,606,739,219,322,000
40.032922
110
0.446094
false
4.400265
false
false
false
ESOedX/edx-platform
common/djangoapps/third_party_auth/management/commands/remove_social_auth_users.py
1
2126
""" Management command to remove social auth users. Intended for use in masters integration sandboxes to allow partners reset users and enrollment data. """ from __future__ import absolute_import import logging from django.conf import settings from django.contrib.auth.models import User from django.core.management.b...
agpl-3.0
-630,919,036,611,812,900
32.21875
96
0.663688
false
4.392562
false
false
false
akretion/odoo
addons/mrp/models/mrp_routing.py
7
5147
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class MrpRouting(models.Model): """ Specifies routings of work centers """ _name = 'mrp.routing' _description = 'Routings' name = fields.Char('Routing', required...
agpl-3.0
1,015,476,141,267,269,400
49.960396
168
0.63979
false
3.929008
false
false
false
Xilinx/hopper
hopper/utils/git/watcher.py
1
5949
# Copyright (c) 2015 Xilinx Inc. # # 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, distrib...
mit
497,451,319,322,704,600
28.161765
102
0.675408
false
3.245499
false
false
false
SLongofono/448_Project4
testMath.py
1
5536
import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import Variance import math def testVariance(): print ("1. Testing Variance") weighting = [2,2,2,2,2,2,2,2,2,2] test1 = [['artist1', 'ar...
mit
5,970,112,297,490,376,000
28.763441
112
0.621929
false
2.390328
true
false
false
ww-Kenya/rainbow6
motion_detection.py
1
5448
import argparse import datetime import imutils import time import cv2 import RPi.GPIO as GPIO import os import smtplib from servo import Servo RESIZE_WIDTH = 500 RESIZE_HEIGHT = 375 THRESHOLD = 30 MAXPIXELVAL = 255 MORNINGTIME = 7 NIGHTTIME = 19 MIN_RECTANGLE = 2000 MAX_RECTANGLE = 90000 HARDDRIVE_LOCATION = "/media/p...
mit
8,836,440,019,275,679,000
27.978723
193
0.581131
false
3.250597
false
false
false
markgw/jazzparser
src/jazzparser/formalisms/music_halfspan/songtools.py
1
20939
"""Interactive shell tools for the Halfspan formalism. These tools concern song recognition and allow utilities for recognising songs to be called from the shell. """ """ ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granrot...
gpl-3.0
-6,989,043,982,802,696,000
38.433145
93
0.570562
false
4.240381
false
false
false
tobiz/OGN-Flight-Logger_V2
settings.py
1
9941
#------------------------------------- # OGN-Flight-Logger Settings #------------------------------------- # Python APRS/OGN program to log flight times, durations, maximum heights achieved and tracks # # This python program creates an SQlite db of flights from a given location and aircraft list # (the later two para...
gpl-3.0
1,513,637,528,252,753,400
62.318471
192
0.574489
false
3.557981
false
false
false
StephanII/accelerator-toolkit
magnets.py
1
3901
from base import Device import math as math class SectorBendingMagnet(Device): def __init__(self, nomenclature="", width=0., height=0., length=0., angle=0.): Device.__init__(self, nomenclature, width, height, length) self.angle = angle def __repr__(self): r = str(self) + "(" ...
mit
-7,058,308,463,578,992,000
28.55303
91
0.471161
false
3.380416
false
false
false
anortef/calico
calico/felix/test/test_frules.py
1
11864
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # 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 applicab...
apache-2.0
8,944,739,970,673,061,000
42.944444
124
0.517701
false
3.757998
true
false
false
seanpue/al340
lessons/textanalysis/Untitled0.py
1
1100
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import nltk %matplotlib inline # <codecell> import os from nltk.corpus.reader.plaintext import PlaintextCorpusReader corpusdir = 'data/texts/' # Directory of corpus. corpus0 = PlaintextCorpusReader(corpusdir, '.*') corpus = nltk.Text(corpus0.words(...
mit
-1,315,354,380,263,225,000
11.454545
62
0.686131
false
2.531178
false
false
false
karrtikr/ete
ete3/tools/phylobuild_lib/interface.py
1
16365
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the...
gpl-3.0
3,725,017,766,903,037,000
29.935728
157
0.524962
false
3.478954
false
false
false
phenoxim/nova
nova/api/openstack/placement/handler.py
1
9631
# 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 # d...
apache-2.0
7,792,931,749,543,994,000
40.15812
78
0.668986
false
4.246473
false
false
false
fallen/artiq
artiq/language/scan.py
1
4762
""" Implementation and management of scan objects. A scan object (e.g. :class:`artiq.language.scan.LinearScan`) represents a one-dimensional sweep of a numerical range. Multi-dimensional scans are constructed by combining several scan objects. Iterate on a scan object to scan it, e.g. :: for variable in self.sca...
gpl-3.0
1,219,659,166,398,376,400
28.395062
81
0.625367
false
3.849636
false
false
false
restful-open-annotation/oa-adapter
formats/json_format.py
1
2113
#!/usr/bin/env python """JSON content-type support for Open Annotation.""" __author__ = 'Sampo Pyysalo' __license__ = 'MIT' import json # Default values for rendering options PRETTYPRINT_DEFAULT = True KEEPCONTEXT_DEFAULT = False # Short name for this format. format_name = 'json' # The MIME types associated with ...
mit
113,083,809,037,946,270
27.173333
71
0.658779
false
3.855839
false
false
false
seprich/py-bson-rpc
bsonrpc/concurrent.py
1
2990
# -*- coding: utf-8 -*- ''' This module provides a collection of concurrency related object generators. These generators will create either native threading based or greenlet based objects depending on which threading_model is selected. ''' from bsonrpc.options import ThreadingModel __license__ = 'http://mozilla.org/M...
mpl-2.0
622,220,974,657,172,900
25.696429
66
0.644147
false
3.695921
false
false
false
MaxTakahashi/hammr
hammr/utils/publish_utils.py
1
14372
# Copyright 2007-2015 UShareSoft SAS, 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
8,318,043,477,958,264,000
31.515837
95
0.695519
false
4.09809
false
false
false
zsommers/bdo_chronicle
bdo_tools/nodes/urls.py
1
1286
from django.conf.urls import include, url from django.views.generic import DetailView, ListView, TemplateView from . import models kingdoms_patterns = [ url(r'^(?P<pk>[0-9]+)/$', DetailView.as_view(model=models.Kingdom), name='detail'), url(r'^$', ListView.as_view(model=models.Kingdom), name='list'), ] terri...
mit
9,142,507,298,452,070,000
37.969697
89
0.664075
false
3.083933
false
true
false
travistang/late_fyt
proportional.py
1
1578
import numpy import random import sum_tree class Experience(object): def __init__(self, memory_size, batch_size, alpha): self.tree = sum_tree.SumTree(memory_size) self.memory_size = memory_size self.batch_size = batch_size self.alpha = alpha def add(self, data, priority): ...
mit
7,641,482,424,519,402,000
30.56
95
0.584918
false
3.80241
false
false
false
jorvis/biocode
gff/convert_genbank_to_gff3.py
1
10340
#!/usr/bin/env python3 """ This is a script to convert GenBank flat files to GFF3 format with a specific focus on initially maintaining as much structural annotation as possible, then expanding into functional annotation support. This is not guaranteed to convert all features, but warnings will be printed wherever po...
mit
-5,754,837,827,644,957,000
40.693548
158
0.547872
false
3.726126
false
false
false
jespino/coval
coval/international.py
1
3349
import string import re def isbn(isbn, strict=True): '''Validation of an ISBN (international Standard Book Number)''' if not strict: isbn = isbn.upper() if isbn[0:4] == 'ISBN': isbn = isbn[4:] isbn = isbn.strip().replace("-", "").replace("/", "") if len(isbn) == 10: ...
bsd-3-clause
4,280,021,965,208,855,600
30.299065
86
0.533294
false
3.075298
false
false
false
kennethreitz/pipenv
pipenv/vendor/shellingham/posix/__init__.py
1
2843
import os import re from .._core import SHELL_NAMES, ShellDetectionFailure from . import proc, ps def _get_process_mapping(): """Select a way to obtain process information from the system. * `/proc` is used if supported. * The system `ps` utility is used as a fallback option. """ for impl in (pr...
mit
1,781,591,116,275,053,000
29.569892
79
0.623285
false
3.790667
false
false
false
MC911-MV-1s2016/lya-compiler-python
lyacompiler/lya_debug_source.py
1
11212
lya_source_dcl = """ dcl dcl1 int; dcl dcl2, dcl3, dcl4, dcl5 char; dcl dcl6, dcl7 int, dcl8 bool; dcl dcl9 int = 5; dcl dcl10, dcl11 int = 6; dcl dcl12 int, dcl13, dcl14 int = 10; dcl dcl15 int (2:5); dcl dcl16 char (0:10); dcl dcl17 bool(10:11); dcl dcl18 dcl17 (1:2); dcl d...
bsd-3-clause
-97,219,455,865,958,500
16.382946
101
0.505619
false
2.561572
true
false
false
filippobrizzi/soma
graph_sched/graphCreator.py
1
5395
import sys import pargraph as par import copy import schedule as sched import profiler as pro import time import multiprocessing import itertools import random import threading """ Usage: call with <filename> <pragma_xml_file> <executable_name> <profiling_interations> True/False (for output) """ if __name__ == "__...
gpl-3.0
-2,984,676,818,941,451,300
27.544974
206
0.704912
false
3.044582
false
false
false
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_types07.py
1
2093
############################################################################### # # 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
-7,666,676,698,832,765,000
28.478873
101
0.580029
false
3.730838
true
false
false
DimaWoogy/convex_hull_bst
charts/run.py
1
4349
from matplotlib import pyplot as plt from matplotlib.font_manager import FontProperties from subprocess import call import random import sys import math from scipy.spatial import ConvexHull from shapely import geometry font = FontProperties() font.set_family('Times New Roman') font.set_size(12) def generate_points_o...
mit
-5,708,612,539,971,205,000
29.146853
78
0.597773
false
2.946685
false
false
false
z23han/Wrangling-MongoDB
Lesson_1_Data_Extraction_Fundamentals/parseCSV.py
1
2010
# Your task is to read the input DATAFILE line by line, and for the first 10 lines (not including the header) # split each line on "," and then for each line, create a dictionary # where the key is the header title of the field, and the value is the value of that field in the row. # The function parse_file should retur...
agpl-3.0
410,967,701,874,879,040
37.653846
216
0.602488
false
3.771107
false
false
false
City-of-Helsinki/smbackend
smbackend/urls.py
1
1679
from django.contrib import admin from django.urls import include, re_path from django.utils.translation import gettext_lazy as _ from munigeo.api import all_views as munigeo_views from rest_framework import routers from observations.api import views as observations_views from observations.views import obtain_auth_toke...
agpl-3.0
5,467,478,504,102,424,000
35.5
81
0.699226
false
3.483402
false
false
false
code-for-india/sahana_shelter_worldbank
models/zzz_1st_run.py
1
13208
# -*- coding: utf-8 -*- # 1st-run initialisation # Set settings.base.prepopulate to 0 in Production # (to save 1x DAL hit every page). pop_list = settings.get_base_prepopulate() if pop_list == 0: pop_list = [] else: table = db[auth.settings.table_group_name] # The query used here takes 2/3 the time of .co...
mit
-2,316,289,051,526,580,700
36.310734
103
0.552998
false
4.240128
false
false
false
rackerlabs/deuce
deuce/tests/test_validation.py
1
21839
import hashlib from unittest import TestCase import uuid from falcon import request from stoplight import validate from stoplight.exceptions import ValidationFailed from deuce.transport import validation as v from deuce.transport.wsgi import errors class MockRequest(object): pass class InvalidSeparatorError(E...
apache-2.0
3,394,681,553,709,124,600
32.444104
79
0.589587
false
3.774456
true
false
false
googleapis/python-aiplatform
google/cloud/aiplatform_v1beta1/services/migration_service/transports/grpc_asyncio.py
1
13902
# -*- coding: utf-8 -*- # 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...
apache-2.0
-2,154,680,416,297,731,300
43.700965
102
0.630557
false
4.663536
false
false
false
liiight/notifiers
tests/providers/test_mailgun.py
1
2725
import pytest import datetime import time from email import utils from notifiers.exceptions import BadArguments from notifiers.core import FAILURE_STATUS provider = "mailgun" class TestMailgun: def test_mailgun_metadata(self, provider): assert provider.metadata == { "base_url": "https://api.m...
mit
-4,442,736,360,810,114,600
32.231707
86
0.519266
false
3.707483
true
false
false
davidnmurray/iris
lib/iris/io/__init__.py
1
15278
# (C) British Crown Copyright 2010 - 2016, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
gpl-3.0
-5,592,605,519,203,370,000
34.948235
99
0.624231
false
4.0894
false
false
false
darkfeline/mir.dlsite
setup.py
1
1535
# Copyright (C) 2016 Allen Li # # 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
3,668,088,456,833,777,700
29.098039
74
0.636482
false
3.743902
false
false
false
UCSD-PL/kraken
reflex/coq/bench-quark/test/quark/output/output.py
1
6774
#!/usr/bin/python import sys import os import tempfile import gobject import gtk import socket import shm import threading import time import struct import cairo import array import cPickle as pickle import message import config #gtk.gdk.threads_init() def olog(str): olog_nonl(str + "\n") def olog_nonl(str): ...
gpl-2.0
2,311,913,955,336,338,400
35.419355
149
0.50059
false
3.659643
false
false
false
Flexget/Flexget
flexget/event.py
1
3312
""" Provides small event framework """ from typing import Callable, List, Dict, Any from loguru import logger logger = logger.bind(name='event') class Event: """Represents one registered event.""" def __init__(self, name: str, func: Callable, priority: int = 128) -> None: self.name = name s...
mit
3,774,398,002,613,047,300
28.571429
119
0.617452
false
3.952267
false
false
false
initcrash/transdb
transdb/fields.py
1
4827
from django.db import models from django.conf import settings from django.utils.translation import get_language from django.utils.translation import ugettext as _ from django.utils.encoding import force_unicode, smart_str, smart_unicode from django.forms.fields import Field from django.forms import ValidationError from...
gpl-3.0
5,646,233,992,082,309,000
34.755556
111
0.618189
false
4.275465
false
false
false
opennode/nodeconductor-openstack
src/waldur_openstack/openstack_tenant/migrations/0008_backup_schedule.py
1
2253
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import waldur_core.logging.loggers import django.utils.timezone import waldur_core.core.fields import waldur_core.core.validators class Migration(migrations.Migration): depen...
mit
3,486,332,113,417,544,700
49.066667
206
0.640923
false
4.156827
false
false
false
jocelynmass/nrf51
sdk/nRF51_SDK_9.0.0_2e23562/examples/dfu/experimental/master_control_panel_patch/init_packet.py
1
6654
# Copyright (c) 2015, Nordic Semiconductor # 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 # list of cond...
gpl-2.0
6,692,166,544,894,411,000
45.884892
121
0.651488
false
3.930301
false
false
false
HPI-SWA-Lab/RSqueak
rsqueakvm/plugins/immutability_plugin.py
1
3782
""" RSqueak/VM plugin which provides support for immutable objects. Immutable objects can be created as copy of existing objects or from a list of arguments. The package `ImmutableObjects`, located in `/repository`, needs to be loaded in the image. """ from rsqueakvm.error import PrimitiveFailedError, UnwrappingError...
bsd-3-clause
4,435,581,936,282,197,000
35.019048
76
0.705447
false
3.629559
false
false
false
Cowa/Django-FileManager
FileManager/settings.py
1
5489
# Django settings for FileManagerHTML project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME':...
gpl-2.0
-9,046,051,876,094,814,000
33.740506
127
0.692476
false
3.74165
false
false
false
Frodox/buildbot
master/buildbot/db/builders.py
1
5881
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-5,907,836,894,642,851,000
37.437908
85
0.577113
false
3.879288
false
false
false
ssorj/pencil
setup.py
1
1079
#!/usr/bin/env python3 # # 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 # ...
apache-2.0
-6,843,731,593,604,329,000
36.206897
62
0.728452
false
3.895307
false
false
false
apanda/modeling
tests/examples/ConvertedAclFwTest.py
1
1751
import components def ConvertedAclFwTest (): """ACL firewall test""" ctx = components.Context (['a', 'b', 'c', 'd', 'fw'],\ ['ip_a', 'ip_b', 'ip_c', 'ip_d', 'ip_f']) net = components.Network (ctx) a = components.EndHost(ctx.a, net, ctx) b = components.EndHost(ctx.b, ne...
bsd-3-clause
-7,122,530,099,745,691,000
38.795455
71
0.475157
false
3.003431
false
false
false
bufke/chat-experiment
chatroom/models.py
1
1963
from django.db import models from swampdragon.models import SelfPublishModel from allauth.account.signals import user_signed_up from .dragon_serializers import MessageSerializer, ProfileSerializer class Profile(SelfPublishModel, models.Model): serializer_class = ProfileSerializer user = models.OneToOneField('...
agpl-3.0
-5,963,895,665,154,620,000
30.15873
76
0.683647
false
4.072614
false
false
false
ianb/sheets
sheets/env.py
1
9837
import os import ast import traceback import time import sys import types import builtins import collections import astor import weakref from .jsonify import jsonify, jsonify_print, jsonify_print_expr from .datalayer import Analysis, Execution, FileEdit from .router import send from . import stdlib def now(): retu...
mit
8,401,066,148,762,453,000
29.549689
126
0.564196
false
3.985818
false
false
false
OmkarPathak/Python-Programs
OOP/P11_Property decorators.py
1
1069
#This shows the usage of property decorators #Python @property is one of the built-in decorators. The main purpose of any decorator is to change your class methods or attributes in such a way so that the users neeed not make any additional changes in their code. #Without property decorators class BankAccount: de...
gpl-3.0
6,660,911,220,316,598,000
27.131579
217
0.705332
false
3.426282
false
false
false
sheagcraig/python-jss
jss/queryset.py
1
5924
#!/usr/bin/env python # Copyright (C) 2014-2017 Shea G Craig # # 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 ...
gpl-3.0
-5,587,489,524,983,974,000
31.549451
103
0.603646
false
4.154278
false
false
false
openstack/python-troveclient
troveclient/client.py
1
19150
# Copyright 2011 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 co...
apache-2.0
2,275,167,824,754,101,500
36.920792
78
0.542924
false
4.449349
false
false
false
cybergreen-net/etl2
tests/etl2/etlharness.py
1
2500
import ETL import os import tempfile import gzip from io import BytesIO, StringIO class EtlHarness: def __init__(self, feed, out_prefix): root_dir = tempfile.mkdtemp() self.feed_name = feed self.out_prefix = out_prefix self.source_root = os.path.join(root_dir, "raw") self.so...
gpl-3.0
-13,470,691,697,173,366
38.68254
108
0.6052
false
3.201024
false
false
false
LuisAlejandro/condiment
condiment/common/fabric/docker.py
1
13369
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014 Luis Alejandro Martínez Faneyth # # This file is part of Condiment. # # Condiment 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 ver...
gpl-3.0
6,817,259,882,447,641,000
28.973094
87
0.537777
false
4.273657
false
false
false
lino-framework/xl
lino_xl/lib/lists/fixtures/demo.py
1
1215
# -*- coding: UTF-8 -*- # Copyright 2014-2019 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from lino.api import dd, rt, _ from lino.utils.mldbc import babeld def objects(): ListType = rt.models.lists.ListType List = rt.models.lists.List mailing = babeld(...
bsd-2-clause
5,112,860,678,266,054,000
34.735294
86
0.655967
false
3.422535
false
false
false
fro391/Investing
Sentiments/RSS_URL.py
1
1126
from bs4 import BeautifulSoup import gethtml import re import urlparse #gets titles def getURLs (rss): Titles = [] soup = BeautifulSoup(gethtml.getHtmlText(rss)) for item in soup.findAll('item'): #link tag cut off after stripping for item... only </link> is there for i in item.findAll('title...
gpl-2.0
7,792,483,381,561,359,000
31.171429
80
0.627886
false
3.655844
false
false
false
bert/geda-gaf
xorn/src/python/geda/xmlread.py
1
30020
# Copyright (C) 2013-2017 Roland Lutz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
-6,952,313,439,646,739,000
37.78553
79
0.521286
false
4.323157
false
false
false
JoaoCarabetta/bradata
bradata/tse/pipeline.py
1
6105
import bradata.utils import bradata.connection import os import io from zipfile import ZipFile import pandas as pd import glob import yaml import shutil import luigi import luigi.contrib.postgres def _find_header(data_type, year, path): with open(path, 'r') as f: data = yaml.load(f) a = data[data_ty...
mit
-2,733,309,150,001,114,000
27.666667
130
0.578051
false
3.691052
false
false
false
vathpela/anaconda
pyanaconda/ui/gui/helpers.py
1
13727
# Abstract base classes for GUI classes # # Copyright (C) 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is...
gpl-2.0
1,719,857,370,931,019,000
35.703209
95
0.660523
false
4.312598
false
false
false
OlexandrI/pyside
paste/util/looper.py
1
4017
""" Helper for looping over sequences, particular in templates. Often in a loop in a template it's handy to know what's next up, previously up, if this is the first or last item in the sequence, etc. These can be awkward to manage in a normal Python loop, but using the looper you can get a better sense of the context....
lgpl-3.0
-7,224,671,793,880,922,000
25.254902
74
0.550411
false
4.008982
false
false
false
rialto-px/openprocurement.tender.twostage
openprocurement/tender/twostage/views/bid_document.py
1
13476
# -*- coding: utf-8 -*- from openprocurement.api.models import get_now from openprocurement.api.utils import ( get_file, save_tender, upload_file, apply_patch, update_file_content_type, opresource, json_view, context_unpack, ) from openprocurement.api.validation import ( validate_fil...
apache-2.0
8,687,690,805,947,830,000
64.736585
256
0.65279
false
3.872414
false
false
false
lamogui/ogre_blender_importer
OgreMeshFileFormat.py
1
2168
from enum import IntEnum; class OgreMeshChunkID(IntEnum): """ Definition of the OGRE .mesh file format .mesh files are binary files (for read efficiency at runtime) and are arranged into chunks of data, very like 3D Studio's format. A chunk always consists of: unsigned short CHUNK_ID ...
mit
5,566,725,582,043,546,000
37.035088
106
0.674815
false
2.986226
false
false
false
gbd-consult/CartoCSS-Export
CartoCSSExport/ce/error.py
1
1066
"""Error codes.""" #: No layers in this project (loading error?) EMPTY_PROJECT = 'EMPTY_PROJECT' #: No converter for this Qgis class. CLASS_NOT_IMPLEMENTED = 'CLASS_NOT_IMPLEMENTED' #: No converter for this Qgis property PROP_NOT_IMPLEMENTED = 'PROP_NOT_IMPLEMENTED' #: No converter for this Qgis data provider DATA_...
gpl-2.0
356,750,921,144,582,340
25.65
68
0.763602
false
3.384127
false
false
false
wolfbeacon/wolfbeacon-core-api
api/migrations/0008_auto_20171230_0919.py
1
2732
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-30 09:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0007_mentor_organizer_volunteer'), ] operations = [ migrations.Alter...
gpl-3.0
-4,158,574,478,643,937,000
29.355556
63
0.528917
false
4.435065
false
false
false
mic4ael/indico
indico/modules/events/abstracts/lists.py
1
12697
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from collections import OrderedDict from operator import attrgett...
mit
-2,068,415,674,711,308,500
47.277567
118
0.579349
false
4.394946
true
false
false
symbolicdata/code
src/sdeval/classes/templates/comp/GB_Z_lp/Maple/template.py
1
1407
""" This is the template for the computation problem of computing a Groebner basis of an ideal generated by a finite set of polynomials with integer coefficients (commutative). It creates code for the computer algebra system Maple. .. moduleauthor:: Albert Heinle <albert.heinle@rwth-aachen.de> """ #------------------...
gpl-3.0
8,111,292,419,854,983,000
35.076923
116
0.518834
false
4.410658
false
false
false
schinmayee/metric-learning
losses.py
1
1953
import torch import torch.nn as nn import torch.nn.functional as F def SimpleHingeLoss(dista, distb, distc, target, margin, hard_triplet=False): if hard_triplet: dist_neg = torch.cat([distb, distc], dim=1) dist_neg = torch.min(dist_neg, dim=1)[0] else: dist_neg = distb return nn.Mar...
mit
-4,633,895,436,246,591,000
37.294118
112
0.65745
false
2.793991
false
false
false
AntonSax/plantcv
utils/util-avg_background_img.py
1
1578
#!/usr/bin/env python import argparse import numpy as np import sys, os from os import listdir import plantcv as pcv import datetime ### Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Get images from an SQLite database and some input information") parser.add_argument("-d...
mit
1,587,402,601,414,127,600
22.924242
111
0.652725
false
3.379015
false
false
false
tatyankaZSGX/addressbook
fixture/application.py
1
1228
__author__ = 'ZSGX' from selenium import webdriver from fixture.Session import SessionHelper from fixture.group import GroupHelper from fixture.contact import ContactHelper class Application: def __init__(self, browser, homeurl): if browser == "firefox": self.wd = webdriver.Firefox() ...
apache-2.0
-6,081,401,815,482,364,000
27.581395
70
0.588762
false
3.987013
false
false
false
akrherz/iem
htdocs/plotting/auto/scripts100/p151.py
1
13587
"""Period deltas""" import datetime from collections import OrderedDict from geopandas import read_postgis import numpy as np from pyiem.plot import MapPlot, centered_bins, get_cmap from pyiem.util import get_autoplot_context, get_dbconn from pyiem.exceptions import NoDataFound PDICT = { "state": "State Level Map...
mit
-7,669,432,662,049,230,000
31.120567
79
0.524693
false
3.23423
false
false
false
zprpa-ca/last.fm
03.artist-correlation.py
1
8514
#!/usr/bin/env python ''' Calculate the correlation between the artists. Intermediate datasets are saved in the HDF5 file and the final dataset is saved in the database as well. The artist correlation matrix is saved only for the single selected artist, used in the final step for the similarity comparison....
gpl-3.0
-9,014,966,826,731,524,000
42.218274
115
0.592436
false
3.581826
false
false
false
ROCmSoftwarePlatform/rocFFT
library/src/device/kernel-generator.py
1
39884
#!/usr/bin/env python3 """rocFFT kernel generator. Currently this acts as a shim between CMake and the C++ kernel generator. It accept two sub-commands: 1. list - lists files that will be generated 2. generate - pass arguments down to the old generator Note that 'small' kernels don't decompose their lengths. """ i...
mit
-6,375,603,604,371,238,000
40.159959
219
0.570605
false
3.503821
false
false
false
erggo/Harpy
harpia/bpGUI/sum.py
1
5658
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-3.0
-8,235,328,954,891,495,000
32.678571
139
0.567515
false
3.671642
false
false
false
wdbm/abstraction
fix_database.py
1
7300
#!/usr/bin/env python """ ################################################################################ # # # fix_database # # ...
gpl-3.0
9,110,137,506,986,018,000
39.782123
81
0.499178
false
5.080028
false
false
false
Azure/azure-sdk-for-python
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/operations/_check_virtual_network_subnet_usage_operations.py
1
5283
# 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 may ...
mit
-119,604,675,933,735,000
47.916667
168
0.680863
false
4.477119
true
false
false
nlm/netgen
netgen/templateutils.py
1
3361
from colors import color from functools import partial from jinja2.exceptions import TemplateRuntimeError import math from math import log, ceil from six.moves import xrange class TemplateUtils(object): def __init__(self, ipversion): if ipversion not in (4, 6): raise ValueError('ipversion must...
gpl-2.0
542,898,760,346,410,400
29.554545
74
0.591491
false
4.015532
false
false
false
leonro/magpy-git
magpy/acquisition/palmacqprotocol.py
1
11090
import sys, time, os, socket import struct, binascii, re, csv from datetime import datetime, timedelta from twisted.protocols.basic import LineReceiver from twisted.internet import reactor from twisted.python import usage, log from twisted.internet.serialport import SerialPort from twisted.web.server import Site from ...
gpl-3.0
7,457,627,093,789,535,000
38.049296
201
0.533724
false
3.747888
false
false
false
deplicate/deplicate
duplicate/utils/fs/osx.py
1
1187
# -*- coding: utf-8 -*- from __future__ import absolute_import from ..init import compilecards from .common import fsdecode from .posix import has_hidden_attribute as _has_hidden_attribute from .posix import has_archive_attribute, is_archived WILDCARDS = ( '*.DS_Store', '.AppleDouble', '.LSOverride', 'Icon', '....
mit
7,296,047,325,512,074,000
26.604651
71
0.676495
false
3.618902
false
false
false
abilng/Mtech-proj-scripts
Others/testDTW.py
1
5762
import numpy as np from collections import Counter from numpy import array, zeros, argmin, inf from numpy.linalg import norm import sys,argparse DATA_PATH='/others/abilng/Database/MSR2-abil/test/data_out/' GroundTruthFile="/others/abilng/Database/MSR2-abil/Videos/groundtruth.txt"; PrintProgress=True def dtw(x, y, di...
apache-2.0
1,400,461,167,598,897,200
22.140562
100
0.618709
false
2.670065
false
false
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/extended_ipv4_reachability/prefixes/prefix/subTLVs/subTLVs_/prefix_sid/sid/__init__.py
1
12694
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
1,686,331,334,871,978,000
37.12012
375
0.576178
false
4.29577
true
false
false
jakebas/homepage
routes.py
1
1408
from flask import Flask, render_template, request from forms import ContactForm from flask.ext.mail import Message, Mail mail = Mail() app = Flask(__name__) app.secret_key = #removed from public version app.config['MAIL_SERVER'] = "smtp.gmail.com" app.config['MAIL_PORT'] = 465 app.config['MAIL_USE_SSL'] = True app....
mit
-5,081,545,841,456,852,000
24.6
104
0.667614
false
3.274419
false
false
false
patpatpatpatpat/stormpath-django
django_stormpath/admin.py
1
1326
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import StormpathUser from .forms import StormpathUserCreationForm, StormpathUserChangeForm class StormpathUserAdmin(UserAdmin): # Set the add/modify forms add_form = StormpathUserCreationForm form = StormpathUse...
apache-2.0
1,799,797,049,859,641,000
40.4375
90
0.6546
false
3.724719
false
false
false
jturner314/map_ssh_attempts
map_ssh_attempts/geoip.py
1
4272
# Copyright (C) 2014 Jim Turner # This file is part of map_ssh_attempts. # map_ssh_attempts is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by the Free # Software Foundation, either version 2 of the License, or (at your option) any # later v...
gpl-2.0
1,047,337,268,620,959,500
37.142857
114
0.61868
false
4.131528
false
false
false
sbustreamspot/sbustreamspot-cdm
test_kafka_vm.py
1
2510
#!/usr/bin/env python import argparse from constants import * import json import pdb from pykafka import KafkaClient from pykafka.exceptions import OffsetOutOfRangeError, RequestTimedOut from pykafka.partitioners import HashingPartitioner import sys from tc.schema.serialization import Utils from tc.schema.serializatio...
apache-2.0
5,254,498,871,606,089,000
30.375
98
0.686853
false
3.707533
false
false
false
aclowes/yawn
yawn/task/serializers.py
1
2485
from rest_framework import serializers from yawn.task.models import Task, Execution from yawn.worker.serializers import MessageSerializer, WorkerSerializer from yawn.workflow.models import Workflow class SimpleWorkflowSerializer(serializers.ModelSerializer): name = serializers.CharField(source='name.name', read_...
mit
-2,446,936,753,634,268,000
34
89
0.700604
false
4.306759
false
false
false
ifduyue/sentry
tests/sentry/integrations/vsts/testutils.py
1
33812
from __future__ import absolute_import import responses from six.moves.urllib.parse import urlparse, urlencode, parse_qs from sentry.integrations.vsts import VstsIntegrationProvider from sentry.testutils import IntegrationTestCase class VstsIntegrationTestCase(IntegrationTestCase): provider = VstsIntegrationPr...
bsd-3-clause
-7,866,642,662,394,803,000
43.784106
966
0.593073
false
2.786091
false
false
false
mganeva/mantid
Framework/PythonInterface/plugins/algorithms/Abins.py
1
40996
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
8,994,032,376,073,273,000
47.804762
120
0.609791
false
4.180706
false
false
false
Oli76/rwslib
rwslib/builder_constants.py
1
6274
# -*- coding: utf-8 -*- __author__ = 'isparks' import enum class DataType(enum.Enum): """ODM Data Types""" Text = 'text' Integer = 'integer' Float = 'float' Date = 'date' DateTime = 'datetime' Time = 'time' String = 'string' # Used only by codelists class QueryStatusType(enum.Enum)...
mit
-2,006,527,805,749,792,300
27.261261
65
0.669908
false
3.712426
false
false
false
litong01/python-monasca
kiloeyes/v2/elasticsearch/versions.py
1
1877
# Copyright 2013 IBM Corp # # 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, so...
apache-2.0
-6,706,174,373,474,287,000
31.362069
75
0.595631
false
3.709486
false
false
false
goodtune/vitriolic
touchtechnology/news/forms.py
1
1627
from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from modelforms.forms import ModelForm from touchtechnology.common.forms.mixins import ( BootstrapFormControlMixin, SuperUserSlugMixin, ) from touchtechnology.news.models import Article, Category, Trans...
bsd-3-clause
2,439,485,887,015,281,000
26.116667
79
0.564229
false
4.519444
false
false
false