index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
64,380 | kaiergin/Quadcopter_simulator | refs/heads/master | /quad_sim.py | import quadcopter,gui,controller,q_controller
import signal
import sys
import argparse
import random
# Constants
TIME_SCALING = 0.0 # Any positive number(Smaller is faster). 1.0->Real Time, 0.0->Run as fast as possible
QUAD_DYNAMICS_UPDATE = 0.002 # seconds
CONTROLLER_DYNAMICS_UPDATE = 0.005 # seconds
global run
def ... | {"/quad_sim.py": ["/controller.py", "/q_controller.py"]} |
64,381 | kaiergin/Quadcopter_simulator | refs/heads/master | /q_controller.py | from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
import numpy as np
import random
from collections import deque
STATE_SIZE = 12
ACTION_SIZE = 4
LEARNING_RATE = 0.001
alpha = 0.01
class Q_Controller:
def __init__(self):
self.prev_action = [0 for x in rang... | {"/quad_sim.py": ["/controller.py", "/q_controller.py"]} |
64,382 | kaiergin/Quadcopter_simulator | refs/heads/master | /controller.py | import numpy as np
import math
import time
import threading
class Controller_AI():
def __init__(self, get_state, get_time, actuate_motors, params, quad_identifier, get_motor_speeds):
self.get_motor_speeds = get_motor_speeds
self.quad_identifier = quad_identifier
self.actuate_motors = actuat... | {"/quad_sim.py": ["/controller.py", "/q_controller.py"]} |
64,391 | Andy-O-Hung/zork | refs/heads/master | /Neighborhood.py | from House import *
from Observer import Observer
from random import *
# Neighborhood class, which extends the Observer class
class Neighborhood(Observer):
# Class constructor
def __init__(self):
Observer.__init__(self)
self.gridHeight = randint(2, 3)
self.gridWidth = randint(2, 3)
self.numMonsters = 0
se... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,392 | Andy-O-Hung/zork | refs/heads/master | /Game.py | from Neighborhood import *
from Player import *
from random import *
# This is the Game class, which will be running the game logic
class Game(object):
# Class constructor
# Initializes variables
def __init__(self):
# Neighborhood class instantiation
self.hood = Neighborhood()
# Get neighborhood grid, wh... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,393 | Andy-O-Hung/zork | refs/heads/master | /main.py | # Import the necessary files
# Note that not all classes are imported. This is because only the necessary ones are imported
# into the main, and then the other ones are imported into the other classes when necessary
from Player import *
from Neighborhood import *
from Game import *
# The main method of the game.
def... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,394 | Andy-O-Hung/zork | refs/heads/master | /Player.py | from random import *
from Weapons import *
#Player class which is the user for the game.
class Player(object):
def __init__(self):
self.health = randint(100, 125)
self.attackValue = randint(10, 20)
self.inventory = self.generateWeapons()
#Getter functions
def getHealth(self):
return self.heal... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,395 | Andy-O-Hung/zork | refs/heads/master | /House.py | from Npc import *
from Observer import *
from random import *
# House class, which extends both the observable and the observer class
# It observes all NPCs living within it, and it's also observed
# by the neighborhood class, which keeps track of the amount of total monsters
class House(Observer, Observable):
# Cl... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,396 | Andy-O-Hung/zork | refs/heads/master | /Weapons.py | from random import *
# Weapon parent class
class Weapon(object):
# Class constructor
# Initializes variables that are common to all weapons
def __init__(self):
self.name = ""
self.attackMod = 0
self.uses = 0
# Getter methods
# Returns weapon name
def getName(self):
return self.name
# Returns wea... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,397 | Andy-O-Hung/zork | refs/heads/master | /Npc.py | from Observer import Observable
from random import *
# Parent class, which extends the observable class
class Npc(Observable):
# Class constructor
# Initializes variables that are common to all NPC's
def __init__(self):
Observable.__init__(self)
self.name = ""
self.attackStrength = 0
self.healthPoints = ... | {"/Neighborhood.py": ["/House.py"], "/Player.py": ["/Weapons.py"], "/House.py": ["/Npc.py"]} |
64,413 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/category_encoder.py | '''
-------------------------------------------------------
Category Encoder - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.u... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,414 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/target_encoder.py | '''
-------------------------------------------------------
Target Encoder - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from warnings import warn
import numpy as np
from sklearn.base import BaseEstimator, Transfo... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,415 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/stack_regressor.py | '''
-------------------------------------------------------
Stack Regressor - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.utils.validation import... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,416 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/stack_classifier.py | '''
-------------------------------------------------------
Stack Classifier - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.validation impo... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,417 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/fold_lgbm.py | '''
-------------------------------------------------------
Fold LightGBM - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from copy import copy
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.uti... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,418 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/count_encoder.py | '''
-------------------------------------------------------
Count Encoder - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from warnings import warn
import numpy as np
from sklearn.base import BaseEstimator, Transfor... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,419 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/utils/__init__.py | '''
-------------------------------------------------------
Utils - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from .utils import compress_dataframe
__all__ = ['compress_dataframe']
| {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,420 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/__init__.py | '''
-------------------------------------------------------
Preprocessing - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from .category_encoder import CategoryEncoder
from .multi_column_encoder import MultiColumnEn... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,421 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/__init__.py | '''
-------------------------------------------------------
extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
__all__ = ['models',
'preprocessing',
'utils'] | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,422 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/__init__.py | '''
-------------------------------------------------------
Models - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from .fold_estimator import FoldEstimator
from .fold_lgbm import FoldLightGBM
from .stack_classifier... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,423 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/utils.py | '''
-------------------------------------------------------
Preprocessing Utils - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
import numpy as np
def is_object_array(X):
''' Check if an array is an object arra... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,424 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/fold_estimator.py | '''
-------------------------------------------------------
Fold Estimator - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from copy import copy
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.ut... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,425 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/models/fold_xgb.py | '''
-------------------------------------------------------
Fold XGBoost - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from copy import copy
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.util... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,426 | simon-larsson/extrakit-learn | refs/heads/master | /xklearn/preprocessing/multi_column_encoder.py | '''
-------------------------------------------------------
Multi-Column Encoder - extrakit-learn
Author: Simon Larsson <larssonsimon0@gmail.com>
License: MIT
-------------------------------------------------------
'''
from copy import copy
import numpy as np
from sklearn.utils.validation import check_ar... | {"/xklearn/preprocessing/category_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/target_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/count_encoder.py": ["/xklearn/preprocessing/utils.py"], "/xklearn/preprocessing/__init__.py": ["/xklearn/preprocessing/category_enc... |
64,428 | tcmoore3/ObitScraper | refs/heads/master | /master.py | # Python 2.7
import csv
import datetime
import random
import sys
import time
import pandas as pd
import requests
import obitscrape
start_time = datetime.datetime.now()
avoid_block_seconds = 2
discharge_date_cushion = -14
input_file = sys.argv[1]
output_file = sys.argv[2]
overwrite_output = sys.argv[3].lower() in ['... | {"/master.py": ["/obitscrape.py"]} |
64,429 | tcmoore3/ObitScraper | refs/heads/master | /obitscrape.py | # Python 2.7
import csv
import datetime
import json
import re
import requests
def findDeathDate(global_member_id, first_name, last_name, dob, discharge_date_cushion, discharge_date='NULL', state=''):
url = ('http://www.tributes.com/search/obituaries/?solr=&first=' + first_name + '&last=' + last_name
+ '&cit... | {"/master.py": ["/obitscrape.py"]} |
64,465 | Daniil-Kost/url_manager | refs/heads/development | /url_app/tests.py | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework.test import APIClient
from url_manager.urls import api_version
from url_app.models import Url
from .test_fixtures.mock_for_tests import URLS, post_success_data
from url_app import util
# Create your tests here.
class Api... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,466 | Daniil-Kost/url_manager | refs/heads/development | /url_app/views.py | from crispy_forms.layout import Submit
from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import FormActions
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django import forms
from django.contrib.auth import login
from django.views.generic import U... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,467 | Daniil-Kost/url_manager | refs/heads/development | /url_manager/urls.py | """url_manager URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,468 | Daniil-Kost/url_manager | refs/heads/development | /url_app/test_fixtures/mock_for_tests.py | from url_manager.settings import DEFAULT_DOMAIN
from url_app import util
URLS = [
("http://devacademy.ru/posts/ochered-soobschenij-i-asinhronnyie-zadachi-s-pomoschyu-celery-i-rabbitmq/",
f"{DEFAULT_DOMAIN}{util.short_url_generator()}"),
("https://docs.djangoproject.com/en/2.1/ref/models/querysets/",
... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,469 | Daniil-Kost/url_manager | refs/heads/development | /url_app/admin.py | from django.contrib import admin
from url_app.models import Url, Profile
# Register your models here.
admin.site.register(Url)
admin.site.register(Profile)
| {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,470 | Daniil-Kost/url_manager | refs/heads/development | /url_app/serializer.py | from rest_framework import serializers
from url_app.models import Url
class UrlSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Url
fields = ('uuid', 'url', 'title', 'short_url', 'clicks', 'create_dttm')
| {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,471 | Daniil-Kost/url_manager | refs/heads/development | /url_app/util.py | import shortuuid
from bs4 import BeautifulSoup
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
from urllib.request import urlopen
from urllib.error import HTTPError
from url_manager.settings impo... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,472 | Daniil-Kost/url_manager | refs/heads/development | /url_app/models.py | import uuid
from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from url_manager.settings import DEFAULT_DOMAIN
class Profile(models.Model):
"""To keep extra user data"""
use... | {"/url_app/tests.py": ["/url_manager/urls.py", "/url_app/models.py", "/url_app/test_fixtures/mock_for_tests.py"], "/url_app/views.py": ["/url_app/models.py", "/url_app/serializer.py"], "/url_manager/urls.py": ["/url_app/views.py"], "/url_app/admin.py": ["/url_app/models.py"], "/url_app/serializer.py": ["/url_app/models... |
64,473 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise8/Tools.py | def find_result(bot_a, bot_b):
result = ""
if bot_a == bot_b:
result = "tie"
elif bot_a == "rock" and bot_b == "paper":
result = "botB"
elif bot_a == "rock" and bot_b == "scissors":
result = "botA"
elif bot_b == "rock" and bot_a == "paper":
result = "botA"
elif b... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,474 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise9/exercise9.py | # Exercise 9
import random
import time
import re
pattern = r"^[-+]?[0-9]+$" # Pattern to find positive or negative or zero integer.
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
play_again = True # Boolean to restart the game after finishing.
user_input = None
while play_again is True and ... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,475 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise3/exercise3.py | # Exercise 3
import re
pattern1 = r"[-+]?[0-9]+" # Pattern to find positive or negative integer.
pattern2 = r"^[-+]?[0-9]+$" # Pattern to find one positive or negative integer.
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
print("\nExit keys: n, e, ex, exi, exit.\nType key + Enter to e... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,476 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise6/exercise6.py | # Exercise 6
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
print("Type exit key + Enter to exit" + 67*" " + "||exit keys: " + str(exit_keys) + "||\n")
while True: # Loop forever or until exit key is typed.
prompt = "Please, type a string and press enter"
user_input = input(prom... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,477 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise10/exercise10.py | # Exercise 10
import random
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
while True: # Loop forever or until exit key is typed.
print(44 * '-')
print('exit keys: ', exit_keys)
print(44 * '-')
print('\nPlease wait while the machine generates two random lists...')
alpha... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,478 | ZogopZ/Internship | refs/heads/master | /utilities/assets/spamMail/Tools.py | import datetime
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import getpass
working_dates = []
weekends = []
holidays = []
working_status = True
def get_working_dates(): ######################... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,479 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise1/exercise1.py | # Exercise 1
import re
import datetime
prompt = "Please, enter your name, age and copies separated by comma or space\n"
user_input = input(prompt) # Get user's input and store it as a string.
pattern = r'\w+' # This is the pattern that will be used with findall() below to separate the user_input.
input_list = re... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,480 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise7/exercise7.py | # Exercise 7
import random
import re
pattern = r"[-+]?[0-9]+" # Pattern to find positive or negative integers.
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
auto_keys = ("a", "au", "aut", "auto") # Use these keys to automatically generate a list of random integers.
print("Type exit key ... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,481 | ZogopZ/Internship | refs/heads/master | /PythonBonus/Bonus1/SoManyToday.py | # Calculates time left until date 13/05/2020 and time 17:00 EET UTC/GMT +2 hours.
# Also calculates how much money earned today and how much money earned since the start of the internship.
from datetime import timedelta
from PythonBonus.Bonus1.Tools import *
# Change above line with: from Tools import *
# if you wan... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,482 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise5/exercise5.py | # Exercise 5
import random
a_len = random.randrange(20) # Generate a random integer to represent the length of list a.
b_len = random.randrange(20) # Generate a random integer to represent the length of list b.
a = random.sample(range(1, 101), a_len) # Generate a list of a_len length with random integers in r... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,483 | ZogopZ/Internship | refs/heads/master | /PythonBonus/Bonus1/Tools.py | import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
working_dates = []
weekends = []
holidays = []
working_status = True
def get_working_dates(): #####################################
return working_dates # ... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,484 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise2/exercise2.py | # Exercise 2
import re
pattern = r"^[-+]?[0-9]+$" # Pattern to find positive or negative integer.
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
print("Exit keys: n, e, ex, exi, exit. Type key + Enter to exit")
while True: # Loop forever or until exit key is typed.
prompt = "Pleas... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,485 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise4/exercise4.py | # Exercise 4
import re
pattern = r"^[-+]?[0-9]+$" # Pattern to find positive or negative integer.
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
print("Type exit key + Enter to exit" + 67*" " + "||exit keys: " + str(exit_keys) + "||\n")
while True: # Loop forever or until exit key is ... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,486 | ZogopZ/Internship | refs/heads/master | /PythonExercises/Exercise8/exercise8.py | # Exercise 8
import random
from PythonExercises.Exercise8.Tools import find_result
exit_keys = ("n", "e", "ex", "exi", "exit") # Use these keys to exit.
rock_keys = ("r", "ro", "roc", "rock") # Use these keys to play rock.
paper_keys = ("p", "pa", "pap", "pape", "paper") # Use these keys to play paper.
scissor_key... | {"/PythonBonus/Bonus1/SoManyToday.py": ["/PythonBonus/Bonus1/Tools.py"], "/PythonExercises/Exercise8/exercise8.py": ["/PythonExercises/Exercise8/Tools.py"]} |
64,532 | arijitx/Appliances-Energy-Use-Prediction | refs/heads/master | /template.py | import numpy as np
import pandas as pd
### encode CSV To feature Matrix
def get_feature_matrix(file_path):
#imports
import time
def date2x(x):
k=(time.mktime(time.strptime(x, "%Y-%m-%d %H:%M:%S"))-time.mktime(time.strptime("2016-01-11 17:00:00", "%Y-%m-%d %H:%M:%S")))/600
k=k%1008
r... | {"/test.py": ["/template.py"]} |
64,533 | arijitx/Appliances-Energy-Use-Prediction | refs/heads/master | /test.py | import template as t
import pandas as pd
import numpy as np
phi=t.get_feature_matrix('data/train.csv')
print('DONE GENERATING FEATURES')
Y=t.get_output('data/train.csv')
print('DONE GENERATING OUTPUT')
wts=t.get_weight_vector(phi,Y,0.0,2)
print('DONE GENERATING WEIGHTS')
wts.dump('wts.pickl')
test_phi=t.get_feature_ma... | {"/test.py": ["/template.py"]} |
64,536 | somasekhar1/django | refs/heads/master | /app1/migrations/0001_initial.py | # Generated by Django 2.1.1 on 2019-02-01 11:49
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Employee',
fields=[
('id', models.IntegerFi... | {"/app1/views.py": ["/app1/models.py"]} |
64,537 | somasekhar1/django | refs/heads/master | /app1/models.py | from django.db import models
class Employee(models.Model):
id=models.IntegerField(primary_key=True)
name=models.CharField(max_length=50)
dob=models.DateField()
doj=models.DateField()
gender=models.CharField(max_length=10)
designition=models.CharField(max_length=40)
contact=models.IntegerFie... | {"/app1/views.py": ["/app1/models.py"]} |
64,538 | somasekhar1/django | refs/heads/master | /app1/views.py | import csv
from django.http import HttpResponse
from django.shortcuts import render,redirect
from .models import Employee
def showindex(request):
emp=Employee.objects.all()
return render(request,"index.html",{"employee":emp})
def savesetails(request):
id=request.POST.get("t1")
name=request.POST.get("t... | {"/app1/views.py": ["/app1/models.py"]} |
64,539 | malexit240/django-questions | refs/heads/master | /polls/models.py |
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField(verbose_name='date published... | {"/polls/views.py": ["/polls/models.py", "/polls/forms.py"], "/polls/forms.py": ["/polls/models.py"], "/polls/url.py": ["/polls/views.py"]} |
64,540 | malexit240/django-questions | refs/heads/master | /polls/views.py | from django.shortcuts import render
from django.http import (HttpResponse, Http404,
HttpResponseRedirect, HttpRequest)
from .models import Question, Choice
from django.template import loader
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_GET
from... | {"/polls/views.py": ["/polls/models.py", "/polls/forms.py"], "/polls/forms.py": ["/polls/models.py"], "/polls/url.py": ["/polls/views.py"]} |
64,541 | malexit240/django-questions | refs/heads/master | /polls/forms.py | from django import forms
from .models import Choice
class QuestionForm(forms.Form):
question_id = forms.IntegerField()
def celan(self):
return self.cleaned_data
class ChoiceModelForm(forms.ModelForm):
class Meta:
model = Choice
fields = ['quetion'] | {"/polls/views.py": ["/polls/models.py", "/polls/forms.py"], "/polls/forms.py": ["/polls/models.py"], "/polls/url.py": ["/polls/views.py"]} |
64,542 | malexit240/django-questions | refs/heads/master | /polls/url.py | from django.contrib import admin
from django.urls import path,include
from django.views.generic import View, TemplateView , RedirectView
from .views import *
app_name = 'polls'
urlpatterns = [
path('<int:question_id>/',DetailsView.as_view(),name='detail'),
path('<int:question_id>/result',result,name='re... | {"/polls/views.py": ["/polls/models.py", "/polls/forms.py"], "/polls/forms.py": ["/polls/models.py"], "/polls/url.py": ["/polls/views.py"]} |
64,545 | oyurimatheus/pythonfuncional | refs/heads/master | /gerenciador_de_gastos.py | from collections import Counter
from functools import reduce
import operator
import itertools
from gastos import Gasto
def abre_arquivo(arquivo, encoding='utf-8'):
with open(arquivo, encoding=encoding) as arquivo:
tuplas = map(_extrai_tipo_e_valor, arquivo)
return list(map(Gasto.de_tupla, tuplas... | {"/gerenciador_de_gastos.py": ["/gastos.py"], "/principal.py": ["/gerenciador_de_gastos.py", "/menu_ui.py"], "/menu_ui.py": ["/gerenciador_de_gastos.py"]} |
64,546 | oyurimatheus/pythonfuncional | refs/heads/master | /principal.py | import gerenciador_de_gastos
import menu_ui
if __name__ == '__main__':
arquivo = input('Digite o nome do arquivo que deseja abrir: ')
gastos = gerenciador_de_gastos.abre_arquivo(arquivo)
menu_ui.mostra_menu(gastos)
| {"/gerenciador_de_gastos.py": ["/gastos.py"], "/principal.py": ["/gerenciador_de_gastos.py", "/menu_ui.py"], "/menu_ui.py": ["/gerenciador_de_gastos.py"]} |
64,547 | oyurimatheus/pythonfuncional | refs/heads/master | /gastos.py | class Gasto:
def __init__(self, categoria, valor):
self.__categoria = categoria
self.__valor = valor
@property
def categoria(self):
return self.__categoria
@property
def valor(self):
return self.__valor
@staticmethod
def de_tupla(tupla):
categoria,... | {"/gerenciador_de_gastos.py": ["/gastos.py"], "/principal.py": ["/gerenciador_de_gastos.py", "/menu_ui.py"], "/menu_ui.py": ["/gerenciador_de_gastos.py"]} |
64,548 | oyurimatheus/pythonfuncional | refs/heads/master | /menu_ui.py | import gerenciador_de_gastos
def mostra_menu(gastos):
texto_do_menu = '''
OPÇÕES
1 - Total dos gastos
2 - Gastos mais frequentes
3 - Total de gastos de uma categoria
4 - Lista de gastos de uma categoria
5 - Listar os 5 maiores gastos
6 - Listar os 5 menores gastos
7 - Previsão dos gastos do próximo mês
0 - Sair ... | {"/gerenciador_de_gastos.py": ["/gastos.py"], "/principal.py": ["/gerenciador_de_gastos.py", "/menu_ui.py"], "/menu_ui.py": ["/gerenciador_de_gastos.py"]} |
64,563 | mbacchi/adminapi | refs/heads/master | /cloud_utils/net_utils/ip_tx.py | #!/usr/bin/python
"""
Simple IP packet generator/client test tool.
Provides very limited support for testing specific IP protocols. Primarily used to test
specific network paths in a cloud or data center traversing firewalls/security groups, nat points,
etc..
"""
from os.path import abspath, basename
from random import... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,564 | mbacchi/adminapi | refs/heads/master | /cloud_admin/cloudview/__init__.py |
import difflib
import json
import os
import yaml
from shutil import copyfile
from cloud_utils.system_utils.machine import Machine
class Namespace(object):
"""
Convert dict (if provided) into attributes and return a somewhat
generic object
"""
def __init__(self, **kwargs):
if kwargs:
... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,565 | mbacchi/adminapi | refs/heads/master | /cloud_admin/hosts/helpers/__init__.py |
class EucaMachineHelpers(object):
_helpername = None
def __init__(self, eucahost):
self.eucahost = eucahost
self.sys = eucahost.sys
self.log = eucahost.log
self.debug = self.log.debug
self.services = getattr(eucahost, 'services', [])
self.eucalyptus_conf = euca... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,566 | mbacchi/adminapi | refs/heads/master | /cloud_admin/systemconnection.py |
import copy
import logging
from prettytable import PrettyTable
import re
import threading
from cloud_admin.access.autocreds import AutoCreds
from cloud_admin.services.serviceconnection import ServiceConnection
from cloud_admin.hosts.eucahost import EucaHost
from cloud_utils.system_utils.machine import Machine
from clo... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,567 | mbacchi/adminapi | refs/heads/master | /cloud_utils/system_utils/__init__.py | import subprocess
def local(cmd):
"""
Run a command on the localhost
:param cmd: str representing the command to be run
:return: :raise: CalledProcessError on non-zero return code
"""
args = cmd.split()
process = subprocess.Popen(args, stdout=subprocess.PIPE, st... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,568 | mbacchi/adminapi | refs/heads/master | /cloud_admin/access/autocreds.py | """
AutoCreds is a convenience class which attempts to provide utilities for reading in
credentials data from multiple sources.
The auto_create flag (set to True by default) attempts to automatically produce credentials
based upon the information provided to this AutoCreds obj.
- If any ssh connect arguments (... | {"/cloud_admin/systemconnection.py": ["/cloud_admin/access/autocreds.py"]} |
64,579 | shubhams/stock-talk | refs/heads/master | /stocktalk/models/user.py | from flask_login import UserMixin
from stocktalk import db
class User(UserMixin, db.Document):
username = db.StringField()
password = db.StringField()
meta = {'collection':'users'}
class UserSymbols(db.Document):
username = db.StringField()
symbols = db.ListField(db.StringField())
meta = {'collection': 'user_... | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,580 | shubhams/stock-talk | refs/heads/master | /stocktalk/helpers.py | import requests
from stocktalk import app
from stocktalk.constants.app_constants import ALPHA_VANTAGE_URLS
def get_search_results(keywords):
key_val = {
'function': ALPHA_VANTAGE_URLS.FUNCTIONS.SYMBOL_SEARCH,
'keywords': keywords,
'apikey': app.config['ALPHA_VANTAGE_KEY']
}
r = requests.get(ALPHA_VANTAGE_UR... | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,581 | shubhams/stock-talk | refs/heads/master | /stocktalk/models/forms.py | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import InputRequired, Length, EqualTo
class RegForm(FlaskForm):
username = StringField('username', validators=[InputRequired(), Length(max=30)])
password = PasswordField('password', validators=[Input... | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,582 | shubhams/stock-talk | refs/heads/master | /stocktalk/routes.py | from flask import request, redirect, url_for, render_template, json
from flask_login import current_user, login_user, login_required, logout_user
from mongoengine import DoesNotExist
from werkzeug.security import generate_password_hash, check_password_hash
from stocktalk import app, User
from stocktalk.helpers import ... | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,583 | shubhams/stock-talk | refs/heads/master | /stocktalk/constants/app_constants.py | class APP_CONSTANTS:
CONFIG_FROM_ENV = 'YOURAPPLICATION_SETTINGS'
class DB_CONSTANTS:
USER_COLLECTION = 'users'
class ALPHA_VANTAGE_URLS:
BASE_URL = 'https://www.alphavantage.co/query'
class FUNCTIONS:
SYMBOL_SEARCH = 'SYMBOL_SEARCH'
TIME_SERIES_INTRADAY = 'TIME_SERIES_INTRADAY' | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,584 | shubhams/stock-talk | refs/heads/master | /stocktalk/__init__.py | from flask import Flask
from flask_mongoengine import MongoEngine
from flask_wtf.csrf import CSRFProtect
from flask_login import LoginManager
from stocktalk.constants.app_constants import APP_CONSTANTS
app = Flask(__name__)
app.config.from_envvar(APP_CONSTANTS.CONFIG_FROM_ENV)
csrf = CSRFProtect()
db = MongoEngine(... | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,585 | shubhams/stock-talk | refs/heads/master | /stocktalk/config/dev.py | MONGODB_SETTINGS = {
'db': 'stock_talk',
'host': 'localhost',
'port': 27017
}
SECRET_KEY = b'XXXXXXXXXXXXXXXXXXXX'
ALPHA_VANTAGE_KEY = 'XXXXXXXXXXXXXXXXXXX' | {"/stocktalk/models/user.py": ["/stocktalk/__init__.py"], "/stocktalk/helpers.py": ["/stocktalk/__init__.py", "/stocktalk/constants/app_constants.py"], "/stocktalk/routes.py": ["/stocktalk/__init__.py", "/stocktalk/helpers.py", "/stocktalk/models/forms.py", "/stocktalk/models/user.py"], "/stocktalk/__init__.py": ["/sto... |
64,586 | divyekant/slackCTCommands | refs/heads/master | /errorHandling.py | import Constants
import slackAlert
error_url = ""
def exit_code():
quit()
def setErrorURL(url):
global error_url
error_url = url
def handleError(errorMessage):
if errorMessage == Constants.error_command_not_matched:
slackAlert.simpleMessage(Constants.error_command_not_matched_message, err... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,587 | divyekant/slackCTCommands | refs/heads/master | /slackAlert.py | import json
import urllib
import requests
def simpleMessagetoChannel(data, url):
payload = {
"response_type": "in_channel",
"text": data
}
headers = {
'Content-Type': "application/json",
}
response = requests.request("POST", url, data=json.dumps(payload), headers=headers)
... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,588 | divyekant/slackCTCommands | refs/heads/master | /trendsAPI.py | import requests
import time
import Constants
def queryCall(eventName, accid, accpc, dfrom, dto, trendType, uniqueFlag):
url = "https://api.clevertap.com/1/counts/trends.json"
payload = "{\"event_name\":\"%s\",\"from\":%s,\"to\":%s,\"unique\":%s,\"groups\":{\"foo\":{\"trend_type\":\"%s\"}}}" % (
eventName... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,589 | divyekant/slackCTCommands | refs/heads/master | /Constants.py | # All command Match Templates
trend_base_template_with_property3 = "Show me the (.*) of (.*) where (.*) in the last (.*) days with (.*) and (.*)"
trend_base_template_with_property4 = "Show me the (.*) for (.*) where (.*) in the last (.*) days with (.*) and (.*)"
trend_base_template_with_property5 = "Show me (.*) of (.... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,590 | divyekant/slackCTCommands | refs/heads/master | /commandInterpreter.py | import re
import Constants
def getCommandKeys(text):
templates = Constants.command_templates
isTokenSet = False
for template in templates:
tokens = re.match(template, text)
if tokens is not None:
isTokenSet = True
break
if not isTokenSet:
return Constan... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,591 | divyekant/slackCTCommands | refs/heads/master | /CTAPIConverter.py | import Constants
import datetime
import errorHandling
def generateObject(commandObject):
CTAPIObject = {}
commandObjectKeys = commandObject.keys()
hasTrendsAPIKeysCheck(commandObjectKeys)
if commandObject[Constants.command_type].lower() == Constants.trend:
for i in range(0, len(commandObjec... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,592 | divyekant/slackCTCommands | refs/heads/master | /chartGenerater.py | import datetime
import Constants
def generateChart(CTData, cType):
chart = {}
if cType.lower() == Constants.trend:
CTData = runDataCleaner(CTData, Constants.trend)
chart = generateLineChart(CTData)
return chart
def generateLineChart(data):
line_data = []
value_data = []
for k... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,593 | divyekant/slackCTCommands | refs/heads/master | /lambda_function.py | import CTAPIConverter
import Constants
import chartGenerater
import errorHandling
import trendsAPI
import urllib
import slackAlert
import commandInterpreter
def lambda_handler(event, context):
payload = convertBodytoJSON(event["body"])
response_url = getURL(payload, "response_url")
errorHandling.setError... | {"/errorHandling.py": ["/Constants.py", "/slackAlert.py"], "/commandInterpreter.py": ["/Constants.py"], "/CTAPIConverter.py": ["/Constants.py", "/errorHandling.py"], "/chartGenerater.py": ["/Constants.py"], "/lambda_function.py": ["/CTAPIConverter.py", "/Constants.py", "/chartGenerater.py", "/errorHandling.py", "/trend... |
64,594 | zavyalovdv/django_hospital | refs/heads/main | /patient/migrations/0007_auto_20210411_2123.py | # Generated by Django 3.0.8 on 2021-04-11 18:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patient', '0006_auto_20210406_2340'),
]
operations = [
migrations.AlterField(
model_name='historicalpatient',
name='... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,595 | zavyalovdv/django_hospital | refs/heads/main | /patient/tests/models/test_api.py | from django.urls import reverse
from rest_framework.test import APITestCase
class BooksApitestCase(APITestCase):
def test_get(self):
url = '/api/patients/'
print(url)
response = self.client.get(url)
print(response.data)
| {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,596 | zavyalovdv/django_hospital | refs/heads/main | /patient/migrations/0004_auto_20210402_0010.py | # Generated by Django 3.0.8 on 2021-04-01 21:10
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patient', '0003_auto_20210401_2351'),
]
operations = [
migrations.AlterField(
model_name='movement... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,597 | zavyalovdv/django_hospital | refs/heads/main | /patient/authentification.py | from django.shortcuts import render, redirect
from django.contrib.auth import login, logout
from .forms import UserLoginForm
def user_login(request):
if request.method == 'POST':
form = UserLoginForm(data=request.POST)
if form.is_valid():
user = form.get_user()
login(reques... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,598 | zavyalovdv/django_hospital | refs/heads/main | /patient/admin.py | from django.contrib import admin
from .models import *
class PatientAdmin(admin.ModelAdmin):
list_display = ('social_security_number', 'surname', 'name', 'second_name', 'current_status', 'ward',
'department', 'severity_disease', 'is_discharged')
list_display_links = ('social_security_numbe... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,599 | zavyalovdv/django_hospital | refs/heads/main | /patient/const/MODELS_CONST.py | from django.core.validators import RegexValidator
""" ENUM поле для пола пациента """
# UNKNOWN_SEX = '0'
# MAN_SEX = '1'
# WOMAN_SEX = '2'
# NOT_APPLICABLE_SEX = '9'
SEX = [
('неизвестно', 'Неизвестно'),
('мужской', 'Мужской'),
('женский', 'Женский'),
('неприменимо', 'Неприменимо'),
]
""" ENUM поле д... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,600 | zavyalovdv/django_hospital | refs/heads/main | /patient/migrations/0005_auto_20210402_0011.py | # Generated by Django 3.0.8 on 2021-04-01 21:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patient', '0004_auto_20210402_0010'),
]
operations = [
migrations.AlterField(
model_name='movement... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,601 | zavyalovdv/django_hospital | refs/heads/main | /patient/templatetags/patient_tags.py | from django import template
from patient.models import *
register = template.Library()
@register.simple_tag()
def get_patients():
return Patient.objects.all()
@register.simple_tag()
def get_doctors():
return Doctor.objects.all()
@register.simple_tag()
def get_departments():
return Department.objects.... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,602 | zavyalovdv/django_hospital | refs/heads/main | /patient/signals.py | from hospital.models import Patient
from django.dispatch import receiver
from django.signals import pre_save, post_save
@receiver(models.signals.pre_save)
def pre_add_movement_history(instance, sender, *args, **kwargs):
print('PRE_SAVE:')
print(sender)
print(instance)
@receiver(models.signals.post_save)
... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,603 | zavyalovdv/django_hospital | refs/heads/main | /patient/forms.py | from django import forms
from .models import *
from django.core.exceptions import ValidationError
from django.contrib.auth.forms import AuthenticationForm
import re
class PatientForm(forms.ModelForm):
admitted_hospital_date = forms.DateTimeField(
label='Дата поступления в больницу', input_formats=['%Y-%m-... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,604 | zavyalovdv/django_hospital | refs/heads/main | /patient/migrations/0001_initial.py | # Generated by Django 3.0.8 on 2021-03-31 20:12
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swa... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,605 | zavyalovdv/django_hospital | refs/heads/main | /patient/tests/urls/tests.py | import unittest
from django.test import Client
class SimpleLoginTest(unittest.TestCase):
def test_home(self):
client = Client()
response = client.get('/')
self.assertEqual(response.status_code, 200)
def test_admin(self):
client = Client()
response = client.get('/ad... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,606 | zavyalovdv/django_hospital | refs/heads/main | /patient/api/urls.py | from django.urls import path
from .views import *
urlpatterns = [
path('patients/', APIPatientsListView.as_view(), name='api_patients'),
path('patient/<int:pk>/', APIPatientDetailView.as_view(), name='api_patient'),
path('doctors/', APIDoctorsListView.as_view(), name='api_doctors'),
path('doctor/<int:... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,607 | zavyalovdv/django_hospital | refs/heads/main | /patient/views.py | from django.shortcuts import render, redirect, HttpResponse, get_object_or_404
from django.views.generic.edit import CreateView, UpdateView
from django.views.generic import ListView, DetailView, DeleteView, FormView
from django.views.generic.detail import SingleObjectMixin
from django.dispatch import receiver
from djan... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,608 | zavyalovdv/django_hospital | refs/heads/main | /patient/models.py | import logging
from django.db import models
from .const.MODELS_CONST import *
from django.core.validators import RegexValidator
from django.urls import reverse
from simple_history.models import HistoricalRecords
from django.utils import timezone
from django.core.exceptions import ObjectDoesNotExist
logger = logging.... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,609 | zavyalovdv/django_hospital | refs/heads/main | /hospital/settings.py | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('django_hospital_secret_key')
DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,610 | zavyalovdv/django_hospital | refs/heads/main | /hospital/celery.py | import os
import subprocess
from celery import Celery
from celery.schedules import crontab
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hospital.settings')
app = Celery("hospital", broker='redis://redis:6379/0')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
64,611 | zavyalovdv/django_hospital | refs/heads/main | /patient/access.py | import re
from django.conf import settings
from django.contrib.auth.decorators import login_required
class RequireLoginMiddleware(object):
def __init__(self):
self.required = tuple(re.compile(url) for url in settings.LOGIN_REQUIRED_URLS)
self.exceptions = tuple(re.compile(url) for url in setting... | {"/patient/authentification.py": ["/patient/forms.py"], "/patient/admin.py": ["/patient/models.py"], "/patient/templatetags/patient_tags.py": ["/patient/models.py"], "/patient/forms.py": ["/patient/models.py"], "/patient/api/urls.py": ["/patient/api/views.py"], "/patient/views.py": ["/patient/models.py", "/patient/form... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.