repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MediaSapiens/autonormix | django/db/models/sql/subqueries.py | 12 | 8069 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures... | bsd-3-clause | 7,945,840,975,774,572,000 | 35.346847 | 121 | 0.602305 | false | 4.202604 | false | false | false |
gannetson/sportschooldeopenlucht | apps/wallposts/admin.py | 1 | 4136 | from bluebottle.bluebottle_utils.utils import set_author_editor_ip
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from apps.wallposts.models import SystemWallPost
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin
from sorl.thumbnail.admin.com... | bsd-3-clause | 2,185,696,457,530,789,000 | 37.654206 | 128 | 0.679884 | false | 3.716083 | false | false | false |
cneill/designate | functionaltests/common/datagen.py | 1 | 3476 | """
Copyright 2015 Rackspace
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
dist... | apache-2.0 | 3,209,893,692,409,349,000 | 31.185185 | 79 | 0.655926 | false | 3.690021 | false | false | false |
REGOVAR/Sandbox | benchs/db/sandbox/poc_003.py | 1 | 8367 | #!env/python3
# coding: utf-8
import os
import sys
import datetime
import sqlalchemy
import subprocess
import reprlib
import time
from progress.bar import Bar
from sqlalchemy import Table, Column, Integer, String, Boolean, ForeignKey, Sequence, UniqueConstraint, Index, func
from sqlalchemy.orm import relationship, Se... | agpl-3.0 | 3,227,470,087,078,721,000 | 33.854167 | 245 | 0.63044 | false | 2.895119 | false | false | false |
clubit/edi-workflow | edi_routes_essers_pclo/wizard/essers_pclo_import.py | 1 | 1364 | import base64
import time, datetime
import csv, StringIO
from itertools import groupby
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
import logging
_logger = logging.getLogger(__name__)
class essers_pclo_import(osv.osv_memory):
_name = 'essers.pclo.import'
... | agpl-3.0 | -6,468,374,991,903,993,000 | 30 | 106 | 0.616569 | false | 3.589474 | false | false | false |
bitmovin/bitcodin-python | bitcodin/test/job/testcase_create_job_deinterlace.py | 1 | 2347 | __author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest
from bitcodin import create_job
from bitcodin import create_input
from bitcodin import create_encoding_profile
from bitcodin import delete_input
from bitcodin import delete_encoding_profile
from bitcodin import Job
from bitcodin import Input
f... | unlicense | 160,885,671,615,673,950 | 34.029851 | 99 | 0.666809 | false | 3.797735 | true | false | false |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/bct/algorithms/physical_connectivity.py | 1 | 5266 | from __future__ import division, print_function
import numpy as np
def density_dir(CIJ):
'''
Density is the fraction of present connections to possible connections.
Parameters
----------
CIJ : NxN np.ndarray
directed weighted/binary connection matrix
Returns
-------
kden : fl... | mit | -8,067,741,869,885,309,000 | 32.75641 | 78 | 0.638625 | false | 3.76681 | false | false | false |
hydroffice/hyo_soundspeed | hyo2/soundspeed/profile/dicts.py | 1 | 5767 | from collections import OrderedDict
import logging
logger = logging.getLogger(__name__)
class Dicts:
@classmethod
def first_match(cls, dct, val):
# print(dct, val)
values = [key for key, value in dct.items() if value == val]
if len(values) != 0:
return values[0]
... | lgpl-2.1 | 4,308,491,181,944,239,600 | 20.599251 | 75 | 0.403329 | false | 3.00052 | false | false | false |
mtholder/taxalotl | taxalotl/sem_graph/graph.py | 1 | 13901 | #!/usr/bin/env python
from __future__ import print_function
import json
import logging
from .taxon_concept_node import TaxonConceptSemNode
from .verbatim_name import VerbatimSemNode
from .names_for_ranks import (GenusGroupSemNode,
HigherGroupSemNode,
Specimen... | bsd-2-clause | 9,101,075,027,773,117,000 | 35.970745 | 115 | 0.556291 | false | 3.430652 | false | false | false |
Brig13Team/Operation_Kerberos | tools/make.py | 1 | 58710 | #!/usr/bin/env python3
# vim: set fileencoding=utf-8 :
# make.py
# An Arma 3 addon build system
###############################################################################
# The MIT License (MIT)
# Copyright (c) 2013-2014 Ryan Schultz
# Permission is hereby granted, free of charge, to any person obtaining a co... | gpl-3.0 | 4,553,427,663,966,882,000 | 38.296519 | 227 | 0.564837 | false | 4.050293 | true | false | false |
FrodeSolheim/fs-uae-launcher | launcher/ws/wsiconwidget.py | 1 | 2386 | from fsui import Font, Panel
class IconWidget(Panel):
ICON_WIDGET_WIDTH = 120
ICON_WIDGET_HEIGHT = 100
def __init__(
self, parent, *, label, icon, selected_icon=None, textcolor=None
):
super().__init__(parent)
self.set_size(
(IconWidget.ICON_WIDGET_WIDTH, IconWidge... | gpl-2.0 | -6,509,956,065,345,226,000 | 33.085714 | 82 | 0.597653 | false | 3.513991 | false | false | false |
marcoitur/FreeCAD | src/Mod/PartDesign/Scripts/Gear.py | 29 | 10175 | #Involute Gears Generation Script
#by Marcin Wanczyk (dj_who)
#(c) 2011 LGPL
import FreeCAD, FreeCADGui, Part, Draft, math, MeshPart, Mesh
from PySide import QtGui,QtCore
App=FreeCAD
Gui=FreeCADGui
def proceed():
try:
compute()
except:
hide()
QtGui.qApp.restoreOverrideCursor()
def co... | lgpl-2.1 | -7,510,394,522,662,491,000 | 33.375 | 287 | 0.642948 | false | 3.112573 | false | false | false |
CityGenerator/Megacosm-Generator | megacosm/oneliners.py | 1 | 21173 | from flask import render_template, request
from megacosm.generators import Artwork
from megacosm.generators import Bond
from megacosm.generators import Curse
from megacosm.generators import Resource
from megacosm.generators import Rumor
from megacosm.generators import Flaw
from megacosm.generators import Misfire
from m... | gpl-2.0 | -7,365,125,080,069,798,000 | 36.342152 | 119 | 0.606763 | false | 3.74677 | false | false | false |
iftekeriba/softlayer-python | SoftLayer/tests/managers/ticket_tests.py | 3 | 2823 | """
SoftLayer.tests.managers.ticket_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
class TicketTests(testing.TestCase):
def set_up(self):
self.ticket = SoftLayer.TicketMan... | mit | 4,796,578,618,074,613,000 | 34.734177 | 75 | 0.565356 | false | 4.127193 | true | false | false |
zylpascal/forum_django | forum/settings.py | 1 | 3234 | """
Django settings for forum project.
Generated by 'django-admin startproject' using Django 1.10a1.
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/
"""
import os
# ... | gpl-3.0 | 4,407,761,704,426,886,700 | 24.666667 | 91 | 0.684601 | false | 3.492441 | false | false | false |
cherstewart/heroprotocol | heroprotocol/cmdline.py | 1 | 7709 | #!/usr/bin/env python
#
# Copyright (c) 2015 Blizzard Entertainment
#
# 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, co... | mit | -7,726,134,100,376,205,000 | 35.535545 | 99 | 0.653911 | false | 4.318768 | false | false | false |
atalax/wytch | examples/loginform.py | 1 | 1835 | #! /usr/bin/env python3
#
# Copyright (c) 2015 Josef Gajdusek
#
# 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, mo... | mit | 1,895,534,158,076,336,000 | 41.674419 | 97 | 0.699728 | false | 3.752556 | false | false | false |
ldomic/lintools | lintools/analysis/salt_bridges.py | 1 | 11492 | import os
from rdkit import Chem
from collections import namedtuple, defaultdict
import numpy as np
import MDAnalysis
from timeit import default_timer as timer
import maths_functions as math
class SaltBridges(object):
"""This module analyses salt bridges between protein and ligand. A salt bridge is defined
as ... | gpl-3.0 | -1,801,268,972,086,654,700 | 62.491713 | 201 | 0.611382 | false | 3.979224 | false | false | false |
monicalzn/DrawMe | Documents/compiladores/Drawme/MemoryAdministrator.py | 1 | 6267 | from memory import Memory
from stack import Stack
class MemoryAdministrator:
def __init__(self):
self.constants_int = []
self.constants_float = []
self.constants_str = []
self.actionPointer = Stack()
self.globals = Memory()
self.main = Memory()
self.currentScope = 0
self.functions = dict()
def cons... | mit | -2,476,583,786,382,289,400 | 28.422535 | 133 | 0.682783 | false | 2.820432 | false | false | false |
givanaldo/invesalius3 | invesalius/data/viewer_slice.py | 3 | 47785 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: ... | gpl-2.0 | 407,647,484,376,521,900 | 36.924603 | 108 | 0.559653 | false | 3.82433 | false | false | false |
neutrons/FastGR | addie/help_handler/help_gui.py | 1 | 3347 | from __future__ import (absolute_import, division, print_function)
from qtpy.QtWidgets import (QMainWindow)
from addie.utilities import load_ui
from addie.help_handler.help_gui_table_initialization import HelpGuiTableInitialization
class HelpGui(QMainWindow):
'''
button_name = ['autonom', 'ndabs', 'scans', '... | mit | 2,865,293,408,460,738,000 | 34.231579 | 92 | 0.607708 | false | 3.436345 | false | false | false |
mathurtx/jyoti-cy | jyoti_content_service/repository/migrations/0001_initial.py | 1 | 1769 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-01 21:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Locati... | mit | 2,286,934,722,302,274,300 | 36.638298 | 83 | 0.546637 | false | 4.357143 | false | false | false |
joedursun/pytineye | pytineye/api_request.py | 1 | 8404 | # -*- coding: utf-8 -*-
"""
api_request.py
Provides authentication with the TinEye API server.
For more information see https://services.tineye.com/developers/tineyeapi/authentication.html
Copyright (c) 2015 Idée Inc. All rights reserved worldwide.
"""
import hmac
import mimetools
import sys
import time
import urll... | mit | -1,211,642,914,218,331,000 | 33.297959 | 104 | 0.590265 | false | 4.287245 | false | false | false |
cchurch/ansible | lib/ansible/modules/network/iosxr/iosxr_lacp.py | 1 | 5844 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | gpl-3.0 | 1,843,571,066,512,024,000 | 18.810169 | 92 | 0.569644 | false | 3.347079 | true | false | false |
dshyshov/MAVProxy | MAVProxy/modules/mavproxy_modegpio.py | 1 | 4224 |
#!/usr/bin/env python
'''mode command handling'''
import time, os
from pymavlink import mavutil
import pingo
board = pingo.detect.MyBoard()
btn_mode_land = board.pins[7]
btn_mode_auto = board.pins[8]
btn_mode_fbwa = board.pins[9]
btn_mode_circle = board.pins[10]
btn_mode_rtl = board.pins[11]
led_mode_land = boar... | gpl-3.0 | 8,222,594,929,687,274,000 | 25.904459 | 80 | 0.560606 | false | 3.080963 | false | false | false |
cosmo-ethz/CosmoHammer | cosmoHammer/util/MpiUtil.py | 1 | 2727 | import itertools
import os
from cosmoHammer import getLogger
import time
# If mpi4py is installed, import it.
try:
from mpi4py import MPI
MPI = MPI
except ImportError:
MPI = None
class MpiPool(object):
"""
Implementation of a mpi based pool. Currently it supports only the map function.
:p... | gpl-3.0 | -3,269,928,217,573,892,600 | 30.709302 | 110 | 0.611661 | false | 3.906877 | false | false | false |
pyblish/pyblish-softimage | pyblish_softimage/lib.py | 1 | 1980 | # Standard library
import os
import contextlib
# Pyblish libraries
import pyblish.api
import pyblish_integration
# Local libraries
import plugins
Application = globals()["Application"]
show = pyblish_integration.show
def setup(console=False):
"""Setup integration
Registers Pyblish for Maya plug-ins and ap... | lgpl-3.0 | -495,693,177,918,365,630 | 22.023256 | 76 | 0.649495 | false | 3.666667 | false | false | false |
dark-lbp/isf | icssploit/protocols/enip.py | 1 | 61472 | #! /usr/bin/env python
# coding:utf-8
from scapy.all import conf
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import TCP, UDP
from icssploit.protocols.cip import CIPHeader
ENIP_COMMANDS = {
0x0000: "NOP",
0x0004: "List Services",
0x0063: "List Identity",
0x0064: "List I... | bsd-2-clause | 1,720,355,070,672,393,000 | 40.367429 | 116 | 0.663945 | false | 2.300599 | false | false | false |
yutkin/News-Aggregator | web_server/parsers/Lenta.py | 2 | 2500 | import requests
import datetime
import logging
import datetime
import re
from bs4 import BeautifulSoup
from .BaseParser import BaseParser
import time
from multiprocessing import cpu_count
class Lenta(BaseParser):
def __init__(self, threads=cpu_count()*2-1):
super(Lenta, self).__init__(
'LEN... | mit | -1,839,790,003,325,187,300 | 34.225352 | 84 | 0.5608 | false | 3.396739 | false | false | false |
mfnch/pyrtist | pyrtist/lib2deep/sculpt.py | 1 | 1820 | # Copyright (C) 2017 Matteo Franchin
#
# This file is part of Pyrtist.
# Pyrtist 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
# (at your option) any late... | lgpl-2.1 | -6,683,927,240,991,764,000 | 31.5 | 76 | 0.662637 | false | 3.625498 | false | false | false |
KJin99/zulip | confirmation/views.py | 122 | 1412 | # -*- coding: utf-8 -*-
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com>
__revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $'
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.conf import settings
from confirmation.models import Confirm... | apache-2.0 | 8,747,018,825,413,551,000 | 31.837209 | 82 | 0.654391 | false | 3.795699 | false | false | false |
talkowski-lab/Holmes | pycluster/cluster.py | 2 | 9036 |
from __future__ import division
import sys
import numpy as np
import pdb
class Cluster(object):
def __init__(self, data, reads=None, samples=None):
self.chrA = data[0]
self.startA = int(data[1])
self.endA = int(data[2])
self.chrB = data[3]
self.startB = int(data[4])
... | mit | 1,253,240,983,401,045,800 | 28.821782 | 85 | 0.5 | false | 3.577197 | false | false | false |
dimkarakostas/project-euler | problem_33.py | 1 | 1139 | from time import time
import fractions
def digit_cancel():
digit_cancelling_fractions = []
for numerator in range(10, 100):
for denominator in range(numerator+1, 100):
if not (numerator % 10 or denominator % 10):
continue
frac = fractions.Fraction(numerator, den... | mit | -7,466,765,532,145,656,000 | 31.542857 | 97 | 0.562774 | false | 4.1875 | false | false | false |
NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse numérique/Conditionnement/gaussElimination.py | 2 | 2193 | # -*- coding: utf-8 -*-
"""
This module calculates a linear system by Gaussian elimination with pivoting.
Almost a copy of on Mike Zingale's code, spring 2013.
"""
import numpy as npy
import os
def gaussElim(A, b):
""" perform gaussian elimination with pivoting, solving A x = b A
is an NxN matri... | gpl-3.0 | -6,760,691,800,443,175,000 | 27.855263 | 81 | 0.54446 | false | 3.3379 | false | false | false |
FedoraScientific/salome-kernel | src/KERNEL_PY/salome_study.py | 1 | 14655 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | lgpl-2.1 | -2,904,193,869,133,300,700 | 33.892857 | 102 | 0.607506 | false | 3.721432 | false | false | false |
liuguanyu/evparse | lib/entry.py | 1 | 5865 | # -*- coding: utf-8 -*-
# entry.py, part for evparse : EisF Video Parse, evdh Video Parse.
# evparse:lib/entry: evparse main lib entry.
# version 0.1.4.0 test201505251453
# author sceext <sceext@foxmail.com> 2009EisF2015, 2015.05.
# copyright 2015 sceext
#
# This is FREE SOFTWARE, released under GNU GPLv3+
# please... | gpl-3.0 | 8,862,132,385,469,039,000 | 28.331658 | 74 | 0.63166 | false | 2.886746 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/hotshot/stats.py | 1 | 2053 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: stats.py
"""Statistics analyzer for HotShot."""
import profile
import pstats
import hotshot.log
from hotshot.log import ENTER, EXIT
def load(filenam... | unlicense | -1,911,640,998,722,707,700 | 24.04878 | 67 | 0.562104 | false | 3.712477 | false | false | false |
pauljohnleonard/MusicBox | attic/thirdparty/srcMMA/MMA/miditables.py | 1 | 7175 |
# miditables.py
"""
This module is an integeral part of the program
MMA - Musical Midi Accompaniment.
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 op... | gpl-2.0 | 4,355,336,779,693,831,000 | 42.484848 | 73 | 0.65324 | false | 2.716774 | false | false | false |
RCIX/RogueP | logic/menu_manager.py | 1 | 1580 | from enum import Enum
from menu import Menu
class MenuStatus(Enum):
Okay = 1
Exit = 2
# master game state and flow manager
# updates and draws the topmost menu from a stack of menus
class MenuManager:
def __init__(self, start_menu):
self.menus=[]
self.menus.append(start_menu)
# update loop for menus
# also... | mit | 3,462,969,893,923,903,000 | 33.369565 | 154 | 0.707595 | false | 3.558559 | false | false | false |
flynx/pli | doc/examples/pli_functional.py | 1 | 2215 | #=======================================================================
__version__ = '''0.0.01'''
__sub_version__ = '''20040825201035'''
__copyright__ = '''(c) Alex A. Naanou 2003'''
#-----------------------------------------------------------------------
'''
this example illustrates a functional loop t... | bsd-3-clause | 6,052,201,563,364,136,000 | 33.725806 | 100 | 0.456885 | false | 4.012681 | false | false | false |
BryanQuigley/sos | sos/report/plugins/openstack_octavia.py | 1 | 3825 | # This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | gpl-2.0 | 4,006,273,389,626,434,000 | 31.692308 | 79 | 0.547974 | false | 3.867543 | true | false | false |
belokop-an/agenda-tools | code/MaKaC/webinterface/pages/authors.py | 1 | 4043 | from xml.sax.saxutils import quoteattr
from MaKaC.webinterface.pages.conferences import WPConferenceDefaultDisplayBase
from MaKaC.webinterface import wcomponents, navigation, urlHandlers
from MaKaC.errors import MaKaCError
from MaKaC.common import Config
class WAuthorDisplay(wcomponents.WTemplated):
def __in... | gpl-2.0 | -5,303,267,263,277,783,000 | 46.011628 | 208 | 0.620826 | false | 3.726267 | false | false | false |
erreur404/Gnubiquity | robot/NaoApplication.py | 1 | 4936 | import sys
import math
import time
import os
from Features.Move import *
from Features.Arm import *
from Features.Stop import *
from Features.Head import *
from Features.Rest import *
from Features.Stand import *
from Features.PhotoCapture import *
from naoqi import ALProxy
from naoqi import ALBroker
from naoqi import... | gpl-2.0 | -8,285,822,098,578,655,000 | 31.051948 | 81 | 0.526742 | false | 3.634757 | false | false | false |
api0cradle/Empire | lib/listeners/http_hop.py | 2 | 21739 | import base64
import random
import os
import errno
# Empire imports
from lib.common import helpers
from lib.common import agents
from lib.common import encryption
from lib.common import packets
from lib.common import messages
class Listener:
def __init__(self, mainMenu, params=[]):
self.info = {
... | bsd-3-clause | 2,141,683,010,831,439,600 | 44.195426 | 260 | 0.515985 | false | 4.540309 | false | false | false |
MooseDojo/apt2 | core/events.py | 1 | 4988 | import Queue
import time
from threading import Thread
class ActiveThreadListItem():
def __init__(self, thread, name):
self.thread = thread
self.name = name
def getThread(self):
return self.thread
def getName(self):
return self.name
class EventObject():
def __init__(... | mit | 4,171,671,237,175,484,000 | 29.414634 | 115 | 0.577586 | false | 4.348736 | false | false | false |
byxor/limp | tests/integration/standard_library/looping_test.py | 1 | 1084 | import limp
import limp.environment as Environment
from nose.tools import assert_equal
from unittest.mock import MagicMock
from tests.syntax import *
from limp.standard_library.loops import *
FUNCTION_NAME = 'my_function'
ARBITRARY_ITERATION_LIMIT = 100
def test_executing_something_a_fixed_number_of_times():
fo... | gpl-3.0 | 2,528,200,842,999,528,400 | 35.133333 | 85 | 0.733395 | false | 3.699659 | false | false | false |
iu-hpfs/zester | lovinfo.py | 1 | 6332 | #!/usr/bin/env python2
# Copyright [2017], The Trustees of Indiana University. Licensed under the
# GNU General Public License Version 2 (see included COPYING.TXT). You
# may not use this file except in compliance with the License. Unless
# required by applicable law or agreed to in writing, software distributed
# und... | gpl-2.0 | 5,598,089,988,341,972,000 | 33.413043 | 140 | 0.65856 | false | 3.19798 | false | false | false |
beniwohli/apm-agent-python | elasticapm/utils/cgroup.py | 1 | 4432 | # BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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, t... | bsd-3-clause | 2,810,033,636,795,195,000 | 40.420561 | 123 | 0.661778 | false | 3.53429 | false | false | false |
google-research/falken | service/learner/brains/action_postprocessor.py | 1 | 9003 | # Copyright 2021 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 | 4,392,880,178,924,691,500 | 37.639485 | 80 | 0.686993 | false | 4.066396 | false | false | false |
ttlttl/fang | app/models.py | 1 | 5618 | # -*- coding=UTF-8 -*-
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
from . import db, login_manager
class User(UserMixin,db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
email = db.C... | apache-2.0 | -2,959,320,776,201,280,500 | 35.322368 | 90 | 0.622101 | false | 3.237537 | false | false | false |
Dunlain/home_auto | core/views.py | 1 | 2858 | # Stack Packages
from pyramid.httpexceptions import HTTPMethodNotAllowed, HTTPFound
from pyramid.renderers import render
from pyramid.response import Response
# Home Automation Packages
from core.models import List, ListCategory
from .models import User
class BaseView(object):
"""
Delegates HTTP requests to V... | mit | 3,526,519,192,348,113,400 | 27.306931 | 98 | 0.623513 | false | 4.343465 | false | false | false |
paultcochrane/pyvisi | pyvisi/renderers/vtk/ellipsoid_plot.py | 1 | 10357 | # Copyright (C) 2004-2008 Paul Cochrane
#
# 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 distribut... | gpl-2.0 | 3,953,808,201,462,481,400 | 35.597173 | 79 | 0.605967 | false | 4.241196 | false | false | false |
patrickhoefler/linked-data-wizards | ldva/urls.py | 1 | 3987 | """
Copyright (C) 2014 Kompetenzzentrum fuer wissensbasierte Anwendungen und Systeme
Forschungs- und Entwicklungs GmbH (Know-Center), Graz, Austria
office@know-center.at
This program 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 ... | agpl-3.0 | -5,252,402,226,826,814,000 | 30.148438 | 80 | 0.654377 | false | 3.378814 | true | false | false |
soldag/home-assistant | homeassistant/components/monoprice/config_flow.py | 10 | 4234 | """Config flow for Monoprice 6-Zone Amplifier integration."""
import logging
from pymonoprice import get_async_monoprice
from serial import SerialException
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_PORT
from .const import (
CONF_SOURC... | apache-2.0 | 8,556,773,037,657,071,000 | 27.608108 | 86 | 0.637222 | false | 3.905904 | true | false | false |
chop-dbhi/ehb-datasources | ehb_datasources/drivers/exceptions.py | 1 | 1444 | class RecordDoesNotExist(Exception):
def __init__(self, url, path, record_id):
self.url = url
self.record_id = record_id
self.errmsg = 'No record(s) found for record_id(s)' + \
str(record_id) + ' at ' + str(url) + ':' + str(path)
class RecordCreationError(Exception):
def __... | bsd-2-clause | 1,145,451,477,164,484,600 | 30.391304 | 77 | 0.577562 | false | 3.565432 | false | false | false |
YufeiZhang/Principles-of-Programming-Python-3 | Labs/lab10/fully_parenthesised.py | 1 | 2863 | import re
from array_stack import ArrayStack, EmptyStackError
from binary_tree import BinaryTree
def parse_tree(expression):
'''
Checks whether a expression is a valid fully parentherised infix expression,
and in case the answer is yes, returns a parse tree for the expression.
>>> parse_tree('100').... | gpl-3.0 | -9,128,842,204,646,743,000 | 23.681034 | 86 | 0.450576 | false | 4.167394 | false | false | false |
DinoCow/airflow | tests/providers/amazon/aws/hooks/test_ses.py | 10 | 2275 | # 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 | -5,764,040,868,421,689,000 | 31.971014 | 104 | 0.70022 | false | 3.494624 | true | false | false |
neudesk/neucloud | openstack_dashboard/dashboards/admin/volumes/tests.py | 1 | 4062 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 | -5,543,413,753,986,897,000 | 42.212766 | 79 | 0.589857 | false | 4.349036 | true | false | false |
hfp/libxsmm | samples/deeplearning/sparse_training/fairseq/fairseq/binarizer.py | 1 | 3354 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from collections import Counter
from fairseq.tokenizer import tokenize_line
import torch
from fairseq.file_io import PathManager
d... | bsd-3-clause | -8,837,528,565,166,712,000 | 31.25 | 84 | 0.493143 | false | 4.311054 | false | false | false |
qe-team/marmot | marmot/preprocessing/parse_xml.py | 1 | 3404 | import sys
from xml.dom.minidom import parseString
import numpy as np
from subprocess import Popen, PIPE
import os
class Correction:
def __init__(self, _start, _end, _type, _id):
self.start = _start
self.end = _end
self.type = _type.replace(' ','_')
self.id = _id
def parse_line( line ):
'''parse a... | isc | -4,689,785,903,012,213,000 | 32.048544 | 137 | 0.606052 | false | 3.311284 | false | false | false |
rajivpant/employeeware | orgchartapp/admin.py | 1 | 1468 | from django.contrib import admin
from orgchartapp.models import Employee
from orgchartapp.models import ReportingRelationship
#class ReportingRelationshipInlineSupervisors(admin.StackedInline):
class ReportingRelationshipInlineSupervisors(admin.TabularInline):
model = ReportingRelationship
fk_name = 'employee'
e... | mit | -4,333,497,357,230,895,000 | 36.641026 | 97 | 0.756812 | false | 3.478673 | false | false | false |
oblalex/isotopic-logging | tests/test_context.py | 1 | 11180 | # -*- coding: utf-8 -*-
import itertools
import time
import threading
import unittest
from six.moves import range
from isotopic_logging.context import (
InjectionContext, InjectionLocalStack, direct_injector, static_injector,
auto_injector, hybrid_injector,
)
from isotopic_logging.injectors import Autoprefix... | lgpl-3.0 | 3,901,529,587,840,700,000 | 31.690058 | 80 | 0.565027 | false | 3.953324 | true | false | false |
d-fan/pysb | pysb/tools/render_species.py | 3 | 5216 | #!/usr/bin/env python
"""
Usage: ``python -m pysb.tools.render_species mymodel.py > mymodel.dot``
Renders the species from a model into the "dot" graph format which can be
visualized with Graphviz.
To create a PDF from the .dot file, use the Graphviz tools in the following
command pipeline::
ccomps -x mymodel.do... | bsd-2-clause | -4,182,931,127,979,094,500 | 38.515152 | 80 | 0.566334 | false | 3.760634 | false | false | false |
Melamoto/ML-Melody-Co-composition | methods/rhythm_melody.py | 1 | 5076 | # -*- coding: utf-8 -*-
"""
Combines the existing melody and rhythm processing methods to form complete
melody processing
"""
import rhythm_hmm as rh
import long_rhythm_distance as lrd
import todd_ann as mel
import numpy as np
import midi
import time
from copy import deepcopy
import pdb
import pickle
class TrackDataS... | mit | -3,233,619,630,553,521,000 | 35.007092 | 103 | 0.600473 | false | 3.144981 | false | false | false |
apple/swift-llbuild | bindings/python/llbuild.py | 1 | 10444 | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of ... | apache-2.0 | -1,657,545,026,854,262,500 | 31.6375 | 79 | 0.668422 | false | 3.615092 | false | false | false |
google/tf-quant-finance | tf_quant_finance/math/random_ops/stateless_test.py | 1 | 6376 | # Lint as: python3
# 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 or agr... | apache-2.0 | -1,269,151,210,869,751,300 | 48.046154 | 95 | 0.682089 | false | 3.783976 | true | false | false |
azylstra/impy | impy/gui/widgets/Table_View.py | 1 | 6271 | # impy - a post-processor for HYADES implosion simulations
# Copyright (c) Massachusetts Institute of Technology / Alex Zylstra
# Distributed under the MIT License
__author__ = 'Alex Zylstra'
import tkinter as tk
import tkinter.font as tkFont
import tkinter.ttk as ttk
import platform
def __sortby__(tree, col, descen... | mit | -4,482,836,889,175,733,000 | 38.696203 | 119 | 0.627013 | false | 3.723872 | false | false | false |
wvxvw/intj | intj/patches.py | 1 | 2400 | # Patches
# Maybe I'll need this, we'll see
# import py2neo
from py2neo.packages.httpstream.jsonstream \
import (AwaitingData, UnexpectedCharacter, Tokeniser, EndOfStream)
# _Entity = py2neo.neo4j._Entity
# entity_patch_ftype = type(_Entity.get_properties)
def _read_digit(self):
pos = self.data.tell()
try:... | mit | -2,045,443,401,489,824,000 | 28.268293 | 70 | 0.535 | false | 3.960396 | false | false | false |
rootulp/hackerrank | python/matrix.py | 1 | 2999 | #!/bin/python3
import math
import os
import random
import re
import sys
# Let's use an adapted form of Kruskal.
# 1. Construct a set for each city.
# 2. Iterate through edges in descending order of "cost to destroy".
# 3. If the edge connects two machines, we must destroy it so add to total time.
# If the edge doe... | mit | 6,934,153,658,004,700,000 | 29.520408 | 80 | 0.590438 | false | 3.360674 | false | false | false |
fabric-bolt/fabric-bolt | fabric_bolt/accounts/views.py | 10 | 3931 | """
Deployment User Views
"""
from django.contrib import auth, messages
from django.contrib.auth.views import redirect_to_login
from django.core.urlresolvers import reverse, reverse_lazy
from django.shortcuts import redirect
from django.views.generic.base import TemplateView
from django.views.generic import UpdateView... | mit | -4,771,910,466,411,093,000 | 32.598291 | 180 | 0.703129 | false | 3.872906 | false | false | false |
nickgaya/python2 | python2/client/codec.py | 1 | 1623 | import weakref
from python2.client.object import Py2Object
from python2.shared.codec import BaseDecodingSession, BaseEncodingSession
class ClientCodec():
def __init__(self, client):
self.client = weakref.proxy(client)
def encoding_session(self):
return ClientEncodingSession(self.client)
... | mit | -8,257,129,393,696,341,000 | 30.211538 | 78 | 0.613678 | false | 4.237598 | false | false | false |
abarisain/mopidy | tests/http/test_events.py | 1 | 1575 | from __future__ import unicode_literals
import json
import mock
import unittest
try:
import cherrypy
except ImportError:
cherrypy = False
try:
import ws4py
except ImportError:
ws4py = False
if cherrypy and ws4py:
from mopidy.http import actor
@unittest.skipUnless(cherrypy, 'cherrypy not found'... | apache-2.0 | -458,041,563,913,532,160 | 28.166667 | 72 | 0.586667 | false | 3.697183 | true | false | false |
Nikea/VisTrails | vistrails/packages/spreadsheet/spreadsheet_registry.py | 2 | 4076 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | bsd-3-clause | 6,814,246,669,865,428,000 | 38.192308 | 80 | 0.607458 | false | 4.946602 | false | false | false |
kooksee/TIOT | test/project/router/common/util.py | 1 | 8218 | # encoding=utf-8
import binascii
from pipe import Pipe
# 判断列表的值是否和集合的一样
@Pipe
def isList_set(kist):
if isinstance(kist, list):
return kist == list(set(kist))
print "参数:列表"
return
# print [1,2,3,1] | is_list_set#False
# print [1,2,3] | is_list_set #True
# print "www" | is_list_set
... | gpl-2.0 | -8,208,586,695,138,560,000 | 22.181818 | 99 | 0.538265 | false | 2.485152 | false | false | false |
andyclymer/ControlBoard | Examples/Components/ServoMotor.py | 1 | 1472 | from mojo.events import addObserver, removeObserver, postEvent
import vanilla
class ServoDemo:
"""
ControlBoard
"Servo" component demo
Set a servo motor to the angle of a potentiometer.
"""
def __init__(self):
# The name of the sensor (the potentiometer) ... | mit | 7,701,526,882,149,594,000 | 31.021739 | 90 | 0.558424 | false | 3.914894 | false | false | false |
gert-janwille/dot | dot/modules/games/Hangman.py | 1 | 6229 | import time
import random
import dot.common.ui as ui
from dot.common.constants import *
class Hangman():
def __init__(self):
print "Starting game..."
time.sleep(1)
self.core_game()
def generateProcess(self, word):
chars = len(word)
temp = []
for char in range(... | gpl-3.0 | -8,312,879,322,148,624,000 | 33.994382 | 112 | 0.312891 | false | 4.2403 | false | false | false |
midnightercz/pulp_docker | plugins/pulp_docker/plugins/importers/upload.py | 1 | 6275 | import contextlib
from gettext import gettext as _
import json
import os
import stat
import tarfile
from pulp.plugins.util.publish_step import PluginStep, GetLocalUnitsStep
from pulp_docker.common import constants, tarutils
from pulp_docker.plugins.db import models
from pulp_docker.plugins.importers import sync
cla... | gpl-2.0 | 1,947,014,518,004,968,700 | 36.801205 | 93 | 0.593466 | false | 4.268707 | false | false | false |
vFense/vFenseAgent-nix | agent/daemon/agentd.py | 1 | 3899 | #!/usr/bin/env python
import os
import os.path
import sys
import time
import shlex
import signal
import subprocess
PIDFILE = '/tmp/vfense_agent.pid'
PATH='/opt/vFense/agent/'
VFENSEAGENT = 'agent.py'
PROGRAM = '/opt/vFense/agent/bin/python'
# Return codes
# If changes are made here, please update them in:
# serverope... | lgpl-3.0 | 1,522,556,601,102,856,700 | 25.705479 | 77 | 0.553732 | false | 3.518953 | false | false | false |
JordanP/openstack-snippets | gerrit-review-cleaner/gerrit_review_cleaner.py | 1 | 4505 | #!/usr/bin/env python
import argparse
import asyncio
import json
import logging
import os
import sys
import traceback
import urllib
from pulsar.apps import http
from pulsar.apps.http import HTTPDigestAuth
from pulsar.utils import exceptions
from pulsar.utils.httpurl import Headers
class GerritSession(http.HttpClient... | apache-2.0 | -7,675,626,281,065,050,000 | 32.37037 | 77 | 0.623973 | false | 4.051259 | false | false | false |
samatdav/zulip | zerver/lib/i18n.py | 18 | 2638 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import operator
from django.conf import settings
from django.utils import translation
from django.utils.translation import ugettext as _
from six.moves import urllib, zip_longest, zip, range
from typing import Any, List, Dict, Optional, Text
import os
im... | apache-2.0 | -5,158,464,667,597,045,000 | 31.567901 | 80 | 0.593252 | false | 3.795683 | false | false | false |
Kyria/LazyBlacksmith | lazyblacksmith/utils/sso.py | 1 | 6440 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import
from flask import flash
from flask import json
from flask import redirect
from flask import request
from flask import session
from flask import url_for
from flask_login import login_user
from flask_login import logout_user
from requests.utils im... | bsd-3-clause | 7,014,906,998,422,335,000 | 28.813397 | 97 | 0.619565 | false | 4.022486 | false | false | false |
yubang/blog | windPlug/core/browser.py | 1 | 2706 | # coding:UTF-8
"""
处理访问的浏览器类型
@author: yubang
"""
import re
def get_browser_data():
"""
获取浏览器信息
:return: dict
"""
datas = [
{'name': '360浏览器', 'key': '360SE'},
{'name': 'UC浏览器', 'key': 'UCWEB'},
{'name': 'UC浏览器', 'key': 'UCBrowser'},
{'name': 'QQ浏览器', 'key': 'QQ... | apache-2.0 | 3,521,597,488,167,812,600 | 26.344444 | 62 | 0.525203 | false | 2.523077 | false | false | false |
atbj505/Python3.0 | chapter9.py | 1 | 3500 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#函数式编程
#函数式编程的特点是,允许把函数本身作为参数传入另一个函数,还允许返回一个函数
#高阶函数
#变量指向函数,函数名称可以看成一个变量 例如abs()的函数名abs就可以看作一个变量
f = abs
print(f)
print(f(-10))
#函数名也是变量
def add(x, y, f):
return f(x) + f(y)
print(add(-10, 10, abs))
#map/reduce
#map()函数接收两个参数,一个是函数,一个是Iterable,map将传入的函数依次作用到序列的每个元... | mit | -3,945,336,102,344,277,000 | 17.626582 | 91 | 0.598232 | false | 1.792809 | false | false | false |
endolith/numpy | numpy/__init__.py | 2 | 10875 | """
NumPy
=====
Provides
1. An array object of arbitrary homogeneous items
2. Fast mathematical operations over arrays
3. Linear Algebra, Fourier Transforms, Random Number Generation
How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the c... | bsd-3-clause | 5,389,611,167,287,707,000 | 34.308442 | 92 | 0.638345 | false | 4.181084 | true | false | false |
rjschwei/azure-sdk-for-python | azure-graphrbac/azure/graphrbac/models/ad_group.py | 1 | 1613 | # 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 ... | mit | -1,064,356,745,412,148,700 | 36.511628 | 110 | 0.588965 | false | 4.114796 | false | false | false |
yijingping/loganalyzer | loganalyzer/apps/nginxlog/migrations/0001_initial.py | 1 | 2414 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'accesstime'
db.create_table('nginxlog_accesstime', (
('id', self.gf('django.db.m... | bsd-3-clause | -7,815,050,214,984,823,000 | 51.5 | 139 | 0.579536 | false | 3.478386 | false | false | false |
mesoscloud/events | 0.5.6/docker.py | 2 | 1100 | """docker"""
import http.client
import json
import socket
__all__ = ['HTTPConnection', 'HTTPError', 'get']
class HTTPConnection(http.client.HTTPConnection):
def __init__(self):
http.client.HTTPConnection.__init__(self, 'localhost')
def connect(self):
sock = socket.socket(socket.AF_UNIX, so... | mit | -9,170,760,431,765,998,000 | 21.44898 | 68 | 0.581818 | false | 4.059041 | false | false | false |
Bachmann1234/marshmallow | examples/flask_example.py | 7 | 4184 | import datetime
from flask import Flask, jsonify, request
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import IntegrityError
from marshmallow import Schema, fields, ValidationError, pre_load
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:////tmp/quotes.db'
db = SQLAlchemy(app... | mit | 6,127,497,916,400,435,000 | 30.938931 | 82 | 0.641491 | false | 3.585261 | false | false | false |
MK-IV/plugin.program.mkiv | lib/dropbox_api.py | 1 | 7997 | import re
import urllib
import urllib2
import json
import log_utils
USER_AGENT = 'TVA Dropbox API'
API_HOST = 'api.dropboxapi.com'
WEB_HOST = "www.dropbox.com"
API_CONTENT_HOST = 'content.dropboxapi.com'
API_NOTIFICATION_HOST = 'notify.dropboxapi.com'
API_VERSION = 1
_OAUTH2_ACCESS_TOKEN_PATTERN = re.compi... | gpl-3.0 | 5,824,369,023,767,231,000 | 34.022523 | 115 | 0.573215 | false | 4.053218 | false | false | false |
pida42/Zabbix-Addons | Extensions/Screen-Builder/lib/zabbix_api.py | 1 | 14520 | # This is a port of the ruby zabbix api found here:
# http://trac.red-tux.net/browser/ruby/api/zbx_api.rb
#
#LGPL 2.1 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
#Zabbix API Python Library.
#Original Ruby Library is Copyright (C) 2009 Andrew Nelson nelsonab(at)red-tux(dot)net
#Python Library is Copyright (... | mit | 7,293,150,512,583,284,000 | 37.927614 | 106 | 0.60854 | false | 3.76947 | false | false | false |
npinto/Oger | Oger/gradient/gradient_nodes.py | 1 | 8959 | """
Module for MDP Nodes that support gradient based learning.
This module contains the gradient node base class and some gradient based
implementations of MDP nodes.
"""
import mdp
import Oger
from mdp import numx
from mdp.utils import mult
def traverseHinet(item):
# TODO: could be implemented with a generetor... | gpl-3.0 | 2,043,110,249,622,242,300 | 29.893103 | 173 | 0.608885 | false | 3.908813 | false | false | false |
lllyasviel/style2paints | V3/server/server.py | 1 | 10571 | from config import *
import re
import os
import cv2
import time
import json
import base64
import shutil
import datetime
import threading
import numpy as np
from bottle import route, run, static_file, request, BaseRequest, response
from ai import *
from tricks import *
BaseRequest.MEMFILE_MAX = 10000 * 1000
def g... | apache-2.0 | 8,520,984,158,949,545,000 | 38.151852 | 129 | 0.604295 | false | 3.242638 | false | false | false |
AlexaVillaume/StellarEvolution | StellarEvolutionCode/opacity_interpolation.py | 2 | 1499 | '''
PURPOSE:
Interpolate over OPAL opacity tables to find opacity given a
temperature and a density.
CALLING SEQUENCE:
get_opacity(temperature, density)
'''
import sys
import math
import numpy as np
from scipy import interpolate
def density_r(logT, logRho):
# R=density[g/cm**3]/T6**3, T6=1.e-6*T[degre... | mit | -6,530,414,351,643,054,000 | 28.98 | 79 | 0.591728 | false | 3.316372 | false | false | false |
kawamon/hue | desktop/core/ext-py/sqlparse-0.2.0/sqlparse/lexer.py | 8 | 2101 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""SQL Lexer"""
# This code is based on the SqlLexer in pygments.
# http://pygments.org/
# It's s... | apache-2.0 | -1,376,921,952,388,628,500 | 29.449275 | 73 | 0.608282 | false | 4.168651 | false | false | false |
bpilania/SDNGini | backend/src/gloader/xml/parsers/xmlproc/xmlproc.py | 14 | 19963 | """
The main module of the parser. All other modules will be imported into this
one, so this module is the only one one needs to import. For validating
parsing, import xmlval instead.
"""
# $Id: xmlproc.py,v 1.25 2002/08/13 09:28:51 afayolle Exp $
import re,string,sys,urlparse
string_translate=string.translate # opt... | mit | -5,480,106,167,174,526,000 | 31.887974 | 83 | 0.498172 | false | 3.943698 | false | false | false |
wearpants/measure_it | instrument/__init__.py | 1 | 11282 | """you are not expected to understand this implementation.
that's why it has tests.
the above-mentioned 'you' includes the author. :-}
"""
__version__ = '0.6.1'
import time
from functools import wraps
from contextlib import contextmanager
import inspect
from .output import print_metric
# builtins we shadow
_builtin... | bsd-3-clause | -1,689,073,413,419,960,000 | 33.187879 | 97 | 0.574898 | false | 4.197173 | false | false | false |
aclogreco/InventGamesWP | ch19/spritesAndSounds.py | 1 | 5101 | # spritesAndSounds.py
# Collision Detection
# with Keyboard and Mouse Input
# and with spites and sounds
"""
This is a demonstration of doing
collison detection with pygame.
This also demonstrates how to get user
input from the keyboard and the mouse
using pygame. The use of Sprites,
sound, and music are demonstrat... | bsd-2-clause | 2,414,215,532,519,144,400 | 30.88125 | 76 | 0.574397 | false | 3.728801 | false | false | false |
dannofx/tgbot | tgbot/commands/native_commands/trigger.py | 1 | 11053 | from tgbot.commands.command import Command
import json
import shlex
import collections
KEYS_NOT_FOUND = 0
SOME_KEYS_FOUND = 1
KEYS_FOUND = 2
class TriggerCommand(Command):
privileges = None
triggers_file = None
triggers = None
def __init__(self, logger, message_sender):
super().__init__(logg... | bsd-3-clause | -1,567,548,089,665,468,000 | 34.540193 | 130 | 0.545372 | false | 4.563584 | false | false | false |
bbxyard/bbxyard | yard/skills/66-python/cookbook/yvhai/demo/std/ds/heapq.py | 1 | 1189 | import heapq
import random
from yvhai.demo.base import YHDemo
class PriorityQueue(object):
def __init__(self):
self._queue = []
self._index = 0
def push(self, item, weight):
heapq.heappush(self._queue, (weight, self._index, item))
self._index += 1
def pop(self):
i... | apache-2.0 | 98,691,416,537,480,210 | 23.604167 | 118 | 0.508044 | false | 3.494083 | false | false | false |
Pyres/django-pyres | setup.py | 2 | 1026 | import os
from setuptools import setup, find_packages
version=__import__('django_pyres').__version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django-pyres',
version=version,
description='django pyres integration',
long_description=read('README.... | bsd-3-clause | 2,095,621,876,080,140,000 | 32.096774 | 78 | 0.608187 | false | 3.901141 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.