text
stringlengths
4
1.02M
meta
dict
import datetime import logging from flask import ( Blueprint, request, current_app, session, send_from_directory, render_template, jsonify, ) from werkzeug.exceptions import BadRequest, Forbidden, NotFound, Unauthorized from geonature.core.gn_commons.models import TAdditionalFields from sql...
{ "content_hash": "d0c538cdc18476976420b838cc0e8688", "timestamp": "", "source": "github", "line_count": 775, "max_line_length": 569, "avg_line_length": 35.38193548387097, "alnum_prop": 0.6381240654972467, "repo_name": "PnEcrins/GeoNature", "id": "d3925b57101e22f07bceb18f63166c736f29efd5", "size": "...
import os from collections import namedtuple from celery.signals import worker_process_init from scrapi import settings from scrapi.processing.base import BaseProcessor DocumentTuple = Document = namedtuple('Document', ['raw', 'normalized']) __all__ = [] for mod in os.listdir(os.path.dirname(__file__)): root, e...
{ "content_hash": "4e7d2da87f08b388f13c89060aecd925", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 106, "avg_line_length": 32.07142857142857, "alnum_prop": 0.6965478841870824, "repo_name": "CenterForOpenScience/scrapi", "id": "27d7e14de0dd48d01a79331669da90d9c766ec8b", "...
import functools import logging from google.appengine.api import memcache def cached(time=1200): """ Decorator that caches the result of a method for the specified time in seconds. Use it as: @cached(time=1200) def functionToCache(arguments): ... """ def decorator(function): @...
{ "content_hash": "b022a9886b36532903e26a6250f0c150", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 81, "avg_line_length": 26.51851851851852, "alnum_prop": 0.63268156424581, "repo_name": "voidabhi/python-scripts", "id": "16d05b94def12e8383680db1ce91c08087bc1335", "size": ...
from ..args import ConversionConfigArg from ..conversion import Converter from kao_command.args import Arg class SetPreset: """ Represents a command to create a Conversion Config file """ description = "Set the preset in a config file" args = [Arg('preset', action='store', help='Preset to store'),...
{ "content_hash": "f2a1059111a277166d5480688315764b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 32.86666666666667, "alnum_prop": 0.6267748478701826, "repo_name": "cloew/Kaovert", "id": "e64d582b0c289947deaf24e0a438c401d71d2ad2", "size": "493", ...
from __future__ import absolute_import import os import pygments import re from datetime import datetime from pkg_resources import resource_filename from pygments.formatters.html import HtmlFormatter from pygments.lexers import get_all_lexers, get_lexer_by_name from pygments.styles import get_all_styles, get_style_by_...
{ "content_hash": "0dbc7bd73897824d7a78007f8c5a6832", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 80, "avg_line_length": 34.50342465753425, "alnum_prop": 0.5996029776674938, "repo_name": "pkdevbox/trac", "id": "0a318342a0ad3b9e930d7b151df9d58ef9d7f229", "size": "10474"...
from south.db import db from django.db import models from cms.models import * class Migration: def forwards(self, orm): # Adding ManyToManyField 'GlobalPagePermission.sites' db.create_table('cms_globalpagepermission_sites', ( ('id', models.AutoField(verbose_name='ID', prim...
{ "content_hash": "bce46f291dd183985449d3e35dfdb403", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 188, "avg_line_length": 78.24034334763948, "alnum_prop": 0.5052111903455841, "repo_name": "jjanssen/django-cms-patches", "id": "5dda3a68bb7ed45ebb27dd4107cdddf575aeb612", ...
"""Program reporting counts for the Home Page Business rules: reporting only if: - LOP indicator in closed program with lop_target - Midline/Endline/Event with set target and 1+ data - Time aware indicator with completed target period and set target and 1+ data""" import unittest import da...
{ "content_hash": "b6a80824f050f87593efe2a0c4e694a9", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 118, "avg_line_length": 43.89948006932409, "alnum_prop": 0.6302013422818792, "repo_name": "mercycorps/TolaActivity", "id": "5e831cd5377332740ed53c6d051721315299db94", "siz...
"""Representation of a deCONZ gateway.""" import asyncio import async_timeout from pydeconz import DeconzSession, errors from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT from homeassistant.core import callback from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homea...
{ "content_hash": "9702b97bc2ef472d39bfb92b407ab0d2", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 108, "avg_line_length": 32.159010600706715, "alnum_prop": 0.6303702889792331, "repo_name": "kennedyshead/home-assistant", "id": "8b057ab9e51f3c0935227a81c576966fde7cafb2", ...
from msrest.serialization import Model class VirtualMachineScaleSetInstanceView(Model): """The instance view of a virtual machine scale set. Variables are only populated by the server, and will be ignored when sending a request. :ivar virtual_machine: The instance view status summary for the virtual...
{ "content_hash": "c9234af142a87c8359fcb7f567ce49ab", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 114, "avg_line_length": 38.5945945945946, "alnum_prop": 0.696078431372549, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "82dbb90ac32ff85bf31f502cd2f7b73068244bc7", ...
import numpy as np from numpy.polynomial.legendre import legval from scipy import linalg from ..utils import logger, warn from ..io.pick import pick_types, pick_channels, pick_info from ..surface import _normalize_vectors from ..bem import _fit_sphere from ..forward import _map_meg_channels def _calc_g(cosang, stiff...
{ "content_hash": "2ef8d885305ae7c8457d48dc44b9ffbc", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 78, "avg_line_length": 34.956756756756754, "alnum_prop": 0.6248646976959951, "repo_name": "nicproulx/mne-python", "id": "ca37aff0d7398ff1b83fe53d22b47da50ef6b10b", "size":...
""" System Core Router File Defines the verbs and the routes dictionary for use in the routes config file """ routes = {} routes['GET'] = {} routes['POST'] = {} routes['PUT'] = {} routes['PATCH'] = {} routes['DELETE'] = {}
{ "content_hash": "553158d1db1129ef9e224eb6059da7c0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 21.09090909090909, "alnum_prop": 0.6077586206896551, "repo_name": "authman/Python201609", "id": "f0ca972cef52ea2ede327af3cf8341acf4a6d674", "size": "...
import functools import threading from pyqryptonight.pyqryptonight import PoWHelper from qrl.core.Singleton import Singleton class CNv1PoWValidator(object, metaclass=Singleton): def __init__(self): self.lock = threading.Lock() self._powv = PoWHelper() def verify_input(self, mining_blob, tar...
{ "content_hash": "440fd5cf95693d1fe0c7800ce92903ed", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 28.473684210526315, "alnum_prop": 0.7153419593345656, "repo_name": "theQRL/QRL", "id": "3a30913dfdf8246d5d43cfff934b6c53424e011a", "size": "693", "...
""" @brief A base class for constructing shapes @author alexander@gokliya.net """ from __future__ import print_function from csg.core import CSG from csg.geom import Vector import numpy DEFAULTS = dict(origin=[0.0, 0.0, 0.0], lengths=[1.0, 1.0, 1.0], radius=1.0, angle=9...
{ "content_hash": "dc740706d8c53c4f6154be68419fa0bd", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 69, "avg_line_length": 29.102272727272727, "alnum_prop": 0.5607184693479109, "repo_name": "pletzer/icqsol", "id": "4d317e179d0c87d618dbd52ffdcd7025ab7e273b", "size": "2584"...
"""The setup script.""" from setuptools import setup, find_packages with open("README.rst", encoding="utf-8") as readme_file, open( "HISTORY.rst", encoding="utf-8" ) as history_file: long_description = readme_file.read() + "\n\n" + history_file.read() install_requires = [ "click>=6.0", "rabird.core",...
{ "content_hash": "ad8fea8b97762b239ba8273dc1912b81", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 85, "avg_line_length": 27.58730158730159, "alnum_prop": 0.6334867663981588, "repo_name": "starofrainnight/rabird.selenium", "id": "b614778f183570688c453d70574217e709c05911", ...
from django.utils.translation import ugettext as _ from django.core.exceptions import ValidationError from django.forms import Form from django.forms import ImageField from django.forms import ChoiceField from django.forms import CharField from django.forms import Textarea from apps.common.shortcuts import uslugify fr...
{ "content_hash": "ee05348ab58e2db17b441bb50e8852e6", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 32.179245283018865, "alnum_prop": 0.6754617414248021, "repo_name": "serdardalgic/bikesurf.org", "id": "057998892d1b04d805a2db43677eb556e92999bf", "s...
from __future__ import unicode_literals import json from StringIO import StringIO from mock import patch, Mock from tests import TestCase, with_settings, logged_in from nose.tools import eq_ from catsnap import Client from catsnap.table.album import Album from catsnap.table.image import Image class TestAlbum(TestCase...
{ "content_hash": "b38a7cd1889bd719e919265ac1911b41", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 78, "avg_line_length": 35.34090909090909, "alnum_prop": 0.5855305466237942, "repo_name": "ErinCall/catsnap", "id": "7303e8cb2b940032927ae5d3832fdd478b913225", "size": "3110...
from ._LaserRange import *
{ "content_hash": "b96022dcc5f766b3c18d1298cb2152a5", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 26, "avg_line_length": 27, "alnum_prop": 0.7407407407407407, "repo_name": "ros-industrial/acuity", "id": "dffa724bf77faf59f2753ecaae47520d2c93d130", "size": "27", "binary"...
from azure.identity import DefaultAzureCredential from azure.mgmt.privatedns import PrivateDnsManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-privatedns # USAGE python put_private_dns_zone_cname_record_set.py Before run the sample, please set the values of the cl...
{ "content_hash": "957d65e7771e9eeff7c9a3d5e80611ac", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 131, "avg_line_length": 35.26315789473684, "alnum_prop": 0.7029850746268657, "repo_name": "Azure/azure-sdk-for-python", "id": "a5d40cf45b281b561d810fb3fbc6f70c70cd5fa2", "s...
"""Erlang port protocol.""" __author__ = "Dmitry Vasiliev <dima@hlabs.org>" __version__ = "1.0" from erlport.erlterms import Atom, List, ImproperList
{ "content_hash": "bab908169ecad88ebf0fb00c1c7f86ac", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 53, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6842105263157895, "repo_name": "276361270/erlport", "id": "d3b2367f6739d84bcebf852e38d526e8ad04c076", "size": "172...
import re import requests from datetime import date from datetime import datetime from juriscraper.opinions.united_states.state import nd from juriscraper.DeferringList import DeferringList class Site(nd.Site): def __init__(self, *args, **kwargs): super(Site, self).__init__(*args, **kwargs) self...
{ "content_hash": "cc2daac77632560dff13aa11e0aa2554", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 114, "avg_line_length": 39.39473684210526, "alnum_prop": 0.5, "repo_name": "m4h7/juriscraper", "id": "c6fec652bc3a2d1189b4af8b8ad7b61dfccadb4b", "size": "6042", "binary"...
import unittest from unittest import mock import pytest from airflow.exceptions import AirflowException from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook from airflow.providers.amazon.aws.sensors.sagemaker_transform import SageMakerTransformSensor DESCRIBE_TRANSFORM_INPROGRESS_RESPONSE = { '...
{ "content_hash": "bbe61b69a071a02834ebb5f82673eed8", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 98, "avg_line_length": 34.49295774647887, "alnum_prop": 0.6786443446304614, "repo_name": "dhuang/incubator-airflow", "id": "a3e23d8a505c7937e35579931b08319b7bb3289d", "size...
from setuptools import setup, find_packages setup( name="rhumba", version='0.2.0', url='http://github.com/calston/rhumba', license='MIT', description="An asynchronous job queue written in Twisted", author='Colin Alston', author_email='colin.alston@gmail.com', packages=find_packages() +...
{ "content_hash": "6ddf40b3b005d5233ad58b033fc59772", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 63, "avg_line_length": 26.78787878787879, "alnum_prop": 0.5871040723981901, "repo_name": "calston/rhumba", "id": "e5e46caf625a9bf9983c1f9ab343664fd458cca7", "size": "884", ...
import jarray import inspect from java.lang import System from java.util.logging import Level from org.sleuthkit.datamodel import SleuthkitCase from org.sleuthkit.datamodel import AbstractFile from org.sleuthkit.datamodel import ReadContentInputStream from org.sleuthkit.datamodel import BlackboardArtifact from org.sleu...
{ "content_hash": "23996ebec2f3f961042c2bf3a091defa", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 165, "avg_line_length": 46.44604316546763, "alnum_prop": 0.7163878562577447, "repo_name": "mhmdfy/autopsy", "id": "6e99ee3cee7a38a0147b7ad50f7cc8dbbd72a9ee", "size": "8071...
import httplib from httplib import BadStatusLine import os import sys import threading import time from cherrypy.test import test test.prefer_parent_path() import cherrypy engine = cherrypy.engine thisdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) class Root: def index(self): ...
{ "content_hash": "4f7ce94b5881a676fbf1a9553ef97bf1", "timestamp": "", "source": "github", "line_count": 557, "max_line_length": 99, "avg_line_length": 34.768402154398565, "alnum_prop": 0.5367654652483734, "repo_name": "cread/ec2id", "id": "90e03dbde5c2b13fe9e54784d1974dc0526ff36e", "size": "19366",...
from collections import defaultdict from django import forms from django.forms import widgets import commonware.log import happyforms import jinja2 from django.utils.translation import ugettext as _ import mkt from mkt.files.models import File from mkt.versions.models import Version log = commonware.log.getLogger(...
{ "content_hash": "d9427d742648deaa461421edc05b3a6d", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 35.915789473684214, "alnum_prop": 0.567409144196952, "repo_name": "ingenioustechie/zamboni", "id": "87bce086c636c3625778aec57291f785531365b7", "size"...
''' Runners are clases which are responsible for consuming sample blocks from sound generator (see the generator package) and directing them to output for playback, file writing, etc. See documentation for the runner module for further explanation. ''' from .file_writer import FileWriter from .pyaudio...
{ "content_hash": "faa60bdd68076f439c9b1330ddf35409", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 77, "avg_line_length": 36.9, "alnum_prop": 0.7723577235772358, "repo_name": "bracket/ratchet", "id": "535f8efc9ee9e29c9301c9c29bc3ccabe2318a18", "size": "369", "binary": ...
import sys import string import os import time from osgeo import gdal from osgeo import osr cur_name = 'default' success_counter = 0 failure_counter = 0 expected_failure_counter = 0 blow_counter = 0 skip_counter = 0 failure_summary = [] reason = None count_skipped_tests_download = 0 count_skipped_tests_slow = 0 sta...
{ "content_hash": "7f3d71ee2f38a13a70c66a112f1fcfd6", "timestamp": "", "source": "github", "line_count": 1547, "max_line_length": 634, "avg_line_length": 33.506140917905626, "alnum_prop": 0.512848709341359, "repo_name": "avalentino/gdal-pixfun-plugin", "id": "4802818fc606fc8e03728eb3abbe951a33c6eeae",...
import unittest import template class TemplateTest(unittest.TestCase): def setUp(self): self.input = 'foo' self.t = Template.Template(self.input) def test_calc(self): d = self.t.calc(False) self.assertEqual(self.input, d) def test_calc_pretty(self): pretty = 'One ...
{ "content_hash": "317920bc0085823c927bff53b989d702", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 46, "avg_line_length": 22.85, "alnum_prop": 0.5951859956236324, "repo_name": "dougsweetser/QProcessing", "id": "d9ac87209139d1d9789e0ca381cd32c076db3db8", "size": "483", ...
''' Created on May 7, 2021 @author: 828567 ''' from datetime import datetime as dateTime from dateutil import parser import datetime import copy import re import os import hashlib from dateutil import parser import uuid from ....core.BaseAgent import BaseAgent import json class GitLabIssueWebhookAgent(BaseAgent): ...
{ "content_hash": "33c3831a399b9a7d98982f9ad5f6801e", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 118, "avg_line_length": 50.229007633587784, "alnum_prop": 0.6227963525835867, "repo_name": "CognizantOneDevOps/Insights", "id": "9c61c488f72c821ea3bfc6d444f729e65c1d9b99", ...
import asyncio async def foo(y): return y + 1 async def print_foo(): x = await foo(1) print(x) asyncio.run(print_foo())
{ "content_hash": "2cd3d14b98a99d1557040b185b396c43", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 24, "avg_line_length": 10.615384615384615, "alnum_prop": 0.6014492753623188, "repo_name": "JetBrains/intellij-community", "id": "870f25693d20b05edf91f8532c157336e5b070b5", ...
import re,urllib,urlparse,base64 from liveresolver.modules import client from liveresolver.modules.log_utils import log def resolve(url): try: try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer=url page = url result...
{ "content_hash": "0d49a513727f3d4507b1db64e87392c6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 116, "avg_line_length": 33.95454545454545, "alnum_prop": 0.6318607764390897, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "60f52077336d0f39b8dbe48a59294e1a770c8dc7", ...
import pytz from django.db import models from django.db.models import Q from django.utils import timezone from osf.models import Node from osf.models import NodeLog from osf.models.base import GuidMixin, Guid, BaseModel from osf.models.mixins import CommentableMixin from osf.models.spam import SpamMixin from osf.models...
{ "content_hash": "95dd10e24d94996f8bed795d3af9f541", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 112, "avg_line_length": 37.389763779527556, "alnum_prop": 0.5949247130672844, "repo_name": "cslzchen/osf.io", "id": "10a380b6ef12a2dd50ed3d62ac1df6bbca4bab41", "size": "94...
import json import urllib from tempest.common.rest_client import RestClient class VolumeHostsClientJSON(RestClient): """ Client class to send CRUD Volume Hosts API requests to a Cinder endpoint """ def __init__(self, config, username, password, auth_url, tenant_name=None): super(VolumeHostsC...
{ "content_hash": "5260c78db37be4afdaa26285b5a34d94", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 31.103448275862068, "alnum_prop": 0.6119733924611973, "repo_name": "armando-migliaccio/tempest", "id": "fc28ada0f499802a8689552229b9d38cc9ac27e6", "s...
import spectral
{ "content_hash": "206532f068ddd23225b50bfd8e8d4e2a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 15, "avg_line_length": 15, "alnum_prop": 0.9333333333333333, "repo_name": "parenthetical-e/neurosrc", "id": "002f21a18bd477a95eca78afd2a5fe9f6d33e145", "size": "15", "bina...
from collections import OrderedDict from typing import Dict, Type from .base import GlobalPublicDelegatedPrefixesTransport from .rest import ( GlobalPublicDelegatedPrefixesRestInterceptor, GlobalPublicDelegatedPrefixesRestTransport, ) # Compile a registry of transports. _transport_registry = ( OrderedDict...
{ "content_hash": "e02e2a1b490ea20f28068357ff1636c7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 72, "avg_line_length": 31.3, "alnum_prop": 0.8099041533546326, "repo_name": "googleapis/python-compute", "id": "da5235a504296c4e9ce0a23cf32734da19692ce2", "size": "1226", ...
""" Example DAG showing how to use Asana TaskOperators. """ import os from datetime import datetime, timedelta from airflow import DAG from airflow.providers.asana.operators.asana_tasks import ( AsanaCreateTaskOperator, AsanaDeleteTaskOperator, AsanaFindTaskOperator, AsanaUpdateTaskOperator, ) ASANA_T...
{ "content_hash": "7e92488ffdd5218984207259fc736d60", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 98, "avg_line_length": 41.92134831460674, "alnum_prop": 0.7027606539801662, "repo_name": "Acehaidrey/incubator-airflow", "id": "311445a01478628445e5b5367258270bc8839d57", "...
import sys import urwid as uw from urwid_timed_progress import TimedProgressBar from urwid.html_fragment import screenshot_init, screenshot_collect # Demo of timed progress bar. if __name__ == '__main__': palette = [ ('normal', 'white', 'black', 'standout'), ('complete', 'white', 'dark magenta'...
{ "content_hash": "c4150991a71a8ac31ca8f960ee39671b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 35.72, "alnum_prop": 0.6052631578947368, "repo_name": "mgk/urwid_timed_progress", "id": "7f07314cb17e803ac2db1b6fe86a3bf08229c4b8", "size": "1809", ...
from django import template from django.utils.html import format_html register = template.Library() @register.filter def github_profile(login): return format_html( '<a href="https://github.com/{0}">@{0}</a>', login, )
{ "content_hash": "a44e243945248ede0ca1da43441f47dc", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 18.923076923076923, "alnum_prop": 0.6504065040650406, "repo_name": "FundersClub/fire", "id": "25d380365a5bf80549f514f5e09703b87c9e2417", "size": "246...
from smart.interfaces.qt5 import getPixmap from smart.const import INSTALL, REMOVE from smart import * from PyQt5 import QtGui as QtGui from PyQt5 import QtWidgets as QtWidgets from PyQt5 import QtCore as QtCore try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s...
{ "content_hash": "c913fec3f4b625685b81254753a6d0bb", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 108, "avg_line_length": 36.09308510638298, "alnum_prop": 0.5472699137867512, "repo_name": "blackPantherOS/packagemanagement", "id": "64aa2d73be137d249b60fca2014ea6bf44f40e0d...
import os import datetime import random from google.appengine.ext import webapp from google.appengine.api import memcache from google.appengine.ext import db from google.appengine.ext.webapp import util from google.appengine.ext.webapp import template from v2ex.babel import Member from v2ex.babel import Counter #from...
{ "content_hash": "5a1058b6a3fd114dc8ec301ac59a9501", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 92, "avg_line_length": 36.128787878787875, "alnum_prop": 0.6198364436988887, "repo_name": "melice/akiraguru", "id": "7dfc047300ad5d371eed9ca75944c088642f1f2f", "size": "48...
"""Loads data into BigQuery from a local file. For more information, see the README.md under /bigquery. Example invocation: $ python load_data_from_file.py example_dataset example_table \ example-data.csv The dataset and table should already exist. """ import argparse import time from google.cloud impo...
{ "content_hash": "e63b111329e319f4a4d8fccb025fef9f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 68, "avg_line_length": 26.951612903225808, "alnum_prop": 0.6433273488928786, "repo_name": "hashems/Mobile-Cloud-Development-Projects", "id": "0bbdd7ba7d80f3fcfd38730ac5b7af1e...
def mergesort(list_to_sort): if len(list_to_sort) < 2: # A list of length 1 is sorted by definition return list_to_sort # Split the list into left and right halves midpoint = len(list_to_sort)/2 right = mergesort(list_to_sort[midpoint:]) left = mergesort(list_to_sort[:midpoint]) # Recursively mergesort the le...
{ "content_hash": "4e4322b4851ab4fea505873c5a1580a9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 83, "avg_line_length": 26.894736842105264, "alnum_prop": 0.6682974559686888, "repo_name": "ross-t/python-ds", "id": "a074e6c5d47511bf6d42d3ddbf960cf37919ebbf", "size": "104...
import os import sys import re from google.protobuf.descriptor_pb2 import FileDescriptorSet, FieldOptions # Add our cwd to the path so we can import generated python protobufs # And extend our options with our Neutron protobuf sys.path.append(os.getcwd() + '/..') from Neutron_pb2 import pointer, PointerType, array_siz...
{ "content_hash": "41d612c866e7dd87a14efbc263ac8b9d", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 85, "avg_line_length": 36.84415584415584, "alnum_prop": 0.5384208671131477, "repo_name": "Fastcode/NUClearExample", "id": "b62e018fa5a06120ca53a99c537514d9cf17223d", "size...
"""Setup script for admin-tools-zinnia""" from setuptools import setup from setuptools import find_packages import admin_tools_zinnia setup( name='admin-tools-zinnia', version=admin_tools_zinnia.__version__, description='Admin tools for django-blog-zinnia', long_description=open('README.rst').read(),...
{ "content_hash": "ca5c619a5ac1ad0a5066312ca16ec3d8", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 72, "avg_line_length": 32.02857142857143, "alnum_prop": 0.6574487065120428, "repo_name": "django-blog-zinnia/admin-tools-zinnia", "id": "55d3901ef820b9c72ab290ed6986c2d4929cd...
""" Abstract base class for all hardware types. """ import abc import six from ironic.common import exception from ironic.drivers import base as driver_base from ironic.drivers.modules.network import noop as noop_net from ironic.drivers.modules import noop from ironic.drivers.modules.storage import noop as noop_stor...
{ "content_hash": "b3951b38b54574563a64407b2bf8e20a", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 32.18867924528302, "alnum_prop": 0.6600234466588512, "repo_name": "NaohiroTamura/ironic", "id": "2d0713a5899a82621a4e94e7c45a83c972c04629", "size": ...
import numpy as np import random import tensorflow as tf import os %matplotlib inline from gridworld import gameEnv env = gameEnv(size=5) class Qnetwork(): def __init__(self,h_size): #The network recieves a frame from the game, flattened into an array. #It then resizes it and processes it through...
{ "content_hash": "19ca444ae8e806c16cc09bbd4d547636", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 137, "avg_line_length": 40.365, "alnum_prop": 0.6330979809240679, "repo_name": "fx2003/tensorflow-study", "id": "20d0ce1f47be87b5c3e5313bcc07a888d5d1c606", "size": "8766",...
""" User model for authentication. """ from sqlite3 import OperationalError from aiorest_ws.auth.user.abstractions import User from aiorest_ws.auth.user.utils import generate_password_hash from aiorest_ws.auth.user.exceptions import RequiredModelFieldsNotDefined, \ SearchCriteriaRequired, NotEnoughArguments from a...
{ "content_hash": "7c32504a5706ea0e0a181ca41868d15c", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 92, "avg_line_length": 33.76111111111111, "alnum_prop": 0.5897646865229554, "repo_name": "Relrin/aiorest-ws", "id": "31a905216ca9b35496b88827fd5926c96f4d972a", "size": "61...
from threading import Lock class ResponsibleGenerator(object): """A generator that will help clean up when it is done being used.""" __slots__ = ['cleanup', 'gen'] def __init__(self, gen, cleanup): self.cleanup = cleanup self.gen = gen def __del__(self): self.cleanup() ...
{ "content_hash": "d66d8efff2b3b651ef4fcc3d6364df12", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 73, "avg_line_length": 28.617021276595743, "alnum_prop": 0.49516728624535317, "repo_name": "hwroitzsch/DayLikeTodayClone", "id": "40747fb11fa7625086749584a42fd8e71e46bcb9", ...
import logging from Top import Top log = logging.getLogger(__name__) if __name__ == "__main__": import sys sys.path.append('..') class AtomicProps(Top): """ This is a container for atomic properties. Expected functionality: 1. Provide data structure to store atomic properties, 2....
{ "content_hash": "e6d646bd7e0a9bae9fefaf1a39eb6a22", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 157, "avg_line_length": 30.255555555555556, "alnum_prop": 0.5045905251560778, "repo_name": "talipovm/terse", "id": "d704dc19e4fe7c59600706ad2de51353a4798381", "size": "2723...
import sys from rest_framework import serializers as ser from api.base.serializers import ( JSONAPISerializer, IDField, TypeField, Link, LinksField, RelationshipField, DateByVersion, ) from api.base.utils import absolute_reverse from framework.auth.core import Auth class WikiSerializer(...
{ "content_hash": "e9350c9a857dac08a018cfb7a5365386", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 122, "avg_line_length": 27.912, "alnum_prop": 0.6408713098308971, "repo_name": "monikagrabowska/osf.io", "id": "1a9acfef2f3c284cbaaa1afe752282306e22d755", "size": "3489", ...
import csv import matplotlib.pyplot as plt ## local modules ## import functions_v5 as fxn ### data structures ### ### called/local plotting parameters ### ps = fxn.pseasons fs = 24 fssml = 16 mild_s = fxn.gp_mild mod_s = fxn.gp_mod sev_s = fxn.gp_sev s_lab = fxn.gp_seasonlabels sevcol = fxn.gp_severitycolors bw = fx...
{ "content_hash": "f675936c7f96ca6bf5768aa61853e3ca", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 188, "avg_line_length": 38.605633802816904, "alnum_prop": 0.7128785114921562, "repo_name": "eclee25/flu-SDI-exploratory-age", "id": "f2664164dcd0cc926678ddb62d152e47dc945d62"...
''' Replaces all blank values in a column with the first non-blank value in a series of columns, falling back on a default_value if all are blank. ``` tweaks: coalesce: # the first of the following list of columns is the one that is modified columns: first_priority_column second_priority_column third_priority...
{ "content_hash": "b07ddfdaa793325e0778eb3cf558058f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 80, "avg_line_length": 32.588235294117645, "alnum_prop": 0.5406137184115524, "repo_name": "paulfitz/sheetsite", "id": "84737210bd2272c8c94993b1e308914969f846f1", "size": "1...
# Copyright 2012 Calvin Rien # # 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 t...
{ "content_hash": "1c77544c0e941df6f32ac0f866653f8b", "timestamp": "", "source": "github", "line_count": 1398, "max_line_length": 165, "avg_line_length": 33.05722460658083, "alnum_prop": 0.5182195871380967, "repo_name": "SmallPlanetUnity/UnityExternalXcodePlugin", "id": "4c3252d59350738e1e5dfc17d226a2...
import locale locale.setlocale(locale.LC_ALL, '') from flask import Flask, request from nas.api import configure_api from nas.models import configure_db from nas.utils.converters import ( ListConverter, RangeConverter, RangeListConverter ) DEFAULT_APPNAME = 'nobix-application-server' def create_app(config=None...
{ "content_hash": "ba72547411b2906aa9ff8c2d35b2078b", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 76, "avg_line_length": 33.10227272727273, "alnum_prop": 0.5787847579814624, "repo_name": "coyotevz/nas", "id": "6470b498b46387cb47ee5131951d3c9b48c75a47", "size": "2938", ...
import unittest from gameplay.rock import Rock from gameplay.player import Player from gameplay.bullet import Bullet from gameplay.field import Field from gameplay.game import Game from gui.user_interface import UserInterface from gui.bullet_ui import BulletUI from gui.powerup_ui import PowerupUI, PowerupType class R...
{ "content_hash": "7a1f311fd475aac6bb6f03e0b98d820d", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 71, "avg_line_length": 34.15289256198347, "alnum_prop": 0.667513611615245, "repo_name": "hristy93/FallingRocks", "id": "d9d1a7472f40a83ebb5e270aa45a575765a2c106", "size": ...
""" Support for ATLAS as toolchain linear algebra library. @author: Stijn De Weirdt (Ghent University) @author: Kenneth Hoste (Ghent University) """ from easybuild.tools.toolchain.linalg import LinAlg class Atlas(LinAlg): """ Provides ATLAS BLAS/LAPACK support. LAPACK is a build dependency only """ ...
{ "content_hash": "14f8adaeb444274ed42640a4a3f400a6", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 54, "avg_line_length": 24.476190476190474, "alnum_prop": 0.6634241245136187, "repo_name": "ULHPC/modules", "id": "f1320600acb5b8a3f47d07f911b371d4a94967d1", "size": "1572",...
"""Support for Baidu speech service.""" import logging import voluptuous as vol from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) SUPPORTED_LANGUAGES = ...
{ "content_hash": "77c26cf4c12c0566ab80c613683855b4", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 87, "avg_line_length": 30.68888888888889, "alnum_prop": 0.5879797248370746, "repo_name": "Cinntax/home-assistant", "id": "85737d1affdc00a7a5fb9e8e817758fcade076aa", "size"...
from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import User from django.contrib.contenttypes.admin import GenericTabularInline from django.contrib.contenttypes.models import ContentType from django.forms.formsets import DEFAULT_MAX_NUM from django.forms....
{ "content_hash": "ee6d6b4265fe6e69153b9ce1e5ce48d8", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 117, "avg_line_length": 38.16411378555799, "alnum_prop": 0.6226133822601915, "repo_name": "ar4s/django", "id": "fc17b9de7440821d31f1878446f10ec311b09b49", "size": "17441",...
from true import *
{ "content_hash": "a21fc545a75488c170dc9ed4435085c3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 18, "avg_line_length": 19, "alnum_prop": 0.7368421052631579, "repo_name": "libtrue/libtrue", "id": "02c21ee295b7ddd026eb08c87c3b9efbe70057e6", "size": "19", "binary": fals...
import os import sys from json import dumps import json from flask import Flask, Response from flask import request from flask_cors import CORS, cross_origin import logging import utilities as _Utilities import endpoints import paybook import paybook.sdk as paybook_sdk #commit for reboot cmd_params = _Utilities.get_c...
{ "content_hash": "f7bfc1d7b955a3f2ef6d27c083d0e2ba", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 57, "avg_line_length": 23.964285714285715, "alnum_prop": 0.7312468951813215, "repo_name": "Paybook/lite-python", "id": "0faea7037a2d73f89441124b1a5bb9a28b1d9bd1", "size": "...
''' This script was used to train the CNN for the symbol recognition. ''' import numpy as np import scipy.io import matplotlib.pyplot as plt from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense from keras.callbacks import ModelCheckpoint from keras.layers import Dropout f...
{ "content_hash": "9a647d08dc5cd8e9448e44d1cc4b1b45", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 125, "avg_line_length": 33.82222222222222, "alnum_prop": 0.6941524310118266, "repo_name": "DavidS3141/HandwrittenEquationRecognizer", "id": "4657deb1715db7f4066be061218772287...
def extractDoramtranslationsWordpressCom(item): ''' Parser for 'doramtranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translat...
{ "content_hash": "43890e9dee910d0447ed890819ebd8ca", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 27.285714285714285, "alnum_prop": 0.643979057591623, "repo_name": "fake-name/ReadableWebProxy", "id": "4ab36183e38fc401e7900a5c061d5dcd3894bac8", "s...
from msrest.serialization import Model class JobTerminateParameter(Model): """Options when terminating a job. :param terminate_reason: The text you want to appear as the job's TerminateReason. The default is 'UserTerminate'. :type terminate_reason: str """ _attribute_map = { 'termin...
{ "content_hash": "c36e1681fe5c46e7c4bdd12d2c261207", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 70, "avg_line_length": 29.61111111111111, "alnum_prop": 0.6641651031894934, "repo_name": "lmazuel/azure-sdk-for-python", "id": "1fe22775e9fd031fb8737487db15af1e11ebdd6f", "...
""" -*- coding: utf-8 -*- A distutils based setup module. """ from distutils.core import setup setup( name='fileasobj', packages=['fileasobj'], version='2.0.0', description='Manage a file as a Python list.', author='John Hazelwood', author_email='jhazelwo@users.noreply.github.com', url='http...
{ "content_hash": "06a6d531fdb5ecb8ac2da6d1ccc7f7ad", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 36.75, "alnum_prop": 0.6258503401360545, "repo_name": "jhazelwo/python-fileasobj", "id": "aaf6c9fd23320e548b3919daafce17de140c1407", "size": "1029", ...
""" #;+ #; NAME: #; utils #; Version 1.0 #; #; PURPOSE: #; Module for spectral utilities #; Primarily overloads of Spectrum1D #; 07-Sep-2014 by JXP #;- #;------------------------------------------------------------------------------ """ from __future__ import print_function, absolute_import, division, uni...
{ "content_hash": "417560b77ac1f59c6289fc7a63d4952a", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 102, "avg_line_length": 32.8828125, "alnum_prop": 0.5384493545576938, "repo_name": "profxj/old_xastropy", "id": "a2cef8a9f1497739924ca0c080202a3b3e3281ff", "size": "12627"...
from django.contrib import admin from .models import Profile class ProfileAdmin(admin.ModelAdmin): list_display = ('id', 'user', 'active', 'nickname', 'phone_number') list_filter = ('user', 'active') admin.site.register(Profile, ProfileAdmin)
{ "content_hash": "1ff813185e119a6507199c541d24d1c6", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 29.22222222222222, "alnum_prop": 0.688212927756654, "repo_name": "Sorjak/TurboSmartHome", "id": "25d442765a1ec9e36d9db5021452b8bd21c6f2ac", "size": "2...
from iptables import Iptables # Author: Moises Gautier Gomez # Proyecto fin de carrera - Ing. en Informatica # Universidad de Granada # Creamos un objeto del tipo Source y operamos con él test = Iptables(args=(1,), source_info={'T': 'Firewall', 'M': 'iptables', 'P': '/var/log/iptables.log', ...
{ "content_hash": "130d8bcd6a9fad5b1874bb63f39641f5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 110, "avg_line_length": 34.53333333333333, "alnum_prop": 0.611969111969112, "repo_name": "MGautier/security-sensor", "id": "13226794184530d1f8b2069a98ccceab8fd3b5dc", "size...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'automatron', 'pyOpenSSL', ] setup( name=...
{ "content_hash": "8b229c77891e53f4e4ec3a36c079a84b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 24.647058823529413, "alnum_prop": 0.6252983293556086, "repo_name": "automatron/automatron-notify", "id": "f4be3f462ee51e63744685edf28898087fd154aa", ...
from django.contrib.auth.models import AbstractBaseUser from django.contrib.auth.models import BaseUserManager from django.core.validators import RegexValidator from django.db import models phone_regex = RegexValidator(regex=r'^\+[1-9]\d{1,14}$', message="Mobile number must be entered in t...
{ "content_hash": "0ae5068d0e3d22353bff528a63776c25", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 106, "avg_line_length": 37.43478260869565, "alnum_prop": 0.686411149825784, "repo_name": "aaronn/django-rest-framework-passwordless", "id": "8bf37954cd220b0706c8faac79c52ff13...
import os import platform import re import subprocess import sys import tempfile import lit.formats import lit.util from lit.llvm import llvm_config from lit.llvm.subst import ToolSubst from lit.llvm.subst import FindTool # Configuration file for the 'lit' test runner. # name: The name of this test suite. config.na...
{ "content_hash": "3213ffe9b6ec9c0978bd77dd350368dc", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 121, "avg_line_length": 38.49044585987261, "alnum_prop": 0.7049478735727288, "repo_name": "endlessm/chromium-browser", "id": "fb2f72357b263dfc383a6a7492dc015f13fc8298", "s...
from __future__ import (absolute_import, division, print_function, unicode_literals) import unittest from grako.codegen import CodeGenerator, ModelRenderer from grako.model import Node class Generator(CodeGenerator): def __init__(self): super(Generator, self).__init__() def ...
{ "content_hash": "808a9b904aed45d00986f777ff9f182c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 67, "avg_line_length": 22.90909090909091, "alnum_prop": 0.6279761904761905, "repo_name": "frnknglrt/grako", "id": "26d5a7579249a2a3e19bce16efea11b2c1d90c15", "size": "1032"...
"""Tests and descriptive statistics with weights Created on 2010-09-18 Author: josef-pktd License: BSD (3-clause) References ---------- SPSS manual SAS manual This follows in large parts the SPSS manual, which is largely the same as the SAS manual with different, simpler notation. Freq, Weight in SAS seems redun...
{ "content_hash": "5026f8e75d9e0b17ae458e133bfaf56d", "timestamp": "", "source": "github", "line_count": 1677, "max_line_length": 123, "avg_line_length": 32.932617769827075, "alnum_prop": 0.5911494169624104, "repo_name": "jseabold/statsmodels", "id": "3f469f4745c6c35a183f0a0707c83b3261801789", "size...
import abc from concurrent import futures import six from taskflow.utils import async_utils from taskflow.utils import misc from taskflow.utils import threading_utils # Execution and reversion events. EXECUTED = 'executed' REVERTED = 'reverted' def _execute_task(task, arguments, progress_callback): with task.a...
{ "content_hash": "db97209bb68dedf1b53c7982bbfb30e6", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 79, "avg_line_length": 32.36363636363637, "alnum_prop": 0.6493871297242084, "repo_name": "varunarya10/taskflow", "id": "846cc56844eb69ca9aa0c89de32e91a657135ebb", "size": ...
from __future__ import absolute_import, division, print_function from future.utils import with_metaclass from future.builtins import zip from abc import ABCMeta, abstractmethod from functools import partial import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Ax...
{ "content_hash": "cdf11512b956f02c7e757b9ddbc3d466", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 79, "avg_line_length": 40.54761904761905, "alnum_prop": 0.5904286553141515, "repo_name": "jairideout/scikit-bio", "id": "09cc3fbf7a4619b3d13fb700fa88e24697396df3", "size":...
from django.contrib import admin from genericfile.models import FileStore admin.site.register(FileStore)
{ "content_hash": "5dba0ec38b927c6b74c6e3fd5c1a0ca9", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 40, "avg_line_length": 26.25, "alnum_prop": 0.8571428571428571, "repo_name": "djangothon/django-generic-file", "id": "42299dec203fff4a5e7f7ae56fca4a0b5b54eb30", "size": "105...
from __future__ import unicode_literals import datetime from django.core.urlresolvers import reverse from django.db import models from django.db import transaction from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.contrib.sites.models import Site from django.utils.e...
{ "content_hash": "dfc045eae30b6ced608e9e068d2ad13a", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 86, "avg_line_length": 37.00709219858156, "alnum_prop": 0.596780375622844, "repo_name": "tejesh95/Zubio.in", "id": "4a13d47c6fec9ebee186c3e5852d6b35683d4c50", "size": "521...
from unittest import TestCase from ebird.api.observations import OBSERVATIONS_URL, get_observations from tests import mixins class GetObservationsTests( TestCase, mixins.AreaTestsMixin, mixins.BackTestsMixin, mixins.CategoryTestsMixin, mixins.DetailTestsMixin, mixins.HeaderTestsMixin, mix...
{ "content_hash": "7a3de0ac302d47fcc74ebcce7c4588d9", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 69, "avg_line_length": 28.31111111111111, "alnum_prop": 0.6530612244897959, "repo_name": "ProjectBabbler/ebird-api", "id": "93e816e7657eeb3cc9a95fbe885e955031abae44", "size...
''' Best buy or sell ''' # Copyright (c) 2012, 2013, 2014 Toomore Chiang, http://toomore.net/ # # 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 limitati...
{ "content_hash": "2c191d462f1cf986616bec1d2b7e3f49", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 80, "avg_line_length": 31.632183908045977, "alnum_prop": 0.5421511627906976, "repo_name": "toomore/grs", "id": "5a550219475a9d06a3495a175ca350789c3d81b0", "size": "5774", ...
"""Test class for common methods used by iLO modules.""" import tempfile import mock from oslo.config import cfg from oslo.utils import importutils from ironic.common import exception from ironic.common import images from ironic.common import swift from ironic.common import utils from ironic.conductor import task_ma...
{ "content_hash": "73636673b47d30a725c4b244267a3ac1", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 79, "avg_line_length": 48.57289002557545, "alnum_prop": 0.6087826453243471, "repo_name": "rackerlabs/ironic", "id": "7e19760cff1c72a29433593594b9bde2562be970", "size": "19...
from __future__ import division,print_function,unicode_literals,with_statement import sys from django import VERSION from django.db import transaction from django.utils import encoding PY2=sys.version_info[0]==2 # commit_on_success was removed in 1.8, use atomic if hasattr(transaction,'atomic'): atomic_decorator=...
{ "content_hash": "01a73988626749b9031bda71e376f965", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 78, "avg_line_length": 22.78787878787879, "alnum_prop": 0.7632978723404256, "repo_name": "hikelee/launcher", "id": "bb885eec874577b63b6809a225d4176ec7e919a5", "size": "752"...
"""Tests""" from unittest import TestCase class TestDummy(TestCase): """ Dummy test case to prevent `pytest` to report failure. When no tests are run, `pytest` return a non-zero status, this single test prevents that. """ def test_one_equals_one(self): """Dummy test.""" assert...
{ "content_hash": "c889a4440a6995e04582b550179b1ee6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 23.428571428571427, "alnum_prop": 0.625, "repo_name": "jricardo27/holiday_planner", "id": "1ba721e508650788da7e4c60663a6a581d161d5b", "size": "328", ...
from django.db.models import Q from rest_framework import status from rest_framework.filters import ( SearchFilter, OrderingFilter, ) from rest_framework.generics import ( ListAPIView, RetrieveAPIView, CreateAPIView, RetrieveUpdateAPIView, DestroyAPIView) from rest_framework.permissions import ( AllowAn...
{ "content_hash": "cac2fd342f8dd218fde4caae4076e93a", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 110, "avg_line_length": 34.458064516129035, "alnum_prop": 0.6759033888784872, "repo_name": "jonaqp/heroku", "id": "7ebfac4772697f0ef7472e65c34f88f06de07a3f", "size": "5341...
enabled = False try: import pxpcap as pcapc enabled = True except: # We can at least import the rest pass from pox.lib.addresses import IPAddr, EthAddr import parser from threading import Thread import pox.lib.packet as pkt import copy class PCap (object): @staticmethod def get_devices (): def ip (add...
{ "content_hash": "f5cbd112e5837fc4c50b8c919a4695da", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 74, "avg_line_length": 27.60754716981132, "alnum_prop": 0.5908966648441771, "repo_name": "kavitshah8/SDNDeveloper", "id": "52a6d918dccd854878527cfaf63a4082880c02fe", "size...
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
{ "content_hash": "8cde599fcd656084155ec2a468517edf", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 110, "avg_line_length": 38.66470588235294, "alnum_prop": 0.5545413053400274, "repo_name": "plaid/plaid-python", "id": "b28b07b48d6b7d7b53c46770b3d61538af090831", "size": "...
from flask import request, g def jinja_get_translation_engine(): try: return getattr(request, 'i18n_engine') except: return getattr(g, 'i18n_engine', None)
{ "content_hash": "d80f240a9298dd560c795339c664c111", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 23.25, "alnum_prop": 0.6344086021505376, "repo_name": "0xbaadf00d/phial", "id": "5d3a92ab973d34a5b804b424a9d4c555a50ede37", "size": "210", "binary":...
__doc__ = \ """ pyparsing module - Classes and methods to define and execute parsing grammars The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new synta...
{ "content_hash": "c52c593e84dc69d79da4bc9efa4b4c23", "timestamp": "", "source": "github", "line_count": 3716, "max_line_length": 196, "avg_line_length": 41.60844994617869, "alnum_prop": 0.5653259344056605, "repo_name": "5monkeys/pyparsing", "id": "bbe38b8b99399462e5b1bbe91f77abbc4329a61b", "size": ...
import pytest import types import sys import asyncio import collections.abc from functools import wraps import gc from . import ( async_generator, yield_, yield_from_, isasyncgen, isasyncgenfunction, ) # like list(it) but works on async iterators async def collect(ait): items = [] async for value in ait:...
{ "content_hash": "e211475aa0f58404066963bfdcf59043", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 78, "avg_line_length": 29.058659217877096, "alnum_prop": 0.5918004421801404, "repo_name": "njsmith/async_generator", "id": "9dca401b04dd7085e1e2d743dfb8d1d94713dd43", "siz...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "4baed0957dfabd69fa593bb9eac48974", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 82, "avg_line_length": 32.25819672131148, "alnum_prop": 0.6883496379113201, "repo_name": "WalkingMachine/sara_commun", "id": "6dfb916cc0417583c3a87147e557261b82563cb2", "s...
from boussole.conf.base_backend import SettingsBackendBase def test_ok_001(settings): """ Dummy content parsing """ backend = SettingsBackendBase(basedir=settings.fixtures_path) path, filename = backend.parse_filepath() filepath = backend.check_filepath(path, filename) content = backend....
{ "content_hash": "62db50ae134ad8f1e1aa2ddb4c22e75e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 25.733333333333334, "alnum_prop": 0.7124352331606217, "repo_name": "sveetch/boussole", "id": "802b7136be5cf2efa2ebd4b0c29f447e68a4ce49", "size": "410...
from airflow.contrib.hooks.wasb_hook import WasbHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class WasbDeleteBlobOperator(BaseOperator): """ Deletes blob(s) on Azure Blob Storage. :param container_name: Name of the container. (templated) :type conta...
{ "content_hash": "114c4bae33aadee49fab579050e46b25", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 81, "avg_line_length": 37.46153846153846, "alnum_prop": 0.6247433264887063, "repo_name": "artwr/airflow", "id": "4173d7e7a8a5d2a6b15e5bf80beface313638dbc", "size": "2761", ...
""" Загрузчик справки с сайта Microsoft's Old API Help File Reborn http://laurencejackson.com/win32 """ from urllib.request import urlopen # # read_chunk(url, max_chunk) # def read_chunk(url, max_chunk=8192*8): """Генератор содержимого web-файла, для использования в инструкции for""" with urlopen(url) as res...
{ "content_hash": "b470d7ecff8e0030349cc4975e6c6088", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 94, "avg_line_length": 22.126984126984127, "alnum_prop": 0.5882352941176471, "repo_name": "maltsevda/University", "id": "222aaacd8d372ee1ec2b57fca042575b727ba049", "size": ...
import pygame import sys import math import random print("\n\n# # # # # INSTRUCTIONS FOR USE # # # # #") print("This was made to facilitate development of my\n" "Asteroids! clone's programmatically-defined\n" "art assets.") print("You can use it by left clicking once inside\n" "the green square on ...
{ "content_hash": "9d1e3f18f6099f3b7d7e34ea9cd44571", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 230, "avg_line_length": 45.076388888888886, "alnum_prop": 0.5608278128691008, "repo_name": "BFriedland/AsteroidsTest", "id": "8a10e2bb45397381a497ebb29c0b4675bd078be1", "s...
import os import signal import contextlib # Used to build usages AUTHOR = "qs-devel@yunify.com" COPYRIGHT = "Copyright (C) 2016-2017 Yunify, Inc" COMMANDS = ( 'qsctl', 'qsctl-ls', 'qsctl-cp', 'qsctl-mb', 'qsctl-mv', 'qsctl-rb', 'qsctl-rm', 'qsctl-sync', 'qsctl-presign' ) def to_rst_style_title(title): s...
{ "content_hash": "1869ec360c94d2ea3a40b8dfc39029dd", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 72, "avg_line_length": 27.458333333333332, "alnum_prop": 0.6172230652503794, "repo_name": "Fiile/qsctl", "id": "3a628b4f6e4793773693438f705b9d2665dd34d3", "size": "2661", ...
from argparse import ArgumentParser from difflib import ndiff from sys import argv from zipfile import ZipFile, ZIP_DEFLATED def diff(name, content, updated_content): diffs = list(ndiff(content.splitlines(1), updated_content.splitlines(1))) if diffs: print(f"{name}\n{''.join(diffs)}") def replace(co...
{ "content_hash": "2fdf96b514b3bd4310a78e86a5e5efae", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 110, "avg_line_length": 31.175675675675677, "alnum_prop": 0.6454269614217598, "repo_name": "bjuvensjo/scripts", "id": "9afbd853c624555efe7f9e1adbde9e76349520fe", "size": "2...
""" Created on Tue Dec 16 15:58:38 2014 @author: egendron """ import math import numpy as np import gral_zer import pyfits def rotateCoupleOfCoeffs(a, b, m, angledeg): """ Inputs: <a> : scalar, floating point. Coefficient of 1st zernike mode. <b> : scalar, floating point. Coefficient...
{ "content_hash": "95a1b99a75ebb24fc0cf55e97b96ce2c", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 144, "avg_line_length": 34.283720930232555, "alnum_prop": 0.6361416361416361, "repo_name": "soylentdeen/CIAO-commissioning-tools", "id": "25f78411d17f102dc4d2d5ae07e4f66ea4b...
""" Provides a subclass of Disk Cache which saves in a simple z/x/y.extension, with Y=0 being the top of the map, and heading down. This tile layout makes for generation of tiles that is friendly to Google/OSM, and the opposite of TMS. This is useful for pre-generating tiles for Google Maps which are going to be used o...
{ "content_hash": "e1b4252709ac881a1e23ee788ca8eb13", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 82, "avg_line_length": 36.26829268292683, "alnum_prop": 0.6435776731674513, "repo_name": "DOE-NEPA/mapwarper", "id": "78cf1b9c06430e6a4f1cc0c4ed17037ddb2c6d54", "size": "15...
postgres_owner = "owner" postgres_user = "user" postgres_host = "localhost" postgres_passwd = "pass" postgres_db = "db" SQLALCHEMY_DATABASE_URI = "postgresql://" + postgres_user + ":" + postgres_passwd + "@" + postgres_host + "/" + postgres_db SQLALCHEMY_DATABASE_URI_OWNER = "postgresql://" + postgres_owner + ":" + po...
{ "content_hash": "52d841d5e237be1fda4be6804d014030", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 130, "avg_line_length": 47, "alnum_prop": 0.6622340425531915, "repo_name": "niclabs/NetworkInformation-Server", "id": "5edddf8d79359a9a677280b13ae31fe7502d5b90", "size": "40...
""" KFServing Python SDK for KFServing # noqa: E501 The version of the OpenAPI document: v0.1 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import kfserving from kfserving.models.v1beta1_explainer_config import V1beta1Expla...
{ "content_hash": "2646eb961c3bfbbe5edf458fe3357b01", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 98, "avg_line_length": 28.245283018867923, "alnum_prop": 0.6412825651302605, "repo_name": "kubeflow/kfserving-lts", "id": "01587be6ce9875a65a6ec7051c7d58a4b7d33824", "size"...
import scrapy class QiubaiItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() _id = scrapy.Field() avatar = scrapy.Field() profile_link = scrapy.Field() name = scrapy.Field() gender = scrapy.Field() age = scrapy.Field() content = scrapy.Field() ...
{ "content_hash": "b377708ce19a6c048c35a5be6dcec23e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 48, "avg_line_length": 25.625, "alnum_prop": 0.6292682926829268, "repo_name": "ychenracing/Spiders", "id": "792091588798652fc74a75c6e942925554fc4793", "size": "562", "bin...
"""DAG run APIs.""" from datetime import datetime from typing import Dict from deprecated import deprecated from airflow.api.common.experimental import check_and_get_dag, check_and_get_dagrun @deprecated(reason="Use DagRun().get_state() instead", version="2.2.4") def get_dag_run_state(dag_id: str, execution_date: d...
{ "content_hash": "ef1d451ed7771f1ac22e4ea67cc4d600", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 83, "avg_line_length": 31.863636363636363, "alnum_prop": 0.7104136947218259, "repo_name": "Acehaidrey/incubator-airflow", "id": "7201186ea9331c630b76966ecb7f6d4c037a0576", ...