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
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub usun\xc4\x85\xc4\x87 wynik\xc3\xb3w z JOIN:', '%Y-%m...
montaggroup/montag-token-redeemer
web2py/applications/token_redeemer/languages/pl-pl.py
Python
gpl-3.0
3,788
0.022703
# -*- coding: utf-8 -*- """ This file is part of checkmate, a meta code checker written in Python. Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG 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 Foun...
ArnossArnossi/checkmate
checkmate/contrib/plugins/python/metrics/issues_data.py
Python
agpl-3.0
813
0.00246
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
Fendoe/open-hackathon-o
open-hackathon-server/src/hackathon/util.py
Python
mit
5,753
0.001912
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ## ...
AlbertoPeon/invenio
modules/bibformat/lib/elements/bfe_references.py
Python
gpl-2.0
3,979
0.012315
"""Runs the Treadmill container cleanup job. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import click from treadmill import appenv from treadmill import cleanup from treadmill import cli from treadmill import...
Morgan-Stanley/treadmill
lib/python/treadmill/sproc/cleanup.py
Python
apache-2.0
1,571
0
# -*- coding:utf-8 -*- __version__ = '2.6.0+whyfly.3'
whyflyru/django-seo
djangoseo/version.py
Python
bsd-3-clause
54
0
# encoding: 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 'NodeGroup' db.create_table('muparse_nodegroup', ( ('url', self.gf('django....
leopoul/mupy
muparse/migrations/0001_initial.py
Python
apache-2.0
7,178
0.00822
import re from django.db import transaction from django.db.models import Count, Q from django.utils.translation import ugettext_lazy as _ from rest_framework.decorators import api_view from rest_framework.exceptions import NotFound, ParseError from rest_framework.request import Request from rest_framework.response imp...
PrivacyScore/PrivacyScore
privacyscore/api/views.py
Python
gpl-3.0
7,028
0.000711
import re import glob import math import logging import os from autotest.client import utils from autotest.client.shared import error # Returns total memory in kb def read_from_meminfo(key): cmd_result = utils.run('grep %s /proc/meminfo' % key, verbose=False) meminfo = cmd_result.stdout return int(re.sear...
rbian/virt-test
virttest/staging/utils_memory.py
Python
gpl-2.0
8,312
0.001444
import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype, IntervalDtype from pandas import ( CategoricalIndex, Index, IntervalIndex, NaT, Timedelta, Timestamp, interval_range, ) import pandas._testing as tm class Base: """Tests common to IntervalIndex w...
TomAugspurger/pandas
pandas/tests/indexes/interval/test_astype.py
Python
bsd-3-clause
7,740
0.000904
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Get stats about your activity. Example: - my_activity.py for stats for the current week (last week on mondays). - my_activ...
coreos/depot_tools
my_activity.py
Python
bsd-3-clause
36,618
0.009504
import requests import logging import urllib2 import traceback import threading from yumcache import growingblob class Downloader(threading.Thread): INVALID_LENGTH = -1 def __init__(self, common, path, url): self._common = common self._path = path self._url = url self._content...
Stratoscale/yumcache
yumcache/downloader.py
Python
apache-2.0
5,695
0.003687
from __future__ import annotations from ..typecheck import * from ..import ui from ..import dap from . import css from .breakpoints_panel import BreakpointsPanel from .input_list_view import InputListView if TYPE_CHECKING: from ..debugger import Debugger class DebuggerPanel(ui.div): on_settings: Callable[[], ...
dmilith/SublimeText3-dmilith
Packages/Debugger/modules/views/debugger_panel.py
Python
mit
3,906
0.027906
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys from os.path import abspath, dirname, join if sys.getdefaultencoding() != 'utf-8': reload(sys) sys.setdefaultencoding('utf-8') PREFIX = abspath( join( dirname(abspath(__file__)), '../' ) ) if PREFIX not in sys.path: sys.path.append(...
PegasusWang/pyhome
test/_env.py
Python
mit
328
0
"""Module to handle messages from Home Assistant cloud.""" import asyncio import logging from aiohttp import hdrs, client_exceptions, WSMsgType from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.components.alexa import smart_home from homeassistant.util.decorator import Registry from homeassi...
ewandor/home-assistant
homeassistant/components/cloud/iot.py
Python
apache-2.0
7,667
0
from functions import * from settings import * import urllib def required_permission(permissions=[]): # this is a handler level decorator def decorator(fn): def wrapper(self, *args, **kwargs): if not self.user.permissions: self.render("frontend/error404.html") ...
opengovt/ckan-agency-management-tool
decorators.py
Python
agpl-3.0
2,547
0
import sqlite3 con = sqlite3.connect("mydb") cur = con.cursor() who = "Yeltsin" age = 72 cur.execute("select name_last, age from people where name_last=:who and age=:age", locals()) print(cur.fetchone())
invisiblek/python-for-android
python3-alpha/python3-src/Doc/includes/sqlite3/execute_3.py
Python
apache-2.0
212
0.009434
"""Support for ADS sensors.""" import logging import voluptuous as vol from homeassistant.components import ads from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT import homeassistant.helpers.config_validation as cv from . import CONF_ADS_F...
nkgilley/home-assistant
homeassistant/components/ads/sensor.py
Python
apache-2.0
2,424
0.001238
import unittest from conans.model.options import OptionsValues, PackageOptions, Options, PackageOptionValues,\ option_undefined_msg from conans.model.ref import ConanFileReference from conans.test.utils.tools import TestBufferConanOutput from conans.errors import ConanException class OptionsTest(unittest.TestCase...
tivek/conan
conans/test/model/options_test.py
Python
mit
12,830
0.001871
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License. import json from azurelinuxagent.common.protocol.restapi import ExtensionStatus from azurelinuxagent.ga.exthandlers import parse_ext_status from tests.tools import * class TestExtHandlers(AgentTestCase): def test_par...
andyliuliming/WALinuxAgent
tests/ga/test_exthandlers.py
Python
apache-2.0
2,603
0.000768
#!/usr/bin/env python # -*- coding: utf-8 -*- from pytube import __version__ import os try: from setuptools import setup except ImportError: from distutils.core import setup def open_file(fname): return open(os.path.join(os.path.dirname(__file__), fname)) setup( name="pytube", version=__versi...
mserjx/pytube
setup.py
Python
mit
1,352
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com> # See LICENSE for details. import sys, os from gevent import select, monkey, spawn, Greenlet, GreenletExit, sleep, socket from base64 import b64encode from hashlib import md5 from struct import pack, unpack from zl...
yann2192/vpyn
Client.py
Python
gpl-3.0
2,459
0.004067
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
vanant/googleads-dfa-reporting-samples
python/v2.0/create_image_creative.py
Python
apache-2.0
3,754
0.005328
""" Glue for interfacing with a farm object """ import os import ast from .constants import HealthStatus def imagesAndStatuses(outputDir): """ Return a dictionary of images and corresponding human assigned statuses from output. """ controlPath = os.path.join(outputDir, 'controls', 'HealthImageryControl...
ForeverWintr/ImageClassipy
clouds/util/farmglue.py
Python
mit
2,342
0.003416
# Copyright 2015 TellApart, 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 writi...
WiserTogether/aurproxy
tellapart/aurproxy/share/adjusters/ramp.py
Python
apache-2.0
2,700
0.007407
# 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 ...
jkonecki/autorest
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ModelFlattening/autorestresourceflatteningtestservice/models/resource.py
Python
mit
1,309
0.001528
# -*- coding: utf-8 -*- """ Copyright (C) 2013 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # Bunch from bunch import Bunch # Zato from zato.common import zato_namespace fr...
alirizakeles/zato
code/zato-server/test/zato/server/service/internal/kvdb/data_dict/test_impexp.py
Python
gpl-3.0
1,497
0.004008
import re, datetime from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.http import Http404 from django.views.generic import date_based, list_detail from basic.events.models import * def event_list(request, page=0): return list_detail.object_l...
sedden/django-basic-apps
basic/events/views.py
Python
bsd-3-clause
1,774
0.003946
#!/usr/bin/env python # TODO.TXT-CLI-python # Copyright (C) 2011-2012 Sigmavirus24 # # 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 option) any ...
mstave/Todo.txt-python
todo.py
Python
gpl-3.0
36,444
0.005213
class ParsingState(object): """ States of the parsing process. """ wait_for_header = 0 wait_for_section = 1 inside_section = 2 end = 4
leandron/steinlib
steinlib/state.py
Python
mit
163
0
SIMPLE_SETTINGS = { 'OVERRIDE_BY_ENV': True } MY_VAR = u'Some Value'
drgarcia1986/simple-settings
tests/samples/special.py
Python
mit
74
0
# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. # # 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 la...
genenetwork/genenetwork2_diet
wqflask/base/data_set.py
Python
agpl-3.0
45,353
0.00452
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-07-10 07:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('person', '0049_patient_photo'), ] operations = [ migrations.RenameField( ...
nanomolina/JP
src/odontology/person/migrations/0050_auto_20160710_0431.py
Python
apache-2.0
422
0
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + #pylint: disable=W0403,R0902,R0903,R0904,W021...
mganeva/mantid
scripts/HFIR_4Circle_Reduction/detector2dview.py
Python
gpl-3.0
14,054
0.00249
from django.contrib import admin from eventex.core.models import Talk from eventex.core.models import Course from eventex.core.models import Speaker from eventex.core.models import Contact class ContactInline(admin.TabularInline): model = Contact extra = 1 class SpeakerModelAdmin(admin.ModelAdmin): i...
adrianomargarin/wttd-eventex
eventex/core/admin.py
Python
gpl-3.0
1,325
0.000755
from __future__ import division import argparse import logging import csv import io from website.app import setup_django setup_django() from osf.metrics import PreprintDownload logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def generate_preprint_csv(preprint_ids): search = Prepri...
pattisdr/osf.io
scripts/remove_after_use/find_timeseries_preprints.py
Python
apache-2.0
1,686
0.004152
#!/usr/bin/env python # # Copyright 2007 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 o...
Suwmlee/XX-Net
gae_proxy/server/lib/google/appengine/api/yaml_listener.py
Python
bsd-2-clause
7,554
0.003839
''' Created on May 21, 2016 @author: zlp ''' # import Image hello = 100 class PILTest(object): hello = 200 def __init__(self, name): self._name = name def printName(self): print self._name def printHelloInClass(self): print self.hello class2 = PILTest...
blackboarddd/PyTest
mstr/PILTest.py
Python
gpl-3.0
2,261
0.01946
# -*- coding: utf-8 - # # This file is part of socketpool. # See the NOTICE for more information. import contextlib import sys import time from socketpool.util import load_backend class MaxTriesError(Exception): pass class MaxConnectionsError(Exception): pass class ConnectionPool(object): """Pool of co...
interactiveinstitute/watthappened
python_modules/socketpool/pool.py
Python
mit
6,292
0.000795
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import openerp from openerp import tools from openerp.osv import osv, fields class product_style(osv.Model): _name = "product.style" _columns = { 'name' : fields.char('Style Name', required=True), ...
syci/OCB
addons/website_sale/models/product.py
Python
agpl-3.0
9,392
0.006601
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 option) any l...
KodiColdkeys/coldkeys-addons
repository/plugin.video.white.devil/resources/lib/sources/dailyrls_wp_jh.py
Python
gpl-2.0
6,200
0.018065
if not (str(1.0) == "1"): from boot import * import tokenize,parse,encode def _compile(s,fname): tokens = tokenize.tokenize(s) t = parse.parse(s,tokens) r = encode.encode(fname,s,t) return r def _import(name): if name in MODULES: return MODULES[name] py = name+".py" tpc = name...
EcmaXp/PyCraft
misc/tinypy/tinypy/py2bc.py
Python
gpl-2.0
1,121
0.02587
class Solution(object): _memo = {} def canWin(self, s): """ :type s: str :rtype: bool """ memo = self._memo if s not in memo: return any(s[i:i+2] == '++' and not self.canWin(s[:i] + '-' + s[i+2:]) for i in range(len(s))) return memo[s]
Mlieou/oj_solutions
leetcode/python/ex_294.py
Python
mit
311
0.009646
# PyJVM (pyjvm.org) Java Virtual Machine implemented in pure Python # Copyright (C) 2014 Andrew Romanenco (andrew@romanenco.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 Software Foundation, either version ...
andrewromanenco/pyjvm
pyjvm/class_path.py
Python
gpl-3.0
3,299
0
# -*- coding: utf-8 -*- #Copyright (C) Fiz Vazquez vud1@sindominio.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 License, or (at your option) any later version. #T...
pytrainer/pytrainer
pytrainer/gui/windowcalendar.py
Python
gpl-2.0
1,204
0.016611
# (C) British Crown Copyright 2013 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
jkettleb/iris
lib/iris/tests/unit/fileformats/pp/test_PPField.py
Python
lgpl-3.0
11,449
0
# -*- coding: utf-8 -*- import npyscreen2 class EscapeForwardingContainer(npyscreen2.Container): def set_up_exit_condition_handlers(self): super(EscapeForwardingContainer, self).set_up_exit_condition_handlers() self.how_exited_handlers.update({'escape': self.h_exit_escape}) class EscapeForwardi...
SavinaRoja/Kerminal
kerminal/escape_forwarding_containers.py
Python
gpl-3.0
574
0.001742
import numpy as np from scipy.optimize import linear_sum_assignment def munkres(arr): temp = np.zeros(arr.shape, np.bool) ind = linear_sum_assignment(arr) temp[ind] = True return temp
braysia/CellTK
celltk/utils/_munkres.py
Python
mit
201
0.004975
# -*- coding: utf-8 -*- """ A class to load the SeparatorRegion of a PageXml to add features to the edges of a graph conjugate used for segmentation. It specialises the _index method to add specific attributes to the edges , so that the specific feature transformers can be used. Copyright...
Transkribus/TranskribusDU
TranskribusDU/graph/pkg_GraphBinaryConjugateSegmenter/PageXmlSeparatorRegion.py
Python
bsd-3-clause
6,028
0.008461
from rest_framework.routers import SimpleRouter from api.ingestjobs import views router = SimpleRouter() router.register(r'ingestjobs', views.IngestJobViewSet, basename='ingestjob') urlpatterns = router.urls
CenterForOpenScience/SHARE
api/ingestjobs/urls.py
Python
apache-2.0
210
0
# This file is part of VoltDB. # Copyright (C) 2008-2016 VoltDB Inc. # # 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...
paulmartel/voltdb
lib/python/voltcli/voltadmin.d/show.py
Python
agpl-3.0
1,129
0.008857
from __future__ import absolute_import from __future__ import with_statement import sys import time from kombu.tests.utils import redirect_stdouts from mock import Mock, patch import celery.utils.timer2 as timer2 from celery.tests.utils import Case, skip_if_quick class test_Entry(Case): def test_call(self): ...
mozilla/firefox-flicks
vendor-local/lib/python/celery/tests/utilities/test_timer2.py
Python
bsd-3-clause
4,966
0
"""check for method without self as first argument """ __revision__ = 0 class Abcd(object): """dummy class""" def __init__(self): pass def abcd(yoo): """another test""" abcd = classmethod(abcd) def edf(self): """justo ne more method""" print('y...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/pylint/test/input/func_e0203.py
Python
agpl-3.0
339
0
# -*- coding: utf-8 -*- from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo class CryptItCom(DeadCrypter): __name__ = "CryptItCom" __type__ = "crypter" __version__ = "0.12" __status__ = "testing" __pattern__ = r'http://(?:www\.)?crypt-it\.com/(s|e|d|c)/\w+' __c...
fayf/pyload
module/plugins/crypter/CryptItCom.py
Python
gpl-3.0
542
0.012915
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json import frappe.utils import frappe.share import frappe.defaults import frappe.desk.form.meta from frappe.permissions import get_doc_permissions from frappe impo...
pombredanne/frappe
frappe/desk/form/load.py
Python
mit
4,558
0.027644
#!/usr/bin/python3 # test_agent_agg_context.py import os import unittest import sys root_fldr = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.insert(0, root_fldr) import aikif.agents.aggregate.agg_context as mod_agg class TestAgentAggContext(unittest.TestCase): def test_01_(self): ...
acutesoftware/AIKIF
aikif/.z_prototype/test_agent_agg_context.py
Python
gpl-3.0
559
0.010733
import os import yaml import time from datetime import datetime def get_all_csv_paths(path): csv_paths = [] for root, dirs, files in os.walk(path): for file in files: if file.endswith(".csv"): csv_paths.append(os.path.join(root, file)) return csv_paths def date_str_to...
newspipe/newspipe
dags/dag_factory/components/utils.py
Python
agpl-3.0
1,480
0.004054
#!/usr/bin/env python3.6 import sys sys.path.insert(1, 'lib') import os import json import logging import requests from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter logger = logging.getLogger() logger.setLevel(logging.INFO) # Retry until AWS Lambda function times out ret...
alestic/townclock-ping-timercheck
code/lambda_function.py
Python
apache-2.0
1,751
0.006282
# -*- coding: utf-8 -*- ''' Created on 2018年3月27日 @author: baimb ''' import logging as log log.basicConfig(level=log.INFO, format='%(asctime)s - [%(filename)s:%(funcName)s:%(lineno)s] - %(message)s') import os import platform import tensorflow as tf from image_similarity import ImageSimilaritySearch ...
ljbin/meiyou
soft/identifyporn/avatar_model.py
Python
apache-2.0
8,414
0.007776
# Copyright (c) 2011-2012 Florian Mounier # Copyright (c) 2012-2014 roger # Copyright (c) 2012 Craig Barnes # Copyright (c) 2012-2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sebastian Kricner # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of...
zordsdavini/qtile
libqtile/dgroups.py
Python
mit
8,861
0.000451
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joel Grand-Guillaume # Copyright 2011-2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
hbrunn/bank-statement-reconcile
account_statement_transactionid_completion/__init__.py
Python
agpl-3.0
971
0
from submission import Submission from heapq import * class AyoubSubmission(Submission): def author(self): return 'Ayoub' def run(self, s): s = s.rstrip() N = int(s) start = 1, 1 goal = 31,39 def is_wall(x, y): r = x*x + 3*x + 2*x*y + y + y*y ...
lypnol/adventofcode-2016
day-13/part-1/ayoub.py
Python
gpl-3.0
1,423
0.007027
from openarticlegauge import plugin class mock_licence_plugin(plugin.Plugin): _short_name="mock_doi" def capabilities(self): return { "type_detect_verify" : False, "canonicalise" : [], "detect_provider" : [], "license_detect" : True } def supp...
CottageLabs/OpenArticleGauge
openarticlegauge/tests/plugins/test_workflow/test_11_1/test_11_1.py
Python
bsd-3-clause
543
0.016575
# Python standard modules import pandas as pd # Own modules from PLR_optclass import PLRMarket import PLR_optimization as plrmodel def PeakLoadReserveFunction(): market = PLRMarket() market.optimize() df_generators = market.data.generators gens_for_zones = market.data.gens_for_country ...
Thomsen22/MissingMoney
Peak Load Reserve - EU system/PLR_function.py
Python
gpl-3.0
4,572
0.013123
# Copyright 2017 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import os from c7n.utils import reset_session_cache from contextlib import contextmanager def account_tags(account): tags = {'AccountName': account['name'], 'AccountId': account['account_id']}...
capitalone/cloud-custodian
tools/c7n_org/c7n_org/utils.py
Python
apache-2.0
814
0
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 ...
ujdhesa/unisubs
apps/videos/types/bliptv.py
Python
agpl-3.0
2,824
0.003895
"""This module is used first to read input files and create year, [word] dict""" __author__ = 'kamat' import unittest from parse_zip import write_year_title class ParseZipTest(unittest.TestCase): def test_write_year_title(self): """This method is used to create year, [word] dict that nsf_stats.py uses to ...
ixlab/trendquery
offline/src/parse_zip_test.py
Python
apache-2.0
528
0.003788
# Create your views here. from django import forms from django.template import RequestContext from django.http import HttpResponse, HttpResponseRedirect from django.template.loader import get_template from django.core.paginator import Paginator from django.core.urlresolvers import reverse import datetime from...
HarrisonHDU/myerp
apps/depot/views.py
Python
mit
4,631
0.002385
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import sys import petl as etl from petl.test.helpers import ieq from petl.io.pandas import todataframe, fromdataframe try: # noinspection PyUnresolvedReferences import pandas as pd except ImportError as e: print('...
psnj/petl
petl/test/io/test_pandas.py
Python
mit
1,286
0
""" This module exposes the BaseClient class, which serves as base for InnerRPCClient and TransferClient. """ __RCSID__ = "$Id$" import time import thread import DIRAC from DIRAC.Core.DISET.private.Protocols import gProtocolDict from DIRAC.FrameworkSystem.Client.Logger import gLogger from DIRAC.Core.Utilities imp...
Andrew-McNab-UK/DIRAC
Core/DISET/private/BaseClient.py
Python
gpl-3.0
26,577
0.025247
############################################################################### # Name: kix.py # # Purpose: Syntax configuration module for KIXtart scripts # # Author: Cody Precord <cprecord@editra.org> # ...
garrettcap/Bulletproof-Backup
wx/tools/Editra/src/syntax/_kix.py
Python
gpl-2.0
4,682
0.001709
from datetime import datetime, timedelta from io import StringIO import itertools import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, Series, Timestamp, compat, date_range, option_context, ) from pandas.core.arrays import IntervalArray, integer...
toobaz/pandas
pandas/tests/frame/test_block_internals.py
Python
bsd-3-clause
22,034
0.000499
from utils.ols import * ########before preproccessing betas_before_process = apply_ols_to_subject(16, 3, r_outliers = False, smooth = False) ##average across all runs avg_before = average_betas(betas_before_process) ## shape to 4d avg_before = beta_2d_to_4d(avg_before) plt.figure() plt.imshow(avg_before[:,...
juanshishido/project-eta
code/make_plots_smoothing.py
Python
bsd-3-clause
1,263
0.020586
import re from sqlalchemy.sql import func from sqlalchemy.types import String, TypeDecorator # https://bitbucket.org/zzzeek/sqlalchemy/issues/3729/using-array_agg-around-row-function-does class ArrayOfRecord(TypeDecorator): _array_regexp = re.compile(r"^\{(\".+?\")*\}$") _chunk_regexp = re.compile(r'"(.*?)"...
getsentry/zeus
zeus/db/func.py
Python
apache-2.0
1,373
0.002185
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import logging import argparse #import subprocess import json import pywemo import urllib.request import urllib.error import urllib.parse import socketserver from datetime import datetime __version__ = '0.93' logging.basicConfig(level=logging.DEBUG, ...
minscof/wemoJeedomPlugin
resources/wemo_server.py
Python
gpl-3.0
16,264
0.001969
# =============================================================================== # Copyright 2011 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
UManPychron/pychron
pychron/canvas/canvas2D/extraction_line_canvas2D.py
Python
apache-2.0
10,949
0.001005
import logging import os import sys from django_extensions.management.signals import post_command, pre_command def _make_writeable(filename): """ Make sure that the file is writeable. Useful if our source is read-only. """ import stat if sys.platform.startswith('java'): # On Jython t...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/django_extensions/management/utils.py
Python
agpl-3.0
2,188
0.001828
# -*- coding: utf-8 -*- ''' State module to manage Elasticsearch indices .. versionadded:: 2015.8.0 ''' # Import python libs from __future__ import absolute_import import logging # Import salt libs log = logging.getLogger(__name__) def absent(name): ''' Ensure that the named index is absent ''' r...
smallyear/linuxLearn
salt/salt/states/elasticsearch_index.py
Python
apache-2.0
2,188
0.001828
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2017-11-26 15:14 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('generic', '0003_auto_20170...
BQLQ/BQLQ
drum-0.4.0/drum/links/migrations/0003_auto_20171126_2314.py
Python
bsd-2-clause
1,322
0.003026
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib import json data = {} data['type_blank'] = 'a' data['from_name'] = 'Ивана Ивановича' data['from_city'] = 'г. Москва' data['from_street'] = 'ул. Стахановская' data['from_build'] = '999' data['from_appartment'] = '99' data['from_zip'] = '109428' data['whom_su...
pbrf/example_api_python
example.py
Python
mit
862
0.001277
"""Manage HTTP servers with CherryPy.""" import warnings import cherrypy from cherrypy.lib import attributes from cherrypy._cpcompat import basestring # We import * because we want to export check_port # et al as attributes of this module. from cherrypy.process.servers import * class Server(ServerAdapter): """...
2mny/mylar
lib/cherrypy/_cpserver.py
Python
gpl-3.0
7,535
0.005574
import os, sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import apx import unittest import remotefile import autosar class TestApxDataType(unittest.TestCase): def setUp(self): pass def test_create_uint8_type(self): dt = apx.DataType('MyU8_T','C') ...
cogu/py-apx
tests/data_type_test.py
Python
mit
3,285
0.006088
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:", } } ROOT_URLCONF = 'linklist.tests.urls' STATIC_URL = '/static/' MEDIA_URL = '/media/' STATIC_ROOT = os.pa...
bitmazk/django-linklist
linklist/tests/test_settings.py
Python
mit
2,306
0
"""SCons.Environment Base class for construction Environments. These are the primary objects used to communicate dependency and construction information to the build engine. Keyword arguments supplied when the construction Environment is created are construction variables used to initialize the Environment """ # # ...
h4ck3rm1k3/OpenWrt-Firefly-SDK
staging_dir/host/lib/scons-2.3.1/SCons/Environment.py
Python
gpl-2.0
96,203
0.002276
# coding: utf-8 from datetime import datetime from flask import Flask from flask import render_template from views.todos import todos_view app = Flask(__name__) app.register_blueprint(todos_view, url_prefix='/todos') @app.route('/') def index(): return render_template('index.html') @app.route('/time') def t...
sdjcw/python-getting-started
app.py
Python
mit
638
0
from __future__ import unicode_literals from .models import lambda_backends from ..core.models import base_decorator, deprecated_base_decorator lambda_backend = lambda_backends["us-east-1"] mock_lambda = base_decorator(lambda_backends) mock_lambda_deprecated = deprecated_base_decorator(lambda_backends)
william-richard/moto
moto/awslambda/__init__.py
Python
apache-2.0
305
0
from .gcc_executor import GCCExecutor, MAX_ERRORS class ClangExecutor(GCCExecutor): arch = 'clang_target_arch' def get_flags(self): return self.flags + ['-ferror-limit=%d' % MAX_ERRORS] @classmethod def get_version_flags(cls, command): return ['--version']
DMOJ/judge
dmoj/executors/clang_executor.py
Python
agpl-3.0
293
0
#!/usr/bin/env python3 # ver 0.1 - coding python by Hyuntae Jung on 6/1/2017 import argparse parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, description='Initial coordiante of particles for MC simulation') ## args #parser.add_argument('-i', '--input', default='init...
jht0664/Utility_python_gromacs
MonteCarlo/python/initial.py
Python
mit
9,683
0.030776
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-04-08 23:26 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0006_author_has_github_task'), ('app', '0006_auto_20170405_1957'), ] operati...
TeamAADGT/CMPUT404-project-socialdistribution
social/app/migrations/0007_merge_20170408_2326.py
Python
apache-2.0
334
0
import pandas as pd class Condition: """ A condition maps gene names to numbers which often represent expression levels. Parameters ---------- condition_name: str A unique name identifying the condition. gene_mapping: pd.Series A pandas Series holding the gene to...
AaronWatters/inferelator_strawman
inferelator_strawman/condition.py
Python
bsd-2-clause
1,467
0.004772
import serial, sys class SerialComm(): def __init__(self, serial_device): try: self.ser = serial.Serial(serial_device, 9600, timeout=5) except serial.serialutil.SerialException, e: print "Unable to open serial port "+serial_device sys.exit() def close(self): self.ser.close() def...
Hainish/cerealbox
server/serial_comm.py
Python
gpl-3.0
372
0.024194
#!/usr/bin/python import sys import numpy as np import Bio.PDB as bp import tess.threedee.model.coarse_grain as ttmc import borgy.graph.graph_pdb as cgg import borgy.visual.pymol as cvp from optparse import OptionParser def main(): usage = './bounding_box_coords.py temp.comp temp.pdb' usage += "Print out ...
pkerpedjiev/ernwin
fess/scripts/bounding_box_coords.py
Python
agpl-3.0
2,959
0.007435
# coding: utf-8 # Copyright 2014 Globo.com Player authors. All rights reserved. # Use of this source code is governed by a MIT License # license that can be found in the LICENSE file. from collections import namedtuple import os import errno import math try: import urlparse as url_parser except ImportError: i...
JaxxC/goodgame.xbmc
plugin.video.goodgame/resources/lib/m3u8/model.py
Python
gpl-2.0
22,352
0.002058
from typing import List class Solution: def transformArray2(self, arr: List[int]) -> List[int]: while True: arr2 = [a for a in arr] changed = 0 for id in range(1, len(arr) - 1): l = arr[id - 1] r = arr[id + 1] m = arr[id] ...
lmmsoft/LeetCode
LeetCode-Algorithm/1243. Array Transformation/1243.py
Python
gpl-2.0
992
0.002016
#!/usr/bin/python #Filename: user_query_strings.py #Author: Bryce Drew #Date: Sept. 30, 2015 #Functionality: #These are sparql queries. They are designed to be specific for the user ontology: from sparql.endpoint import Endpoint def add_literal_by_email(email, predicate, literal): update = """ PREFIX emai...
kevinkle/semantic
superphy/src/upload/python/sparql/user.py
Python
apache-2.0
2,243
0.009808
#!/usr/bin/python ################################################################################# # # The MIT License (MIT) # # Copyright (c) 2015 Dmitry Sovetov # # https://github.com/dmsovetov # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documen...
dmsovetov/pygling
Pygling/__main__.py
Python
mit
3,421
0.042093
from ase import * from espresso import espresso from ase.lattice import bulk import matplotlib matplotlib.use('Agg') #turn off screen output so we can plot from the cluster import matplotlib.pyplot as plt import numpy as np metal = 'Pt' metal2 = None # if you have an alloy, specify the second metal name = metal if...
CBE544/CBE544.github.io
ASE/Getting_Started/run_sp.py
Python
gpl-2.0
2,085
0.026859
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Server Module Patrick Jose Pereira April 2018 ''' import time import json import socket from threading import Thread from flask import Flask from werkzeug.serving import make_server from MAVProxy.modules.lib import mp_module def mavlink_to_json(msg): '''Translate...
ArduPilot/MAVProxy
MAVProxy/modules/mavproxy_restserver.py
Python
gpl-3.0
5,314
0.002446
# -*- coding: utf-8 -*- # # Copyright © 2014 René Samselnig # # This file is part of Database Navigator. # # Database Navigator 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, ...
resamsel/dbnavigator
src/dbmanagr/wrapper.py
Python
gpl-3.0
3,349
0
# Copyright 2013-2015 ARM Limited # # 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...
freedomtan/workload-automation
wlauto/workloads/andebench/__init__.py
Python
apache-2.0
3,485
0.003443