input
stringclasses
1 value
context
stringlengths
5.05k
188k
answers
stringlengths
22
82
length
int32
502
23.3k
dataset
stringclasses
1 value
language
stringclasses
1 value
all_classes
null
_id
stringlengths
48
48
"""Tools for parsing a regular expression into a Pattern.""" import collections import string import charsource import pattern as p # Characters that represent themselves in a regular expression. # TODO(jasonpr): Handle $ and ^ specially at edges of regex. _CHAR_LITERALS = string.ascii_letters + string.digits + '!"#$%&...
if _parse_verbatim(source, '[:%s:]' % class_name):
850
lcc_e
python
null
da4a2050450c0e6dbb46728a24c2681051dcf60db99aed6b
# -*- coding: utf-8 -*- """ Created on Tue Nov 8 14:27:22 2016 @author: Viktor """ import numpy as np from sklearn.datasets import fetch_mldata from matplotlib import pyplot as plt from skimage.io import imread from skimage.io import imshow from skimage.morphology import opening, closing from scipy import ndimage from...
check = numbers[5][123]
502
lcc_e
python
null
3a9e8b1453db3c2f6454e9ee3926124b1bbca244e7f8e637
import gtk import gobject import pygame import pygame.event class _MockEvent(object): def __init__(self, keyval): self.keyval = keyval class Translator(object): key_trans = { 'Alt_L': pygame.K_LALT, 'Alt_R': pygame.K_RALT, 'Control_L': pygame.K_LCTRL, 'Control_R': pygame...
self.__tick_id = gobject.timeout_add(10, self._tick_cb)
703
lcc_e
python
null
8470084fed939b4e4fcf2f79678790b3986d9ec82bc29985
import json import os import sys from datetime import datetime, timedelta import wptserve from wptserve import sslutils from . import environment as env from . import instruments from . import mpcontext from . import products from . import testloader from . import wptcommandline from . import wptlogging from . import w...
handler = handlers.LogLevelFilter(logged_critical, "CRITICAL")
1,196
lcc_e
python
null
2477e626c89426f565807bbc5e35a472279f3e388787ac17
# -*- coding: utf-8 -*- """ This module contains a POI Manager core class which gives capability to mark points of interest, re-optimise their position, and keep track of sample drift over time. Qudi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publishe...
if self.getState() == 'idle':
885
lcc_e
python
null
e59f877d3863977e0c9a383546007617a3bcb1d48ab84132
#!/usr/bin/python # # 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 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
if self.interface == 'all':
1,718
lcc_e
python
null
ac75f42af7295a6d31f508d44bcc5ac42fd665147ac86554
""" Convert human-editable CSV files into JSON files, used by the web application. """ import json import csv from io import StringIO from datetime import datetime ################################################################################ # CONFIG # behavior categories to include in the JSON file categories = se...
behavior_list = [ checkOnTour(tourlist, o,
609
lcc_e
python
null
a9b4285cd9b366f640dd9663e9dd44dfdc153065ee32a6d8
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com> # Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk> # Copyright (C) 2007-2009 Stephane Charet...
footer = self.write_footer(None)
960
lcc_e
python
null
eed31a60b2b619d0d6e7f0a366fbd64a29d110c6a51d5a73
#!/usr/bin/env python ''' Fly Helicopter in SITL AP_FLAKE8_CLEAN ''' from __future__ import print_function from arducopter import AutoTestCopter from common import AutoTest from common import NotAchievedException, AutoTestTimeoutException from pymavlink import mavutil from pysim import vehicleinfo class AutoTestHelicop...
if abs(m.relative_alt) > max_relalt_mm:
577
lcc_e
python
null
afc69ae78edec70b690890e285882cf26620106e9a4ecc3d
import json from django.core.management import call_command from django.test import TestCase from bulk_adding.models import RawPeople from candidates.tests.uk_examples import UK2015ExamplesMixin from official_documents.models import OfficialDocument from parties.tests.factories import PartyFactory from parties.tests.fi...
("O`NEAL \nCarol Joy", "Carol Joy O'Neal"),
919
lcc_e
python
null
471d9cb59a1c21652129c86006d9d0c5592f5e0867def0cb
""" This module provides an abstraction for working with XModuleDescriptors that are stored in a database an accessible using their Location as an identifier """ import logging import re import json import datetime from uuid import uuid4 from pytz import UTC from collections import namedtuple, defaultdict import collec...
if sort[0] == 'uploadDate':
1,853
lcc_e
python
null
f3072fdefd4e8da2e7e9faf48cffb40392217553f43722a7
# unionrepo.py - repository class for viewing union of repository changesets # # Derived from bundlerepo.py # Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com> # Copyright 2013 Unity Technologies, Mads Kiilerich <madski@unity3d.com> # # This software may be used and distributed according to the terms of the # ...
parentpath = parentpath[len(cwd):]
795
lcc_e
python
null
ccc7e6259fdffd163ebd0d5779c4ced9624d7b3d215079cf
# # Copyright (c) 2015-2018 Canonical, Ltd. # # This file is part of Talisker # (see http://github.com/canonical-ols/talisker). # # 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 # regardin...
if sys.version_info[0] == 2:
897
lcc_e
python
null
17f8060bda3eea4e6b94e07ca7850afadc2a42895f40a08a
""" Step definitions for working with Django models. """ from datetime import datetime import re from django.core.management import call_command from django.core.management.color import no_style from django.db import connection from django.db.models.loading import get_models from django.utils.functional import curry fr...
for k, v in hash_.iteritems():
546
lcc_e
python
null
7ae84ee3dc227ab3ad301914db5aa12c8e0ecb2042da37aa
## This file is part of Invenio. ## Copyright (C) 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 ## License, or (at your option) any later versio...
return page_not_authorized(req=req, referer="/edit",
756
lcc_e
python
null
04e295ceba60a64b82588ffaa2a96d5c35e2e469380e6944
# Copyright (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com> # Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __futur...
- {key: usetty, section: ssh_connection}
968
lcc_e
python
null
372cbea864b598e206205434a3c9016ac96913fb9e29fd56
# -*- coding: utf-8 -*- ## ## This file is part of Harvesting Kit. ## Copyright (C) 2013, 2014, 2015 CERN. ## ## Harvesting Kit 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...
record_add_field(rec, '300', subfields=[('a', page_count)])
1,283
lcc_e
python
null
86663145e9262154f0a3a437a533c6207187300f593522f9
# coding: utf8 # This file is part of Scapy # Scapy 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 # any later version. # # Scapy is distributed in the hope that it will be...
lambda pkt: pkt.commandId == 0x6f),
625
lcc_e
python
null
7be7d972146bae6e379a2e75d85d7a8103d8d6cef2e618fd
import os import warnings import numpy as np from photon_tools.io import timetag_parse, pt2_parse, metadata time_ch_dtype = np.dtype([('time', 'u8'), ('chan', 'u1')]) def verify_monotonic(times, filename): """ Verify that timestamps are monotonically increasing """ if len(times) == 0: return negatives = tim...
exts = supported_extensions()
653
lcc_e
python
null
61d1532f1b1f27850e6b4a51d10754f0cd32ef74d49068e3
#!/usr/bin/env python3 """Compute the auto and cross-correlation of delta fields for a list of IGM absorption. This module follow the procedure described in sections 4.3 of du Mas des Bourboux et al. 2020 (In prep) to compute the distortion matrix """ import time import argparse import multiprocessing from multiprocess...
out_list += [weights_dmat_all[index]]
1,374
lcc_e
python
null
679f7e9fbff5d78f3c5e8e268644626790d4fa5fa3997cae
from enum import Enum from collections import defaultdict from pathlib import Path from typing import Dict, List, Optional, TextIO, Union import re from .config import LIST_TYPE_TAGS, TAG_KEY_MAPPING, WOK_TAG_KEY_MAPPING, WOK_LIST_TYPE_TAGS __all__ = ["load", "loads"] class RisImplementation(Enum): BASE = "base" ...
obj = obj.lstrip("\ufeff")
676
lcc_e
python
null
558f671494850fdb1783371aa9016d6202151b1b538c13a5
import os import random import re import socket import subprocess import time import zipfile import tempfile import base64 import shutil import sys from io import BytesIO import pytest from contextlib import contextmanager from multiprocessing import Process from urllib.request import urlopen, Request from werkzeug.dat...
res = c.get("/")
919
lcc_e
python
null
868c857f4c55cf95b3e5964786bc9bfb558a134958ed9614
from __future__ import with_statement, print_function # Script for building the _ssl and _hashlib modules for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session # for the actual _ssl.pyd and _hashlib.pyd DLLs. # THEORETICALLY, you can: # * Unpack the...
if arch == "amd64":
982
lcc_e
python
null
c737e0826af057af7bdde835b7d29b5b6e193c58c82a25f4
from io import BytesIO from translate.convert import prop2po, test_convert from translate.storage import po, properties class TestProp2PO: @staticmethod def prop2po(propsource, proptemplate=None, personality="java"): """helper that converts .properties source to po source without requiring files""" ...
options = self.help_check(options, "-P, --pot")
1,336
lcc_e
python
null
b2821f4a0fef62fd70ef5f4e22b1d56b272a3581d330dac8
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
module = AnsibleModule(argument_spec=fields,
1,009
lcc_e
python
null
e199272f351e3f6118b8425dc96ee820466bf95092f4e4a1
#!/usr/bin/env python import socket import struct import threading import time import dns from dnsdisttests import DNSDistTest try: range = xrange except NameError: pass class TestTCPShort(DNSDistTest): # this test suite uses a different responder port # because, contrary to the other ones, its # respon...
soaResponse = dns.message.make_response(query)
648
lcc_e
python
null
aab6e3b1dcab2261ae6d783a39b356522fa6e32c6b4b0579
# Copyright (c) 2006,2007 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...
path += '?' + query_args
1,198
lcc_e
python
null
c48d09a8554b241e4d79956b75662da87b99458aa872b0de
"""Container and Namespace classes""" import anydbm import cPickle import logging import os import time import beaker.util as util from beaker.exceptions import CreationAbortedError, MissingCacheParameter from beaker.synchronization import _threading, file_synchronizer, \ mutex_synchronizer, NameLock, null_synchro...
if os.access(self.file + os.extsep + ext, os.F_OK):
1,142
lcc_e
python
null
d63d19ecf556ea2e1d2bd315c79a39046985507ff2dd2eb9
# -*- coding: utf-8 -*- from ast import literal_eval from pprint import pformat import os import shutil from errbot import BotPlugin, botcmd from errbot.plugin_manager import PluginConfigurationException, PluginActivationException from errbot.repo_manager import RepoException class Plugins(BotPlugin): @botcmd(admin...
all_plugins = self._bot.plugin_manager.get_all_plugin_names()
833
lcc_e
python
null
50511e2d36d05cdb890a54b72403a62d4a131cdfd6350426
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
"vdom": {"required": False, "type": "str"}
1,164
lcc_e
python
null
4dd6d387cd79be7f92c54f193f47ae6ab681a0ecc6ae3dba
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Loic Blot (@nerzhul) <loic.blot@unix-experience.fr> # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_im...
if state == 'present':
2,176
lcc_e
python
null
2d9194c77a619cfea6ab57817de1e00fa23d7a47b317043a
"""This tutorial introduces restricted boltzmann machines (RBM) using Theano. Boltzmann Machines (BMs) are a particular form of energy-based model which contain hidden variables. Restricted Boltzmann Machines further restrict BMs to those without visible-visible and hidden-hidden connections. """ import timeit try: ...
of log(sigmoid(..)) and will not apply the wanted
1,545
lcc_e
python
null
2f4b3c5fc9ed076b95ed19ce205e786f9d4793438d046e27
import subprocess import cfg import util import shutil import os import time import tempfile import easywebdav import filecmp import threading import Queue import sys import random import hashlib from nose.tools import with_setup from nose.tools import assert_raises # # NOTE: following tests have been implemented using...
name, checksum = checksums.get(block=False)
599
lcc_e
python
null
9e99b91db2d990fbd559f63ba39622bf1c97aaa7f105a287
# 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 3 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be usefu...
dest = args[0]
655
lcc_e
python
null
087a12a2ee41ab7a59bdf67a92f3e49b77514c4b6dc1816e
# Copyright (c) 2011-2015 Rusty Wagner # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed...
result += [DATA_ORIGINAL] * mem_len
1,032
lcc_e
python
null
9d1ef6b62bf709d7490cbf236f15ee8ef609e6aff8c231cf
"""Imports: defaultdict: for multidimensional dictionaries (implicitly instantiating the nested dictionaries as the dimensions are accessed) operator: sorting dictionaries os: writing the collection out to disk """ from collections import defaultdict import operator import os class TrackCollection(o...
for song in self.collection[artist][album]:
826
lcc_e
python
null
50c8a624b72c93ccf1b9dc94cc56cefefc09ed423276260c
# -*- coding: utf-8 -*- ########################## Copyrights and license ############################ # # # Copyright 2011-2015 Christian Lupien <christian.lupien@usherbrooke.ca> # # ...
if dev_obj == self.fetch:
4,119
lcc_e
python
null
8315f5f7696d567019104d0bca173bb58486f52c04ab7202
""" Copyright (C) 2011-2015 Parametric Products Intellectual Holdings, LLC This file is part of CadQuery. CadQuery 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...
s = Workplane().box(1,1,1).faces("+Z").edges().fillet(0.1)
4,053
lcc_e
python
null
edc5a05e949253312fe2af3c4fcdab85f5bf23272d2a6b86
# coding=utf-8 # Python Standard Library Imports from time import sleep from math import atan, atan2, sqrt # External Imports pass # Custom Imports from pycomms import PyComms, u_to_s, qv_mult class MPU6050: # Register map based on Jeff Rowberg <jeff@rowberg.net> source code at # https://github.com/jrowberg/i2c...
fifoCount = self.getFIFOCount()
6,204
lcc_e
python
null
a4bf3f805b8466b1223216081b5cf014eeddec9df3c3867e
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import itertools import json import erpnext import frappe import copy from frappe.utils.pdf import get_pdf import pdfkit import os from erpnext.controll...
names = names['names']
4,346
lcc_e
python
null
e6ef26f48ff864846fd354ceed186901245ee88c5aa2b90f
""" Test split modulestore w/o using any django stuff. """ from mock import patch import datetime from importlib import import_module from path import Path as path import random import re import unittest import uuid from contracts import contract from nose.plugins.attrib import attr from django.core.cache import ge...
'deleting_user', parent.version_agnostic(), category_queue[0]
4,289
lcc_e
python
null
271ef4fcd93c2d0dcdf4e07cc25ce775594a0c381c7b448f
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
ir_values_obj = pooler.get_pool(cr.dbname).get('ir.values')
4,578
lcc_e
python
null
d67076d9d7bf62b5c38c0440629a0ded22f13c821ac9e30b
import os import re import json import time import subprocess from decimal import Decimal from urllib import urlopen, quote, unquote_plus from django.conf import settings from django.views import generic from django.contrib import messages from django.core.urlresolvers import reverse from django.contrib.auth.models imp...
5: SortableHeader('Outline', False, '', 'col-center'),
4,072
lcc_e
python
null
6db294b63c7ab23de37dff9e04724eb68d907ebb6dae1161
from __future__ import unicode_literals import copy import inspect import warnings from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned, ...
field = opts.get_field(unique_check[0])
4,513
lcc_e
python
null
811329a16ff2d3a22ff0d09ca64e9653d8c42c93e0a05f02
# Run optimization of radii and gamma factors to minimize differences between deltaGcalc and deltaGexp # INPUT: # > experimental deltaG # > template geometries in MOPAC input format, previusly optimized with the method to test # > initial radii values in a file from commonfunctions import * # common function fro...
for key, value in sorted(paramtestdic.iteritems()):
4,363
lcc_e
python
null
94bb9fcc9960c219f0729ff1ef8ec12d68b4b09712b835f4
# bundle2.py - generic container format to transmit arbitrary data. # # Copyright 2013 Facebook, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Handling of the new bundle2 format The goal of bundle2 is to act as an atomica...
while len(h) == 20:
4,561
lcc_e
python
null
dc69884722b73150bb62984666db56f2f16f5f14793e8856
# -*- coding: utf-8 -*- # Copyright Martin Manns # Distributed under the terms of the GNU General Public License # -------------------------------------------------------------------- # pyspread is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
cas = literal_eval(cas_data_str)
5,088
lcc_e
python
null
bb1bd3c077e648b3344f219ca187ca7214cc79803cf4e4c9
#!/usr/bin/env python # py2/3 compatibility from __future__ import print_function try: from builtins import range, bytes from itertools import izip, chain except ImportError: from itertools import chain izip = zip # standard lib imports import os import glob import time import shutil import pickle from ...
seq = self.seqs[nidx]
7,755
lcc_e
python
null
192744c2c14f9572bfc3d71ced42504e69ccf49d2ec9d39a
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import babel.dates import collections from datetime import datetime, timedelta from dateutil import parser from dateutil import rrule from dateutil.relativedelta import relativedelta import logging from oper...
data['rrule_type'] = rrule_type[rule._freq]
4,433
lcc_e
python
null
03cceaae7e78f9d216abf00dd46b4252a23ef664a49a90af
#! /usr/bin/env python from miasm.loader.cstruct import CStruct class Ehdr(CStruct): _fields = [ ("ident","16s"), ("type","u16"), ("machine","u16"), ("version","u32"), ("entry","ptr"), ("phoff","ptr"), ("shoff","ptr"), ...
DT_PPC64_OPD = (DT_LOPROC + 1)
6,803
lcc_e
python
null
752810f3c699f5d0c43979ff990a3efa5574fa10a2e4c194
""" # Copyright Anne M. Archibald 2008 # Released under the scipy license """ import sys from heapq import heappush, heappop import math import numpy as np import scipy.sparse __all__ = ['minkowski_distance_p', 'minkowski_distance', 'haversine_distance', 'distance_matrix', 'Rectangle', 'KDTree'] R...
sd[node.split_dim] = np.abs(node.split - x[node.split_dim])
5,233
lcc_e
python
null
dacd21514a5f3df4693975193338f4a10d81f39af653e3ec
# -*- coding: utf-8 -*- from datetime import datetime import json import logging import re from urllib import urlencode try: from cStringIO import cStringIO as StringIO except: from StringIO import StringIO import newrelic.agent from pyquery import PyQuery as pq from tower import ugettext_lazy as _lazy, ugettex...
doc = parent_doc.translations.get(locale=document_locale)
4,854
lcc_e
python
null
ecaeaa9e3094860fecd69a5572e6bac80ccc445e259a0bf1
"""Sorted List ============== :doc:`Sorted Containers<index>` is an Apache2 licensed Python sorted collections library, written in pure-Python, and fast as C-extensions. The :doc:`introduction<introduction>` is the best way to get started. Sorted list implementations: .. currentmodule:: sortedcontainers * :class:`Sorte...
return self.__class__(values, key=self._key)
7,674
lcc_e
python
null
d11b4d760bd1b3107de6dfc8bd9a39d24c7696400da19e90
# orm/session.py # Copyright (C) 2005-2013 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 """Provides the Session class and related utilities.""" import weakref from itertools im...
for state, dict_ in states.items():
4,268
lcc_e
python
null
2a39703131e8541ff29487b26d6b1a3f4eaeb5d61a7399f4
# coding=utf-8 import os, sys, datetime, unicodedata import xbmc, xbmcgui, xbmcvfs, urllib import xml.etree.ElementTree as xmltree from xml.dom.minidom import parse from xml.sax.saxutils import escape as escapeXML import thread from traceback import print_exc from unicodeutils import try_decode import calendar from tim...
widgetTempName = xbmc.getInfoLabel(widgetName)
6,955
lcc_e
python
null
45b4cb0f1e6ff6cf19ff04c4dc78debf5eb295f9fb1033e7
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
umask = os.umask(0)
7,132
lcc_e
python
null
bdc4619a8c7ccc8f1bd2cd02a0bd2f148097dbef786aed3d
""" Utility classes and functions to handle Virtual Machine creation using libvirt. :copyright: 2011 Red Hat Inc. """ from __future__ import division import time import string import os import logging import fcntl import re import shutil import tempfile import platform import aexpect from avocado.utils import process f...
shm = int(open(filename).read().split()[2])
7,764
lcc_e
python
null
8c6ea8a1244dc3cdcdb73c893e4496a60dacd26b57a7b28c
import os import sys import json import time import uuid import base64 import gevent import itertools from hashlib import sha256 from datetime import datetime from collections import namedtuple from flask import (request, g, Blueprint, make_response, Response, stream_with_context) from flask import j...
exclude_types = args.get('exclude_types')
4,956
lcc_e
python
null
ccfda5c5b2193dd53acce9410d3fbb305d423d4917c636b1
""" Models for User Information (students, staff, etc) Migration Notes If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration student --auto description_of_you...
objects = CourseEnrollmentManager()
4,276
lcc_e
python
null
645ab552d4c99e65670b1301bf0b423dc7ee6b9d178f1386
# # Licensed under the GNU General Public License Version 3 # # 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 later version. # # This p...
system_id = self.get_system_id(system)
5,050
lcc_e
python
null
4189db9c56d2c78001f372323a80282fe9e88bbc31bf9670
# -*- encoding: utf-8 -*- from abjad.tools.durationtools import Duration from abjad.tools.lilypondparsertools.LilyPondDuration import LilyPondDuration lilypond_version = "2.17.9" current_module = { '$current-book': '$current-book', '$current-bookpart': '$current-bookpart', '$defaultheader': '$defaultheader'...
'types': ('general-music', 'sequential-music',),
4,888
lcc_e
python
null
565c67214cc2708315f1cc7c7ebc698d2249e6e6bee5101c
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014 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 o...
update_t = StatusUpdater(total_recs, finished_queue)
6,540
lcc_e
python
null
6e65ba37cab17e000e9cd179b485808a47a6068c1e996bb3
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
digits= dp.get_precision('Product Price'),
4,978
lcc_e
python
null
b12ef08689195e4cc8f175bda64fb4109ab1345bf685b23e
# encoding: utf-8 """ Common implementation of ID, Population, PopulationView and Assembly classes. These base classes should be sub-classed by the backend-specific classes. :copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS. :license: CeCILL, see LICENSE for details. """ import numpy import logging import o...
data = self.get_data(variables, gather, clear, annotations)
5,678
lcc_e
python
null
594c693ecfddc23819ec6a8d933d0930ccc6bb544441a19b
# Bob build tool # Copyright (C) 2016 TechniSat Digital GmbH # # SPDX-License-Identifier: GPL-3.0-or-later from . import BOB_VERSION, BOB_INPUT_HASH, DEBUG from .errors import ParseError, BobError from .languages import getLanguage, ScriptLanguage, BashLanguage, PwshLanguage from .pathspec import PackageSet from .scm ...
depStates = { n : s.copy() for (n,s) in states.items() }
8,648
lcc_e
python
null
31482c3de325468dbb5d1581a10a5f93f5cd8421770b89bb
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ## License, ...
&nbsp;(<span class="warning">extra: %(diff)s</span>)<br />
11,089
lcc_e
python
null
6fbc14fb9561eb8fa28cc69fbce940bc349c14bfe4c279e1
# -*- coding: utf-8 -*- # # pylast - A Python interface to Last.fm (and other API compatible social networks) # # Copyright 2008-2010 Amr Hassan # # 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 a...
if type(text) == int:
9,909
lcc_e
python
null
801671b5a69a2c02e24e0b874f50d93613e0d5fdd104c618
#!/usr/bin/python -u # # This is the API builder, it parses the C sources and build the # API formal description in XML. # # See Copyright for the status of this software. # # daniel@veillard.com # import os, sys import string import glob import re quiet=True warnings=0 debug=False debugsym=None # # C parser analysis c...
desc = escape(desc)
8,020
lcc_e
python
null
d5119d291024c6c23d0a2c14f328ff4cd89641fb653fb509
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
columnNum // self.coincidencesShape[1],
8,992
lcc_e
python
null
a2578e61e6b5d25ae80d36c044bb63669ffa35e99835aab4
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any ...
check_nodes = [self.new_node_uuid, self.other_node_uuid]
8,172
lcc_e
python
null
1f82635fa73c4dfcf97ed3cc926641f71d98aa4e5fa64e78
# # commands.py - the GraalVM specific commands # # ---------------------------------------------------------------------------------------------------- # # Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free ...
complt += '\t\t\t\t\t-"'
8,122
lcc_e
python
null
9d961758e8228e308bc1ef5f04f834404c61ebc3304e17d2
# -*- coding: utf-8 -*- """ auibar contains an implementation of AuiToolBar, which is a completely owner-drawn toolbar perfectly integrated with the AUI layout system. This allows drag and drop of toolbars, docking/floating behaviour and the possibility to define "overflow" items in the toolbar itself. The default them...
Handles the ``wx.EVT_LEAVE_WINDOW`` event for L{AuiToolBar}.
11,431
lcc_e
python
null
d700d0a6c77d8cec0b9ffe05f9eea7b58a8b2af36fbaa29d
#!/usr/bin/python # -*- coding: utf-8 -*- # # Xibo - Digitial Signage - http://www.xibo.org.uk # Copyright (C) 2009-2014 Alex Harrington # # This file is part of Xibo. # # Xibo 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 Fre...
if e.nodeType == e.ELEMENT_NODE and e.localName == "layout":
8,661
lcc_e
python
null
e2895e568551293781414fe52b2571117dff76a79196d8e6
from __future__ import absolute_import, print_function, division """ Tensor optimizations addressing the ops in basic.py. """ # TODO: intelligent merge for mul/add # TODO: 0*x -> 0 from collections import defaultdict import logging import itertools import operator import sys import time import traceback import warnings...
for pos, idx in enumerate(cdata):
10,029
lcc_e
python
null
8152cfa361486a6a6f2953cf6740d89650cb310719efcbb1
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
is_const=True, is_virtual=True, is_pure_virtual=True)
10,722
lcc_e
python
null
5e257dacb588eede1548b87c86d7d1948fce16bb407c74bc
# 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=C0302,C0103,R0902,R0904,R091...
if os.path.exists(md_file_path) is False:
9,108
lcc_e
python
null
43332efaef30a408cc9cab9136931131d536dab1b4bb3735
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing vers...
package = package.rpartition('.')[0]
8,094
lcc_e
python
null
f7f9c73cbeb87190ba7533fe99a7e1d11d8e9b15427feb37
#!/usr/bin/env python # vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0: # -*- coding: UTF8 -*- # # A sword KJV indexed search module. # Copyright (C) 2012 Josiah Gordon <josiahg@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
search_reg_str = '\\b%s\\b' % search_terms.replace(' ',
11,879
lcc_e
python
null
927dbd70a755e5e339b4ffbb4cb56098b546fbec2b368570
## @file # parse FDF file # # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
if not self.__IsKeyword("FV"):
10,845
lcc_e
python
null
64c3a69e7851fde8cc6d137194738274c4b0e07c38266f93
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the project...
headers_phase = PBXHeadersBuildPhase()
11,459
lcc_e
python
null
02fa887706420d04baac1896a028bd74ff94ed29cd375ad1
# A collection of tools to remotely access a CATMAID server via its API # # Copyright (C) 2017 Philipp Schlegel # # 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 ...
post = {'node_ids[{}]'.format(i): n for i, n in enumerate(x)}
14,106
lcc_e
python
null
7ba93fa3c3cda095310c1e86d1f964e467c2b744a03c2d3f
# This file was created automatically by SWIG 1.3.29. # Don't modify this file, modify the SWIG interface instead. import _richtext import new new_instancemethod = new.instancemethod def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name =...
BeginBatchUndo(self, String cmdName) -> bool
9,452
lcc_e
python
null
7c4c9949f60f4f327a48f2671410466485a03f060befc851
""" Module for managing the installation of DIRAC components: MySQL, DB's, NoSQL DBs, Services, Agents, Executors and Consumers It only makes use of defaults in LocalInstallation Section in dirac.cfg The Following Options are used:: /DIRAC/Setup: Setup to be used for any operation /LocalInstallation/Ins...
exec lighttpdSvc.sh < /dev/null
8,611
lcc_e
python
null
bcd12fc83b049649e4609d18f3c25490db2d34e90d3517d7
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMEN...
elif state == 'suspended':
8,276
lcc_e
python
null
416048f78a3be5be5fdef7a8d39c04ebbbdfa50703b682bb
#!/usr/bin/python -t # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it...
group.add_option("", "--rpmverbosity", default=None,
8,933
lcc_e
python
null
1fc52a605c2339692497389ae8415624af2aa9f420e6efab
# (C) Copyright 2015-2021 Sei Lisa. All rights reserved. # # This file is part of LSL PyOptimizer. # # LSL PyOptimizer 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 # ...
if self.tok[0] != ')':
10,276
lcc_e
python
null
cd9c5ebc544ca1c92142cfa8e3c50e240e3bf5573ebbe13d
# # File: courseware/capa/responsetypes.py # """ Problem response evaluation. Handles checking of student responses, of a variety of types. Used by capa_problem.py """ # TODO: Refactor this code and fix this issue. # pylint: disable=attribute-defined-outside-init # standard library imports import abc import cgi impo...
options_value = json_d.get('options', [])
13,691
lcc_e
python
null
209e74b85df5f578309a7c9d543f7244f663f07342936dfd
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012 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 # License, or (at your option) any...
json_data = json.loads(str(form['jsondata']))
9,234
lcc_e
python
null
63e11b185b4a4678fb60b510a916fad3d5a0c78f2fe82ac4
#!/usr/bin/python # -*- coding: utf-8 -*- # # This module is also sponsored by E.T.A.I. (www.etai.fr) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version':...
disk_type = expected_disk_spec.get('type', '').lower()
9,014
lcc_e
python
null
062118817bdc9a092da1d4524629824f4e88305dc9eb112e
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
if acc_src == acc_valuation:
9,425
lcc_e
python
null
510fda46c7dd55d3196a9e71e2f528e1627ff2d61c2ef425
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in core/fromnume...
out : array of datetime64[D]
23,278
lcc_e
python
null
8415cc3776003fa5588524600aadaafdfed4c6921b110ca0
# (C) British Crown Copyright 2010 - 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...
subsets = dim_coord_subset()
8,031
lcc_e
python
null
fc73c9efea98568ceb6be090daf2a83234c653b1c0aa5303
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2011, 2012, 2015 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 # License, or (at your optio...
operation_parts = {'pid': person_id,
8,290
lcc_e
python
null
5aa904241ceb318da41a26ce573b2842824733d61c10c768
""" Student Views """ import datetime import logging import uuid import time import json import warnings from collections import defaultdict from pytz import UTC from ipware.ip import get_ip from django.conf import settings from django.contrib.auth import logout, authenticate, login from django.contrib.auth.models impo...
u"User %s (%s) opted in to receive emails from course %s",
8,301
lcc_e
python
null
44ad206402cbad485db6d26a02afd264eaa149f17e5c574b
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Common codegen classes. from collections import defaultdict import operator import re import string import textwrap imp...
if len(arrayObjectMemberTypes) > 0:
12,254
lcc_e
python
null
ddbfe085c46c1c7882246aeb0e735bb4d4f1c449cbfc2851
# module pyparsing.py # # Copyright (c) 2003-2009 Paul T. McGuire # # 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, cop...
tokenlist[ikey] = _ParseResultsWithOffset(dictvalue,i)
11,936
lcc_e
python
null
d7dd4f7df2a201bc16d5be4579c3fe4469912e1cbfa0868f
#!/usr/bin/env python # # Copyright (c) 2009 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...
if matched_zero and matched_zero.group(1) != '0':
20,316
lcc_e
python
null
f08a124a114577d3ad44ab0eb8109ad143afa1725e636790
#!/usr/bin/env python # # Copyright 2007-2009 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 ...
if after == NULL_HASH:
10,689
lcc_e
python
null
9e747fea1debf6f541b01de454b85d07f988ccaa14d308f4
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 ...
url = field_get_subfield_values(fft, 'a')
8,249
lcc_e
python
null
866ef2395db510677aaf95209d2798262b2f5f6057fa4995
# This module is intended to be used by the build/installation scripts of # extension modules created with SIP. It provides information about file # locations, version numbers etc., and provides some classes and functions. # # Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file i...
if adding and rhs != "":
8,273
lcc_e
python
null
2dcbe3f1e795cf4752a0ce542c306fd7bd0fb436d4434e10