index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
59,875
WilfredLemus/antivirus
refs/heads/master
/antivirus/apps/home/admin.py
from django.contrib import admin from .models import Categoria, antivirus admin.site.register(Categoria) admin.site.register(antivirus)
{"/antivirus/apps/home/admin.py": ["/antivirus/apps/home/models.py"]}
59,876
WilfredLemus/antivirus
refs/heads/master
/antivirus/apps/home/urls.py
from django.conf.urls import include, url from django.contrib import admin from .views import IndexView, TestView urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), url(r'^test/$', TestView.as_view(), name='test'), # url(r'^preguntar/$', QuestionCreateView.as_view(), name='create_question'), ]
{"/antivirus/apps/home/admin.py": ["/antivirus/apps/home/models.py"]}
59,877
WilfredLemus/antivirus
refs/heads/master
/antivirus/apps/home/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='antivirus', fields=[ ('id', models.AutoField(ve...
{"/antivirus/apps/home/admin.py": ["/antivirus/apps/home/models.py"]}
59,881
royw/fullmonty
refs/heads/master
/fullmonty/remote_shell.py
# coding=utf-8 """ Remote shell with a context over ssh with support for pexpect. Usage ----- .. code-block:: python with RemoteShell(user=user, password=password, host=host, verbose=True) as remote: remote.run("ls ~") remote.put(local_file, remote_dir) remote.get(remote_file) """ impor...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,882
royw/fullmonty
refs/heads/master
/fullmonty/tmp_dir.py
# coding=utf-8 """ Context manager for using a temporary directory. Usage:: with TmpDir as dir: print("temp directory: {dir}".format(dir=dir)) """ import shutil import tempfile class TmpDir(object): def __init__(self): self.__dir_path = None def __enter__(self): self.__dir_pat...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,883
royw/fullmonty
refs/heads/master
/tests/test_comparable_mixin.py
# coding=utf-8 """ Describe Me! """ from fullmonty.comparable_mixin import ComparableMixin __docformat__ = 'restructuredtext en' __author__ = 'wrighroy' # noinspection PyDocstring class BaseClass(object): pass # noinspection PyDocstring def test_int_compare(): # noinspection PyDocstring def cmpkey(sel...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,884
royw/fullmonty
refs/heads/master
/tests/test_method_missing_hook.py
# coding=utf-8 """ Unit tests for method_missing mixin. We create two classes, Foo, and Bar. Foo is our control, we apply the mixin but do not override the default method missing behavior. While Bar is our class with new behavior where we override both instance and class method_missing methods. """ import collectio...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,885
royw/fullmonty
refs/heads/master
/fullmonty/method_missing_hook.py
# coding=utf-8 """ One part of meta programming is being able to handle when an object doesn't respond to a message. It could be incompatible object, dynamically handled method (ex, for a DSL), typo, etc. Python calls an object's __getattr__(name) method when it does not find an attribute that matches the name. __g...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,886
royw/fullmonty
refs/heads/master
/fullmonty/local_shell.py
# coding=utf-8 """ Run external scripts and programs on the local system. Local *run* and *system* commands support prefix and postfix. Prefix is a string to prepend to the command given to the methods. Postfix is a string appended to the command. For example: .. code-block:: python with LocalShell(prefix="M...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,887
royw/fullmonty
refs/heads/master
/tests/test_tmp_dir.py
# coding=utf-8 import os from fullmonty.tmp_dir import TmpDir def test_tmp_dir(): path = None with TmpDir() as dir: path = dir assert os.path.isdir(dir) assert not os.path.isdir(path)
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,888
royw/fullmonty
refs/heads/master
/fullmonty/__init__.py
# coding=utf-8 """\ FullMonty ========= FullMonty is a collection of various library modules that are not big enough to justify individual packaging. For example, I like using a context with cd: .. code-block:: python with cd(path): # current working directory is path Another is the list_helper module...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,889
royw/fullmonty
refs/heads/master
/fullmonty/timeit.py
# coding=utf-8 """ timeit is a primitive profiling decorator Usage: .. code-block:: python @timeit def foobar(): #... """ import tempfile import time timeit_enabled = False timeit_file = tempfile.NamedTemporaryFile(prefix="new-pcap-checkin", suffix="timeit", delete=False) def timeit(func): ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,890
royw/fullmonty
refs/heads/master
/fullmonty/capture_sys_output.py
# coding=utf-8 """ A context manager for capturing stdout and stderr. from: https://stackoverflow.com/questions/18651705/argparse-unit-tests-suppress-the-help-message By: Martijn Pieters https://stackoverflow.com/users/100297/martijn-pieters """ from contextlib import contextmanager from cStringIO import StringIO ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,891
royw/fullmonty
refs/heads/master
/fullmonty/unionfs.py
# coding=utf-8 """ FUSE Union File System support """ import os import subprocess import shutil from contextlib import contextmanager from .mkdir_p import mkdir_p from .simple_logger import info @contextmanager def unionfs(source_dirs=None, mount_dir=None, verbose=False): """ Enable using unionfs using the ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,892
royw/fullmonty
refs/heads/master
/tests/test_mash.py
# coding=utf-8 """ Test Mash """ import unittest from argparse import Namespace from fullmonty.mash import Mash from fullmonty.simple_logger import info __docformat__ = 'restructuredtext en' __author__ = 'wrighroy' # noinspection PyMethodMayBeStatic class TestMash(unittest.TestCase): """ Test the Mash clas...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,893
royw/fullmonty
refs/heads/master
/fullmonty/certs.py
# coding=utf-8 """ Certificate helpers """ from fullmonty.simple_logger import error __docformat__ = 'restructuredtext en' def self_signed_certs_allowed(): try: import requests requests.packages.urllib3.disable_warnings() import ssl try: _create_unverified_https_...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,894
royw/fullmonty
refs/heads/master
/tests/test_backup.py
# coding=utf-8 """ Tests the backup functionality used when rendering templates. """ import os from fullmonty.backup import backup_filename, next_backup_filename def test_backup_filename(): """Test getting the backup file name for a given file name""" assert backup_filename('foo') == 'foo~' assert back...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,895
royw/fullmonty
refs/heads/master
/tests/test_localshell.py
# coding=utf-8 """ test LocalShell """ import Queue import multiprocessing from threading import Thread from multiprocessing import Process from fullmonty.local_shell import LocalShell CMD_LINE = 'pwd' def test_local_shell(): """ test normal LocalShell usage """ with LocalShell() as local: result ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,896
royw/fullmonty
refs/heads/master
/fullmonty/make_bytes.py
# coding=utf-8 """ Handle string to bytes conversion for python 2 & 3. From: http://python3porting.com/problems.html#bytes-strings-and-unicode Usage ----- :: from fullmonty.make_bytes import b with open(file_name, 'w') as file_: file_.write(b(str_variable)) """ import sys if sys.version < '3': ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,897
royw/fullmonty
refs/heads/master
/tests/test_make_bytes.py
# coding=utf-8 """ unit tests for make_bytes """ from io import BytesIO from fullmonty.make_bytes import b __docformat__ = 'restructuredtext en' __author__ = 'wrighroy' def test_str_write(): """ For python2: BytesIO.write(str) For python3: BytesIO.write(bytes) Use b(data) to convert a string to eith...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,898
royw/fullmonty
refs/heads/master
/fullmonty/find_directory.py
# coding=utf-8 """ Locate a directory by environment variable or path or contents. Locating rules are: * If given an environment variable name and the environment variable exists and the value is the path to a directory, then return the directory's path. * If given a path string ("path:path:...") is given, scan th...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,899
royw/fullmonty
refs/heads/master
/tests/test_list_helper.py
# coding=utf-8 """ test the list helper functions """ import collections from fullmonty.list_helper import compress_list, unique_list, is_sequence, flatten def test_compress_list(): """ compress_list removes empty or None elements from a list """ # incompressible lists assert compress_list([]) ...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,900
royw/fullmonty
refs/heads/master
/fullmonty/mash.py
# coding=utf-8 """ A Mash behaves like both a dictionary and a NameSpace. This is a very simple implementation, attribute accessors are just added onto a dictionary. So a['foo'] == a.foo Keys must be hashable. If a key is not a valid attribute name, then it can only be accessed using dict accessors. For example:...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,901
royw/fullmonty
refs/heads/master
/tests/test_remote_shell.py
# coding=utf-8 """ Test the remote shell """ from fullmonty.local_shell import LocalShell from fullmonty.remote_shell import RemoteShell def test_remote_run(): with LocalShell() as local: dir = local.run("pwd") local_ls = local.run("/bin/ls -l") with RemoteShell(user='wrighroy', password='yak...
{"/tests/test_method_missing_hook.py": ["/fullmonty/method_missing_hook.py"], "/tests/test_tmp_dir.py": ["/fullmonty/tmp_dir.py"], "/tests/test_mash.py": ["/fullmonty/mash.py"], "/tests/test_localshell.py": ["/fullmonty/local_shell.py"], "/tests/test_make_bytes.py": ["/fullmonty/make_bytes.py"], "/tests/test_remote_she...
59,936
paulosalem/time-blender
refs/heads/master
/tests/test_random_events.py
import numpy as np from tests.common import AbstractTest from time_blender.core import Generator, ConstantEvent from time_blender.deterministic_events import WalkEvent from time_blender.random_events import NormalEvent, UniformEvent, PoissonEvent, TopResistance, BottomResistance class AbstractRandomEventTest(Abstrac...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,937
paulosalem/time-blender
refs/heads/master
/time_blender/models.py
# Standard models import numpy as np import pandas as pd from time_blender.coordination_events import PastEvent, CumulativeEvent, ParentValueEvent, TemporarySwitch, Choice, \ SeasonalEvent from time_blender.core import LambdaEvent, ConstantEvent, wrapped_constant_param, Event, Invariant from time_blender.de...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,938
paulosalem/time-blender
refs/heads/master
/tests/test_models.py
import unittest import math import pandas as pd import numpy as np from sklearn.metrics import mean_absolute_error from time_blender.core import ConstantEvent, Generator from time_blender.random_events import NormalEvent pd.set_option('display.max_rows', None) from tests.common import AbstractTest from t...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,939
paulosalem/time-blender
refs/heads/master
/tests/common.py
import unittest import pandas as pd import numpy as np import math import random from time_blender.core import Generator class AbstractTest(unittest.TestCase): def common_model_test(self, model, n=1, print_data=False): data = Generator(start_date=self.start_date, end_date=self.end_date, freq='D').genera...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,940
paulosalem/time-blender
refs/heads/master
/time_blender/util.py
import random import pandas as pd import numpy as np # A counter to be used when creating fresh names import time_blender def fresh_id(): fresh_id.counter += 1 return fresh_id.counter fresh_id.counter = -1 def set_random_seed(seed): if seed is not None: random.seed(seed) np.random.see...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,941
paulosalem/time-blender
refs/heads/master
/time_blender/core.py
import logging import math import random import copy import numpy as np from numpy.random import random_integers import pandas as pd import functools import matplotlib import matplotlib.pyplot as plt from hyperopt import STATUS_OK, STATUS_FAIL from scipy import signal from scipy.stats import ks_2samp from sklearn.me...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,942
paulosalem/time-blender
refs/heads/master
/tests/test_core.py
import copy import numpy as np from tests.common import AbstractTest from time_blender.coordination_events import Piecewise, Replicated, PastEvent from time_blender.core import Generator, ConstantEvent, LambdaEvent from time_blender.deterministic_events import WalkEvent from time_blender.models import BankingModels, ...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,943
paulosalem/time-blender
refs/heads/master
/tests/test_util.py
import unittest import pandas as pd from time_blender.util import shift_weekend_and_holidays class TestUtil(unittest.TestCase): def test_shift_weekend_and_holidays(self): def aux_check(a, b, direction='forward'): shifted_day = shift_weekend_and_holidays(a, direction=direction, holidays=[])...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,944
paulosalem/time-blender
refs/heads/master
/time_blender/cli.py
######################################################################################################################## # Command-Line Interface utils ######################################################################################################################## import pandas as pd from sigtools.wrappers impo...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,945
paulosalem/time-blender
refs/heads/master
/time_blender/coordination_events.py
from time_blender.core import Event import time_blender.config as config import random import numpy as np from numpy.random import choice # Filters, connectors, etc. from time_blender.random_events import BernoulliEvent from time_blender.util import is_sequence class OnceEvent(Event): """ Executes and memoiz...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,946
paulosalem/time-blender
refs/heads/master
/tests/test_composition.py
import unittest import pandas as pd from time_blender.coordination_events import OnceEvent, Choice from time_blender.core import Generator, LambdaEvent, ConstantEvent from time_blender.deterministic_events import WalkEvent, WaveEvent from time_blender.random_events import NormalEvent, UniformEvent class TestDetermin...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,947
paulosalem/time-blender
refs/heads/master
/time_blender/deterministic_events.py
from time_blender.core import Event, ConstantEvent import numpy as np class IdentityEvent(Event): def __init__(self, event, name=None, parallel_events=None, push_down=True, allow_learning=True): name = self._default_name_if_none(name) self.event = event super().__init__(name, parallel_eve...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,948
paulosalem/time-blender
refs/heads/master
/tests/test_coordination_events.py
import unittest import pandas as pd import numpy as np import math from tests.common import AbstractTest from time_blender.coordination_events import Piecewise, Choice, SeasonalEvent, OnceEvent, PastEvent, \ ConcludingValueEvent from time_blender.core import Generator, ConstantEvent, LambdaEvent from time_blender....
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,949
paulosalem/time-blender
refs/heads/master
/setup.py
from setuptools import setup, find_packages setup(name='time-blender', version='0.3.0', description='A compositional time series generator.', url='https://github.com/paulosalem/time-blender', author='Paulo Salem', author_email='paulosalem@paulosalem.com', license='MIT', packag...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,950
paulosalem/time-blender
refs/heads/master
/time_blender/config.py
# Probabilistic programming configurations PP_CONFIG = { 'max_time_step': 1000000 } LEARNING_CONFIG = { 'large_default_value': 1000000000 } ## TODO other general configurations (e.g., default upper and lower bounds, etc.)
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,951
paulosalem/time-blender
refs/heads/master
/time_blender/random_events.py
import numpy as np from time_blender.core import Event from scipy.stats import norm, poisson, uniform, bernoulli from time_blender.deterministic_events import ClipEvent class UniformEvent(Event): def __init__(self, low=-1.0, high=1.0, name=None, parallel_events=None, push_down=True, allow_learning=True): ...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,952
paulosalem/time-blender
refs/heads/master
/tests/test_deterministic_events.py
import unittest import pandas as pd import numpy as np from tests.common import AbstractTest from time_blender.core import Generator, ConstantEvent from time_blender.deterministic_events import ClockEvent, WaveEvent, WalkEvent class TestClockEvent(AbstractTest): def setUp(self): super().setUp() ...
{"/tests/test_random_events.py": ["/tests/common.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py"], "/time_blender/models.py": ["/time_blender/coordination_events.py", "/time_blender/core.py", "/time_blender/deterministic_events.py", "/time_blender/random_events.py...
59,953
ugneokmanaite/FileHandling_ClassDemo
refs/heads/master
/requests.py
from text_file import TextFileHandling file_path = "modified.txt" # by putting the file path here and importing the class we only need to change the file path once if we need to text_file = TextFileHandling(file_path) # print(text_file.read_text()) # # text_file.write_text_file() # print(text_file.write_text_file())...
{"/requests.py": ["/text_file.py"]}
59,954
ugneokmanaite/FileHandling_ClassDemo
refs/heads/master
/text_file.py
class TextFileHandling: def __init__(self, file_path, text_storage=None): self.file_path = file_path self.text_storage = text_storage # going to read in two ways and write in two ways # creating some methods # opening file # reading the file # closing the file def read_te...
{"/requests.py": ["/text_file.py"]}
59,956
mbroihier/ml
refs/heads/master
/xorExample.py
import getopt import sys import matplotlib.pyplot as plt import tensorflow as tf import Model def main(bypass, cycles): ''' Analysis of XOR learning operation ''' if cycles is None: cycles = 1250 tf.random.set_seed(1671) # Create a model with two neural layers. The first layer, "0", ha...
{"/xorExample.py": ["/Model.py"], "/Model.py": ["/NeuralLayer.py"]}
59,957
mbroihier/ml
refs/heads/master
/NeuralLayer.py
import pickle import tensorflow as tf class NeuralLayer: ''' Class for defining a layer of nuerons that can have multiple inputs and neurons/outputs - a neuron can only have one output, but it may server as inputs to many neurons in the next layer. The equations used in this class assume that the bia...
{"/xorExample.py": ["/Model.py"], "/Model.py": ["/NeuralLayer.py"]}
59,958
mbroihier/ml
refs/heads/master
/Model.py
import tensorflow as tf import NeuralLayer as nl class Model: ''' Class for defining a model that consists of neural layers. The first layer is always the inputs, which means that it does not exist as a NeuralLayer. All subsequent layers are completely interconnected except for the final layer. ...
{"/xorExample.py": ["/Model.py"], "/Model.py": ["/NeuralLayer.py"]}
59,959
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/elasticity_1_step.py
""" Compute approximate elasticity of unemployment to pension benefits by age. by simulation runs the solution routine (see solve_model_old2.py) with N=10000; this code can be used in the calibration procedure. See elasticity_exact.py for a more precise computation of elasticity by age. """ #########################...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,960
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/first_best_3_agents_individual.py
""" Compute first best solution. This module computes the first best solution. """ ##################################################### # IMPORTS ##################################################### import json import sys import numpy as np from bld.project_paths import project_paths_join as ppj #################...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,961
simonjheiler/ui_human_capital
refs/heads/main
/src/utilities/model_utils.py
""" Utilities for numerical modelling. This modules contains standardized functions for used throughout the analytical part of the project for handling of the numerical routines. """ ##################################################### # IMPORTS ##################################################### import sys impo...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,962
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/first_best.py
""" Compute first best solution. This module computes the first best solution. """ ##################################################### # IMPORTS ##################################################### import json import sys import warnings import numba as nb import numpy as np from scipy import interpolate from bld...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,963
simonjheiler/ui_human_capital
refs/heads/main
/src/utilities/run_utils.py
import subprocess import matlab.engine from bld.project_paths import project_paths_join as ppj ##################################################### # PARAMETERS ##################################################### python_path = r"C:\Programs\Anaconda3\envs\labor-markets\python.exe" stata_path = r"C:\Program Files...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,964
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/elasticity_exact.py
import copy import json import src.utilities.istarmap_3_8 # noqa, noreorder import multiprocessing import sys import numpy as np import tqdm from bld.project_paths import project_paths_join as ppj from src.model_analysis.run_utils import _solve_run ##################################################### # PARAMETERS...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,965
simonjheiler/ui_human_capital
refs/heads/main
/src/model_calibration/adjust_calibration.py
import copy import json import src.utilities.istarmap_3_8 # noqa, noreorder import multiprocessing import sys # noqa:F401 import tqdm # noqa:F401 import warnings # noqa:F401 import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import interpolate from scipy import optimize from bld.pro...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,966
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/run_utils.py
""" Utilities for solving and simulating the model_analysis. This modules contains standardized functions for solving and simulating throughout the analytical part of the project. """ ##################################################### # IMPORTS ##################################################### import numpy ...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,967
simonjheiler/ui_human_capital
refs/heads/main
/src/utilities/optimization_utils.py
""" Utilities for optimization routines. """ ##################################################### # IMPORTS ##################################################### import warnings import numpy as np ##################################################### # PARAMETERS ####################################################...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,968
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/welfare.py
""" Compute consumption equivalents. This module computes the equivalent consumption changes required to compensate for welfare differentials. """ ##################################################### # IMPORTS ##################################################### import json import sys import numba as nb import num...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,969
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/optimization.py
""" Find optimal life cycle profiles of UI benefit replacement rates and tax rates. """ ##################################################### # IMPORTS ##################################################### import copy import json import src.utilities.istarmap_3_8 # noqa, noreorder import multiprocessing import sys imp...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,970
simonjheiler/ui_human_capital
refs/heads/main
/src/model_analysis/solve_model.py
import copy import json import sys import warnings import numba as nb import numpy as np import numpy_financial as npf from scipy import interpolate from bld.project_paths import project_paths_join as ppj from src.utilities.interpolation_utils import interpolate_1d from src.utilities.interpolation_utils import interp...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,971
simonjheiler/ui_human_capital
refs/heads/main
/src/utilities/sandbox.py
import copy import json # noqa:F401 import src.utilities.istarmap_3_8 # noqa, noreorder import multiprocessing import sys # noqa:F401 import tqdm # noqa:F401 import warnings # noqa:F401 import numba as nb # noqa:F401 import numpy as np # noqa:F401 import pandas as pd # noqa:F401 from scipy import interpolate ...
{"/src/model_analysis/elasticity_1_step.py": ["/src/model_analysis/run_utils.py"], "/src/model_analysis/elasticity_exact.py": ["/src/model_analysis/run_utils.py"], "/src/model_calibration/adjust_calibration.py": ["/src/model_analysis/run_utils.py", "/src/utilities/optimization_utils.py"], "/src/model_analysis/run_utils...
59,979
MrG0d/GooglePhoto-SynologyMoments
refs/heads/master
/translate/ru.py
NAME_KEY_METADATA = 'метадата' NAME_KEY_CHANGED = 'измененный' NAME_KEY_ARCHIVE = 'Архивы'
{"/run.py": ["/bootstrap.py", "/logger.py", "/translate/ru.py"]}
59,980
MrG0d/GooglePhoto-SynologyMoments
refs/heads/master
/logger.py
import logging BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, GRAY, WHITE = range(9) RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" COLORS = { 'WARNING': YELLOW, 'INFO': WHITE, 'DEBUG': BLUE, 'CRITICAL': YELLOW, 'ERROR': RED } class PlainFormatter(logging.Formatter): F...
{"/run.py": ["/bootstrap.py", "/logger.py", "/translate/ru.py"]}
59,981
MrG0d/GooglePhoto-SynologyMoments
refs/heads/master
/run.py
from datetime import datetime import json import os import re from bootstrap import get_file_dir_and_filename, hash_file, path from logger import Logger from translate.ru import * hash_processed_photos = {} logger = Logger('Transform') PATH_TO_GOOGLE_PHOTO_DIR = path('google_photo') def get_meta_file(path_to_medi...
{"/run.py": ["/bootstrap.py", "/logger.py", "/translate/ru.py"]}
59,982
MrG0d/GooglePhoto-SynologyMoments
refs/heads/master
/translate/en.py
NAME_KEY_METADATA = 'metadata' NAME_KEY_CHANGED = 'changed' NAME_KEY_ARCHIVE = 'Archive'
{"/run.py": ["/bootstrap.py", "/logger.py", "/translate/ru.py"]}
59,983
MrG0d/GooglePhoto-SynologyMoments
refs/heads/master
/bootstrap.py
import hashlib import ntpath import os from typing import Iterator, Tuple, AnyStr, List, Optional ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) def path(rel): return os.path.join(ROOT_PATH, rel.lstrip('/')) def walk_on_path(path) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: return os.wa...
{"/run.py": ["/bootstrap.py", "/logger.py", "/translate/ru.py"]}
59,985
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/formations/squad.py
from ..geometric_mean import geometric_mean from .formation import Formation from ..units.solider import Solider class Squad(Formation): def __init__(self, units: list) -> None: super().__init__(units) @property def attack_success(self) -> float: return geometric_mean([unit.attack_success...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,986
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/rand.py
from random import Random Rand = Random()
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,987
igorbeor/py_lesson_battlefield
refs/heads/master
/tests/test_solider.py
from unittest import TestCase from classes.units.solider import Solider from classes.rand import Rand class SoliderTest(TestCase): def setUp(self): Rand.seed(123) self.solider = Solider() def test_experience(self): self.solider.experience = 60 self.assertEqual(self.solider.exp...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,988
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/units/unit.py
from time import monotonic class Unit: def __init__(self, health: float, recharge: int) -> None: self.health = health self.recharge = recharge self.recharge_timer = 0 @property def health(self) -> float: return self._health @health.setter def health(self, value: ...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,989
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/strategy.py
from .rand import Rand from operator import attrgetter STRATEGIES = {} def register_class(target_class): STRATEGIES[target_class.__name__] = target_class class MetaRegistry(type): def __new__(meta, name, bases, class_dict): cls = type.__new__(meta, name, bases, class_dict) if name not in ...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,990
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/units/vehicle.py
from ..rand import Rand from .unit import Unit from ..geometric_mean import geometric_mean class Vehicle(Unit): def __init__(self, operators: list, health: float = 100, recharge: int = 2000) -> None: super().__init__(health, recharge) self.operators = operators @property ...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,991
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/battlefield.py
from .units.solider import Solider from .units.vehicle import Vehicle from .formations.squad import Squad from .formations.army import Army from random import randint, choice, shuffle from .rand import Rand from .strategy import STRATEGIES from json import load from typing import Optional ARMY_NAMES = [ 'The Ruth...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,992
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/units/solider.py
from ..rand import Rand from .unit import Unit class Solider(Unit): def __init__(self, health: float = 100, recharge: int = 500, experience: int = 0): super().__init__(health, recharge) self.experience = experience @property def experience(self) -> int: return se...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,993
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/formations/formation.py
class Formation: def __init__(self, subformations: list) -> None: self.subformations = subformations @property def is_active(self) -> bool: return any(subformation.is_active for subformation in self.subformations) @property def active_subformations(self) -> list:...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,994
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/formations/army.py
from .formation import Formation from ..strategy import STRATEGIES class Army(Formation): def __init__(self, squads: list, strategy: str, name: str) -> None: super().__init__(squads) self.strategy = strategy self.name = name def attack(self, enemy: object) -> None: if not self...
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,995
igorbeor/py_lesson_battlefield
refs/heads/master
/classes/geometric_mean.py
from math import exp, fsum, log def geometric_mean(xs: list) -> float: return exp(fsum(log(x) for x in xs) / len(xs))
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
59,996
igorbeor/py_lesson_battlefield
refs/heads/master
/app.py
from classes.battlefield import Battlefield def main(): battlefield = Battlefield.create_battlefield_from_config() battlefield.battle() if __name__ == '__main__': main()
{"/classes/formations/squad.py": ["/classes/geometric_mean.py", "/classes/formations/formation.py", "/classes/units/solider.py"], "/tests/test_solider.py": ["/classes/units/solider.py", "/classes/rand.py"], "/classes/strategy.py": ["/classes/rand.py"], "/classes/units/vehicle.py": ["/classes/rand.py", "/classes/units/u...
60,021
chomman/sensefarm
refs/heads/master
/src/application/contact.py
""" contact.py """ from google.appengine.api import users from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError from flask import request, render_template, flash, url_for, redirect from flask_cache import Cache from application import app from decorators import login_required, admin_required ...
{"/src/application/forms.py": ["/src/application/models.py"]}
60,022
chomman/sensefarm
refs/heads/master
/src/application/forms.py
""" forms.py Web forms based on Flask-WTForms See: http://flask.pocoo.org/docs/patterns/wtforms/ http://wtforms.simplecodes.com/ """ from flaskext import wtf from flaskext.wtf import validators from wtforms.ext.appengine.ndb import model_form from .models import ExampleModel, ContactModel class ClassicExamp...
{"/src/application/forms.py": ["/src/application/models.py"]}
60,023
chomman/sensefarm
refs/heads/master
/src/application/secret_keys.py
# CSRF- and Session keys CSRF_SECRET_KEY = 'KVxw41wZtncUM1T2cBMohWcX' SESSION_KEY = 'b9xnbrv3A9ifjGF1aCtw284I'
{"/src/application/forms.py": ["/src/application/models.py"]}
60,024
chomman/sensefarm
refs/heads/master
/src/application/page.py
""" company.py URL route handlers Note that any handler params must match the URL route params. For example the *say_hello* handler, handling the URL route '/hello/<username>', must be passed *username* as the argument. """ from google.appengine.api import users from google.appengine.runtime.apiproxy_errors import...
{"/src/application/forms.py": ["/src/application/models.py"]}
60,025
chomman/sensefarm
refs/heads/master
/src/application/models.py
""" models.py App Engine datastore models """ from google.appengine.ext import ndb class ExampleModel(ndb.Model): """Example Model""" example_name = ndb.StringProperty(required=True) example_description = ndb.TextProperty(required=True) added_by = ndb.UserProperty() timestamp = ndb.DateTimeProper...
{"/src/application/forms.py": ["/src/application/models.py"]}
60,035
nhhai196/Ticket-Reassignment
refs/heads/main
/ticket_reassign.py
import sys import datastructure import csv import numpy as np import cardinalpivot as cp import ordinalpivot as op import scarfpivot as sp import time import numpy as np import iterativerounding as ir import random #argv[1]: csv file name in the following format #row 1: number of families, number of games #row f+1: bu...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,036
nhhai196/Ticket-Reassignment
refs/heads/main
/scarfpivot.py
######################## Scarf Pivot ############################ import sys import datastructure as ds import csv import numpy as np import cardinalpivot as cp import ordinalpivot as op import time import correctness as cor def scarfpivot(eps, CB, OB, A, b, c, rmins, numf, numg, fp, ordlist, fb2col, budget, budlist)...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,037
nhhai196/Ticket-Reassignment
refs/heads/main
/datastructure.py
import collections import csv import numpy import sys import openpyxl as op #################### MAIN ########################### #numF = 2; #s1 = list(1, 2, 4) #s2 = list(3, 5, 6) #p1 = list(1, 1, 1) #p2 = list(0, 0, 0) #c111 = tuple(1, s1, p1) #c211 = tuple(2, s1, p1) #c121 = tuple(1, s2, p1) #c221 = tuple(2, s2...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,038
nhhai196/Ticket-Reassignment
refs/heads/main
/gen_rand_csv.py
import csv import sys import random #argv[1]: filename #argv[2]: #families #argv[3]: #games #argv[4]: lower bound for family size/budget #argv[5]: upper bound for family size/budget #argv[6]: lower bound length of each family's preference list #argv[7]: upper bound length of each family's preference list #argv[8]: inc...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,039
nhhai196/Ticket-Reassignment
refs/heads/main
/ticket_reassign_v3.py
import sys import datastructure import csv import numpy as np import cardinalpivot as cp import ordinalpivot as op import scarfpivot as sp import time import numpy as np import iterativerounding as ir import random import statistics as stat #argv[1]: xlsx file name in the following format #row 1: column labels: family...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,040
nhhai196/Ticket-Reassignment
refs/heads/main
/m2py.py
import openpyxl as op import sys import csv #argv[1]: input file name #argv[2]: output file name #argv[3]: budget for seniors, each non-senior has 1 dollar #argv[4]: offset for alpha, i.e. extra number of seats needed #argv[5]: capacity of a game #argv[6]: upper bound of bundle size book = op.load_workbook(sys.argv[1...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,041
nhhai196/Ticket-Reassignment
refs/heads/main
/ordinalpivot.py
######################## Ordinal Pivot ############################ import datastructure as ds import copy import functools as func import math import correctness as cor import time # @clist : an ordinal basis # @c : a column that will be added to the basis # @fp : famimy preferences # @rmins : row min of the basis ...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,042
nhhai196/Ticket-Reassignment
refs/heads/main
/cardinalpivot.py
######################## Cardinal Pivot ############################ import numpy import datastructure as ds # @clist : a list of contracts that is a cardinal basis. Note that # the order of contracts is important. # @c : a new column to add to the basis # @A : the constraint matrix. Note that this matrix wil...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,043
nhhai196/Ticket-Reassignment
refs/heads/main
/correctness.py
######################## Tetsing ######################################### # This module contains all functions that are needed to test the correctness # of ordinal pivot and cardinal pivot import ordinalpivot as op import math import datastructure as ds def isordbasis(eps, basis, numf, numg, fp, ordlist, fb2col, bud...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,044
nhhai196/Ticket-Reassignment
refs/heads/main
/iterativerounding.py
from scipy.optimize import linprog import datastructure as ds import numpy as np import math import copy import threading # A : the constraint matrix # v: the objective coefficients # x : a dominating extreme point # tol: tolerance for double-floating error def iterativerounding(A, x, b, tol, numf, numg): print("+++...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,045
nhhai196/Ticket-Reassignment
refs/heads/main
/gendata_v3.py
import random from scipy import stats import numpy as np import copy import xlsxwriter def gendata(filename, numg, numf, fdist, numscore, minsize, numswaps, seatoffset, maxbsize): numscore, scorelist = genscorelist(numscore, numg, numswaps) prefcdf = genprefcdf(numscore) # print(scorelist) # print(prefcdf) famd...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,046
nhhai196/Ticket-Reassignment
refs/heads/main
/ticket_reassign_v2.py
import sys import datastructure import csv import numpy as np import cardinalpivot as cp import ordinalpivot as op import scarfpivot as sp import time import numpy as np import iterativerounding as ir import random import statistics as stat #argv[1]: xlsx file name in the following format #row 1: column labels: family...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,047
nhhai196/Ticket-Reassignment
refs/heads/main
/testing.py
import correctness as cor print("test 1:") print(cor.enumprice(0.5, [1], 1, 2)) print("test 2:") print(cor.enumprice(0.5, [1,2], 2, 2)) print("test 3:") print(cor.enumprice(0.5, [0,2], 2, 2)) print("test 4:") print(cor.enumprice(0.5, [2,2], 2, 2))
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,048
nhhai196/Ticket-Reassignment
refs/heads/main
/statistics.py
from openpyxl import * import copy from numpy import * import datastructure as ds import numpy as np # def statistics(filename, A, x, b, numf, numg, fb2col, FP, famsize, bundle2rank): print("+++++++++++++++++++++++++++++++++++ Statistics +++++++++++++++++++++++++++++++++++++") print(FP) nmf, nmp, bysize, fb...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,049
nhhai196/Ticket-Reassignment
refs/heads/main
/gendata_v2.py
import random from scipy import stats import numpy as np import copy import xlsxwriter def gendata(filename, numg, numf, fdist, numscore, minsize, numswaps, seatoffset): numscore, scorelist = genscorelist(numscore, numg, numswaps) prefcdf = genprefcdf(numscore) print(scorelist) print(prefcdf) famdict = genfam...
{"/ticket_reassign.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/scarfpivot.py", "/iterativerounding.py"], "/scarfpivot.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py", "/correctness.py"], "/ticket_reassign_v3.py": ["/datastructure.py", "/cardinalpivot.py", "/ordinalpivot.py",...
60,050
soudabemhashemi/Yektanet
refs/heads/master
/advertiser_mangement/admin.py
from django.contrib import admin from .models import Ad, Advertiser, Click, View, summaryShit admin.site.register(Advertiser) @admin.register(Ad) class AdAdmin(admin.ModelAdmin): list_display = ["title", "link", "advertiser"] list_filter=["approve"] search_fields = ["title"] @admin.register(Click) class...
{"/advertiser_mangement/admin.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/migrations/0019_alter_ad_imgurl.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/serializers.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/tasks.py": ["/advertiser_mangement/models.py"], "/a...
60,051
soudabemhashemi/Yektanet
refs/heads/master
/advertiser_mangement/migrations/0021_summaryshit_view_or_click.py
# Generated by Django 4.0.dev20210715050039 on 2021-07-25 02:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('advertiser_mangement', '0020_summaryshit'), ] operations = [ migrations.AddField( model_name='summaryshit', ...
{"/advertiser_mangement/admin.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/migrations/0019_alter_ad_imgurl.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/serializers.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/tasks.py": ["/advertiser_mangement/models.py"], "/a...
60,052
soudabemhashemi/Yektanet
refs/heads/master
/advertiser_mangement/migrations/0019_alter_ad_imgurl.py
# Generated by Django 4.0.dev20210715050039 on 2021-07-21 11:21 import advertiser_mangement.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('advertiser_mangement', '0018_alter_ad_imgurl_alter_click_date_alter_view_date'), ] operations = [...
{"/advertiser_mangement/admin.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/migrations/0019_alter_ad_imgurl.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/serializers.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/tasks.py": ["/advertiser_mangement/models.py"], "/a...
60,053
soudabemhashemi/Yektanet
refs/heads/master
/advertiser_mangement/urls.py
from django.urls import path from . import views app_name = 'advertiser_mangement' urlpatterns = [ # path('', views.AdList.as_view(), name='home'), path('createAd/', views.createAd.as_view(), name='create_new'), path('createAdvertiser/', views.createAdvertiser, name='createSdvertiser'), # path('crea...
{"/advertiser_mangement/admin.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/migrations/0019_alter_ad_imgurl.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/serializers.py": ["/advertiser_mangement/models.py"], "/advertiser_mangement/tasks.py": ["/advertiser_mangement/models.py"], "/a...