repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
suoto/hdlcc | hdl_checker/types.py | 1 | 3057 | # This file is part of HDL Checker.
#
# Copyright (c) 2015 - 2019 suoto (Andre Souto)
#
# HDL Checker 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 ... | gpl-3.0 | -1,681,818,069,359,244,300 | 29.57 | 87 | 0.680079 | false | 3.894268 | false | false | false |
mrmoss/exorcist | exorcist.py | 1 | 2875 | #!/usr/bin/python2
import hashlib
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
import os
from scapy.all import *
import sys
#returns [(session,carving)]
def carve_http(streams):
ret=[]
requests=[]
for stream in streams:
start_pos=0
raw=stream[1]+"\r\n\r\n"
carving=""
header=""... | unlicense | -1,377,638,968,375,982,000 | 21.81746 | 89 | 0.647304 | false | 2.804878 | false | false | false |
bminchew/PySAR | pysar/polsar/decomp.py | 1 | 6649 | """
PySAR
Polarimetric SAR decomposition
Contents
--------
decomp_fd(hhhh,vvvv,hvhv,hhvv,numthrd=None) : Freeman-Durden 3-component decomposition
"""
from __future__ import print_function, division
import sys,os
import numpy as np
###===============================================================================... | gpl-3.0 | -7,134,213,076,990,878,000 | 33.630208 | 194 | 0.558731 | false | 3.005877 | false | false | false |
rx2130/Leetcode | python/286 Walls and Gates.py | 1 | 3439 | from collections import deque
class Solution(object):
# Op1: DFS
def wallsAndGates(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: void Do not return anything, modify rooms in-place instead.
"""
for i in range(len(rooms)):
for j in range(len(rooms[0])... | apache-2.0 | 996,698,160,578,721,000 | 35.2 | 102 | 0.444024 | false | 2.946872 | false | false | false |
id0tfqh/statistic | check-ip.py | 1 | 1236 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
pattern = r'^[0-9.]+$'
try:
addr = raw_input('input ip address: \n')
if re.match(pattern, addr):
pass
else:
print('A incorrect address')
addr = '192.168.1.1'
except ValueError: print "A incorrect address"
command = 'ipset -L | grep '
comman... | gpl-3.0 | -7,377,820,511,277,487,000 | 31.526316 | 74 | 0.682039 | false | 2.828375 | false | false | false |
TylerTemp/tomorrow | lib/hdlr/tomorrow/blog/edit.py | 1 | 2586 | import tornado.web
import logging
import json
try:
from urllib.parse import unquote
from urllib.parse import quote
except ImportError:
from urllib import unquote
from urllib import quote
from .base import BaseHandler
from ..base import EnsureUser
from lib.db.tomorrow import Article, User
class EditHa... | gpl-3.0 | -6,393,562,031,929,236,000 | 29.069767 | 74 | 0.588554 | false | 4.13099 | false | false | false |
istellartech/OpenGoddard | examples/11_Polar_TSTO_Taiki.py | 1 | 19117 | # -*- coding: utf-8 -*-
# Copyright 2017 Interstellar Technologies Inc. All Rights Reserved.
from __future__ import print_function
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from OpenGoddard.optimize import Problem, Guess, Condition, Dynamics
class Rocket:
# Atmosphere Param... | mit | 2,229,820,025,872,743,400 | 37.104208 | 228 | 0.603114 | false | 2.452025 | false | false | false |
algorithmic-music-exploration/amen | amen/timing.py | 1 | 3596 | #!/usr/bin/env python
'''Timing interface'''
from bisect import bisect_left, bisect_right
import numpy as np
import pandas as pd
import librosa
class TimeSlice(object):
"""
A slice of time: has a start time, a duration, and a reference to an Audio object.
"""
def __init__(self, time, duration, au... | bsd-2-clause | 8,363,270,816,140,576,000 | 29.735043 | 88 | 0.55812 | false | 4.017877 | false | false | false |
Jumpscale/jumpscale6_core | lib/JumpScale/baselib/remote/fabric/FabricTool.py | 1 | 1222 | from JumpScale import j
j.system.platform.ubuntu.check()
import fabric
import fabric.api
# from fabric.api import run as frun
# from fabric.api import execute as fexecute
# from fabric.api import env as fenv
# from fabric.api import open_shell as fopen_shell
# from fabric.api import path as fpath
# from fabric.api i... | bsd-2-clause | 7,891,684,852,131,338,000 | 25.565217 | 103 | 0.638298 | false | 3.375691 | false | false | false |
andnovar/networkx | networkx/algorithms/shortest_paths/tests/test_generic.py | 1 | 7273 | from __future__ import division
from nose.tools import assert_almost_equal
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from nose.tools import assert_raises
from nose.tools import ok_
from nose.tools import raises
import networkx as nx
def validate_grid_... | bsd-3-clause | -7,788,339,697,315,782,000 | 37.893048 | 89 | 0.595903 | false | 2.798384 | true | false | false |
ronkitay/Rons-Tutorials | Python/APIs/tor_json_processing.py | 1 | 3684 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python considers any map or collection as JSON elements. 'Serializing/DeSerializing' them is VERY easy
Read:
- json.load(data_file) --> Loads an object from a File
- json.loads(json_as_string) --> Loads an object from a string representing a JSON object
Write:
- json.d... | mit | 8,985,401,378,486,224,000 | 28.238095 | 102 | 0.615635 | false | 3.022149 | false | false | false |
finalion/WordQuery | src/prepare.py | 1 | 4014 | #-*- coding:utf-8 -*-
#
# Copyright © 2016–2017 Liang Feng <finalion@gmail.com>
#
# Support: Report an issue at https://github.com/finalion/WordQuery/issues
#
# 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... | gpl-3.0 | 1,858,871,427,544,899,800 | 31.609756 | 100 | 0.680379 | false | 3.683196 | false | false | false |
dalgibbard/fishfeedtime | fishfeedtime.py | 1 | 4825 | #!/usr/bin/python
#
# Fishfeedtime powers down Powerheads/Filters/Pumps of your choice (which are connected to 433.92MHz power socket controllers)
# for a set duration.
#
## GPIO Pin Definitions
# Pin with button circuit GPIO Pullup
BUTTON = 25
# LED Pin if present...
LED = True
LEDPIN = 11
# Pin connect to 434MHz tra... | bsd-3-clause | -5,868,628,276,199,227,000 | 27.892216 | 126 | 0.61057 | false | 3.501451 | false | false | false |
rjschwei/azure-sdk-for-python | azure-mgmt-redis/setup.py | 1 | 2428 | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | mit | -4,773,402,602,854,851,000 | 31.373333 | 92 | 0.575783 | false | 4.122241 | false | false | false |
pyqt/maya2012-qt4 | PyQt4/uic/Compiler/qobjectcreator.py | 1 | 5626 | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 Thorsten Marek.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as fol... | gpl-3.0 | -7,984,635,184,039,644,000 | 32.488095 | 103 | 0.612336 | false | 4.465079 | false | false | false |
openhealthcare/gloss | sites/uch/mock_api.py | 1 | 4898 | import random
from gloss import models
from gloss.translators.hl7 import coded_values
from datetime import datetime, date, timedelta
from gloss.external_api import save_message
first_names = [
"Jane", "James", "Chandeep", "Samantha", "Oliver", "Charlie",
"Sophie", "Emily", "Lily", "Olivia", "Amelia", "Isabell... | gpl-3.0 | 955,071,997,367,505,700 | 26.829545 | 83 | 0.627195 | false | 3.190879 | false | false | false |
adamnew123456/myweb | myweb/backend/db.py | 1 | 8614 | """
An interface on top of a database, which stores articles along with associated
metadata.
"""
from collections import namedtuple
import os
import os.path
import sqlite3
import sys
import zlib
import myweb.backend.query as query
import myweb.backend.utils as utils
# The connected database - there's meant to be onl... | bsd-2-clause | -7,318,419,859,649,137,000 | 34.44856 | 87 | 0.643023 | false | 3.646909 | false | false | false |
alogg/dolfin | demo/undocumented/bcs/python/demo_bcs.py | 1 | 1676 | """This demo illustrates how to set boundary conditions for meshes
that include boundary indicators. The mesh used in this demo was
generated with VMTK (http://www.vmtk.org/)."""
# Copyright (C) 2008-2012 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# ... | gpl-3.0 | 8,899,261,710,372,261,000 | 26.933333 | 77 | 0.71778 | false | 3.075229 | false | false | false |
yunify/qingcloud-cli | qingcloud/cli/iaas_client/actions/eip/allocate_eips.py | 1 | 3185 | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | apache-2.0 | -5,052,867,756,647,274,000 | 43.236111 | 101 | 0.569545 | false | 4.321574 | false | false | false |
ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/tools/Editra/src/syntax/_actionscript.py | 1 | 3261 | ###############################################################################
# Name: actionscript.py #
# Purpose: Define ActionScript syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> ... | mit | -7,326,205,709,849,318,000 | 35.918605 | 85 | 0.467035 | false | 4.971037 | false | false | false |
mhlechner/psi4 | psi4/driver/inputparser.py | 1 | 30572 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | gpl-2.0 | 7,811,537,964,894,177,000 | 36.419829 | 138 | 0.580204 | false | 3.512812 | false | false | false |
Kijewski/ctypesgen_to_pxd | convert_libc.py | 1 | 3013 | #!/usr/bin/env python3
from os import open, O_RDWR, makedirs, devnull
from os.path import abspath, exists, isfile, isdir, dirname
from subprocess import check_call, check_output, STDOUT
from re import compile as compile_re, M
from sys import argv, stderr
# Standard headers as of POSIX.1-2008 (Base Specifications, Is... | apache-2.0 | 6,184,763,107,851,232,000 | 18.43871 | 75 | 0.546963 | false | 3.459242 | false | false | false |
zulumarketing/html2pdf | xhtml2pdf/w3c/cssDOMElementInterface.py | 1 | 4314 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~ Copyright (C) 2002-2004 TechGame Networks, LLC.
##~
##~ This library is free software; you can redistribute it and/or
##~ modify it under the terms of the BSD style License as found in the
##~ LICENSE file included with this distribution.... | apache-2.0 | -8,676,311,311,175,980,000 | 28.547945 | 97 | 0.529671 | false | 4.814732 | false | false | false |
RandallDW/Aruba_plugin | plugins/org.python.pydev/pysrc/_pydevd_bundle/pydevd_utils.py | 1 | 7871 | from __future__ import nested_scopes
import traceback
import os
try:
from urllib import quote
except:
from urllib.parse import quote # @UnresolvedImport
import inspect
from _pydevd_bundle.pydevd_constants import IS_PY3K
import sys
from _pydev_bundle import pydev_log
def save_main_module(file, module_name):
... | epl-1.0 | -8,926,122,198,916,266,000 | 32.21097 | 104 | 0.582899 | false | 3.710985 | false | false | false |
pbjr23/django-projects | mysite/settings.py | 1 | 1989 | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | gpl-2.0 | 2,987,500,169,355,664,000 | 23.256098 | 71 | 0.724987 | false | 3.208065 | false | false | false |
kevin1024/vcrpy | vcr/stubs/httpx_stubs.py | 1 | 5330 | import functools
import logging
from unittest.mock import patch, MagicMock
import httpx
from vcr.request import Request as VcrRequest
from vcr.errors import CannotOverwriteExistingCassetteException
_logger = logging.getLogger(__name__)
def _transform_headers(httpx_reponse):
"""
Some headers can appear mult... | mit | -8,018,359,077,275,233,000 | 32.522013 | 101 | 0.684053 | false | 3.520476 | false | false | false |
sboosali/commands-frontends-dragon13 | NatLink/SampleMacros/natspeak_sample6.py | 1 | 1733 | #
# Python Macro Language for Dragon NaturallySpeaking
# (c) Copyright 1999 by Joel Gould
# Portions (c) Copyright 1999 by Dragon Systems, Inc.
#
# This sample macro file was created for my talk to the Boston Voice Users
# group on November 9, 1999. It is explained in my PowerPoint slides.
#
# natspeak_sample6.py
... | mit | 613,530,174,290,772,600 | 31.092593 | 76 | 0.690133 | false | 3.648421 | false | false | false |
wiki2014/Learning-Summary | alps/build/tools/releasetools/test_rangelib.py | 1 | 5541 | #
# Copyright (C) 2015 The Android Open Source Project
#
# 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 la... | gpl-3.0 | -5,130,773,463,447,550,000 | 39.445255 | 79 | 0.632377 | false | 3.215902 | true | false | false |
tgetzoya/project-euler-python | problems/pe11.py | 1 | 4396 | # In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
#
# 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
# 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
# 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
# 52 70 95 23 04 60 11 42 69 24 68 56 01 32 5... | bsd-2-clause | -8,575,176,105,820,560,000 | 50.658824 | 135 | 0.506946 | false | 2.487819 | true | false | false |
skyostil/tracy | src/generator/Cheetah/Utils/Misc.py | 1 | 2886 | #!/usr/bin/env python
# $Id: Misc.py,v 1.1 2006-09-06 09:50:10 skyostil Exp $
"""Miscellaneous functions/objects used by Cheetah but also useful standalone.
Meta-Data
================================================================================
Author: Mike Orr <iron@mso.oz.net>
License: This software is rel... | mit | 4,007,942,018,161,766,000 | 33.195122 | 80 | 0.597367 | false | 3.738342 | false | false | false |
Quihico/repository.spartacus | temp/script.module.python.koding.aio/lib/koding/web.py | 1 | 12658 | # -*- coding: utf-8 -*-
# script.module.python.koding.aio
# Python Koding AIO (c) by whufclee (info@totalrevolution.tv)
# Python Koding AIO is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
# You should have received a copy of the license along with this
# work... | gpl-2.0 | 7,584,954,019,673,659,000 | 40.917219 | 604 | 0.643467 | false | 3.743863 | false | false | false |
chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/views.py | 1 | 1334 | from datetime import datetime
from django.conf import settings
from django.db.models import Case, IntegerField, Q, Value, When
from django.shortcuts import get_object_or_404, render
from django.views.generic import ListView, TemplateView
from .models import DataQuality
class LeagueTable(ListView):
model = DataQua... | bsd-3-clause | -8,691,390,755,958,600,000 | 29.318182 | 78 | 0.625187 | false | 3.736695 | false | false | false |
NicoVarg99/daf-recipes | ckan/ckan/ckanext-dcatapit/ckanext/dcatapit/dcat/profiles.py | 1 | 31302 |
import ast
import logging
import datetime
from pylons import config
from rdflib.namespace import Namespace, RDF, SKOS
from rdflib import URIRef, BNode, Literal
import ckan.logic as logic
from ckanext.dcat.profiles import RDFProfile, DCAT, LOCN, VCARD, DCT, FOAF, ADMS
from ckanext.dcat.utils import catalog_uri, dat... | gpl-3.0 | 9,136,739,147,792,279,000 | 38.225564 | 139 | 0.566449 | false | 3.702626 | false | false | false |
slaveofcode/rajaongkir | rajaongkir/api.py | 1 | 6138 | from __future__ import unicode_literals
import requests
import json
from json.encoder import JSONEncoder
JNE = 'jne'
POS = 'pos'
TIKI = 'tiki'
ALL_COURIER = 'all'
class ApiRequest(object):
"""Basic Api request with using requests library
"""
json_encoder_class = JSONEncoder
def __init__(self, endpo... | mit | -6,702,348,984,780,667,000 | 25.921053 | 107 | 0.567937 | false | 4.1002 | false | false | false |
Julius2342/pyvlx | test/frame_set_node_name_req_test.py | 1 | 1465 | """Unit tests for FrameSetNodeNameRequest."""
import unittest
from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameSetNodeNameRequest
class TestFrameSetNodeNameRequest(unittest.TestCase):
"""Test class FrameSetNodeNameRequest."""
# pylint: disable=too-many-public-methods,inv... | lgpl-3.0 | -4,525,066,278,725,775,000 | 37.552632 | 77 | 0.674403 | false | 2.912525 | true | false | false |
chr15m/PodSixNet | examples/LagTimeServer.py | 1 | 1743 | from __future__ import print_function
from time import sleep, localtime
from weakref import WeakKeyDictionary
from time import time
import sys
from PodSixNet.Server import Server
from PodSixNet.Channel import Channel
class LagTimeChannel(Channel):
"""
This is the server representation of a single connected c... | lgpl-3.0 | -1,066,932,997,699,319,200 | 27.112903 | 107 | 0.558233 | false | 3.899329 | false | false | false |
superwebium/pybbb | checksumUrl.py | 1 | 1052 | #creer l'url avec son checksum
import hashlib
def checksumUrl(queryString,action,secret):
#1. Create the entire query string for your API call without the checksum parameter "name=Test+Meeting&meetingID=abc123&attendeePW=111222&moderatorPW=333444"
#2. Prepend the call name to your string "createname=Test+Meeting&me... | mit | -2,831,333,343,508,274,000 | 64.75 | 202 | 0.813688 | false | 2.805333 | false | false | false |
bchappet/dnfpy | src/dnfpyUtils/stats/clusterMap.py | 1 | 7473 | from dnfpy.core.map2D import Map2D
import numpy as np
from sklearn.cluster import DBSCAN
import scipy.spatial.distance as dist
from dnfpyUtils.stats.statistic import Statistic
class ClusterMap(Statistic):
"""
Params:
"continuity" : float if different of 0.0, we assume that the cluster are continuous
... | gpl-2.0 | 7,517,553,050,231,811,000 | 39.177419 | 115 | 0.57313 | false | 3.935229 | false | false | false |
wayward710/django-oidc-provider | oidc_provider/models.py | 1 | 2568 | import json
from django.db import models
from django.utils import timezone
from django.conf import settings
class Client(models.Model):
RESPONSE_TYPE_CHOICES = [
('code', 'code (Authorization Code Flow)'),
('id_token', 'id_token (Implicit Flow)'),
('id_token token', 'id_token token (Impl... | mit | -1,568,644,394,554,472,200 | 26.612903 | 84 | 0.616433 | false | 3.838565 | false | false | false |
gurneyalex/odoo | addons/hr_holidays/models/mail_channel.py | 7 | 1538 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class Channel(models.Model):
_inherit = 'mail.channel'
def partner_info(self, all_partners, direct_partners):
partner_infos = super(Channel, self).partner_info(all_... | agpl-3.0 | 8,126,574,079,275,542,000 | 55.962963 | 131 | 0.570221 | false | 3.913486 | false | false | false |
kordless/zoto-server | aztk/plugins/Paypal.py | 1 | 7615 | """
plugins/Paypal.py
Author: Trey Stout
Date Added: Mon Jul 24 15:29:48 CDT 2006
New interface to the same old shit...
"""
## STD LIBS
from md5 import md5
from datetime import date, datetime
from xml.dom import minidom
from pprint import pprint, pformat
from math import floor
import time
## OUR LIBS
from AZTKAPI i... | bsd-3-clause | 2,491,178,433,134,927,400 | 34.584112 | 143 | 0.695338 | false | 2.922103 | false | false | false |
shw700/latrace-plus | frontend/la2html.py | 1 | 15468 | #!/usr/bin/python
import sys
import re
color_map = [ "silver", "aquamarine", "tan", "skyblue", "plum", "yellowgreen", "moccasin" ]
def get_color_level(n):
return color_map[n % len(color_map)]
def enstyle_parameters(s):
result = ""
if s == "" or s == "void":
return "<b>void</b>"
nexti = s.find("=")
while... | gpl-3.0 | 7,565,566,668,682,800,000 | 34.315068 | 314 | 0.612749 | false | 2.790547 | false | false | false |
michellab/SireUnitTests | unittests/SireIO/test_amberterms.py | 1 | 5571 | from Sire.IO import *
from Sire.MM import *
from Sire.Mol import *
from Sire.CAS import *
from Sire.Maths import *
from nose.tools import assert_almost_equal
rangen = RanGenerator()
mol = MoleculeParser.read("../io/ose.top","../io/ose.crd") \
[MolWithResID(ResName("OSE"))].molecule()
def _assert_expressions... | gpl-3.0 | -5,070,307,527,353,900,000 | 34.484076 | 93 | 0.581763 | false | 3.223958 | true | false | false |
pahaz/fabtools | fabtools/openvz/operations.py | 1 | 3962 | """
OpenVZ containers
=================
"""
from __future__ import with_statement
from fabric.api import *
def create(ctid, ostemplate=None, config=None, private=None,
root=None, ipadd=None, hostname=None, **kwargs):
"""
Create an OpenVZ container.
"""
return _vzctl('create', ctid, ostempl... | bsd-2-clause | -4,828,890,494,168,943,000 | 23.45679 | 87 | 0.594649 | false | 3.374787 | false | false | false |
thanatos/lets-encrypt-preview | letsencrypt-nginx/setup.py | 1 | 2062 | import sys
from setuptools import setup
from setuptools import find_packages
version = '0.5.0.dev0'
# Please update tox.ini when modifying dependency version requirements
install_requires = [
'acme=={0}'.format(version),
'letsencrypt=={0}'.format(version),
'PyOpenSSL',
'pyparsing>=1.5.5', # Python3... | apache-2.0 | 2,273,293,315,519,230,000 | 28.884058 | 78 | 0.625121 | false | 3.861423 | false | false | false |
orwa1902/code-exemples | TicTacToe.py | 1 | 4091 | board = []
for i in range(3):
board.append(["*"] * 3)
#a function that creats the board
def print_board(board):
for row in board:
print (" ".join(row))
print("Let\'s play Tic Tac Toe! the rules are simple. you, the players, is given two choices: the row and column of your symbol. note that the numbers are between 0... | apache-2.0 | -7,065,360,161,552,512,000 | 30.713178 | 199 | 0.58152 | false | 2.531559 | false | false | false |
matthiasplappert/pibot | src/robot/base.py | 1 | 4268 | import logging
import select
import Pyro4
import Pyro4.core
import Pyro4.naming
import Pyro4.socketutil
class Robot(object):
def __init__(self):
self._sensors = []
self._actuators = []
self.n_steps = 0
@property
def actuators(self):
return self._actuators
@actuators.... | mit | -7,062,326,412,749,371,000 | 29.056338 | 99 | 0.594424 | false | 4.041667 | false | false | false |
bashu/django-easy-seo | seo/south_migrations/0004_auto__del_url__del_unique_url_url_site.py | 1 | 2904 | # -*- 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):
# Removing unique constraint on 'Url', fields ['url', 'site']
db.delete_unique('seo_url', ['url', 'site_id']... | gpl-3.0 | -8,277,121,684,023,901,000 | 49.964912 | 161 | 0.546488 | false | 3.639098 | false | false | false |
spmjc/plugin.video.freplay | resources/lib/channels/tf12.py | 1 | 4906 | #-*- coding: utf-8 -*-
from resources.lib import utils
import base64
import hashlib
import json
import urllib
import urllib2
import urlparse
from resources.lib import globalvar
title=['TF1','NT1','HD1','TMC','XTRA']
img=['tf1','nt1','hd1','tmc','xtra']
readyForUse=True
#urlCatalog='http://api.mytf1.tf1.... | gpl-2.0 | -7,290,840,593,552,326,000 | 38.248 | 138 | 0.649613 | false | 3.214941 | false | false | false |
sambev/ircbot | scrapers/cafescraper.py | 1 | 1407 | def scrapeCafe():
"""
Scrape the EastBay Cafe's site for the current lunch menu
"""
from bs4 import BeautifulSoup
import requests
# Get the page contents and make a soup object from it
page = requests.get('http://www.eastbaycafe.com/menu.php')
the_html = BeautifulSoup(page.text)
mapping = {
'Steam \'n T... | mit | -7,617,186,305,014,569,000 | 28.333333 | 109 | 0.574271 | false | 2.889117 | false | false | false |
mendersoftware/integration | testutils/api/proto_shell.py | 1 | 2637 | # Copyright 2021 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 | -2,031,462,545,458,636,000 | 31.158537 | 90 | 0.617368 | false | 3.751067 | false | false | false |
WoLpH/EventGhost | plugins/Streamzap/__init__.py | 1 | 6300 | # -*- coding: utf-8 -*-
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 v... | gpl-2.0 | 6,701,844,419,906,486,000 | 25.804255 | 78 | 0.59184 | false | 3.217058 | false | false | false |
joedborg/fusilier | fusilier/settings.py | 1 | 3090 | """
Django settings for fusilier project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... | agpl-3.0 | 1,931,001,291,523,696,600 | 24.121951 | 91 | 0.682201 | false | 3.568129 | false | false | false |
MaxTyutyunnikov/lino | obsolete/src/lino/apps/pinboard/quotes.py | 1 | 4769 | ## Copyright 2003-2006 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version... | gpl-3.0 | 3,548,653,768,347,829,000 | 28.80625 | 70 | 0.658419 | false | 3.722873 | false | false | false |
donyfeng/httpac | httpac.py | 1 | 4588 | #!/usr/bin/env python
import urllib.request
import urllib.parse
import http.cookiejar
import re
import time
import json
caller_url = "http://caller.ap01.aws.af.cm"
tieba_url = "http://tieba.baidu.com"
token_url = "https://passport.baidu.com/v2/api/?getapi&tpl=mn&apiver=v3&tt=1385610373352&class=login&loginty... | gpl-2.0 | 6,571,578,771,101,169,000 | 29 | 150 | 0.53204 | false | 3.22191 | false | false | false |
rogerthat-platform/gae-plugin-framework | src/framework/server/framework/bizz/session.py | 1 | 2118 | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 | -4,808,146,808,591,208,000 | 30.61194 | 74 | 0.674221 | false | 3.907749 | false | false | false |
ColumbiaCMB/kid_readout | kid_readout/equipment/agilent_33220.py | 1 | 2243 | """
Agilent 33220A Function generator
"""
import socket
import time
class FunctionGenerator(object):
def __init__(self,addr=('192.168.1.135', 5025)):
self.addr = addr
def set_load_ohms(self,ohms):
self.send("OUTPUT:LOAD %d" % ohms)
def set_dc_voltage(self,volts):
s... | bsd-2-clause | 84,217,115,527,791,150 | 31.042857 | 113 | 0.557735 | false | 3.440184 | false | false | false |
unnikrishnankgs/va | annotator/models.py | 1 | 2852 | from django.db import models
from django.contrib.staticfiles import finders
class Video(models.Model):
annotation = models.TextField(blank=True,
help_text="A JSON blob containing all user annotation sent from client.")
source = models.CharField(max_length=1048, blank=True,
help_text=("Name of v... | bsd-2-clause | -1,258,414,000,665,692,400 | 46.533333 | 254 | 0.646213 | false | 4 | false | false | false |
editxt/editxt | editxt/platform/__init__.py | 1 | 1745 | # -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2013 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-3.0 | -8,238,820,184,732,468,000 | 29.614035 | 75 | 0.632665 | false | 3.886414 | false | false | false |
cpn18/track-chart | gps-pi/combolog4_fft.py | 1 | 4482 | #!/usr/bin/python
import gps
import math
import datetime
import threading
#import the adxl345 module
import adxl345
import time
import greatcircle
import numpy as np
import scipy.fftpack
lock = threading.Lock()
gpstime = ""
def gps_logger():
global inSync,gpstime
logging = False
# feet
threshold = 25
# L... | gpl-3.0 | 6,752,739,938,205,765,000 | 22.465969 | 156 | 0.504909 | false | 2.984021 | false | false | false |
jayantk/pnp | experiments/dipart/scripts/visualize/generate_heatmap.py | 1 | 1411 | #!/usr/bin/python
# Generate heatmap of points
import numpy as np
import seaborn as sns
sns.set()
import matplotlib.pyplot as plt
from heatmap_data import *
# image_name=
# im = plt.imread(image_name);
# implot = plt.imshow(im);
# Load the example flights dataset and conver to long-form
# flights_long = sns.load_da... | apache-2.0 | 4,418,347,765,884,188,000 | 22.915254 | 117 | 0.634302 | false | 2.588991 | false | false | false |
untitaker/vdirsyncer | docs/conf.py | 1 | 2718 | # -*- coding: utf-8 -*-
import datetime
import os
import setuptools_scm
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'vdirsyncer'
copyright = (u'2014-{}, Markus Unterwaditzer & contributors'
.format(datetime.date.today().st... | mit | -4,870,969,946,447,225,000 | 28.225806 | 79 | 0.59713 | false | 3.449239 | false | false | false |
mjwestcott/projecteuler | python/problem68.py | 1 | 2098 | """
problem68.py
https://projecteuler.net/problem=68
What is the maximum 16-digit string for a 'magic' 5-gon ring?
"""
from itertools import chain
flatten = chain.from_iterable
def five_gon_rings(n):
"""Return list of solutions to the 'magic' 5-gon ring problem, each line
summing to n. The empty list will b... | mit | -8,939,477,965,107,197,000 | 40.137255 | 79 | 0.551954 | false | 3.027417 | false | false | false |
ioannistsanaktsidis/inspire-next | inspire/modules/workflows/tasks/matching.py | 1 | 7191 | # -*- coding: utf-8 -*-
#
## This file is part of INSPIRE.
## Copyright (C) 2014 CERN.
##
## INSPIRE is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) an... | gpl-2.0 | 800,043,034,938,041,700 | 34.776119 | 81 | 0.623279 | false | 3.861976 | false | false | false |
Tomcuzz/OctaHomeAutomation | OctaHomeSettings/views.py | 1 | 14790 | from django.conf import settings
import json
from OctaHomeCore.baseviews import *
from OctaHomeCore.models import *
from OctaHomeCore.OctaFiles.menus.base import *
from OctaHomeCore.weathermodels import *
from OctaHomeCore.helpers import *
from OctaHomeCore.authmodels import *
from OctaHomeAppInterface.models import *... | mit | -2,805,894,448,979,393,500 | 39.299728 | 175 | 0.680325 | false | 3.332582 | false | false | false |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ec.py | 1 | 10656 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... | mit | 4,637,279,592,631,494,000 | 32.828571 | 79 | 0.615709 | false | 3.725874 | false | false | false |
Belval/pdf2image | pdf2image/parsers.py | 1 | 1820 | """
pdf2image custom buffer parsers
"""
from io import BytesIO
from PIL import Image
def parse_buffer_to_ppm(data):
"""Parse PPM file bytes to Pillow Image"""
images = []
index = 0
while index < len(data):
code, size, rgb = tuple(data[index : index + 40].split(b"\n")[0:3])
siz... | mit | -5,405,256,562,195,068,000 | 23.931507 | 88 | 0.550549 | false | 3.198594 | false | false | false |
erdc/proteus | proteus/tests/cylinder2D/ibm_method/cylinder_so.py | 1 | 3701 | from __future__ import absolute_import
import proteus.default_so
from importlib import reload
reload(proteus.default_so)
from proteus.default_so import *
try:
from . import cylinder
except:
import cylinder
reload(cylinder)
from proteus.SplitOperator import Sequential_FixedStep_Simple, defaultSystem
if cylinde... | mit | 5,619,028,336,860,877,000 | 34.932039 | 109 | 0.623885 | false | 2.97508 | false | false | false |
Edgar-Bruno/Estudos_iniciais_Python | GTK/sudoku/OrdenadasVerificar.py | 1 | 1348 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
# Verificação de repetição no eixo das abscissas
indexMatriz = 46 # Index da matriz passado no click
i = indexMatriz
dicOrdenadas = {} # Key é o index da listaMatriz, value é o existe ou não
listaMatriz = [6, 2, 4, 1, 5, 9, 7, 6, 8,
9, 7, 8, 2, 6, 3, 1, 9,... | gpl-3.0 | -7,201,601,456,120,977,000 | 18.735294 | 84 | 0.545116 | false | 1.951965 | false | false | false |
miyucy/oppia | extensions/objects/models/objects.py | 1 | 13859 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 | -7,645,703,186,979,859,000 | 26.227898 | 79 | 0.553503 | false | 4.301366 | false | false | false |
sarielsaz/sarielsaz | test/functional/test_framework/test_framework.py | 1 | 20268 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Sarielsaz Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
from collections import deque
from enum import Enum
import logging
im... | mit | -1,083,212,665,010,364,000 | 41.049793 | 310 | 0.600849 | false | 4.081353 | true | false | false |
vntarasov/openpilot | selfdrive/crash.py | 1 | 2009 | """Install exception handler for process crash."""
import os
import sys
import threading
import capnp
from selfdrive.version import version, dirty
from selfdrive.swaglog import cloudlog
from common.hardware import PC
if os.getenv("NOLOG") or os.getenv("NOCRASH") or PC:
def capture_exception(*args, **kwargs):
pa... | mit | -4,263,265,187,109,849,000 | 27.295775 | 118 | 0.67546 | false | 3.463793 | false | false | false |
gurneyalex/odoo | addons/website_slides/tests/test_security.py | 7 | 12127 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_slides.tests import common
from odoo.exceptions import AccessError, UserError
from odoo.tests import tagged
from odoo.tests.common import users
from odoo.tools import mute_logger
@tagged('secur... | agpl-3.0 | -2,554,847,660,156,569,000 | 45.28626 | 152 | 0.63371 | false | 3.812323 | true | false | false |
jeonghoonkang/BerePi | apps/logger/berepi_logger.py | 1 | 1372 | # -*- coding: utf-8 -*-
# author : http://github.com/jeonghoonkang
import logging
#import logging.config
from logging.handlers import RotatingFileHandler
#logging.config.fileConfig('logging.conf')
LOG_FILENAME = "/home/pi/devel/BerePi/logs/berelogger.log"
logger = logging.getLogger('BereLogger')
logger.setLevel(logg... | bsd-2-clause | -6,053,963,852,080,583,000 | 25.901961 | 122 | 0.690962 | false | 3.371007 | false | false | false |
fluxer/spm | nuitka/nuitka/codegen/IdCodes.py | 1 | 1739 | # Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | gpl-2.0 | 5,721,993,039,687,379,000 | 33.78 | 78 | 0.646348 | false | 3.988532 | false | false | false |
mrmarkhurlburt/django_media_library | catalog/views.py | 1 | 4650 | from django.shortcuts import render
# Create your views here.
from .models import Book, Author, BookInstance, Genre, Language
def index(request):
"""
View function for home page of site.
"""
# Generate counts of some of the main objects
num_books=Book.objects.all().count()
num_instances=BookI... | cc0-1.0 | 2,464,272,805,686,653,400 | 34.496183 | 145 | 0.704301 | false | 3.881469 | false | false | false |
berguner/svmap | assemble.py | 1 | 6568 | import sys
import shutil
import subprocess
import argparse
import os
import commands
from multiprocessing import Pool
parser = argparse.ArgumentParser(description='Assemble reads extracted from each region')
parser.add_argument('--bed', help='.bed file of SV regions', type=str)
parser.add_argument('--dipspades', help=... | gpl-3.0 | -4,185,502,430,161,534,000 | 54.669492 | 148 | 0.559227 | false | 3.312153 | false | false | false |
marrow/WebCore | example/annotation.py | 1 | 2204 | # encoding: utf-8
"""Python 3 function annotation and AnnotationExtension example."""
from json import dumps
class Root:
def __init__(self, context):
self._ctx = context
def tmpl(self) -> 'mako:./template.html':
return dict()
def mul(self, a: int = None, b: int = None) -> 'json':
"""Multiply two values... | mit | 5,416,544,557,947,799,000 | 30.485714 | 109 | 0.712795 | false | 3.697987 | false | false | false |
compmetagen/micca | micca/tp/muscle.py | 1 | 1664 | ## Copyright 2016 Davide Albanese <davide.albanese@gmail.com>
## Copyright 2016 Fondazione Edmund Mach (FEM)
## This file is part of micca.
##
## micca 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 ... | gpl-3.0 | -4,189,151,909,305,110,500 | 31.627451 | 78 | 0.670072 | false | 3.354839 | false | false | false |
triskadecaepyon/pyworkout-toolkit | pyworkout/parsers/tcxtools.py | 1 | 4560 | """
Tools to process TCX files,
specifically for parsing and
converting to other formats.
"""
import numpy as np
import pandas as pd
from lxml import objectify
import dateutil.parser
import logging
TPXNS = "{http://www.garmin.com/xmlschemas/ActivityExtension/v2}TPX"
LXNS = "{http://www.garmin.com/xmlschemas/ActivityE... | bsd-3-clause | -4,978,831,119,489,418,000 | 32.284672 | 89 | 0.505263 | false | 4.935065 | false | false | false |
Grk0/python-libconf | setup.py | 1 | 1185 | from setuptools import setup
setup(
name='libconf',
version='2.0.1',
description="A pure-Python libconfig reader/writer with permissive license",
long_description=open('README.rst').read(),
author="Christian Aichinger",
author_email="Greek0@gmx.net",
url='https://github.com/Grk0/python-libc... | mit | -7,864,377,935,274,342,000 | 38.5 | 80 | 0.620253 | false | 4.114583 | false | true | false |
LumaPictures/rez | src/rez/utils/sourcecode.py | 1 | 11788 | from rez.utils.formatting import indent
from rez.utils.data_utils import cached_property
from rez.utils.logging_ import print_debug
from inspect import getsourcelines
from textwrap import dedent
from glob import glob
import traceback
import os.path
import imp
def early():
"""Used by functions in package.py to har... | lgpl-3.0 | -7,031,366,739,847,356,000 | 30.102902 | 83 | 0.580336 | false | 4.267922 | false | false | false |
Stolas/vim-exploit | plugin/templates/python_file.py | 1 | 1431 | #!/usr/bin/env python
# $$COPYRIGHT$$
# Author: $$AUTHOR$$
from struct import pack, unpack
from subprocess import call
### The Exploit
buff = "AAAA"
buff += "\x42\x42\x42\x42"
buff += pack("<L", 0x43434343)
# exploit += $$SHELLCODE$$
## The delivery script
def exploit(filename, binary, shellcode=None):
if shel... | gpl-3.0 | -6,607,134,021,538,640,000 | 24.553571 | 82 | 0.585604 | false | 3.439904 | false | false | false |
charbull/GeminiTest | reader.py | 1 | 1669 | #!/usr/bin/env python3
import asyncio
import json
import datetime
import websockets
@asyncio.coroutine
async def market_data():
"""Returns the latest market data"""
timestampms = []
async with websockets.connect('wss://api.gemini.com/v1/marketdata/ethusd') as websocket:
var_eth_usd_price = await w... | mit | -5,213,556,050,802,760,000 | 38.738095 | 92 | 0.517076 | false | 4.021687 | false | false | false |
jtpaasch/armyguys | armyguys/cli/commands/loadbalancers.py | 1 | 4802 | # -*- coding: utf-8 -*-
"""Commands for managing load balancers."""
import click
from ...jobs import loadbalancers as loadbalancer_jobs
from ...jobs.exceptions import AwsError
from ...jobs.exceptions import ImproperlyConfigured
from ...jobs.exceptions import MissingKey
from ...jobs.exceptions import Non200Response
... | mit | -4,785,469,106,288,825,000 | 27.414201 | 86 | 0.653061 | false | 3.949013 | false | false | false |
mapzen/vector-datasource | vectordatasource/collision.py | 2 | 2159 | from vectordatasource.meta.python import FilterCompiler
from vectordatasource.meta.python import create_matcher
class CollisionRanker(object):
def __init__(self, cases):
def _output_fn(datum):
return datum['index']
index = 1
matchers = []
for case in cases:
... | mit | 3,299,812,645,278,217,000 | 34.983333 | 79 | 0.516443 | false | 4.851685 | false | false | false |
skimpax/python-rfxcom | tests/protocol/test_lighting1.py | 1 | 2738 | from unittest import TestCase
from rfxcom.protocol.lighting1 import Lighting1
from rfxcom.exceptions import (InvalidPacketLength, UnknownPacketSubtype,
UnknownPacketType)
class Lighting1TestCase(TestCase):
def setUp(self):
self.data = bytearray(b'\x07\x10\x00\x01\x41\x0A... | bsd-3-clause | -2,636,206,439,880,392,700 | 28.44086 | 76 | 0.582907 | false | 3.528351 | true | false | false |
LCLS/Protein-Folding-Sims | analysis/state.py | 1 | 1766 | import sys
import numpy as np
import os
import os.path
import argparse
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument("--h1",
default=None,
type=float,
help='RMSD threshold to helix 1'
)
parser.add_argument("--h2",
... | mit | -2,607,971,450,660,101,600 | 33.627451 | 105 | 0.565685 | false | 3.240367 | false | false | false |
NeilT-UK/python-utilities | quantiser.py | 1 | 7435 | """ export qXXX quantiser functions, and general make_quant function
use function closures to return the following pre-defined qXXX functions
qE3 to qE192, the standard resistor ranges
qE2 [1, 3, 10]
qE5 [1, 1.6, 2.5, 4, 6.3, 10]
qE10 [1, 1.25, 1.6, 2, 2.5, 3.2, 4, 5, 6.3, 8, 10]
return a function that quantises ac... | bsd-2-clause | 8,269,376,849,785,245,000 | 37.128205 | 95 | 0.551984 | false | 3.208891 | true | false | false |
benbenbenbenbenbenbenbenben/mitsingen | sing/models.py | 1 | 3770 | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.db.models.signals import post_delete
from django.dispatch.dispatcher import receiver
import datetime
class Song(models.Model):
name = models.CharField(max_length=200)
notes = models.CharField(max_... | agpl-3.0 | 4,289,320,630,643,934,700 | 35.960784 | 116 | 0.700531 | false | 3.607656 | false | false | false |
kaushik94/sympy | sympy/printing/mathml.py | 1 | 74156 | """
A MathML printer.
"""
from __future__ import print_function, division
from sympy import sympify, S, Mul
from sympy.core.compatibility import range, string_types, default_sort_key
from sympy.core.function import _coeff_isneg
from sympy.printing.conventions import split_super_sub, requires_partial
from sympy.printi... | bsd-3-clause | -7,659,441,283,775,360,000 | 34.413563 | 85 | 0.551823 | false | 3.780962 | false | false | false |
pychess/pychess | lib/pychess/widgets/playerinfoDialog.py | 1 | 2716 | from gi.repository import Gtk, GObject
firstRun = True
def run(widgets):
global firstRun
if firstRun:
initialize(widgets)
firstRun = False
widgets["player_info"].show_all()
def initialize(widgets):
def addColumns(treeview, *columns):
model = Gtk.ListStore(*((str, ) * len(co... | gpl-3.0 | -6,611,440,754,596,565,000 | 32.95 | 107 | 0.588733 | false | 3.482051 | false | false | false |
guanquan94/orbis | reviews_user/views.py | 1 | 4607 | from urllib import quote_plus
from account.decorators import login_required
from annoying.decorators import render_to
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http... | mit | 5,985,936,475,654,009,000 | 30.77931 | 120 | 0.738442 | false | 3.228451 | false | false | false |
Fillll/reddit2telegram | reddit2telegram/channels/r_battlestations/app.py | 1 | 1028 | #encoding:utf-8
from utils import weighted_random_subreddit
# Subreddit that will be a source of content
subreddit = weighted_random_subreddit({
'battlestations': 1.0,
# If we want get content from several subreddits
# please provide here 'subreddit': probability
# 'any_other_subreddit': 0.02
})
# Te... | mit | 3,961,850,211,462,758,400 | 32.16129 | 75 | 0.670233 | false | 3.684588 | false | false | false |
robertobarreda/django-experiments | experiments/templatetags/experiments.py | 1 | 3713 | from __future__ import absolute_import
from django import template
from django.core.urlresolvers import reverse
from experiments.utils import participant
from experiments.manager import experiment_manager
from experiments import conf
from uuid import uuid4
register = template.Library()
@register.inclusion_tag('ex... | mit | 6,445,567,667,155,048,000 | 32.754545 | 104 | 0.66146 | false | 4.337617 | false | false | false |
ElessarWebb/dummy | src/dummy/viewer/formatting/plotformatters.py | 1 | 2788 | from dummy.viewer.formatting import ResultFormatter, Formatter
import logging
logger = logging.getLogger( __name__ )
try:
import pylab
import numpy
@Formatter.register( 'plot' )
class PlotFormatter( ResultFormatter ):
def __init__( self, *args, **kwargs ):
super( PlotFormatter, self ).__init__( self, *args... | mit | 2,839,519,910,887,826,400 | 23.243478 | 88 | 0.610115 | false | 3.115084 | false | false | false |
Toshakins/wagtail | wagtail/wagtailadmin/views/home.py | 1 | 3918 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import connections
from django.shortcuts import render
from django.template.loader import render_to_string
from wagtail.wagtailadmin.navigation import get_explorable_... | bsd-3-clause | -9,083,408,297,776,795,000 | 32.775862 | 122 | 0.641654 | false | 3.814995 | false | false | false |
google/clusterfuzz | src/python/tests/appengine/handlers/cron/manage_vms_test.py | 1 | 40729 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | 7,282,561,913,248,177,000 | 34.571179 | 80 | 0.542562 | false | 3.712762 | true | false | false |
DataDog/integrations-extras | lighthouse/tests/test_lighthouse.py | 1 | 3661 | import os
import pytest
from mock import MagicMock
from datadog_checks.base.errors import CheckException
from datadog_checks.lighthouse import LighthouseCheck
HERE = os.path.dirname(os.path.abspath(__file__))
def mock_get_lighthouse_report(cmd, lgr, re=False):
if "https" not in cmd[1]:
return "", "erro... | bsd-3-clause | -107,395,236,161,458,830 | 39.677778 | 94 | 0.714286 | false | 3.304152 | true | false | false |
MediaKraken/MediaKraken_Deployment | source/database/db_base_sync.py | 1 | 3911 | """
Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful... | gpl-3.0 | -5,817,515,067,658,072,000 | 38.319588 | 91 | 0.479161 | false | 4.200859 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.