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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RonnyPfannschmidt/pytest | testing/test_main.py | 2 | 8566 | import argparse
import os
import re
from pathlib import Path
from typing import Optional
import pytest
from _pytest.config import ExitCode
from _pytest.config import UsageError
from _pytest.main import resolve_collection_argument
from _pytest.main import validate_basetemp
from _pytest.pytester import Pytester
@pytes... | mit | -5,105,526,674,477,959,000 | 34.543568 | 99 | 0.602498 | false | 4.046292 | true | false | false |
mvaled/sentry | tests/sentry/event_manager/interfaces/test_expectstaple.py | 1 | 1718 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from sentry.interfaces.security import ExpectStaple
from sentry.event_manager import EventManager
from sentry.models import Event
@pytest.fixture
def make_csp_snapshot(insta_snapshot):
def inner(data):
mgr = EventManager(data=... | bsd-3-clause | 4,981,248,649,165,972,000 | 29.140351 | 98 | 0.603609 | false | 3.422311 | false | false | false |
meego-tablet-ux/meego-app-browser | tools/grit/grit/format/rc_unittest.py | 2 | 11258 | #!/usr/bin/python2.4
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for grit.format.rc'''
import os
import re
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.pat... | bsd-3-clause | -7,016,519,296,522,795,000 | 36.278146 | 111 | 0.618227 | false | 3.30923 | true | false | false |
TheKnowledgeOrientedArchitecture/oks | knowledge_server/migrations/0001_initial.py | 1 | 21184 | # -*- coding: utf-8 -*-
# Subject to the terms of the GNU AFFERO GENERAL PUBLIC LICENSE, v. 3.0. If a copy of the AGPL was not
# distributed with this file, You can obtain one at http://www.gnu.org/licenses/agpl.txt
#
# Author: Davide Galletti davide ( at ) c4k.it
from __future__ import unicode_lite... | agpl-3.0 | -4,693,753,816,321,246,000 | 60.225434 | 176 | 0.588085 | false | 4.135884 | false | false | false |
pypowervm/pypowervm | pypowervm/tests/tasks/test_master_mode.py | 2 | 2877 | # Copyright 2015 IBM Corp.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 | -3,966,140,001,694,107,600 | 41.940299 | 78 | 0.600278 | false | 3.765707 | true | false | false |
dreibh/planetlab-lxc-plcapi | PLC/Methods/GetWhitelist.py | 1 | 2565 | from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
from PLC.Nodes import Node, Nodes
from PLC.Persons import Person, Persons
from PLC.Auth import Auth
class GetWhitelist(Method):
"""
Returns an array of structs containing details abou... | bsd-3-clause | -8,704,996,109,009,940,000 | 34.136986 | 83 | 0.584795 | false | 4.430052 | false | false | false |
lefousdu05/performance_modelisation | src/tool_monitoring_bandwidth/format_log.py | 2 | 15389 | # ------------------------------------------------------------------
# YAMB Profiling Tool
#
# Yet Another Memory Bandwidth Profiling Tool
# ------------------------------------------------------------------
#
# [Jean Pourroy]
# [Frederic Ciesielski]
# [Patrick Demichel]
# -------... | gpl-3.0 | 3,095,190,147,515,510,000 | 34.871795 | 136 | 0.530769 | false | 3.571362 | false | false | false |
robotic-ultrasound-image-system/ur5 | moveit_commander/src/moveit_commander/planning_scene_interface.py | 2 | 10567 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | apache-2.0 | 2,890,600,286,816,371,700 | 38.875472 | 130 | 0.614555 | false | 3.907914 | false | false | false |
vmthunder/nova | nova/api/openstack/compute/contrib/migrations.py | 21 | 2998 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | 1,308,766,767,018,918,400 | 32.685393 | 78 | 0.659106 | false | 4.16968 | false | false | false |
css-lucas/GAT | gat/core/sna/update25OCT.py | 1 | 11152 | import tempfile
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import xlrd
from networkx.algorithms import bipartite as bi
from networkx.algorithms import centrality
import pandas as pd
import datetime
# Initializing graph for test case:
Graph = SNA("24OCT.xlsx", nodeSheet="Data Sheet", attrS... | mit | -6,390,395,529,313,854,000 | 37.455172 | 162 | 0.6033 | false | 2.925498 | false | false | false |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/pyshared/papyon/service/AddressBook/address_book.py | 2 | 29027 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007-2008 Johann Prieur <johann.prieur@gmail.com>
# Copyright (C) 2007 Ole André Vadla Ravnås <oleavr@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Ge... | gpl-3.0 | -3,187,320,357,286,806,500 | 37.7 | 114 | 0.568613 | false | 4.250256 | false | false | false |
jelly/calibre | src/calibre/gui2/store/stores/amazon_uk_plugin.py | 2 | 5639 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import (unicode_literals, division, absolute_import,
print_function)
store_version = 15 # Needed for dynamic plugin loading
from contextlib import closing
im... | gpl-3.0 | -2,503,281,077,070,761,000 | 36.593333 | 142 | 0.562156 | false | 3.704993 | false | false | false |
NMGRL/pychron | pychron/dvc/fix/apply_ic_scalar.py | 1 | 2408 | # ===============================================================================
# Copyright 2020 ross
#
# 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/LICE... | apache-2.0 | 4,597,753,026,927,730,700 | 29.1 | 110 | 0.54402 | false | 3.681957 | false | false | false |
asm-products/banyan-web | utils/aws.py | 1 | 2022 | import json
import logging
import pdb
import sys
import os
import boto
import boto.sns
from boto.exception import BotoServerError
from django.conf import settings
from accounts.models import BanyanUser
# Get an instance of a logger
logger = logging.getLogger(__name__)
def sns_send_push_notification_to_user(endpoi... | agpl-3.0 | -5,098,394,670,195,992,000 | 35.107143 | 134 | 0.64639 | false | 3.364393 | false | false | false |
johestephan/CTI-Toolbox | otx.py | 1 | 3794 | import urllib
import urllib2
from optparse import OptionParser
import json
import hashlib
import os.path
import time
import re
import datetime
import sys
sys.path.append('./')
import iprep_conf as IC
#- general: General information about the IP, such as geo data, and a list of the other sections currently available ... | apache-2.0 | -5,376,696,150,028,604,000 | 32.575221 | 137 | 0.715604 | false | 2.785609 | false | false | false |
ThomasBollmeier/GObjectCreator2 | src/gobjcreator2/input/grammar/intf_def.py | 1 | 1440 | #! coding=UTF-8
from tbparser.grammar import Rule, tokenNode as tnode, Switch, zeroToMany
from tbparser.parser import AstNode
from gobjcreator2.input.grammar.tokens import *
from gobjcreator2.input.grammar.method import Method, Signal
from gobjcreator2.input.grammar.misc_rules import Prefix as PrefixRule
import gobjcr... | gpl-3.0 | 1,168,160,838,227,874,600 | 31.022222 | 73 | 0.597917 | false | 4.198251 | false | false | false |
endlessm/chromium-browser | third_party/chromite/cli/cros/cros_cidbcreds.py | 1 | 2831 | # -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""cros cidbcreds: get the cidb credentials from gs."""
from __future__ import print_function
import os
import shutil
import sys... | bsd-3-clause | -9,028,332,333,411,411,000 | 33.950617 | 76 | 0.679972 | false | 3.529925 | false | false | false |
mpereaji/incubator-spot | spot-oa/api/graphql/proxy/mutation.py | 7 | 7512 | #
# 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 us... | apache-2.0 | 1,910,793,654,132,458,200 | 32.99095 | 132 | 0.620607 | false | 4.349739 | false | false | false |
odlgroup/odl | odl/test/test_examples.py | 2 | 2035 | # Copyright 2014-2020 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""Test that all examples run.
Running this... | mpl-2.0 | -2,852,233,931,185,390,000 | 28.071429 | 78 | 0.692875 | false | 3.679928 | true | false | false |
mbuchove/notebook-wurk-b | fb/zombit_recursion.py | 1 | 3262 | def zombits(str_S):
"""returns the last time that there will be number of zombits represented by str_S
str_S will represent an integer less than or equal to 10**25"""
# the even numbers and odd numbers increase monotonically
# so numbers are not repeated unless one occurrence is even and the other odd
... | mit | 6,850,013,545,591,492,000 | 29.485981 | 95 | 0.518087 | false | 3.833137 | false | false | false |
altio/foundation | foundation/backend/views/controller/mixins/search.py | 2 | 3335 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import operator
import six
from django.db import models
if six.PY3:
from functools import reduce
from .....utils import lookup_needs_distinct
from .variables import SEARCH_VAR
__all__ = 'SearchMixin',
class SearchMixin(object):
def get_searc... | mit | -9,112,678,759,690,286,000 | 35.648352 | 88 | 0.551124 | false | 4.568493 | false | false | false |
sanSS/programming-contests | project-euler/problem007.py | 2 | 1303 | #!/usr/bin/env python3
########################################################################
# Solves problem 7 from projectEuler.net.
# Finds the 10001 prime number
# Copyright (C) 2010 Santiago Alessandri
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | gpl-3.0 | -1,161,119,571,700,542,000 | 35.194444 | 73 | 0.602456 | false | 4.084639 | false | false | false |
ganga-devs/ganga | ganga/GangaAtlas/Lib/Athena/dm_util.py | 1 | 27740 | import os
#import md5
import re
import sys
import socket
from threading import Thread, Lock
from Queue import Queue, Empty
from dq2.info import TiersOfATLAS
from dq2.common.DQException import *
try:
import hashlib
md = hashlib.md5()
except ImportError:
# for Python << 2.5
import md5
md = md5.new(... | gpl-2.0 | 4,947,632,153,884,459,000 | 32.665049 | 178 | 0.599495 | false | 3.60213 | false | false | false |
memetalk/memetalk | stuff/py/pyparsers/gen_parsers.py | 2 | 2360 | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2013 Thiago B. L. Silva <thiago@metareload.com>
#
# 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 limitatio... | bsd-2-clause | -2,078,498,759,382,089,000 | 52.636364 | 104 | 0.737288 | false | 3.430233 | false | false | false |
talpah/cortana | plugins/hellopy/hello.py | 1 | 1441 | #!/usr/bin/env python
# coding: utf8
from bottle import route, run, request
import socket
from multiprocessing import Process
import json
import requests
@route('/ping', method=['POST'])
def ping():
return json.dumps({'pong': request.json['ping']})
@route('/process', method=['POST'])
def process()... | mit | 2,058,538,921,523,647,700 | 29.659574 | 86 | 0.628036 | false | 3.666667 | false | false | false |
samvtran/unity-tweak-tool | UnityTweakTool/elements/fontbutton.py | 1 | 3091 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Team:
# J Phani Mahesh <phanimahesh@gmail.com>
# Barneedhar (jokerdino) <barneedhar@ubuntu.com>
# Amith KK <amithkumaran@gmail.com>
# Georgi Karavasilev <motorslav@gmail.com>
# Sam Tran <samvtran@gmail.com>
# Sam Hewitt <hewittsamuel@gmail.com>
#
# Descript... | gpl-3.0 | -6,613,721,590,231,528,000 | 35.797619 | 176 | 0.628599 | false | 3.610981 | false | false | false |
UTSA-ICS/python-openstackclient-SID | openstackclient/tests/volume/v1/fakes.py | 1 | 2141 | # Copyright 2013 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
#
# Unless required by applicable law or agreed to... | apache-2.0 | -199,681,332,179,023,800 | 29.15493 | 79 | 0.670248 | false | 3.592282 | true | false | false |
qrsforever/workspace | python/learn/base/process/pool.py | 1 | 1287 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @file pool.py
# @brief
# @author QRS
# @blog qrsforever.github.io
# @version 1.0
# @date 2020-04-08 14:34:15
################################ jupyter-vim #######################################
# Start: JupyterXvfb or Jupyter
# ji, jj, jc, je, jp, jt
#####################... | mit | 7,648,282,756,490,769,000 | 16.493151 | 85 | 0.498042 | false | 2.88914 | false | false | false |
sa2ajj/DistroTracker | pts/mail/management/commands/pts_dispatch.py | 1 | 2039 | # Copyright 2013 The Distro Tracker Developers
# See the COPYRIGHT file at the top-level directory of this distribution and
# at http://deb.li/DTAuthors
#
# This file is part of Distro Tracker. It is subject to the license terms
# in the LICENSE file found in the top-level directory of this
# distribution and at http:/... | gpl-2.0 | -3,835,516,045,686,758,000 | 31.365079 | 78 | 0.669446 | false | 4.204124 | false | false | false |
Connexions/openstax-cms | pages/migrations/0013_auto_20201204_1532.py | 2 | 1515 | # Generated by Django 3.0.4 on 2020-12-04 21:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0052_pagelogentry'),
('wagtailredirects', '0006_redirect_increase_max_length'),
('wagtailforms', '0004_add_verbose_name_plural'),
... | agpl-3.0 | -5,062,336,205,075,407,000 | 26.545455 | 66 | 0.546535 | false | 4.563253 | false | false | false |
google/realtime-help | custom-xblocks/realtime_help/views.py | 1 | 1410 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 | 2,456,805,166,045,874,000 | 31.790698 | 74 | 0.719149 | false | 3.821138 | false | false | false |
jmesteve/saas3 | openerp/addons_extra/control_access/controller/main.py | 1 | 1794 | import openerp.http as http
from openerp.http import request
import werkzeug.utils
import openerp.addons.web.controllers.main as main
import openerp
from openerp import pooler, sql_db
class Session_extend(main.Session):
@http.route('/web/session/logout', type='http', auth="none")
def logout(self, redi... | agpl-3.0 | 761,288,180,426,150,800 | 41.738095 | 92 | 0.410814 | false | 5.571429 | false | false | false |
genome/flow-core | flow/petri_net/success_failure_net.py | 1 | 1187 | from flow.petri_net.future import FutureNet
class SuccessFailureNet(FutureNet):
def __init__(self, name=''):
FutureNet.__init__(self, name=name)
# External -- owner nets should connect to these
self.start_transition = self.add_basic_transition(name='start')
self.success_transition... | agpl-3.0 | -1,759,973,677,291,259,400 | 39.931034 | 75 | 0.676495 | false | 3.983221 | false | false | false |
acesonl/remotecare | remotecare/apps/api/models.py | 1 | 2753 | # -*- coding: utf-8 -*-
import os
import json
import binascii
from django.db import models
from core.models import EncryptedTextField
from django.conf import settings
from apps.healthperson.patient.models import Patient
from apps.healthperson.healthprofessional.models import HealthProfessional
from django.contrib.auth.... | gpl-3.0 | -589,811,924,907,541,200 | 27.978947 | 76 | 0.6749 | false | 3.944126 | false | false | false |
demisto/content | Packs/CommonScripts/Scripts/GetFieldsByIncidentType/GetFieldsByIncidentType_test.py | 1 | 3619 | import demistomock as demisto
import json
def executeCommand(name, args=None):
if name == 'demisto-api-get' and args and 'uri' in args and args['uri'] == "/incidentfields":
file_name = 'TestData/integration_incidentfields.json'
else:
raise ValueError('Unimplemented command called: {}'.format(n... | mit | -4,053,200,081,679,451,000 | 31.9 | 97 | 0.473888 | false | 4.490074 | true | false | false |
tensorflow/models | official/nlp/keras_nlp/layers/masked_lm.py | 2 | 4788 | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | 9,167,296,622,262,820,000 | 37.926829 | 80 | 0.669799 | false | 4 | false | false | false |
corand/scraping-kiniela | kiniela.py | 1 | 1537 | import requests
import datetime
from bs4 import BeautifulSoup
meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]
# meses.index("Marzo") + 1
def get_kiniela(url):
r = requests.get(url)
soup = BeautifulSoup(r.content)
data = soup.fi... | mit | -302,729,625,015,949,700 | 26.464286 | 133 | 0.653221 | false | 2.283804 | false | false | false |
sergio-garcia/learning-django | notafiscal/models.py | 1 | 2540 | from xml.etree import ElementTree
from datetime import datetime
from dateutil.parser import parse
from decimal import Decimal
from django.db import models
from io import open
class Company(models.Model):
cnpj = models.CharField(max_length=20)
inscricao_municipal = models.CharField(max_length=20)
razao_soc... | mit | 1,224,345,666,265,805,600 | 33.324324 | 83 | 0.649606 | false | 3.198992 | false | false | false |
jakejhansen/minesweeper_solver | q_learning/backup_output_net2_discount_0_batch_400_best/minesweeper_env.py | 6 | 14194 | import math
import numpy as np
import random
import time
import mss
from tkinter import *
from tkinter import font
import IPython
from random import randint
class MinesweeperEnv(object):
def __init__(self, ROWS = 10, COLS = 10, SIZEOFSQ = 100, MINES_MIN = 13, MINES_MAX=15, display = False,
#rewa... | mit | 7,132,483,203,305,293,000 | 33.204819 | 167 | 0.489784 | false | 3.576216 | false | false | false |
cberridge/trappetroll | src/alarm.py | 1 | 3443 | #!/usr/bin/env python
# coding: utf-8
"""
Alarm receives notification from a motion sensor (walkby).
If the alarm is set it notifies the parties. Example:
ha = HouseAlarm(['+447579965785', '+447579965785'],
['chris@berridge.org', 'chris@lightbulb2live.com'])
ha.walkby() # does nothi... | gpl-2.0 | 8,336,030,036,638,270,000 | 31.790476 | 85 | 0.546035 | false | 3.549485 | false | false | false |
nickfrostatx/frost | frost/session.py | 1 | 3131 | # -*- coding: utf-8 -*-
"""Server-side sessions."""
from datetime import datetime, timedelta
from flask import request
from flask.sessions import SessionInterface, SessionMixin
from .model import get_session_data, store_session_data, delete_session
from .util import random_string
class RedisSession(dict, SessionMixi... | mit | -328,743,757,470,375,600 | 33.406593 | 79 | 0.605877 | false | 4.197051 | false | false | false |
xiaoguoai/ec-dev-swift | swift/common/ring/builder.py | 2 | 45823 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 | -5,431,311,787,517,883,000 | 42.891762 | 79 | 0.559675 | false | 4.398023 | false | false | false |
iagcl/data_pipeline | tests/applier/data_common.py | 1 | 1560 | # 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 | 3,355,947,233,800,717,000 | 52.793103 | 440 | 0.732051 | false | 3.959391 | false | false | false |
tisnik/fabric8-analytics-common | perf-tests/src/gremlin_package_generator.py | 2 | 4174 | """Class that generates ecosystem+package and ecosystem+package+version tuples."""
class GremlinPackageGenerator:
"""Class that generates ecosystem+package and ecosystem+package+version tuples."""
PACKAGES = {
"npm": {
"sequence": ["3.0.0"]
},
"maven": {
"io.ve... | apache-2.0 | -5,103,946,279,313,145,000 | 39.921569 | 99 | 0.629372 | false | 4.174 | false | false | false |
anoncb1754/backlogr_py | backlogr/backlog_items/models.py | 1 | 3651 |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from backlogs.models import Backlog
import uuid
# Create your models here.
class BacklogItem(models.Model):
"""
A BacklogItem is either an epic, a user story or a non functional requirement.
Ev... | unlicense | 2,577,522,481,267,700,700 | 37.03125 | 137 | 0.682553 | false | 3.775595 | false | false | false |
micolous/metrodroid | extra/mdst/mdst.py | 1 | 6536 | #!/usr/bin/env python3
# -*- mode: python; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-
"""
mdst.py - Helper for writing MdST files
Copyright 2018-2019 Michael Farrell <micolous+git@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public L... | gpl-3.0 | -5,829,663,833,743,044,000 | 33.041667 | 131 | 0.656059 | false | 3.341513 | false | false | false |
chaconnewu/awesome-augmented | attach_all_github_repo_info.py | 1 | 2516 | # import mistune
import markdown2
import re
import pymysql
import yaml
import iso8601
import pytz
import subprocess
import html.parser
import os
from bs4 import BeautifulSoup, Tag
from datetime import datetime, timedelta
from dateutil.parser import parse
input_dir = './original_awesomes/'
output_dir = './awesomes/'
... | apache-2.0 | 6,304,591,235,224,284,000 | 27.91954 | 112 | 0.577901 | false | 3.553672 | true | false | false |
jumpstarter-io/horizon | horizon/test/tests/templatetags.py | 1 | 4286 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | apache-2.0 | 520,753,866,508,876,100 | 38.685185 | 78 | 0.575595 | false | 4.081905 | true | false | false |
gemalto/pycryptoki | pycryptoki/key_generator.py | 1 | 5466 | """
Methods used to generate keys.
"""
from ctypes import byref
from .attributes import Attributes
from .cryptoki import C_DeriveKey
from .cryptoki import C_DestroyObject, CK_OBJECT_HANDLE, CK_ULONG, C_GenerateKey, \
C_GenerateKeyPair, C_CopyObject
from .default_templates import CKM_DES_KEY_GEN_TEMP, \
get_def... | apache-2.0 | 9,070,576,796,278,497,000 | 32.950311 | 99 | 0.670326 | false | 3.54245 | false | false | false |
bazzisoft/webmake | tests/test_project/webmakefile.py | 1 | 2264 | from webmake import api
NODE_MODULES = [
'jquery',
'underscore',
'bootstrap',
'fastclick',
'react',
'react-dom',
]
JSX_INPUTS = api.list_matching_files('www-dev/jsx', extensions='jsx', recursive=False)
def custom_compiler(input_files, output_file, release):
with open(output_file, 'w') ... | mit | -3,220,452,723,882,895,000 | 35.516129 | 107 | 0.681537 | false | 3.097127 | false | false | false |
ryokbys/nap | nappy/vasp/__init__.py | 1 | 9202 | """
Python classes and functions useful for using DFT code VASP.
"""
from __future__ import print_function
import os
import copy
import math
import nappy
from . import incar, poscar, potcar
import json
import yaml
def get_conf_path():
return nappy.get_nappy_dir()+'/vasp_conf.yaml'
def get_exec_path():
conf... | mit | -4,215,781,216,391,372,000 | 27.57764 | 86 | 0.53847 | false | 3.559768 | true | false | false |
leandro86/epubcreator | epubcreator/pyepub/pyepubreader/opf.py | 1 | 3730 | from lxml import etree
class Opf:
_OPF_NS = "http://www.idpf.org/2007/opf"
DC_NS = "http://purl.org/dc/elements/1.1/"
def __init__(self, opf):
self._opf = etree.parse(opf)
def getSpineItems(self):
return self._xpath(self._opf, "/opf:package/opf:spine/opf:itemref/@idref")
def get... | unlicense | -920,729,571,205,317,200 | 39.11828 | 126 | 0.639678 | false | 3.56256 | false | false | false |
grlee77/numpy | numpy/tests/test_ctypeslib.py | 17 | 12170 | import sys
import pytest
import weakref
import numpy as np
from numpy.ctypeslib import ndpointer, load_library, as_array
from numpy.distutils.misc_util import get_shared_lib_extension
from numpy.testing import assert_, assert_array_equal, assert_raises, assert_equal
try:
import ctypes
except ImportError:
ctyp... | bsd-3-clause | 8,187,678,813,041,027,000 | 32.342466 | 93 | 0.548644 | false | 3.553285 | true | false | false |
vitaliykomarov/NEUCOGAR | nest/neuron_models/scripts/test.py | 1 | 5054 | import nest
import numpy as np
import pylab as pl
import nest.raster_plot
nest.ResetKernel()
#neuron_model = "iaf_psc_alpha"
#neuron_model = "iaf_psc_delta"
#neuron_model = "iaf_psc_exp"
#neuron_model = "iaf_cond_exp"
#neuron_model = "iaf_cond_alpha"
#neuron_model = "aeif_cond_alpha"
#neuron_model = "mat2_psc_exp"
#n... | gpl-2.0 | 907,808,825,375,359,500 | 38.492188 | 187 | 0.619311 | false | 2.845721 | false | false | false |
fastinetserver/portage-idfetch | pym/_emerge/CompositeTask.py | 2 | 3238 | # Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
from portage import os
class CompositeTask(AsynchronousTask):
__slots__ = ("scheduler",) + ("_current_task",)
def isAlive(self):
return self._current_t... | gpl-2.0 | -6,855,550,339,204,279,000 | 26.210084 | 66 | 0.700124 | false | 3.477981 | false | false | false |
fdosani/markov-bot | tests/twitter_tests.py | 1 | 4350 | import unittest
import mock
from mbot import Twitter
from mbot.twitter import tweepy
class TestTwitter(unittest.TestCase):
def test_twitter_init(self):
twitter_test = Twitter(credentials_file="tests/data/config_test.ini")
self.assertEquals(twitter_test.consumer_key, "SOME_CONSUMER_KEY")
... | mit | 7,060,231,458,493,714,000 | 36.5 | 79 | 0.558621 | false | 3.987168 | true | false | false |
mitaka/fun | core/utils.py | 1 | 4119 | from django.core.mail import EmailMultiAlternatives
from django.utils.html import strip_tags
from django.db.models import Q
from django.template import Template
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from django.core.exceptions import ValidationError
import string
import ran... | gpl-2.0 | 4,806,157,702,850,058,000 | 33.325 | 143 | 0.655742 | false | 3.613158 | false | false | false |
paolodedios/tensorflow | tensorflow/python/ops/ragged/ragged_operators_test.py | 6 | 4967 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -689,697,433,490,265,000 | 39.713115 | 80 | 0.598148 | false | 3.252783 | true | false | false |
sayan801/djando-rest-framework-test | tutorial/quickstart/client.py | 1 | 6714 | import oauth2 as oauth
import urllib
import urlparse
import re
import os
import base64
import hmac
import hashlib
from xml.dom import minidom as XML # Use the built-in to avoid requiring an lxml install
# OAuth relative URLs
REQUEST_TOKEN_URL = '/oauth/request_token'
ACCESS_TOKEN_URL = '/oauth/access_token'
AUTHORIZAT... | gpl-3.0 | -5,857,598,201,564,025,000 | 40.701863 | 103 | 0.62392 | false | 3.972781 | true | false | false |
boada/planckClusters | CLUSTERpipe/utils.py | 1 | 7928 | import sys
import math
import numpy
import matplotlib.patches
from past.utils import old_div
Polygon = matplotlib.patches.Polygon
sout = sys.stderr
int16 = numpy.int16
float64 = numpy.float64
land = numpy.logical_and
##################################################################
# Read both kcorrection k(z) and ... | mit | -6,175,738,053,965,031,000 | 26.72028 | 79 | 0.452447 | false | 2.912564 | false | false | false |
softintouch/python-youtrack-api | sit_youtrack/mantis2youtrack.py | 1 | 18008 | #! /usr/bin/env python
import sys
import urllib2
from StringIO import StringIO
import mantis
import mantis.defaultMantis
import youtrack.importHelper
from mantis.mantisClient import MantisClient
from youtrack import *
from youtrack.connection import Connection
from youtrack.importHelper import *
def main():
tar... | apache-2.0 | 7,439,833,824,813,745,000 | 37.561028 | 126 | 0.624667 | false | 3.593694 | false | false | false |
QuanticPotato/vcoq | plugin/coq.py | 1 | 3667 | import xml.etree.ElementTree as XMLFactory
import subprocess
import os
import signal
import utils
from buffers import Text, Color
class CoqManager:
def __init__(self, WM):
# The coqtop process
self.coqtop = None
# The string return by 'coqtop --version'
self.coqtopVersion = ''
# The windows manager insta... | gpl-2.0 | 4,173,728,588,573,874,000 | 29.558333 | 80 | 0.675484 | false | 3.147639 | false | false | false |
turbokongen/home-assistant | homeassistant/components/sms/__init__.py | 8 | 1884 | """The sms component."""
import asyncio
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_DEVICE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from .const import DOMAIN, SMS_GATEWA... | apache-2.0 | -7,792,330,586,489,864,000 | 25.166667 | 80 | 0.651805 | false | 3.933194 | true | false | false |
fedora-infra/anitya | anitya/db/migrations/versions/3fae8239eeec_add_an_api_token_table.py | 2 | 3722 | # -*- coding: utf-8 -*-
#
# This file is part of the Anitya project.
# Copyright (C) 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... | gpl-2.0 | 7,818,402,803,493,933,000 | 30.016667 | 89 | 0.631112 | false | 4.186727 | false | false | false |
lockeee/Dancing-Links2015 | dancing_links/python/test_pentominos.py | 1 | 2283 | import unittest
import pentominos
import copy
from pentominos import Pentomino
class TestPentominoMethods(unittest.TestCase):
def test_normalize(self):
for p in pentominos.all_pentominos():
self.assertEqual(p.coos, p.normalize().coos, "test_normalize failed for polyomino " + p.... | cc0-1.0 | 8,643,367,252,658,715,000 | 29.039474 | 139 | 0.562856 | false | 2.91199 | true | false | false |
dtroyer/python-openstackclient | openstackclient/tests/functional/object/v1/test_object.py | 2 | 3589 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 | -4,878,181,406,049,886,000 | 38.43956 | 78 | 0.620786 | false | 4.014541 | true | false | false |
trein/pinject | pinject/object_graph.py | 2 | 10870 | """Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | apache-2.0 | -7,218,317,423,121,197,000 | 43.186992 | 83 | 0.629439 | false | 4.303246 | true | false | false |
Banbury/cartwheel-3d | Python/UI/GLUITools/WindowWithControlPoints.py | 1 | 6688 | '''
Created on 2009-12-02
@author: beaudoin
'''
import GLUtils
from OpenGL.GL import *
class ControlPoint(object):
"""Base class for any type of control point.
Derived classes must implement:
getPos() returns the x, y position of the control point."""
def __init__( self ):... | apache-2.0 | 3,632,144,524,704,162,000 | 35.363128 | 150 | 0.570275 | false | 4.070603 | false | false | false |
postpopmail/postpop | postpop/mail/utils.py | 1 | 4094 | #!/usr/bin/env python2
import sys
import re
import logging
logger = logging.getLogger(__name__)
REGEX_FIND_ADDRESS = re.compile(r"(?:[^<]*<)?([^@]+@[^>]+)>?")
CRLF = '\r\n'
_alphanum = frozenset("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
def find_address(email_address):
"""
This take... | agpl-3.0 | 3,446,261,720,723,041,000 | 27.636364 | 87 | 0.507328 | false | 3.851364 | false | false | false |
centrofermi/e3pipe | tracking/E3FittingToolAnalyzer.py | 1 | 4650 | #!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2015 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... | gpl-3.0 | -6,002,607,043,038,633,000 | 35.328125 | 79 | 0.512473 | false | 2.928212 | false | false | false |
glastopf/conpot | conpot/tests/test_proxy.py | 1 | 5038 | # Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk>
#
# 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... | gpl-2.0 | -8,253,099,978,253,951,000 | 38.367188 | 117 | 0.650457 | false | 3.455418 | true | false | false |
xamanu/osm2gtfs | osm2gtfs/creators/cr_gam/trips_creator_cr_gam.py | 1 | 6244 | # coding=utf-8
from datetime import datetime
import transitfeed
from osm2gtfs.creators.trips_creator import TripsCreator
class TripsCreatorCrGam(TripsCreator):
def add_trips_to_feed(self, feed, data):
lines = data.get_routes()
# line (osm rounte master | gtfs route)
for line_id, line... | gpl-3.0 | -5,532,657,069,298,161,000 | 34.856322 | 85 | 0.569963 | false | 4.019974 | false | false | false |
jmchandonia/narrative | src/biokbase/narrative/tests/test_narrativeio.py | 1 | 19757 | """
Tests for Mixin class that handles IO between the
Narrative and workspace service.
"""
import unittest
from biokbase.narrative.contents.narrativeio import (
KBaseWSManagerMixin,
PermissionsError
)
from biokbase.workspace.baseclient import ServerError
import biokbase.auth
from tornado.web import HTTPError
im... | mit | 4,086,712,958,464,729,000 | 38.672691 | 125 | 0.630966 | false | 3.572694 | true | false | false |
WeiChatShop/weiChatShopPython | weiChatShopPython/service.py | 1 | 4236 | from urllib import request
from django.db import connection,transaction
from weiChatShopPython.myapp.models import BookCart
__author__ = 'xiaoming'
#得到buid
def getBuid(request):
buid = '1270001';
if 'BUID' in request.COOKIES:
buid = request.COOKIES['BUID'];
return buid;
#得到用户的ip地址
def getRealIP(req... | artistic-2.0 | -542,228,909,045,385,300 | 44.304348 | 135 | 0.59453 | false | 3.28189 | false | false | false |
benjaminoh1/tensorflowcookbook | Chapter 11/k_means.py | 1 | 4675 | # -*- coding: utf-8 -*-
# K-means with Tensorflow
#----------------------------------
#
# This script shows how to do k-means with Tensorflow
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn import datasets
from scipy.spatial import cKDTree
from sklearn.decomposition import PCA
f... | mit | 5,973,709,645,364,874,000 | 32.640288 | 96 | 0.691765 | false | 3.096026 | false | false | false |
nismod/energy_demand | energy_demand/plotting/fig_spatial_distribution_of_peak.py | 1 | 9775 | """
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import geopandas as gpd
from energy_demand.read_write import data_loader, read_data
from energy_demand.basic import date_prop
from energy_demand.basic import basic_functions
from energy_demand.basic import lookup_tables
from energ... | mit | 7,706,849,007,474,783,000 | 38.415323 | 193 | 0.547519 | false | 3.587156 | false | false | false |
csdt/Pawi | app/models/user.py | 1 | 2162 | #! /usr/bin/env python3
# -*-coding:utf-8 -*-
from . import app, db
from .account import *
from .account_sharing import *
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
__all__ = ["User"]
class User(db.Model):
__tablename__ = "users"
id = db.Column(db.Integer, primary_key = True)
name ... | mit | 7,508,580,616,117,213,000 | 39.792453 | 130 | 0.682701 | false | 3.77972 | false | false | false |
rochacbruno/manage | setup.py | 1 | 1424 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def long_description():
desc = []
for filename in ['README.rst', 'HISTORY.rst']:
with open(filename, 'r') as fd:
desc.append(fd.read())
return '\n\n'.join(desc)
setup(
name='manage',
version='0.1.15... | isc | 5,247,055,065,714,724,000 | 26.384615 | 79 | 0.587079 | false | 3.698701 | false | false | false |
amitu/cfblog | example/settings.py | 1 | 3077 | """
Django settings for example project.
Generated by 'django-admin example' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ins... | bsd-3-clause | 2,114,873,860,291,854,000 | 23.814516 | 71 | 0.675658 | false | 3.445689 | false | false | false |
bd808/tools-stashbot | stashbot/phab.py | 1 | 1918 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of bd808's stashbot application
# Copyright (C) 2016 Bryan Davis and contributors
#
# 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 Founda... | gpl-3.0 | -8,536,266,390,919,645,000 | 31.508475 | 78 | 0.61001 | false | 3.866935 | false | false | false |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractItsameTranslationsCom.py | 1 | 1597 | def extractItsameTranslationsCom(item):
'''
Parser for 'itsame-translations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('person with inferior ability returns from demon world', 'Pe... | bsd-3-clause | -5,110,887,899,354,999,000 | 58.185185 | 163 | 0.567314 | false | 3.775414 | false | false | false |
leluck/Service-Network-Simulator | src/snsim/generator.py | 1 | 2415 | # Copyright (c) 2012 Johannes Bendler
# Licensed under the MIT License (MIT)
#
# 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 right... | mit | 3,913,196,606,445,384,700 | 39.266667 | 108 | 0.691097 | false | 4.259259 | false | false | false |
karel-brinda/prophyle | prophyle/prophyle_validate_tree.py | 1 | 1090 | #! /usr/bin/env python3
"""Test whether given Newick/NHX trees are valid for ProPhyle.
Author: Karel Brinda <kbrinda@hsph.harvard.edu>
Licence: MIT
Example:
$ prophyle_validate_tree.py ~/prophyle/bacteria.nw ~/prophyle/viruses.nw
"""
import os
import sys
import argparse
sys.path.append(os.path.dirname(__file_... | mit | 7,507,836,275,854,325,000 | 20.372549 | 108 | 0.606422 | false | 3.132184 | false | false | false |
lordlothar99/angus-doc | services/gazeanalysis/gazeanalysis_fromwebcam.py | 1 | 2726 | #!/usr/bin/env python
import sys
import math as m
import cv2
import numpy as np
import angus
if __name__ == '__main__':
### To grab the host computer web cam instead of a given file, try:
### cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture(0)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640);
ca... | apache-2.0 | 4,180,960,521,707,927,600 | 33.948718 | 116 | 0.458914 | false | 3.729138 | false | false | false |
bjodah/chempy | chempy/properties/water_permittivity_bradley_pitzer_1979.py | 1 | 3096 | # -*- coding: utf-8 -*-
import warnings
from .._util import _any, get_backend
def water_permittivity(
T=None, P=None, units=None, U=None, just_return_U=False, warn=True, backend=None
):
"""
Relative permittivity of water as function of temperature (K)
and pressure (bar).
Parameters
-------... | bsd-2-clause | -1,106,801,426,060,132,900 | 28.769231 | 84 | 0.532946 | false | 3.146341 | false | false | false |
afomm/autotest-docker | subtests/docker_cli/run/run_names.py | 2 | 1479 | from run import run_base
class run_names(run_base):
# Verify behavior when multiple --name options passed
def init_subargs(self):
cont = self.sub_stuff["cont"]
name_base = cont.get_unique_name()
names = []
for number in xrange(self.config['names_count']):
name = ('... | gpl-2.0 | 8,817,771,002,334,802,000 | 37.921053 | 77 | 0.578093 | false | 3.538278 | false | false | false |
bjornaa/ladim | postladim/particlefile.py | 1 | 4889 | from collections import namedtuple
import datetime
from typing import Any, List, Dict, Union, Optional
import numpy as np # type: ignore
import xarray as xr # type: ignore
from .variable import InstanceVariable, ParticleVariable, arraystr
Timetype = Union[str, np.datetime64, datetime.datetime]
Array = Union[np.nda... | mit | 1,220,321,048,714,860,800 | 28.810976 | 86 | 0.567805 | false | 3.653961 | false | false | false |
severin-lemaignan/minimalkb | src/minimalkb/backends/rdflib_backend.py | 2 | 4337 | import logging; logger = logging.getLogger("minimalKB."+__name__);
DEBUG_LEVEL=logging.DEBUG
import shlex
from rdflib import Graph, URIRef
from rdflib.namespace import Namespace, NamespaceManager, RDF, RDFS, OWL, XSD
from minimalkb.exceptions import KbServerError
DEFAULT_NAMESPACE = ('chili', 'http://chili-research... | bsd-3-clause | 2,133,701,431,384,136,700 | 30.656934 | 107 | 0.569288 | false | 4.114801 | false | false | false |
r-portas/govhack2015 | website/database/db_schema.py | 1 | 3974 | # db_schema.py
# Contains all the schema for the database
# (c) 2015 Roy Portas
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String, Float, Boolean
from sqlalchemy.orm import relationship
from .db_setup import setup_engine, setup_session
Ba... | mit | 7,521,927,184,866,023,000 | 28.656716 | 96 | 0.596125 | false | 3.498239 | false | false | false |
rschnapka/bank-payment | account_banking_iban_lookup/model/res_bank.py | 2 | 2278 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under ... | agpl-3.0 | -3,057,804,786,989,774,300 | 35.15873 | 78 | 0.549166 | false | 4.210721 | false | false | false |
gvalkov/gnu-make-toolkit | tests/test_lists.py | 1 | 1384 | def test_rest(make):
assert make('$(call rest,1 2 3 4)') == '2 3 4'
assert make('$(call rest,1)') == ''
assert make('$(call rest,)') == ''
def test_chop(make):
assert make('$(call chop,1 2 a)') == '1 2'
assert make('$(call chop,1 2 a 4)') == '1 2 a'
assert make('$(call chop,1)') == ''
asser... | bsd-3-clause | -1,704,352,496,490,251,800 | 35.421053 | 67 | 0.503613 | false | 2.901468 | true | false | false |
jacebrowning/doorstop | doorstop/core/base.py | 1 | 11112 | # SPDX-License-Identifier: LGPL-3.0-only
"""Base classes and decorators for the doorstop.core package."""
import abc
import functools
import os
from typing import Dict
import yaml
from doorstop import common, settings
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
log = common.logger(__na... | lgpl-3.0 | 1,540,292,809,050,756,600 | 29.032432 | 79 | 0.585133 | false | 4.231531 | false | false | false |
chair6/bandit | tests/unit/cli/test_main.py | 2 | 12276 | # Copyright 2016 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 | 4,712,040,085,946,968,000 | 41.477509 | 78 | 0.60769 | false | 3.8922 | true | false | false |
appcove/AppStruct | Python/AppStruct/Date.py | 1 | 3261 | # vim:fileencoding=utf-8:ts=2:sw=2:expandtab
#
# Copyright 2010 AppCove, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | apache-2.0 | -2,920,423,158,416,207,000 | 27.605263 | 131 | 0.609016 | false | 3.465462 | false | false | false |
mdechiaro/gpslogger | dbgps.py | 1 | 2012 | #!/usr/bin/python
""" MySQL DB class for GPS Coordinates."""
import MySQLdb
class DBGPS(object):
"""
Class for accepting GPS coordinates into a mysql DB
"""
def __init__(self, host, user, passwd, db_name):
self.host = host
self.user = user
self.passwd = passwd
self.db_na... | mit | 6,813,532,233,039,590,000 | 29.029851 | 76 | 0.519881 | false | 4.139918 | false | false | false |
brannon/aiohttp-healthcheck | aiohttp_healthcheck/__init__.py | 1 | 7311 | import asyncio
import imp
import json
import os
import logging
import socket
import sys
import time
import traceback
from aiohttp import web
try:
from functools import reduce
except Exception:
pass
def basic_exception_handler(_, e):
return False, str(e)
def json_success_handler(results):
data = {
... | mit | -8,143,978,316,571,378,000 | 30.649351 | 94 | 0.559431 | false | 4.404217 | false | false | false |
dbohdan/unflattener | unflattener/normalmapgen.py | 1 | 12204 | # unflattener, a normal map generator for 2D art.
# Copyright (c) 2013, 2014, 2015, 2016, 2017 dbohdan
# All rights reserved.
# See the file LICENSE for licensing information.
"""
Implements the NormalMap class.
"""
from __future__ import print_function
from PIL import Image
import numpy
POINT_FIVE = numpy.float64(1... | bsd-3-clause | 8,021,919,347,232,004,000 | 40.22973 | 79 | 0.533186 | false | 3.733252 | false | false | false |
medialab/reanalyse | reanalyseapp/search_indexes.py | 1 | 5240 | # -*- coding: utf-8 -*-
################################################
from haystack.indexes import *
from haystack import site
from reanalyseapp.models import *
################################################
# For the most basic usage, you can simply register a model with the `site`.
# It will get a `haystack.ind... | lgpl-3.0 | 431,652,045,908,962,940 | 31.75 | 136 | 0.655725 | false | 3.391586 | false | false | false |
CottageLabs/OpenArticleGauge | openarticlegauge/plugins/bmj.py | 1 | 4968 | from openarticlegauge import plugin
import re
class BMJPlugin(plugin.Plugin):
_short_name = __name__.split('.')[-1]
__version__='0.1' # consider incrementing or at least adding a minor version
# e.g. "0.1.1" if you change this plugin
__desc__ = "Handles articles from the British Medical... | bsd-3-clause | 2,061,661,685,062,943,200 | 55.454545 | 486 | 0.634461 | false | 4.109181 | false | false | false |
birdland/dlkit-doc | dlkit/mongo/type/objects.py | 1 | 11783 | """Mongodb implementations of type objects."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allowed in p... | mit | 8,599,292,032,602,187,000 | 32.859195 | 120 | 0.612662 | false | 4.266112 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.