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
bkbilly/AlarmPI
alarmcode/logs.py
1
8304
#!/usr/bin/env python import re import threading import time from datetime import datetime import pytz import logging logging = logging.getLogger('alarmpi') class Logs(): def __init__(self, wd, logfile, timezone): self.wd = wd self.logfile = logfile try: self.mytimezone = py...
mit
9,113,431,894,522,070,000
36.071429
107
0.486031
false
weichweich/Pi-Timeswitch
Flask-Server/timeswitch/switch/schema.py
1
2441
import logging import time from flask import request from flask_restful import Resource from marshmallow import ValidationError, post_load, validates_schema from marshmallow_jsonapi import Schema, fields from timeswitch.switch.model import (Pin, Sequence, is_absolute_time, is_rela...
mit
4,909,760,856,457,402,000
25.824176
82
0.60508
false
GNOME/orca
test/keystrokes/firefox/line_nav_roledescriptions.py
1
2374
#!/usr/bin/python from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manually. sequence.append(KeyComboAction("<Con...
lgpl-2.1
4,970,380,769,082,865,000
34.432836
70
0.70219
false
cmcqueen/cobs-python
python3/cobs/cobs/_cobs_py.py
1
2890
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 3.x. """ class DecodeError(Exception): pass def _get_buffer_view(in_bytes): mv = memoryview(in_bytes) if mv.ndim > 1 or mv.itemsize > 1: raise BufferError('object must be a single-dimension buffer of bytes.') try: ...
mit
147,667,922,598,717,340
31.111111
86
0.577855
false
kiddinn/plaso
plaso/analysis/viper.py
1
6045
# -*- coding: utf-8 -*- """Analysis plugin to look up files in Viper and tag events.""" from plaso.analysis import hash_tagging from plaso.analysis import logger from plaso.analysis import manager from plaso.containers import events from plaso.lib import errors class ViperAnalyzer(hash_tagging.HTTPHashAnalyzer): "...
apache-2.0
-6,213,781,568,674,037,000
26.352941
79
0.656245
false
mabotech/mabo.io
py/opcda/backup/monitor.py
1
10535
""" import logging import logging.handlers import logging.config logging.config.fileConfig('logging.ini') log = logging.getLogger(__file__) """ import os, sys import subprocess import traceback from singleton import Singleton import simplejson from apscheduler import events from apscheduler.scheduler import...
mit
-5,451,429,152,634,972,000
19.337838
245
0.470242
false
tengqm/senlin
senlin/tests/engine/test_policy_types.py
1
2469
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
apache-2.0
4,855,372,240,069,778,000
36.409091
75
0.592143
false
gregdetre/abracadjabra
abracadjabra/views.py
1
3115
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.models import User from django.db.models import Sum, Count from django.http import Http404 from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from exceptions impor...
mit
-9,047,564,593,219,679,000
44.808824
99
0.614446
false
jgravois/ArcREST
src/arcrest/agol/layer.py
1
54466
""" .. module:: layer :platform: Windows, Linux :synopsis: Class that contians feature service layer information. .. moduleauthor:: Esri """ from .._abstract import abstract from ..security import security import types from ..common import filters from ..common.geometry import SpatialReference from ..common.g...
apache-2.0
-7,880,301,906,038,631,000
42.296502
105
0.482191
false
alphacsc/alphacsc
alphacsc/other/swm.py
1
5148
""" Code adopted from Voytek Lab package neurodsp: https://github.com/voytekresearch/neurodsp/blob/master/neurodsp/shape/swm.py The sliding window matching algorithm identifies the waveform shape of neural oscillations using correlations. """ # Authors: Scott Cole # Mainak Jas <mainak.jas@telecom-paristech.f...
bsd-3-clause
-5,241,638,121,785,414,000
32.428571
79
0.621018
false
Peter-Liang/CodeWars-Python
solutions/Conway_s_Game_of_Life_Unlimited_Edition.py
1
1775
""" Conway's Game of Life - Unlimited Edition http://www.codewars.com/kata/52423db9add6f6fc39000354/train/python """ from copy import deepcopy def get_generation(cells, generations): origin = deepcopy(cells) if generations == 0: return origin if generations > 1: origin = get_generation(or...
mit
7,685,390,107,174,797,000
25.117647
66
0.514366
false
Mercy-Nekesa/sokoapp
sokoapp/tracking/utils.py
1
5688
import re headers = ('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTERED_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') # Back ported from Django trunk # This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # L...
mit
-1,081,139,503,090,599,600
27.582915
94
0.56962
false
pymor/dune-hdd
examples/linearparabolic/morepas3__prepare.py
1
23451
#!/usr/bin/env python2 # # This file is part of the dune-hdd project: # https://github.com/pymor/dune-hdd # Copyright Holders: Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from __future__ import division, print_function import numpy as np from functools import parti...
bsd-2-clause
-5,464,840,250,336,528,000
54.835714
133
0.612255
false
wateraccounting/wa
Collect/MOD9/DataAccess.py
1
12824
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2016 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Collect/MOD9 """ # import general python modules import os import numpy as np import pandas as pd import gdal import urllib import urllib2 from bs4 impor...
apache-2.0
-289,952,064,989,498,560
42.471186
378
0.573456
false
Stbot/PyCrypt
first writes/b64cy.py
1
2516
############################################################################### import b64_mod from binascii import unhexlify ############################################################################### def decode(bstring,flag = 0): """Decode, when flag is set to 0 or not set takes a Base64 strig and converts i...
mit
-6,056,610,221,976,268,000
36
175
0.49841
false
googleapis/python-api-core
tests/unit/test_client_info.py
1
2488
# Copyright 2017 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
-3,570,916,829,049,336,300
27.272727
79
0.64791
false
ItsCalebJones/SpaceLaunchNow-Server
api/v330/spacestation/views.py
1
1860
from rest_framework.viewsets import ModelViewSet from rest_framework.filters import SearchFilter, OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from api.models import * from api.permission import HasGroupPermission from api.v330.spacestation.serializers import SpaceStationDetailedSeriali...
apache-2.0
-6,008,000,186,509,618,000
39.456522
114
0.687634
false
luan-th-nguyen/seisflows_ndt
seisflows/config.py
1
6784
import copy_reg import imp import os import re import sys import types from importlib import import_module from os.path import abspath, join, exists from seisflows.tools import msg from seisflows.tools.err import ParameterError from seisflows.tools import unix from seisflows.tools.tools import loadjson, loadobj, loa...
bsd-2-clause
-5,586,993,668,159,306,000
26.803279
406
0.627064
false
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
1
38185
# Copyright (c) 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # Copyright (c) 2010 Research In Motion Limited. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are...
gpl-3.0
7,722,090,757,548,807,000
44.840336
229
0.618934
false
ChristophKirst/ClearMap
ClearMap/IO/NRRD.py
1
20940
#!/usr/bin/env python # encoding: utf-8 """ Interface to NRRD volumetric image data files. The interface is based on nrrd.py, an all-python (and numpy) implementation for reading and writing nrrd files. See http://teem.sourceforge.net/nrrd/format.html for the specification. Example: >>> import os, numpy >>> ...
gpl-3.0
-2,766,026,941,562,460,000
31.009174
117
0.596542
false
weidongxu84/info-gatherer
django/contrib/auth/tests/models.py
1
3906
from django.conf import settings from django.test import TestCase from django.contrib.auth.models import (Group, User, SiteProfileNotAvailable, UserManager) class ProfileTestCase(TestCase): fixtures = ['authtestdata.json'] def setUp(self): """Backs up the AUTH_PROFILE_MODULE""" self.old_A...
mit
-7,884,866,480,122,510,000
38.857143
81
0.666155
false
rplevka/robottelo
tests/foreman/cli/test_katello_agent.py
1
11216
"""CLI tests for ``katello-agent``. :Requirement: Host :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: Katello-agent :Assignee: gtalreja :TestType: Functional :CaseImportance: High :Upstream: No """ import time import pytest from broker import VMBroker from robottelo.api.utils import wait_for...
gpl-3.0
-6,850,693,793,248,222,000
32.783133
98
0.684647
false
mdevaev/slog
src/remote.py
1
1202
# -*- mode: python; coding: utf-8; -*- import dbus import dbus.service, dbus.mainloop.glib class Remote: def __init__(self): bus = dbus.SessionBus() slog_obj = bus.get_object("org.LightLang.SLog", "/SLog") self.iface = dbus.Interface(slog_obj, "org.LightLang.SLogInterface") def __spy_toggle(self): self.if...
gpl-2.0
-6,164,688,821,272,691,000
24.041667
70
0.682196
false
ovnicraft/server-tools
base_locale_uom_default/tests/test_res_lang.py
1
1605
# -*- coding: utf-8 -*- # Copyright 2017 LasLabs Inc. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestResLang(TransactionCase): def setUp(self): super(TestResLang, self).setUp() se...
agpl-3.0
4,553,754,772,150,179,000
35.477273
69
0.61433
false
jabumaho/MNIST-neural-network
network.py
1
3424
import numpy as np def sgm(x, derivative=False): if not derivative: return 1/(1+np.exp(-x)) else: return sgm(x) * (1 - sgm(x)) def linear(x, derivative=False): if not derivative: return x else: return 1 class NeuralNetwork: layerCount = 0 shape = None weights = [] layerTransfe...
gpl-3.0
-1,273,426,215,257,752,800
28.035088
133
0.645736
false
danclaudiupop/pyhackernews
hn/core.py
1
6927
import os import urwid import subprocess import ConfigParser from hnapi import HN from datetime import datetime _config = None class HNStory(object): def __init__(self, i, story): self.index = i + 1 self.story = story @property def story_number(self): index = str(self.index) ...
mit
871,114,213,341,966,000
28.857759
76
0.529955
false
arulalant/mmDiagnosis
diagnosis1/extra/dirty/MULTIPLE PLOTS/por_landscape_2x3.py
1
2203
import cdms2 import cdutil import numpy import numpy.ma import vcs import os import sys import por_template_2x3_landscape as por_lanscape_2x3 x = por_lanscape_2x3.x iso=x.createisofill('new1', 'ASD') iso.levels = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] #([1, 5, 10, 15, 20, 25, 35, 45, 55, 60, 65, 70, 80]) #is...
gpl-3.0
-1,482,070,405,860,495,400
31.880597
125
0.552429
false
cedricpradalier/vrep_ros_ws
src/ar_loc_base/src/ar_loc_base/rover_pf.py
1
4147
import roslib; roslib.load_manifest('ar_loc_base') import rospy from numpy import * from numpy.linalg import pinv, inv from math import pi, sin, cos from geometry_msgs.msg import * import tf import bisect import threading from rover_kinematics import * class RoverPF(RoverKinematics): def __init__(self, initial_po...
bsd-3-clause
2,330,022,787,027,257,000
32.991803
96
0.592235
false
agrc/deq-enviro
api/Deq.Search.Soe/PublishSoe.py
1
1322
import requests host = 'localhost' configuration = 'Debug' service_name = 'DEQEnviro/MapService' token_url = 'http://{}:6080/arcgis/admin/generateToken'.format(host) update_soe_url = 'http://{}:6080/arcgis/admin/services/types/extensions/update'.format( host) upload_url = 'http://{}:6080/arcgis/admin/uploads/uplo...
mit
7,601,712,418,277,422,000
24.921569
97
0.645991
false
nblago/utils
src/model/BBFit.py
1
66521
# -*- coding: utf-8 -*- """ Created on Thu Feb 22 10:57:34 2018 Class that enables to fit a black body function to a set of magntidues. @author: nadiablago @version: 0.22 """ from __future__ import print_function import matplotlib from matplotlib import pylab as plt import corner from astropy import units as u impo...
mit
-9,118,717,144,658,973,000
39.41373
196
0.504743
false
disco-framework/disco
priv/general/components/gui/gui.py
1
18070
#!/usr/bin/python import sys from PyQt4 import QtCore, QtGui from ui_mainview import Ui_MainWindow import json from jsonreader import JsonReader ################################################## class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, pare...
apache-2.0
-6,686,924,166,606,951,000
38.714286
124
0.639236
false
au9ustine/elrond
elrond/aws/s3.py
1
3432
import os import json import threading import boto3 from boto3.s3.transfer import S3Transfer from elrond.crypto import get_file_digest DEFAULT_CHUNK_SIZE = 64 * 1024 * 1024 ELROND_S3_SINGLETON_CLIENT = None ELROND_S3_SUPPORTED_REGIONS = [ 'EU', 'eu-west-1', 'us-west-1', 'us-west-2', 'ap-south-1'...
mit
4,340,258,530,075,880,400
27.363636
74
0.586247
false
cerrno/neurokernel
examples/timing/run_gpu_slow.py
2
1898
#!/usr/bin/env python """ Run timing test (GPU) scaled over number of ports. """ import csv import glob import multiprocessing as mp import os import re import subprocess import sys import numpy as np from neurokernel.tools.misc import get_pids_open try: from subprocess import DEVNULL except ImportError: i...
bsd-3-clause
5,892,850,443,696,471,000
26.507246
80
0.53372
false
hsoft/pluginbuilder
pluginbuilder/util.py
1
12467
import os, sys, zipfile, time from modulegraph.find_modules import PY_SUFFIXES from modulegraph.modulegraph import os_listdir import macholib.util def os_path_islink(path): """ os.path.islink with zipfile support. Luckily zipfiles cannot contain symlink, therefore the implementation is trivial. ""...
mit
2,080,846,094,289,265,200
30.722646
87
0.562365
false
jimcarreer/hpack
setup.py
1
1691
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Get the version version_regex = r'__version__ = ["\']([^"\']*)["\']' with open('hpack/__init__.py', 'r') as f: text = f.read() match = r...
mit
-773,770,130,712,185,600
29.196429
95
0.608516
false
CliMT/climt-future
climt/_lib/rrtmg_lw/setup.py
1
2948
from setuptools import setup, Extension from Cython.Distutils import build_ext # This line only needed if building with NumPy in Cython file. from numpy import get_include from os import system import os # compile the fortran modules without linking module_list = [ 'parkind.f90', 'parrrtm.f90', 'rrlw_cld.f...
bsd-3-clause
-8,972,440,418,118,426,000
25.8
80
0.637042
false
hachreak/invenio-accounts
invenio_accounts/models.py
1
5487
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
gpl-2.0
6,014,488,001,262,512,000
31.087719
76
0.659194
false
khertan/KhtNotes
khtnotes/merge3/merge3.py
1
18192
# Copyright (C) 2005-2010 Canonical Ltd # # 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 distribute...
gpl-3.0
-2,084,280,794,020,240,600
34.952569
79
0.484883
false
tschalch/pyTray
src/setup.py
1
6933
#!/usr/bin/env python #this installer script uses InnoSetup to generate a complete Installer from distutils.core import setup import py2exe import os, os.path, sys import glob #adding lib directory to module search path libpath = os.path.abspath(os.path.dirname(sys.argv[0])) + "/lib" sys.path.append(os.path.abs...
bsd-3-clause
2,843,598,152,450,568,700
34.298429
116
0.492572
false
tdegeus/GooseEYE
docs/examples/clusters_dilate_periodic.py
1
2926
r''' Plot and/or check. Usage: script [options] Options: -s, --save Save output for later check. -c, --check Check against earlier results. -p, --plot Plot. -h, --help Show this help. ''' # <snippet> import numpy as np import GooseEYE # generate image I = np.zeros((21, 21)...
gpl-3.0
-889,297,396,052,922,000
25.125
89
0.520164
false
NovikovMA/python_training_mantis
test/test_project_del.py
1
3996
# -*- coding: utf-8 -*- __author__ = 'M.Novikov' from model.project import Project # Проекты Mantis from random import randrange # Случайности import random # Случайнос...
apache-2.0
2,116,186,601,909,424,000
76.714286
127
0.563725
false
drupdates/Slack
__init__.py
1
1072
""" Send report using Slack. """ from drupdates.settings import Settings from drupdates.utils import Utils from drupdates.constructors.reports import Report import json, os class Slack(Report): """ Slack report plugin. """ def __init__(self): current_dir = os.path.dirname(os.path.realpath(__file__)) ...
mit
81,357,146,827,252,450
33.580645
72
0.616604
false
maxime-beck/compassion-modules
mobile_app_connector/mappings/compassion_project_mapping.py
1
8179
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2018 Compassion CH (http://www.compassion.ch) # @author: Quentin Gigon <gigon.quentin@gmail.com> # # The licence is in the file __manifest__.py # ############################################...
agpl-3.0
-3,517,541,789,825,772,000
50.11875
79
0.595183
false
RudolfCardinal/pythonlib
cardinal_pythonlib/wsgi/headers_mw.py
1
4487
#!/usr/bin/env python # cardinal_pythonlib/headers_mw.py """ =============================================================================== Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (...
apache-2.0
8,220,256,760,036,851,000
32.992424
79
0.592378
false
simonzhangsm/voltdb
tests/sqlcoverage/config/all-config.py
1
15894
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2018 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
agpl-3.0
3,054,152,486,480,809,000
54.573427
152
0.57355
false
aep124/TwitterAnalyticsTools
textonly.py
1
2405
# this is a script to retrieve and process text-only data for classification # This process includes four main tasks # 1) getting raw tweets # 2) apply labels (this step can be conducted at any time) # 2) filtering those tweets (e.g., according to CMU POS tagger) # 3) deriving a set of features (a.k.a. wo...
mit
2,456,822,204,111,772,700
24.585106
116
0.642827
false
daicang/Leetcode-solutions
146-lru-cache.py
1
1792
class DLNode(object): def __init__(self): self.key = None self.value = None self.prev = None self.next = None class LRUCache(object): def __init__(self, capacity): """ :type capacity: int """ self.head = DLNode() self.tail = DLNode() ...
mit
3,490,341,262,473,513,000
19.363636
40
0.497768
false
brettchien/LeetCode
9_PalindromeNumber.py
1
3651
class Solution: # @param {integer} x # @return {boolean} def isPalindrome(self, x): if x < 0: return False if x > 0 and x % 10 == 0: return False reverse = 0 while x > reverse: reverse = reverse * 10 + x % 10 x /= 10 ret...
mit
3,103,546,097,456,922,600
26.870229
54
0.398247
false
felipemontefuscolo/bitme
get_bitmex_candles.py
1
4122
#!/usr/bin/env python import sys import time import swagger_client from swagger_client.rest import ApiException from utils.utils import smart_open import argparse import pandas as pd MAX_NUM_CANDLES_BITMEX = 500 def print_file(file_or_stdout, api_instance, bin_size, partial, symbol, reverse, start_time, end_time)...
mpl-2.0
-6,723,906,315,588,768,000
35.157895
119
0.562591
false
google/makani
avionics/network/network_config.py
1
19633
# Copyright 2020 Makani Technologies 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...
apache-2.0
6,779,570,442,275,803,000
30.36262
103
0.629247
false
Oslandia/qgis-swmm
SwmmAlgorithm.py
1
21125
# -*- coding: utf-8 -*- """ *************************************************************************** SwmmAlgorithm.py --------------------- Date : December 2013 Copyright : (C) 2013 by Vincent Mora Email : vincent dot mora dot mtl at gmail dot com ******...
gpl-2.0
8,211,793,255,597,314,000
48.940898
141
0.62097
false
LibrePCB/LibrePCB
tests/funq/libraryeditor/conftest.py
1
1156
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest library = 'libraries/Populated Library.lplib' @pytest.fixture def library_editor(librepcb, helpers): """ Fixture opening the library editor with an empty library """ librepcb.add_local_library_to_workspace(path=library) with librepcb.op...
gpl-3.0
-901,900,597,603,947,900
33
77
0.684256
false
pengkobe/leetcode
questions/Regular_Expression_Matching.py
1
6170
# -*- coding: utf-8 -*- # 本题难度:★★★ # 实现一个正则表达式引擎,让其支持匹配 . 和 *,其中: # . 匹配任何单字符 # * 匹配 0 个或者多个前字符 # 需要匹配全部输入而非部分输入,函数格式如下: # bool isMatch(const char *s, const char *p) # 如: # isMatch('aa', 'a') // false # isMatch('aa', 'aa') // true # isMatch('aaa', 'aa') // false # isMatch('aa', 'a*') // true # isMatch('aa', '.*') //...
gpl-3.0
-772,837,806,286,783,600
29.136126
106
0.442669
false
MisanthropicBit/bibpy
examples/requirements_check.py
1
1795
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Example of checking the requirements of bibtext and biblatex.""" import bibpy from bibpy.tools import get_abspath_for def format_requirements_check(required, optional): s = "" if required: s = "required field(s) " + ", ".join(map(str, required)) ...
mit
8,251,867,451,367,847,000
31.636364
78
0.578273
false
syci/ingadhoc-odoo-addons
partner_views_fields/res_config.py
1
1176
# -*- coding: utf-8 -*- from openerp import fields, models class partner_configuration(models.TransientModel): _inherit = 'base.config.settings' group_ref = fields.Boolean( "Show Reference On Partners Tree View", implied_group='partner_views_fields.group_ref', ) group_user_id = fi...
agpl-3.0
5,898,531,089,247,119,000
34.636364
65
0.654762
false
safwanrahman/kuma
kuma/urls.py
1
2694
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.static import serve from django.views.generic import RedirectView from kuma.attachments import views as attachment_views from kuma.core import views as core_views from kuma.wiki.admin import pu...
mpl-2.0
-7,610,912,507,910,773,000
25.673267
74
0.59614
false
carthach/essentia
test/src/unittests/rhythm/test_onsetdetection.py
1
5977
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
agpl-3.0
-5,361,231,174,398,711,000
41.091549
105
0.621047
false
malt1/lutris
tests/test_installer.py
1
1700
from unittest import TestCase from lutris.installer import ScriptInterpreter, ScriptingError class MockInterpreter(ScriptInterpreter): """ a script interpreter mock """ script = {'runner': 'linux'} def is_valid(self): return True class TestScriptInterpreter(TestCase): def test_script_with_c...
gpl-3.0
-5,782,265,075,609,909,000
33
72
0.594118
false
jossgray/zyrecffi
zyrecffi/_cffi.py
1
3231
from cffi import FFI import os, sys ffi = FFI() ffi.cdef(''' // zsock.h typedef struct _zsock_t zsock_t; // zmsg.h typedef struct _zmsg_t zmsg_t; int zmsg_addstr (zmsg_t* self, const char* string); char* zmsg_popstr (zmsg_t* self); // zyre.h typedef struct _zyre_t zyre_t; zyre_t* zyre_new (const char *name); ...
gpl-3.0
5,003,882,334,878,248,000
21.444444
104
0.665738
false
cwisecarver/osf.io
api/base/serializers.py
1
58011
import collections import re import furl from django.core.urlresolvers import resolve, reverse, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from django.utils import six from rest_framework import exceptions, permissions from rest_framework import serializers as ser from rest_framework.field...
apache-2.0
3,039,951,152,254,714,000
37.725634
289
0.597076
false
yakky/djangocms-text-ckeditor
djangocms_text_ckeditor/forms.py
1
3464
# -*- coding: utf-8 -*- from django import forms from django.core import signing from django.core.signing import BadSignature from django.forms.models import ModelForm from django.template import RequestContext from django.utils.translation import ugettext from cms.models import CMSPlugin from .models import Text fro...
bsd-3-clause
-7,001,191,991,926,625,000
29.928571
76
0.633661
false
SanPen/GridCal
src/research/PTDF/ACPTDF_research2.py
1
14022
# This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in the hope that...
gpl-3.0
2,332,068,375,098,212,400
31.234483
120
0.590857
false
Yubico/yubikey-manager
ykman/cli/fido.py
1
24461
# Copyright (c) 2018 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
bsd-2-clause
-6,043,912,827,052,858,000
32.010796
88
0.589346
false
kobotoolbox/kobocat
onadata/apps/logger/tests/test_briefcase_client.py
1
6934
# coding: utf-8 import os.path from io import StringIO, BytesIO from urllib.parse import urljoin import requests from django.contrib.auth import authenticate from django.core.files.storage import get_storage_class from django.core.files.uploadedfile import UploadedFile from django.urls import reverse from django.test ...
bsd-2-clause
5,599,805,507,777,540,000
37.098901
78
0.62792
false
mmlab/eice
EiCGraphAlgo/core/typeahead.py
1
4270
''' Created on 17-sep.-2012 @author: ldevocht ''' import urllib.parse, lxml.objectify, logging, configparser, re, ujson, requests from core.resourceretriever import Resourceretriever from core import resourceretriever, config_search config = resourceretriever.config mappings = resourceretriever.mappings logger = loggi...
agpl-3.0
-1,328,228,545,254,396,400
45.423913
131
0.52623
false
gaeun/open-event-orga-server
app/api/helpers/utils.py
1
7209
import json from hashlib import md5 from flask import request from flask.ext.restplus import Resource as RestplusResource from flask_restplus import Model, fields, reqparse from app.helpers.data import update_version from app.models.event import Event as EventModel from .error_docs import ( notfound_error_model, ...
gpl-3.0
3,571,529,669,562,688,000
30.207792
88
0.625468
false
wradlib/wradlib
wradlib/tests/test_adjust.py
1
7916
#!/usr/bin/env python # Copyright (c) 2011-2020, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import numpy as np import pytest from wradlib import adjust class Data: # Arguments to be used throughout all test classes raw_x, raw_y = np.meshgrid(np.arange(4).astype("...
mit
893,179,589,196,588,400
27.47482
84
0.456544
false
forkbong/qutebrowser
qutebrowser/misc/backendproblem.py
1
17440
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-8,716,777,097,984,474,000
37.669623
84
0.585722
false
maxivanoff/fftoolbox-app
q/fftoolbox/multipole.py
1
12213
import logging import numpy as np from copy import deepcopy from numpy.linalg import norm from scipy.special import sph_harm as Y mult_logger = logging.getLogger('multipole') def Rlm(l, m, r, theta, phi): return r**l * np.sqrt(4 * np.pi / (2 * l + 1)) * Y(m, l, theta, phi) def Rlmc(l, m, r, theta, phi): retu...
gpl-2.0
6,099,882,326,194,920,000
33.794872
372
0.524032
false
woobe/h2o
py/testdir_multi_jvm/test_rf_1ktrees_job_cancel_many_fvec.py
1
2219
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_jobs, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost()...
apache-2.0
-7,085,951,831,473,397,000
37.258621
141
0.604777
false
juliosmelo/soldo
utils/settings.py
1
1331
PGS_TOKEN = 'C888EE7F420841CF92D0B0063EDDFC7D' PGS_EMAIL = 'pagseguro@panfleteria.com.br' # from datetime import datetime # from datetime import date # from datetime import timedelta # dates = [d0] # dates_two = list() # def date_paginator(x, y): # print x, y # if pages == 1 and pages_mods == 0: # _date =...
mit
1,225,591,867,755,594,800
23.666667
80
0.574005
false
MichaelAnckaert/Hermes
message.py
1
1631
"""Message functionality for Hermes""" from datetime import datetime import json __author__ = "Michael Anckaert" __copyright__ = "Copyright 2012, Michael Anckaert" __credits__ = ["Michael Anckaert"] __license__ = "GPLv3" __version__ = "0.0.1" __maintainer__ = "Michael Anckaert" __email__ = "michael.anckaert@sinax.be"...
gpl-3.0
2,294,136,335,230,464,300
27.12069
132
0.591048
false
DedMemez/ODS-August-2017
suit/SuitDNA.py
1
7589
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.suit.SuitDNA from panda3d.core import Datagram, DatagramIterator, VBase4 import random from direct.directnotify.DirectNotifyGlobal import * from toontown.toonbase import TTLocalizer, ToontownGlobals import random from direct.distributed.PyDatagra...
apache-2.0
5,145,229,808,531,475,000
21.501548
90
0.548557
false
normanjaeckel/OpenSlides
server/tests/integration/motions/test_polls.py
1
53361
from decimal import Decimal import pytest from django.conf import settings from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from openslides.core.config import config from openslides.motions.models import Motion, ...
mit
-2,000,771,081,450,811,000
39.090909
88
0.603287
false
tswast/google-cloud-python
videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py
1
14088
# -*- coding: utf-8 -*- # # Copyright 2019 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...
apache-2.0
-8,513,084,120,351,419,000
45.039216
156
0.626704
false
BeeeOn/server
t/restui/t1007-types-list-detail.py
1
10281
#! /usr/bin/env python3 import config config.import_libs() import unittest import socket import json from rest import GET, POST, PUT, DELETE class TestTypesListDetail(unittest.TestCase): """ Create a session for testing. """ def setUp(self): req = POST(config.ui_host, config.ui_port, "/auth") req.body(confi...
bsd-3-clause
227,601,853,684,804,400
32.271845
94
0.654897
false
fusionbox/django-darkknight
darkknight/forms.py
1
4549
import re import os from django import forms from django.db import transaction from django.utils.translation import ugettext as _ from django.forms.formsets import BaseFormSet from localflavor.us.us_states import US_STATES from django_countries import countries from OpenSSL import crypto from darkknight.models import...
bsd-2-clause
-862,029,955,554,943,000
31.963768
111
0.591778
false
debian789/suescunet
apps/codigos/admin.py
1
1478
from django.contrib import admin from models import mdl_codigos from apps.elementos_comunes.models import mdl_lenguaje,mdl_sistema_operativo from actions import export_as_csv ## crea el listado de opciones en el administrado !!! class codigosAdmin(admin.ModelAdmin): list_display = ('titulo','lenguaje','archivo','i...
gpl-2.0
5,772,595,188,927,756,000
31.152174
85
0.747632
false
tliron/ronin
ronin/sdl/__init__.py
1
4444
# Copyright 2016-2018 Tal Liron # # 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 writin...
apache-2.0
-7,181,409,825,519,541,000
41.730769
98
0.649865
false
jeremiah-c-leary/vhdl-style-guide
vsg/tests/sequential/test_rule_006.py
1
1193
import os import unittest from vsg.rules import sequential from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_006_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTestDi...
gpl-3.0
3,324,378,810,418,496,500
24.934783
106
0.678122
false
tvotyakov/codeeval
easy/hidden-digits/code.py
1
1115
#!python3 def hidden_digits(in_str): '''(string) -> string Finds all visible and hidden digits in the in_str string and return them out in order of their appearance as one string. >>> hidden_digits('abcdefghik') '012345678' >>> hidden_digits('Xa,}A#5N}{xOBwYBHIlH,#W') '05' >...
gpl-2.0
8,614,142,024,831,928,000
25.875
67
0.510314
false
acjones617/k-means
lib/exec.py
1
1524
import normalize as n import cluster as c import jsonpickle as j import argparse import ast parser = argparse.ArgumentParser() parser.add_argument('matrix') parser.add_argument('options') args = parser.parse_args() matrix = ast.literal_eval(args.matrix) options = ast.literal_eval(args.options) # steps: # 1. norma...
mit
4,464,520,530,550,727,700
24.4
78
0.727034
false
mlperf/training_results_v0.7
Google/benchmarks/ssd/implementations/ssd-research-TF-tpu-v4-512/ssd_main.py
1
11062
# Copyright 2018 Google. 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 applicable law or agree...
apache-2.0
66,469,063,065,002,300
35.388158
90
0.653679
false
openwebcc/ba
maintenance/rawdata/als/hef/071011_hef14_fix_ala.py
1
2755
#!/usr/bin/python # # fix incorrect syntax for echoes in .ala files of 071011_hef14 # import re import os import sys sys.path.append('/home/institut/rawdata/www/lib') from Laser.Util import las if __name__ == '__main__': """ fix incorrect return number and number of returns for given pulse syntax """ import ...
gpl-3.0
-4,989,434,933,116,422,000
33.873418
120
0.536116
false
google/retiming
models/networks.py
1
16657
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
2,665,017,518,263,958,500
44.386921
117
0.576514
false
samirelanduk/pygtop
pygtop/targets.py
1
14667
"""Contains target-specific objects and functions.""" from . import gtop from . import pdb from .interactions import Interaction, get_interaction_by_id from .exceptions import NoSuchTargetError, NoSuchTargetFamilyError from .shared import DatabaseLink, Gene, strip_html def get_target_by_id(target_id): """Returns ...
mit
6,307,949,579,907,811,000
30.678186
115
0.628281
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/Fuse/main_generator_SMD.py
1
13644
# -*- coding: utf8 -*- #!/usr/bin/python # # This is derived from a cadquery script for generating PDIP models in X3D format # # from https://bitbucket.org/hyOzd/freecad-macros # author hyOzd # This is a # Dimensions are from Microchips Packaging Specification document: # DS00000049BY. Body drawing is the same as QFP g...
gpl-2.0
-5,632,057,004,259,708,000
38.547826
141
0.591469
false
kalyptorisk/daversy
src/daversy/db/oracle/index.py
1
3580
from daversy.utils import * from daversy.db.object import Index, IndexColumn class IndexColumnBuilder(object): """ Represents a builder for a column in an index. """ DbClass = IndexColumn XmlTag = 'index-column' Query = """ SELECT c.column_name, lower(c.descend) AS sort, i.index_name, ...
gpl-2.0
1,298,916,235,426,265,300
35.907216
95
0.569832
false
patrick91/pycon
backend/notifications/aws.py
1
2184
import typing from urllib.parse import urljoin import boto3 from django.conf import settings from newsletters.exporter import Endpoint from users.models import User def _get_client(): return boto3.client("pinpoint", region_name="eu-central-1") def chunks(l, n): for i in range(0, len(l), n): yield l...
mit
7,613,541,312,755,594,000
27.736842
87
0.642399
false
jcushman/pywb
pywb/rewrite/cookie_rewriter.py
1
4929
from Cookie import SimpleCookie, CookieError #================================================================= class WbUrlBaseCookieRewriter(object): """ Base Cookie rewriter for wburl-based requests. """ def __init__(self, url_rewriter): self.url_rewriter = url_rewriter def rewrite(self, co...
gpl-3.0
-1,616,446,436,483,166,000
31.006494
75
0.564212
false
colloquium/spacewalk
client/solaris/smartpm/smart/interfaces/gtk/interactive.py
1
31919
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
-5,670,332,782,027,367,000
37.135006
88
0.556534
false
qbuat/tauperf
old/eff_tools/DecisionTool.py
1
2103
from ROOT import TMVA from array import array from rootpy.extern import ordereddict import logging log = logging.getLogger('DecisionTool') class DecisionTool: def __init__(self,tree,name,weight_file,var_file,cutval): """ A class to handle the decision of the BDT""" TMVA.Tools.Instance() s...
gpl-3.0
-3,456,458,913,760,876,500
30.863636
67
0.514503
false
bioconda/bioconda-utils
bioconda_utils/bot/chat.py
1
5842
""" Chat with the bot via Gitter """ import asyncio import logging from typing import Any, Dict, List import aiohttp from .. import gitter from ..gitter import AioGitterAPI from .commands import command_routes logger = logging.getLogger(__name__) # pylint: disable=invalid-name """ https://webhooks.gitter.im/e/b9e...
mit
7,395,101,836,971,723,000
40.432624
96
0.566587
false
reshanie/roblox.py
roblox/asset.py
1
12222
""" Copyright (c) 2017 James Patrick Dill, reshanie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
mit
-1,756,698,657,007,532,500
28.708543
115
0.58722
false
jcsp/manila
manila/tests/scheduler/fakes.py
1
12546
# Copyright 2011 OpenStack LLC. # 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
4,470,534,704,318,130,700
48.588933
78
0.492428
false
corredD/upy
transformation.py
1
68489
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2013, Christoph Gohlke # Copyright (c) 2006-2013, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifica...
gpl-3.0
-2,078,898,188,954,768,100
33.503778
83
0.578706
false
bepress/xavier
xavier/taskqueue.py
1
2517
""" Offline Manager for Xavier """ import logging import jsonpickle logger = logging.getLogger(__name__) class Task(object): def __init__(self, func): self.func = func self.path = '%s.%s' % (func.__name__, func.__module__) self.publish_event = None def __call__(self, *args, **kwargs...
mit
-8,391,339,796,450,315,000
26.064516
98
0.594358
false
zestrada/nova-cs498cc
nova/cells/manager.py
1
15722
# Copyright (c) 2012 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
-814,845,744,529,827,200
42.551247
78
0.596871
false
rapidpro/tracpro
tracpro/orgs_ext/tests/test_forms.py
1
15878
from __future__ import unicode_literals import datetime import mock from django.core.exceptions import NON_FIELD_ERRORS from django.forms import model_to_dict from django.test import TestCase from django.test import override_settings from django.utils.timezone import now from tracpro.orgs_ext.forms import FetchRunsF...
bsd-3-clause
-6,527,262,072,748,828,000
41.568365
93
0.617836
false
gitcommitpush/django-mailtrail
runtests.py
1
1253
#!/usr/bin/env python import os import sys import subprocess import django from coverage import coverage from django.conf import settings from django.test.utils import get_runner FLAKE8_ARGS = ['mailtrail', 'tests/', '--ignore=E501'] def exit_on_failure(command, message=None): if command: sys.exit(comma...
mit
252,067,481,946,622,180
24.06
76
0.630487
false