repo_name stringlengths 5 92 | path stringlengths 4 232 | copies stringclasses 19
values | size stringlengths 4 7 | content stringlengths 721 1.04M | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 15 997 | alpha_frac float64 0.25 0.97 | autogenerated bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|
tiborsimko/invenio-jsonschemas | invenio_jsonschemas/errors.py | 1 | 1593 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Invenio-JSONSchemas errors."""
from __future__ import absolute_import, print_func... | mit | 5,699,083,285,520,204,000 | 31.510204 | 72 | 0.625235 | false |
qPCR4vir/orange3 | Orange/widgets/unsupervised/owpca.py | 1 | 14413 | from PyQt4.QtGui import QFormLayout, QColor, QApplication, QLineEdit
from PyQt4.QtCore import Qt, QTimer
import numpy
import pyqtgraph as pg
from Orange.data import Table, Domain, StringVariable
from Orange.data.sql.table import SqlTable, AUTO_DL_LIMIT
from Orange.preprocess import Normalize
from Orange.projection im... | bsd-2-clause | 5,290,078,399,030,746,000 | 34.153659 | 80 | 0.576077 | false |
ECESeniorDesign/lazy_record | test/test_base.py | 1 | 11343 | import unittest
import mock
import sys
import os
sys.path.append(os.path.join(
os.path.dirname(os.path.abspath(os.path.dirname(__file__))),
"lazy_record"))
import base
from base import Base
import lazy_record
class MyModel(Base):
__attributes__ = {
"name": str,
}
__validates__ = {
... | mit | -5,940,867,194,754,726,000 | 34.669811 | 78 | 0.611655 | false |
agoragames/haigha | tests/unit/connection_test.py | 1 | 34872 | '''
Copyright (c) 2011-2017, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
import logging
from chai import Chai
from haigha import connection, __version__
from haigha.connection import Connection, ConnectionChannel, ConnectionError, ConnectionClosed
from haigh... | bsd-3-clause | -1,640,058,306,771,636,200 | 37.069869 | 113 | 0.620469 | false |
apporc/neutron | neutron/db/db_base_plugin_v2.py | 1 | 64808 | # Copyright (c) 2012 OpenStack Foundation.
# 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... | apache-2.0 | -2,228,443,469,237,160,700 | 46.201748 | 79 | 0.556737 | false |
tmtowtdi/django | mysite/polls/admin.py | 1 | 1401 |
from django.contrib import admin
from polls.models import Question, Choice
class ChoiceInLine( admin.TabularInline ):
model = Choice
extra = 3
class QuestionAdmin( admin.ModelAdmin ):
### By default, the Question object's str() is displayed on the "list of
### questions" page. Tell it to display ... | artistic-2.0 | -2,186,924,659,745,510,700 | 33.170732 | 91 | 0.630978 | false |
bsipocz/astropy | astropy/utils/misc.py | 1 | 40318 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
A "grab bag" of relatively small general-purpose utilities that don't have
a clear module/package to live in.
"""
import abc
import copy
import contextlib
import difflib
import inspect
import json
import os
import signal
import... | bsd-3-clause | -8,344,829,424,143,748,000 | 33.369991 | 124 | 0.597331 | false |
CoreSecurity/pysap | pysap/utils/fields.py | 1 | 12226 | # ===========
# pysap - Python library for crafting SAP's network protocols packets
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# The library was designed and developed by Martin Gallo from
# the SecureAuth's Innovation Labs team.
#
# This program is free software; you can red... | gpl-2.0 | 3,712,130,716,518,683,000 | 31.515957 | 117 | 0.586128 | false |
mbiokyle29/pipelines | EBseq/ebseq_extras.py | 1 | 3684 | import os.path
import re
# don't use slots since we only have a few of these guys
class _sampleRec():
def __init__(self, name, mean, std, condition):
self.name = name
self.mean = int(mean)
self.std = int(std)
self.condition = int(condition)
class EbseqExtras():
def __init__(s... | mit | -1,907,952,357,245,468,400 | 29.708333 | 103 | 0.51683 | false |
whummer/moto | tests/test_sns/test_topics_boto3.py | 1 | 7274 | from __future__ import unicode_literals
import boto3
import six
import json
import sure # noqa
from botocore.exceptions import ClientError
from moto import mock_sns
from moto.sns.models import DEFAULT_TOPIC_POLICY, DEFAULT_EFFECTIVE_DELIVERY_POLICY, DEFAULT_PAGE_SIZE
@mock_sns
def test_create_and_delete_topic():
... | apache-2.0 | 8,110,577,855,049,402,000 | 35.009901 | 102 | 0.643937 | false |
taigaio/taiga-back | taiga/export_import/management/commands/dump_project.py | 1 | 2981 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... | agpl-3.0 | 5,321,887,911,599,760,000 | 39.283784 | 110 | 0.571956 | false |
GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_packages/maven.py | 1 | 4623 | # Copyright 2020 PerfKitBenchmarker 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 appli... | apache-2.0 | -5,603,522,190,831,945,000 | 34.022727 | 100 | 0.679645 | false |
mindbody/API-Examples | SDKs/Python/swagger_client/models/time_clock_report.py | 1 | 7634 | # coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | bsd-2-clause | -8,113,522,800,906,684,000 | 28.459459 | 132 | 0.573788 | false |
SymbiFlow/sv-tests | tools/runners/Yosys.py | 1 | 1388 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import os
from BaseRunner import BaseRunner
... | isc | -7,568,493,084,167,110,000 | 24.703704 | 65 | 0.54755 | false |
fedora-conary/conary | conary/trovetup.py | 1 | 7716 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 | -8,419,735,200,402,609,000 | 34.232877 | 79 | 0.616252 | false |
allancaffee/scaly-mongo | scalymongo/structure_walker.py | 1 | 4037 | """
Structure Walker
================
A utility used to aid in structure validation.
"""
from inspect import isclass
from scalymongo.errors import ValidationError
class StructureWalker(object):
"""A helper class to recurse a :class:`dict`-like object in accordance with
a structure.
:param field_transl... | bsd-3-clause | 7,673,683,350,043,057,000 | 34.725664 | 79 | 0.567005 | false |
FedoraScientific/salome-smesh | src/Tools/blocFissure/gmu/rotTrans.py | 1 | 2187 | # -*- coding: utf-8 -*-
import logging
from geomsmesh import geompy
import math
from triedreBase import triedreBase
O, OX, OY, OZ = triedreBase()
# -----------------------------------------------------------------------------
# --- operateur de rotation translation d'un objet centré à l'origine
def rotTrans(objet, o... | lgpl-2.1 | 1,145,417,926,614,904,200 | 37.035088 | 121 | 0.677122 | false |
Twi/amaya | amaya/base.py | 1 | 8526 | from exceptions import ConnectionError
from ircmess import IRCLine
from select import select
import socket
import ssl
class IRCBot:
"""
An IRCBot is a class that maintains a connection with a remote IRC server
and keeps track of channel members, information about the remote server,
and other things th... | mit | 6,726,665,231,286,973,000 | 27.51505 | 82 | 0.554891 | false |
deanmalmgren/flo | tests/run.py | 1 | 1071 | #!/usr/bin/env python
"""Run the test suite that is specified in the .travis.yml file
"""
import os
import subprocess
import yaml
from flo.colors import green, red
root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def run_test(command):
wrapped_command = "cd %s && %s" % (root_dir, command)... | mit | -1,789,616,958,793,071,000 | 23.906977 | 70 | 0.65733 | false |
Deledrius/korman | korman/properties/modifiers/region.py | 1 | 15953 | # This file is part of Korman.
#
# Korman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Korman is distributed i... | gpl-3.0 | -1,248,840,267,233,175,300 | 41.769437 | 134 | 0.603021 | false |
AuxinJeron/ACS-VRP | src/vrpmain.py | 1 | 1857 | from TsplibParser import parser as tspparser
from ArgParser import parser as argparser
from VRPCenter import VRPCenter
from TspPainter import tspPainter
import logging
# construct the logger
logger = logging.getLogger("logger")
logger.setLevel(logging.INFO)
logFormatter = logging.Formatter("%(asctime)s [%(threadName)s... | apache-2.0 | 7,920,056,264,688,182,000 | 33.407407 | 136 | 0.649435 | false |
joshu/loan-eval-rabbit | async_logger.py | 1 | 2525 | from pika.adapters.twisted_connection import TwistedProtocolConnection
from pika.connection import ConnectionParameters
from twisted.internet import protocol, reactor, task
from twisted.python import log
import uuid
import json
import os
class Consumer(object):
def on_connected(self, connection):
d = conn... | mit | -1,238,929,204,795,590,700 | 31.371795 | 76 | 0.645545 | false |
vindimy/altcointip | src/main.py | 1 | 1232 | import cointipbot, traceback, time
class Main():
cb = None
def __init__(self):
'''
Unfortunately, we cannot instantiate CointipBot only once due to the way pifkoin works.
Pifkoin will open an HTTP connection to the RPC client which will eventually close when the bot completes its che... | gpl-2.0 | 630,895,149,168,113,300 | 33.25 | 162 | 0.668831 | false |
KeepSafe/translation-real-time-validaton | notifier/sync.py | 1 | 2907 | import asyncio
import logging
from . import const, compare
from .model import *
logger = logging.getLogger(__name__)
def _to_dc_items(wti_items, zendesk_items):
return [DynamicContentItem(key, wti_items.get(key), zendesk_item) for key, zendesk_item in zendesk_items.items()]
async def _get_all_translations(zen... | apache-2.0 | 4,294,154,491,269,031,000 | 36.753247 | 118 | 0.675611 | false |
AnyChart/GraphicsJS | build.py | 1 | 14952 | #!/usr/bin/env python
# coding=utf-8
import os
import sys
import subprocess
import urllib
import zipfile
import platform
import shlex
import time
import json
import datetime
# =======================================================================================================================
# Project pa... | bsd-3-clause | -1,710,062,974,786,245,600 | 33.451613 | 336 | 0.524144 | false |
evanhenri/memfog | src/database.py | 1 | 1615 | from sqlalchemy import Column, Integer, String, Text, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Database:
def __init__(self, db_fp):
# Create an engine that stores data in db found at db_path
engine... | mit | -738,783,469,334,043,900 | 32.645833 | 96 | 0.643344 | false |
jeremydw/google-apputils-python | tests/datelib_unittest.py | 1 | 8310 | #!/usr/bin/env python
# Copyright 2002 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... | apache-2.0 | 4,097,536,020,298,167,300 | 34.512821 | 80 | 0.676775 | false |
qbeenslee/Nepenthes-Server | data/db.py | 1 | 8333 | # coding:utf-8
'''
数据库
Author : qbeenslee
Created : 2014/10/10
'''
import time
import datetime
import sqlalchemy
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker, relationship
from config import setting
from data.base_clazz import Base
def get_db():
'''
获取操作对象集合
:re... | gpl-3.0 | 5,364,762,305,518,218,000 | 32.458333 | 99 | 0.634422 | false |
akarol/cfme_tests | cfme/physical/physical_server.py | 1 | 11597 | # -*- coding: utf-8 -*-
"""A model of an Infrastructure PhysicalServer in CFME."""
import attr
from navmazing import NavigateToSibling, NavigateToAttribute
from cached_property import cached_property
from wrapanapi.lenovo import LenovoSystem
from cfme.common import PolicyProfileAssignable, WidgetasticTaggable
from cfm... | gpl-2.0 | -3,648,648,376,430,438,400 | 36.898693 | 106 | 0.644218 | false |
tadams42/sokoenginepy | tests/board/hexoban_board_spec.py | 1 | 16599 | import os
import pytest
from sokoenginepy import BoardConversionError, HexobanBoard, PuzzlesCollection
from ..test_helpers import TEST_RESOURCES_ROOT
from .autogenerated_board import HexobanBoardAutogeneratedSpecMixin
def load_parser_test_data():
input_file = os.path.join(
TEST_RESOURCES_ROOT, 'test_da... | gpl-3.0 | 1,282,884,382,846,484,700 | 37.334873 | 96 | 0.552744 | false |
symac/wikidata | rugby/01_getListeJoueurs.py | 1 | 1035 | # -*- coding: utf-8 -*-
#!/usr/bin/python
import MySQLdb
import pywikibot
import sys
import re
import mwparserfromhell
from pywikibot import pagegenerators
'''
Ce script va récupérer toutes les pages qui utilisent le template "Infobox Rugbyman"
'''
site = pywikibot.Site("fr", "wikipedia")
def parse(title):
page = p... | gpl-2.0 | -8,651,722,581,256,401,000 | 26.184211 | 123 | 0.710271 | false |
altaurog/django-caspy | tests/unit/test_adaptor.py | 1 | 9434 | from datetime import datetime, date
from caspy.domain import models as domain
from caspy import models as db
from caspy import django_orm as orm
import pytest
class TestGetField:
def test_foreign(self):
class X:
pass
o = X()
assert orm.get_field(o) is o
assert orm.get_f... | bsd-3-clause | -5,163,583,924,773,448,000 | 32.935252 | 61 | 0.53816 | false |
tbenthompson/quadracheer | tests/test_piessens.py | 1 | 3323 | import numpy as np
from quadracheer.piessens import piessen_neg_one_to_one_nodes,\
piessen_method, piessens
from quadracheer.map import map_singular_pt, map_pts_wts
def test_piessen_neg_1_1():
# Example 1 from Piessens
f = lambda x: np.exp(x)
exact = 2.11450175
piessen_... | mit | 6,857,235,317,311,616,000 | 31.262136 | 66 | 0.589828 | false |
pirate42/docc | docc/image.py | 1 | 2823 | # coding=utf-8
from docc.exceptions import APIError
class Image(object):
"""Represent an Image object (name and distribution information)"""
def __init__(self, identifier, name, distribution):
self.id = identifier
self.name = name
self.distribution = distribution
def __repr__(se... | mit | 7,968,175,958,036,338,000 | 28.726316 | 77 | 0.57492 | false |
Unity-Technologies/ml-agents | ml-agents-envs/mlagents_envs/registry/remote_registry_entry.py | 1 | 3260 | from sys import platform
from typing import Optional, Any, List
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.base_env import BaseEnv
from mlagents_envs.registry.binary_utils import get_local_binary_path
from mlagents_envs.registry.base_registry_entry import BaseRegistryEntry
class RemoteR... | apache-2.0 | 8,832,754,937,924,894,000 | 44.915493 | 87 | 0.647546 | false |
quantopian/metautils | metautils/singleton.py | 1 | 1394 | #
# Copyright 2015 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 | 591,549,726,284,844,900 | 30.681818 | 74 | 0.657819 | false |
wq/wq.db | tests/test_router.py | 1 | 2694 | from .base import APITestCase
from django.core.exceptions import ImproperlyConfigured
try:
from django.urls import include
except ImportError:
from django.conf.urls import include
class RestRouterTestCase(APITestCase):
def test_rest_model_conflict(self):
from wq.db import rest
from tests.c... | mit | -4,957,441,498,676,931,000 | 33.538462 | 76 | 0.598367 | false |
pmitche/it3105-aiprogramming | project3/module6/deeplearning/layer.py | 1 | 1224 | import numpy as np
import theano
import theano.tensor as T
class HiddenLayer(object):
def __init__(self, input, num_in, number_of_nodes, activation):
self.num_in = num_in
self.number_of_nodes = number_of_nodes
self.weights = self.init_weights(activation)
self.output = activation(T... | mit | 273,362,223,681,299,230 | 33 | 100 | 0.596405 | false |
BlackHole/enigma2-obh10 | lib/python/Tools/Downloader.py | 1 | 2535 | from boxbranding import getMachineBrand, getMachineName
from twisted.web import client
from twisted.internet import reactor, defer
from urlparse import urlparse
class HTTPProgressDownloader(client.HTTPDownloader):
def __init__(self, url, outfile, headers=None):
client.HTTPDownloader.__init__(self, url, outfile, h... | gpl-2.0 | -6,097,105,769,769,699,000 | 32.8 | 169 | 0.737673 | false |
klocey/DiversityTools | StatPak/ACE.py | 1 | 3982 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
#scikit-bio/skbio/diversity/alpha/_ace.py
#Greg Caporasogregcaporaso on Aug 7, 2014 API: moved base.py to _base.py
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (... | mit | 2,663,075,253,608,483,000 | 33.626087 | 79 | 0.615018 | false |
sanjayankur31/pyjigdo | pyJigdo/base.py | 1 | 5381 | #
# Copyright 2007-2009 Fedora Unity Project (http://fedoraunity.org)
#
# 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; version 2, or (at your option) any
# later version.
#
# This program is di... | gpl-2.0 | 8,769,146,377,141,532,000 | 43.471074 | 90 | 0.584836 | false |
nlamirault/portefaix | diagrams/certmanager.py | 1 | 3182 | #!/usr/bin/python3
# Copyright (C) 2020 Nicolas Lamirault <nicolas.lamirault@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 | -5,073,813,048,137,684,000 | 44.442857 | 95 | 0.621188 | false |
yunojuno/django-inbound-email | inbound_email/backends/sendgrid.py | 1 | 5539 | import json
import logging
from email.utils import getaddresses
from django.core.mail import EmailMultiAlternatives
from django.http import HttpRequest
from django.utils.datastructures import MultiValueDictKeyError
from django.utils.encoding import smart_text
from ..backends import RequestParser
from ..errors import... | mit | -6,551,924,801,335,674,000 | 36.938356 | 95 | 0.610399 | false |
openplans/shareabouts-vahi-demo | src/sa_web/views.py | 1 | 9089 | import requests
import yaml
import json
import logging
import os
import time
import hashlib
import httpagentparser
import urllib2
from .config import get_shareabouts_config
from django.shortcuts import render
from django.conf import settings
from django.core.cache import cache
from django.core.mail import send_mail
fro... | gpl-3.0 | 6,137,123,870,696,673,000 | 33.42803 | 161 | 0.645836 | false |
NOAA-ORR-ERD/gridded | gridded/tests/test_dataset.py | 1 | 1234 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
import os
import netCDF4 as nc
from gridded import Dataset
from .utilities import get_test_file_dir
test_dir = get_test_file_dir()
# Need to hook this up to existing test data infrastructure
# and... | unlicense | -9,179,753,565,101,680,000 | 21.035714 | 82 | 0.683955 | false |
Belval/pdf2image | tests.py | 1 | 66419 | import os
import sys
import errno
import pathlib
import tempfile
import unittest
import time
import shutil
import subprocess
from inspect import signature
from subprocess import Popen, PIPE
from tempfile import TemporaryDirectory
from multiprocessing.dummy import Pool
from memory_profiler import profile as profile_memo... | mit | -5,162,533,474,726,274,000 | 37.72828 | 111 | 0.567955 | false |
Lujeni/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_host_info.py | 1 | 8077 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) me@mimiko.me
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'statu... | gpl-3.0 | -9,156,222,259,647,895,000 | 32.936975 | 142 | 0.604432 | false |
arbenson/mrtsqr | dumbo/BtA.py | 1 | 2491 | """
Copyright (c) 2012-2014, Austin Benson and David Gleich
All rights reserved.
This file is part of MRTSQR and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
"""
"""
BtA.py
===========
Driver code f... | bsd-2-clause | 7,643,623,938,800,354,000 | 26.076087 | 75 | 0.638298 | false |
facebookresearch/faiss | benchs/bench_index_flat.py | 1 | 2187 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import time
import os
import numpy as np
import faiss
from faiss.contrib.datasets import SyntheticDataset
os.system... | mit | -6,713,802,029,258,484,000 | 24.114943 | 72 | 0.474142 | false |
nanomolina/controlDeGastos | Windows/openWindow.py | 1 | 5551 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'new.ui'
#
# Created: Fri Aug 15 21:30:13 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import sys
from os import getcwd, listdir
from os.path import j... | gpl-2.0 | -6,159,931,926,551,762,000 | 39.518248 | 107 | 0.631057 | false |
mottosso/mindbender-setup | bin/pythonpath/raven/contrib/django/client.py | 1 | 10355 | # -*- coding: utf-8 -*-
"""
raven.contrib.django.client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import time
import logging
from django.conf import settings
from dj... | mit | -6,920,952,999,196,945,000 | 33.055921 | 84 | 0.552014 | false |
JeremyOT/Toto | toto/zmqworkerconnection.py | 1 | 10185 | import toto
import zmq
import cPickle as pickle
import zlib
import logging
from toto.exceptions import *
from toto.workerconnection import WorkerConnection
from threading import Thread
from tornado.options import options
from tornado.gen import Task
from collections import deque
from zmq.eventloop.ioloop import ZMQPoll... | mit | 51,147,384,794,014,200 | 47.5 | 319 | 0.68434 | false |
coddingtonbear/django-location | location/signals.py | 1 | 1394 | from django.dispatch.dispatcher import Signal
from location.models import LocationSnapshot
location_updated = Signal(providing_args=['user', 'from_', 'to'])
location_changed = Signal(providing_args=['user', 'from_', 'to'])
class watch_location(object):
def __init__(self, user):
self.user = user
de... | mit | -3,250,612,997,930,834,400 | 29.304348 | 65 | 0.537303 | false |
pck886/kicomav | Engine/plugins/emalware.py | 1 | 12387 | # -*- coding:utf-8 -*-
# Author: Kei Choi(hanul93@gmail.com)
import os
import re
import kernel
import kavutil
import cryptolib
# -------------------------------------------------------------------------
# KavMain 클래스
# -------------------------------------------------------------------------
class KavMain:
# --... | gpl-2.0 | 4,424,197,806,499,684,000 | 41.310861 | 115 | 0.409843 | false |
DHTC-Tools/logstash-confs | condor/python/split-index.py | 1 | 5102 | #!/usr/bin/env python
import datetime
import argparse
import sys
import logging
import pytz
import elasticsearch
import elasticsearch.helpers
ES_NODES = 'uct2-es-door.mwt2.org'
VERSION = '0.1'
SOURCE_INDEX = 'osg-connect-job-details'
def get_start_week(start_date):
"""
Return a datetime that starts at the ... | apache-2.0 | -7,657,909,026,755,955,000 | 33.945205 | 92 | 0.546844 | false |
phoebe-project/phoebe2-docs | 2.0/tutorials/irrad_method_horvat.py | 1 | 3065 | #!/usr/bin/env python
# coding: utf-8
# Lambert Scattering (irrad_method='horvat')
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.0 installed. (You can comment out this line if you don't use pip for your installation or don't wa... | gpl-3.0 | -2,983,392,925,752,449,000 | 25.422414 | 203 | 0.675041 | false |
Bharath-J/Mezzanine | setup.py | 1 | 4939 |
# #import os
# #import sys
# #from setuptools import setup, find_packages
# #from shutil import rmtree
# #from mezzanine import __version__ as version
# #exclude = ["mezzanine/project_template/dev.db",
# # "mezzanine/project_template/project_name/local_settings.py"]
# #if sys.argv == ["setup.py", "test"]:
... | bsd-2-clause | 2,649,597,721,540,508,700 | 34.028369 | 79 | 0.524398 | false |
mcclurmc/juju | juju/providers/ec2/tests/common.py | 1 | 7904 | from yaml import dump
from twisted.internet.defer import fail, succeed
from txaws.s3.client import S3Client
from txaws.s3.exception import S3Error
from txaws.ec2.client import EC2Client
from txaws.ec2.exception import EC2Error
from txaws.ec2.model import Instance, Reservation, SecurityGroup
from juju.lib.mocker impo... | agpl-3.0 | -6,238,537,517,998,629,000 | 35.762791 | 78 | 0.602859 | false |
jelmer/python-fastimport | fastimport/processors/filter_processor.py | 1 | 11587 | # Copyright (C) 2009 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | gpl-2.0 | -4,424,120,872,560,378,000 | 36.866013 | 77 | 0.586778 | false |
wgkoro/Countdown-Reader-closing | source/libs/utils.py | 1 | 1190 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import string
import re
import random
import hashlib
from flask import request, session
def generate_csrf_token():
rand_str = randstr(20)
session['_csrf_token'] = get_session_token(rand_str)
return rand_str
def get_session_token(rand_str):
key = 'SaltOfToken... | mit | -7,334,088,037,797,551,000 | 19.517241 | 63 | 0.612605 | false |
OnroerendErfgoed/skosprovider_heritagedata | setup.py | 1 | 1309 | import os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
packages = [
'skosprovider_heritagedata'
]
requires = [
'skosprovider>=0.6.0',
... | mit | 516,847,866,655,250,750 | 27.456522 | 83 | 0.662338 | false |
alexad2/XeRPI | Xe1T_Kr83m_Note/lce_helpers_v2.py | 1 | 8006 | import numpy as np
from collections import defaultdict
import ROOT
from subprocess import call
import pandas as pd
##################################################################################################
def atan(y, x):
phi = np.arctan2(y, x)
for i in range(len(phi)):
if phi[i] < 0:
... | gpl-3.0 | -3,472,338,365,560,601,000 | 36.586854 | 126 | 0.402823 | false |
adobe-type-tools/robofont-scripts | Anchors/AnchorsOutput.py | 1 | 3389 | from __future__ import print_function
__copyright__ = __license__ = """
Copyright (c) 2013-2019 Adobe Systems Incorporated. All rights reserved.
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 wi... | mit | 5,904,105,215,958,060,000 | 29.258929 | 85 | 0.701682 | false |
infothrill/python-viscosity-app | viscosity_app/vpn.py | 1 | 4333 | """
This module provides procedures to interact in a programmatic way with the
application "Viscosity" from http://www.sparklabs.com/viscosity/ using the
OS X applescripting interface.
"""
import logging
import time
import applescript
from .observer import Subject
EVT_VPN_STOPPED = 100
EVT_VPN_STARTED = 101
def c... | mit | 6,369,262,081,582,387,000 | 31.825758 | 126 | 0.648973 | false |
klnusbaum/UDJ-Server | udjserver/udj/views/views07/user_modification.py | 1 | 2613 | import json
import re
from udj.views.views07.decorators import NeedsJSON
from udj.views.views07.decorators import AcceptsMethods
from udj.views.views07.decorators import HasNZJSONParams
from udj.views.views07.authdecorators import NeedsAuth
from udj.views.views07.responses import HttpResponseConflictingResource
from u... | gpl-2.0 | 8,605,335,649,776,238,000 | 29.741176 | 80 | 0.760046 | false |
google-research/google-research | aqt/utils/summary_utils_test.py | 1 | 3467 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | 6,234,843,658,226,991,000 | 33.67 | 79 | 0.507067 | false |
StellarCN/py-stellar-base | stellar_sdk/base_transaction_envelope.py | 1 | 5708 | from abc import abstractmethod
from typing import List, Union, Generic, TypeVar
from . import xdr as stellar_xdr
from .exceptions import SignatureExistError
from .keypair import Keypair
from .network import Network
from .utils import hex_to_bytes, sha256
T = TypeVar("T")
class BaseTransactionEnvelope(Generic[T]):
... | apache-2.0 | -428,335,434,075,978,200 | 37.567568 | 123 | 0.658549 | false |
hail-is/hail | hail/python/hailtop/cleanup_gcr/__main__.py | 1 | 2922 | import sys
import time
import logging
import asyncio
import aiohttp
import hailtop.aiogoogle as aiogoogle
log = logging.getLogger(__name__)
class AsyncIOExecutor:
def __init__(self, parallelism):
self._semaphore = asyncio.Semaphore(parallelism)
async def _run(self, fut, aw):
async with self.... | mit | 2,255,893,551,007,446,000 | 29.123711 | 117 | 0.605065 | false |
chrislit/abydos | abydos/stemmer/_stemmer.py | 1 | 1218 | # Copyright 2018-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | gpl-3.0 | 6,629,885,516,102,265,000 | 21.555556 | 70 | 0.630542 | false |
partofthething/home-assistant | tests/components/unifi/conftest.py | 1 | 1068 | """Fixtures for UniFi methods."""
from typing import Optional
from unittest.mock import patch
from aiounifi.websocket import SIGNAL_CONNECTION_STATE, SIGNAL_DATA
import pytest
@pytest.fixture(autouse=True)
def mock_unifi_websocket():
"""No real websocket allowed."""
with patch("aiounifi.controller.WSClient")... | mit | -5,269,824,949,856,575,000 | 29.514286 | 78 | 0.627341 | false |
schanzen/gnunet-mirror | src/integration-tests/test_mem_consumption.py | 1 | 5199 | #!/usr/bin/python
# This file is part of GNUnet.
# (C) 2010 Christian Grothoff (and other contributing authors)
#
# GNUnet 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, or (a... | gpl-3.0 | 3,829,938,605,057,254,400 | 33.892617 | 96 | 0.670898 | false |
DayGitH/Family-Tree | worker.py | 1 | 28764 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'worker.ui'
#
# Created: Tue Jul 12 16:21:50 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(se... | cc0-1.0 | -7,275,819,988,399,845,000 | 71.453401 | 163 | 0.742212 | false |
rasbt/advent-of-code-2016 | python_code/aoc_08_02.py | 1 | 10351 | # Sebastian Raschka, 2016
"""
source: http://adventofcode.com/2016/day/8
DESCRIPTION
You come across a door implementing what you can only assume is an
implementation of two-factor authentication after a long
game of requirements telephone.
To get past the door, you first swipe a keycard (no problem; there was one ... | mit | -4,137,628,623,510,542,300 | 33.274834 | 135 | 0.495314 | false |
raiden-network/raiden | raiden/tests/unit/network/rtc/test_web_rtc_manager.py | 1 | 1676 | from typing import Any
import pytest
from gevent.event import Event
from raiden.constants import ICEConnectionState
from raiden.network.transport.matrix.rtc.aiogevent import yield_future
from raiden.network.transport.matrix.rtc.web_rtc import WebRTCManager
from raiden.tests.utils.factories import make_signer
from raid... | mit | -1,773,934,289,486,246,700 | 37.976744 | 99 | 0.756563 | false |
SCUT16K/SmsSender | server/utils/commands.py | 1 | 1286 | # -*- coding: utf-8 -*-
import sys
import gevent.wsgi
import gevent.monkey
from werkzeug.contrib import profiler
from flask_script import Command
class ProfileServer(Command):
"""
Run the server with profiling tools
"""
def __init__(self, host='localhost', port=9000, **options):
self.por... | apache-2.0 | -2,121,802,192,813,314,800 | 26.956522 | 94 | 0.566874 | false |
matt77hias/Clipping | src/intersection.py | 1 | 1377 | import numpy as np
###############################################################################
## Intersection utilities 2D
###############################################################################
def intersect2D(c_v1, c_v2, p_v1, p_v2):
A1 = c_v2[1] - c_v1[1]
B1 = c_v1[0] - c_v2[0]
C1 = c_v1[0... | gpl-3.0 | 6,211,066,492,931,171,000 | 26 | 79 | 0.335512 | false |
robmcmullen/peppy | peppy/project/editra/BZR.py | 1 | 9992 | ###############################################################################
# Name: Cody Precord #
# Purpose: SourceControl implementation for Bazaar #
# Author: Cody Precord <cprecord@editra.org> #
... | gpl-2.0 | 5,564,929,580,805,322,000 | 34.942446 | 91 | 0.470877 | false |
fafaschiavo/lol-api-webapp | lolapiwebapp/stock/views.py | 1 | 17940 | from pprint import pprint
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
from stock.models import Hero, mastery, Rune
import json, requests, grequests
# Create your procedures here.
def searchSummonerStats(summoner_id):
context = {}
if type(summon... | gpl-3.0 | -8,273,637,906,974,307,000 | 39.046875 | 434 | 0.608696 | false |
cfusting/arctic-browning | utilities/learning_data.py | 1 | 4957 | import os
import ntpath
import re
from functools import partial
import h5py
import design_matrix as dm
class LearningData:
DEFAULT_PREFIX = 'ARG'
CSV = '.csv'
HDF = '.hdf'
def __init__(self):
self.num_variables = None
self.num_observations = None
self.predictors = None
... | gpl-3.0 | 630,932,586,585,630,200 | 32.268456 | 100 | 0.617511 | false |
nonemaw/Flask_nonemaw | app/science/views.py | 1 | 2703 |
from flask import render_template, request, redirect, url_for
from flask_login import current_user, login_required
from bson import ObjectId
from . import science
from .compute import compute
from .forms import populate_form_from_instance, ComputeForm
from .. import db_s
from ..models_science import Compute
# http... | mit | -692,888,562,903,513,600 | 34.565789 | 79 | 0.616352 | false |
IanLewis/homepage | homepage/runner.py | 1 | 2657 | # :coding=utf-8:
import os
import argparse
import django
from django.core.management import call_command
from waitress import serve
from homepage import __version__ as VERSION
from homepage.wsgi import application
def start(args):
"""
Starts the homepage application server.
"""
serve(application, ... | mit | 8,793,610,769,817,218,000 | 23.601852 | 87 | 0.641325 | false |
GoeGaming/lutris | lutris/config.py | 1 | 10735 | #!/usr/bin/python
# -*- coding:Utf-8 -*-
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WA... | gpl-3.0 | 1,786,690,622,427,660,800 | 36.274306 | 78 | 0.606148 | false |
geophysics/mtpy | mtpy/uofa/bayesian1d.py | 1 | 2126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 31.07.2013
@author: LK@UofA
mtpy/uofa/bayesian1d.py
Module for handling the UofA Bayesian 1D inversion/modelling code.
"""
import os
import sys
import os.path as op
import mtpy.utils.filehandling as MTfh
import mtpy.core.edi as EDI
import mtpy.utils.ex... | gpl-3.0 | 2,121,404,373,755,960,000 | 20.049505 | 69 | 0.648636 | false |
di/vladiate | vladiate/inputs.py | 1 | 2379 | import io
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from vladiate.exceptions import MissingExtraException
class VladInput(object):
""" A generic input class """
def ... | mit | 376,685,929,278,033,800 | 24.858696 | 87 | 0.565784 | false |
dagon666/napi | tests/integration_tests/napi/scpmocker.py | 1 | 1963 | import os
import subprocess
class ScpMocker(object):
"""
This class interfaces to scpmocker - a programmable command mock.
"""
def __init__(self, scpMockerPath, sandboxPath):
self.scpMockerPath = scpMockerPath
self.sandboxPath = sandboxPath
self.binPath = os.path.join(self.sand... | gpl-3.0 | -5,285,952,767,629,290,000 | 27.449275 | 73 | 0.55731 | false |
drewcsillag/skunkweb | pylibs/vfs/__init__.py | 1 | 1223 | # $Id$
# Time-stamp: <02/05/25 15:05:54 smulloni>
########################################################################
#
# Copyright (C) 2001 Jacob Smullyan <smulloni@smullyan.org>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified... | gpl-2.0 | -6,009,414,850,838,430,000 | 28.119048 | 74 | 0.649223 | false |
esrf-bliss/Lima-camera-andor3 | tango/Andor3.py | 1 | 13277 | ############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2014
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free software; you can redistribute it and/or modify
# it under ... | gpl-3.0 | -8,108,087,734,343,641,000 | 34.031662 | 139 | 0.442269 | false |
ronghanghu/vqa-mcb | train/v4_glove/visualize_tools.py | 1 | 10507 | import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import json
import re
import shutil
from PIL import Image
from PIL import ImageFont, ImageDraw
import caffe
from caffe import layers as L
from caffe import params as P
from vqa_data_provider_layer import VQADataProvider
from vqa_data_provider_lay... | bsd-2-clause | 5,928,542,490,714,291,000 | 38.205224 | 115 | 0.504901 | false |
gadeleon/chromatic_circle | questions.py | 1 | 1751 | '''
Questions generation functions
'''
import random
def degree(note, scale, degree):
'''
What is the <Number> of <Note> <Scale>?
'''
try:
answer = raw_input('What is the {} of {} {}: '.format(str(degree + 1), note, scale.capitalize()))
return answer, degree
except KeyboardInterru... | mit | -1,124,495,998,507,797,200 | 25.530303 | 105 | 0.537978 | false |
benkonrath/django-guardian | guardian/testapp/tests/test_decorators.py | 1 | 13291 | from __future__ import unicode_literals
from django.conf import settings, global_settings
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions import PermissionDenied
from django.db.models.base import ModelBase
from django.http import HttpRequest
from django.http import HttpResponse
f... | bsd-2-clause | -5,353,922,090,276,023,000 | 36.229692 | 80 | 0.630351 | false |
jupyter-widgets/ipywidgets | ipywidgets/widgets/widget_media.py | 1 | 7783 | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import mimetypes
from .widget_core import CoreWidget
from .domwidget import DOMWidget
from .valuewidget import ValueWidget
from .widget import register
from traitlets import Unicode, CUnicode, Bool
from .trait_types i... | bsd-3-clause | -1,439,636,317,653,839,400 | 33.745536 | 132 | 0.620326 | false |
BorgERP/borg-erp-6of3 | l10n_hr/l10n_hr_account/account_invoice.py | 1 | 8374 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Slobodni programi d.o.o. (<http://www.slobodni-programi.com>).
# $Id$
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 | -3,190,680,389,484,607,500 | 44.759563 | 112 | 0.524242 | false |
jmpews/torweb | tests/test_blog_load_from_md.py | 1 | 2367 | # coding:utf-8
import sys, os
import os.path
sys.path.append(os.path.dirname(sys.path[0]))
from settings.config import config
from peewee import Model, MySQLDatabase
mysqldb = MySQLDatabase('',
user=config.BACKEND_MYSQL['user'],
password=config.BACKEND_MYSQL['password']... | mit | 728,075,483,062,490,800 | 27.670732 | 81 | 0.553382 | false |
ageron/tensorflow | tensorflow/python/ops/custom_gradient.py | 1 | 12977 | # Copyright 2017 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 | -7,386,745,741,267,146,000 | 44.059028 | 86 | 0.681282 | false |
dmilos/nucleotide | src/nucleotide/component/windows/cygwingcc/atom/blank.py | 1 | 1439 | #!/usr/bin/env python2
# Copyright 2015 Dejan D. M. Milosavljevic
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 | 7,428,636,978,328,667,000 | 25.188679 | 115 | 0.601112 | false |
alexsalo/genenetwork2 | wqflask/base/webqtlConfig.py | 1 | 3470 | #########################################'
# Environment Variables - public
#########################################
#Debug Level
#1 for debug, mod python will reload import each time
DEBUG = 1
#USER privilege
USERDICT = {'guest':1,'user':2, 'admin':3, 'root':4}
#minimum number of informative strains
KMININFOR... | agpl-3.0 | -4,796,549,076,374,986,000 | 44.064935 | 148 | 0.711816 | false |
MisanthropicBit/pygments-sisal | setup.py | 1 | 1494 | """pygments-sisal module setup script for distribution."""
from __future__ import with_statement
import os
import setuptools
def get_version(filename):
with open(filename) as fh:
for line in fh:
if line.startswith('__version__'):
return line.split('=')[-1].strip()[1:-1]
set... | mit | 8,996,431,354,112,685,000 | 32.2 | 71 | 0.613119 | false |
lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/virtual_machine_scale_set_instance_view_py3.py | 1 | 1931 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -237,297,689,070,112,480 | 39.229167 | 114 | 0.65044 | false |
pallets/jinja | tests/test_security.py | 1 | 6176 | import pytest
from markupsafe import escape
from jinja2 import Environment
from jinja2.exceptions import SecurityError
from jinja2.exceptions import TemplateRuntimeError
from jinja2.exceptions import TemplateSyntaxError
from jinja2.nodes import EvalContext
from jinja2.sandbox import ImmutableSandboxedEnvironment
from ... | bsd-3-clause | -7,340,597,471,083,471,000 | 34.699422 | 88 | 0.553271 | false |
xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_countries_cambodia.py | 1 | 1113 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... | gpl-3.0 | -2,878,269,767,698,330,000 | 37.344828 | 76 | 0.69577 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.