index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
35,758,898 | Taospirit/DRL_beta | refs/heads/main | /drl/algorithm/oac.py | import os
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Normal
from drl.algorithm import BasePolicy
from drl.utils import ReplayBuffer
device = torch.device("cuda" if torch.cuda.is_available(... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,899 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_dqn.py | from test_tool import policy_test
import gym
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import namedtuple
# from drl.model import ActorNet, CriticDQN
from drl.algorithm import DQN
# from drl.algorithm impo... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,900 | Taospirit/DRL_beta | refs/heads/main | /beta/tutorial/quick_start.py | import gym
import os, sys
import time
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.utils.tensorboard import SummaryWriter
from collections import namedtuple
import sys
sys.path.append('../..')... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,901 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_a2c.py | from test_tool import policy_test
import gym
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.utils.tensorboard import SummaryWriter
from drl.model import ActorNet, CriticV
from drl.algorithm ... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,902 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_pickle.py |
import os
d = {'mean': [1,2 ,3, 4, 5, 6, 7], 'std': [1, 2, 3, 4, 5, 6, 7]}
path_dir = os.path.abspath(os.path.dirname(__file__))
print (path_dir)
pkl_dir = path_dir + '/test.pkl'
print (pkl_dir)
import pickle
with open(pkl_dir, 'wb') as f:
pickle.dump(d, f, pickle.HIGHEST_PROTOCOL) | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,903 | Taospirit/DRL_beta | refs/heads/main | /drl/algorithm/__init__.py | from drl.algorithm.base import BasePolicy
from drl.algorithm.dqn import DQN, DoubleDQN, DuelingDQN
from drl.algorithm.a2c import A2C
from drl.algorithm.ddpg import DDPG
from drl.algorithm.ppo import PPO
from drl.algorithm.td3 import TD3
from drl.algorithm.sac import SAC
from drl.algorithm.sac2 import SAC2
from drl.algo... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,904 | Taospirit/DRL_beta | refs/heads/main | /drl/backup.py |
class SegmentTree():
def __init__(self, size):
self.index = 0
self.size = size
self.full = False
self.sum_tree = np.zeros((2 * size - 1, ), dtype=np.float32)
self.memory = []
self.max = 1
self.cnt = 0
def __len__(self):
return len(self.memory)
... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,905 | Taospirit/DRL_beta | refs/heads/main | /drl/algorithm/ddpg.py | import os
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from drl.algorithm import BasePolicy
from drl.utils import ReplayBuffer
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class DDPG(BasePolicy):
... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,906 | Taospirit/DRL_beta | refs/heads/main | /drl/algorithm/sac1.py | import os
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Normal
from drl.algorithm import BasePolicy
from drl.utils import ReplayBuffer
device = torch.device("cuda" if torch.cuda.is_available(... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,907 | Taospirit/DRL_beta | refs/heads/main | /beta/tutorial/tutorial_a2c.py | import gym
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.utils.tensorboard import SummaryWriter
from collections import namedtuple
import sys
sys.path.append('../..')
from drl.algorithm imp... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,908 | Taospirit/DRL_beta | refs/heads/main | /beta/test_oac.py | # from test_tool import policy_test
#region
import gym
import os
from os.path import abspath, dirname
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical, Normal
from torch.utils.tensorboard import SummaryWriter
from ... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,909 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_seaborn.py | import pickle
import os
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
def getdata():
basecond = [[18, 20, 19, 18, 13, 4, 1],
[20, 17, 12, 9, 3, 0, 0],
[20, 20, 20, 12, 5, 3, 0]]
cond1 = [[18, 19, 18, 19, 20, ... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,910 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_ppo.py | from test_tool import policy_test
import gym
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import namedtuple
from drl.model import ActorPPO, CriticV
from drl.algorithm import PPO
from drl.utils import ZFilter
env_name = 'Pendu... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,911 | Taospirit/DRL_beta | refs/heads/main | /baidu.py | class yimian1():
def __init__(self):
pass
def get_index(self, num_list, target):
l, r = 0, len(num_list) - 1
while l != r:
if num_list[l] + num_list[r] > target:
r -= 1
if num_list[l] + num_list[r] < target:
l += 1
if nu... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,912 | Taospirit/DRL_beta | refs/heads/main | /beta/test/test_ddpg.py | from test_tool import policy_test
import gym
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from torch.distributions import Categorical
from collections import namedtuple
# from drl.model import... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,913 | Taospirit/DRL_beta | refs/heads/main | /beta/tutorial/tutorial_sac.py | # from test_tool import policy_test
from os.path import abspath, dirname
import os
import gym
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
from torch.utils.tensorboard import SummaryWriter
from collections import na... | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,758,914 | Taospirit/DRL_beta | refs/heads/main | /setup.py | from setuptools import setup
setup(
name='drl1',
version='0.0.1',
packages=setuptools.find_packages(),
description='a drl package',
author='lintao',
author_email='lintao209@outlook.com',
install_requires=['numpy', 'torch'],
python_requires='>=3.6',
) | {"/beta/backup/backup_ddpg.py": ["/drl/algorithm/__init__.py"], "/beta/backup/backup_sac_per.py": ["/drl/algorithm/__init__.py"], "/beta/play_atari/Pong-v0.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/rainbow.py": ["/drl/algorithm/__init__.py"], "/drl/algorithm/dqn.py": ["/drl/algorithm/__init__.py"], "/beta/tu... |
35,785,313 | xiaoyu-work/text | refs/heads/main | /torchtext/functional.py | import torch
from torch import Tensor
from torch.nn.utils.rnn import pad_sequence
from typing import List, Optional
__all__ = [
'to_tensor',
'truncate',
'add_token',
]
def to_tensor(input: List[List[int]], padding_value: Optional[int] = None) -> Tensor:
if padding_value is None:
output = torc... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,785,314 | xiaoyu-work/text | refs/heads/main | /test/experimental/test_datasets.py | import hashlib
import json
from torchtext.experimental.datasets import sst2
from ..common.case_utils import skipIfNoModule
from ..common.torchtext_test_case import TorchtextTestCase
class TestDataset(TorchtextTestCase):
@skipIfNoModule("torchdata")
def test_sst2_dataset(self):
split = ("train", "dev... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,785,315 | xiaoyu-work/text | refs/heads/main | /torchtext/models/roberta/bundler.py |
import os
from dataclasses import dataclass
from functools import partial
from typing import Optional, Callable
from torchtext._download_hooks import load_state_dict_from_url
from torch.nn import Module
import logging
logger = logging.getLogger(__name__)
from .model import (
RobertaEncoderParams,
RobertaMod... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,785,316 | xiaoyu-work/text | refs/heads/main | /torchtext/models/roberta/model.py | import math
from dataclasses import dataclass, asdict
from typing import Optional
from torch.nn import Module
import torch
from torch import Tensor
import torch.nn as nn
from .modules import (
TransformerEncoder,
)
@dataclass
class RobertaEncoderParams:
vocab_size: int = 50265
embedding_dim: int = 768
... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,785,317 | xiaoyu-work/text | refs/heads/main | /torchtext/models/roberta/__init__.py | from .model import (
RobertaEncoderParams,
RobertaClassificationHead,
)
from .bundler import (
RobertaModelBundle,
XLMR_BASE_ENCODER,
XLMR_LARGE_ENCODER,
)
__all__ = [
"RobertaEncoderParams",
"RobertaClassificationHead",
"RobertaModelBundle",
"XLMR_BASE_ENCODER",
"XLMR_LARGE_EN... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,785,318 | xiaoyu-work/text | refs/heads/main | /test/models/test_models.py | import torchtext
import torch
from ..common.torchtext_test_case import TorchtextTestCase
from ..common.assets import get_asset_path
class TestModels(TorchtextTestCase):
def test_xlmr_base_output(self):
asset_name = "xlmr.base.output.pt"
asset_path = get_asset_path(asset_name)
xlmr_base = ... | {"/torchtext/models/roberta/bundler.py": ["/torchtext/_download_hooks.py", "/torchtext/models/roberta/model.py"], "/torchtext/models/roberta/__init__.py": ["/torchtext/models/roberta/model.py", "/torchtext/models/roberta/bundler.py"]} |
35,803,983 | Emekaborisama/EndSars-twitter-bot | refs/heads/main | /mention.py | import tweepy as tp
import logging
import os
from time import sleep
logger = logging.getLogger()
auth = tp.OAuthHandler('pIZw54XtvVuGZM4TTJYHZrFX1', '6x1ohdPHRdFnSrUGUo6qbEup3O7eiVk5mMNpnFXcWrLQPNVhTC')
auth.set_access_token('1305611268447928320-MA3D0D1Ay41wjefcRmrxKr08Ub12VM', 's0EAbYg9gKIM8qoq0XjDpCCA3mToGPvQxkntPv... | {"/.ipynb_checkpoints/endsarsbot-checkpoint.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"], "/endsarsbot.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"]} |
35,803,984 | Emekaborisama/EndSars-twitter-bot | refs/heads/main | /like_retweet.py | import tweepy as tp
import logging
import os
from time import sleep
logger = logging.getLogger()
auth = tp.OAuthHandler('pIZw54XtvVuGZM4TTJYHZrFX1', '6x1ohdPHRdFnSrUGUo6qbEup3O7eiVk5mMNpnFXcWrLQPNVhTC')
auth.set_access_token('1305611268447928320-MA3D0D1Ay41wjefcRmrxKr08Ub12VM', 's0EAbYg9gKIM8qoq0XjDpCCA3mToGPvQxkntP... | {"/.ipynb_checkpoints/endsarsbot-checkpoint.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"], "/endsarsbot.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"]} |
35,803,985 | Emekaborisama/EndSars-twitter-bot | refs/heads/main | /config.py | import tweepy as tp
import logging
import os
logger = logging.getLogger()
def create_api():
auth = tp.OAuthHandler('pIZw54XtvVuGZM4TTJYHZrFX1', '6x1ohdPHRdFnSrUGUo6qbEup3O7eiVk5mMNpnFXcWrLQPNVhTC')
auth.set_access_token('1305611268447928320-MA3D0D1Ay41wjefcRmrxKr08Ub12VM', 's0EAbYg9gKIM8qoq0XjDpCCA3mToGPvQxkn... | {"/.ipynb_checkpoints/endsarsbot-checkpoint.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"], "/endsarsbot.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"]} |
35,803,986 | Emekaborisama/EndSars-twitter-bot | refs/heads/main | /endsarsbot.py | import tweepy as tp
import logging
import os
from time import sleep
logger = logging.getLogger()
auth = tp.OAuthHandler('pIZw54XtvVuGZM4TTJYHZrFX1', '6x1ohdPHRdFnSrUGUo6qbEup3O7eiVk5mMNpnFXcWrLQPNVhTC')
auth.set_access_token('1305611268447928320-MA3D0D1Ay41wjefcRmrxKr08Ub12VM', 's0EAbYg9gKIM8qoq0XjDpCCA3mToGPvQxkntP... | {"/.ipynb_checkpoints/endsarsbot-checkpoint.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"], "/endsarsbot.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"]} |
35,803,987 | Emekaborisama/EndSars-twitter-bot | refs/heads/main | /comment_bot.py | import tweepy as tp
import logging
import os
from time import sleep
auth = tp.OAuthHandler('pIZw54XtvVuGZM4TTJYHZrFX1', '6x1ohdPHRdFnSrUGUo6qbEup3O7eiVk5mMNpnFXcWrLQPNVhTC')
auth.set_access_token('1305611268447928320-MA3D0D1Ay41wjefcRmrxKr08Ub12VM', 's0EAbYg9gKIM8qoq0XjDpCCA3mToGPvQxkntPv6AWbtVI')
api = tp.API(auth, w... | {"/.ipynb_checkpoints/endsarsbot-checkpoint.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"], "/endsarsbot.py": ["/comment_bot.py", "/like_retweet.py", "/mention.py"]} |
35,835,907 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/utils/database_functions.py | from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
import calendar
import pyodbc
from typing import Dict, List, Tuple
def connect_to_database():
"""This function returns a connection to the database.
Returns:
pyodbc connection: A connection to the relevant... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,908 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/email_manager/email_lib.py | import substation_readings_manager.email_manager.email_manager as em
import configparser
import json
email_manager_primary_receipient_list = [
'knliao@southernco.com'
]
primary_receipient_list = [
'jrstewar@southernco.com',
'EBBRAY@southernco.com',
'JONJAMES@southernco.com',
'RJSCHNEI@s... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,909 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/app.py | """This module queries the MPC Battery Data Database and checks for missing values."""
from datetime import date
import calendar
import xlsxwriter
import substation_readings_manager.utils.utils as df
import substation_readings_manager.email_manager.email_lib as el
from substation_readings_manager.excel_file.excel_fi... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,910 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/utils/workbook.py | """[summary]
Returns:
[type]: [description]
"""
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
import calendar
import pyodbc
from typing import Dict, List, Tuple
import database_functions as database_func
import date_functions as date_func
def check_substation(s... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,911 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/app_copy.py | """This module queries the MPC Battery Data Database and checks for missing values."""
from datetime import date
import calendar
import substation_readings_manager.utils.database_functions as df
import substation_readings_manager.email_manager.email_lib as el
from substation_readings_manager.excel_file.excel_file imp... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,912 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/utils/deprecated.py | def query_database_cell_values(string_record_id: str, reading_type: int, cell_number: int,
day: date = get_last_month_date()) -> List:
""" This function queries the database for the readings for a specific StringID,
reading type and cell number
Args:
string_record_id ... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,913 | knliao-southernco/substation_readings_manager | refs/heads/master | /main.py | from substation_readings_manager.app_copy import main
main() | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,914 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/substation/substation.py | from enum import Enum
from datetime import date
from typing import List, Dict, Tuple
import substation_readings_manager.utils.database_functions as df
import substation_readings_manager.utils.date_functions as date_func
class DataReading():
reading_type_dict = {6: "Cell Impedance", 8: "Cell Voltage",
9:"Stra... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,915 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/excel_file/excel_file.py | """This class is responsible for creating the excel sheet and writing to it.
"""
import xlsxwriter
from substation_readings_manager.substation.substation import Substation
class ExcelFile:
def __init__(self, workbook_name):
self.workbook = xlsxwriter.Workbook(workbook_name)
self.key = self.work... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,916 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/utils/utils_test.py | import unittest
from datetime import date
import pyodbc
import utils as df
class LastMonthDate(unittest.TestCase):
def test_connect_to_database(self):
self.assertIs(type(df.connect_to_database()), pyodbc.Connection)
def test_get_last_month_date(self):
self.assertIs(type(df.get_last_month_da... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,917 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/utils/date_functions.py | from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
import calendar
import pyodbc
from typing import Dict, List, Tuple
def get_last_month_date() -> date:
""" This function returns the date one month ago. This is for get_date_range_one_month
which then takes the firs... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,835,918 | knliao-southernco/substation_readings_manager | refs/heads/master | /substation_readings_manager/excel_file/test_excel_file.py | import os
import unittest
from ExcelFile import ExcelFile
class ExcelFileTest(unittest.TestCase):
def test_create_excel_file(self):
excel_file = ExcelFile("Excel_Test.xlsx")
excel_file.close()
self.assertTrue(os.path.exists("./Excel_Test.xlsx"))
if __name__ == '__main__':
unittest.... | {"/substation_readings_manager/app_copy.py": ["/substation_readings_manager/email_manager/email_lib.py", "/substation_readings_manager/utils/database_functions.py", "/substation_readings_manager/excel_file/excel_file.py", "/substation_readings_manager/substation/substation.py", "/substation_readings_manager/utils/workb... |
35,897,976 | Yefimenko1Kirillallay/gitHomeworkPython | refs/heads/master | /work.py | import pygame
import sys
# Переменные для установки ширины и высоты окна
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
mainSurface = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT), 0, 32)
# Подключение фото для заднего фона
# Здесь лишь создание переменной, вывод заднего фона ниже в коде
bg = pygame.image.loa... | {"/main.py": ["/work.py"]} |
35,897,977 | Yefimenko1Kirillallay/gitHomeworkPython | refs/heads/master | /main.py | import pygame
import work
work.main() | {"/main.py": ["/work.py"]} |
35,958,008 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/models.py | from django.db import models
class MyUserLogin(models.Model):
username = models.CharField(max_length=20)
password = models.CharField(max_length=20)
class MyUser(models.Model):
login = models.ForeignKey(MyUserLogin, on_delete=models.CASCADE)
type = models.CharField(max_length=1) # T=TA I=Instructor... | {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
35,958,009 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/views.py | from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, redirect
from django.views import View
from GitHubTest.models import MySyllabus, MyUser, MyUserLogin, MyCourse, MySection, MySyllabusComponent
class Home(View):
def get(self, request):
request.session["current"] = "... | {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
35,958,010 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/migrations/0001_initial.py | # Generated by Django 3.1.3 on 2020-12-13 00:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='MyCourse',
fields=[
... | {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
35,958,011 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/tests.py | from django.test import TestCase, Client
from .models import MySyllabus, MyUser, MyCourse, MySection, MyUserLogin
from . import views
import unittest
# Create your tests here.
class TestLogin(TestCase):
def setUp(self):
self.client = Client()
self.user_admin = MyUser(login=MyUserLogin(username="no... | {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
35,958,012 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/admin.py | from django.contrib import admin
from GitHubTest.models import MyUserLogin, MyUser, MySyllabus, MyCourse, MySection, MySyllabusComponent
admin.site.register(MyUserLogin)
admin.site.register(MyUser)
admin.site.register(MySyllabus)
admin.site.register(MySyllabusComponent)
admin.site.register(MyCourse)
admin.site.registe... | {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
35,958,013 | aalnobel/CS361Project | refs/heads/master | /GitHubTest/apps.py | from django.apps import AppConfig
class GithubtestConfig(AppConfig):
name = 'GitHubTest'
| {"/GitHubTest/tests.py": ["/GitHubTest/models.py"], "/GitHubTest/views.py": ["/GitHubTest/models.py"], "/GitHubTest/admin.py": ["/GitHubTest/models.py"]} |
36,001,401 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /main.py | from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
import numpy as np
import argparse
import imutils
import time
import dlib
import cv2
import playsound
from drowsy import *
from utils import *
import headpose_utils as headpose
from scipy.spatial import distance
from PIL... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,402 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /detection.py | from scipy.spatial import distance
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
import numpy as np
import argparse
import imutils
import time
import dlib
import cv2
import playsound
#cap = cv2.VideoCapture(0)
ALARM_ON = False
face_cascade = cv2.Cas... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,403 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /phone/phone_detection.py | import cv2
import time
import numpy as np
from PIL import Image
import tensorflow as tf
from .helper import *
from tensorflow.python.saved_model import tag_constants
def detect (frame,infer): #infer model instance
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
image = Image.fromarray(frame)
frame_siz... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,404 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /headpose_main.py | import cv2
import dlib
import numpy as np
import headpose_utils as headpose
from utils import *
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('shape_predictor.dat')
vid = cv2.VideoCapture(0)
while(True):
ret, image = vid.read()
gray = cv2.cvtColor(image, cv2.COLOR_RGB2G... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,405 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /UIandMain.py | # import
import sys
import PyQt5.QtWidgets as qwd
from PyQt5 import QtGui as gui
import datetime
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
import numpy as np
import argparse
import imutils
import time
import dlib
import cv2
import playsound
from drowsy import *
f... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,406 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /mainYolo.py | import os
import cv2
import time
import numpy as np
from PIL import Image
import tensorflow as tf
from phone.phone_detection import detect
from tensorflow.python.saved_model import tag_constants
model_path = os.path.join(os.getcwd() +'/phone/checkpoints/','yolov4_tiny_416')
def main():
saved_model_loaded = t... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,407 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /UI.py | # import
import os
import sys
import cv2 as cv
import PyQt5.QtWidgets as qwd
from PyQt5 import QtGui as gui
import datetime
from imutils.video import VideoStream
import imutils
import cv2
# fileName=""
videoPath = ""
# MACRO DEFINITIONS
WINDOW_TITLE = "Drowsy Driver"
WINDOW_SIZE_X = 1280 # 1920
WINDOW... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,408 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /headpose_utils.py | import numpy as np
# import dlib
import cv2
def HeadPoseAngles(marks,image,frame_counter_head):
#marks : 68 facial landmarks
#frame_counter_head : counter for num of frames to detect if the driver looked away to turn alarm on
distortion_coeff = np.zeros((4,1)) #no camera length distortion
... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,409 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /phone/__init__.py | from .checkpoints import yolov4_tiny_416
from .helper import draw_bbox
from .phone_detection import detect
| {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,001,410 | reemnasserr/Drowsy-Driver-Detection-using-OpenCV | refs/heads/main | /drowsy.py | import cv2
from scipy.spatial import distance
#this fucntion takes the average of eye ascpect ratio of both eyes and the current frame counter
#and starts counting the number of frames the driver is closing their eyes in. Once it reaches the max_no_of_frames
#the alarm is turned to true and if the the eye is open, me... | {"/main.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/headpose_main.py": ["/headpose_utils.py"], "/UIandMain.py": ["/drowsy.py", "/headpose_utils.py", "/phone/phone_detection.py"], "/mainYolo.py": ["/phone/phone_detection.py"], "/phone/__init__.py": ["/phone/phone_detection.py"]} |
36,018,404 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/teste.py | vowels = ['a', 'e', 'i', 'o', 'i', 'u']
# index of 'e' in vowels
index = vowels.index('e')
print('The index of e:', index)
# element 'i' is searched
# index of the first 'i' is returned
index = vowels.index('i')
print('The index of i:', index)
| {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,405 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('orcamento', views.OrcamentoListView.as_view(), name='orcamento'),
path(
'orcamento/<int:pk>',
views.OrcamentoDetailView.as_view(),
name='orcamento-id',
),
path(
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,406 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/models.py | from django.db import models
from django.contrib.auth.models import User
from django.urls import (
reverse,
) # Used to generate URLs by reversing the URL patterns
from django.utils import timezone
from .customclass.estruturas.dimensao import Dimensao
from .customclass.objetos.filtro import Filtro
from .customcla... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,407 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/actions.py | def negociacao(modeladmin, request, queryset):
queryset.update(status='Em negociação')
negociacao.short_description = 'Em negociação'
def contrato(modeladmin, request, queryset):
queryset.update(status='Contrato')
contrato.short_description = 'Contrato'
def encerrado(modeladmin, request, queryset):
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,408 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/migrations/0001_initial.py | # Generated by Django 4.0.3 on 2022-03-22 00:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,409 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/objetos/vinil.py | # -*- coding: utf-8 -*-
from .dbs.database import Database
class Vinil:
def __init__(self, espessura, fornecedor):
self.espessura = espessura
self.fornecedor = fornecedor
self.config = {}
self.config['vinil'] = Database('vinils').lista()
def vinil_grupo(self):
return
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,410 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/objetos/precificacao.py | from .dbs.database import Database
from .vinil import Vinil
from .filtro import Filtro
import locale
class Precificacao:
def __init__(self, dimensao):
self.dimensao = dimensao
self.config = {}
self.config['vinil'] = Database('vinils').lista()
self.config['perfil_rigido'] = Database... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,411 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/objetos/filtro.py | from .dbs.database import Database
class Filtro:
def __init__(self, dimensao):
self.dimensao = dimensao
self.config = {}
self.config['filtros'] = Database('filtros')
self.config['tampa_casa_maquinas'] = Database('tampa_casa_maquinas')
def dimensionamento_filtro_grupo(
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,412 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/estruturas/__init__.py | from .dimensao import Dimensao
| {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,413 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/admin.py | from django.contrib import admin
from .models import ClienteModel, DimensaoModel
from .actions import negociacao, contrato, encerrado
# Register your models here.
@admin.register(ClienteModel)
class ClienteAdmin(admin.ModelAdmin):
list_display = (
'nome_completo',
'cidade',
'rua',
'... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,414 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/objetos/motor.py | # -*- coding: utf-8 -*-
from .filtro import Filtro
from .dbs.database import Database
class Motor:
def __init__(self, dimensao):
self.dimensao = dimensao
self.materiais = []
self.config = {}
self.config['motores'] = Database('motores')
def add_materiais(self, material):
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,415 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/schema.py | import graphene
from graphene_django.types import DjangoObjectType, ObjectType
from .models import ClienteModel, DimensaoModel
# Create a GraphQL type for the actor model
class ClienteType(DjangoObjectType):
nome_completo = graphene.String(source='nome_completo')
class Meta:
model = ClienteModel
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,416 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/views.py | from django.http import HttpResponse
from django.views import generic
from django.shortcuts import render
from django.urls import reverse_lazy
from django.utils import timezone
from django.shortcuts import redirect
from .models import ClienteModel, DimensaoModel
from .forms import DimensaoForm, OrcamentoUpdateForm, Cl... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,417 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/estruturas/dimensao.py | # -*- coding: utf-8 -*-
# Estrutura de Dados de Dimensão
class Dimensao:
def __init__(
self,
rec_largura,
rec_comprimento,
rec_prof_inicial,
rec_prof_final,
rec_largura_da_calcada,
):
self.largura = rec_largura
self.comprimento = rec_comprimento
... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,418 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/customclass/objetos/dbs/database.py | import ast
import json
class Database:
def __init__(self, tabela):
self.file = open(
'dimensoes/customclass/objetos/dbs/' + tabela + '.json', 'r'
)
self.table = tabela
self.db = json.dumps(ast.literal_eval(self.file.read()))
def lista(self):
return json.load... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,018,419 | leopesi/pool_budget | refs/heads/main | /projeto/dimensoes/forms.py | from django import forms
from django.forms import ModelForm
from .models import DimensaoModel, ClienteModel
class DimensaoForm(ModelForm):
espessura = forms.CharField(
widget=forms.RadioSelect(
choices=[
['0.6', '0.6 mm'],
['0.7', '0.7 mm'],
['0... | {"/projeto/dimensoes/customclass/estruturas/__init__.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py"], "/projeto/dimensoes/models.py": ["/projeto/dimensoes/customclass/estruturas/dimensao.py", "/projeto/dimensoes/customclass/objetos/filtro.py", "/projeto/dimensoes/customclass/objetos/motor.py"], "/projeto... |
36,053,109 | kalyanteja/device-monitor | refs/heads/master | /ImageReader.py | import os, io
from typing import Dict
from google.cloud import vision
import pandas as pd
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = r"google_api_key.json"
client = vision.ImageAnnotatorClient()
class ImageReadingService:
@classmethod
def fetch_readings_from_image(cls, file_name: str = 4) -> Dict[str, s... | {"/api.py": ["/ImageReader.py"]} |
36,053,110 | kalyanteja/device-monitor | refs/heads/master | /api.py | import flask
from flask import jsonify
from ImageReader import ImageReadingService
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET', 'POST'])
def home():
# todo: get image from FE and pass along
df = ImageReadingService.fetch_readings_from_image(4)
return jsonify(df)... | {"/api.py": ["/ImageReader.py"]} |
36,141,953 | sapdeleon/python_lecture | refs/heads/master | /hello.py | print("Hello, World!")
# array in python
names = ["Harry", "Ron", "Tess", "Meghan"]
# loop in python
for name in names:
print(name)
| {"/imports.py": ["/classes.py"]} |
36,141,954 | sapdeleon/python_lecture | refs/heads/master | /inputs.py | import sys
# using exceptions
try:
num = int(input("Enter a number: "))
except ValueError:
print("Error: Invalid number!")
sys.exit(1)
# using conditions
if (num > 0):
print("Number is positive.")
elif (num < 0):
print("Number is negative.")
else:
print("Number is zero...")
| {"/imports.py": ["/classes.py"]} |
36,141,955 | sapdeleon/python_lecture | refs/heads/master | /classes.py | class Flight():
def __init__(self, capacity):
self.capacity = capacity
self.passengers = []
def add_passenger(self, name):
if not self.open_seats(): # no seats available
return False
self.passengers.append(name)
return True
def open_seats(self):
... | {"/imports.py": ["/classes.py"]} |
36,141,956 | sapdeleon/python_lecture | refs/heads/master | /imports.py | import classes
people = ["Harry", "Ron", "James", "Dave"]
# create new Flight object with 3 maximum capacity
flight = classes.Flight(3);
for person in people:
if flight.add_passenger(person):
print(f"Added {person} to flight successfully!")
else:
print(f"Sorry, no available seat for {person}.... | {"/imports.py": ["/classes.py"]} |
36,161,503 | minglii1998/simple-classification-frame | refs/heads/main | /lib/utils/fileutils.py | import os
import numpy as np
import cv2
mapping_dict_weight2id = {}
mapping_dict_weight2id['25'] = 1
mapping_dict_weight2id['5'] = 2
mapping_dict_weight2id['75'] = 3
mapping_dict_weight2id['10'] = 4
mapping_dict_weight2id['125'] = 5
mapping_dict_weight2id['15'] = 6
mapping_dict_weight2id['175'] = 7
mapping_dict_weigh... | {"/lib/evaluators.py": ["/lib/evaluation_metrics/__init__.py"], "/main.py": ["/config.py", "/lib/datasets/dataset_classification.py", "/lib/trainers.py", "/lib/evaluators.py"], "/lib/trainers.py": ["/lib/evaluation_metrics/__init__.py"]} |
36,183,352 | danesjenovdan/parladata | refs/heads/dev | /parlacards/serializers/cards/person/recent_activity.py | from django.db.models import Value
from parlacards.pagination import create_paginator
from parlacards.serializers.common import PersonScoreCardSerializer
from parlacards.serializers.recent_activity import EventSerializer
from parladata.models.ballot import Ballot
from parladata.models.question import Question
from parl... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,353 | danesjenovdan/parladata | refs/heads/dev | /parladata/update_helpers/methods.py | from django.utils.module_loading import import_string
from django.conf import settings
def get_helper_method(lib, name):
language_code = settings.LEGISLATION_RESOLVER_LANGUAGE_CODE
mathod_path_string = f'parladata.update_helpers.{language_code}.{lib}.{name}'
try:
method = import_string(mathod_path... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,354 | danesjenovdan/parladata | refs/heads/dev | /parlacards/management/commands/upload_votes_to_solr.py | import json
import requests
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from parladata.models.vote import Vote
from parlacards.serializers.vote import SessionVoteSerializer
from datetime import datetime, timedelta
from parlacards.solr import delete_from_solr, ... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,355 | danesjenovdan/parladata | refs/heads/dev | /parladata/management/commands/send_daily_notifications.py | from django.core.management.base import BaseCommand, CommandError
from parladata.update_utils import notify_editors_for_new_data
class Command(BaseCommand):
help = 'Send daily notifications'
def handle(self, *args, **options):
self.stdout.write('Checking for new data')
notify_editors_for_new... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,356 | danesjenovdan/parladata | refs/heads/dev | /parladata/compass.py | # -*- coding: utf-8 -*-
from parladata.models import *
def removekey(d, key):
r = dict(d)
del r[key]
return r
def getVotingArray():
persons = Person.objects.all()
votes = Vote.objects.all()
results = {}
# for each person
for i, person in enumerate(persons):
# generate new li... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,357 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0036_auto_20210802_1314.py | # Generated by Django 3.2.5 on 2021-08-02 13:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('parladata', '0035_auto_20210715_1704'),
]
operations = [
migrations.AlterField(
model_name='per... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,358 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0045_auto_20210913_1845.py | # Generated by Django 3.2.7 on 2021-09-13 18:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('parladata', '0044_auto_20210911_1135'),
]
operations = [
migrations.RemoveField(
model_name='or... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,359 | danesjenovdan/parladata | refs/heads/dev | /tests/views/test_card_views.py | from datetime import datetime
import pytest
from tests.fixtures.common import *
from rest_framework.test import APIClient
from parlacards.views import *
client = APIClient()
def single_test_url(url, params, status_code=200):
response = client.get(url, params)
assert response.status_code == status_code
de... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,360 | danesjenovdan/parladata | refs/heads/dev | /parladata/models/question.py | from django.db import models
from parladata.behaviors.models import Timestampable
QUESTION_TYPES = [
('question', 'question'),
('initiative', 'initiative'),
('unknown', 'unknown'),
]
class Question(Timestampable):
"""All questions from members of parlament."""
session = models.Fo... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,361 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0053_auto_20211201_1150.py | # Generated by Django 3.2.9 on 2021-12-01 11:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('parladata', '0052_auto_20211130_1124'),
]
operations = [
migrations.CreateModel(
name='Legislat... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,362 | danesjenovdan/parladata | refs/heads/dev | /parladata/management/commands/delete_all_sessions.py | from django.core.management.base import BaseCommand, CommandError
from parladata.models import Session
class Command(BaseCommand):
help = 'Merges people together'
def handle(self, *args, **options):
self.stdout.write('I am about to delete all sessions')
self.stdout.write('\n')
Session.... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,363 | danesjenovdan/parladata | refs/heads/dev | /tests/scores/test_number_of_questions.py | import pytest
from parlacards.scores.number_of_questions import calculate_number_of_questions_from_person
from tests.fixtures.common import *
@pytest.mark.django_db()
def test_calculate_number_of_questions_from_person(
first_person,
second_person,
last_person,
ending_date_of_first_mandate
):
numb... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,364 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0065_task_module_name.py | # Generated by Django 3.2.12 on 2022-11-21 17:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parladata', '0064_auto_20220908_1825'),
]
operations = [
migrations.AddField(
model_name='task',
name='module_name'... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,365 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0017_auto_20210511_1240.py | # Generated by Django 3.2 on 2021-05-11 12:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parladata', '0016_auto_20210511_1223'),
]
operations = [
migrations.RenameField(
model_name='motion',
old_name='recap'... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,366 | danesjenovdan/parladata | refs/heads/dev | /parladata/management/commands/startparlameter.py | from django.core.management.base import BaseCommand, CommandError
from parladata.models import Organization
class Command(BaseCommand):
help = 'Merges people together'
def add_arguments(self, parser):
parser.add_argument('people', nargs='+')
def handle(self, *args, **options):
self.stdout... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,367 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0051_rename_authors_question_person_authors.py | # Generated by Django 3.2.9 on 2021-11-29 17:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('parladata', '0050_mediareport_uri'),
]
operations = [
migrations.RenameField(
model_name='question',
old_name='authors',
... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,368 | danesjenovdan/parladata | refs/heads/dev | /parladata/management/commands/run_tasks.py |
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import Group
from django.conf import settings
from django.utils.translation import gettext as _
from importlib import import_module
from parladata.models.task import Task
from datetime import datetime
from parladata.u... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,369 | danesjenovdan/parladata | refs/heads/dev | /parladata/admin/motion.py | from django.contrib import admin
from django.utils.safestring import mark_safe
from django.conf import settings
from django.db.models import Q
from django.urls import reverse
from parladata.models import *
from parladata.models.task import Task
from parladata.models.versionable_properties import *
from parladata.model... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
36,183,370 | danesjenovdan/parladata | refs/heads/dev | /parladata/migrations/0023_alter_personmembership_role.py | # Generated by Django 3.2 on 2021-05-12 19:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parladata', '0022_alter_law_passed'),
]
operations = [
migrations.AlterField(
model_name='personmembership',
name='rol... | {"/parladata_project/urls.py": ["/parladata/views.py", "/parlacards/admin_views.py"], "/sandbox/uk_imports.py": ["/parladata/models/__init__.py"], "/parladata/migrations/0002_organizationmembership.py": ["/parladata/models/__init__.py"], "/parladata/admin.py": ["/parladata/models/__init__.py"], "/parladata/management/c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.