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 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 11