repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
ray-project/ray
rllib/agents/es/es_torch_policy.py
1
5277
# Code in this file is adapted from: # https://github.com/openai/evolution-strategies-starter. import gym import numpy as np import tree # pip install dm_tree import ray from ray.rllib.models import ModelCatalog from ray.rllib.policy.policy_template import build_policy_class from ray.rllib.policy.sample_batch import...
apache-2.0
94,148,031,799,769,420
37.518248
78
0.614554
false
Orav/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/request.py
1
5949
# urllib3/request.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import...
lgpl-3.0
-7,818,495,000,782,802,000
40.191489
81
0.598084
false
mbiciunas/nix
src/cli_config/script/script_rename.py
1
2028
# NixConfig # Copyright (c) 2017 Mark Biciunas. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is d...
gpl-3.0
-5,188,311,129,422,364,000
31.190476
91
0.675542
false
arkharin/OpenCool
scr/logic/components/separator_flow/theoretical.py
1
3301
# 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/. """ Define the Separator Flow component. """ from scr.logic.components.component import Component as Cmp from scr.logic....
mpl-2.0
-5,360,974,496,690,660,000
38.309524
125
0.65465
false
timothycrosley/pies
pies/overrides.py
1
8179
"""pies/overrides.py. Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import Copyright (C) 2013 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
mit
6,420,396,422,063,561,000
31.328063
116
0.59396
false
amanharitsh123/zulip
zerver/tornado/socket.py
1
13905
from typing import Any, Dict, Mapping, Optional, Text, Union from django.conf import settings from django.utils.timezone import now as timezone_now from django.utils.translation import ugettext as _ from django.contrib.sessions.models import Session as djSession try: from django.middleware.csrf import _compare_sa...
apache-2.0
-7,408,919,245,389,131,000
43.283439
115
0.577778
false
betrisey/home-assistant
tests/test_util/aiohttp.py
1
3248
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import functools import json as _json from unittest import mock class AiohttpClientMocker: """Mock Aiohttp client requests.""" def __init__(self): """Initialize the request mocker.""" self._mocks = [] self....
mit
5,491,227,388,798,299,000
27.743363
75
0.564963
false
espressif/esp-idf
tools/ci/python_packages/tiny_test_fw/App.py
1
2939
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD # # 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
-2,223,458,540,208,511,200
28.989796
111
0.643076
false
OCA/margin-analysis
sale_order_margin_percent/tests/test_margin_percent.py
1
1456
# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl from odoo.tests import SavepointCase class TestSaleMarginPercent(SavepointCase): def setUp(self): super().setUp() self.SaleOrder = self.env['sale.order'] self.product_uom_id = self.ref('uom.pr...
agpl-3.0
-5,844,371,091,095,846,000
34.512195
64
0.524725
false
tatsuhirosatou/JMdictDB
python/lib/jmxml.py
1
40347
####################################################################### # This file is part of JMdictDB. # Copyright (c) 2006-2012 Stuart McGraw # # JMdictDB 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...
gpl-2.0
-779,504,099,350,805,900
43.681063
98
0.534934
false
ctogle/make_places
mp/make_places/blueprints.py
1
6334
#import make_places.scenegraph as sg import make_places.fundamental as fu import make_places.walls as wa #import make_places.primitives as pr import mp_utils as mpu import mp_bboxes as mpbb import mp_vector as cv #from make_places.stairs import ramp #from make_places.stairs import shaft #from make_places.floors import...
gpl-2.0
-4,426,654,233,850,615,000
26.419913
78
0.578623
false
mesheven/pyOCD
pyocd/debug/breakpoints/manager.py
1
6475
""" mbed CMSIS-DAP debugger Copyright (c) 2015-2017 ARM 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 ...
apache-2.0
-6,488,740,294,680,375,000
34
96
0.586873
false
kadamski/func
func/minion/modules/func_module.py
1
4442
## ## Copyright 2007, Red Hat, Inc ## see AUTHORS ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave...
gpl-2.0
-3,535,112,327,350,250,500
32.651515
102
0.615714
false
jeremiahyan/odoo
addons/survey/tests/test_survey_flow.py
1
5648
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.survey.tests import common from odoo.tests import tagged from odoo.tests.common import HttpCase @tagged('-at_install', 'post_install', 'functional') class TestSurveyFlow(common.TestSurveyCommon, HttpCa...
gpl-3.0
752,808,867,488,364,400
46.066667
145
0.581445
false
pombredanne/pyp2rpm
pyp2rpm/name_convertor.py
1
7808
import logging import re try: import dnf except ImportError: dnf = None from pyp2rpm import settings from pyp2rpm import utils from pyp2rpm.logger import LoggerWriter logger = logging.getLogger(__name__) class NameConvertor(object): def __init__(self, distro): self.distro = distro self...
mit
7,444,019,662,291,841,000
37.845771
99
0.60105
false
rfinnie/unladen
unladen/httpd/handlers/status.py
1
1333
#!/usr/bin/env python # Unladen # Copyright (C) 2014 Ryan Finnie # # 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. # # ...
gpl-2.0
3,672,747,148,127,936,500
31.512195
73
0.684921
false
giruenf/GRIPy
app/app_utils.py
1
29345
import re import os import json import importlib import timeit import inspect import collections from enum import Enum from pathlib import Path import numpy as np from matplotlib.cm import cmap_d import wx import app import fileio from classes.om.base.manager import ObjectManager from app import log ...
apache-2.0
-2,007,023,896,810,117,400
34.727159
103
0.527926
false
grouan/udata
udata/api/fields.py
1
2440
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from dateutil.parser import parse from flask import request, url_for from flask.ext.restplus.fields import * log = logging.getLogger(__name__) class ISODateTime(String): __schema_format__ = 'date-time' def format(self, value)...
agpl-3.0
1,874,636,427,373,957,000
28.047619
78
0.607377
false
optiv-labs/talus_client
talus_client/cmds/__init__.py
1
11800
#!/usr/bin/env python # encoding: utf-8 import argparse import arrow import cmd import datetime import glob import json import inspect import os import re import readline import shlex import sys import textwrap import types import talus_client.api import talus_client.errors as errors import talus_client.utils as util...
mit
4,405,679,507,563,071,000
26.699531
118
0.648559
false
cristian99garcia/laybrinth-activity
labyrinthactivity.py
1
39566
#!/usr/bin/python # coding=UTF-8 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-2.0
-8,125,047,139,919,657,000
36.151174
123
0.580397
false
wkschwartz/django
django/utils/http.py
1
17700
import base64 import calendar import datetime import re import unicodedata import warnings from binascii import Error as BinasciiError from email.utils import formatdate from urllib.parse import ( ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, quote, quote_plus, scheme_chars, unquote, unquo...
bsd-3-clause
-1,610,993,750,533,662,700
34.329341
108
0.621356
false
Ignalion/bookshelf
app/endpoints/booksauthors.py
1
5914
""" Here are defined all book related views as below: BookList AuthorList AddEditBook AddEditAuthor """ from flask import ( render_template, request, redirect, url_for, views, ) from flask_login import login_required, current_user from app.lib.abstract import BookAbstraction, Auth...
gpl-2.0
2,764,888,172,949,385,000
32.794286
79
0.521644
false
mollie/mollie-api-python
mollie/api/objects/capture.py
1
1497
from .base import Base class Capture(Base): @classmethod def get_resource_class(cls, client): from ..resources.captures import Captures return Captures(client) @property def id(self): return self._get_property("id") @property def mode(self): return self._get_...
bsd-2-clause
-2,216,945,610,880,563,500
23.145161
89
0.623914
false
mitodl/open-discussions
sites/migrations/0001_add_authenticated_site.py
1
2689
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2018-02-09 19:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Authenticat...
bsd-3-clause
-8,328,817,798,779,035,000
35.337838
155
0.410933
false
kevgliss/historical
historical/s3/poller.py
1
3444
""" .. module: historical.s3.poller :platform: Unix :copyright: (c) 2017 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. author:: Mike Grima <mgrima@netflix.com> """ import os import uuid import logging import boto3 from botocore.exceptions import ClientError from ...
apache-2.0
8,197,142,188,748,092,000
35.638298
117
0.664634
false
cysuncn/python
spark/crm/PROC_M_R_RET_CUST_ASSETS.py
1
4509
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_M_R_RET_CUST_ASSETS').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) s...
gpl-3.0
-4,341,465,601,094,905,300
45.691489
127
0.548189
false
rsmmr/hilti
doc/scripts/hlt.py
1
5732
# -*- coding: utf-8 -*- """X The Hlt domain for Sphinx. """ def setup(Sphinx): Sphinx.add_domain(HltDomain) from sphinx import addnodes from sphinx.domains import Domain, ObjType from sphinx.locale import l_, _ from sphinx.directives import ObjectDescription from sphinx.roles import XRefRole from sphinx.util....
bsd-3-clause
-4,610,790,904,439,784,000
32.325581
82
0.532798
false
theno/fabsetup
fabsetup/fabfile-data/presetting-fabsetup-custom/fabfile_/custom/__init__.py
1
2213
from fabsetup.fabutils import checkup_git_repo_legacy, checkup_git_repos_legacy from fabsetup.fabutils import install_package, install_packages, flo from fabsetup.fabutils import install_user_command_legacy, run, suggest_localhost from fabsetup.fabutils import custom_task as task # here, every task is custom import c...
mit
7,198,231,537,723,629,000
28.118421
81
0.66742
false
salimfadhley/jenkinsapi
jenkinsapi_tests/unittests/test_requester.py
2
12127
from __future__ import print_function import pytest import requests from jenkinsapi.jenkins import Requester from jenkinsapi.custom_exceptions import JenkinsAPIException from mock import patch def test_no_parameters_uses_default_values(): req = Requester() assert isinstance(req, Requester) assert req.user...
mit
-207,026,566,923,361,760
28.151442
82
0.61829
false
facelessuser/subclrschm
setup.py
1
2691
#!/usr/bin/env python # -*- coding: utf-8 -*- """Setup package.""" from setuptools import setup, find_packages import os import imp import traceback def get_version(): """Get version and version_info without importing the entire module.""" devstatus = { 'alpha': '3 - Alpha', 'beta': '4 - Beta...
mit
-6,795,916,051,965,609,000
29.931034
86
0.621702
false
sam-m888/gprime
gprime/db/test/test_where.py
1
3409
# # gPrime - A web-based genealogy program # # Copyright (C) 2016 Gramps Development Team # # 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 o...
gpl-2.0
-2,685,789,864,473,225,000
29.990909
83
0.555295
false
Reality9/spiderfoot
modules/sfp_whois.py
1
2855
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_whois # Purpose: SpiderFoot plug-in for searching Whois servers for domain names # and netblocks identified. # # Author: Steve Micallef <steve@binarypool.com> # #...
gpl-2.0
-5,858,934,050,261,415,000
30.078652
98
0.544658
false
lago-project/lago-ost-plugin
ovirtlago/utils.py
1
2164
# # Copyright 2014-2017 Red Hat, Inc. # # 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
-7,402,835,338,542,384,000
27.853333
79
0.634473
false
mikar/60-days-of-python
gui/filebrowser/fileops.py
1
24240
# -*- coding: utf-8 -*- from operator import itemgetter from unicodedata import normalize import fnmatch import logging import os import re import string import helpers log = logging.getLogger("fileops") class FileOps(object): def __init__(self, casemode=0, countpos=0, dirsonly=False, exclude="", ...
mit
6,557,784,114,560,238,000
29.221945
82
0.573768
false
agendaTCC/AgendaTCC
tccweb/apps/usuarios/admin.py
1
2272
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.utils.translation import ugettext_lazy as _ from models import _User, CSVUsuario from forms import _UserChangeForm,_UserCreationForm def deactivate(modeladmin, request, queryset): queryset.update(i...
gpl-2.0
-1,889,795,591,340,552,000
40.218182
160
0.588884
false
datamade/represent-boundaries
boundaries/tests/test_boundary.py
1
5043
# coding: utf-8 from __future__ import unicode_literals import datetime from django.test import TestCase from django.contrib.gis.gdal import OGRGeometry from django.contrib.gis.geos import Point, GEOSGeometry from boundaries.models import BoundarySet, Boundary, Geometry class BoundaryTestCase(TestCase): maxDiff...
mit
-7,161,883,801,366,320,000
35.280576
133
0.493555
false
vladimir-ipatov/ganeti
lib/ssh.py
1
10583
# # # Copyright (C) 2006, 2007, 2010, 2011 Google Inc. # # 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 progr...
gpl-2.0
2,119,428,609,877,526,000
30.218289
79
0.651422
false
alphagov/backdrop
tests/read/test_validators.py
1
3336
import unittest from hamcrest import * from backdrop.read.validation import ParameterMustBeOneOfTheseValidator, MondayValidator, FirstOfMonthValidator, ParamDependencyValidator # TODO: looked around and couldn't see any other validator tests class TestValidators(unittest.TestCase): def test_value_must_be_one_of...
mit
-7,594,048,280,196,841,000
32.029703
137
0.536871
false
NeCTAR-RC/nova
nova/tests/unit/compute/test_tracker.py
1
76576
# 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,270,558,305,109,929,000
42.757714
79
0.591008
false
woutdenolf/spectrocrunch
spectrocrunch/visualization/tests/test_scene.py
1
2667
# -*- coding: utf-8 -*- import unittest import matplotlib.pyplot as plt import numpy as np from .. import scene from ...patch.pint import ureg class test_scene(unittest.TestCase): def test_images(self): n0, n1 = 5, 10 img = np.arange(n0 * n1).reshape(n0, n1) unit0 = ureg.mm uni...
mit
1,212,141,342,712,263,000
24.893204
86
0.522685
false
gurneyalex/odoo
addons/website_hr_recruitment/models/hr_recruitment.py
8
2050
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from werkzeug import urls from odoo import api, fields, models from odoo.tools.translate import html_translate class RecruitmentSource(models.Model): _inherit = 'hr.recruitment.source' url = fields.Char(compu...
agpl-3.0
-3,908,755,139,462,205,000
35.607143
171
0.639024
false
khertan/Wleux
make.py
1
3091
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Benoît HERVIER <khertan@khertan.net> # Licenced under GPLv3 ## 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; version 3 only. #...
gpl-3.0
-7,431,925,628,490,577,000
33.322222
134
0.663969
false
joequant/sptrader
sptrader/spstore.py
1
14099
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015,2016 Daniel Rodriguez # # Licensed under the GPLv3+ License # ############################################################################### from __fu...
bsd-2-clause
6,111,832,492,346,460,000
33.471883
79
0.536634
false
matrixorz/ut_ali
ut_engine/evaluate/evaluator.py
1
1366
#!/usr/bin/python #-*- coding: utf-8 -*- import sys from collections import defaultdict as ddict def load_test(path): test = ddict(list) with file(path) as f: for line in f: elements = line.strip().split(',') if elements[2] != '1': continue uid = int(elements[0]) ...
mit
-1,154,984,135,064,513,000
26.32
72
0.544656
false
dib-lab/kevlar
kevlar/cli/dist.py
1
2230
#!/usr/bin/env python # # ----------------------------------------------------------------------------- # Copyright (c) 2016 The Regents of the University of California # # This file is part of kevlar (http://github.com/dib-lab/kevlar) and is # licensed under the MIT license: see LICENSE. # ----------------------------...
mit
883,916,755,266,280,200
52.095238
79
0.527354
false
rocktavious/DevToolsLib
DTL/api/daemon.py
1
6655
# Taken and modified from: # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ import threading import Queue import atexit import os import signal import sys import time import logging import logging.handlers from DTL.api import loggingUtils if (hasattr(os, "devnull")): DEVNULL = os.de...
mit
3,978,645,494,672,254,500
29.392694
92
0.433509
false
tony/libtmux
libtmux/server.py
1
15725
# -*- coding: utf-8 -*- """Pythonization of the :term:`tmux(1)` server. libtmux.server ~~~~~~~~~~~~~~ """ from __future__ import absolute_import, unicode_literals, with_statement import logging import os from . import exc, formats from .common import ( EnvironmentMixin, TmuxRelationalObject, has_gte_ver...
bsd-3-clause
1,763,537,423,157,772,000
26.491259
86
0.534563
false
davidzchen/tensorflow
tensorflow/python/distribute/mirrored_strategy.py
1
30492
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-8,923,172,070,556,166,000
39.121053
105
0.669717
false
louisrli/grabrc-client
client/util.py
1
2688
""" Utility functions for output, executing commands, and downloading files. """ # 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...
gpl-3.0
7,016,417,344,108,169,000
26.428571
100
0.667783
false
kmichalak/rosie
test/test_create_git_branch.py
1
4104
import os import shutil import git from rosie.plugins import CreateGitBranch from test.test_base import ( GitRepoTestCase, JenkinsJobMock ) class CreateGitBranchTest(GitRepoTestCase): def setUp(self): self.repo_dir = os.path.join(os.getcwd(), 'test/tmp') self.jenkins_job = JenkinsJobMock...
apache-2.0
-5,072,018,693,773,136,000
28.956204
74
0.552144
false
TaskEvolution/Task-Coach-Evolution
taskcoach/taskcoachlib/gui/iphone.py
1
2653
''' Task Coach - Your friendly task manager Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org> Task Coach is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
gpl-3.0
-6,450,007,675,775,254,000
33.454545
95
0.6683
false
thinkopensolutions/tkobr-addons
tko_account_payment_method_journal_entry_selection/account_invoice.py
1
1727
from openerp import models, fields, api class account_invoice(models.Model): _inherit = 'account.invoice' @api.one @api.depends( 'move_id.line_ids' ) def _get_receivable_lines(self): if self.move_id: data_lines = [x for x in self.move_id.line_ids if ( x...
agpl-3.0
4,093,489,694,293,593,000
38.25
106
0.573827
false
salv-orlando/MyRepo
nova/db/sqlalchemy/migrate_repo/versions/057_add_sm_driver_tables.py
1
3887
# Copyright (c) 2011 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-2,864,362,244,569,372,700
38.663265
79
0.606638
false
tambu-j/signals
python/candlestick.py
1
1780
# __all__ = ['candlestick_trades'] import numpy as np import ctypes import os def _getpath(): #return r"/Users/tim/Library/Caches/clion10/cmake/generated/c57b29e0/c57b29e0/Debug/" return r"/Users/tim/dev/signals/build" def _load_candlestick_lib(): return np.ctypeslib.load_library("libsignals", _getpath...
apache-2.0
-4,548,263,752,612,800,000
40.418605
89
0.473596
false
bigswitch/snac-nox
src/nox/apps/tests/pyunittests/event_test.py
1
2007
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX is d...
gpl-3.0
2,535,196,302,534,147,000
34.839286
88
0.659691
false
PnEcrins/GeoNature
contrib/module_example/backend/blueprint.py
1
1374
from flask import Blueprint, current_app, session from geonature.utils.utilssqlalchemy import json_resp from geonature.utils.env import get_id_module # import des fonctions utiles depuis le sous-module d'authentification from geonature.core.gn_permissions import decorators as permissions from geonature.core.gn_permis...
bsd-2-clause
-7,252,899,591,470,316,000
33.1
75
0.716801
false
alexanderfefelov/nav
python/nav/web/devicehistory/urls.py
1
1840
# # Copyright (C) 2008-2009 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License version 2 as published by the Free # Software Foundation. # # This program is distributed in the...
gpl-2.0
2,219,473,031,298,057,200
40.818182
79
0.668478
false
2ndy/RaspIM
usr/share/python-support/python-soappy/SOAPpy/wstools/c14n.py
1
21235
"""Compatibility module, imported by ZSI if you don't have PyXML 0.7. No copyright violations -- we're only using parts of PyXML that we wrote. """ _copyright = '''ZSI: Zolera Soap Infrastructure. Copyright 2001, Zolera Systems, Inc. All Rights Reserved. Copyright 2002-2003, Rich Salz. All Rights Reserved. Permis...
gpl-2.0
-1,016,785,352,330,602,400
38.691589
138
0.547116
false
egbertbouman/tribler-g
Tribler/Core/ProxyService/ProxyDownloader.py
1
23379
# Written by John Hoffman, George Milescu # see LICENSE.txt for license information import sys from random import randint from urlparse import urlparse from httplib import HTTPConnection import urllib import time from threading import Thread,currentThread,Lock from traceback import print_exc, print_stack from collecti...
lgpl-2.1
-7,412,642,661,146,545,000
35.759434
163
0.582831
false
wdv4758h/ZipPy
lib-python/3/test/test_types.py
1
22083
# Python test set -- part 6, built-in types from test.support import run_unittest, run_with_locale, impl_detail import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is true instead of false') if 0: self.fail('0 is true...
bsd-3-clause
7,613,874,855,356,535,000
37.272097
94
0.502332
false
espenak/enkel
enkel/exml/formgen.py
1
4443
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # 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...
gpl-2.0
-2,090,161,680,316,545,300
25.446429
81
0.674994
false
rossella/neutron
quantum/openstack/common/jsonutils.py
1
5314
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
3,052,417,602,733,729,300
34.905405
78
0.625894
false
adybbroe/atrain_match
atrain_match/reshaped_files_scr/plot_ctth_boxplots_mlvl2_temperature_pressure_height.py
1
16002
"""Read all matched data and make some plotting """ import os import re from glob import glob import numpy as np from matchobject_io import (readCaliopImagerMatchObj, CalipsoImagerTrackObject) from plot_kuipers_on_area_util import (PerformancePlottingObject, ...
gpl-3.0
-7,393,755,009,320,824,000
55.946619
453
0.624734
false
duythanhphan/qt-creator
tests/system/shared/project_explorer.py
1
15291
############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
lgpl-2.1
179,521,143,003,143,680
54.402174
142
0.683539
false
ecederstrand/exchangelib
exchangelib/services/get_user_configuration.py
1
1729
from .common import EWSAccountService from ..properties import UserConfiguration from ..util import create_element, set_xml_value ID = 'Id' DICTIONARY = 'Dictionary' XML_DATA = 'XmlData' BINARY_DATA = 'BinaryData' ALL = 'All' PROPERTIES_CHOICES = {ID, DICTIONARY, XML_DATA, BINARY_DATA, ALL} class GetUserConfiguratio...
bsd-2-clause
-5,405,332,260,484,910,000
41.170732
115
0.712551
false
mghweb/sublime-miva-ide
mvt-toggle-comment.py
1
7319
import sublime, sublime_plugin def advance_to_first_non_white_space_on_line(view, pt): while True: c = view.substr(pt) if c == " " or c == "\t": pt += 1 else: break return pt def has_non_white_space_on_line(view, pt): while True: c = view.substr(pt) if c == " " or c == "\t": pt += 1 else: ...
mit
-864,045,968,172,918,800
30.416309
89
0.679328
false
PnMercantour/autorisations_circulation
auth_circu/routes/export.py
1
5388
import unicodedata from io import BytesIO from datetime import datetime import flask_excel import weasyprint from flask import request, send_file, g, make_response, jsonify from secretary import Renderer from werkzeug.exceptions import BadRequest, abort from sqlalchemy.orm.exc import NoResultFound from pypnusers...
gpl-3.0
7,626,577,335,625,211,000
30.652941
80
0.606207
false
davecroll/data-tasks
test/TestDataEntityManager.py
1
1130
# test\TestDataEntityManager.py import unittest from unittest import TestCase from datatasks.DataEntityManager import DataEntityManager from datatasks.DataEntity import DataEntity from datatasks.sources import FileSource from datatasks.destinations import DatabaseDestination class DataEntityManagerTests(TestCase): ...
mit
-1,377,128,645,068,313,600
28.736842
81
0.7
false
voicesauce/opensauce-python
opensauce/helpers.py
1
3298
"""Helper functions for OpenSauce """ # Licensed under Apache v2 (see LICENSE) from __future__ import division import math import fileinput import numpy as np from scipy.io import wavfile def wavread(fn): """Read in a 16-bit integer PCM WAV file for processing Args: fn - filename of WAV file [st...
apache-2.0
-4,575,236,972,586,572,300
28.711712
111
0.661007
false
gtesei/fast-furious
competitions/tgs-salt-identification-challenge/solutions/9_place/models/inplace_abn/bn.py
1
3567
import torch from queue import Queue from .functions import * from .abn import ABN class InPlaceABN(ABN): """InPlace Activated Batch Normalization""" def forward(self, x): exponential_average_factor = 0.0 if self.training and self.track_running_stats: self.num_batches_tracked +...
mit
2,949,862,532,384,423,000
38.633333
107
0.596299
false
zielmicha/satori
satori.web/satori/web/utils/xmlparams.py
1
1156
from satori.client.common import want_import want_import(globals(), '*') from datetime import datetime from xml.dom import minidom from django import forms from satori.web.utils import forms as satoriforms from satori.tools.params import * class ParamsForm(forms.Form): fieldtypes = { OaTypeTex...
mit
6,455,497,379,610,604,000
37.566667
73
0.583045
false
sallyom/atomic
Atomic/verify.py
1
11302
from . import util from . import Atomic import os from docker.errors import NotFound from operator import itemgetter class Verify(Atomic): DEBUG = False def verify(self): """ Primary def for atomic verify :return: None """ def fix_layers(layers): """ ...
lgpl-2.1
7,556,177,246,161,963,000
39.508961
112
0.500442
false
hmtai6/universe_NeonRace-v0
DQN_breakout/DQN.py
1
9601
import argparse import logging import sys import gc import cv2 import matplotlib.pyplot as plt import gym import universe # register the universe environments from universe import wrappers from collections import deque from skimage.color import rgb2gray from skimage.transform import resize import numpy as np import t...
mit
-7,813,668,082,382,251,000
35.371212
144
0.611915
false
gstarnberger/paasta
paasta_tools/monitoring/check_classic_service_replication.py
1
8785
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-4,242,378,001,048,526,000
39.671296
108
0.64189
false
zenr/ippy
segmentation/shanbhag.py
1
1545
import numpy as np import scipy.misc def shanbhag(imgdata) : """Returns a binary segmentation threshold using the Shanbhag algorithm given imgdata as a grayscale image of type numpy.ndarray """ # get normalized histogram hist, bins = np.histogram(imgdata,range(0,257),density=True) # calculate ...
gpl-3.0
4,705,636,846,058,423,000
28.711538
75
0.586408
false
codebox/star-charts
coord_calc.py
1
4668
# -*- coding: utf-8 -*- from math import sin, cos, degrees, radians, pi class CoordCalc: def __init__(self, star_data_list, area, diagram_size): self.star_data_list = star_data_list self.area = area self.center_ra_angle = self._ra_to_angle((area.ra_min + area.ra_max)/2) if area.ra...
mit
-2,826,641,857,710,505,000
35.732283
117
0.572347
false
eort/OpenSesame
libqtopensesame/widgets/qtitem_splitter.py
2
1578
#-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame 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. OpenSesame is distri...
gpl-3.0
-4,027,054,382,903,953,000
22.205882
73
0.727503
false
bolidozor/RTbolidozor
handlers/__init__.py
1
2316
#!/usr/bin/env python # -*- coding: utf-8 -*- import MySQLdb as mdb import pymysql.cursors import os import tornado from requests_oauthlib import OAuth2Session import smtplib #from email.MIMEMultipart import MIMEMultipart #from email.MIMEBase import MIMEBase #from email.MIMEText import MIMEText #from email.Utils impo...
gpl-3.0
-5,035,603,752,302,982,000
26.903614
163
0.617444
false
ityaptin/ceilometer
ceilometer/tests/unit/image/test_glance.py
1
5111
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
apache-2.0
-5,967,410,848,596,420,000
40.552846
78
0.615144
false
valerymelou/cookiecutter-django-gulp
{{cookiecutter.project_slug}}/config/settings/production.py
1
5098
# -*- coding: utf-8 -*- """ Production Configurations - Use Redis for cache """ from __future__ import absolute_import, unicode_literals from .common import * # noqa # SECRET CONFIGURATION # ------------------------------------------------------------------------------ # See: https://docs.djangoproject.com/en/dev/r...
bsd-3-clause
-3,370,520,679,117,669,400
37.330827
117
0.557081
false
TatsuyaOGth/PepperScripts
LittlePerformance/module/_tmp/random_move.py
1
1596
import time import math import random from naoqi import ALProxy #IP = '127.0.0.1' #port = 49951 IP = '192.168.3.9' port = 9559 motion_proxy = ALProxy('ALMotion',IP,port) part = 'Body' time.sleep(3.0) for i in range(200): motion_proxy.setStiffnesses(part, 1.0) body_names = motion_proxy.getBodyNames(part) if i...
cc0-1.0
-5,709,509,332,995,824,000
20.863014
81
0.703634
false
terna/SLAPP3
6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/start.py
1
4599
# start 6 objectSwarmObserverAgentsAESOP.py # 'project' is by default both the name of the application and of the subfolder # that contains its code; the subfolder is supposed to be placed within the # SLAPP tree # the folder can can be placed outside the SLAPP tree if we place a file # project.txt in the folder "6 ...
cc0-1.0
-7,428,399,567,447,264,000
33.320896
89
0.599043
false
darkopevec/kivy
kivy/uix/widget.py
1
46002
''' Widget class ============ The :class:`Widget` class is the base class required for creating Widgets. This widget class was designed with a couple of principles in mind: * *Event Driven* Widget interaction is built on top of events that occur. If a property changes, the widget can respond to the change in the...
mit
-6,705,151,984,013,767,000
33.797277
80
0.61193
false
ryfeus/lambda-packs
Spacy/source2.7/thinc/neural/_classes/batchnorm.py
1
3359
from .model import Model from ... import describe def _init_to_one(W, ops): W.fill(1.) def _run_child_hooks(model, X, y=None): for hook in model.child.on_data_hooks: hook(model.child, X, y) @describe.on_data(_run_child_hooks) @describe.attributes( G=describe.Weights("Scaling vector", la...
mit
-4,046,856,294,922,201,000
31.298077
75
0.54808
false
Tatsh/tccutil
tccutil.py
1
7732
#!/usr/bin/env python import argparse import sqlite3 import sys import os import hashlib from platform import mac_ver from distutils.version import StrictVersion as version ############################## ######## VARIABLES ########### # Utility Name util_name = os.path.basename(sys.argv[0]) # Utility Version util_v...
gpl-2.0
-660,460,857,305,158,800
25.29932
127
0.622866
false
ziel980/website
app/__init__.py
1
2897
from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap from .navigation import * import os from werkzeug.middleware.proxy_fix import ProxyFix db = SQLAlchemy() nav = MyNavigation() module_setup_functions = [] def create_app(config, disable_login=False): # Flask from flask import Flask ...
mit
3,497,567,861,086,679,000
30.835165
118
0.677943
false
googleapis/python-logging
tests/unit/test_client.py
1
30471
# Copyright 2016 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 agreed to in writing, s...
apache-2.0
7,038,636,927,435,961,000
34.145329
93
0.597059
false
MarkusHackspacher/pyfootballmngr
tests/test_pep8.py
1
1858
# -*- coding: utf-8 -*- # pyfootballmngr # Copyright (C) <2015> Markus Hackspacher # This file is part of pyfootballmngr. # pyfootballmngr 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 o...
gpl-3.0
-8,170,530,810,372,039,000
37.708333
79
0.571044
false
seribits/seriauth
seriauth/api/v1/superusers/views.py
1
3886
# -*- encoding: utf-8 -*- from flask import make_response, request from flask_restful import Api, Resource from .. import blueprint_superusers from ...lib.encrypt import encrypt_sha512 from ...lib.errors import error_410, error_422, error_500 from ...lib.regex_validators import validate_password from .models import Su...
gpl-3.0
7,559,758,148,637,709,000
32.119658
74
0.547355
false
IamJeffG/geopandas
geopandas/io/tests/test_io.py
1
1794
from __future__ import absolute_import import fiona from geopandas import read_postgis, read_file from geopandas.tests.util import download_nybb, connect, create_db, \ PANDAS_NEW_SQL_API, unittest, validate_boro_df class TestIO(unittest.TestCase): def setUp(self): nybb_filename, nybb_zip_path = dow...
bsd-3-clause
5,256,483,910,449,221,000
31.035714
69
0.552954
false
fosfataza/protwis
ligand/models.py
1
14776
from django.db import models from django.utils.text import slugify from django.db import IntegrityError from common.models import WebResource from common.models import WebLink from common.tools import fetch_from_web_api from urllib.request import urlopen, quote import json import yaml import logging class Ligand(mod...
apache-2.0
-3,696,227,186,216,180,700
41.338109
211
0.623782
false
florianfesti/boxes
boxes/generators/folder.py
1
1599
#!/usr/bin/env python3 # Copyright (C) 2013-2014 Florian Festi # # 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....
gpl-3.0
2,576,006,453,972,368,400
31.632653
73
0.623515
false
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_chart_stock01.py
1
2175
############################################################################### # # 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
-961,379,040,412,736,800
29.208333
79
0.511724
false
antoinevg/survival
ontology/human.py
1
1096
#import sys #import cairo #import math import rsvg from random import random # for myfn import widgets #from widgets.texteditor import TextEditor #from core.mathlib import MathLib #from core.world import TheWorld from ontology.movingthing import MovingThing SIZE = 0.05 # scaling constant class Human(MovingThing):...
gpl-2.0
1,649,486,439,531,439,600
17.896552
50
0.614051
false
pombredanne/DjangoRestMultipleModels
drf_multiple_model/mixins.py
1
6074
from rest_framework.response import Response class MultipleModelMixin(object): """ Create a list of objects from multiple models/serializers. Mixin is expecting the view will have a queryList variable, which is a list/tuple of queryset/serailizer pairs, like as below: queryList = [ (...
mit
1,078,349,059,939,249,000
31.137566
99
0.594666
false
sumihai-tekindo/helpdesk_sicepat
helpdesk_waybill/__openerp__.py
1
1962
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2017 Sicepat Ekspres Indonesia (<http://www.sicepat.com>). # @author: - Pambudi Satria <pambudi.satria@yahoo.com> # # This program is free software: you can redistribute it and/or modi...
gpl-3.0
3,049,939,936,751,258,000
31.862069
95
0.575943
false
openstack/watcher-dashboard
watcher_dashboard/content/goals/views.py
1
4470
# Copyright (c) 2016 b<>com # # 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, softw...
apache-2.0
-7,534,486,794,679,372,000
33.651163
76
0.623714
false
JulyKikuAkita/PythonPrac
cs15211/NumbersWithSameConsecutiveDifferences.py
1
3415
__source__ = 'https://leetcode.com/problems/numbers-with-same-consecutive-differences/' # Time: O(2^N) # Space: O(2^N) # # Description: Leetcode # 967. Numbers With Same Consecutive Differences # # Return all non-negative integers of length N such that # the absolute difference between every two consecutive digits is ...
apache-2.0
8,838,016,209,958,667,000
25.679688
98
0.487848
false
vortex-ape/scikit-learn
sklearn/kernel_approximation.py
4
23032
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
5,673,052,215,641,753,000
35.675159
78
0.598862
false
CitrineInformatics/python-citrination-client
citrination_client/models/design/constraints/elemental_inclusion.py
1
1357
from citrination_client.models.design.constraints.base import BaseConstraint from citrination_client.base.errors import CitrinationClientError class ElementalInclusionConstraint(BaseConstraint): """ Constraint class which allows the assertion that a set of elements is included in the candidate composition...
apache-2.0
-7,337,785,072,410,175,000
34.736842
145
0.627856
false