code
stringlengths
9
256k
<s> import logging <EOL> from rest_framework import permissions <EOL> logger = logging . getLogger ( __name__ ) <EOL> class StackdioModelPermissions ( permissions . DjangoModelPermissions ) : <EOL> """<STR_LIT>""" <EOL> perms_map = { <EOL> '<STR_LIT:GET>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL...
<s> from django . conf . urls import url <EOL> from django . contrib . auth import views as auth_views <EOL> from stackdio . core . utils import cached_url <EOL> from . import views <EOL> from . views import accounts <EOL> from . views import blueprints <EOL> from . views import formulas <EOL> from . views import image...
<s> import argparse <EOL> import os <EOL> import shutil <EOL> import tempfile <EOL> from stackstrap . cli import StackStrapCLI <EOL> from stackstrap . commands import CommandError <EOL> from stackstrap . commands . create import name_type <EOL> from stackstrap . project import Project <EOL> from stackstrap . repository...
<s> from __future__ import unicode_literals <EOL> try : <EOL> from builtins import * <EOL> from future import standard_library <EOL> standard_library . install_aliases ( ) <EOL> except : <EOL> pass <EOL> import os <EOL> import sys <EOL> if sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:0> ) : <EOL> import ...
<s> """<STR_LIT>""" <EOL> from core . common import retrieve_content <EOL> __url__ = "<STR_LIT>" <EOL> __check__ = "<STR_LIT>" <EOL> __info__ = "<STR_LIT>" <EOL> __reference__ = "<STR_LIT>" <EOL> def fetch ( ) : <EOL> retval = { } <EOL> content = retrieve_content ( __url__ ) <EOL> if __check__ in content : <EOL> for li...
<s> """<STR_LIT>""" <EOL> from core . common import retrieve_content <EOL> __url__ = "<STR_LIT>" <EOL> __check__ = "<STR_LIT>" <EOL> __info__ = "<STR_LIT>" <EOL> __reference__ = "<STR_LIT>" <EOL> def fetch ( ) : <EOL> retval = { } <EOL> content = retrieve_content ( __url__ ) <EOL> if __check__ in content : <EOL> for li...
<s> import meinheld , MySQLdb , msgpack , ujson <EOL> from MySQLdb . cursors import DictCursor <EOL> packer = msgpack . Packer ( ) <EOL> con = MySQLdb . connect ( user = '<STR_LIT:root>' , host = '<STR_LIT:localhost>' , db = '<STR_LIT:test>' ) <EOL> con . autocommit ( <NUM_LIT:1> ) <EOL> count = <NUM_LIT:0> <EOL> def f...
<s> import os , sys , inspect <EOL> def add_relative_to_current_source_file_path_to_sys_path ( relpath ) : <EOL> path = os . path . realpath ( os . path . abspath ( os . path . join ( os . path . split ( inspect . getfile ( inspect . currentframe ( ) ) ) [ <NUM_LIT:0> ] , relpath ) ) ) <EOL> if path not in sys . path :...
<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function <EOL> import json <EOL> import rethinkdb as r <EOL> def connect ( ) : <EOL> """<STR_LIT>""" <EOL> return r . connect ( db = '<STR_LIT>' ) <EOL> def init_db ( ) : <EOL> """<STR_LIT>""" <EOL> with connect ( ) as con : <EOL> try : <EOL> r . ...
<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> import requests <EOL> import logging <EOL> import os <EOL> import json <EOL> import base64 <EOL> from repositorytools . lib . artifact import RemoteArtifact <EOL> logger = logging . getL...
<s> import statsmodels . api as sm <EOL> import pandas as pd <EOL> from load_macrodata import dta <EOL> cycle , trend = sm . tsa . filters . hpfilter ( dta . realgdp , <NUM_LIT> ) <EOL> gdp_decomp = dta [ [ '<STR_LIT>' ] ] <EOL> gdp_decomp [ "<STR_LIT>" ] = cycle <EOL> gdp_decomp [ "<STR_LIT>" ] = trend <EOL> import ma...
<s> import numpy as np <EOL> from scipy import stats <EOL> import statsmodels . api as sm <EOL> import matplotlib . pyplot as plt <EOL> from statsmodels . distributions . mixture_rvs import mixture_rvs <EOL> np . random . seed ( <NUM_LIT> ) <EOL> obs_dist1 = mixture_rvs ( [ <NUM_LIT> , <NUM_LIT> ] , size = <NUM_LIT> , ...
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import range <EOL> import numpy as np <EOL> import statsmodels . api as sm <EOL> from statsmodels . compat . scipy import NumpyVersion <EOL> from numpy . testing import assert_ , assert_allclose , assert_equal <EOL> from nose import SkipTest <EOL> import plat...
<s> from . data import * </s>
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import range <EOL> import os <EOL> import numpy as np <EOL> from numpy . testing import ( assert_ , assert_raises , assert_almost_equal , <EOL> assert_equal , assert_array_equal , assert_allclose , <EOL> assert_array_less ) <EOL> from statsmodels . discrete ....
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> import statsmodels . sandbox . nonparametric . kernel_extras as smke <EOL> import statsmodels . sandbox . nonparametric . dgp_examples as dgp...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import numpy as np <EOL> import statsmodels . api as sm <EOL> np . random . seed ( <NUM_LIT> ) <EOL> nsample = <NUM_LIT:100> <EOL> x = np . linspace ( <NUM_LIT:0> , <NUM_LIT:10> , <NUM_LIT:100> ) <EOL> X = sm . add_constant ( np . column_stack ( ( x ...
<s> from statsmodels . regression . linear_model import GLS <EOL> gls = GLS . from_formula <EOL> from statsmodels . regression . linear_model import WLS <EOL> wls = WLS . from_formula <EOL> from statsmodels . regression . linear_model import OLS <EOL> ols = OLS . from_formula <EOL> from statsmodels . regression . linea...
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import get_function_name , iterkeys , lrange , zip , iteritems <EOL> import numpy as np <EOL> from statsmodels . graphics . plottools import rainbow <EOL> import statsmodels . graphics . utils as utils <EOL> def interaction_plot ( x , trace , response , func ...
<s> """<STR_LIT>""" <EOL> from numpy . lib . _iotools import _is_string_like <EOL> from statsmodels . compat . python import PY3 <EOL> class EmptyContextManager ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , obj ) : <EOL> self . _obj = obj <EOL> def __enter__ ( self ) : <EOL> '''<STR_LIT>''' <EOL> retur...
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import range , string_types <EOL> import copy <EOL> import numpy as np <EOL> from scipy import optimize <EOL> from scipy . stats . mstats import mquantiles <EOL> try : <EOL> import joblib <EOL> has_joblib = True <EOL> except ImportError : <EOL> has_joblib = F...
<s> import numpy as np <EOL> class Bunch ( dict ) : <EOL> def __init__ ( self , ** kw ) : <EOL> dict . __init__ ( self , kw ) <EOL> self . __dict__ = self <EOL> for i , att in enumerate ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) : <EOL> self [ att ] = self . params_table [ : , i ] <EOL> est = dict ( ...
<s> '''<STR_LIT>''' </s>
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import numpy as np <EOL> class TransformFunction ( object ) : <EOL> def __call__ ( self , x ) : <EOL> self . func ( x ) <EOL> class SquareFunc ( TransformFunction ) : <EOL> '''<STR_LIT>''' <EOL> def func ( self , x ) : <EOL> return np . power ( x , <...
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import lzip <EOL> import numpy as np <EOL> import matplotlib . finance as fin <EOL> import matplotlib . pyplot as plt <EOL> import datetime as dt <EOL> import pandas as pa <EOL> def getquotes ( symbol , start , end ) : <EOL> quotes = fin . quotes_historical_y...
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from numpy . testing import assert_almost_equal , assert_equal <EOL> from statsmodels . sandbox . nonparametric import smoothers , kernels <EOL> from statsmodels . regression . linear_model import OLS , WLS <EOL> class CheckSmoother ( object ) : <EOL> def test_predict ...
<s> '''<STR_LIT>''' <EOL> from statsmodels . compat . python import lmap <EOL> import numpy as np <EOL> from numpy . testing . decorators import skipif <EOL> import pandas <EOL> import scipy <EOL> from scipy import stats <EOL> from statsmodels . regression . linear_model import OLS <EOL> from statsmodels . sandbox . re...
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> def pca ( data , keepdim = <NUM_LIT:0> , normalize = <NUM_LIT:0> , demean = True ) : <EOL> '''<STR_LIT>''' <EOL> x = np . array ( data ) <EOL> if demean : <EOL> m = x . mean ( <NUM_LIT:0> ) <EOL> else : <EOL> m = np . zeros ( x . shape [ <NUM_LIT:1> ] ) <EOL> x -= m <E...
<s> '''<STR_LIT>''' <EOL> from statsmodels . compat . python import range , lrange <EOL> import numpy as np <EOL> from scipy import stats <EOL> def powerdiscrepancy ( observed , expected , lambd = <NUM_LIT:0.0> , axis = <NUM_LIT:0> , ddof = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> o = np . array ( observed ) <EOL> e...
<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from numpy . testing import assert_almost_equal , assert_equal <EOL> from statsmodels . stats . inter_rater import ( fleiss_kappa , cohens_kappa , <EOL> to_table , aggregate_raters ) <EOL> class Holder ( object ) : <EOL> pass <EOL> table0 = np . asarray ( '''<STR_LIT>'...
<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from statsmodels . compat . python import range <EOL> import numpy as np <EOL> EPS = np . MachAr ( ) . eps <EOL> _hessian_docs = """<STR_LIT>""" <EOL> def _get_epsilon ( x , s , epsilon , n ) : <EOL> if epsilon is None : <EOL> h = EPS ** ( <NUM_LIT:1...
<s> """<STR_LIT>""" <EOL> from statsmodels . compat . python import range <EOL> import numpy as np <EOL> from scipy import signal , optimize <EOL> from statsmodels . base . model import ( LikelihoodModel , <EOL> GenericLikelihoodModel ) <EOL> class Arma ( GenericLikelihoodModel ) : <EOL> """<STR_LIT>""" <EOL> def __ini...
<s> """<STR_LIT>""" <EOL> from __future__ import division , absolute_import , print_function <EOL> from warnings import warn <EOL> from statsmodels . compat . collections import OrderedDict <EOL> import numpy as np <EOL> import pandas as pd <EOL> from statsmodels . tsa . filters . hp_filter import hpfilter <EOL> from s...
<s> import numpy as np <EOL> llf = np . array ( [ - <NUM_LIT> ] ) <EOL> nobs = np . array ( [ <NUM_LIT> ] ) <EOL> k = np . array ( [ <NUM_LIT:5> ] ) <EOL> k_exog = np . array ( [ <NUM_LIT:1> ] ) <EOL> sigma = np . array ( [ <NUM_LIT> ] ) <EOL> chi2 = np . array ( [ <NUM_LIT> ] ) <EOL> df_model = np . array ( [ <NUM_LIT...
<s> import numpy as np <EOL> import statsmodels . api as sm <EOL> from statsmodels . tsa . api import VAR , SVAR <EOL> import matplotlib . pyplot as plt <EOL> import statsmodels . tsa . vector_ar . util as util <EOL> import pandas as px <EOL> mdatagen = sm . datasets . macrodata . load ( ) . data <EOL> mdata = mdatagen...
<s> from setuptools import setup , find_packages <EOL> install_requires = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> classifiers = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] , <EOL>...
<s> from django . db import models <EOL> from django . db . models import Q <EOL> from datetime import datetime <EOL> class FolderManager ( models . Manager ) : <EOL> def with_bad_metadata ( self ) : <EOL> return self . get_query_set ( ) . filter ( has_all_mandatory_data = False ) </s>
<s> class BaseSmsBackend ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , fail_silently = False , ** kwargs ) : <EOL> self . fail_silently = fail_silently <EOL> def open ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def send_messages ( self ,...
<s> import re <EOL> from django import template <EOL> from django . template . defaultfilters import stringfilter , force_escape <EOL> from django . utils . safestring import mark_safe <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from annotatetext . models import Annotation <EOL> from an...
<s> from pyws . errors import MissingFieldValue , WrongFieldValueType <EOL> from pyws . functions . args . types import TypeFactory <EOL> __all__ = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> class Field ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , type_ , none_value = None ) : <EOL> """<STR_LIT>""" ...
<s> import unittest2 as unittest <EOL> from testcases . base import BaseTestCaseMixin <EOL> class AddIntegerListsTestCase ( BaseTestCaseMixin , unittest . TestCase ) : <EOL> def test_empty ( self ) : <EOL> p = self . factory . create ( '<STR_LIT>' ) <EOL> p . item = [ ] <EOL> q = self . factory . create ( '<STR_LIT>' )...
<s> from __future__ import unicode_literals <EOL> from django . db import migrations , models <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_L...
<s> from __future__ import unicode_literals <EOL> from future . builtins import str , super <EOL> import os <EOL> import datetime <EOL> from django . db import models <EOL> from django import forms <EOL> from django . core . files . storage import default_storage <EOL> from django . forms . widgets import Input <EOL> f...
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . add_column ( '<STR_LIT>' , '<STR_LIT>' , <EOL> self . gf ( '<STR_LIT>' ) ( default = False ) , ...
<s> from __future__ import unicode_literals <EOL> from django . contrib . auth import ( login as auth_login , authenticate , <EOL> logout as auth_logout , get_user_model ) <EOL> from django . contrib . auth . decorators import login_required <EOL> from django . contrib . messages import info , error <EOL> from django ....
<s> from __future__ import unicode_literals <EOL> from future . builtins import str <EOL> from copy import copy <EOL> from django . contrib import admin <EOL> from django . contrib . messages import info <EOL> from django . http import HttpResponseRedirect <EOL> from django . utils . translation import ugettext_lazy as...
<s> from modeltranslation . translator import TranslationOptions <EOL> class TranslatedSlugged ( TranslationOptions ) : <EOL> fields = ( '<STR_LIT:title>' , ) <EOL> class TranslatedDisplayable ( TranslatedSlugged ) : <EOL> fields = ( '<STR_LIT>' , '<STR_LIT:description>' ) <EOL> class TranslatedRichText ( TranslationOp...
<s> from __future__ import unicode_literals <EOL> from django_comments . managers import CommentManager as DjangoCM <EOL> from mezzanine . conf import settings <EOL> from mezzanine . core . managers import CurrentSiteManager <EOL> class CommentManager ( CurrentSiteManager , DjangoCM ) : <EOL> """<STR_LIT>""" <EOL> def ...
<s> from modeltranslation . translator import translator , TranslationOptions <EOL> from mezzanine . core . translation import ( TranslatedDisplayable , <EOL> TranslatedRichText ) <EOL> from mezzanine . pages . models import Page , RichTextPage , Link <EOL> class TranslatedPage ( TranslatedDisplayable ) : <EOL> fields ...
<s> from __future__ import unicode_literals <EOL> import os <EOL> import sys <EOL> from django . contrib . sites . models import Site <EOL> from mezzanine . conf import settings <EOL> from mezzanine . core . request import current_request <EOL> def current_site_id ( ) : <EOL> """<STR_LIT>""" <EOL> from mezzanine . util...
<s> import os <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( '<STR_LIT>' ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> os . environ . setdefault ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> from django . core . management import execute_from_command_line <EOL> execute_from_command_line ...
<s> """<STR_LIT>""" <EOL> import tempfile <EOL> import os <EOL> import os . path as op <EOL> import shutil <EOL> from unittest import TestCase <EOL> import re <EOL> from pyesgf . logon import LogonManager , DAP_CONFIG_MARKER <EOL> from pyesgf . search import SearchConnection <EOL> from test . config import TEST_SERVICE...
<s> import os <EOL> from setuptools import setup , find_packages <EOL> def read ( fname ) : <EOL> return open ( os . path . join ( os . path . dirname ( __file__ ) , fname ) ) . read ( ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT:1.0>' , <EOL> description = '<STR_LIT>' , <EOL> long_description =...
<s> from django . test . client import Client <EOL> from . . documents import Test001Parent <EOL> from . . forms import ( Test002StringFieldForm , Test003FormFieldOrder , <EOL> Test004StringFieldForm ) <EOL> from testprj . tests import MongoengineTestCase <EOL> class MongoformsRegressionTests ( MongoengineTestCase ) : ...
<s> from django . contrib import messages <EOL> from django . shortcuts import redirect <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . views . generic import TemplateView , FormView <EOL> from userprofiles . mixins import LoginRequiredMixin <EOL> from userprofiles . settings impor...
<s> """<STR_LIT>""" <EOL> import functools <EOL> import random <EOL> try : <EOL> from gevent . lock import RLock <EOL> except ImportError : <EOL> from gevent . coros import RLock <EOL> from . base import ( <EOL> LoadBalancerSink , <EOL> NoMembersError <EOL> ) <EOL> from . . async import AsyncResult <EOL> from . . const...
<s> import logging <EOL> import random <EOL> import time <EOL> from struct import ( pack , unpack ) <EOL> from cStringIO import StringIO <EOL> import gevent <EOL> from . . async import AsyncResult <EOL> from . . constants import SinkProperties <EOL> from . . message import ( <EOL> Deadline , <EOL> MethodDiscardMessage ...
<s> import gevent <EOL> from scales . async import AsyncResult <EOL> from scales . constants import ChannelState , SinkProperties <EOL> from scales . core import ScalesUriParser <EOL> from scales . message import ( MethodReturnMessage , FailedFastError ) <EOL> from scales . loadbalancer . serverset import ServerSetProv...
<s> from pyxley . charts import Chart <EOL> from flask import jsonify , request <EOL> class PlotlyAPI ( Chart ) : <EOL> def __init__ ( self , options , route_func ) : <EOL> super ( PlotlyAPI , self ) . __init__ ( "<STR_LIT>" , options , route_func ) <EOL> class PlotlyLines ( PlotlyAPI ) : <EOL> def __init__ ( self , xy...
<s> from . import npm <EOL> from . import webpack <EOL> NPM = npm . NPM <EOL> Webpack = webpack . Webpack </s>
<s> """<STR_LIT>""" <EOL> import binascii <EOL> import math <EOL> import os <EOL> import uuid as _uu <EOL> class ShortUUID ( object ) : <EOL> def __init__ ( self , alphabet = None ) : <EOL> if alphabet is None : <EOL> alphabet = list ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> self . set_alphabet ( alphabet ) <EOL> @ prope...
<s> """<STR_LIT>""" <EOL> db = current . db <EOL> atable = db . auth_user <EOL> frtable = db . friend_requests <EOL> join_query = ( atable . id == frtable . to_h ) <EOL> email_ids = db ( frtable ) . select ( atable . email , <EOL> join = frtable . on ( join_query ) , <EOL> distinct = True ) <EOL> for email in email_ids...
<s> import unittest <EOL> import tempfile <EOL> import os <EOL> try : <EOL> from mock import create_autospec , MagicMock <EOL> except ImportError : <EOL> from unittest . mock import create_autospec , MagicMock <EOL> from stormpath_cli import context <EOL> from stormpath . resources . application import ApplicationList ...
<s> from __future__ import print_function <EOL> import numpy as np <EOL> from numpy import cos , sin <EOL> from numpy . testing import assert_equal <EOL> import unittest <EOL> import pcl <EOL> from pcl . registration import icp , gicp , icp_nl <EOL> class TestICP ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EO...
<s> """<STR_LIT>""" <EOL> import pyramid <EOL> from . api import ( <EOL> register_api_doc_endpoints , <EOL> build_swagger_20_swagger_schema_views , <EOL> ) <EOL> from . ingest import get_swagger_schema <EOL> from . ingest import get_swagger_spec <EOL> from . tween import get_swagger_versions , SWAGGER_12 , SWAGGER_20 <...
<s> from django . db import models <EOL> import bcrypt <EOL> from monospace import settings <EOL> class User ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> email = models . CharField ( max_length = <NUM_LIT:255> , unique = True ) <EOL> password = models . CharField ( max_lengt...
<s> import stripe <EOL> from stripe . test . helper import StripeApiTestCase <EOL> class ListObjectTests ( StripeApiTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( ListObjectTests , self ) . setUp ( ) <EOL> self . lo = stripe . resource . ListObject . construct_from ( { <EOL> '<STR_LIT:id>' : '<STR_LIT>' , <EOL> ...
<s> import io , subprocess , sqlite3 , collections , datetime , re , sys <EOL> def run ( args , db ) : <EOL> cmd = '<STR_LIT>' <EOL> table = '<STR_LIT>' <EOL> out_structure = """<STR_LIT>""" . split ( '<STR_LIT:\n>' ) <EOL> ps_out = out_structure [ <NUM_LIT:0> ] . split ( ) <EOL> ps_sizes = out_structure [ <NUM_LIT:1> ...
<s> """<STR_LIT>""" <EOL> from datetime import datetime <EOL> import inspect <EOL> __version__ = '<STR_LIT>' <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ,...
<s> SHAPE_SPHERE = <NUM_LIT:0> <EOL> SHAPE_BOX = <NUM_LIT:1> <EOL> SHAPE_CAPSULE = <NUM_LIT:2> <EOL> MODE_STATIC = <NUM_LIT:0> <EOL> MODE_DYNAMIC = <NUM_LIT:1> <EOL> MODE_DYNAMIC_BONE = <NUM_LIT:2> </s>
<s> from bpy . types import PropertyGroup <EOL> from bpy . props import StringProperty , IntProperty , BoolVectorProperty , EnumProperty , FloatVectorProperty <EOL> from mmd_tools . core import rigid_body <EOL> class MMDRigidBody ( PropertyGroup ) : <EOL> name_j = StringProperty ( <EOL> name = '<STR_LIT:Name>' , <EOL> ...
<s> from . models import Item , UserItem <EOL> from . myauth import MyAuthenticatedResource <EOL> from easyrest . resources import APIResource <EOL> from easyrest . core import API <EOL> api = API ( ) <EOL> class ItemResource ( APIResource ) : <EOL> model = Item <EOL> name = '<STR_LIT>' <EOL> def serialize ( self , ite...
<s> '''<STR_LIT>''' <EOL> Version = '<STR_LIT>' <EOL> import operator , math , random <EOL> NPRE , NPOST = <NUM_LIT:0> , <NUM_LIT:0> <EOL> def iszero ( z ) : return abs ( z ) < <NUM_LIT> <EOL> def getreal ( z ) : <EOL> try : <EOL> return z . real <EOL> except AttributeError : <EOL> return z <EOL> def getimag ( z ) : <E...
<s> from metrics . models import ProgramTimeliness , AgencyTimeliness <EOL> from numpy import mean <EOL> from helpers . charts import Pie <EOL> from utils import short_money <EOL> from settings import FISCAL_YEARS , MEDIA_ROOT <EOL> def main ( ) : <EOL> for fy in FISCAL_YEARS : <EOL> timely_programs = ProgramTimeliness...
<s> from distutils . core import setup <EOL> long_description = '<STR_LIT>' <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = "<STR_LIT>" , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT>' } , <EOL> packages = [ '<STR_LIT>' ] , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<...
<s> from rest_framework import serializers <EOL> from rest_framework . compat import unicode_to_repr <EOL> from models import * <EOL> class CurrentSessionDefault ( object ) : <EOL> def set_context ( self , serializer_field ) : <EOL> self . user = Session . current_for_user ( serializer_field . context [ '<STR_LIT>' ] ....
<s> from django . conf import settings <EOL> import urllib2 <EOL> from cache import * <EOL> from models import ApiLogIncrement <EOL> QS_PARAM = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> HTTP_HEADER = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> LOCKSMITH_CLIENT_KEY = getattr ( settings , '<STR_LI...
<s> import datetime <EOL> from south . db import db <EOL> from south . v2 import SchemaMigration <EOL> from django . db import models <EOL> class Migration ( SchemaMigration ) : <EOL> def forwards ( self , orm ) : <EOL> db . add_column ( u'<STR_LIT>' , '<STR_LIT>' , <EOL> self . gf ( '<STR_LIT>' ) ( auto_now_add = True...
<s> """<STR_LIT>""" <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from process_skede_lines import attach_ie_target <EOL> from formdata . models import SkedE <EOL> from datetime import date <EOL> class Command ( BaseCommand ) : <EOL> help = "<STR_LIT>" <EOL> requires_model_validati...
<s> import sys , time , os <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> from parsing . filing import filing <EOL> from parsing . form_parser import form_parser , ParserMissingError <EOL> from fec_alerts . utils . form_mappers import * <EOL> from write_csv_to_db import CSV_dumper <EOL> from fec_import_logging import ...
<s> from django . conf . urls . defaults import url , patterns <EOL> urlpatterns = patterns ( '<STR_LIT>' , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> url ( r'<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) </s>
<s> """<STR_LIT>""" <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from formdata . models import SkedE <EOL> from fec_alerts . models import new_filing <EOL> from django . db import connection <EOL> class Command ( BaseCommand ) : <EOL> help = "<STR_LIT>" <EOL> requires_model_valid...
<s> from datetime import date <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from summary_data . utils . summary_utils import update_committee_times <EOL> from summary_data . models import Committee_Overlay <EOL> from django . conf import settings <EOL> try : <EOL> CURRENT_CYCLE = ...
<s> from django . template import Library <EOL> from summary_data . utils . update_utils import get_update_time <EOL> from django . conf import settings <EOL> FILING_SCRAPE_KEY = settings . FILING_SCRAPE_KEY <EOL> COMMITTEES_SCRAPE_KEY = settings . COMMITTEES_SCRAPE_KEY <EOL> BULK_EXPORT_KEY = settings . BULK_EXPORT_KE...
<s> import django <EOL> from rest_framework import test <EOL> from djet import testcases <EOL> class APIRequestFactory ( testcases . RequestFactory , test . APIRequestFactory ) : <EOL> def _request ( self , method , ** kwargs ) : <EOL> request = super ( APIRequestFactory , self ) . _request ( method , ** kwargs ) <EOL>...
<s> from datetime import timedelta <EOL> DEBUG = True <EOL> SQLALCHEMY_DATABASE_URI = '<STR_LIT>' <EOL> CELERY_BROKER_URL = '<STR_LIT>' <EOL> CELERY_TASK_SERIALIZER = '<STR_LIT>' <EOL> CELERY_ACCEPT_CONTENT = [ '<STR_LIT>' ] <EOL> CELERYBEAT_SCHEDULE = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<S...
<s> import sys <EOL> try : <EOL> import pyresttest <EOL> except ImportError : <EOL> sys . path . insert ( <NUM_LIT:0> , '<STR_LIT:..>' ) </s>
<s> import timeit <EOL> import time <EOL> import string <EOL> import argparse <EOL> import csv <EOL> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] > <NUM_LIT:2> : <EOL> import urllib . parse as urlparse <EOL> else : <EOL> import urlparse <EOL> from pycurl import Curl <EOL> try : <EOL> from cStringIO import Str...
<s> import os <EOL> DIRNAME = os . path . dirname ( __file__ ) <EOL> DEFAULT_CHARSET = '<STR_LIT:utf-8>' <EOL> DATABASE_ENGINE = '<STR_LIT>' <EOL> DATABASE_NAME = os . path . join ( DIRNAME , '<STR_LIT>' ) <EOL> INSTALLED_APPS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> MULTILINGUAL_TA...
<s> import os <EOL> from pdb import set_trace <EOL> from unittest import TestCase <EOL> from gtdzen import GTD <EOL> from gtdzen . exceptions import * <EOL> TEST_DB = '<STR_LIT>' <EOL> class TaskTests ( TestCase ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> if os . path . exists ( TEST_DB ) : <EOL> os . ...
<s> import wikipedia <EOL> from templates . text import TextTemplate <EOL> def process ( input , entities ) : <EOL> output = { } <EOL> try : <EOL> query = entities [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:value>' ] <EOL> data = wikipedia . summary ( query ) <EOL> output [ '<STR_LIT:input>' ] = input <EOL> output [ '...
<s> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __licence__ = '<STR_LIT>' <EOL> from mock import patch <EOL> from proxmoxer import ProxmoxAPI <EOL> from tests . base . base_ssh_suite import BaseSSHSuite <EOL> class TestOpenSSHSuite ( BaseSSHSuite ) : <EOL> proxmox = None <EOL> client = None <EOL> @...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AlterUniqueTogether ( <EOL> name = '<STR_LIT>' , <EOL> unique_toge...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . AddField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT...
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> ] </s>
<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> import django . db . models . deletion <EOL> import django . utils . timezone <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <...
<s> from django import template <EOL> from django . utils . safestring import mark_safe <EOL> from reversion . helpers import generate_patch_html <EOL> register = template . Library ( ) <EOL> @ register . simple_tag <EOL> def semantic_diff ( left , right , field ) : <EOL> return mark_safe ( generate_patch_html ( left ,...
<s> from django . core . urlresolvers import reverse <EOL> from . base import TestBase <EOL> from . . models import ProfileUpdateRequest , Person , KnowledgeDomain , Lesson <EOL> class TestProfileUpdateRequest ( TestBase ) : <EOL> def setUp ( self ) : <EOL> self . _setUpAirports ( ) <EOL> self . _setUpLessons ( ) <EOL>...
<s> from setuptools import setup , find_packages <EOL> import os <EOL> execfile ( os . path . join ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = VERSION , <EOL> description = '<STR_LIT>' , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' ...
<s> """<STR_LIT>""" <EOL> from sword2_logging import logging <EOL> from implementation_info import __version__ <EOL> coll_l = logging . getLogger ( __name__ ) <EOL> from compatible_libs import etree <EOL> from utils import NS , get_text <EOL> from datetime import datetime <EOL> class Category ( object ) : <EOL> """<STR...