prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.... | warnings.warn(BlasNotFoundError.__doc__)
libodr_files.append('d_lpkbls.f') |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.... | from numpy.distutils.core import setup
setup(**configuration(top_path='').todict()) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def <|fim_middle|>(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils... | configuration |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | class Customer(HattiUser):
title = models.CharField(max_length=200, blank=True, null=True)
is_org = models.BooleanField();
org_type = models.ForeignKey(OrganisationType) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
<|fim_middle|>
class Address(models.Model):
street_address = models.CharField(max_length=100)
city = models.CharField(max_length=100)
pi... | type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
<|fim_middle|>
class Address(models.Model):
street_address = mod... | return self.type_desc |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
<|fim_middle|>... | street_address = models.CharField(max_length=100)
city = models.CharField(max_length=100)
pin = models.CharField(max_length=10)
province = models.CharField(max_length=100)
nationality = models.CharField(max_length=100)
def __unicode__(self):
return self.street_address + ',' + self.city |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | return self.street_address + ',' + self.city |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | user = models.OneToOneField(User)
address = models.ForeignKey(Address)
telephone = models.CharField(max_length=500)
date_joined = models.DateTimeField(auto_now_add=True)
fax = models.CharField(max_length=100)
avatar = models.CharField(max_length=100, null=True, blank=True)
tagline = models... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | abstract = True |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | title = models.CharField(max_length=200)
organisation_type = models.ForeignKey(OrganisationType)
def __unicode__(self):
return self.title |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | return self.title |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | title = models.CharField(max_length=200, blank=True, null=True)
is_org = models.BooleanField();
org_type = models.ForeignKey(OrganisationType)
company = models.CharField(max_length = 200)
def __unicode__(self, arg):
return unicode(self.user) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | return unicode(self.user) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def <|fim_middle|>(self):
return self.type_desc
class Address(models.Model):
street_addr... | __unicode__ |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | __unicode__ |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | __unicode__ |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address... | __unicode__ |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
<|fim▁hole|> f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
print_all(current_file)
print "Now let's rewind... | def print_all(f):
print f.read()
def rewind(f): |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def print_all(f):
<|fim_middle|>
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
print... | print f.read() |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def rewind(f):
<|fim_middle|>
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
... | f.seek(0) |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
<|fim_middle|>
current_file = open(input_file)
print "First let's print the whole file:\n"
print_all(current_fil... | print line_count, f.readline() |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def <|fim_middle|>(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
p... | print_all |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def <|fim_middle|>(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"... | rewind |
<|file_name|>ex20.py<|end_file_name|><|fim▁begin|>from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def <|fim_middle|>(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
prin... | print_a_line |
<|file_name|>variables.py<|end_file_name|><|fim▁begin|>__author__ = 'sekely'
'''
we are using variables almost everywhere in the code.<|fim▁hole|>
this of it as the famous "x" from high school
x = 5, right?
the only thing is, that in Python "x" can store anything
'''
# try this code:
x = 5
y = x + 3
print(y)
# wha... | variables are used to store results, calculations and many more. |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | return "View Generator Service is Active!" |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | executor.submit(runTask)
return "" |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | cron = CRONTask.CRONTask( )
cron.run( )
cron.killPID( )
sys.exit(0) |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | app.run( debug=True, port=Config.PORT, host=Config.HOST ) |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | index |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | view |
<|file_name|>ViewGeneratorService.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import Config
import Database
import atexit, os, time
from flask import Flask
from concurrent.futures import ThreadPoolExecutor
from classes import CRONTask
# Generate a thread pool
executor = ThreadPoolExecutor(5)
app = Flask( __... | runTask |
<|file_name|>returnTypeInNewNumpyDocString_after.py<|end_file_name|><|fim▁begin|>def f(x):
"""
Returns
-------
object<|fim▁hole|> return 42<|fim▁end|> | """ |
<|file_name|>returnTypeInNewNumpyDocString_after.py<|end_file_name|><|fim▁begin|>def f(x):
<|fim_middle|>
<|fim▁end|> | """
Returns
-------
object
"""
return 42 |
<|file_name|>returnTypeInNewNumpyDocString_after.py<|end_file_name|><|fim▁begin|>def <|fim_middle|>(x):
"""
Returns
-------
object
"""
return 42<|fim▁end|> | f |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.contrib.admin import TabularInline
from .models import GalleryPhoto
class PhotoInline(TabularInline):
"""
Tabular inline that will be displayed in the gallery form during frontend
editing or in the admin site.<|fim▁hol... | """
model = GalleryPhoto
fk_name = "gallery" |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.contrib.admin import TabularInline
from .models import GalleryPhoto
class PhotoInline(TabularInline):
<|fim_middle|>
<|fim▁end|> | """
Tabular inline that will be displayed in the gallery form during frontend
editing or in the admin site.
"""
model = GalleryPhoto
fk_name = "gallery" |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
This class instantiates the modules, takes care of the module's versions
and gets the module's select queries.
"""
# dictonary of instantiated modules
_instantiated_modules = {}
def __init__(self, db):
self._db = db
self._log = Logging(self.__class__.__name__).get_logg... |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | self._db = db
self._log = Logging(self.__class__.__name__).get_logger()
########################################################################
self._instantiate_modules()
self._check_module_versions() |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
Method to instantiate modules.
All modules must contain a class with the exact same name as the module.
This class must implement the abstract base class (abc) DatasourceBase.
"""
# finds all modules to import
for module_name in modules.__all__:
... |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
Method to check module's versions.
"""
for module_name, module in self._instantiated_modules.items():
module_version = module.get_version()
# searches module's version in the database
result = self._db.select_data('''
SELECT vers... |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
Returns the module's search queries.
"""
queries = {}
for module_name, module in self._instantiated_modules.items():
queries[module_name] = module.get_queries('select')
return queries |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
Exception for module subclass errors.
""" |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | """
Exception for module version errors.
""" |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | raise SubClassError(
'Modul is not an instance of DatasourceBase: {}'
.format(module.__class__.__name__)) |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | self._db.insert_data('''
INSERT INTO versions (module, version)
VALUES (%s, %s)''', (module_name, module_version)) |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | self.server.db.update_data('''
UPDATE versions
SET version = %s
WHERE module = %s''', (module_version, module_name,)) |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | raise VersionError('Old module version detected!' +
'Module: {} - Expected: {} - Found: {}'
.format(module_name, result[0][0], module_version)) |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | __init__ |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | _instantiate_modules |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | _check_module_versions |
<|file_name|>Scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The scheduler is responsible for the module handling.
"""
import modules
from importlib import import_module
from additional.Logging import Logging
################################################################################
cla... | get_module_select_queries |
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | Returns:
outputs: Encoder states.
if time_major is True, a tensor of size `[T, B, output_dim]` |
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | """Student CNN encoder for XE training.
Args:
input_size (int): the dimensions of input vectors.
This is expected to be num_channels * 3 (static + Δ + ΔΔ)
splice (int): frames to splice
num_stack (int): the number of frames to stack
parameter_init (float, optional): t... |
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | ert input_size % 3 == 0
self.num_channels = (input_size // 3) // num_stack // splice
self.splice = splice
self.num_stack = num_stack
self.parameter_init = parameter_init
self.name = name
|
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | Construct model graph.
Args:
inputs (placeholder): A tensor of size
`[B, input_size (num_channels * splice * num_stack * 3)]`
keep_prob (placeholder, float): A probability to keep nodes
in the hidden-hidden connection
is_training (bool)... |
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | nit__(se |
<|file_name|>student_cnn_xe.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Student CNN encoder for XE training."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from models.en... | all__(se |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | client = models.ForeignKey(Application)
user = models.ForeignKey(User)
scope = models.CharField(_('Scope'), max_length=255, blank=True)
code = models.CharField(_('Code'), max_length=255, blank=False) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | lient_id = models.CharField(_('Client ID'), max_length=40, blank=False, primary_key=True)
client_secret = models.CharField(_('Client secret'), max_length=40, blank=False)
name = models.CharField(_('Application Name'), max_length=40, blank=False)
home_url = models.CharField(_('URL'), max_length=255, blan... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | eturn unicode(self.client_id)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | lient = models.ForeignKey(Application)
user = models.ForeignKey(User)
scope = models.CharField(_('Scope'), max_length=255, blank=True)
code = models.CharField(_('Code'), max_length=255, blank=False)
creation_timestamp = models.CharField(_('Creation timestamp'), max_length=40, blank=False)
expire... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | nique_together = ('client', 'code')
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | eturn unicode(self.code)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | oken = models.CharField(_('Token'), max_length=40, blank=False, primary_key=True)
client = models.ForeignKey(Application)
user = models.ForeignKey(User)
scope = models.CharField(_('Scope'), max_length=255, blank=True)
token_type = models.CharField(_('Token type'), max_length=10, blank=False)
r... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | eturn unicode(self.token)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | f created is False:
instance.token_set.all().update(creation_timestamp='0')
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | nstance.token_set.all().update(creation_timestamp='0')
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | _unicode__( |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | _unicode__( |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | _unicode__( |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | nvalidate_tokens_on_change( |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | """
the simplest device.
Uses a stepwise-constant quadrature rule and non-adaptive
smoothing.
"""
def __init__(
self,
positive=True,
normalize=False,
wlm=None,
wlm_factory='WeightedLassoLarsCV',
cum_interp='linear',
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | if wlm is None:
# Allow reference by class for easy serialization
if isinstance(wlm_factory, str):
wlm_factory = getattr(weighted_linear_model, wlm_factory)
self.wlm = wlm_factory(
positive=positive,
normalize=normalize,
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.obs_t_ = obs_t
self.cum_obs_ = cum_obs
if np.isscalar(basis_lag):
# scalars are a bin width
basis_span = min(
(np.amax(obs_t) - np.amin(obs_t))/2.0,
max_basis_span
)
n_bins = ceil(basis_span/basis_lag)
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | """
This should return forward-predicted intensity
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.predict_increment(
big_n=self.big_n_hat_,
obs_t=obs_t if obs_t is not None else self.obs_t_,
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | """
This should return predicted increments
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.predict_increment(
big_n=self.big_n_hat_,
obs_t=obs_t if obs_t is not None else self.obs_t_,
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | """
This should return predicted increment interpolant
based on the fitted histogram, up to the last observations
before the given times.
"""
return design.interpolate(
obs_t=self.obs_t_,
cum_obs=self.cum_obs_,
cum_interp=self.cum_inter... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | return self.wlm.coef_ |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | return np.sum(self.coef_) |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | return self.wlm.intercept_ |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | return self.wlm.alpha_ |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | return self.wlm.n_iter_ |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | """
repeatedly forward-smooth to find optimal interpolant.
TODO: This doesn't do backwards losses
"""
def __init__(
self,
*args, **kwargs):
super().__init__(
cum_interp='dirac',
strategy='random',
*args, **kwargs)
def fit(
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | super().__init__(
cum_interp='dirac',
strategy='random',
*args, **kwargs) |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | inner_model = NonLatticeOneShot(
wlm=self.wlm,
cum_interp='linear',
)
self.inner_model = inner_model
self.obs_t_ = obs_t
self.cum_obs_ = cum_obs
if np.isscalar(basis_lag):
# scalars are a bin width
basis_span = min(
... |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | if isinstance(wlm_factory, str):
wlm_factory = getattr(weighted_linear_model, wlm_factory)
self.wlm = wlm_factory(
positive=positive,
normalize=normalize,
*args, **kwargs
) |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | wlm_factory = getattr(weighted_linear_model, wlm_factory) |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.wlm = wlm |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | basis_span = min(
(np.amax(obs_t) - np.amin(obs_t))/2.0,
max_basis_span
)
n_bins = ceil(basis_span/basis_lag)
self.basis_lag_ = np.arange(n_bins+1) * basis_lag |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.basis_lag_ = basis_lag |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.big_n_hat_ = self.predict_big_n() |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | basis_span = min(
(np.amax(obs_t) - np.amin(obs_t))/2.0,
max_basis_span
)
n_bins = ceil(basis_span/basis_lag)
self.basis_lag_ = np.arange(n_bins+1) * basis_lag |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.basis_lag_ = basis_lag |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | self.big_n_hat_ = self.predict_big_n() |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | __init__ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.