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
gogoair/foremast
tests/app/test_create_app.py
1
1377
"""Verifies that instance_links are being retrieved properly from LINKS. Verifies that app_data.json.j2 contains the instance link information""" from unittest import mock from foremast.app import SpinnakerApp @mock.patch('foremast.app.spinnaker_app.LINKS', new={'example1': 'https://example1.com'}) def test_default_i...
apache-2.0
-1,537,231,771,002,252,500
36.216216
103
0.701525
false
3.803867
true
false
false
IQSS/miniverse
dv_apps/metrics/stats_view_base.py
1
9234
import json import csv from collections import OrderedDict from datetime import datetime from StringIO import StringIO #import pandas as pd from django.conf import settings from django.http import JsonResponse, HttpResponse from django.template.loader import render_to_string from django.views.generic import View # A...
mit
2,642,223,270,353,928,000
36.084337
98
0.640676
false
3.878202
false
false
false
ydkhatri/mac_apt
plugins/quicklook.py
1
22345
''' Copyright (c) 2019 Yogesh Khatri This file is part of mac_apt (macOS Artifact Parsing Tool). Usage or distribution of this software/code is subject to the terms of the MIT License. ''' from plugins.helpers.macinfo import * from plugins.helpers.writer import * from plugins.helpers.common im...
mit
-3,242,953,654,342,168,600
40.565714
150
0.602059
false
3.906469
false
false
false
glexey/vim_html_paste
clip2html.py
1
4509
# This script takes marks the existing text content of a Windows # clipboard as HTML. This is useful to automate copy/paste of # the formatted code from gVIM to Outlook, blog post, etc. # Clipboard stuff from http://code.activestate.com/recipes/474121/ import re import win32clipboard class HtmlClipboard: CF_HTM...
mit
-8,930,930,131,424,293,000
32.154412
116
0.604125
false
3.873711
false
false
false
flavour/eden
modules/templates/SAFIRE/Urgences-Sante/menus.py
9
4745
# -*- coding: utf-8 -*- from gluon import current from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # ============================================================================= class S3MainMenu(default.S3MainMenu): """ Custom Applica...
mit
6,823,988,331,201,383,000
40.26087
85
0.406322
false
4.69802
false
false
false
brian-rose/climlab
climlab/radiation/aplusbt.py
1
11588
from __future__ import division from climlab.process.energy_budget import EnergyBudget from climlab.utils import constants as const import numpy as np class AplusBT(EnergyBudget): r"""The simplest linear longwave radiation module. Calculates the Outgoing Longwave Radation (OLR) :math:`R\uparrow` as .. m...
mit
5,655,771,523,168,865,000
34.987578
103
0.547722
false
3.834547
false
false
false
goblinhack/MundusMeus
python/things/road_snow.py
1
1511
import tp import mm def thing_init(t): return def road_snow_init(name, short_name, tiles=[]): x = tp.Tp(name) x.set_short_name(short_name) x.set_is_road_snow(True) x.set_is_world_item(True) x.set_z_depth(mm.Z_DEPTH_ROAD) if tiles is not None: for t in tiles: x.set_ti...
lgpl-3.0
-3,589,036,232,447,633,400
26.981481
47
0.338848
false
4.072776
false
false
false
yosshy/bergenholm
tests/views/test_hosts.py
1
3286
import copy from flask import json from tests import base from bergenholm.views import hosts API = "/api/1.0/hosts/" class HostsViewTestCase(base.TestCase): def test_get_hosts(self): expected = {u"hosts": [self.host_id]} result = self.client.get(API) self.assertEqual(result.status_code...
apache-2.0
-1,911,109,451,051,491,000
38.590361
74
0.593427
false
3.440838
true
false
false
mtury/scapy
scapy/arch/__init__.py
1
2813
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ Operating system specific functionality. """ from __future__ import absolute_import import socket import scapy.consts fr...
gpl-2.0
-7,706,871,854,291,476,000
28.302083
117
0.685034
false
2.954832
false
false
false
sergeneren/anima
anima/rig/curve.py
1
2784
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Anima Istanbul # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import pymel.core as pm class Curve(object): def __init__(self, name_in, curve): self._curveNode = p...
bsd-2-clause
7,706,875,388,871,063,000
26.701031
83
0.58046
false
3.653543
false
false
false
vayw/stuffy
archivate.py
1
1303
#!/usr/bin/env python3 import time import os import shutil import tarfile import logging HOWOLD = 1 basepath = 'E:/1CBufferDirectory/1CUTAxelot' logging.basicConfig(filename=basepath + '/archivate.log', format='%(levelname)s:%(message)s', level=logging.INFO) try: if os.path.getsize(basepath + '/archivate.log') ...
gpl-3.0
-90,586,186,703,380,210
30.02381
113
0.66769
false
2.914989
false
false
false
tylerclair/py3canvas
py3canvas/apis/calendar_events.py
1
51704
"""CalendarEvents API Version 1.0. This API client was generated using a template. Make sure this code is valid before using it. """ import logging from datetime import date, datetime from .base import BaseCanvasAPI from .base import BaseModel class CalendarEventsAPI(BaseCanvasAPI): """CalendarEvents API Version...
mit
8,638,054,460,111,715,000
44.314636
610
0.64701
false
4.07054
false
false
false
cuauv/software
mission/missions/old/2018/track.py
1
1649
#!/usr/bin/env python3 import math from mission.framework.task import Task from mission.framework.combinators import Sequential, Concurrent, MasterConcurrent, Retry, Conditional, While, Either from mission.framework.movement import Heading, RelativeToInitialHeading, VelocityX, VelocityY, Depth, RelativeToCurrentHeadi...
bsd-3-clause
-2,502,780,342,940,534,000
25.596774
151
0.653123
false
3.304609
false
false
false
turbokongen/home-assistant
homeassistant/components/harmony/remote.py
1
9818
"""Support for Harmony Hub devices.""" import json import logging import voluptuous as vol from homeassistant.components import remote from homeassistant.components.remote import ( ATTR_ACTIVITY, ATTR_DELAY_SECS, ATTR_DEVICE, ATTR_HOLD_SECS, ATTR_NUM_REPEATS, DEFAULT_DELAY_SECS, ) from homeass...
apache-2.0
-8,381,512,501,906,454,000
32.394558
91
0.623956
false
4.007347
true
false
false
alabs/petateca
petateca/apps/serie/migrations/0002_auto__add_field_episode_title_en__add_field_episode_title_es__add_fiel.py
1
9856
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Episode.title_en' db.add_column('serie_episode', 'title_en', self.gf('django.db.models.fie...
agpl-3.0
-8,935,656,780,571,769,000
58.017964
173
0.564834
false
3.507473
false
false
false
Stanford-Online/edx-analytics-pipeline
edx/analytics/tasks/warehouse/tests/test_run_vertica_sql_script.py
1
3109
""" Ensure we can write to Vertica data sources. """ from __future__ import absolute_import import textwrap from unittest import TestCase import luigi import luigi.task from mock import MagicMock, patch, sentinel from edx.analytics.tasks.util.tests.target import FakeTarget from edx.analytics.tasks.warehouse.run_vert...
agpl-3.0
1,487,603,360,284,520,700
34.735632
93
0.639756
false
4.085414
true
false
false
im-liang/word-frequency-counter
app.py
1
2361
import sys from os import listdir from os.path import isfile, join, isdir, exists from multiprocessing import Pool import support import const def wordFrequency(fname): """ Analysis of word usage for the file @param fname: file name @return: word frequency dict """ counter = {} content = su...
mit
4,527,895,484,852,742,000
29.662338
116
0.615841
false
3.948161
false
false
false
3dfxsoftware/cbss-addons
account_bank_balance_report/report/account_bank_balance_report.py
1
13133
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
gpl-2.0
6,034,979,615,341,734,000
51.536
230
0.521587
false
4.553745
false
false
false
rbuffat/pyidf
tests/test_generatormicrochp.py
1
3012
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.electric_load_center import GeneratorMicroChp log = logging.getLogger(__name__) class TestGeneratorMicroChp(unittest.TestCase): def setUp(self): self.fd, self.path ...
apache-2.0
8,094,510,328,616,789,000
42.042857
119
0.688247
false
3.369128
false
false
false
sopoforic/cgrr-gamecube
graphics.py
1
2996
from PIL import Image def parse_rgb5a3(data, width): if ((len(data))/2) % width != 0: raise ValueError("Invalid number of tiles for width {}".format(width)) height = (len(data))//(width * 2) img = Image.new("RGBA", size=(width, height)) imgdata = reorder_tiles(data, (4, 4), width, 16) pixma...
gpl-3.0
-5,450,840,273,704,599,000
35.536585
96
0.570761
false
3.005015
false
false
false
RobLoach/lutris
lutris/gui/cellrenderers.py
1
1642
from gi.repository import Gtk, Pango, GObject class GridViewCellRendererText(Gtk.CellRendererText): """CellRendererText adjusted for grid view display, removes extra padding""" def __init__(self, width, *args, **kwargs): super(GridViewCellRendererText, self).__init__(*args, **kwargs) self.prop...
gpl-3.0
-6,833,111,031,784,157,000
35.488889
80
0.607795
false
3.523605
false
false
false
rhelmer/socorro-webapp
crashstats/crashstats/views.py
1
85774
import os import json import datetime import logging import math import isodate import urllib from collections import defaultdict from operator import itemgetter from django import http from django.contrib.auth.models import Permission from django.shortcuts import render, redirect from django.conf import settings from...
mpl-2.0
9,182,683,778,932,783,000
33.405937
79
0.578497
false
4.044417
false
false
false
shanot/imp
modules/multifit/pyext/src/models.py
1
1750
#!/usr/bin/env python from __future__ import print_function import IMP.multifit from IMP import OptionParser __doc__ = "Write output models as PDB files." # analyse the ensemble, first we will do the rmsd stuff def parse_args(): usage = """%prog [options] <asmb.input> <proteomics.input> <mapping.inpu...
gpl-3.0
749,032,697,762,741,500
32.653846
78
0.609714
false
3.271028
false
false
false
nyamairi/TracToChatwork
tochatwork/admin_panel.py
1
1782
import pkg_resources from trac.core import Component, implements from trac.admin import IAdminPanelProvider from trac.web.chrome import add_notice, add_warning, ITemplateProvider from trac.util.text import exception_to_unicode SECTION_NAME = 'tochatwork' class AdminPanel(Component): implements(IAdmin...
mit
6,070,210,907,413,598,000
32.307692
94
0.584175
false
3.89083
false
false
false
academicsystems/Qengine
pkg/config/qconfig.py
1
3956
import os.path from random import choice from string import ascii_uppercase import sys import yaml # pyyaml from ..blocks import loadblocks as lb class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*args, ...
apache-2.0
-6,168,134,766,040,976,000
27.666667
105
0.69818
false
3.200647
true
false
false
JiangKlijna/design-pattern
AbstractFactoryPattern/AbstractFactory.py
1
1135
# encoding = utf-8 import random class PetShop: """A pet shop""" def __init__(self, animal_factory=None): self.pet_factory = animal_factory def show_pet(self): pet = self.pet_factory.get_pet() print("This is a lovely", pet) print("It says", pet.speak()) print("It ...
apache-2.0
3,855,028,213,898,458,600
17.015873
53
0.570044
false
3.299419
false
false
false
guorendong/iridium-browser-ubuntu
third_party/chromite/cli/cros/lint.py
1
16717
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This module is not automatically loaded by the `cros` helper. The filename # would need a "cros_" prefix to make that happen. It lives here so tha...
bsd-3-clause
-7,882,174,848,410,504,000
34.796574
100
0.627864
false
3.593508
false
false
false
deepmind/mathematics_dataset
mathematics_dataset/sample/number.py
1
5071
# Copyright 2018 DeepMind Technologies Limited. # # 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
1,212,512,588,697,373,000
29.733333
80
0.709525
false
3.593905
false
false
false
shaun-h/PGame
Games/Snake/snake.py
1
5131
from scene import * from ui import get_screen_size import random import time A = Action class snake(Scene): def setup(self): self.movement = 1 self.movementStep = 0.1 self.lastStep = 0 self.grid = [] self.snakePos = [] self.food = -1 self.snakeColour = '#000000' self.emptyColour = '#ffffff' self.food...
mit
7,900,173,201,529,440,000
25.448454
110
0.638277
false
2.625896
false
false
false
Javier-AG/SMC_thesis
extraction_and_annotation/high_level_description.py
1
1476
import Timbral_Brightness as bright import Timbral_Depth as depth import Timbral_Hardness as hard import Timbral_Roughness as rough import os import numpy as np import pandas as pd # High-level descriptors calculation # Set folders: change source directory pardir = 'DATASET_PATH' folder = 'FOLDER_NAME' # Initialize ...
gpl-3.0
-5,852,060,324,948,805,000
29.122449
157
0.663957
false
2.558059
false
false
false
PeteAndersen/swarfarm
data_log/migrations/0005_auto_20190322_1821.py
1
10182
# Generated by Django 2.1.7 on 2019-03-23 01:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('data_log', '0004_riftdungeonlog_clear_time'), ] operations = [ migrations.RemoveField( model_na...
apache-2.0
-5,502,780,763,330,571,000
39.245059
150
0.592909
false
4.013402
false
false
false
codingjoe/django-s3file
s3file/views.py
1
1865
import base64 import hashlib import hmac import logging from django import http from django.conf import settings from django.core.files.storage import default_storage from django.views import generic logger = logging.getLogger("s3file") class S3MockView(generic.View): def post(self, request): success_ac...
mit
-3,465,388,422,501,639,700
32.909091
78
0.589812
false
4.238636
false
false
false
Kaosumaru/conan-freetype
conanfile.py
1
1449
from conans import ConanFile, CMake from conans import tools import os class freetypeConan(ConanFile): name = "freetype" version = "2.6.2" url = "https://github.com/Kaosumaru/conan-freetype" settings = "os", "compiler", "build_type", "arch" exports = "freetype/*" freetype_name = "freetype-%s" ...
mit
-8,372,275,207,622,794,000
36.153846
131
0.618357
false
3.184615
false
false
false
car3oon/saleor
saleor/product/templatetags/product_images.py
1
1695
import logging import warnings from django import template from django.conf import settings from django.contrib.staticfiles.templatetags.staticfiles import static logger = logging.getLogger(__name__) register = template.Library() # cache available sizes at module level def get_available_sizes(): all_sizes = set...
bsd-3-clause
-8,253,396,041,086,579,000
30.981132
82
0.634808
false
4.064748
false
false
false
citronneur/rdpy
bin/rdpy-rdpmitm.py
1
11898
#!/usr/bin/python # # Copyright (c) 2014-2015 Sylvain Peyrefitte # # This file is part of rdpy. # # rdpy 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) a...
gpl-3.0
-8,752,646,454,044,498,000
35.835913
201
0.620188
false
4.187962
false
false
false
akhmadMizkat/odoo
addons/base_setup/res_config.py
1
3628
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class base_config_settings(osv.osv_memory): _name = 'base.config.settings' _inherit = 'res.config.settings' _columns = { 'group_multi_company': fields.boolean('M...
gpl-3.0
-6,858,198,202,764,836,000
53.149254
190
0.63699
false
4.113379
true
false
false
netsamir/dotfiles
files/vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/typescript/typescript_completer.py
1
18871
# Copyright (C) 2015 - 2016 Google Inc. # 2016 ycmd contributors # # This file is part of ycmd. # # ycmd 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 ...
unlicense
175,188,819,222,903,420
32.818996
117
0.597213
false
4.028822
false
false
false
google-research/ssl_detection
third_party/FasterRCNN/FasterRCNN/modeling/model_fpn.py
1
8940
# -*- coding: utf-8 -*- import itertools import numpy as np import tensorflow as tf from tensorpack.models import Conv2D, FixedUnPooling, MaxPooling, layer_register from tensorpack.tfutils.argscope import argscope from tensorpack.tfutils.scope_utils import under_name_scope from tensorpack.tfutils.summary import add_m...
apache-2.0
4,639,428,613,423,541,000
32.234201
106
0.630201
false
3.12369
false
false
false
belcaid/last-slack-msg-on-raspberrypi
slack.py
1
1465
#!/usr/bin/env python # -*- coding: utf-8 -*- import time from slackclient import SlackClient import yaml import datetime import pytz import json global message_string token = "ADD-YOUR-TOKEN"# found at https://api.slack.com/web#authentication sc = SlackClient(token) users = sc.api_call("users.list") users_dict =...
mit
-8,217,405,894,988,625,000
28.897959
146
0.588396
false
3.47981
false
false
false
ddofer/ProFET
ProFET/feat_extract/FastaFilter.py
1
4999
''' Go through a given fasta file (later - mod for sets of fastas), and output a new fasta file, with sequences containg unknown, or non standard AA removed; too short sequences removed. Later, can be used to filter sequences whose ID is a classname; (keeping those with a minimum amount of examples, e.g. 30+ samples ...
gpl-3.0
-2,050,795,477,758,331,600
32.066225
119
0.638093
false
3.429258
false
false
false
Ircam-Web/mezzanine-organization
organization/formats/fr/formats.py
1
2414
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
1,685,152,173,706,029,000
38.57377
77
0.636288
false
2.820093
false
false
false
joefutrelle/pyifcb
ifcb/data/bins.py
1
3657
""" Bin API. Provides consistent access to IFCB raw data stored in various formats. """ from functools import lru_cache from .adc import SCHEMA from .hdr import TEMPERATURE, HUMIDITY from .utils import BaseDictlike from ..metrics.ml_analyzed import compute_ml_analyzed class BaseBin(BaseDictlike): """ Base c...
mit
4,120,801,862,766,967,300
28.97541
75
0.615532
false
3.85353
false
false
false
plotly/python-api
packages/python/plotly/plotly/graph_objs/barpolar/_marker.py
1
43687
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "barpolar" _path_str = "barpolar.marker" _valid_props = { "autocolorscale", "...
mit
5,252,691,283,202,661,000
40.448767
87
0.536338
false
4.446061
false
false
false
hip-odoo/odoo
odoo/addons/base/ir/ir_model.py
2
66977
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime import dateutil import logging import time from collections import defaultdict from odoo import api, fields, models, SUPERUSER_ID, tools, _ from odoo.exceptions import AccessError, UserError, ValidationE...
agpl-3.0
-8,925,995,035,553,623,000
46.400566
206
0.565881
false
4.194451
false
false
false
openstack/taskflow
taskflow/utils/misc.py
1
18584
# -*- coding: utf-8 -*- # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved. # Copyright (C) 2013 Rackspace Hosting 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 ...
apache-2.0
-3,695,374,384,073,142,300
33.351201
79
0.619511
false
4.240018
false
false
false
dungtn/baby-vqa
model.py
1
3686
from keras.models import Sequential from keras.layers import Bidirectional, BatchNormalization from keras.layers.embeddings import Embedding from keras.layers.core import Dense, Activation, Merge, Dropout, Flatten, Reshape from keras.layers.convolutional import MaxPooling2D from keras.layers.recurrent import LSTM, GRU ...
mit
3,799,223,031,472,505,000
46.25641
174
0.643516
false
3.123729
true
false
false
jlumpe/pyalign
pyalign/matrix/matrices/create_matrices.py
1
5544
"""Script that formats substitution matrices obtained from NCBI This folder contains substitution matrices (mostly PAM and BLOSUM) used by NCBI's BLAST tool. Data was obtained from ftp://ftp.ncbi.nih.gov/blast/matrices/ on 2/14/16. * PAM matrices - in two formats: PAM{n} and PAM{n}.cdi. N ranges from 10 to 500 in ...
mit
8,317,513,757,221,103,000
22.793991
78
0.640693
false
2.593078
false
false
false
antonc42/taiga-contrib-ldap-auth
taiga_contrib_ldap_auth/connector.py
1
4779
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # Copyright (C) 2015 Ensky Lin <enskylin@gmail.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
1,047,184,773,024,419,600
38.479339
99
0.664224
false
3.794281
false
false
false
josrolgil/exjobbCalvin
calvin/runtime/north/storage.py
1
34594
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-8,092,037,025,147,654,000
41.446626
131
0.568682
false
3.923557
false
false
false
cordoval/myhdl-python
myhdl/test/conversion/general/test_adapter.py
1
1607
from myhdl import * def adapter(o_err, i_err, o_spec, i_spec): nomatch = Signal(bool(0)) other = Signal(bool(0)) o_err_bits = [] for s in o_spec: if s == 'other': o_err_bits.append(other) elif s == 'nomatch': o_err_bits.append(nomatch) else: ...
lgpl-2.1
4,795,991,567,857,670,000
22.985075
74
0.501556
false
2.819298
false
false
false
hydroffice/hyo_ssp
hydroffice/ssp/atlases/woa09checker.py
1
2109
from __future__ import absolute_import, division, print_function, unicode_literals import os import logging log = logging.getLogger(__name__) from ..helper import Helper as BaseHelper from hydroffice.base.ftpconnector import FtpConnector class Woa09Checker(object): def __init__(self, force_downlo...
lgpl-3.0
8,534,105,163,208,124,000
33.15
88
0.602655
false
3.550505
false
false
false
hellsgate1001/thatforum_django
thatforum/models.py
1
3446
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.template.defaultfilters import slugify from mptt.models import MPTTModel, TreeForeignKey class ForumCategory(MPTTModel): parent = TreeForeignKey( 'self', blank=True, null=True, related_n...
mit
2,913,269,870,506,611,700
28.965217
74
0.595763
false
4.097503
false
false
false
jokey2k/pyClanSphere
pyClanSphere/views/core.py
1
3780
# -*- coding: utf-8 -*- """ pyClanSphere.views.core ~~~~~~~~~~~~~~~~~~~~~~~ This module exports the main index page where plugins can hook in to display their widgets :copyright: (c) 2009 - 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE for...
bsd-3-clause
8,366,069,577,547,890,000
36.058824
94
0.696296
false
4.008484
false
false
false
dursobr/Pythics
pythics/html.py
1
27284
# -*- coding: utf-8 -*- # # Copyright 2008 - 2019 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics 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, e...
gpl-3.0
-7,351,712,269,783,081,000
33.580482
117
0.549626
false
3.806362
false
false
false
stoeps13/ibmcnxscripting
WebSphere/cfgJ2EERoleSocialMail.py
1
2136
# cfgJ2EERolesSocialMail # # Author: Christoph Stoettner # Blog: http://www.stoeps.de # E-Mail: nospam@stoeps.de # # Description: # Script is tested with IBM Connections 4.5 CR2, CR3 # # You can enable and disable Socialmail Integration through J2EE Roles with this script # History: # 20140225 Christoph S...
apache-2.0
4,649,441,762,398,965,000
32.451613
156
0.537921
false
3.701906
false
false
false
gypleon/codesCloud
assignments/1/B/1-B.py
1
3657
#!/usr/local/bin/python3 import math import numpy as np # get prime factors unduplicatedly, optimized def getPrimes( num ): pset = set() if 0 == num % 2: pset.add(2) for i in range(3, num+1, 2): if 0 == num % i: isprime = True for j in range(3, int(math.sqrt(i))+1, ...
apache-2.0
6,717,562,176,186,580,000
31.651786
89
0.507793
false
3.928034
false
false
false
woutersmet/Zeosummer
lib/zeobuilder/nodes/vector.py
1
6052
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilde...
gpl-3.0
-3,980,150,933,196,877,000
32.810056
107
0.61649
false
3.789606
false
false
false
googleads/googleads-dfa-reporting-samples
python/v3_3/dfareporting_utils.py
1
4475
#!/usr/bin/python # # Copyright 2015 Google 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 b...
apache-2.0
-2,486,802,664,709,208,000
32.901515
80
0.739441
false
4.319498
false
false
false
DrChai/Haystack-SolrEnginePlus
backends/solr_backend.py
1
5798
from haystack.backends import BaseEngine from haystack.backends.solr_backend import SolrSearchBackend, SolrSearchQuery from haystack.constants import VALID_FILTERS, FILTER_SEPARATOR, DEFAULT_ALIAS, ITERATOR_LOAD_PER_QUERY __author__ = 'Carrycat' class EventSolrSearchBackend(SolrSearchBackend): def _process_resul...
mit
-2,384,183,493,642,633,700
46.532787
120
0.59417
false
4.123755
false
false
false
jbrowne/UCSBsketch
linux/Utils/BoardChangeWatcher.py
1
13053
if __name__ == "__main__": import sys sys.path.append("./") """This module supports watching for ink-changes on a whiteboard.""" from Utils import Logger from Utils.ForegroundFilter import ForegroundFilter from Utils.ImageUtils import captureImage from Utils.ImageUtils import changeExposure from Utils.ImageUtil...
bsd-3-clause
-6,130,084,411,366,002,000
40.702875
79
0.612273
false
3.896418
false
false
false
sylvestre/bedrock
lib/l10n_utils/dotlang.py
1
10514
# coding=utf-8 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """This library parses dotlang files migrated over from the old PHP system. It caches them using the dj...
mpl-2.0
6,054,639,285,895,285,000
31.341538
103
0.596233
false
4.033384
false
false
false
jasontlam/snorkel
snorkel/candidates.py
1
13432
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * from future.utils import iteritems from collections import defaultdict from copy import deepcopy from itertools import product import re from sqlal...
apache-2.0
6,448,931,044,896,654,000
45.801394
155
0.582638
false
4.317583
false
false
false
nive/nive_cms
nive_cms/tests/test_configuration.py
1
3218
# -*- coding: utf-8 -*- import unittest from nive.helper import FormatConfTestFailure from nive_cms import app, box, column, file, image, link, media, menublock, news, note, page, root from nive_cms import spacer, text, codeblock class TestConf(unittest.TestCase): def setUp(self): pass def tear...
gpl-3.0
-6,212,781,265,735,746,000
24.744
98
0.593226
false
4.14157
true
false
false
turbulent/substance
substance/core.py
1
7385
import sys import os import logging from collections import OrderedDict from substance.monads import * from substance.logs import * from substance.shell import Shell from substance.engine import Engine from substance.link import Link from substance.box import Box from substance.db import DB from substance.constants im...
apache-2.0
7,815,226,040,247,544,000
29.266393
156
0.636696
false
4.011407
true
false
false
Azure/azure-sdk-for-python
sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_models.py
1
43651
# 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
-3,180,025,066,798,150,700
34.838259
128
0.619619
false
3.879054
false
false
false
kozmonaut/django-blog-unchained
django_blog/settings.py
1
3990
""" Django settings for django_blog project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
gpl-2.0
-730,967,659,484,838,400
23.9375
101
0.617794
false
3.322231
true
false
false
initrunlevel0/sns
python/nltk/word_classes.py
1
1638
from __future__ import division import nltk, re, pprint from urllib import urlopen # WORD CLASSES # Belajar mengklasifikasikan kata (kata benda, kata sifat, dkk) # POS Tagging # Merupakan mekanisme untuk menandai (tag) kata dengan suatu kelas tertentu pada proses NLP # Menjadi suatu kelas kata atau kategori leksikal ...
mit
-924,523,288,895,908,100
29.333333
168
0.681929
false
2.654781
false
false
false
revoer/keystone-8.0.0
swift/common/request_helpers.py
1
22483
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
apache-2.0
6,721,470,277,451,898,000
39.485455
87
0.591189
false
4.157394
true
false
false
robertoyubero/ptavi-p2
calcplus.py
1
1079
# ROBERTO YUBERO DE DIEGO #!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import calcoohija if __name__ == "__main__": fichero = open(sys.argv[1], 'r') #leo todo el fichero lista_lineas = fichero.read() #creamos una lista de lineas sin salto de linea lista_lineas = lista_lineas.splitlin...
gpl-2.0
8,556,814,540,427,485,000
28.972222
76
0.625579
false
2.972452
false
false
false
lcpt/xc
python_modules/actions/roadway_trafic/load_model_base.py
1
8361
# -*- coding: utf-8 -*- from __future__ import division __author__= "Luis C. Pérez Tato (LCPT) Ana Ortega (AO_O)" __copyright__= "Copyright 2018, LCPT AO_O " __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com ana.ortega.ort@gmail.com" import xc_base import geom import xc from actions import loa...
gpl-3.0
-642,362,778,233,924,100
33.403292
102
0.627273
false
3.965844
false
false
false
bgmerrell/desmod
desmod/component.py
1
11791
"""Component is the building block for desmod models. Hierarchy --------- A desmod model consists of a directed acyclical graph (DAG) of :class:`Component` subclasses. Each Component is composed of zero or more child Components. A single top-level Component class is passed to the :func:`~desmod.simulation.simulate()`...
mit
7,515,155,429,324,628,000
36.670927
79
0.653889
false
4.623922
false
false
false
cdgriffith/Box
box/box_list.py
1
16433
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017-2020 - Chris Griffith - MIT License import copy import re from os import PathLike from typing import Iterable, Type, Union import box from box.converters import ( BOX_PARAMETERS, _from_csv, _from_json, _from_msgpack, _from_toml, ...
mit
5,929,839,658,323,711,000
35.599109
118
0.546887
false
4.041564
false
false
false
theikkila/lopputili
lib/finv2pdf.py
1
10024
# -*- encoding: utf-8 -*- import reportlab from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 from reportlab.lib.units import mm def n(integer): return str('{:.2f}'.format(integer)) class Invoice2PDF: def __init__(self, type, file): self.file = file self.type = type self.p = canvas.Ca...
mit
-6,308,574,670,345,561,000
32.573826
161
0.686026
false
2.541021
false
false
false
chiamingyen/PythonCAD_py3
Interface/Entity/ellipse.py
1
1620
# # Copyright (c) ,2010 Matteo Boscolo # # This file is part of PythonCAD. # # PythonCAD 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...
gpl-2.0
3,794,190,349,041,091,000
31.4
75
0.662963
false
3.690205
false
false
false
wojtask/CormenPy
test/test_chapter17/test_textbook17_4.py
1
1291
import random from unittest import TestCase from hamcrest import * from chapter17.textbook17_4 import table_insert, table_delete from datastructures.dynamic_table import DynamicTable class TestTextbook17_4(TestCase): def test_table_insert(self): nelements = 20 elements = [random.randint(0, 999)...
gpl-3.0
-7,282,318,737,319,688,000
32.102564
96
0.601084
false
3.32732
true
false
false
lciti/cvxEDA
src/cvxEDA.py
1
5876
""" ______________________________________________________________________________ File: cvxEDA.py Last revised: 07 Nov 2015 r69 ______________________________________________________________________________ Copyright (C) 2014-2015 Luca Citi, Alberto Greco This ...
gpl-3.0
-5,067,598,910,324,977,000
40.273381
96
0.550374
false
2.979716
false
false
false
nidkil/gunbot_config_updater
gunbot_config_updater.py
1
11281
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script takes a Gunbot configuration file from the specified URL, updates the keys, creates a Gunthy GUI config file and then stops and starts Gunthy GUI. @author Stephen Oostenbrink (nidkil) <stephen at oostenbrink dot com> """ import os import json import reques...
mit
3,852,402,770,475,489,300
40.322344
117
0.616701
false
3.764097
true
false
false
michalbachowski/pycontentmakeup
src/contentmakeup/strategy/template_renderer.py
1
1147
#!/usr/bin/env python # -*- coding: utf-8 -*- from contentmakeup.strategy import StrategyInterface class TemplateRenderer(StrategyInterface): """Class describes strategy for extracting metadata""" subject = ('template_renderer',) def __init__(self, format_discovery, template_manager, input_reader): ...
mit
-1,085,219,933,147,370,900
39.964286
79
0.622493
false
4.480469
false
false
false
RedHatInsights/insights-core
insights/parsers/libvirtd_log.py
1
2771
""" Libvirtd Logs ============= This module contains the following parsers: LibVirtdLog - file ``/var/log/libvirt/libvirtd.log`` ---------------------------------------------------- LibVirtdQemuLog - file ``/var/log/libvirt/qemu/*.log`` ------------------------------------------------------ """ from insights.specs im...
apache-2.0
-4,709,715,493,350,284,000
38.585714
187
0.636593
false
3.28707
false
false
false
SathyaBhat/spotify-dl
setup.py
1
1543
#!/usr/bin/env python from setuptools import setup, find_packages from spotify_dl.constants import VERSION with open('README.md') as f: long_description = f.read() with open('requirements.txt') as f: requirements = f.read().splitlines() setup( name='spotify_dl', version=VERSION, python_requires=...
mit
1,793,278,256,263,504,400
31.829787
87
0.626701
false
3.966581
false
true
false
akittas/geocoder
geocoder/api.py
1
16248
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import from geocoder.osm import Osm from geocoder.w3w import W3W from geocoder.bing import Bing from geocoder.here import Here from geocoder.tamu import Tamu from geocoder.tgos import Tgos from geocoder.yahoo import Yahoo from geocoder.baidu import Baid...
mit
-8,501,324,559,396,109,000
27.992857
149
0.652685
false
3.791686
false
false
false
REVLWorld/elasticsearch-dsl-py
elasticsearch_dsl/query.py
1
8154
from .utils import DslBase, _make_dsl_class from .function import SF, ScoreFunction __all__ = [ 'Q', 'Bool', 'Boosting', 'Common', 'ConstantScore', 'DisMax', 'Filtered', 'FunctionScore', 'Fuzzy', 'FuzzyLikeThis', 'FuzzyLikeThisField', 'GeoShape', 'HasChild', 'HasParent', 'Ids', 'Indices', 'Match', 'MatchAl...
apache-2.0
-1,174,660,242,213,295,000
33.697872
106
0.536056
false
3.663073
false
false
false
lambdamusic/xtm-hacking
extras/gendocs/parse copy.py
1
4574
#!/usr/bin/env python """ # extracts functions code from xtm source code, returns a structure consisting of a list of metadata dictionaries (one per function) USAGE python parse.py > data.json """ import os, sys from pygments import highlight from pygments.lexers import get_lexer_by_name from pygments.formatte...
apache-2.0
-4,090,661,951,149,218,300
19.328889
132
0.613467
false
2.983692
false
false
false
google/digitalbuildings
tools/validators/instance_validator/validate/telemetry_warning.py
1
1521
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
apache-2.0
6,332,066,584,468,475,000
32.065217
74
0.69165
false
4.178571
false
false
false
vrpolak/slowsort
mutable_stable_lazy_zigzag_pairing_heap.py
1
4167
"""Module that defines mutable stable zigzag pairing heap.""" from pep_3140 import Deque from pep_3140 import List from sorted_using_heap import sorted_using_mutable_stable_heap from mutable_priority_queue import MutablePriorityQueue class MutableStableLazyZigzagPairingHeap(MutablePriorityQueue): """A heap that ...
agpl-3.0
-1,490,482,913,868,144,000
40.257426
113
0.61963
false
4.061404
false
false
false
OmnesRes/prepub
final_populate.py
1
20556
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') import django django.setup() from papers.models import Article from papers.models import Tag from papers.models import Affiliation from papers.models import Author from datetime import date ##links for f1000 and biorxiv ##f=open(r'C:\Use...
mit
1,597,231,650,557,225,000
34.6875
126
0.506859
false
3.448415
false
false
false
googleinterns/IBRNet
ibrnet/data_loaders/create_training_dataset.py
1
5158
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
3,506,847,130,985,132,000
36.649635
119
0.627763
false
4.560566
false
false
false
hawkeyexp/plugin.video.netflix
resources/lib/common/kodi_ops.py
1
10441
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Helper functions for Kodi operations SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_import, d...
mit
-7,129,245,215,049,425,000
41.100806
120
0.646586
false
3.767954
false
false
false
lo-ise/sea_ice_downloader
seaicedata.py
1
2942
# -*- coding: utf-8 -*- """ /*************************************************************************** SeaIceData A QGIS plugin Downloads sea ice concentration data from NSIDC ------------------- begin : 2014-10-02 copyrig...
mit
-5,549,265,629,633,507,000
38.756757
93
0.520054
false
4.692185
false
false
false
apexkid/Wikiapiary
apiary/tasks/bot/extension_weekly.py
1
1462
"""Process weekly activities for extensions.""" # pylint: disable=C0301,C0103,W1201 from apiary.tasks import BaseApiaryTask import logging import datetime LOGGER = logging.getLogger() class ExtensionWeekly(BaseApiaryTask): """Kick off weekly tasks for extensions.""" def run(self, curr_day = None, curr_hour...
gpl-2.0
805,745,656,183,699,000
28.836735
108
0.567031
false
4.061111
false
false
false
interlegis/saap
config/rest_framework/views.py
1
17934
""" Provides an APIView class that is the base of all views in REST framework. """ from __future__ import unicode_literals from django.conf import settings from django.core.exceptions import PermissionDenied from django.db import connection, models, transaction from django.http import Http404 from django.http.response...
gpl-3.0
3,719,835,170,683,816,000
35.230303
85
0.627913
false
4.549467
false
false
false
jhuapl-marti/marti
crits/config/database.py
1
1685
# This is an example file. You should copy this to "database.py" and # make your changes there. # Modifying this example file will not change the settings that CRITs uses. # MongoDB connection information MONGO_HOST = 'localhost' # server to connect to MONGO_PORT = 27017 # port MongoD is running on MO...
mit
8,853,616,078,283,250,000
40.097561
84
0.709792
false
3.488613
false
false
false
openafs-contrib/afspy
afs/service/VolumeService.py
1
7943
import string,json,logging from afs.model.Volume import Volume from afs.model.ExtendedVolumeAttributes import ExtVolAttr from afs.service.BaseService import BaseService, task_wrapper from afs.service.VolumeServiceError import VolumeServiceError from afs.util import misc import afs class VolumeService (BaseService): ...
bsd-2-clause
1,151,720,227,587,487,700
49.916667
180
0.590331
false
3.617031
false
false
false
chunshen1987/iSS
utilities/filter_SMASH_pdg.py
1
1948
#!/usr/bin/env python import numpy as np import sys if len(sys.argv) < 2: print("{} filename".format(sys.argv[0])) exit() filename = str(sys.argv[1]) f = open(filename, "r") SMASH_table = f.read().split("\n") f.close() pdg_list = [] mass_list = [] header_list = [] decay_list = [] iline = 0 while iline ...
mit
2,562,141,826,844,263,400
25.684932
74
0.61037
false
2.743662
false
false
false
googleapis/python-analytics-data
samples/snippets/run_report_with_dimension_filter.py
1
2783
#!/usr/bin/env python # Copyright 2021 Google 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 require...
apache-2.0
450,873,576,677,864,000
37.123288
146
0.736974
false
3.865278
false
false
false
butozerca/fireplace
fireplace/cards/blackrock/collectible.py
1
3004
from ..utils import * ## # Minions # Flamewaker class BRM_002: events = OWN_SPELL_PLAY.after(Hit(RANDOM_ENEMY_MINION, 1) * 2) # Twilight Whelp class BRM_004: play = HOLDING_DRAGON & Buff(SELF, "BRM_004e") # Imp Gang Boss class BRM_006: events = SELF_DAMAGE.on(Summon(CONTROLLER, "BRM_006t")) # Dark Iron Skul...
agpl-3.0
-551,028,235,361,436,000
17.096386
89
0.691744
false
2.184727
false
false
false
joaomoreno/facilis
facilis/core/app.py
1
4753
#!/usr/bin/python # -*- coding: utf-8 -*- # Facilis # João Moreno <http://www.joaomoreno.com/> # GPLv3 import os, yaml, sys, clipboard from urllib2 import urlopen, HTTPError from re import search from web import ServerHandler from db import FilesDatabase from misc import PortInUse from threading import Event, Thre...
gpl-3.0
7,259,759,753,931,775,000
29.267516
129
0.538089
false
3.956703
true
false
false
aymeric-spiga/planetoplot
examples/ppclass_additional/roughness_hist.py
1
1177
#! /usr/bin/env python from ppclass import pp import matplotlib.pyplot as mpl import numpy as np import ppplot u = pp() #u.file = "/home/aymeric/Big_Data/ustar.101x101x201.CaseA.w30_zipbl.nc" u.file = "BIGLES10m_wind5_USTM_9-11.nc" u.var = "USTM" u.x = "0,1000" u.y = "0,1000" tttall = "0,1e10" for yeah in [tttall]: ...
gpl-2.0
5,804,368,510,208,841,000
20.4
71
0.615973
false
2.116906
false
false
false
google-research/language
language/tek_representations/preprocess/prepare_mrqa_data.py
1
3661
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-3,192,057,876,285,266,400
33.537736
80
0.698443
false
3.621167
false
false
false
pf4d/dolfin-adjoint
tests_dolfin/mantle_convection/timings/adjoint.py
1
6534
__author__ = "Lyudmyla Vynnytska and Marie E. Rognes" __copyright__ = "Copyright (C) 2011 Simula Research Laboratory and %s" % __author__ __license__ = "GNU LGPL Version 3 or any later version" # Last changed: 2012-02-14 import time import numpy import sys import os import math sys.path.insert(0, '..') from stokes...
lgpl-3.0
-7,254,148,762,428,801,000
28.565611
123
0.617539
false
3.002757
false
false
false