text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
pass
<caret><selection>n = 0
while n:
print("spam")</selection>
pass | siosio/intellij-community | python/testData/mover/multiLineSelectionDifferentIndentLevelsMoveToEmptyLine_afterDown.py | Python | apache-2.0 | 74 | 0.081081 |
"""
Creates an Azure serverless function.
"""
from common.methods import set_progress
from infrastructure.models import CustomField
from common.methods import generate_string_from_template
import os, json
def create_custom_fields_as_needed():
CustomField.objects.get_or_create(
name='azure_function_name', ... | CloudBoltSoftware/cloudbolt-forge | blueprints/azure_functions/create.py | Python | apache-2.0 | 3,475 | 0.007194 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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, either version 3 of the Licens... | nijel/weblate | weblate/addons/apps.py | Python | gpl-3.0 | 905 | 0 |
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | gregbdunn/aws-ec2rescue-linux | tools/moduletests/unit/test_arpcache.py | Python | apache-2.0 | 12,661 | 0.003001 |
from .. import scalar_measures
import numpy
from numpy.testing import assert_array_almost_equal
def test_fractional_anisotropy(N=10, random=numpy.random.RandomState(0)):
tensors = random.randn(N, 3, 3)
fa = numpy.empty(N)
for i, t in enumerate(tensors):
tt = numpy.dot(t, t.T)
tensors[i] =... | demianw/tract_querier | tract_querier/tensor/tests/test_scalar_measures.py | Python | bsd-3-clause | 2,117 | 0.000945 |
# oracle/base.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the Oracle database.
Oracle version 8 through current (11g at the time ... | jokajak/itweb | data/env/lib/python2.6/site-packages/SQLAlchemy-0.6.7-py2.6.egg/sqlalchemy/dialects/oracle/base.py | Python | gpl-3.0 | 43,930 | 0.005304 |
import logging
import traceback
import numpy as np
from eemeter.structures import EnergyTrace
logger = logging.getLogger(__name__)
class SplitModeledEnergyTrace(object):
''' Light wrapper around models applicable to a single trace which
fits and predicts multiple models for different segments.
Paramet... | impactlab/eemeter | eemeter/modeling/split.py | Python | mit | 7,118 | 0.000281 |
"""For seeding individual ops based on a graph-level seed.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
_DEFAULT_GRAPH_SEED = 87654321
def get_seed(op_seed):
"""Returns the local seeds an operation sh... | arunhotra/tensorflow | tensorflow/python/framework/random_seed.py | Python | apache-2.0 | 4,427 | 0.002259 |
def address(self, data):
self.irc.send(self.privmsg("512 Shaw Court #105, Severn, MD 21144"))
| Unallocated/UAS_IRC_Bot | modules/address.py | Python | gpl-3.0 | 195 | 0.010256 |
from django.db.models.fields import related
def _is_many_to_many_relation(field):
"""Check if a field specified a many-to-many relationship as defined by django.
This is the case if the field is an instance of the ManyToManyDescriptor as generated
by the django framework
Args:
field (django.d... | rackerlabs/django-DefectDojo | dojo/api_v2/prefetch/utils.py | Python | bsd-3-clause | 1,916 | 0.003132 |
"""
Evaluation of Python code in |jedi| is based on three assumptions:
* The code uses as least side effects as possible. Jedi understands certain
list/tuple/set modifications, but there's no guarantee that Jedi detects
everything (list.append in different modules for example).
* No magic is being used:
- metac... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/jedi/evaluate/__init__.py | Python | bsd-2-clause | 26,873 | 0.001191 |
import os
import sys
import shutil
import straight.plugin
import numpy as np
import pkg_resources
from os import path
from core import utils
from core import argparser
from core import log
from core import parser
def main():
## Parse arguments
ap = argparser.init_arg_parser()
options = ap.parse_args()
... | satriaphd/bgc-learn | bgc-learn.py | Python | gpl-3.0 | 18,044 | 0.004434 |
# Copyright (c) 2011-2013 Peng Sun. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYRIGHT file.
# hone_lib.py
# provide library for mgmt program to create dataflow
import inspect
from cStringIO import StringIO
import hone_rts
from hone_util import LogU... | pupeng/hone | Controller/hone_lib.py | Python | bsd-3-clause | 9,045 | 0.015478 |
""" Needed Tests
clip_to_rect() tests
--------------------
DONE *. clip_to_rect is inclusive on lower end and exclusive on upper end.
DONE *. clip_to_rect behaves intelligently under scaled ctm.
DONE *. clip_to_rect intersects input rect with the existing clipping rect.
DONE *. ... | tommy-u/enable | kiva/agg/tests/clip_to_rect_test_case.py | Python | bsd-3-clause | 12,045 | 0.003653 |
"""The tests for the Splunk component."""
import unittest
from unittest import mock
from homeassistant.setup import setup_component
import homeassistant.components.splunk as splunk
from homeassistant.const import STATE_ON, STATE_OFF, EVENT_STATE_CHANGED
from tests.common import get_test_home_assistant
class TestSpl... | MungoRae/home-assistant | tests/components/test_splunk.py | Python | apache-2.0 | 3,879 | 0 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | darcyliu/storyboard | boto/rds/parametergroup.py | Python | mit | 7,126 | 0.002666 |
"""Task Utilities.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon.
@license: Licensed under the MIT license.
"""
import sys
import threading
_threadPool = None
_threadPoolLock = threading.Lock()
def setThreadPool(threadPool):
"""Set ... | lewissbaker/cake | src/cake/task.py | Python | mit | 15,540 | 0.013964 |
# -*- coding: utf-8 -*-
#
# web_container.py
#
# Copyright © 2016-2017 Antergos
#
# This file is part of whither.
#
# whither 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... | Antergos/whither | whither/toolkits/gtk/web_container.py | Python | gpl-3.0 | 985 | 0 |
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 req... | scripnichenko/nova | nova/api/openstack/compute/floating_ip_pools.py | Python | apache-2.0 | 2,196 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
from django.conf import settings
import json
import sys
import csv
from datetime import datetime, date, time
from bson.code import Code
from bson.objectid import ObjectId
from bson.errors import InvalidId
from bson import json_util
from pymongo... | videntity/django-djmongo | djmongo/mongoutils.py | Python | gpl-2.0 | 17,724 | 0.00079 |
import re
import csv
from urllib import parse
import lxml.html
from pupa.scrape import Person, Scraper
class NoDetails(Exception):
pass
SESSION_NUMBERS = {
'2011': '62nd',
'2013': '63rd',
'2015': '64th',
'2017': '65th',
}
class MTPersonScraper(Scraper):
def url_xpath(self, url):
#... | cliftonmcintosh/openstates | openstates/mt/people.py | Python | gpl-3.0 | 7,587 | 0.001977 |
import copy
import pytest
from peek.line import InvalidIpAddressException, Line, InvalidStatusException
# 127.0.0.1 - - [01/Jan/1970:00:00:01 +0000] "GET / HTTP/1.1" 200 193 "-" "Python"
test_line_contents = {
'ip_address': '127.0.0.1',
'timestamp': '[01/Jan/1970:00:00:01 +0000]',
'verb': 'GET',
... | purrcat259/peek | tests/unit/test_line.py | Python | mit | 1,585 | 0.001262 |
from flask import request, render_template
from flask.ext.login import current_user, login_user
from mysite.weibo import Client
from mysite import app, db
from mysite.models import Wuser, User
from . import weibo
@weibo.route('/oauthreturn')
def oauthreturn():
code = request.args.get('code', '')
if code:
client = ... | liyigerry/caixiang | mysite/views/weibo/oauthreturn.py | Python | mit | 941 | 0.026567 |
# Copyright 2012 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 app... | nikesh-mahalka/cinder | cinder/api/contrib/services.py | Python | apache-2.0 | 7,673 | 0 |
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | eProsima/Fast-DDS | test/communication/liveliness_assertion.py | Python | apache-2.0 | 2,185 | 0.003661 |
# Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com>
# Licensed for distribution under the GPL version 2, check COPYING for details
import utils
from twisted.internet import reactor
from twisted.words.xish.domish import Element
import jabw
import config
from debug import LogEvent, INFO, WARN, ERROR
import lang... | Alwnikrotikz/pyicqt | src/contact.py | Python | gpl-2.0 | 9,153 | 0.037365 |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2017 AT&T 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 t... | Juniper/tempest | tempest/lib/services/compute/servers_client.py | Python | apache-2.0 | 36,704 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('article', '0001_initial'),
]
operations = [
migrations.AddField(
... | Timurdov/bionicprojectpython | shadrus/article/migrations/0002_comments_comments_date.py | Python | apache-2.0 | 548 | 0.001825 |
NAME='gif'
GCC_LIST=['gif']
| unbit/uwsgi-gif | uwsgiplugin.py | Python | mit | 28 | 0.071429 |
from hashlib import sha256
from .etl import ETL
from kombu.mixins import ConsumerMixin
from kombu import Connection
import traceback
import Queue
import json
import time
import pytz
from datetime import datetime
from tzlocal import get_localzone
import socket
import logging
import os
class KnownHosts(object):
H... | deeso/slow-hitter | src/slow/hitter.py | Python | apache-2.0 | 10,877 | 0.001747 |
# -*- coding: utf-'8' "-*-"
import base64
import json
from hashlib import sha1
import hmac
import logging
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_adyen.controllers.main import AdyenController
from openerp.osv import osv, fields
from opener... | minhphung171093/GreenERP | openerp/addons/payment_adyen/models/adyen.py | Python | gpl-3.0 | 7,511 | 0.003728 |
import json
class JSON_RPCError(Exception):
""" Base class for JSON-RPC errors. """
def to_json(self):
return json.dumps({
'code': self.code,
'message': self.__doc__,
})
class ParseError(JSON_RPCError):
""" Invalid JSON was received by the server. An error occurre... | AdvancedClimateSystems/Diode | diode/exceptions.py | Python | mpl-2.0 | 830 | 0 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='Card-Magic',
version='1.0',
description='The best card and decks ever',
author='Juan Carlos Ferrer',
author_email='juan.carlos@micronixsolutions.com',
packages=['cardmagic', 'cardmagic.tests'],
package_data = {
... | juancferrer/Card-Magic | setup.py | Python | bsd-3-clause | 463 | 0.008639 |
"""
********************************************************************************
Learn Python the Hard Way Third Edition, by
Zed A. Shaw
ISBN: 978-0321884916
********************************************************************************
"""
import random
from urllib import urlopen
import sys
#debug ... | msnorm/projects | zspy2/ex41/ex41.py | Python | mit | 2,749 | 0.005457 |
from collections import OrderedDict
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = OrderedDict(
(
("{{company_limited_prefix}}{{last_name}} {{company_limited_suffix}}", 0.2),
(
"{{company_limited_prefix}}{{last_name}}{{company... | joke2k/faker | faker/providers/company/th_TH/__init__.py | Python | mit | 4,173 | 0.000946 |
"""Support for raspihats board binary sensors."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
CONF_ADDRESS,
CONF_DEVICE_CLASS,
CONF_NAME,
DEVICE_DEFA... | rohitranjan1991/home-assistant | homeassistant/components/raspihats/binary_sensor.py | Python | mit | 4,436 | 0.001127 |
__author__ = 'alberto'
import time
from functools import wraps
from config import logger
def measure_time(func):
"""
Decorator that reports the execution time.
"""
@wraps(func)
def wrapper(*args, **kwargs):
logger.info("Running %s", func.__name__)
start = time.time()
resu... | jresendiz27/EvolutionaryComputing | escom/pepo/utils.py | Python | apache-2.0 | 469 | 0.002132 |
import os
import sys
import time
import pickle
import threading
import multiprocessing
from concurrent.futures import ThreadPoolExecutor
# required to reserve changed attributes
from pandaserver.taskbuffer import JobSpec
from pandaserver.taskbuffer import FileSpec
JobSpec.reserveChangedState = True
FileSpec.reserveC... | PanDAWMS/panda-server | pandaserver/taskbuffer/TaskBufferInterface.py | Python | apache-2.0 | 5,146 | 0.008356 |
# coding=utf-8
# This file is part of SickRage.
#
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... | Maximilian-Reuter/SickRage-1 | sickrage/providers/torrent/TorrentProvider.py | Python | gpl-3.0 | 5,136 | 0.001363 |
# Copyright 2017 gRPC 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 applicable law or agreed to in writing... | adelez/grpc | src/python/grpcio_testing/grpc_testing/_common.py | Python | apache-2.0 | 4,406 | 0.000227 |
import os
import time
import threading
import neovim
import pytest
threading.current_thread().name = "Test"
NVIM_LISTEN_ADDRESS = "/tmp/nvim-LanguageClient-IntegrationTest"
project_root = os.path.dirname(os.path.abspath(__file__))
def join_path(path: str) -> str:
"""Join path to this project tests root."""
... | autozimu/LanguageClient-neovim | tests/LanguageClient_test.py | Python | mit | 9,546 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('applicants', '0010_auto_20151126_0525'),
]
operations = [
migrations.AddField(
model_name='applicant',
... | shailr/vms | applicants/migrations/0011_applicant_number_of_missed_calls.py | Python | gpl-2.0 | 421 | 0 |
"""
Author: Ali Hajimirza (ali@alihm.net)
Copyright Ali Hajimirza, free for use under MIT license.
"""
import csv
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from algorithm import EM
import argparse
def line_plot(data_arrays, xlabel, ylabel, labels, title, f):
"""
Plots a scatter c... | A92hm/expectation-maximization | demo.py | Python | mit | 2,034 | 0.006391 |
#!/usr/bin/env python
# Copyright 2019 Google, 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... | googleapis/python-storage | samples/snippets/storage_remove_bucket_default_owner.py | Python | apache-2.0 | 1,765 | 0 |
#!/usr/bin/env python
import os.path
<<<<<<< HEAD
import re
import sys
=======
import sys
import gspread
>>>>>>> # This is a combination of 2 commits.
=======
<<<<<<< HEAD
import re
import sys
=======
import sys
import gspread
>>>>>>> # This is a combination of 2 commits.
>>>>>>> Update README.md
try:
from set... | ShivaShinde/gspread | setup.py | Python | mit | 1,845 | 0.015718 |
# Copyright 2014 Plexxi, 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 writing, ... | ekcs/congress | congress/dse/dataobj.py | Python | apache-2.0 | 3,470 | 0 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class YouJizzIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?youjizz\.com/videos/[^/#?]+-(?P<id>[0-9]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.youjizz.com/video... | nandhp/youtube-dl | youtube_dl/extractor/youjizz.py | Python | unlicense | 2,297 | 0.001741 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# 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,... | odoousers2014/odoo-addons-supplier_price | purchase_group_by_period/tests/__init__.py | Python | agpl-3.0 | 821 | 0 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ibtokin.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | ibtokin/ibtokin | manage.py | Python | mit | 805 | 0 |
# coding: latin1
## Copyright 2003-2007 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) ... | MaxTyutyunnikov/lino | obsolete/tests/8.py | Python | gpl-3.0 | 2,702 | 0.018135 |
""" The provider bits of TileStache.
A Provider is the part of TileStache that actually renders imagery. A few default
providers are found here, but it's possible to define your own and pull them into
TileStache dynamically by class name.
Built-in providers:
- mapnik (Mapnik.ImageProvider)
- proxy (Proxy)
- vector (T... | kartta-labs/mapwarper | lib/tilestache/TileStache-1.51.5/TileStache/Providers.py | Python | mit | 12,088 | 0.002978 |
# -*- coding: utf-8 -*-
""" S3 Synchronization
@copyright: 2011-15 (c) Sahana Software Foundation
@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
re... | sahana/Turkey | modules/s3/s3sync.py | Python | mit | 33,252 | 0.003248 |
"""
A test module which has a required module and a config
"""
TYPE = "Test"
NAME = "test_2"
REQUIRES = ["test_1"]
DEFAULTCONF = {'a': 1, 'b': 2}
def check(conf=DEFAULTCONF):
if None in REQUIRES:
return False
return True
def scan(filelist, conf=DEFAULTCONF):
results = []
result1, meta1 = RE... | jmlong1027/multiscanner | tests/modules/test_2.py | Python | mpl-2.0 | 649 | 0 |
##
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# Flemish Research Foundation ... | wpoely86/easybuild-easyblocks | easybuild/easyblocks/p/python.py | Python | gpl-2.0 | 8,497 | 0.003884 |
import hashlib
import os
import re
import time
import uuid
import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.staticfiles.finders import find as find_static_path
from olympia.lib.jingo_minify_helpers import ensure_path_exists
def... | atiqueahmedziad/addons-server | src/olympia/amo/management/commands/compress_assets.py | Python | bsd-3-clause | 8,858 | 0.000226 |
import re
class UnknowItem(Exception):
pass
KEYWORDS = ("and", "as", "assert", "break", "class", "continue", "def", "del", "elif", "else", "except", "exec", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "not", "or", "pass", "print", "raise", "return", "try", "while", "with", "yield")
... | cbonoz/codehealth | dependencies/baron/tokenizer.py | Python | mit | 3,585 | 0.000837 |
import os
import sys
from github import Github
from github.GithubException import GithubException
def tag_to_tag():
SRC_TAG=os.environ.get('SRC_TAG')
ORG_NAME=os.environ.get('ORG_NAME')
REPO_NAME=os.environ.get('REPO_NAME')
USERNAME=os.environ.get('USERNAME')
PASSWORD=os.environ.get('PASSWORD')
... | jorrit-steporange/CumulusCI | ci/github/tag_to_tag.py | Python | bsd-3-clause | 1,855 | 0.012399 |
#!/usr/bin/python
################
# The MIT License (MIT)
#
# Copyright (c) <2013> <Martin de Bruyn>
#
# 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... | grimfang/quickShadows | src/game/input.py | Python | mit | 4,080 | 0.002206 |
from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework.exceptions import NotFound
from framework.auth.oauth_scopes import CoreScopes
from osf.models import (
Guid,
BaseFileNode,
FileVersion,
QuickFilesNode
)
from api.base.exceptions import Go... | chennan47/osf.io | api/files/views.py | Python | apache-2.0 | 5,890 | 0.002207 |
#/usr/bin/env python
import os
import cv2
import sys
import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
disp_n = 200
s_time = 3
radius = 3
thickness = 3
cls_color = (23, 119, 188)
colors = [... | zimenglan-sysu-512/pose_action_caffe | results/pic_iou_curve.py | Python | mit | 7,311 | 0.045137 |
# based on https://github.com/pypa/sampleproject/blob/master/setup.py
# see http://packaging.python.org/en/latest/tutorial.html#creating-your-own-project
from setuptools import setup, find_packages
from setuptools.command.install import install as stdinstall
import codecs
import os
import re
import sys
def find_v... | prechelt/typecheck-decorator | setup.py | Python | bsd-2-clause | 3,969 | 0.007055 |
"""Helpers to execute scripts."""
import logging
from contextlib import suppress
from itertools import islice
from typing import Optional, Sequence
import voluptuous as vol
from homeassistant.core import HomeAssistant, Context, callback
from homeassistant.const import CONF_CONDITION, CONF_TIMEOUT
from homeassistant ... | MartinHjelmare/home-assistant | homeassistant/helpers/script.py | Python | apache-2.0 | 12,633 | 0 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRvcheck(RPackage):
"""Check latest release version of R and R package (both in 'CRAN',
... | iulian787/spack | var/spack/repos/builtin/packages/r-rvcheck/package.py | Python | lgpl-2.1 | 958 | 0.003132 |
import numpy as np
import tensorflow as tf
import dists
from misc import *
| davmre/bayesflow | elbow/util/__init__.py | Python | bsd-3-clause | 77 | 0 |
# Copyright 2019-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... | chrislit/abydos | abydos/distance/_roberts.py | Python | gpl-3.0 | 3,233 | 0 |
# subSystemBonusGallenteElectronic2TractorBeamVelocity
#
# Used by:
# Subsystem: Proteus Electronics - Emergent Locus Analyzer
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Tractor Beam",
"maxTractorVelocity"... | Ebag333/Pyfa | eos/effects/subsystembonusgallenteelectronic2tractorbeamvelocity.py | Python | gpl-3.0 | 458 | 0.004367 |
from django.db import models
from django.db.models.fields.files import FieldFile
from django.core.files import File
def get_video_dimensions(path):
from ffvideo import VideoStream
vs = VideoStream(path)
return (vs.frame_width, vs.frame_height)
class VideoFile(File):
"""
A mixin for use alongsi... | akhilari7/pa-dude | lib/python2.7/site-packages/image/video_field.py | Python | mit | 1,087 | 0 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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 Lice... | OuterDeepSpace/OuterDeepSpace | generators/osgen2.py | Python | gpl-2.0 | 27,347 | 0.037774 |
from data.database.sourceGroupAssignmentTable import getSourceIdToAssignedGroups
from data.database.sourceGroupTable import getAllSourceGroupNames
from data.database.sourceTable import getAllSources
(categoryToSourceObjects, sourceCategoryNames, sourceIdToAssignments, sourceIdToSourceObject,
unCategorizedSource) = ({... | TobyRoseman/PS4M | engine/sourceManager.py | Python | mit | 1,630 | 0.007362 |
import logging
import math
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirect, render
from django.views.generic import View
from experiments_ma... | MOOCworkbench/MOOCworkbench | user_manager/views.py | Python | mit | 7,680 | 0.004297 |
#!/usr/bin/env python
#Demo code
#
# simple demonstration script showing real-time thermal Imaging
# using the MLX90620 16x4 thermopile array and the mlxd daemon
#
# Copyright (C) 2015 Chuck Werbick
#
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the G... | alphacharlie/mlxd | mlxview.py | Python | gpl-2.0 | 3,859 | 0.007256 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0002_recipecollection_title'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields... | agnethesoraa/recipemaster | recipemaster/recipes/migrations/0003_auto_20150325_2130.py | Python | mit | 820 | 0.002439 |
# Copyright 2015, Google 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 copyright
# notice, this list of conditions and the f... | leifurhauks/grpc | src/python/grpcio/tests/unit/beta/test_utilities.py | Python | bsd-3-clause | 2,422 | 0.002064 |
from django.conf.urls.defaults import patterns, include, url
from rest_framework.urlpatterns import format_suffix_patterns
from startups import views
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('startups.views',
# Examples:
... | PredictionIO/Demo-AngelList | backend/angellist_demo/urls.py | Python | apache-2.0 | 840 | 0.009524 |
import copy
import warnings
import collections
import tempfile
import sys
import os
import sqlite3
import six
from textwrap import dedent
from gffutils import constants
from gffutils import version
from gffutils import bins
from gffutils import helpers
from gffutils import feature
from gffutils import interface
from gf... | hjanime/gffutils | gffutils/create.py | Python | mit | 50,151 | 0 |
"""
WSGI config for cv project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_M... | cthtuf/django-cv | cv/wsgi.py | Python | mit | 381 | 0 |
"""Support for Spider thermostats."""
import logging
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_COOL,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
SUPPORT_FAN_MODE,
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.const import ATTR_T... | nkgilley/home-assistant | homeassistant/components/spider/climate.py | Python | apache-2.0 | 3,866 | 0.000259 |
#!/usr/bin/env python3
# Copyright (c) 2014-present, The osquery authors
#
# This source code is licensed as defined by the LICENSE file found in the
# root directory of this source tree.
#
# SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
import glob
import os
import signal
import shutil
import time
import uni... | hackgnar/osquery | tools/tests/test_osqueryd.py | Python | bsd-3-clause | 9,307 | 0.000537 |
# -*- coding: utf-8 -*-
actions = {
"up": _(u"Go up in the current buffer"),
"down": _(u"Go down in the current buffer"),
"left": _(u"Go to the previous buffer"),
"right": _(u"Go to the next buffer"),
"next_account": _(u"Focus the next session"),
"previous_account": _(u"Focus the previous session"),
"show_hide": _(u"Sh... | codeofdusk/ProjectMagenta | src/keystrokeEditor/constants.py | Python | gpl-2.0 | 2,205 | 0.021769 |
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | Eficent/sale-workflow | product_customer_code_sale/__init__.py | Python | agpl-3.0 | 880 | 0 |
class Robot:
def __init__(self):
self.__name = ""
@property
def name(self):
return self.__name
@name.setter
def name(self, x):
self.__name = x
class Car:
def __init__(self, model=None):
self.__set_model(model)
def __set_model(self, model):
self.__model = model
def __get_model(self):
return s... | abdullahcaliskan/Python | OOP/props.py | Python | gpl-2.0 | 467 | 0.038544 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.test import TestCase
from models import Student, StudyGroup, Task, Lab, Subject, GroupSubject
class PortalTest(TestCase):
def setUp(self):
self.study_group1 = StudyGroup.objects.... | vinneyto/lab-portal | portal/test_models.py | Python | bsd-3-clause | 2,587 | 0.002052 |
#
# Copyright (C) 2008-2013 by Nicolas Piganeau
# npi@m4x.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; either version 2 of the License, or
# (at your option) any later versi... | Sharpe49/ts2 | ts2/routing/route.py | Python | gpl-2.0 | 12,444 | 0.001848 |
# -*- coding: utf-8 -*-
#
# # Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Contributing Authors:
# - Ansible Core Team
# - Eduard Snesarev (@verm666)
# - Berend De Schouwer (@berenddeschouwer)
# - Abhijeet Kasurde (@Akasurde)
# GNU General Public License v3.0+ (... | alexlo03/ansible | lib/ansible/module_utils/yumdnf.py | Python | gpl-3.0 | 6,502 | 0.001846 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserSettings'
db.create_table(u'cms_usersettings', (
(u'id', self.gf('django.db.... | SinnerSchraderMobileMirrors/django-cms | cms/migrations/0041_auto__add_usersettings.py | Python | bsd-3-clause | 15,866 | 0.00832 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | kubeflow/kfp-tekton-backend | components/gcp/container/component_sdk/python/kfp_component/google/bigquery/__init__.py | Python | apache-2.0 | 601 | 0.001664 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@gmail.com>
# This file is part of Ansible
#
# Ansible 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... | gaqzi/ansible-modules-extras | packaging/language/composer.py | Python | gpl-3.0 | 6,200 | 0.008548 |
# jsb/plugs/core/rc.py
#
#
""" jsonbot resource files .. files with the .jsb extension which consists of commands to be executed. """
## jsb imports
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
from jsb.utils.url import geturl2
from jsb.utils.exception import handle_exception
from jsb.uti... | melmothx/jsonbot | jsb/plugs/core/rc.py | Python | mit | 1,732 | 0.017321 |
from __future__ import print_function
import unittest
import numpy as np
import pydrake
import os.path
class TestRBTCoM(unittest.TestCase):
def testCoM0(self):
r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(),
"examples/Pendulum/Pendulum.urdf"))... | billhoffman/drake | drake/bindings/python/pydrake/test/testRBTCoM.py | Python | bsd-3-clause | 1,228 | 0.002443 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Brian Cherinka, José Sánchez-Gallego, and Brett Andrews
# @Date: 2018-07-24
# @Filename: test_rss.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu)
# @Last modified time: ... | sdss/marvin | tests/tools/test_rss.py | Python | bsd-3-clause | 8,275 | 0.001693 |
'''This module contains utilities for following up search triggers'''
# JavaScript for searching the aLOG
redirect_javascript = """<script type="text/javascript">
function redirect(form,way)
{
// Set location to form and submit.
if(form != '')
{
document.forms[form].action=way;
... | ligo-cbc/pycbc | pycbc/results/dq.py | Python | gpl-3.0 | 2,187 | 0.002286 |
from copy import deepcopy
from sqlalchemy import inspect
from sqlalchemy.orm.base import DEFAULT_STATE_ATTR
from sqlalchemy.orm.state import InstanceState
from mongosql.bag import ModelPropertyBags
class ModelHistoryProxy:
""" Proxy object to gain access to historical model attributes.
This leverages SqlAlc... | kolypto/py-mongosql | mongosql/util/history_proxy.py | Python | bsd-2-clause | 5,787 | 0.003974 |
#/usr/bin/env python
#Base Server -Chapter three -basicserver.py
import socket, traceback
host=''
port=8080
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
print "Waiting for connections..."
s.listen(1)
while True:
try:
clien... | jac2130/BayesGame | foundations-of-python-network-programming/python2/01/basicserver.py | Python | mit | 745 | 0.013423 |
from textwrap import dedent
from sympy import (
symbols, Integral, Tuple, Dummy, Basic, default_sort_key, Matrix,
factorial, true)
from sympy.combinatorics import RGS_enum, RGS_unrank, Permutation
from sympy.utilities.iterables import (
_partition, _set_partitions, binary_partitions, bracelets, capture,
... | hrashk/sympy | sympy/utilities/tests/test_iterables.py | Python | bsd-3-clause | 24,090 | 0.00083 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Daniel Campos (danielcampos@avanzosc.es) Date: 29/09/2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | oihane/odoomrp-wip | mrp_byproduct_operations/__init__.py | Python | agpl-3.0 | 945 | 0 |
#!/usr/bin/env python
"""
make_a_star_cluster.py creates a model star cluster,
which can then be used in N-body simulations or for other purposes.
It requires AMUSE, which can be downloaded from http://amusecode.org or
https://github.com/amusecode/amuse.
Currently not feature-complete yet, and function/argument names... | rieder/MASC | src/amuse/ext/masc/cluster.py | Python | mit | 10,655 | 0 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleinterns/local_global_ts_representation | main.py | Python | apache-2.0 | 3,904 | 0.00666 |
filenames = ['firstNames', 'secondNames', 'famousWrestlers', 'categories', 'jobs']
for filename in filenames:
with open('%s.csv' % filename, 'r') as f:
namelist = []
for name in f.read().split('\n'):
if len(name)>1: namelist.append(name)
with open('../js/%s.js' % filename, 'w') as dest_f:
dest_f.write('%... | staudt/gimmick-generator | lists/generate.py | Python | mit | 352 | 0.028409 |
#!/usr/bin/env python
# coding=utf-8
from scrapy.spiders import Spider
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor as link
from scrapy.http import Request, FormRequest
from scrapy.selector import Selector
from illustrious.items import ProblemItem, SolutionItem, AccountIt... | Coderhypo/makinami | illustrious/spiders/poj.py | Python | mit | 12,789 | 0.005943 |
##########################################################################
#
# Copyright (c) 2011, Image Engine Design 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:
#
# * Redistribu... | code-google-com/cortex-vfx | contrib/IECoreArnold/python/IECoreArnold/__init__.py | Python | bsd-3-clause | 1,852 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.