index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
87,388 | devpraveenops/shopdaily | refs/heads/main | /store/admin.py | from django.contrib import admin
from .models import *
# Register your models here.
class ProductAdmin(admin.ModelAdmin):
list_display = ['name','unit','price','discount_price','category']
list_filter = ['name']
class OrderProductInline(admin.TabularInline):
model = OrderProduct
readonly_fields = ['us... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,389 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0054_delete_address.py | # Generated by Django 3.0.8 on 2020-09-15 09:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0053_auto_20200915_1103'),
]
operations = [
migrations.DeleteModel(
name='Address',
),
]
| {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,390 | devpraveenops/shopdaily | refs/heads/main | /store/forms.py | from django import forms
from django.forms import ModelForm
from django.core.exceptions import ValidationError
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Order, UserProfile
PAYMENT_CHOICES =(
('S', 'Stripe'),
('P', 'PayPal')
)
def sho... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,391 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0019_auto_20200815_1321.py | # Generated by Django 3.0.8 on 2020-08-15 07:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0018_auto_20200815_1316'),
]
operations = [
migrations.RemoveField(
model_name='orderitem',
name='product',
... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,392 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0056_auto_20201110_1013.py | # Generated by Django 3.0.8 on 2020-11-10 04:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0055_auto_20201110_0913'),
]
operations = [
migrations.RenameField(
model_name='product',
old_name='store',
... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,393 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0024_auto_20200828_2233.py | # Generated by Django 3.0.8 on 2020-08-28 17:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0023_auto_20200828_2232'),
]
operations = [
migrations.AlterField(
model_name='order',
name='start_date',
... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,394 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0022_item.py | # Generated by Django 3.0.8 on 2020-08-28 16:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('store', '0021_orderitem'),
]
operations = [
migrations.CreateModel(
name='Item',
fi... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,395 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0040_auto_20200901_1716.py | # Generated by Django 3.0.8 on 2020-09-01 11:46
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('store', '0039_auto_20200... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,396 | devpraveenops/shopdaily | refs/heads/main | /store/templatetags/cart.py | from django import template
register = template.Library()
@register.filter(name='is_in_cart')
def is_in_cart(product, cart):
keys = cart.keys()
for id in keys:
if int(id) == product.id:
return True
return False;
@register.filter(name='cart_quantity')
def cart_quantity(product, cart)... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,397 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0044_delete_item.py | # Generated by Django 3.0.8 on 2020-09-01 13:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0043_auto_20200901_1822'),
]
operations = [
migrations.DeleteModel(
name='Item',
),
]
| {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,398 | devpraveenops/shopdaily | refs/heads/main | /store/models.py | from django.db import models
from django.contrib.auth.models import User, AbstractBaseUser, BaseUserManager
from django.db.models.signals import pre_save
# from djecom.utils import unique_slug_generator
# from django_countries.fields import CountryField, StateField
# from django_states.fields import StateField
from dja... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,399 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0034_auto_20200901_1525.py | # Generated by Django 3.0.8 on 2020-09-01 09:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('store', '0033_auto_20200901_1519'),
]
operations = [
migrations.AlterField(
model_name='orderit... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,400 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0027_auto_20200829_1739.py | # Generated by Django 3.0.8 on 2020-08-29 12:09
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('store', '0026_product_discount_price'),
]
operations = [
migrations.RenameFiel... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,401 | devpraveenops/shopdaily | refs/heads/main | /store/urls.py | from django.urls import path
from . import views
from .views import *
from .models import Order
urlpatterns = [
path('', Store.as_view(), name="store"),
# path('store/', views.home),
path('signup/', Signup.as_view(), name="signup"),
path('profile/', Profile.as_view(), name="profile"),
path('... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,402 | devpraveenops/shopdaily | refs/heads/main | /store/migrations/0031_auto_20200830_1407.py | # Generated by Django 3.0.8 on 2020-08-30 08:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0030_auto_20200830_0911'),
]
operations = [
migrations.RenameField(
model_name='order',
old_name='address',
... | {"/store/views.py": ["/store/forms.py", "/store/models.py"], "/store/admin.py": ["/store/models.py"], "/store/forms.py": ["/store/models.py"], "/store/urls.py": ["/store/views.py", "/store/models.py"]} |
87,411 | jmperalb/darkroom | refs/heads/master | /darkroom/shell.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, Craig Tracey
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | {"/darkroom/shell.py": ["/darkroom/image_builder.py"], "/darkroom/builders/rhel.py": ["/darkroom/image_builder.py", "/darkroom/packer_settings.py"], "/darkroom/image_builder.py": ["/darkroom/build_instance_settings.py", "/darkroom/builders/rhel.py"]} |
87,412 | jmperalb/darkroom | refs/heads/master | /darkroom/builders/rhel.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, Craig Tracey
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | {"/darkroom/shell.py": ["/darkroom/image_builder.py"], "/darkroom/builders/rhel.py": ["/darkroom/image_builder.py", "/darkroom/packer_settings.py"], "/darkroom/image_builder.py": ["/darkroom/build_instance_settings.py", "/darkroom/builders/rhel.py"]} |
87,413 | jmperalb/darkroom | refs/heads/master | /darkroom/packer_settings.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, Craig Tracey
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | {"/darkroom/shell.py": ["/darkroom/image_builder.py"], "/darkroom/builders/rhel.py": ["/darkroom/image_builder.py", "/darkroom/packer_settings.py"], "/darkroom/image_builder.py": ["/darkroom/build_instance_settings.py", "/darkroom/builders/rhel.py"]} |
87,414 | jmperalb/darkroom | refs/heads/master | /darkroom/image_builder.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, Craig Tracey
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | {"/darkroom/shell.py": ["/darkroom/image_builder.py"], "/darkroom/builders/rhel.py": ["/darkroom/image_builder.py", "/darkroom/packer_settings.py"], "/darkroom/image_builder.py": ["/darkroom/build_instance_settings.py", "/darkroom/builders/rhel.py"]} |
87,415 | jmperalb/darkroom | refs/heads/master | /darkroom/build_instance_settings.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014, Craig Tracey
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | {"/darkroom/shell.py": ["/darkroom/image_builder.py"], "/darkroom/builders/rhel.py": ["/darkroom/image_builder.py", "/darkroom/packer_settings.py"], "/darkroom/image_builder.py": ["/darkroom/build_instance_settings.py", "/darkroom/builders/rhel.py"]} |
87,418 | ayrnb/pythonProject1 | refs/heads/master | /ex/ex14.py | from sys import argv
script, user_name = argv
promt = '>'
print(f"Hi{user_name},I'm the {script}script")
| {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,419 | ayrnb/pythonProject1 | refs/heads/master | /cards_tools.py | card_list = []
def show_menu():
"""显示菜单
"""
print("*" * 50)
print("欢迎使用【名片管理系统】V1.0\n1. 新建名片\n2. 显示全部\n3. 查询名片\n\n0. 退出系统")
print("*" * 50)
def new_card():
"""新建名片
"""
print("-" * 50)
print("功能:新建名片")
name = input("输入您的姓名")
phone = input("输入您的电话")
qq = input("输入您的QQ")... | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,420 | ayrnb/pythonProject1 | refs/heads/master | /元组.py | string="i like python"
a=string.capitalize()
b=string.title()
print(a)
print(b)
seq="ssss"
c=string.join(seq)
print(c)
# del(string)
print(string) | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,421 | ayrnb/pythonProject1 | refs/heads/master | /ex/ex15.py | filename= "ex15_sample.txt"
txt=open(filename)
print(f"Here's your file {filename}:")
print(txt.read()) | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,422 | ayrnb/pythonProject1 | refs/heads/master | /ex/day2.py |
# def sum_2_num(num1,num2):
#
# result=num1+num2
# return result
# print(sum_2_num(10,20))
def print_lines(chars,times):
print(chars*times)
def print_times(chars,times):
"""打印多行分隔线
:param chars:
:param times:
"""
low=0
while low<5:
print_lines(chars,times)
low+=1
pri... | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,423 | ayrnb/pythonProject1 | refs/heads/master | /ex/41.py | from ex.ex40a import MyStuff
thing=MyStuff()
thing.apple()
print(thing.tangerine) | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,424 | ayrnb/pythonProject1 | refs/heads/master | /ex/格式化字符串.py | print('哈哈哈')
print('嘻嘻嘻')
print('\n\n')
print('哈哈哈', end=' ')
print('嘻嘻嘻')
a = input("请输入你的名字")
print(a)
| {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,425 | ayrnb/pythonProject1 | refs/heads/master | /leetcode/l1893.py | from typing import List
def isCovered(ranges: List[List[int]], left: int, right: int) -> bool:
diff = [0] * 52
for l, r in ranges:
diff[l] += 1
diff[r + 1] -= 1
sum = 0
for i in range (1, 51):
sum += diff[i]
if left <= i <= right and sum <= 0:
return False
... | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,426 | ayrnb/pythonProject1 | refs/heads/master | /体验模块.py | import hm_10_分隔线模块
hm_10_分隔线模块.print_line("-", 80)
hm_10_分隔线模块.print_lines('-',80)
print(hm_10_分隔线模块.name) | {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,427 | ayrnb/pythonProject1 | refs/heads/master | /ex/ex16.py | filename = "text.txt"
print(f"We're going to erase {filename}")
print("if you don't want that,hit CTRL-C(^C).")
print("If you do want that,hit RETRUN")
input("?")
print("Opening the file...")
targrt=open(filename,'w')
print("Truncating the file.Goodbye!")
targrt.truncate()
| {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,428 | ayrnb/pythonProject1 | refs/heads/master | /hm_10_分隔线模块.py | name = "黑马程序员"
def print_line(chars,times):
print(chars*times)
def print_lines(chars,times):
"""打印多行分隔线
:param chars:
:param times:
"""
low=0
while low<5:
print_line(chars,times)
low+=1
| {"/\u4f53\u9a8c\u6a21\u5757.py": ["/hm_10_\u5206\u9694\u7ebf\u6a21\u5757.py"]} |
87,454 | Dhivyapriya-saturam/flask23dec | refs/heads/master | /ex.py | from flask import Blueprint
ex_blueprint = Blueprint('ex_blueprint', __name__)
@ex_blueprint.route('/')
def index():
return "WELCOME TO OUR PAGE!!"
| {"/app.py": ["/ex.py"]} |
87,455 | Dhivyapriya-saturam/flask23dec | refs/heads/master | /app.py | import json
from flask import Flask, request, session, redirect, url_for, render_template, g
import requests
import os
from ex import ex_blueprint
app = Flask(__name__)
app.secret_key = os.urandom(24)
app.register_blueprint(ex_blueprint)
@app.route('/login', methods=['GET', 'POST'])
def index():
"""
create... | {"/app.py": ["/ex.py"]} |
87,457 | nicolastrres/slack-bot-wrapper | refs/heads/master | /slack_bot/slack_bot.py | import logging
import time
class SlackBot:
def __init__(self, bot_name, client, commands_handlers=None):
self.client = client
self.bot_name = bot_name
self.commands_handlers = commands_handlers or {}
self.logger = logging.getLogger('%sBot' % self.bot_name)
self.at_bot = se... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,458 | nicolastrres/slack-bot-wrapper | refs/heads/master | /setup.py | from setuptools import setup
setup(name='slack-bot-wrapper',
version='0.0.6',
description='Slack Bot Wrapper',
long_description='Allows to create Slack bots and add features to them '
'very easily.',
url='https://github.com/nicolastrres/slack-bot-wrapper',
classifie... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,459 | nicolastrres/slack-bot-wrapper | refs/heads/master | /slack_bot/slack_client_wrapper.py | import logging
from slackclient import SlackClient
class SlackClientWrapper:
def __init__(self, slack_token, slack_lib=SlackClient):
self.slack_client = slack_lib(slack_token)
self.logger = logging.getLogger('SlackClientWrapper')
def post_message(self, channel, message, as_user):
"""... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,460 | nicolastrres/slack-bot-wrapper | refs/heads/master | /slack_bot/__init__.py | from slack_bot.slack_bot import SlackBot
from slack_bot.slack_client_wrapper import SlackClientWrapper
__all__ = [SlackBot, SlackClientWrapper]
| {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,461 | nicolastrres/slack-bot-wrapper | refs/heads/master | /examples/standup_bot.py | import logging
import os
from dotenv import load_dotenv
from slack_bot import SlackBot
from slack_bot import SlackClientWrapper
dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env')
load_dotenv(dotenv_path)
logging.basicConfig(format='[%(levelname)s] [%(name)s] - %(message)s',
level=... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,462 | nicolastrres/slack-bot-wrapper | refs/heads/master | /tests/test_slack_client_wrapper.py | import unittest
from unittest.mock import Mock
from slack_bot import SlackClientWrapper
class SlackClientWrapperTest(unittest.TestCase):
def setUp(self):
self.slack_lib_mocked = Mock()
self.slack_client = Mock()
self.slack_lib_mocked.return_value = self.slack_client
def test_post_mess... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,463 | nicolastrres/slack-bot-wrapper | refs/heads/master | /tests/test_slack_bot.py | import unittest
from functools import partial
from unittest.mock import Mock
from slack_bot import SlackBot
class SlackBotTest(unittest.TestCase):
def setUp(self):
self.users = [
{'id': 'some-id', 'name': 'bot-name'},
{'id': 'another-id', 'name': 'another-name'}
]
... | {"/slack_bot/__init__.py": ["/slack_bot/slack_bot.py", "/slack_bot/slack_client_wrapper.py"], "/examples/standup_bot.py": ["/slack_bot/__init__.py"], "/tests/test_slack_client_wrapper.py": ["/slack_bot/__init__.py"], "/tests/test_slack_bot.py": ["/slack_bot/__init__.py"]} |
87,464 | kujiy/mail-line-informer | refs/heads/master | /tests/test_main.py | from main import start
from utils.mailer import Mailer
from tests.helpers import *
def test_notify(mocked_object):
start(my_rules)
mocked_object.mail_mock.assert_called_once()
mocked_object.notify_new_emails_mock.assert_called_once()
mocked_object.notify_new_emails_mock.assert_called_once_with(mail_o... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,465 | kujiy/mail-line-informer | refs/heads/master | /utils/logger.py | import sys
import logging
logger = logging.getLogger(__name__)
sh = logging.StreamHandler(sys.stdout)
sh.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
logger.addHandler(sh)
logger.setLevel(logging.INFO)
| {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,466 | kujiy/mail-line-informer | refs/heads/master | /my_rules.sample.py | from env import env
from models import RuleModel
my_rules = [
RuleModel(mailbox="<YOUR_MAILBOX_NAME>", LINE_TOKEN="<YOUR_LINE_TOKEN>"),
]
| {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,467 | kujiy/mail-line-informer | refs/heads/master | /tests/helpers.py | import json
from unittest.mock import Mock
from requests.models import Response
from env import env
from plugins.line import LINE
from utils.mailer import Mailer
import pytest
from env import env
from models import RuleModel
my_rules = [
RuleModel(mailbox="school-pass", LINE_TOKEN=""),
]
class MockMailObj:
... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,468 | kujiy/mail-line-informer | refs/heads/master | /models.py | from pydantic import BaseModel
class RuleModel(BaseModel):
mailbox: str
LINE_TOKEN: str
send_body: bool = True
| {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,469 | kujiy/mail-line-informer | refs/heads/master | /plugins/line.py | # forked from linenotipy
# https://pypi.org/project/linenotipy/
import os
import requests
import io
class LINE:
def __init__(self, *, token):
self.url = "https://notify-api.line.me/api/notify"
self.headers = {"Authorization": "Bearer " + token}
def post(self, **kwargs):
files = kwargs... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,470 | kujiy/mail-line-informer | refs/heads/master | /main.py | import datetime
import os
import sys
import re
import traceback
from importlib import import_module
from typing import List
from my_rules import my_rules
from pydantic import BaseModel
from env import env
from models import RuleModel
from plugins.line import LINE
from utils.easyimap import MailObj
from utils.mailer im... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,471 | kujiy/mail-line-informer | refs/heads/master | /utils/mailer.py | from utils.easyimap import *
import email.utils
import datetime
class Mailer():
def __init__(self, *args, **kwargs):
self.connect(**kwargs)
def connect(self, **kwargs):
self.imapper = connect(
kwargs.get("host"),
kwargs.get("user"),
kwargs.get("pw"),
... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,472 | kujiy/mail-line-informer | refs/heads/master | /env.py | from pydantic import BaseSettings
class Env(BaseSettings):
LINE_BASE_TOKEN: str = 'test'
LINE_TOKEN_WAGAYA: str = 'test'
MAIL_HOST: str = 'test'
MAIL_USER: str = 'test'
MAIL_PASSWORD: str = 'test'
MAIL_BOX: str = 'test'
class Config:
env_file = '.env'
env_file_encoding = ... | {"/tests/test_main.py": ["/main.py", "/utils/mailer.py", "/tests/helpers.py"], "/my_rules.sample.py": ["/env.py", "/models.py"], "/tests/helpers.py": ["/env.py", "/plugins/line.py", "/utils/mailer.py", "/models.py"], "/main.py": ["/env.py", "/models.py", "/plugins/line.py", "/utils/mailer.py", "/utils/logger.py"]} |
87,478 | samuelSavanovic/sentiment_analasys | refs/heads/master | /classifiers/classifier_decision_tree_neg.py | import nltk
from classifiers.decision_tree_most_informative_features import most_informative_features
from features.feature_set_builder import get_feature_set
train_set, test_set = get_feature_set("neg")
classifier = nltk.DecisionTreeClassifier.train(train_set)
features = most_informative_features(classifier, 15)
wi... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,479 | samuelSavanovic/sentiment_analasys | refs/heads/master | /features/feature_set_builder.py | import random
from nltk.corpus import PlaintextCorpusReader
from features.feature_extractors import *
corpus_root = '../corpus'
wordlists = PlaintextCorpusReader(corpus_root, '.*')
def get_feature_set(feature_space):
if feature_space == "pos":
return __feature_sets(features_pos)
elif feature_space =... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,480 | samuelSavanovic/sentiment_analasys | refs/heads/master | /features/reader.py | positive_words = {}
negative_words = {}
all_words = {}
with open("lexical_resource.txt") as f:
for line in f:
words = line.split()
if int(words[-1]) > 0:
positive_words[words[0]] = words[-1]
all_words[words[0]] = ("pos", words[-1])
else:
negative_words[wor... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,481 | samuelSavanovic/sentiment_analasys | refs/heads/master | /curpus_builder/corpus_builder.py | from scraping.goodreads_books import get_links
from scraping.scrapper import parse_comments
if __name__ == "__main__":
for l in get_links(10):
comments, dates = parse_comments(l)
i = 0
book_name = l.split('/')[-1].split('.')[-1]
for comment in comments:
print(comment)
... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,482 | samuelSavanovic/sentiment_analasys | refs/heads/master | /classifiers/decision_tree_most_informative_features.py | def most_informative_features(classifier, n):
classifier = [classifier]
features = []
i = 0
while len(features) < n:
if classifier[i]._fname != None and classifier[i]._fname not in features:
features.append(classifier[i]._fname)
for node in classifier[i]._decisions.values():
... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,483 | samuelSavanovic/sentiment_analasys | refs/heads/master | /classifiers/classifier_maxent_all.py | import nltk
from classifiers.maxent_most_informative_features import most_informative_features
from features.feature_set_builder import get_feature_set
train_set, test_set = get_feature_set("all")
classifier = nltk.MaxentClassifier.train(train_set)
with open("classifier_maxent_all.txt", "w") as f:
f.write("Accura... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,484 | samuelSavanovic/sentiment_analasys | refs/heads/master | /classifiers/classifier_bayes_neg.py | import nltk
from features.feature_set_builder import get_feature_set
train_set, test_set = get_feature_set("neg")
classifier = nltk.NaiveBayesClassifier.train(train_set)
with open("classifier_bayes_neg.txt", "w") as f:
f.write("Accuracy: " + str(nltk.classify.accuracy(classifier, test_set)))
f.write("\n")
... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,485 | samuelSavanovic/sentiment_analasys | refs/heads/master | /scraping/scrapper.py | import re
import requests
from bs4 import BeautifulSoup
from scraping.english_checker import is_english_text
def parse_comments(link):
url = requests.get(link)
content = url.text
soup = BeautifulSoup(content, 'html.parser')
comments = soup.find_all(id=re.compile('freeText\d'))
date = soup.find_a... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,486 | samuelSavanovic/sentiment_analasys | refs/heads/master | /scraping/goodreads_books.py | import re
import requests
from bs4 import BeautifulSoup
def get_links(count=50):
url = requests.get('http://www.goodreads.com/list/show/6.Best_Books_of_the_20th_Century')
content = url.text
soup = BeautifulSoup(content, 'html.parser')
links = soup.find_all('a', class_=re.compile("bookTitle"))
ret... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,487 | samuelSavanovic/sentiment_analasys | refs/heads/master | /classifiers/maxent_most_informative_features.py | def most_informative_features(classifier, n):
features = []
fids = sorted(list(range(len(classifier._weights))), key=lambda fid: abs(classifier._weights[fid]), reverse=True)
for fid in fids[:n]:
znacajnaZnacajka, _, _ = classifier._encoding.describe(fid).partition('==')
features.append(znaca... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,488 | samuelSavanovic/sentiment_analasys | refs/heads/master | /scraping/english_checker.py | from nltk.corpus import words as nltk_words
dictionary = dict.fromkeys(nltk_words.words(), None)
def is_english_word(word):
global dictionary
try:
x = dictionary[word]
return True
except KeyError:
return False
def count(lst):
cnt = 0
for i in lst:
if i == True:
... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,489 | samuelSavanovic/sentiment_analasys | refs/heads/master | /features/feature_extractors.py | from features.reader import positive_words, negative_words, all_words
def features_neg(text):
return __create_features_from_text(text, negative_words)
def features_pos(text):
return __create_features_from_text(text, positive_words)
def features_all(text):
return __create_features_from_text(text, all_w... | {"/classifiers/classifier_decision_tree_neg.py": ["/classifiers/decision_tree_most_informative_features.py", "/features/feature_set_builder.py"], "/features/feature_set_builder.py": ["/features/feature_extractors.py"], "/curpus_builder/corpus_builder.py": ["/scraping/goodreads_books.py", "/scraping/scrapper.py"], "/cla... |
87,491 | deadln/First-rep | refs/heads/master | /lesson/blog/models.py | from django.db import models
from django.contrib.auth.models import User #Lj,fdktybt vjltkb gjkmpjdfntkz
class Post(models.Model): #Создание класса поста
author = models.ForeignKey(User, blank = True, null = True, on_delete = models.CASCADE)
description = models.TextField()
# Create your models here.
| {"/lesson/blog/admin.py": ["/lesson/blog/models.py"], "/lesson/blog/views.py": ["/lesson/blog/models.py"], "/lesson/blog/urls.py": ["/lesson/blog/views.py"]} |
87,492 | deadln/First-rep | refs/heads/master | /lesson/blog/admin.py | from django.contrib import admin
from .models import Post #Импортирование модели поста
admin.site.register(Post) #Регистрация модели поста
| {"/lesson/blog/admin.py": ["/lesson/blog/models.py"], "/lesson/blog/views.py": ["/lesson/blog/models.py"], "/lesson/blog/urls.py": ["/lesson/blog/views.py"]} |
87,493 | deadln/First-rep | refs/heads/master | /lesson/blog/views.py | from django.shortcuts import render
from django.contrib.auth.models import User
# from django.http import HTTPResponse, HTTPRequest
from .models import Post
def post_list(request):
posts = Post.objects.all()
return render(request, 'posts.html', {'Posts': posts})
def user_posts(request, user):
# post... | {"/lesson/blog/admin.py": ["/lesson/blog/models.py"], "/lesson/blog/views.py": ["/lesson/blog/models.py"], "/lesson/blog/urls.py": ["/lesson/blog/views.py"]} |
87,494 | deadln/First-rep | refs/heads/master | /lesson/lesson/__init__.py | #Миграции являются отбражением всех внесенных в проект изменений. Следующие 2 команды нужно писать при каждом внесении
#изменений
#makemigrations - создание миграций
#migrate - добавление миграции в базу данных
#python manage.py createsuperuser - создание супер пользователя | {"/lesson/blog/admin.py": ["/lesson/blog/models.py"], "/lesson/blog/views.py": ["/lesson/blog/models.py"], "/lesson/blog/urls.py": ["/lesson/blog/views.py"]} |
87,495 | deadln/First-rep | refs/heads/master | /lesson/blog/urls.py | from django.urls import path
from .views import post_list, user_posts
urlpatterns = [
path('', post_list),
path('user/<user>/', user_posts),
] | {"/lesson/blog/admin.py": ["/lesson/blog/models.py"], "/lesson/blog/views.py": ["/lesson/blog/models.py"], "/lesson/blog/urls.py": ["/lesson/blog/views.py"]} |
87,503 | noirbee/console-component | refs/heads/master | /console/formatter/output_formatter_style.py | # -*- coding: utf-8 -*-
class OutputFormatterStyle(object):
FOREGROUND_COLORS = {
'black': 30,
'red': 31,
'green': 32,
'yellow': 33,
'blue': 34,
'magenta': 35,
'cyan': 36,
'white': 37
}
BACKGROUND_COLORS = {
'black': 40,
're... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,504 | noirbee/console-component | refs/heads/master | /console/input/input_definition.py | # -*- coding: utf-8 -*-
try:
import ujson as json
except ImportError:
import json
from ordereddict import OrderedDict
from input_option import InputOption
class InputDefinition(object):
def __init__(self, definition=None):
definition = definition or []
self.set_definition(definition)
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,505 | noirbee/console-component | refs/heads/master | /console/output/stream_output.py | # -*- coding: utf-8 -*-
import os
from output import Output
class StreamOutput(Output):
def __init__(self, stream, verbosity=Output.VERBOSITY_NORMAL, decorated=None, formatter=None):
self.stream = stream
if decorated is None:
decorated = self.has_color_support(decorated)
su... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,506 | noirbee/console-component | refs/heads/master | /console/helper/formatter_helper.py | # -*- coding: utf-8 -*-
from helper import Helper
from ..formatter.output_formatter import OutputFormatter
class FormatterHelper(Helper):
def format_section(self, section, message, style='info'):
return '<%s>[%s]</%s> %s' % (style, section, style, message)
def format_block(self, messages, style, la... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,507 | noirbee/console-component | refs/heads/master | /setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
__version__ = '0.9.0'
setup(
name = 'console',
license='MIT',
version = __version__,
description = 'A Python port of Symfony2 Console Component.',
author = 'Sébastien Eustace',
author_email = 'sebastien.eustace@gmail.com',
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,508 | noirbee/console-component | refs/heads/master | /tests/helper/test_dialog_helper.py | # -*- coding: utf-8 -*-
import StringIO
import re
from unittest import TestCase
from console.helper.dialog_helper import DialogHelper
from console.helper.helper_set import HelperSet
from console.helper.formatter_helper import FormatterHelper
from console.output.stream_output import StreamOutput
class DialogHelperTe... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,509 | noirbee/console-component | refs/heads/master | /tests/command/test_list_command.py | # -*- coding: utf-8 -*-
import re
from unittest import TestCase
from console.tester.command_tester import CommandTester
from console.application import Application
class ListCommandTest(TestCase):
def test_execute(self):
"""
ListCommand.execute() behaves properly
"""
application... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,510 | noirbee/console-component | refs/heads/master | /console/input/input_option.py | # -*- coding: utf-8 -*-
class InputOption(object):
"""
Represents a command line option.
"""
VALUE_NONE = 1
VALUE_REQUIRED = 2
VALUE_OPTIONAL = 4
VALUE_IS_ARRAY = 8
def __init__(self, name, shortcut=None, mode=None, description='', default=None):
"""
Constructor
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,511 | noirbee/console-component | refs/heads/master | /console/command/command.py | # -*- coding: utf-8 -*-
import re
import sys
from ..input.input import Input
from ..input.input_definition import InputDefinition
from ..input.input_argument import InputArgument
from ..input.input_option import InputOption
from ..output.output import Output
class CommandError(Exception):
pass
class Command(o... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,512 | noirbee/console-component | refs/heads/master | /console/helper/dialog_helper.py | # -*- coding: utf-8 -*-
import sys
import os
from helper import Helper
from ..formatter.output_formatter_style import OutputFormatterStyle
class DialogHelper(Helper):
"""
The Dialog class provides helpers to interact with the user.
"""
input_stream = None
stty = None
def select(self, outpu... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,513 | noirbee/console-component | refs/heads/master | /tests/command/test_command.py | # -*- coding: utf-8 -*-
import os
from unittest import TestCase
from console.command.command import Command
from console.application import Application
from console.input.input_definition import InputDefinition
from console.input.input_argument import InputArgument
from console.input.input_option import InputOption
fr... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,514 | noirbee/console-component | refs/heads/master | /console/input/input.py | # -*- coding: utf-8 -*-
from input_definition import InputDefinition
class Input(object):
interactive = True
def __init__(self, definition=None):
if definition is None:
self.arguments = {}
self.options = {}
self.definition = InputDefinition()
else:
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,515 | noirbee/console-component | refs/heads/master | /console/helper/helper.py | # -*- coding: utf-8 -*-
class Helper(object):
__helper_set = None
def set_helper_set(self, helper_set=None):
self.__helper_set = helper_set
def get_helper_set(self):
return self.__helper_set | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,516 | noirbee/console-component | refs/heads/master | /console/formatter/output_formatter_style_stack.py | # -*- coding: utf-8 -*-
from output_formatter_style import OutputFormatterStyle
class OutputFormatterStyleStack(object):
def __init__(self, empty_style=None):
self.empty_style = empty_style or OutputFormatterStyle()
self.reset()
def reset(self):
self.styles = list()
def push(se... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,517 | noirbee/console-component | refs/heads/master | /console/output/output.py | # -*- coding: utf-8 -*-
from ..formatter.output_formatter import OutputFormatter
class OutputError(Exception):
pass
class Output(object):
VERBOSITY_QUIET = 0
VERBOSITY_NORMAL = 1
VERBOSITY_VERBOSE = 2
OUTPUT_NORMAL = 0
OUTPUT_RAW = 1
OUTPUT_PLAIN = 2
def __init__(self, verbosity=... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,518 | noirbee/console-component | refs/heads/master | /console/helper/progress_helper.py | # -*- coding: utf-8 -*-
import time
import math
from helper import Helper
from ..output.output import Output
class ProgressHelper(Helper):
"""
The Progress class providers helpers to display progress output.
"""
FORMAT_QUIET = ' %percent%%'
FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%'
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,519 | noirbee/console-component | refs/heads/master | /console/command/list_command.py | # -*- coding: utf-8 -*-
from command import Command
from ..input.input_argument import InputArgument
from ..input.input_option import InputOption
from ..input.input_definition import InputDefinition
class ListCommand(Command):
def configure(self):
self.ignore_validation_errors()
self.set_name('... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,520 | noirbee/console-component | refs/heads/master | /console/formatter/output_formatter.py | # -*- coding: utf-8 -*-
import re
from output_formatter_style import OutputFormatterStyle
from output_formatter_style_stack import OutputFormatterStyleStack
class OutputFormatter(object):
FORMAT_PATTERN = '(?is)(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?:(?!\\\\?<).)*)'
def __init__(self, decorated=False, style... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,521 | noirbee/console-component | refs/heads/master | /console/application.py | # -*- coding: utf-8 -*-
import sys
import traceback
import Levenshtein
from output.output import Output
from output.console_output import ConsoleOutput
from input.argv_input import ArgvInput
from input.list_input import ListInput
from input.input_argument import InputArgument
from input.input_option import InputOption... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,522 | noirbee/console-component | refs/heads/master | /console/input/list_input.py | # -*- coding: utf-8 -*-
from .input import Input
class ListInput(Input):
"""
ListInput represents an input provided as an array.
Usage:
>>> input_ = ListInput([('name', 'foo'), ('--bar', 'foobar')])
"""
interactive = False
def __init__(self, parameters, definition=None):
"""
... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,523 | noirbee/console-component | refs/heads/master | /console/command/help_command.py | # -*- coding: utf-8 -*-
from command import Command
from ..input.input_argument import InputArgument
from ..input.input_option import InputOption
class HelpCommand(Command):
__commmand = None
def configure(self):
self.ignore_validation_errors()
self.set_name('help')\
.set_defin... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,524 | noirbee/console-component | refs/heads/master | /tests/tester/test_command_tester.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from console.tester.command_tester import CommandTester
from console.command.command import Command
from console.output.output import Output
class TestCommandTester(TestCase):
def setUp(self):
self.command = Command('foo')
self.command.add_ar... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,525 | noirbee/console-component | refs/heads/master | /console/output/console_output.py | # -*- coding: utf-8 -*-
import sys
from stream_output import StreamOutput
class ConsoleOutput(StreamOutput):
def __init__(self, verbosity=StreamOutput.VERBOSITY_NORMAL,
decorated=None, formatter=None):
output_stream = sys.stdout
super(ConsoleOutput, self).__init__(output_stream... | {"/console/helper/formatter_helper.py": ["/console/formatter/output_formatter.py"], "/tests/helper/test_dialog_helper.py": ["/console/helper/dialog_helper.py", "/console/helper/formatter_helper.py", "/console/output/stream_output.py"], "/tests/command/test_list_command.py": ["/console/application.py"], "/tests/command/... |
87,529 | Lasoko/gr3PSI | refs/heads/master | /cw2/file.py | class FileManager:
def __init__(self, file_name):
self.file_name = file_name
def read_file(self):
file = open(self.file_name)
data = file.read()
#print(plik)
file.close()
return data
def update_file(self, text_data):
file = open(self.file_name)
... | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,530 | Lasoko/gr3PSI | refs/heads/master | /cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py | from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import permissions
from rest_framework import status
from rest_framework import generics
from django.contrib.auth.models import Us... | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,531 | Lasoko/gr3PSI | refs/heads/master | /chuck_norris.py | from chucknorris.pronoun import nick_gender
def chuck(name):
return name + " is a " + nick_gender(name)
print(chuck("Marcel")) | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,532 | Lasoko/gr3PSI | refs/heads/master | /cw2/file_test.py | from cw2.file import FileManager
plik = FileManager(r'C:\Users\Krzysztof\PycharmProjects\gr3PSI\cw2\test.txt')
print(plik.read_file())
print(plik.update_file("Additional text to add to the end of the file.")) | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,533 | Lasoko/gr3PSI | refs/heads/master | /cw1/Zadanie8.py | student1 = (145881,"Cezary","Dobreńko")
student2 = (145882,"Marcin","Gałązka")
student3 = (145883,"Patryk","Chomik")
student4 = (145884,"Artur","Dymkowski")
student5 = (145885,"Zygmunt","Hajzer")
lista_studentow = [student1,student2,student3,student4,student5]
print(lista_studentow) | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,534 | Lasoko/gr3PSI | refs/heads/master | /cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py | from django.contrib import admin
from .models import *
admin.site.register(Pracownik)
admin.site.register(Zwierze)
admin.site.register(Umowa)
admin.site.register(Typ_Umowy)
admin.site.register(Boks)
| {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,535 | Lasoko/gr3PSI | refs/heads/master | /cw3/Schronisko_Dla_Zwierzat/Schronisko/migrations/0002_auto_20200130_0919.py | # Generated by Django 3.0.2 on 2020-01-30 08:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Schronisko', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='pracownik',
... | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,536 | Lasoko/gr3PSI | refs/heads/master | /cw1/zad13.py | imiona = dict({1:"Jan",2:"Adam",3:"Marian",4:"Antoni",5:"Karol"})
lista = [] | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,537 | Lasoko/gr3PSI | refs/heads/master | /cw3/Schronisko_Dla_Zwierzat/Schronisko/migrations/0003_auto_20200130_0922.py | # Generated by Django 3.0.2 on 2020-01-30 08:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Schronisko', '0002_auto_20200130_0919'),
]
operations = [
migrations.AlterField(
model_name='um... | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,538 | Lasoko/gr3PSI | refs/heads/master | /cw2/zad1.py | def fun(a_lista, b_lista):
return a_lista[1::2]+b_lista[0::2]
lista_ab = fun([12, 14, 11, 17, 22], [8, 4, 1, 2, 9])
print(lista_ab) | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
87,539 | Lasoko/gr3PSI | refs/heads/master | /cw3/Schronisko_Dla_Zwierzat/Schronisko/migrations/0001_initial.py | # Generated by Django 2.2.7 on 2019-11-14 13:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Boks',
fields=[
... | {"/cw3/Schronisko_Dla_Zwierzat/Schronisko/views.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py", "/cw3/Schronisko_Dla_Zwierzat/Schronisko/serializers.py"], "/cw2/file_test.py": ["/cw2/file.py"], "/cw3/Schronisko_Dla_Zwierzat/Schronisko/admin.py": ["/cw3/Schronisko_Dla_Zwierzat/Schronisko/models.py"], "/cw3/Sc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.