repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
hexlism/xx_net
python27/1.0/lib/zipfile.py
11
59383
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re import string try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "Z...
bsd-2-clause
6,829,568,326,489,694,000
37.04164
103
0.548642
false
vfreex/procszoo
tests/test_atfork.py
1
1691
#!/usr/bin/env python import os import sys from distutils.log import warn as printf try: from procszoo.c_functions import * except ImportError: this_file_absdir = os.path.dirname(os.path.abspath(__file__)) procszoo_mod_dir = os.path.abspath("%s/.." % this_file_absdir) sys.path.append(procszoo_mod_dir)...
gpl-3.0
-5,939,648,310,228,879,000
25.421875
66
0.564755
false
ubuntu-core/snapcraft
tests/integration/store/test_store_validate.py
1
2124
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2019 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
1,699,060,045,097,039,400
32.1875
87
0.629944
false
ideal/drummer
ez_setup.py
4
10034
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
gpl-3.0
4,738,398,491,704,964,000
40.634855
86
0.652581
false
ResearchComputing/RCAMP
rcamp/mailer/models.py
1
3763
from django.db import models from django.core import mail from django.core.exceptions import ValidationError from django.template import Template,Context import time import socket import mailer.signals MODULE_EXCLUDES = ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__n...
mit
-3,203,701,715,067,586,000
30.621849
87
0.563646
false
rfverbruggen/rachiopy
tests/test_zone.py
1
7027
"""Zone object test module""" import unittest from unittest.mock import patch import uuid import random import json from random import randrange from rachiopy import Zone from rachiopy.zone import ZoneSchedule from tests.constants import BASE_API_URL, AUTHTOKEN, RESPONSE200, RESPONSE204 class TestZoneMethods(unitte...
mit
-8,967,909,637,884,122,000
32.146226
77
0.55116
false
jeandet/meson
test cases/common/100 manygen/subdir/manygen.py
8
2129
#!/usr/bin/env python from __future__ import print_function # Generates a static library, object file, source # file and a header file. import sys, os import shutil, subprocess with open(sys.argv[1]) as f: funcname = f.readline().strip() outdir = sys.argv[2] buildtype_args = sys.argv[3] if not os.path.isdir(ou...
apache-2.0
-3,651,456,773,026,154,500
22.395604
90
0.616721
false
edgarRd/incubator-airflow
airflow/operators/oracle_operator.py
9
2132
# -*- coding: utf-8 -*- # # 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
3,355,717,025,591,581,700
37.071429
72
0.69137
false
mfherbst/spack
var/spack/repos/builtin/packages/font-misc-ethiopic/package.py
5
2102
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
5,406,814,945,503,770,000
39.423077
90
0.663654
false
crankycoder/leaderboard_backend
leaderboard/route_endpoints/submit_contributor_observations.py
2
1490
from leaderboard.db import session_factory from leaderboard.models.tile import Tile from leaderboard.models.contributor import Contributor from leaderboard.models.reportweeks import insert_or_update_reportweek key_tile_easting_northing = 'tile_easting_northing' key_observations = 'observations' def add_stumbles_for_c...
mpl-2.0
-556,587,348,377,407,740
38.210526
79
0.650336
false
ttm/aprendizadoSemisupervisionado
trabalho-final-aplicacao/algoritmos/ssl-propagacao-de-rotulo.py
1
2561
# -*- coding: utf-8 -*- import numpy as np, networkx as nx, pylab as p, os a=open("opiniao.arff","rb") vec=a.read(); a.close() vec=vec.split("@DATA"); vec=vec[1].split() vec=[i.split(",")[:-1] for i in vec] v=np.float64(vec) vec=[[float(i[0]),float(i[1])] for i in vec] p.plot(v[0:71,0],v[0:71,1],"go") p.plot(v[71:,0]...
unlicense
-2,881,063,819,277,067,000
21.165217
95
0.589643
false
DBuildService/atomic-reactor
tests/plugins/test_flatpak_create_oci.py
1
35479
""" Copyright (c) 2017, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from flexmock import flexmock from io import BytesIO import json import os import png import pytest import re import subprocess import ...
bsd-3-clause
-4,129,035,388,203,286,500
48.413649
343
0.70529
false
juhnowski/FishingRod
production/pygsl-0.9.5/examples/odeiv.py
1
2561
# Author : Pierre Schnizer """ The python equivalent of the C example found in the GSL Reference document. It prints the calculational ouput to stdout. The first column is t, the second y[0] and the thrid y[1]. Plot it with your favourite programm to see the output. """ import sys import time import pygsl._numobj as ...
mit
-8,548,448,083,523,289,000
27.775281
83
0.565795
false
AWegnerGitHub/stackapi
setup.py
1
1182
from setuptools import setup, find_packages long_description = open('README.rst').read() setup( name='StackAPI', description='Library for interacting with the Stack Exchange API', long_description=long_description, url='https://github.com/AWegnerGitHub/StackAPI', author='Andrew Wegner', author...
mit
8,084,246,330,976,300,000
34.818182
74
0.632826
false
yantrabuddhi/nativeclient
build/package_version/package_locations.py
5
6916
#!/usr/bin/python # Copyright (c) 2014 The Native Client 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 library keeps track of all the standard locations for package files""" import os import posixpath SHARED_FOLDER = 'share...
bsd-3-clause
-5,299,187,509,450,316,000
33.237624
80
0.697079
false
mikewiebe-ansible/ansible
test/units/modules/network/fortios/test_fortios_firewall_schedule_group.py
21
7727
# Copyright 2019 Fortinet, 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 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
-380,618,400,493,725,630
35.971292
142
0.671153
false
amenonsen/ansible
lib/ansible/modules/network/fortios/fortios_firewall_address.py
1
18494
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
gpl-3.0
-1,523,008,129,345,578,000
32.686703
111
0.491889
false
Ritsyy/fjord
fjord/feedback/tests/test_api.py
1
32763
# -*- coding: utf-8 -*- import json import random import time from datetime import date, datetime, timedelta from django.core.cache import get_cache from django.test.client import Client from fjord.base.tests import TestCase, reverse from fjord.feedback import models from fjord.feedback.api_views import PER_HOUR_LIMI...
bsd-3-clause
-3,848,013,333,888,951,300
32.761856
79
0.520718
false
hustlzp/zulip
analytics/management/commands/stream_stats.py
113
1703
from __future__ import absolute_import from django.core.management.base import BaseCommand from django.db.models import Q from zerver.models import Realm, Stream, Message, Subscription, Recipient class Command(BaseCommand): help = "Generate statistics on the streams for a realm." def add_arguments(self, pars...
apache-2.0
3,659,913,931,787,800,600
41.575
101
0.568996
false
qPCR4vir/orange
Orange/OrangeWidgets/VisualizeQt/OWMDSQt.py
6
32319
""" <name>MDS Qt</name> <description>Multi dimensional scaling (Qt)</description> <icon>icons/MDS.svg</icon> <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> <priority>2500</priority> """ from OWWidget import * import Orange import orange import orngMDS import OWGUI import numpy, sys, math, time, os i...
gpl-3.0
6,245,947,863,665,940,000
43.031335
206
0.58266
false
jiwanlimbu/aura
keystone/oauth1/backends/sql.py
1
10594
# Copyright 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 agreed to in...
apache-2.0
9,211,129,164,002,423,000
40.22179
79
0.62054
false
hamasho/endojo
apps/games/vocabulary/models.py
1
8032
from datetime import timedelta from django.db import models from django.utils import timezone from django.contrib.auth.models import User from registration.models import Language from core.utils import date_range, get_today class Package(models.Model): title = models.CharField(max_length=200, unique=True) le...
gpl-3.0
-4,291,319,311,046,072,000
30.131783
74
0.541086
false
blueskycoco/rt-thread
bsp/gd32e230k-start/rtconfig.py
12
3354
import os # toolchains options ARCH='arm' CPU='cortex-m23' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EX...
gpl-2.0
-8,796,945,031,366,751,000
26.048387
128
0.55963
false
clever-crow-consulting/otm-core
opentreemap/treemap/species/codes.py
8
98503
# flake8: noqa def all_itree_region_codes(): return _CODES.keys() def all_species_codes(): return species_codes_for_regions(all_itree_region_codes()) def species_codes_for_regions(region_codes): if region_codes is None: return None species_codes = [] for region_code in region_codes: ...
agpl-3.0
-7,224,161,547,193,751,000
26.991759
85
0.402607
false
dga4654dan/UTM-Demo
V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/unittest.py
11
25328
#!/usr/bin/env python ''' Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's Smalltalk testing framework. This module contains the core framework classes that form the basis of specific test cases and suites (TestCase, TestSuite etc.), and also a text-based utility class for running the tests ...
gpl-2.0
5,509,492,323,495,381,000
34.031812
90
0.583504
false
noobcoderT/ryu-3.21
ryu/lib/packet/bmp.py
22
29351
# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
8,440,368,976,161,723,000
37.568988
78
0.506013
false
GerryPy/GerryPy
gerrypy/scripts/fish_scales.py
1
12945
""" Pull tract information from database, compute new congressional districts based on criteria in request, and update the database. """ from gerrypy.models.mymodel import Tract, Edge import networkx as nx from gerrypy.scripts.assigndistrict import assign_district def fill_graph(request): """Build state graph fr...
mit
-5,427,844,483,483,254,000
47.483146
162
0.60757
false
mnieber/shared-goals
django/goal/templates/goal/edit_goal_html.py
2
2302
from django_dominate.django_tags import * from dominate.tags import * from dominate.util import text from goal.templates.dominate_tags import * @form( method="post", enctype="multipart/form-data", ) def goal_form(): django_csrf_token() with p(): with django_if("show_errors"): t...
apache-2.0
-7,100,782,973,196,199,000
24.577778
66
0.425717
false
girke-lab/chemmine-ei
src/eutils/fpdbcompare.py
1
1474
""" Calculating distances to all reference compounds """ import os import sys from pexpect import spawn, TIMEOUT bin = 'ei-fp_db_compare_server' exchange_fp = "/tmp/__db_compare.in" from time import time from signal import SIGINT class DBComparerStartupError(Exception): pass class ComparerError(Exception): pass c...
gpl-3.0
2,112,102,640,835,268,600
20.362319
65
0.66825
false
AlphaX2/FotoShareN9
0.9.7/fotoshare_deb/opt/FotoShareN9/paramiko/auth_handler.py
26
16421
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
gpl-3.0
7,699,957,758,928,900,000
37.546948
119
0.574874
false
timlinux/inasafe
safe/gis/vector/test/test_union.py
2
2114
# coding=utf-8 import unittest from safe.definitions.constants import INASAFE_TEST from safe.test.utilities import ( get_qgis_app, load_test_vector_layer) from safe.gis.vector.clean_geometry import clean_layer QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app(qsetting=INASAFE_TEST) from safe.gis.vector.union im...
gpl-3.0
8,934,478,622,426,080,000
31.030303
75
0.628193
false
andzaytsev/deepnav
GA3C_LSTM_NAV_D/backup/Environment_gym.py
7
3447
# Copyright (c) 2016, NVIDIA CORPORATION. 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 a...
gpl-2.0
8,339,360,293,789,449,000
36.467391
91
0.688425
false
deepfield/ibis
ibis/expr/analytics.py
1
4739
# Copyright 2015 Cloudera 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 or agreed to in writing, so...
apache-2.0
-5,387,108,389,572,287,000
29.574194
77
0.639586
false
SickRage/SickRage
sickrage/libs/enzyme/language.py
3
15136
# Author: echel0n <echel0n@sickrage.ca> # URL: https://sickrage.ca # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
7,245,538,614,709,254,000
27.18622
74
0.455338
false
lewischeng-ms/pox
pox/misc/dnsspy.py
5
2069
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, Inc. # # This file is part of POX. # # POX 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) an...
gpl-3.0
1,055,570,198,829,311,400
29.880597
86
0.669889
false
AliZafar120/NetworkStimulatorSPl3
rapidnet_visualizer/src/ns3/test/test_gui_playback.py
1
3036
import sys import gtk from ns3.viewer.net_view_area import NetViewArea from ns3.viewer.time_slider import TimeSlider from ns3.viewer.node_style import NodeStyle, NodeShape from ns3.viewer.link_style import LinkStyle from ns3.drivers.node_style_driver import LoadNodeStyles from ns3.drivers.link_style_driver import LoadL...
gpl-2.0
-1,535,345,298,507,349,800
28.192308
91
0.695652
false
rahulunair/nova
nova/virt/xenapi/fake.py
1
41677
# Copyright (c) 2010 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 applicab...
apache-2.0
-2,799,547,797,793,958,000
34.56058
79
0.553471
false
SCSSoftware/BlenderTools
addon/io_scs_tools/exp/pim/piece.py
1
9610
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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,222,418,562,750,311,000
36.98419
124
0.615609
false
russellthackston/comp-chem-util
myriad/aws/lambda/pymysql/tests/thirdparty/test_MySQLdb/capabilities.py
20
10191
#!/usr/bin/env python -O """ Script to test database capabilities and the DB-API interface for functionality and memory leaks. Adapted from a script by M-A Lemburg. """ import sys from time import time try: import unittest2 as unittest except ImportError: import unittest PY2 = sys.version_info[0] == ...
mit
8,673,656,556,234,855,000
33.197987
102
0.531744
false
Xaxetrov/OSCAR
oscar/agent/nn/playagent.py
1
6344
import numpy from pysc2.agents import base_agent from pysc2.lib import actions from pysc2.lib import features from learning_tools.A3C_learner.neuralmodel import get_neural_network _PLAYER_RELATIVE = features.SCREEN_FEATURES.player_relative.index _PLAYER_FRIENDLY = 1 _PLAYER_NEUTRAL = 3 # beacon/minerals _PLAYER_HOST...
apache-2.0
-8,732,523,221,495,277,000
41.864865
107
0.599149
false
strets123/cbh_chembl_ws_extension
cbh_chembl_ws_extension/features/steps/salts.py
2
3160
from behave import given, when, then import json import os from django.contrib.auth.models import User, Group from pybel import readfile @given('I have valid salted compound') def step(context): context.inchi = "InChI=1S/2CHF3O3S.Cu/c2*2-1(3,4)8(5,6)7;/h2*(H,5,6,7);/q;;+2/p-2" context.post_data["ctab"] = """ ...
mit
-4,025,316,958,847,487,500
32.978495
86
0.550949
false
josesanch/django-oscar
src/oscar/apps/catalogue/south_migrations/0010_call_update_product_ratings.py
7
18993
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(DataMigration): def forwards(self, orm): for product in orm.Product.objects.all(): ...
bsd-3-clause
2,444,137,537,843,999,000
79.478814
222
0.557521
false
mattjmorrison/ReportLab
src/reportlab/lib/extformat.py
10
2164
#Copyright ReportLab Europe Ltd. 2000-2010 #see license.txt for license details __version__='''$Id: extformat.py 3665 2010-02-09 15:55:45Z rgbecker $''' __doc__='''Apparently not used anywhere, purpose unknown!''' from tokenize import tokenprog import sys def _matchorfail(text, pos): match = tokenprog.match(text, pos...
bsd-3-clause
-2,870,351,378,579,206,700
24.458824
78
0.615527
false
mtausig/RIOT
tests/gnrc_netif/tests/01-run.py
7
8711
#!/usr/bin/env python3 # Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> # Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. ...
lgpl-2.1
4,346,733,464,777,080,300
58.664384
92
0.623924
false
AsherBond/MondocosmOS
grass_trunk/scripts/v.db.droprow/v.db.droprow.py
2
1441
#!/usr/bin/env python ############################################################################ # # MODULE: v.db.droprow # AUTHOR(S): Markus Neteler # Pythonized by Martin Landa # PURPOSE: Interface to v.extract -r to drop ... # COPYRIGHT: (C) 2009 by the GRASS Development Team # # ...
agpl-3.0
3,355,757,292,743,143,400
24.280702
87
0.526024
false
adongy/spreads
spreads/vendor/huey/__init__.py
7
2101
from api import Huey, crontab try: import redis from backends.redis_backend import RedisBlockingQueue from backends.redis_backend import RedisDataStore from backends.redis_backend import RedisEventEmitter from backends.redis_backend import RedisSchedule class RedisHuey(Huey): def __init...
agpl-3.0
-8,652,692,313,373,966,000
38.641509
77
0.621609
false
gxx/andrewcrosio.com
blog/blog/conf/settings.py
1
3058
""" Django settings for blog project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
gpl-2.0
3,182,777,056,244,373,500
23.861789
77
0.713538
false
ctuning/ck-env
module/apk/module.py
2
15053
# # Collective Knowledge (APK entries) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: cTuning foundation, admin@cTuning.org, http://cTuning.org # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) c...
bsd-3-clause
-7,371,507,197,331,777,000
25.133681
119
0.431741
false
janez87/social-knowledge-extractor
test/crawler_test/tweets_chunk_tests.py
2
1042
__author__ = 'marcotagliabue' import unittest from dandelion import DataTXT from utils import mongo_manager import configuration from Model import tweets_chunk class ChunksTest(unittest.TestCase): def setUp(self): # Retrieve all tweets tweets = list(mongo_manager.MongoManager(configuration.db_n...
apache-2.0
-8,622,158,109,543,462,000
32.612903
106
0.631478
false
giserh/coordTransform_py
coordTransform_utils.py
1
4994
# -*- coding: utf-8 -*- import json import requests import math key = 'your key here' # 这里填写你的百度开放平台的key x_pi = 3.14159265358979324 * 3000.0 / 180.0 pi = 3.1415926535897932384626 # π a = 6378245.0 # 长半轴 ee = 0.00669342162296594323 # 扁率 def geocode(address): """ 利用百度geocoding服务解析地址获取位置坐标 :param addres...
mit
-5,559,326,173,723,235,000
27.487654
73
0.530661
false
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/layout_tests/port/win.py
1
4847
# 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-3.0
7,427,172,287,631,490,000
49.489583
161
0.710749
false
TwoFlyLiu/novel
distrib/novel-linux-i386_0.0.1/usr/bin/novel-0.0.1/log.py
3
1731
#!/usr/bin/env python3 import logging, getopt, sys import config as cfg from logging.handlers import RotatingFileHandler FORMATTER = logging.Formatter("%(asctime)s [%(levelname)s]: %(message)s") def config(*args): if len(args) == 0: cmd_args = sys.argv[1:] else: cmd_args = args[0] # 这儿设置根...
gpl-3.0
432,530,988,444,907,970
30.82
150
0.675676
false
dart-lang/sdk
tools/dom/scripts/database.py
2
11954
#!/usr/bin/env python3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """Module to manage IDL files.""" import copy import pickle import logging import o...
bsd-3-clause
733,561,349,666,326,000
33.851312
91
0.617534
false
afrolov1/nova
nova/api/openstack/compute/plugins/v3/migrations.py
29
2172
# 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
-451,041,208,208,691,900
31.41791
78
0.671731
false
Arthaey/anki
aqt/reviewer.py
6
25686
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from __future__ import division import difflib import re import cgi import unicodedata as ucd import HTMLParser from anki.lang import _, ngettext from aqt.qt import * from ...
agpl-3.0
-5,684,123,282,236,373,000
31.888604
102
0.515806
false
matterker/csvkit
tests/test_convert/test_xls.py
21
4335
#!/usr/bin/env python import datetime try: import unittest2 as unittest except ImportError: import unittest import six import xlrd from xlrd.xldate import xldate_from_date_tuple as xldate, xldate_from_time_tuple as xltime, xldate_from_datetime_tuple as xldatetime from csvkit.exceptions import XLSDataError f...
mit
-6,741,753,145,712,667,000
41.920792
195
0.61015
false
vikas-parashar/zulip
zerver/lib/actions.py
1
159321
from __future__ import absolute_import from __future__ import print_function from typing import ( AbstractSet, Any, AnyStr, Callable, Dict, Iterable, Mapping, MutableMapping, Optional, Sequence, Set, Tuple, TypeVar, Union ) from django.utils.translation import ugettext as _ from django.conf import settings fro...
apache-2.0
-3,383,029,409,355,278,000
43.527949
253
0.623226
false
ESS-LLP/erpnext
erpnext/regional/report/gstr_2/gstr_2.py
7
6769
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from datetime import date from erpnext.regional.report.gstr_1.gstr_1 import Gstr1Report def execute(filters=None): return Gstr2Report(filters).r...
gpl-3.0
4,715,858,335,174,644,000
23.614545
89
0.578667
false
D3f0/coreemu
daemon/core/misc/xmlparser.py
4
1267
# CORE # Copyright (c) 2014 The Boeing Company. # See the LICENSE file included in this distribution. from xml.dom.minidom import parse from xmlutils import getoneelement from xmlparser0 import CoreDocumentParser0 class CoreVersionParser(object): '''\ Helper class to check the version of Network Plan document...
bsd-2-clause
-3,061,204,226,982,964,000
34.194444
73
0.662194
false
PressLabs/silver
silver/migrations/0008_auto_20150430_1804.py
2
3210
# Copyright (c) 2015 Presslabs SRL # # 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 writ...
apache-2.0
1,217,616,252,393,458,400
35.067416
107
0.585358
false
mdibaiee/servo
components/script/dom/bindings/codegen/GlobalGen.py
20
2610
# 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/. # We do one global pass over all the WebIDL to generate our prototype enum # and generate information for subsequent pha...
mpl-2.0
-3,315,116,233,648,265,700
30.829268
77
0.675479
false
rmanoni/mi-instrument
mi/core/object.py
2
21665
#!/usr/bin/env python __author__ = 'Adam R. Smith, Michael Meisinger, Tom Lennan' import os import re import inspect from collections import OrderedDict, Mapping, Iterable from mi.core.log import log from mi.core.exceptions import BadRequest BUILT_IN_ATTRS = {'_id', '_rev', 'type_', 'blame_', 'persisted_version'} ...
bsd-2-clause
-5,931,472,128,882,139,000
39.495327
144
0.571152
false
HydrelioxGitHub/home-assistant
homeassistant/components/locative/device_tracker.py
3
1318
""" Support for the Locative platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.locative/ """ import logging from homeassistant.components.device_tracker import \ DOMAIN as DEVICE_TRACKER_DOMAIN from homeassistant.components.loc...
apache-2.0
4,214,745,285,256,520,700
30.380952
74
0.719272
false
Tehsmash/ironic
ironic/netconf.py
2
1590
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
3,006,686,439,345,713,700
31.44898
78
0.683019
false
Giswater/giswater_qgis_plugin
sys_manager.py
1
1247
# -*- coding: utf-8 -*- """ This file is part of Giswater 3 The 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. """ import os import ...
gpl-3.0
-6,133,701,337,317,172,000
25.531915
101
0.626303
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/_network_interfaces_operations.py
1
64223
# 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
6,053,468,105,619,516,000
50.751007
354
0.646015
false
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/test_asyncio/test_events.py
1
102515
"""Tests for events.py.""" import collections.abc import functools import gc import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import threading import time import errno import unittest from unittest import mock ...
mit
5,086,868,112,075,673,000
36.143116
81
0.593347
false
agx/git-buildpackage
gbp/rpm/linkedlist.py
1
5840
# vim: set fileencoding=utf-8 : # # (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com> # 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 # ...
gpl-2.0
7,364,602,028,743,081,000
26.023148
73
0.519616
false
MaastrichtUniversity/irods-ruleset
python/get_user_group_memberships.py
1
2190
@make(inputs=[0, 1], outputs=[2], handler=Output.STORE) def get_user_group_memberships(ctx, show_special_groups, username): """ Get the group membership of a given user Parameters ---------- ctx : Context Combined type of a callback and rei struct. show_special_groups : str 'tru...
gpl-3.0
-5,291,455,098,513,226,000
34.322581
96
0.510959
false
fw1121/bcbio-nextgen
bcbio/rnaseq/featureCounts.py
3
2745
import os from bcbio.utils import (file_exists, get_in, safe_makedir) from bcbio.pipeline import config_utils from bcbio.log import logger from bcbio.bam import is_paired from bcbio.provenance import do from bcbio.distributed.transaction import file_transaction import bcbio.pipeline.datadict as dd try: import pan...
mit
-7,919,623,223,516,557,000
31.294118
87
0.627687
false
Takonan/csc411_a3
keras_nn.py
1
10943
from utils import * # import csutils import theano import yaml import matplotlib.pyplot as plt import numpy as np from keras.models import * from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.optimizers import SGD, RMSprop from keras.layers.convolutional import Convolution2D, MaxPooling2D fro...
bsd-3-clause
886,774,752,257,761,700
36.094915
121
0.629809
false
marscher/mdtraj
MDTraj/tests/performance/test_readwrite.py
1
4297
import os import tempfile import numpy as np from noseperf.testcases import PerformanceTest #from mdtraj import dcd, binpos, trr, netcdf, hdf5 from mdtraj import (XTCTrajectoryFile, TRRTrajectoryFile, DCDTrajectoryFile, BINPOSTrajectoryFile, NetCDFTrajectoryFile, HDF5TrajectoryFile) #############...
lgpl-2.1
-3,462,826,742,070,323,000
29.048951
85
0.605306
false
Manojkumar91/odoo_inresto
addons/account_payment/account_move_line.py
4
4410
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-6,033,715,039,825,717,000
41.403846
84
0.562812
false
japaric/npm2exheres
npm2exheres/validate.py
1
4145
from npm2exheres.print import print_warn import os import re def exist_exheres(pn, pv): exheres_path = '{}/{}-{}.exheres-0'.format(pn, pn, pv) return os.path.exists(exheres_path) def filter_versions(versions, verspec): """ >>> filter_versions(['1.2.2', '1.2.3', '1.2.4', '1.3'], '~>1.2.3') ['1.2....
mit
-8,177,797,979,655,093,000
22.551136
79
0.486128
false
keedio/hue
desktop/core/ext-py/Mako-0.8.1/mako/ext/turbogears.py
38
2108
# ext/turbogears.py # Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re, inspect from mako.lookup import TemplateLookup from mako.template import Template cl...
apache-2.0
1,500,685,392,377,851,000
35.982456
79
0.620493
false
whygee/oppia
core/domain/stats_domain_test.py
15
6143
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
4,395,155,295,401,251,000
42.878571
76
0.661566
false
gbaty/shiboken2
tests/samplebinding/map_test.py
6
2795
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the Shiboken Python Bindings Generator project. # # Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). # # Contact: PySide team <contact@pyside.org> # # This program is free software; you can redistribute it and/or # modify it under the terms...
gpl-2.0
2,183,458,481,055,712,000
36.266667
96
0.649374
false
taigetco/cassandra_read
pylib/cqlshlib/displaying.py
62
3634
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
4,569,019,769,568,256,000
31.446429
78
0.652174
false
makinacorpus/ionyweb
ionyweb/page_app/page_gallery_images/views.py
2
1936
# -*- coding: utf-8 -*- from django.conf import settings from django.shortcuts import get_object_or_404 from django.template import RequestContext from ionyweb.website.rendering.utils import render_view from ionyweb.website.rendering.medias import * from models import Album RENDER_MEDIAS = ( # App CSS CSSMedi...
bsd-3-clause
-655,532,076,070,607,900
32.964912
75
0.578512
false
ashiklom/studyGroup
lessons/RISE/slideUtilities.py
2
2048
from IPython.display import display_html from IPython.display import display import matplotlib.pyplot as plt from IPython.display import HTML import binascii import base64 def hide_code_in_slideshow(): import os uid = binascii.hexlify(os.urandom(8)).decode('UTF-8') html = """<div id="%s"></div> <script...
apache-2.0
327,447,022,830,235,700
31.507937
104
0.626465
false
js0701/chromium-crosswalk
tools/telemetry/telemetry/__init__.py
7
1861
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A library for cross-platform browser tests.""" import os import sys # Ensure Python >= 2.7. if sys.version_info < (2, 7): print >> sys.stderr, 'Need Py...
bsd-3-clause
4,260,652,117,494,071,000
40.355556
78
0.748522
false
hajgato/easybuild-easyblocks
easybuild/easyblocks/o/openssl.py
3
2597
## # Copyright 2009-2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
5,376,023,745,489,699,000
35.577465
103
0.624952
false
theJollySin/mazelib
test/test_generators.py
1
10866
import numpy as np import unittest from mazelib.mazelib import Maze from mazelib.generate.AldousBroder import AldousBroder from mazelib.generate.BacktrackingGenerator import BacktrackingGenerator from mazelib.generate.BinaryTree import BinaryTree from mazelib.generate.CellularAutomaton import CellularAutomaton from maz...
gpl-3.0
5,452,656,329,043,997,000
31.435821
112
0.608043
false
hrishioa/Aviato
flask/Lib/site-packages/nltk/book.py
5
3354
# Natural Language Toolkit: Some texts for exploration in chapter 1 of the book # # Copyright (C) 2001-2015 NLTK Project # Author: Steven Bird <stevenbird1@gmail.com> # # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function from nltk.corpus import (gutenberg, genesis...
gpl-2.0
-6,703,769,327,110,885,000
36.685393
80
0.587657
false
davidwaroquiers/pymatgen
pymatgen/io/abinit/abitimer.py
1
31329
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides objects for extracting timing data from the ABINIT output files It also provides tools to analye and to visualize the parallel efficiency. """ import collections import logging import o...
mit
5,615,313,038,195,150,000
32.471154
119
0.546554
false
frishberg/django
tests/auth_tests/test_admin_multidb.py
12
1496
from django.conf.urls import url from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db import connections from django.test import TestCase, mock, override_settings from django.urls import reverse class Router(object): target_db ...
bsd-3-clause
2,055,074,307,013,647,600
28.92
84
0.639037
false
markovmodel/adaptivemd
adaptivemd/engine/__init__.py
2
1176
############################################################################## # adaptiveMD: A Python Framework to Run Adaptive Molecular Dynamics (MD) # Simulations on HPC Resources # Copyright 2017 FU Berlin and the Authors # # Authors: Jan-Hendrik Prinz # Contributors: # # `adaptiveMD` is free software: ...
lgpl-2.1
8,122,477,913,784,121,000
46.04
78
0.64966
false
Revanth47/addons-server
tests/ui/pages/desktop/base.py
4
1697
from pypom import Page, Region from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains class Base(Page): _url = '{base_url}/{locale}' def __init__(self, selenium, base_url, locale='en-US', **kwargs): super(Base, self).__init__(selenium, base_url, ...
bsd-3-clause
9,104,308,252,170,018,000
32.94
79
0.612257
false
Jmita/ptavi-p3
smallsmilhandler.py
1
2081
from xml.sax import make_parser from xml.sax.handler import ContentHandler class SmallSMILHandler(ContentHandler): def __init__(self): self.lista = [] def startElement(self, name, attrs): if name == "root-layout": self.root_layout = {} self.root_layout['width'] = attr...
apache-2.0
3,023,930,376,117,540,400
32.564516
85
0.519942
false
kholia/pyrpm
tests/rpmgraph.py
1
14571
#!/usr/bin/python # # rpmgraph # # (c) 2005 Thomas Woerner <twoerner@redhat.com> # # version 2005-06-07-01 import sys, os PYRPMDIR = ".." if not PYRPMDIR in sys.path: sys.path.append(PYRPMDIR) import pyrpm import pyrpm.database.memorydb from pyrpm.logger import log def usage(): print """Usage: %s [-h] <rpm n...
gpl-2.0
-6,106,591,619,334,053,000
31.024176
84
0.431611
false
Hybrid-Cloud/cinder
cinder/api/contrib/snapshot_unmanage.py
5
2737
# Copyright 2015 Huawei Technologies Co., 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
-3,679,071,870,225,744,400
35.986486
79
0.678115
false
francisliyy/caravel-aidp
caravel/migrations/versions/27ae655e4247_make_creator_owners.py
3
1155
"""Make creator owners Revision ID: 27ae655e4247 Revises: d8bc074f7aad Create Date: 2016-06-27 08:43:52.592242 """ # revision identifiers, used by Alembic. revision = '27ae655e4247' down_revision = 'd8bc074f7aad' from alembic import op from caravel import db from sqlalchemy.ext.declarative import declarative_base f...
apache-2.0
6,249,852,287,527,510,000
22.1
63
0.697835
false
nham/rust
src/etc/maketest.py
15
2681
# Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or ht...
apache-2.0
5,905,180,420,240,376,000
32.936709
77
0.596046
false
li-ch/pykka
tests/actor_test.py
1
13696
import threading import unittest import uuid from pykka.actor import ThreadingActor from pykka.exceptions import ActorDeadError from pykka.registry import ActorRegistry class AnActor(object): def __init__(self, **events): super(AnActor, self).__init__() self.on_start_was_called = events['on_start...
apache-2.0
-1,672,452,303,989,471,700
37.256983
78
0.63953
false
piyush1911/git-cola
cola/widgets/archive.py
7
8558
from __future__ import division, absolute_import, unicode_literals import os from PyQt4 import QtCore from PyQt4 import QtGui from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL from cola import cmds from cola import core from cola import icons from cola import qtutils from cola.git import git from cola.git ...
gpl-2.0
726,761,229,199,508,500
34.957983
80
0.590091
false
elaOnMars/logya
docs/conf.py
1
7939
# -*- coding: utf-8 -*- # # logya documentation build configuration file, created by # sphinx-quickstart on Sun Sep 8 18:10:11 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
mit
8,130,983,754,686,606,000
30.995968
80
0.703718
false
alexkolar/home-assistant
tests/common.py
6
5290
""" tests.helper ~~~~~~~~~~~~~ Helper method for writing tests. """ import os from datetime import timedelta from unittest import mock from homeassistant import core as ha, loader import homeassistant.util.location as location_util from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import ...
mit
8,768,889,767,843,919,000
25.582915
79
0.612098
false
InUrSys/PescArt2.0
src/srcPlus/SQL_ViewModel.py
1
1264
''' Created on 04/09/2017 @author: chernomirdinmacuvele ''' from PyQt5.Qt import Qt, QSqlRelationalTableModel from PyQt5 import QtSql import QT_msg class viewModel(): def __init__(self, dbcon= None, TblName= None, dictModel=None, filtro=None): self.TblName = TblName self.dictModel = dictModel ...
gpl-3.0
-1,212,956,792,029,076,500
34.083333
116
0.630745
false
bswartz/cinder
cinder/volume/drivers/kaminario/kaminario_common.py
1
21966
# Copyright (c) 2016 by Kaminario Technologies, Ltd. # 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 # #...
apache-2.0
6,486,585,981,483,560,000
41.818713
79
0.566148
false
CVL-GitHub/karaage
karaage/legacy/machines/south_migrations/0017_auto__del_field_account_default_project_tmp__add_field_account_default.py
3
11377
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): depends_on = ( ('projects', '0016_rename_project'), ) def forwards(self, orm): db.rename_column('account', 'default_project_tmp_id', 'default_project_id') def backw...
gpl-3.0
5,145,831,037,399,073,000
83.902985
250
0.548036
false