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
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
uclouvain/OSIS-Louvain
base/tests/factories/group_element_year.py
Python
agpl-3.0
2,912
0.002061
# Adapted from ASE https://wiki.fysik.dtu.dk/ase/ # # # Copyright (C) 2010, Jesper Friis # (see accompanying license files for details). """ A module for chemlab for simple creation of crystalline structures from knowledge of the space group. """ import numpy as np from collections import Counter from .spacegroup ...
chemlab/chemlab
chemlab/core/spacegroup/crystal.py
Python
gpl-3.0
7,982
0.003884
#!/usr/bin/python # -*- coding: utf-8 -*- # # Urwid LCD display module # Copyright (C) 2010 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1...
DarkPurpleShadow/ConnectFour
urwid/lcd_display.py
Python
bsd-3-clause
16,440
0.003343
# -*- coding: utf-8 -*- from django.db import migrations def create_switch(apps, schema_editor): """Create the async_order_fulfillment switch if it does not already exist.""" Switch = apps.get_model('waffle', 'Switch') Switch.objects.get_or_create(name='async_order_fulfillment', defaults={'active': Fals...
edx/ecommerce
ecommerce/core/migrations/0007_auto_20151005_1333.py
Python
agpl-3.0
780
0.002564
# -*- coding: utf-8 -*- #!/usr/bin/env python """ Created on Sun Sep 18 20:24:29 2016 """ list1 = [3, 44, 38, 5, 47, 15, 36, 26, 27, 2, 46, 4, 19, 50, 48] list2 = [1,1,1,1,1,1,1,1] list3 = [1,2,3,4,5,6,7,8] list4 = [2,3,6,7,5,2,2,2] list5 = [8,7,6,5,4,3,2,1] #检查函数 def check(func): print sort_bubble(list1)==func(lis...
zfrxiaxia/Code-zfr
visualgo数据结构/01_sort.py
Python
gpl-3.0
1,847
0.045529
"""Features modules"""
timevortexproject/timevortex
features/__init__.py
Python
mit
23
0
#!/usr/bin/env python """AFF4 objects for managing Chipsec responses.""" from grr.client.components.chipsec_support.actions import chipsec_types from grr.lib.aff4_objects import collects class ACPITableDataCollection(collects.RDFValueCollection): """A collection of ACPI table data.""" _rdf_type = chipsec_types....
destijl/grr
grr/lib/aff4_objects/hardware.py
Python
apache-2.0
334
0.005988
#!/usr/bin/env python """ 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")...
arenadata/ambari
ambari-server/src/main/resources/stacks/BigInsights/4.2.5/services/HDFS/package/alerts/alert_checkpoint_time.py
Python
apache-2.0
10,596
0.014062
from sys import exit import argparse import sobol, morris, extended_fast parser = argparse.ArgumentParser(description='Perform sensitivity analysis on model output') parser.add_argument('-m', '--method', type=str, choices=['sobol', 'morris', 'fast'], required=True) parser.add_argument('-p', '--paramfile', type...
dhyams/SALib
SALib/analyze/__main__.py
Python
lgpl-3.0
1,927
0.011936
import pybullet as p import time p.connect(p.GUI) fileIO = p.loadPlugin("fileIOPlugin") if (fileIO >= 0): p.executePluginCommand(fileIO, "pickup.zip", [p.AddFileIOAction, p.ZipFileIO]) objs = p.loadSDF("pickup/model.sdf") dobot = objs[0] p.changeVisualShape(dobot, -1, rgbaColor=[1, 1, 1, 1]) else: print("fi...
MadManRises/Madgine
shared/bullet3-2.89/examples/pybullet/examples/fileIOPlugin.py
Python
mit
457
0.017505
from streamable_archive_tests import * from delivery_collection_tests import *
vegarang/devilry-django
devilry/utils/tests/__init__.py
Python
bsd-3-clause
81
0.024691
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other 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 Foundation, either version 3 of the License, or # (at your ...
rosudrag/eve-wspace
evewspace/account/models.py
Python
gpl-3.0
4,390
0.003189
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-nupages ------------ Tests for `django-nupages` models module. """ import os import shutil import unittest from django.utils import timezone from django.core.urlresolvers import reverse from django.contrib.sites.models import Site from nupages import mo...
goldhand/django-nupages
tests/test_models.py
Python
bsd-3-clause
1,041
0.024976
#!/usr/bin/env python3 # # Copyright 2013 Simone Campagna # # 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 ...
simone-campagna/statcode
lib/python/statcode/project_file.py
Python
apache-2.0
5,340
0.004307
import pylogging import os # Logs Dir Absolute Path logs_path = os.path.dirname(os.path.abspath(__file__)) + '/logs/' # Create Logger Instance logger = pylogging.PyLogging(LOG_FILE_PATH = logs_path) def customAction1(type, msg): # Custom Action Goes Here pass # Add Action actionIden1 = logger.addAction(customActio...
Clivern/PyLogging
examples/custom_actions.py
Python
mit
773
0.01423
from django import forms from django.core.urlresolvers import reverse, NoReverseMatch from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.core.validators import URLValidator from treenav.models import MenuItem from mptt.forms import TreeNodeChoic...
NetstationMurator/django-treenav
treenav/forms.py
Python
bsd-3-clause
2,787
0.001794
from tools.load import LoadMatrix from numpy import double lm=LoadMatrix() traindat = double(lm.load_numbers('../data/fm_train_real.dat')) testdat = double(lm.load_numbers('../data/fm_test_real.dat')) traindna = lm.load_dna('../data/fm_train_dna.dat') testdna = lm.load_dna('../data/fm_test_dna.dat') parameter_list =...
ratschlab/ASP
examples/undocumented/python_modular/kernel_combined_modular.py
Python
gpl-2.0
1,900
0.036842
""" Tools for handling trade data, candle data, and simulating trades. """ from __future__ import division import os import csv import time from datetime import datetime, timedelta import itertools import traceback from decimal import Decimal, getcontext getcontext().prec = 8 from utilities import (TRADES, CANDLES, u...
AdamStone/cryptrade
cryptrade/trading.py
Python
unlicense
30,686
0.000293
from django.conf.urls import url from annotate import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^create$', views.create_annotation, name='create'), url(r'^edit$', views.edit_annotation, name='edit'), url(r'^json$', views.export_json, name='export_json'), url(r'^rdf$', views...
opensemanticsearch/open-semantic-search-apps
src/annotate/urls.py
Python
gpl-3.0
494
0.01417
# flake8: noqa """ PILKit image processors. A processor accepts an image, does some stuff, and returns the result. Processors can do anything with the image you want, but their responsibilities should be limited to image manipulations--they should be completely decoupled from the filesystem. """ from .base import *...
bzennn/blog_flask
python/lib/python3.5/site-packages/pilkit/processors/__init__.py
Python
gpl-3.0
386
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ read-bookmark.py ~~~~~~~~~~~~~~~~ This module is an example of how to harness the Readability API w/ oAuth. This module expects the following environment variables to be set: - READABILITY_CONSUMER_KEY - READABILITY_CONSUMER_SECRET - READABILITY_ACCESS_TOKEN - READA...
alexwaters/python-readability-api
examples/read-bookmarks.py
Python
mit
2,034
0.002458
def get_hero_winrate(hero): """returns hero winrate from list of meta heroes""" if hero['pro_pick'] == 0: return 0 else: return hero.get('pro_win', 0) / hero.get('pro_pick', 1) def get_hero_pick_percent(hero, heroes): return hero.get('pro_pick', 0) / get_total_pro_games(heroes) def get_hero_ban_perc...
mdiller/MangoByte
cogs/utils/metastats.py
Python
mit
738
0.004065
# Natural Language Toolkit: Product Reviews Corpus Reader # # Copyright (C) 2001-2017 NLTK Project # Author: Pierpaolo Pantone <24alsecondo@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ CorpusReader for reviews corpora (syntax based on Customer Review Corpus). - Customer Review C...
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/nltk/corpus/reader/reviews.py
Python
apache-2.0
12,534
0.002074
# Time: O(n) # Space: O(1) # # The API: int read4(char *buf) reads 4 characters at a time from a file. # # The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the file. # # By using the read4 API, implement the function int read(char *buf, int n) ...
yiwen-luo/LeetCode
Python/read-n-characters-given-read4-ii-call-multiple-times.py
Python
mit
1,921
0.006247
#!/usr/bin/python import os,sys,glob,re import numpy as np import scipy from scipy import stats import datetime import time from datetime import timedelta #import matplotlib #matplotlib.use('Agg') #import matplotlib.pyplot as plt #from matplotlib import colors as c #from matplotlib import cm from scipy.stats.kde impor...
sthyme/ZFSchizophrenia
BehaviorAnalysis/mergingbehaviordata/lmmanalysisave_septcut4and2ifsame.py
Python
mit
13,435
0.026424
# Copyright (c) 2008 Princeton University # Copyright (c) 2009 Advanced Micro Devices, 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 c...
aferr/LatticeMemCtl
src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py
Python
bsd-3-clause
2,044
0.001468
# Generated by Django 2.0.8 on 2018-10-05 19:45 from django.db import migrations from django.core.exceptions import ObjectDoesNotExist def cria_sistema_cultura(apps, schema_editor): erros = [] SistemaCultura = apps.get_model('adesao', 'SistemaCultura') Municipio = apps.get_model('adesao', 'Municipio') ...
culturagovbr/sistema-nacional-cultura
adesao/migrations/0019_auto_20181005_1645.py
Python
agpl-3.0
8,604
0.005811
# -*- coding: utf-8 -*- # # hh_psc_alpha.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, o...
terhorstd/nest-simulator
pynest/examples/hh_psc_alpha.py
Python
gpl-2.0
2,263
0
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'OrganizationOption' db.create_table('sentry_organizationo...
JackDanger/sentry
src/sentry/south_migrations/0212_auto__add_organizationoption__add_unique_organizationoption_organizati.py
Python
bsd-3-clause
40,363
0.008052
#------------------------------------------------------------------------------------------ # # Copyright 2017 Robert Pengelly. # # This file is part of ppa-helper. # # 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 # ...
robertapengelly/ppa-helper
ppa_helper/compat.py
Python
gpl-3.0
3,031
0.002639
#!/usr/bin/python import os import shutil from trac.util.compat import close_fds # On Windows, shutil.rmtree doesn't remove files with the read-only # attribute set, so this function explicitly removes it on every error # before retrying. Even on Linux, shutil.rmtree chokes on read-only # directories, so we...
i-rabot/tractogithub
tracformatter/trac/tests/functional/compat.py
Python
bsd-3-clause
650
0.003077
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('academics', '0016_student_auth_key'), ('courseevaluations', '0004_auto_20151208_1004'), ] operations = [ migrations....
rectory-school/rectory-apps
courseevaluations/migrations/0005_auto_20151208_1014.py
Python
mit
877
0
# test concurrent interning of strings # # MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd import _thread # function to check the interned string def check(s, val): assert type(s) == str assert int(s) == val # main thread function def th(base, n): for i in range(n): # this...
mhoffma/micropython
tests/thread/thread_qstr1.py
Python
mit
825
0.004848
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus # # MAUS 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. # # MAUS...
mice-software/maus
src/common_py/calibration/get_kl_calib.py
Python
gpl-3.0
3,304
0.003329
""" Client for the library API. """ class LibraryClient(object): """ Library API client. """ def __init__(self,axilent_connection): self.content_resource = axilent_connection.resource_client('axilent.library','content') self.api = axilent_connection.http_client('axilent.library') ...
aericson/Djax
pax/library.py
Python
bsd-3-clause
3,541
0.017509
import pyhwtherm mytest = pyhwtherm.PyHWTherm( username="someuser@example.com", password="mysecretpassword", deviceid=123456 ) print "login successful: ",mytest.login() print "Get thermostat data:", mytest.updateStatus() beforeChange = mytest.status print "Status: ", beforeChange mytes...
texnofobix/pyhwtherm
example.py
Python
mit
739
0.014885
#!/usr/bin/env python # encoding: utf-8 import sqlite3 from sys import version_info if version_info >= (3, 0, 0): def listkey(dicts): return list(dicts.keys())[0] else: def listkey(dicts): return dicts.keys()[0] class sqlitei: '''Encapsulation sql.''' def __init__(self, path): ...
54Pany/gum
data/libdbs.py
Python
gpl-3.0
1,870
0.002674
"""Support for INSTEON dimmers via PowerLinc Modem.""" import logging from homeassistant.helpers.entity import Entity from .insteon_entity import InsteonEntity _LOGGER = logging.getLogger(__name__) async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the INSTEON devi...
postlund/home-assistant
homeassistant/components/insteon/sensor.py
Python
apache-2.0
876
0.001142
import unittest import wire class TestSQLString(unittest.TestCase): def setUp(self): '''Sets up the test case''' self.sql = wire.SQLString def test_pragma(self): '''Tests the PRAGMA SQL generation''' self.assertEqual(self.sql.pragma("INTEGRITY_CHECK(10)"), "PRAGMA INTEGRITY_CHECK(10)") self.assertEqual(s...
panchr/wire
wire/tests/sqlstring_test.py
Python
gpl-3.0
1,665
0.027628
from glob import glob import pylab as pyl import h5py as hdf files = glob('ML_predicted_masses*') # get the power law masses with hdf.File('../results_cluster.hdf5', 'r') as f: dset = f[f.keys()[0]] results = dset.value # make a figure f = pyl.figure(figsize=(6, 6 * (pyl.sqrt(5.) - 1.0) / 2.0)) ax = f.add_su...
boada/vpCluster
data/boada/analysis_all/MLmethods/plot_massComparison_scatter.py
Python
mit
1,151
0.002606
import unittest from .context import json_stable_stringify_python as stringify class TestStringify(unittest.TestCase): def test_simple_object(self): node = {'c':6, 'b': [4,5], 'a': 3, 'z': None} actual = stringify.stringify(node) expected = '{"a":3,"b":[4,5],"c":6,"z":null}' self.as...
haochi/json-stable-stringify-python
tests/test_stringify.py
Python
mit
1,700
0.004118
""" Django settings for accountant project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os import sys from decimal import Decimal import accounting V...
dulaccc/Accountant
accountant/settings/common.py
Python
mit
5,873
0.000851
############################################################################## # # Copyright Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS ...
dcm-oss/blockade
blockade/tests/util.py
Python
apache-2.0
1,956
0.001022
""" Shogun demo Fernando J. Iglesias Garcia """ import numpy as np import matplotlib as mpl import pylab import util from scipy import linalg from shogun.Classifier import QDA from shogun.Features import RealFeatures, MulticlassLabels # colormap cmap = mpl.colors.LinearSegmentedColormap('color_classes', {'red': ...
ratschlab/ASP
examples/undocumented/python_modular/graphical/multiclass_qda.py
Python
gpl-2.0
3,312
0.038647
from floyd.client.base import FloydHttpClient from floyd.model.version import CliVersion from floyd.log import logger as floyd_logger class VersionClient(FloydHttpClient): """ Client to get API version from the server """ def __init__(self): self.url = "/cli_version" super(VersionClien...
houqp/floyd-cli
floyd/client/version.py
Python
apache-2.0
580
0
from ymir import app app.run(debug=True, host='0.0.0.0', port=2841)
Ymir-RPG/ymir-api
run.py
Python
apache-2.0
70
0
""" Scrapy - a web crawling and web scraping framework written for Python """ __all__ = ['__version__', 'version_info', 'twisted_version', 'Spider', 'Request', 'FormRequest', 'Selector', 'Item', 'Field'] # Scrapy version import pkgutil __version__ = pkgutil.get_data(__package__, 'VERSION').decode('ascii')....
eLRuLL/scrapy
scrapy/__init__.py
Python
bsd-3-clause
1,151
0.007819
from django.db.models import Transform from django.db.models import DateTimeField, TimeField from django.utils.functional import cached_property class TimeValue(Transform): lookup_name = 'time' function = 'time' def as_sql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) ...
mivanov-utwente/t4proj
t4proj/apps/stats/models.py
Python
bsd-2-clause
481
0.002079
from openerp.osv import fields,osv import time import openerp.addons.decimal_precision as dp from openerp.tools.translate import _ from openerp import pooler from openerp import netsvc import base64 from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from openerp.addons.Edumedi...
trabacus-softapps/docker-edumedia
additional_addons/Edumedia_India/ed_sale.py
Python
agpl-3.0
56,005
0.017034
# coding=utf-8 import sys def read(client, vlans, cnames, print_warnings): lines = [] if cnames: for cname in client.list_cnames(): lines.append('cname\t' + cname['name']) lines.append('target\t' + cname['canonical']) lines.append('') for vlan in client.list_vla...
booski/hostdb9
dns_reader.py
Python
gpl-2.0
1,853
0.001619
# 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 may ...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py
Python
mit
54,887
0.005265
""" Provides XML parsing support. """ from django.conf import settings from rest_framework.exceptions import ParseError from rest_framework.parsers import BaseParser import defusedxml.ElementTree as etree class XMLCompanyParser(BaseParser): """ XML company parser. """ media_type = 'application/xml' ...
bgroff/kala-app
django_kala/api/basecamp_classic/companies/parsers.py
Python
mit
2,236
0
# Copyright 2018 Google LLC. 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 a...
PAIR-code/interpretability
text-dream/python/helpers/setup_helper.py
Python
apache-2.0
3,457
0.010703
from uber.tests import * class TestCosts: @pytest.fixture(autouse=True) def mocked_prices(self, monkeypatch): monkeypatch.setattr(c, 'get_oneday_price', Mock(return_value=10)) monkeypatch.setattr(c, 'get_attendee_price', Mock(return_value=20)) def test_badge_cost(self): assert 10 ...
md1024/rams
uber/tests/models/test_attendee.py
Python
agpl-3.0
16,952
0.001829
from abc import ABCMeta, abstractmethod class AbstractConsumer(metaclass=ABCMeta): """ This class provides facilities to create and manage queue consumers. To create a consumer, subclass this class and override the :meth:`run` method. Then, instantiate the class with the desired parameters and call ...
gst/amqpy
amqpy/consumer.py
Python
mit
2,846
0.000351
import os def NormalizedJoin( *args ): "Normalizes and joins directory names" return os.path.normpath(os.path.join(*args))
DavidYen/YEngine
ypy/path_help.py
Python
mit
129
0.03876
"""Tests for certbot_dns_route53._internal.dns_route53.Authenticator""" import unittest from botocore.exceptions import ClientError from botocore.exceptions import NoCredentialsError try: import mock except ImportError: # pragma: no cover from unittest import mock # type: ignore from certbot import errors fr...
stweil/letsencrypt
certbot-dns-route53/tests/dns_route53_test.py
Python
apache-2.0
9,471
0.00095
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'PiezaConjunto.fragmentos' db.delete_column(u'cachi_piez...
data-tsunami/museo-cachi
cachi/migrations/0008_auto__del_field_piezaconjunto_fragmentos.py
Python
gpl-3.0
15,336
0.007303
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
forkbong/qutebrowser
qutebrowser/utils/usertypes.py
Python
gpl-3.0
16,178
0.000124
# Copyright: Damien Elmes <anki@ichi2.net> # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import re import signal import zipfile from send2trash import send2trash from aqt.qt import * from anki import Collection from anki.utils import isWin, isMac, intTime, spl...
timrae/anki
aqt/main.py
Python
agpl-3.0
39,738
0.000906
#! /usr/bin/env python import os import time import traceback import re import locale import subprocess import zlib import zipfile import private.metadata as metadata import private.messages as messages from glob import glob from private.exceptionclasses import CustomError, CritError, SyntaxError, Logic...
gslab-econ/gslab_python
gslab_make/dir_mod.py
Python
mit
9,540
0.005346
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011, Nicolas Clairon # 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 cop...
namlook/MongoLite
mongolite/schema_document.py
Python
bsd-3-clause
17,726
0.002369
# -*- coding: utf-8 -*- # Copyright 2020 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...
googleads/google-ads-python
google/ads/googleads/v9/services/services/conversion_value_rule_set_service/transports/__init__.py
Python
apache-2.0
1,117
0
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
tzpBingo/github-trending
codespace/python/tencentcloud/sqlserver/v20180328/models.py
Python
mit
284,748
0.002484
from pygame.mixer import music as _music from .loaders import ResourceLoader from . import constants __all__ = [ 'rewind', 'stop', 'fadeout', 'set_volume', 'get_volume', 'get_pos', 'set_pos', 'play', 'queue', 'pause', 'unpause', ] _music.set_endevent(constants.MUSIC_END) class _MusicLoader(ResourceLoader):...
yrobla/pyjuegos
pgzero/music.py
Python
lgpl-3.0
2,526
0.000396
from .requests_test import RequestsTest import copy import sys class XSSTest(RequestsTest): def test(self): if self.DEBUG: print("Run the XSS Tests") passed = 0 failed = 0 messages = [] url = self.domain['protocol'] + self.domain['host'] + self.config['path'] print(...
sethlaw/sputr
tests/xss_test.py
Python
gpl-3.0
3,768
0.005308
import contextlib from time import time from .meter import Meter from .stats import Stat from .histogram import Histogram class Timer(Stat): def __init__(self): self.count = 0 self.meter = Meter() self.histogram = Histogram() super(Timer, self).__init__() @contextlib.contextm...
emilssolmanis/tapes
tapes/local/timer.py
Python
apache-2.0
702
0
#!/usr/bin/env python import re letters = 'abcdefghijklmnopqrstuvwxyz' with open("../input/11.txt") as fileobj: password = fileobj.readline().strip() print password def rules(password): rules = [ rule1, rule2, rule3 ] if all(rule(password) for rule in rules): return True else: return False def rule1(passwo...
dsumike/adventofcode
python/11p2.py
Python
mit
1,491
0.032193
# 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 # distributed under the Li...
ismail-s/warehouse
tests/unit/i18n/test_init.py
Python
apache-2.0
1,632
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2012 Nebula Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
developerworks/horizon
horizon/tests/authors_tests.py
Python
apache-2.0
2,188
0.001371
# Patchwork - automated patch tracking system # Copyright (C) 2017 Stephen Finucane <stephen@that.guru> # # SPDX-License-Identifier: GPL-2.0-or-later from collections import OrderedDict from rest_framework.generics import ListAPIView from rest_framework.serializers import ModelSerializer from rest_framework.serialize...
stephenfin/patchwork
patchwork/api/event.py
Python
gpl-2.0
3,356
0
""" GWR is tested against results from GWR4 """ import unittest import pickle as pk from pysal.contrib.gwr.gwr import GWR from pysal.contrib.gwr.sel_bw import Sel_BW from pysal.contrib.gwr.diagnostics import get_AICc, get_AIC, get_BIC, get_CV from pysal.contrib.glm.family import Gaussian, Poisson, Binomial import nump...
ljwolf/pysal
pysal/contrib/gwr/tests/test_gwr.py
Python
bsd-3-clause
45,280
0.009408
from __future__ import division, absolute_import, unicode_literals from qtpy import QtWidgets from qtpy.QtCore import Qt from . import cmds from . import gitcmds from . import hotkeys from . import icons from . import qtutils from . import utils from .i18n import N_ from .widgets import completion from .widgets impor...
Vdragon/git-cola
cola/difftool.py
Python
gpl-2.0
6,355
0.000157
import tensorflow as tf ''' Model for sequence classification and localization with weighted loss ''' class DeepLocalizationWeightedLossVariableLengthDeeper: def get_name(self): return "deep_localization_weighted_loss_variable_length_6" def input_placeholders(self): inputs_placeholder = tf.p...
thePetrMarek/SequenceOfDigitsRecognition
sequences_of_variable_length/deep_localization_weighted_loss_variable_length_deeper.py
Python
mit
7,054
0.00241
# -------------------------------------------------------------------# # Released under the MIT license (https://opensource.org/licenses/MIT) # Contact: mrinal.haloi11@gmail.com # Enhancement Copyright 2016, Mrinal Haloi # -------------------------------------------------------------------# import random import os impo...
n3011/deeprl
train_dqn.py
Python
mit
1,042
0.00096
# framework/modules/get_modem_info.py # # Copyright 2011 Spencer J. McIntyre <SMcIntyre [at] SecureState [dot] net> # # 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...
firebitsbr/termineter
framework/modules/get_modem_info.py
Python
gpl-3.0
3,174
0.015123
from typing import Union from ray.rllib.models.action_dist import ActionDistribution from ray.rllib.utils.annotations import override from ray.rllib.utils.exploration.exploration import TensorType from ray.rllib.utils.exploration.soft_q import SoftQ from ray.rllib.utils.framework import try_import_tf, try_import_torch...
ray-project/ray
rllib/utils/exploration/slate_soft_q.py
Python
apache-2.0
1,483
0.000674
import numpy as np class PriceHistoryPack(object): def __init__(self, input_seq_len, num_features, target_seq_len): super(PriceHistoryPack, self).__init__() self.sku_ids = [] self.XX = np.empty((0, input_seq_len, num_features)) self.YY = np.empty((0, target_seq_len)) self.s...
pligor/predicting-future-product-prices
04_time_series_prediction/data_providers/price_history_pack.py
Python
agpl-3.0
2,640
0.003788
import windows.generated_def as gdef def test_format_charactere_values(): assert gdef.FC_ZERO == 0 assert gdef.FC_PAD == 0x5c assert gdef.FC_PAD == 0x5c assert gdef.FC_SPLIT_DEREFERENCE == 0x74 assert gdef. FC_SPLIT_DIV_2 == 0x75 assert gdef.FC_HARD_STRUCT == 0xb1 assert gdef.FC_TRANSMIT_A...
hakril/PythonForWindows
tests/test_midl.py
Python
bsd-3-clause
380
0.013158
# -*- coding: utf-8 -*- import re from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo from module.plugins.internal.SimpleHoster import seconds_to_midnight class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" __version__ = "0.15" __status__ = "testin...
jansohn/pyload
module/plugins/hoster/HighWayMe.py
Python
gpl-3.0
2,588
0.008114
# -*- 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 'ActivityMigrationProgress' db.create_table('activity_activitymigrationprogress', ( ...
wevoice/wesub
apps/activity/migrations/0002_auto__add_activitymigrationprogress.py
Python
agpl-3.0
21,651
0.00799
from nct.utils.alch import Session, LSession from nct.domain.instrument import Instrument import random import functools import time from nct.deploy.deploy import Deployer import cProfile INSTRUMENTS = ['GOOGL.O', 'TWTR.N', 'GS.N', 'BAC.N', 'IBM.N'] def profile_method(file_name = None): def gen_wrapper(func): ...
kozyarchuk/NCT-workers
tests/perf/pscrap.py
Python
gpl-2.0
1,216
0.011513
# flake8: noqa from __future__ import absolute_import, unicode_literals import warnings from feincms.extensions.ct_tracker import * warnings.warn( 'Import %s from feincms.extensions.%s' % (__name__, __name__), DeprecationWarning, stacklevel=2)
mcmaxwell/idea_digital_agency
idea/feincms/module/extensions/ct_tracker.py
Python
mit
255
0
# pyui2 # Copyright (C) 2001-2002 Sean C. Riley # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # bu...
Ripsnorta/pyui2
widgets/formpanel.py
Python
lgpl-2.1
7,289
0.006311
#!/bin/python import sys,os,sqlite3,time,ntpath,psycopg2,grp,pwd from random import randint class color: PURPLE = '\033[95m' CYAN = '\033[96m' DARKCYAN = '\033[36m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' BOLD = '\033[1m' UNDERLINE = '\033[4m' END = '\033...
pglivebackup/pgchain
pgchain.py
Python
mit
26,324
0.02454
def f(s): s = s[::-1] return s.swapcase() result = f(f(f(f(f('abcdef'))))) # breakpoint
allotria/intellij-community
python/testData/debug/stepping/test_smart_step_into_native_function_in_return.py
Python
apache-2.0
99
0
# Natural Language Toolkit: Chatbots # # Copyright (C) 2001-2013 NLTK Project # Authors: Steven Bird <stevenbird1@gmail.com> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT # Based on an Eliza implementation by Joe Strout <joe@strout.net>, # Jeff Epler <jepler@inetnebr.com> and Jez Higgins <je...
bbengfort/TextBlob
textblob/nltk/chat/__init__.py
Python
mit
1,546
0.001294
# flake8: noqa from .store import Store from .errors import StoreError, CredentialsNotFound from .constants import *
jarv/cmdchallenge-site
lambda_src/runcmd/dockerpycreds/__init__.py
Python
mit
116
0.008621
# 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...
kumar303/rockit
vendor-local/boto/rds/dbsnapshot.py
Python
bsd-3-clause
2,724
0.001468
''' Created on Mar 1, 2017 @author: PJ ''' from Scouting2017.model.reusable_models import Team from BaseScouting.views.submissions.submit_bookmark import BaseUpdateBookmarks class UpdateBookmarks2017(BaseUpdateBookmarks): def __init__(self): BaseUpdateBookmarks.__init__(self, Team)
ArcticWarriors/scouting-app
ScoutingWebsite/Scouting2017/view/submissions/submit_bookmark.py
Python
mit
299
0
""" This component provides HA sensor support for Ring Door Bell/Chimes. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.ring/ """ from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import ...
jamespcole/home-assistant
homeassistant/components/ring/sensor.py
Python
apache-2.0
6,215
0
#!/usr/bin/env python3 ############################################################################### # # VFR importer based on GDAL library # # Author: Martin Landa <landa.martin gmail.com> # # Licence: MIT/X # ############################################################################### """ Imports VFR data to P...
ctu-osgeorel/gdal-vfr
vfr2pg.py
Python
mit
5,000
0.0034
import numpy as np import scipy as sp import scipy.interpolate import requests from io import StringIO def qvalues(pv, m = None, verbose = False, lowmem = False, pi0 = None): """ Copyright (c) 2012, Nicolo Fusi, University of Sheffield All rights reserved. Estimates q-values from p-values Args ...
mfitzp/padua
padua/utils.py
Python
bsd-2-clause
9,476
0.004538
from __future__ import absolute_import, division, print_function import os from time import ctime from qtpy import QtWidgets from glue import core from glue.utils.qt import load_ui class MessageWidget(QtWidgets.QWidget, core.hub.HubListener): """ This simple class displays all messages broadcast by a hub. I...
stscieisenhamer/glue
glue/core/qt/message_widget.py
Python
bsd-3-clause
1,541
0
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class] module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol']) typ...
annegabrielle/secure_adhoc_network_ns-3
ns3_source_code/ns-3.10/bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py
Python
gpl-2.0
11,439
0.012763
#!/usr/bin/python import imaplib import sys import random import os import threading import time import types import subprocess SERVER = "localhost" USER = ["ftfstest1", "ftfstest2", "ftfstest3", "ftfstest4", "ftfstest5", "ftfstest6", "ftfstest7", "ftfstest8", "ftfstest9", "ftfstest10", "ftfstest11", "ftfstest12", "ft...
oscarlab/betrfs
benchmarks/aging/mailserver/mailserver-aging.py
Python
gpl-2.0
2,672
0.030689
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin # not sure about line 7 admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^dropzone-drag-drop/$', inc...
vdmann/cse-360-image-hosting-website
src/mvp_landing/urls.py
Python
mit
1,288
0.003882
from sqlalchemy import Column, MetaData, Table from sqlalchemy import DateTime, Integer, String, Text from sqlalchemy import ForeignKeyConstraint, UniqueConstraint from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.orm import backref, dynamic_loader, mapper, relation from sqlalchemy.orm.colle...
dongjinleekr/wpdb
wpdb.py
Python
apache-2.0
16,291
0.008348
import pymysql from flask_restful import Resource from flask import abort ALLOWED_SHOW = ('processlist', 'databases', 'plugins', 'privileges') class Mysql(Resource): def __init__(self): self.connection = pymysql.connect(user='root') self.cursor = self.connection.cursor() def _execute(self, s...
natict/roomservice
roomservice/mysql.py
Python
mit
1,306
0
# -*- coding: utf-8 -*- # # Copyright (c) 2014, Florian Wesch <fw@dividuum.de> # 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 copy...
phase/ApplePi
fastmc/auth.py
Python
mit
7,818
0.004861