blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
6bdf9d22a1d4d0ab8c9c497705023b520ea12137 | 10f05e97aca5f7b1b711030925bf79d756f89ded | Sherinkthomas07/Internship-Program-Python---Inoovation-Incubator | /Reading Using Pandas/Sher_csv2/celery.py | Python | py | 244 | no_license | import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Sher_csv2.settings')
csv_app2 = Celery('Sher_csv2')
csv_app2.config_from_object('django.conf:settings', namespace='CELERY')
csv_app2.autodiscover_tasks()
|
cc0073d40ffff6f9f7639e61c1550903caaa08e3 | f60476a391a2e40139be969c1a967cc4581ff68b | juju/jenkins-github-lander | /src/jenkinsgithublander/logger.py | Python | py | 590 | no_license | import logging
import os
LOGGER = None
def setup_custom_logger(name, level):
global LOGGER
formatter = logging.Formatter(
fmt='%(asctime)s - %(levelname)s - %(module)s - %(message)s')
handler = logging.FileHandler("{}/{}.log".format(
os.getenv('HOME'), name))
handler.setFormatter(for... |
94a1da0794808d9d75188ce1846342e48d393416 | 38a7cd84229e6d648dee913028361de285623502 | GregLahaye/masterylevels | /update.py | Python | py | 1,119 | no_license | import requests
import json
def update_config():
r = requests.get(VERSION_URL)
if r.status_code == 200:
content = r.json()
with open("config.json", "r") as file:
config = json.load(file)
for key in VERSION_KEYS:
config["version"][key] = content["n"][key]
... |
9b9200cb87aa9c47db78b428ea8b78e6b9afcd82 | 89286c061dc756f7397b7d623b51a278e5d3b4ba | labsland/labmanager | /alembic/versions/105c1c44ff70_login_is_not_nullabl.py | Python | py | 832 | permissive | """login is not nullable
Revision ID: 105c1c44ff70
Revises: 2003c675a267
Create Date: 2013-12-09 10:52:50.646000
"""
# revision identifiers, used by Alembic.
revision = '105c1c44ff70'
down_revision = '2003c675a267'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
... |
7ef447150749205f4ba322b609e2601972d5ed02 | 726e15267d4a9d2f5afcc5b77156ad62151eed9e | alexmorenoec/turing-test-v2 | /subject.py | Python | py | 8,372 | no_license | from config import *
from helper import chat_tag, info_message, get_header, get_chat_line_separator
from http.client import HTTPConnection
import socket
import time
import sys
def connect_to_tester():
"""
Connect to the tester
Returns:
HTTPConnection: A connection to the tester
"""
while... |
3a4cc25174895c660f43e3a123435c151f44d72a | 6924933b5a87c4c71bd229a54eefe55806458856 | billaanil3/crownstack | /exchange_currency/views.py | Python | py | 974 | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import HttpResponse
from django.shortcuts import render
from django.shortcuts import render
from .models import Currency
import requests
import json
import ast
# Create your views here.
def currency_details(request):
"""
get/sh... |
35e70c031ef3cb9368f1df97dd9c39fc454cda21 | 2ecf0b4fc90e2567524da9659b087ea4575126c4 | LynxieBoo/Selenium-Python-Stepic-course | /required_fields.py | Python | py | 1,729 | no_license | from selenium import webdriver
import time
link = "http://suninjuly.github.io/registration1.html"
browser = webdriver.Chrome()
try:
browser.get(link)
# Ваш код, который заполняет обязательные поля
# имя
input_name = browser.find_element_by_css_selector(".first[required]")
input_name.send_keys('M... |
445931ca4c8caae62e277d242ea55962ecd821d5 | f8bb880a77214719254c1812e79b7905701f6a60 | wamonite/configmate | /tests/conftest.py | Python | py | 1,214 | permissive | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import logging
import pytest
from tempfile import mkdtemp
import os
from shutil import rmtree
LOG_LEVEL = logging.INFO
LOG_FORMAT = '%(name)s %(levelname)s: %(message)s'
LOG_FORMAT_DATE = '%Y-%m-%d %H:%M:%S'
logger = logging.getLogger(... |
c1b6b8b1402282be28a416cdeff0a93a34a512c5 | 4063c9a3b45158f766043d35eca4ff0d004a0fc9 | GPrathap/utilities | /python/GreedyClustering.py | Python | py | 3,054 | permissive | def GrowCluster ( intensity, cluster, mask, k ):
newcluster = cluster
#find boundary of current cluster
indexes = np.nonzero( np.logical_and(mask, (np.logical_not(newcluster))))
while indexes :
growingboundary = 0 * cluster
for kk in range ( len (indexes[0] ) ):
i = indexes[0... |
612cfbd44c7a10a89d40d65c031a7758c1e7bf59 | 76a17ffdfdbf4eb26fa2173cdac820573056a752 | GoldLabGrapeSPEC/QScout | /qscout_utils.py | Python | py | 2,759 | no_license | from PyQt5.QtCore import QVariant
import numpy as np
import math
DIRECTION_RIGHT = 0
DIRECTION_UP = 1
DIRECTION_LEFT = 2
DIRECTION_DOWN = 3
NUM_DIRECTIONS = 4
DIRECTIONS = (
(1, 0),
(0, 1),
(-1, 0),
(0, -1)
)
# for converting from numpy types to QVariants used by QGIS or Python data types that go into... |
e5d18d801e3295027ba2c781142ec7f21dc74fc1 | 6569f2bcd0a7192654590fc52247db75a23182fb | kumasento/VELVET-PROGRAMMING | /Python/HttpRequest/request_wsthw.py | Python | py | 2,960 | no_license | #!/usr/bin/python
#-*- coding: utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from HTMLParser import HTMLParser
from time import sleep
import time
import re
import requests
FROM_EMAIL_HOST = "mail.pku.edu.cn"
EMAIL_USER = "1200012778"
EMAIL_PASSWD = "Mima484860"
TO_EMAIL = "vincentzhaorz@pku.edu.c... |
6749e2580d275a2c229aa561ab1a75af301a7e67 | acf8a09e793314ca3e5f59d56056750f918868ed | wildyslothin/TextBased-Mess | /basic_fighter.py | Python | py | 1,830 | no_license | # Most basic fantasy combat simulator
import random
p_health = 5
g_health = 5
goblin_alive = True
def status():
if g_health == 5:
return "\nA menacing goblin stands before you..."
elif g_health >= 3:
return "\nThe goblin is looking a little tired, and is bleeding..."
elif g_health >= 1:
... |
5181a3e16fc3924941fda4eae75beb7f8f6a5193 | 85d6a009c48e280fa1c49ad2410c89a58c37ab1b | ipchecker/ipchecker | /main.py | Python | py | 687 | no_license | import re
import os
import time
def main():
os.system("rm ifconfig.out")
os.system("ifconfig ppp0 | cat >> ifconfig.out")
os.system("ifconfig en0 | cat >> ifconfig.out")
os.system("ifconfig en1 | cat >> ifconfig.out")
os.system("ifconfig en2 | cat >> ifconfig.out")
f = open("ifconfig.out")
... |
0e2b6b6c2b7da2f32b35f76add8f98264a4e2a15 | b2fdab9224c9dda10b966fa89f2a3634748cbc33 | gargana/taskcat | /tests/test_amiupdater.py | Python | py | 38,672 | permissive | import logging
import re
import tempfile
import unittest
from datetime import datetime
from pathlib import Path
from unittest.mock import patch, sentinel
import requests
import mock
from taskcat._amiupdater import (
REGION_REGEX,
AMIUpdater,
AMIUpdaterCommitNeededException,
AMIUpdaterFatalException,
... |
06e3c65b416d168ac799e88bf1433517aa113cea | 0c77b0cb19eb1df6e4ace6cbd45b7206174378a4 | lyiker/leetcode | /leetcode-py/leetcode148.py | Python | py | 2,056 | no_license | # # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
# class Solution:
# # @param {ListNode} head
# # @return {ListNode}
# def sortList(self, head):
# if not head:
# return []
# return self.fastSort(head)
... |
035ccbc7be0e6ae02d26a50ab856b7f43a6c8fe5 | 7068ed31675f239ee65443354c98dd0ccd5d35d4 | paytaa/nubip | /task 2.py | Python | py | 7,470 | no_license | # Підключаємо графічну та математичну бібліотеки
import tkinter
import math
# Функції, які відповідають за введення та виконання стандартних операцій
def add_digit(digit):
value = count.get()
if value[0] == '0':
value = value[1:]
count.delete(0, tkinter.END)
count.insert(0, valu... |
b8eed09951ad2fd465358af4a4e80077cf071f7c | 56d9044c40cbaf5c9f8075ae793b96096f788273 | hyeonahkiki/board_restart | /todos/urls.py | Python | py | 363 | no_license | from django.urls import path
from . import views
app_name = 'todos'
urlpatterns = [
path('', views.index, name="index"),
path('new/', views.new, name="new"),
path('create/', views.create, name="create"),
path('add/', views.add, name="add"),
path('<int:id>/delete/', views.delete, name="delete"),
path('<int:id>... |
cd04875743f822e5cbd808365a182230ba83a1c3 | 4e8006576c52684fb78c6401efbbb541d6c9c72e | maazsabahuddin/Sawari-Backend | /A/settings/base.py | Python | py | 6,957 | no_license | """
Django settings for A project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
import r... |
edd8f7ca1bbc0771dd4404e69475f15bbdb553de | bb0ffad29c1cdef59301a7bcf8ff6ba6760cf3b8 | PaoloRanzi81/test_1 | /403_bayesian_hbm_20210112/slave_scripts/bayesian_hbm_403_01_training.py | Python | py | 57,002 | no_license |
"""
TITLE: "Hierarchical Bayesian Logistic Regression for predicting
four different video trailers"
AUTHOR: Paolo Ranzi
PYTHON VERSION: 3.6.9
DESCRIPTION:
Please change the following sections according to your individual input preferences:
- '2. PARAMETERS TO BE SET!!!'
"""
################################... |
fc1845ebe8b7a3bab223bd86f9f47766d2eeab34 | c175b78dade84641678d11b8cf977fd8374585b4 | GtechGovind/Sentance-generator | /Data/Complex/sentence/libraries/lsystem/__init__.py | Python | py | 9,893 | permissive | ### CREDITS ##########################################################################################
# Copyright (c) 2007 Frederik De Bleser.
# See LICENSE.txt for details.
__author__ = "Frederik De Bleser, Mark Meyer, Tom De Smedt"
__version__ = "1.9.3"
__copyright__ = "Copyright (c) 2007 Frederik De Bleser"
... |
2682124b221dd12488625240a12755837f5dd6af | 65da0215075c737266bacf7405aaa36eb16e96d0 | a7r3/CollegeStuffs | /OSTL/queue.py | Python | py | 741 | no_license | class Queue:
def __init__(self, length):
self.q = list()
self.length = length
self.front = -1
self.rear = -1
def insert(self, data):
if self.rear == -1 and self.front == -1:
self.q.append(data)
self.rear = 0
self.front = 0
print("Queue Init")
elif self.rear < self.length:
self.q.append(da... |
20283a61eccb8a7a52d13d6029546e601937f589 | ede4cb58a115d51544b74c19111bf6f415215841 | nafur/pydelta | /scripts/compare_time.py | Python | py | 1,419 | permissive | #!/usr/bin/env python3
import signal
import subprocess
import sys
import time
filename = sys.argv[1]
solvers = {
'A': ['solverA', '--option'],
'B': ['solverB', '--option'],
}
# minimal factor between the faster and the slower solver
threshold = 10
slow = 'A'
dur = {}
CUR_PROC = None
def stop_process(proc... |
f1dcceac915cf8a584c4d0b75c384c4512c0d262 | 13430ba125f5c7fa3438d912a4b668f1d14f81a9 | willson5127/AbiUbuTryO | /Python/opencv practice/數值的運算結果_I.py | Python | py | 465 | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 14:24:09 2020
@author: willson
array add process
"""
import cv2
import numpy as np
img1 = np.ones((4, 4), dtype = np.uint8) * 3
img2 = np.ones((4, 4), dtype = np.uint8) * 5
print("img1 = \n", img1)
print("img2 = \n", img2)
img3 = cv2.add(img1, img2)
print("cv2.add(im... |
d106e3606cbf338941eddb1bd120d80d0e6000f3 | 073d4704d1c2b50b8fb466cee0845e7c931d64ae | anjali-dhanuka/post_jobs | /jobposter/models.py | Python | py | 479 | no_license | from django.db import models
# Create your models here.
class postjobs(models.Model):
Job_title = models.CharField(max_length = 100)
slug = models.SlugField()
Job_Description = models.TextField()
Experience = models.CharField(max_length = 100)
Location = models.CharField(max_length = 100)
Salar... |
ed272214e12228923c1cea1d5c6e84d50594bdd1 | 3191569442fc3742c42435ba67822464b682ecda | bkawan/tldextract | /setup.py | Python | py | 2,996 | no_license | """`tldextract` accurately separates the gTLD or ccTLD (generic or country code
top-level domain) from the registered domain and subdomains of a URL.
>>> import tldextract
>>> tldextract.extract('http://forums.news.cnn.com/')
ExtractResult(subdomain='forums.news', domain='cnn', suffix='com')
>>> tldext... |
04bcca777a7f3942ec53331a5475a55ec04b1047 | 183c473a60ffae789038ed70c4f7d53d6eb8ca80 | victorsemenov1980/Coding-challenges | /LeetCodeInterviewCollections/Easy/TwoSum.py | Python | py | 908 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 4 22:02:49 2020
@author: user
"""
'''
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element ... |
237cd0abf151a94d81ee3dad10b83d3e16c9664d | 50bfe939e0687936c077d2902d90743bca43088e | Xu109/data_science | /智能风控-梅子行/64353 智能风控_源码及数据_2010/智能风控(代码)/第2章/2.7.py | Python | py | 10,055 | no_license | import pandas as pd
from sklearn.metrics import roc_auc_score,roc_curve,auc
from sklearn import metrics
from sklearn.linear_model import LogisticRegression
import numpy as np
data = pd.read_csv('Acard.txt')
data.head()
data.obs_mth.unique()
train = data[data.obs_mth != '2018-11-30'].reset_index().copy() ... |
fa541353dfd5d957213b0c113e0df0cf4ba6f06c | facf5fa740c3aa8b671a709e091251440830a321 | danielegrattarola/spektral | /tests/test_layers/convolutional/test_general_conv.py | Python | py | 359 | permissive | from core import MODES, run_layer
from spektral import layers
config = {
"layer": layers.GeneralConv,
"modes": [MODES["SINGLE"], MODES["MIXED"]],
"kwargs": {"channels": 256},
"dense": False,
"sparse": True,
"edges": False,
}
def test_layer():
run_layer(config)
config["kwargs"]["activ... |
310cde1dca53a5fc917020cc50d95069d9417a0c | 0ece7760cdfdd4d40343396d8899f61e6581d041 | SyneRBI/SIRF-Exercises | /notebooks/Deep_Learning_PET/odl_funcs/ellipses.py | Python | py | 2,519 | permissive | # Author: Imraj Singh
# First version: 21st of May 2022
# CCP SyneRBI Synergistic Image Reconstruction Framework (SIRF).
# Copyright 2022 University College London.
# This is software developed for the Collaborative Computational Project in Synergistic Reconstruction for Biomedical Imaging (http://www.ccpsynerbi.ac.... |
25811a264e11578241af328b3449103366e00310 | 82bdbf811ac1c153b640853724dad06852a63e88 | udwivedi394/djangoProjects | /hungerExpress/hungerExpress/wsgi.py | Python | py | 403 | no_license | """
WSGI config for hungerExpress project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... |
5f1d80b7e752dd6bc16d4ce0213703855af4f783 | f6d45c03d61fa494438dfb2d3be55f5716ee2eb8 | yareek/django-app | /blog/migrations/0001_initial.py | Python | py | 908 | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... |
f52c3d7cee6531a765da191f73a004a94ae3f50b | bfd292ee42e2db126df375ab33ad3a033051354c | jimioke/virtual-city-generator | /population-synthesis/generate_pop_all_attributes.py | Python | py | 5,267 | no_license | import pandas as pd
import geopandas as gpd
import math
import numpy as np
counties = [24001, 24003, 24005, 24009, 24011, 24013, 24015, 24017, 24019, 24021, 24023, 24025, 24027, 24029, 24031, 24033, 24035, 24037, 24039, 24041, 24043, 24045, 24047, 24510]
# counties = [24009, 24011, 24013, 24015, 24017, 24019, 24021, 2... |
41d9931b9d595c33aef49fad70e6fa2080c8ad39 | 9c7696c51021cb84b751fc9a3297655bef95477f | KongBOy/kong_model2 | /Exps_7_v3/doc3d/I_to_M_Gk3_no_pad/wiColorJ/pyr_Tcrop255_p60_j15/Sob_k23_s001/pyr_1s/L4/step10_a.py | Python | py | 7,743 | no_license | #############################################################################################################################################################################################################
##################################################################################################################... |
02e66b1f2354b7c0dc8c94b833e95b6b060ef3da | d72013bae73c464db876f6872cd7cb9fe051e923 | alexandresobolevski/yahoo_ff | /yahoo_ff/tools/constants.py | Python | py | 4,281 | permissive | date_string_length = 12
# default PARAMS
FIELDS = {
'INFO': [
'Sector',
'Industry',
'Full Time Employees'
],
'KEY_STATS': [
'Market Cap (intraday)',
'Trailing P/E (ttm, intraday)',
'Forward P/E',
'PEG Ratio (5 yr expected)',
'Price/Sales (ttm)... |
d1b05fdeb3c8f76d4e01ecc8a81d3c7f9e50f329 | 176a3e6f566c29c5ac7649f0a2ffef6f93a5b8b0 | dafma/pruebas | /DesarrolloInterautoPizarronesLPG/wsgi.py | Python | py | 442 | no_license | """
WSGI config for DesarrolloInterautoPizarronesLPG project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.enviro... |
c970402af39dd659ec1f4bc55b8fcbd1cbc47d4b | f5bf812e2edf4d013adcd5d3d8098cbdef4794ef | skuzzymiglet/old-projects | /naxos_dict/backend/search5.py | Python | py | 2,736 | no_license | #!/usr/bin/python3
# -*- coding: UTF-8 -*-# enable debugging
import json, re, itertools, time, cgi, cgitb
cgitb.enable()
data = cgi.FieldStorage()
search_term = data.getvalue("search_term")
glossary = open("glossary_dump.json", "r")
glossary_dict = json.loads(glossary.read())
glossary.close()
def replace_ignore_ca... |
b084f7c3646163cb08e72f92189abaca4e50497b | 9dd6c2d5cd4ea3ed925224db28bbbd691c1b5db5 | ken1029/skeleton | /pydownloadmgr/download_manager.py | Python | py | 2,378 | no_license | #!/usr/bin/python -u
import sys
import gobject
import dbus
import dbus.service
import dbus.mainloop.glib
import subprocess
from obmc.dbuslib.bindings import get_dbus
import obmc_system_config as System
DBUS_NAME = 'org.openbmc.managers.Download'
OBJ_NAME = '/org/openbmc/managers/Download'
TFTP_PORT = 69
class Downl... |
1c1af6768d73379438a852e440f880f729e09263 | ec7938795adf5e7837ec4b8122fbb107f94c61e1 | asmmhossain/phyG | /eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-i686-ucs4.egg/EGG-INFO/scripts/qv_to_bqv.py | Python | py | 2,149 | permissive | #!/afs/bx.psu.edu/project/pythons/linux-i686-ucs4/bin/python2.7
"""
Convert a qual (qv) file to several BinnedArray files for fast seek.
This script takes approximately 4 seconds per 1 million base pairs.
The input format is fasta style quality -- fasta headers followed by
whitespace separated integers.
usage: %pro... |
1f56bc7f7a1e327bfeb7b64cd52654bdfc051908 | d5ab94c23c64eeaac626353de86002bba2c2109a | HoChangSUNG/baekjoon_python | /binary_search/semiconductor_design.py | Python | py | 508 | no_license | # 반도체 설계, 2352번
import sys
def lower_bound(arr,target):
low,high = 0,len(arr)-1
while low<=high:
mid = (low+high)//2
if arr[mid]<target:
low=mid+1
else:
high=mid-1
return low
n = int(sys.stdin.readline().rstrip())
sequence = list(map(int,sys.stdin.readline()... |
08afd0055bd0c61122d1c11d623b3cd00def5584 | c9262ec12c0f44f18ac425fba385056acb82eb5a | lorabit/MiningReasons | /data_preprocess.py | Python | py | 1,440 | permissive | from common import *
import os
import os.path
def filter_reason(reasons):
ret = []
for i in range(len(reasons)):
contains = False
for j in range(len(reasons)):
if i!=j and reasons[j].find(reasons[i])!=-1:
contains = True
break
if not contains:
ret += [reasons[i]]
return ret
def parse_file(file... |
15d361e4329dc9625a287c78a9fc2e6559417ef2 | 87d7197581e701fe26922ebc1a396a0da4e4bcb5 | elenaborisova/Python-Advanced | /08. Comprehension - Exercise/04_number_clasification.py | Python | py | 549 | permissive | numbers = [int(num) for num in input().split(", ")]
positive_numbers = [num for num in numbers if num >= 0]
negative_numbers = [num for num in numbers if num < 0]
even_numbers = [num for num in numbers if num % 2 == 0]
odd_numbers = [num for num in numbers if not num % 2 == 0]
print(f"Positive: {', '.join([str(num) f... |
ca9c7eeee1b46e13045dc22bc69495e5523d2a34 | f9f6bc58a5ada8634579512ff3ca18792e7d74c1 | Azer-Denker/ex_8 | /source/webapp/migrations/0003_auto_20210501_1234.py | Python | py | 742 | no_license | # Generated by Django 2.2 on 2021-05-01 06:34
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('webapp', '0002_auto_20210501_1213'),
]
operations = [
migrations.AddField(
model_name='review',
... |
0c4f22dfbc106f25f893532a341d9206732fa7db | e35d7091354b2d827ee78773aa6d402fe13219c5 | leeiopd/algorithm | /before2021/python/문제풀이/home/B8_[TST]시간외 근무 수당.py | Python | py | 1,515 | no_license | '''
A대학에서는 시간외 근무를 수기로 작성하고 있다. 행정실의 K씨는 시간외 근무 수당을 전산으로 처리하고자 한다.
이 대학의 시간외 근무 수당 규정은 아래와 같다.
1. 시간외 근무는 최초 1시간은 제외하며, 최대 4시간까지 인정한다.
2. 시간외 근무에 따른 금액은 30분에 5,000원으로 한다.
3. 5일간의 시간외 근무 합계가 15시간 이상이면 받는 금액의 5%를 감하여 지급한다.
4. 5일간의 시간외 근무 합계가 5시간 이하이면 받는 금액의 5%를 더하여 지급한다.
시간외 근무 수당을 계산하는 프로그램을 작성하시오.
1. 5... |
7a42ab41ecde6902fd17359c5e91c5225ba1acdd | 5a60693560bb170ffddf8df97999bc55c6871b26 | bealbrown/allhours | /locations/spiders/noted/kohls.py | Python | py | 2,259 | permissive | # -*- coding: utf-8 -*-
import re
import scrapy
from locations.hourstudy import inputoutput
class KohlsSpider(scrapy.Spider):
name = "kohls"
download_delay = 1.5
allowed_domains = ["www.kohls.com"]
start_urls = (
'https://www.kohls.com/stores.shtml',
)
def parse_stores(self, respons... |
7d42b6668645702bf31ffc3528af643003458a0e | 39ed90d8d5aac99ca337c67328039c68ea6636ae | learning022/quality-report | /backend/tests/unittests/metric_source/coverage_report/sonar_coverage_report_tests.py | Python | py | 2,459 | no_license | """
Copyright 2012-2019 Ministerie van Sociale Zaken en Werkgelegenheid
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/licenses/LICENSE-2.0
Unless required by applicable... |
554a859c944f8ecf30f66d636d3630704823256b | 6e68dcad393d09fdfdd6e4d768535c8492b56569 | metoppv/improver | /improver_tests/acceptance/test_hail_size.py | Python | py | 2,656 | permissive | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown copyright. The Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are me... |
1581e2460b49f6e5f3b57d93d122d59ba3946c8e | 2c2e02891a28a5e9cdb7bfd549d711548cfed738 | jlmorales/sbml | /sml1/sbml.py | Python | py | 12,088 | no_license | #Jose Morales 109306481
class Node:
def __init__(self):
print("init node")
def evaluate(self):
return 0
def execute(self):
return 0
class BoolNode(Node):
def __init__(self, v):
if(v == 'true'):
self.value = True
else:
self.value = False
... |
929ce313759ea377a8133f96944c022c19e308b2 | f9c11c7456f8dee4750ba76f352fd1b5cb5ca518 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2358/60782/269892.py | Python | py | 751 | no_license | """
题目描述
给定一个由N个正整数组成的数组,请从该数组中打印k个最大的元素。输出元素应按降序打印。
"""
"""
输入描述
输入的第一行包含一个整数T,表示测试用例的数量。
每个测试用例的第一行是N和k,N是数组的大小,K是要返回的最大元素。
每个测试用例的第二行包含N个输入C [i]。
"""
"""
输出描述
按降序打印最大的k个元素。
"""
times = int(input())
while times > 0:
times = times - 1
line1 = input().split(" ")
n = int(line1[0])
k =... |
3d0c4890968dfec9fc694f4b5506142287b261eb | 488d66aafca47fc454ae80b183467600206cbc1b | dongyuanxin/design-pattern-demos | /decorator_pattern/main.py | Python | py | 702 | no_license | def log_without_args(func):
def inner(*args, **kw):
print("args are %s, %s" % (args, kw))
return func(*args, **kw)
return inner
def log_with_args(text):
def decorator(func):
def wrapper(*args, **kw):
print("decorator's arg is %s" % text)
print("args are %s, %... |
8b4af21c9b655984b258dec27781ef218095c163 | 82e3157f9439d5875abc678c0cd9da596c7a8b31 | TanjidIslam/Movie-Website | /media.py | Python | py | 996 | no_license | import webbrowser
class Movie():
'''
A movie object that contains movie title, movie trailer,
storyline and poster
'''
# Class Variable for rating
VALID_RATINGS = ["G", "PG", "PG-13", "R"]
def __init__(self, title, storyline, poster_img, trailer_url, stars):
'''
Initializ... |
6079ae8e6e7b0289c1be1af5aff19312158e3c9d | 56c07ecfd6ed00f10f91cc5a012cc716afcc25b3 | ChezRD/deg2020 | /cryptolib/app/blindsig_ec.py | Python | py | 5,251 | no_license | # pygost.CURVES['id-GostR3410-2001-CryptoPro-A-ParamSet']
import hashlib
import sys
from fastecdsa.curve import Curve
from fastecdsa.point import Point
from pygost.gost34112012 import GOST34112012
from app.crypto import gen_random_from_scalar_field, create_point, square_root_3_mod_4, square_root_exists
from binascii i... |
6f6904f5a62ec475eac8582171929ec39e604728 | ebc887371c0c2b34226eb5097560bd97f2b80222 | nephtyws/problem-solving | /acmicpc/bipartite_matching/11375 열혈강호.py | Python | py | 1,071 | no_license | # from acmicpc.net
def traverse(a: int):
if visited[a]:
return False
visited[a] = True
for b in range(len(match_list[a])):
if match_list[a][b]:
if not matched_work[b] or traverse(matched_work[b]):
matched_employee[a] = b
matched_work[b] = a
... |
88bc4ee5f6d17a3448514f62fd0ff59579038bdf | 663245168824eac6a1df05a29c0eca2de8c58b29 | TraceIvan/PythonProjects | /爬虫实战/testLogging.py | Python | py | 685 | no_license | import logging
class TestLogging(object):
def __init__(self):
logFormat='%(asctime)-12s %(levelname)-8s %(name)-10s %(message)-12s'#当前时间、日志级别、Logger名字、用户输出的信息
logFileName='./testLog.txt'
logging.basicConfig(level=logging.INFO,
format=logFormat,
... |
6d9312ef3f37eec761442a455d68dee28b27bd2f | d9380099f3bdd0c7a55835d224a8cd87675e2771 | SeunghyeunBaek/TIL | /07_웹개발/4_Django/instagram/posts/models.py | Python | py | 1,465 | no_license | # https://github.com/matthewwithanm/django-imagekit
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
from django.conf import settings
from django.db import models
class HashTag(models.Model):
# unique=True: 고유한 값만 들어갈 수 있도록 함, 같은 내용은 id가 같다.
content = models.CharFie... |
f963ca27a6af51bc88a39b27f5028717220dc9ab | b6272b6c7e120044b6d20bc6f0b9551bac8d0d39 | QuangNguyenVinh/CDSNTU1_SourceCode | /NTU1/scripts/TRT.py | Python | py | 3,620 | no_license | import cv2
import numpy as np
import time
import tensorflow as tf
from tensorflow.python.platform import gfile
from keras import backend as K
K.set_learning_phase(0)
class Model():
def __init__(self, path):
self.graph = tf.Graph()
sess = tf.Session(graph=self.graph, config=tf.ConfigProto(gpu_options... |
f1adb5fe78cfe0ba86b1d316f15e8804836256a9 | faec8fa8d9952a40f50aa869b2edd4b3bcb17cb4 | apcamargo/InSilicoSeq | /iss/modeller.py | Python | py | 13,387 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from builtins import dict, range, zip
from iss import util
from scipy import stats
from joblib import Parallel, delayed
import logging
import numpy as np
def insert_size(insert_size_distribution):
"""Calculate cumulative distribution... |
d1e84887336573b90f0ef496545781b52085a46e | 3f4e7b2f750e78a8ad1af80f7fc0033b4076deee | BuiltinCoders/PythonTutorial | /string slicing and other function.py | Python | py | 3,215 | no_license | mystr = "virtual world"
decimal = 's.s.f.a.e'
digits = "12345"
# # String slicing
# 1. start argument
# staring index of string
# print(mystr[0:])
# 2. stop argument
# ending index of string
# print(mystr[:7])
# 3. step argument
# skipping index of string
# print(mystr[::2])
# string slicing refers to print... |
72f6f56b8240e08dd2a769fca703172a8623d216 | 6469f37ca9604d1d29d4dc119de341f47ebc849d | Ben-Hardy/imageProcessing_ComputerVision | /camtest.py | Python | py | 215 | no_license | import cv2
capture = cv2.VideoCapture(0)
while True:
r, frame = capture.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord(' '):
break
capture.release()
cv2.destroyAllWindows() |
391b1a8d9c2a6deab25c918dbe5429e23bc2137b | c7871aab550a7481848e6d986d32550ad2983160 | zavierboyd/ZScript-Bokeh | /zscript/zsyntaxtree.py | Python | py | 9,394 | no_license | import operator as op
import random as rdm
import numpy as np
from collections import defaultdict
from .rply.token import BaseBox
class ZWarning(Warning):
currentwarnings = []
def __init__(self, message):
self.message = message
self.currentwarnings.append(message)
@classmethod
def cl... |
524e62cd5e3e4275ce3514b9ea7fa381fea282fc | af79572d420d99d0c5879e95d872ecd8cb815e29 | msafwankhan/Challenge | /venv/Scripts/pip3-script.py | Python | py | 418 | no_license | #!C:\Users\safwan_khan\PycharmProjects\challenge\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys... |
5393f2fd5f8a4c6665e4caaa362249bc3586d0da | 58eeaddf2f283b05a0a142ed9a988f74f353e3e2 | strigazi/athena | /LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CTB04_PhysWaveShifter_jobOptions.py | Python | py | 12,434 | permissive | ###########################################################################
readNovaDB = True
PhysWaveFolderName = ["/lar/LArElecCalibTB04/LArPhysWaveContainer/RTM"]
PhysWaveFolderTag = "TB04-NoTimeShift-1"
POOLFileDir = "./"
#POOLFileDir = "/data/mdelmast/ctb2004/ofc/"
#POOLFileDir ... |
f828fb4b4936cef5e1277cbcd8cc12d0d0de79dd | bd3e031df9df690f93e1f296ec4e03cde10799d6 | Tamanna1411/softanbees_web | /softanbees_web/urls.py | Python | py | 979 | no_license | """softanbees_web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... |
7f05286ea38668e8a5d17413daa7d948bfd51219 | d15fa8efa0e39267c5ff9cb7fab1c6b85433d609 | dappre/QiyTestTool | /app.py | Python | py | 638 | no_license | import os
import mod_wsgi.server
# Create data directory if required
datapath = os.getenv('QIY_CREDENTIALS')
if not os.path.isdir(datapath):
os.makedirs(datapath)
print("Data dir created")
else:
print("Data dir exists")
mod_wsgi.server.start(
'--log-to-terminal',
'--port', '8080',
'--t... |
770951e4a932bf322fe38ab7d08216c057473257 | 2b65541bae35cd3a5a76e39189e0ee0cc07fc014 | rosanajurdi/Test_Segmentation | /Common_Scripts/metrics.py | Python | py | 4,082 | no_license | from collections import defaultdict
from scipy import spatial
import numpy as np
import torch.nn.functional as F
import torch
def threshold_predictions(predictions, thr=0.999):
thresholded_preds = predictions[:]
low_values_indices = thresholded_preds < thr
thresholded_preds[low_values_indices] = 0
low_... |
fa8aea1760ac73dd17a41393b099a511ac7cfc12 | bfb05b1c19642341a6143f33a444a28bdd9bb075 | pelarejo/KooC | /runner_test.py | Python | py | 1,392 | no_license | #!/usr/bin/env python3
import sys
import unittest
#Add your test here
tests = [
'unittests.test_simple_mangling',
'unittests.test_kooc_file',
'unittests.test_import',
'unittests.test_class',
# 'unittests.test_module',
'unittests.test_kooccall',
]
# 'unittests.test_newtest',
def main():
... |
ffc8880a42fba979c7ca33466eb8f257910de893 | 0c6e0f4403b7947ab66b4c5b4c1f27b30ed6335e | fth-ship/mining | /mining/utils.py | Python | py | 2,199 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unicodedata
import re
from decimal import Decimal
from datetime import date
from pandas import tslib, date_range
def fix_type(value):
if type(value) is str:
try:
return unicode(value)
except UnicodeDecodeError:
return un... |
5f1ebd3334478ef9ecf7fff2f45808e8652bd9cb | 5650f8874102f6dc4b3e9b20772cfee6cbc8443c | Upabjojr/rubi_generated | /generated_tempdir_2019_09_15_163300/generated_part001652.py | Python | py | 15,255 | no_license | from sympy.abc import *
from matchpy.matching.many_to_one import CommutativeMatcher
from matchpy import *
from matchpy.utils import VariableWithCount
from collections import deque
from multiset import Multiset
from sympy.integrals.rubi.constraints import *
from sympy.integrals.rubi.utility_function import *
from sympy.... |
91cd7bc246378e9ebf58e7ea41e4b39c8386b7bf | e9e270c4b0635018a95a2ca8d180743c97dd7f48 | xiewei20082008/yys | /src/main.py | Python | py | 599 | no_license | import ExpElf
from toolkit import *
import threading
from time import sleep
import sys
import os
dm = reg()
def main():
global dm
print dm
# dm.SetMouseDelay("windows",150)
# cf = ExpElf.ExpElf(dm,"jiangshi",4,0,isRush = False,shenLe = False)
#cf = ExpElf.ExpElf(dm,"dahao",11,10,isRush = True,is... |
75992a66ca71a619c24d7cb5cdd2536b58a276f3 | 698f52f0bd89af89d959c5964764889884c191a8 | FalsePsyche/verbose-waffle | /main.py | Python | py | 1,058 | no_license | import nltk
# nltk.download()
from nltk.corpus import words
english_dict = words.words()
print(len(english_dict))
print("find all the words in the dictionary that have swears as substrings")
print("Derek smeels")
print()
# List of words to match
substring_list = ['shit', 'ass', 'jam', 'base', 'tele', 'damn', 'work', 'w... |
afeffb6cb97b77f4270ab6d0a50ee90eb992b981 | 6e262345d5b7345f68ec75c0ff85002a7840d28d | jhorcicka/python | /networking/server.py | Python | py | 492 | no_license | #!/usr/bin/python
import socket
class Server:
def __init__(self):
self.__socket = socket.socket()
self.__port = 12345
self.__socket.bind(('', self.__port))
self.__socket.listen(5)
self.__counter = 0
def start(self):
while True:
c, addr = self.__socket.accept()
self.__counter ... |
22a8b230e16ab5c246c6e17d26b07f4ef59bcae2 | 9e43c7a0362000749cbb509d1d300760891a863b | andreystashev/python_base | /lesson_007/01_snowfall.py | Python | py | 2,224 | no_license | # -*- coding: utf-8 -*-
import simple_draw as sd
# Шаг 1: Реализовать падение снежинки через класс. Внести в методы:
# - создание снежинки с нужными параметрами
# - отработку изменений координат
# - отрисовку
flakes = []
class Snowflake:
def __init__(self):
self.xpoint = sd.random_number(100, 500)
... |
6f3517d8482996423d77139ed70b2c2887b56ece | 6b0972e8d6e645c2dce0633cde1322e0903bc791 | tiagocoutinho/pint | /pint/testsuite/test_unit.py | Python | py | 14,388 | permissive | # -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, print_function, absolute_import
import math
import copy
import operator as op
from pint.unit import (ScaleConverter, OffsetConverter, UnitsContainer,
Definition, PrefixDefinition, UnitDefinition,
... |
a8b41791111f913366f59457fb98a1caeb678f9f | 795d2913b8ec646d5c623de718fbefe52bc8487a | harshvbansal/Stock-Analysis | /optimization.py | Python | py | 3,096 | no_license | import datetime as dt
import pandas as pd
import numpy as np
import scipy.optimize as spo
import util
from util import *
def normalize_data(df):
return df/ df.ix[0,:]
def compute_daily_returns(df):
daily_returns = (df/df.shift(1)) -1
daily_returns.ix[0] = 0 #has some issues, only works with one colum... |
077e3fc47b4fc76113f1923110e3d4e53dbb1e41 | 2d133192a5ab3180fa58d6eeaadcd3a27d3e4241 | huguge/learn-python33 | /basic/do_while.py | Python | py | 226 | no_license | #!/usr/bin/env python3
# -*- doding: utf-8 -*-
# 计算1+2+3+...+100:
sum = 0
n = 1
while n <= 100:
sum += n
n += 1
print(sum)
# 计算1*2*3*...*100:
acc = 1
n = 1
while n < 100:
acc = acc*n
n += 1
print(acc) |
f209457cf5637652fbaf3a74742cd315b45fa6d0 | ceeff9807f14f0eb49e0939c1a99a44bc5f99895 | arajkumar/fabric8-analytics-utils | /f8a_utils/dependency_finder.py | Python | py | 8,792 | permissive | """Definition of a class to find dependencies from an input manifest file."""
import json
class DependencyFinder():
"""Implementation of methods to find dependencies from manifest file."""
@staticmethod
def scan_and_find_dependencies(ecosystem, manifests, show_transitive):
"""Scan the dependenci... |
07c6d33d77c43f44d97e352562302b4a5abfdd18 | 5de62fdb5cfeb85f927acc2b5924419c9e55f25a | rneilturner/python-mistralclient | /mistralclient/api/client.py | Python | py | 1,958 | permissive | # Copyright 2013 - Mirantis, Inc.
#
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
d0dcd5e8622c384d58b83ca22ca25368e4bdd438 | 03821785c9ff8f36a78747f22e2683d09322aa63 | positivevibes2021/sacrosanct-30761 | /backend/home/migrations/0001_load_initial_data.py | Python | py | 538 | no_license | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "sacrosanct-30761.botics.co"
site_params = {
"name": "Sacrosanct",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_cr... |
0ca12e89f48b381f14ae559ccccd929ac0271eb3 | 84262d8aee800f34b5252544a2c8abc8c73bdb99 | pedroeverett/Django-RunTracker | /runtracker/models.py | Python | py | 354 | no_license | from django.db import models
class Runtracker(models.Model):
date = models.DateField()
distance = models.DecimalField(
decimal_places=0,
max_digits=6
)
time = models.DecimalField(
decimal_places=0,
max_digits=6
)
calories = models.DecimalField(
decimal_pl... |
ece7b6dac8bae3a4d0940868c510d0c378f17554 | 630bff6065f9052a322b417a0569e15ddcafaeec | D3nii/Random | /Python/weather.py | Python | py | 1,003 | no_license | from darksky.api import DarkSky, DarkSkyAsync
from darksky.types import languages, units, weather
API_KEY = '02a5bad031f5f4de58fad7f396c6f982'
# Synchronous way
darksky = DarkSky(API_KEY)
latitude = 30.3753
longitude = 69.3451
forecast = darksky.get_forecast(
latitude, longitude,
extend=False, # default `Fa... |
90594c0315928397d9f396d8d28f1212ea2e78ee | f29778d7e9292da4d08075083a3a3f8a8b849853 | malia-d/cp1404practicals | /prac_01/menus.py | Python | py | 542 | no_license | user_name = input("Enter name: ")
print("(H)ello\n(G)oodbye\n(Q)uit")
choice = input().upper()
while choice != "Q":
if choice == "H":
print("Hello {}".format(user_name))
print("(H)ello\n(G)oodbye\n(Q)uit")
choice = input().upper()
elif choice == "G":
print("Goodbye {}".format(use... |
f57f0ac50c2906422aa54d5b8d784c1a4d19aac0 | d93ab851d4284d82206477b56aa7653c09765c64 | QuantumGroup/information_dashboard | /collection_and_processing/real_time_collectors/twitter_follow_collector.py | Python | py | 7,313 | no_license | """
This class takes in the user account requirements from the control script or web UI and handles the
collection and pre-processing of tweets based off of those requirements.
"""
from tweepy import StreamListener
class TwitterFollowCollector(StreamListener):
def __init__(self, accounts, error_log, debug):
... |
3ff5eeacbc94fe731ec960144268366c4bd61be1 | d8961c20ac73c89ad5fe9006e32a5cd9643d57e2 | sc4you/tmsv8 | /tms_agreement/sale.py | Python | py | 1,375 | no_license | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
2e327dba5a16396344b5c58eda30a66689935e9f | 0a14af7e398ebff3911e605eddd2e06f86b17f1e | xtrusia/charm-helpers | /charmhelpers/contrib/openstack/amulet/utils.py | Python | py | 69,663 | permissive | # Copyright 2014-2015 Canonical Limited.
#
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
4d0d2c3cca4d9433965b833f54645402780653cb | 5e2ff2aa81b3ceba971bdf133ce73dbec6f04584 | rafaelperazzo/programacao-web | /moodledata/vpl_data/303/usersdata/296/78957/submittedfiles/testes.py | Python | py | 203 | no_license | # -*- coding: utf-8 -*-
#COMECE AQUI ABAIXO
A = float(input("Digite o primeiro número: "))
B = float(input("Digite o primeiro número: "))
if A>B:
print ("MAIOR NÚMERO É")str(A)
|
a73297a9464cb614a4bd5cb0ec2535eba9b74437 | 737914618679e293534eb3e282ff402688f212f4 | Dolan001/Get3SixtyUser | /db.py | Python | py | 601 | no_license | import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="dolan",
passwd="dolan159320"
)
cursor = mydb.cursor()
cursor.execute("CREATE DATABASE Get2")
print("Database Created....")
cursor.execute("USE Get2")
cursor.execute("CREATE TABLE users (id INT AUTO_INCREMENT PRIMARY KEY,firstname VAR... |
6b156c8694d77f2097809da989bdfa909e250dae | 3e2a9222263777e08d1a77b62eec5f88896e9837 | ThaminduR/spark-privacy-preserver | /spark_privacy_preserver/clustering_utils/kmodes.py | Python | py | 5,138 | permissive | import numpy as np
class Kmodehelpers:
@staticmethod
def edit_cluster(group,distances):
'''
This method is used to edit the cluster number of a record.
group :- Cluster group, type = Pandas DataFrameGroupBy
distances :- Dataframe that include cluster mapping details
'''... |
81aa3a96ecef6f283ebfe47f24fd78352ef39939 | 07c99fd545d734a7bd8f6415ba915a3a41a3c777 | hobama/IoTSim_Model | /RPi_CPU_model/pwr_measure.py | Python | py | 3,438 | no_license | # For single time power measurement in a serie
# Store the measured data in ./pwr_measure/
# Usage: python pwr_measure.py cpu_600
import sys
import os
import serial, select
import time
import signal
import datetime
bSignaled = False
def signal_handler(signal, frame):
global bSignaled
print("You presse... |
02712c61422934e8eb1b411fec0d8df295c76869 | 63528df69b237872335e73643e60adceab9d6f47 | muskanmahajan37/um-credits-django | /server/umsubjects/models.py | Python | py | 294 | no_license | from django.db import models
class Subject(models.Model):
code = models.IntegerField(unique=True)
name = models.CharField(max_length=100)
credits = models.IntegerField()
year = models.IntegerField()
# EJEMPLO: {"code": 2000, "name": "FISICA", "credits": 7, "year": 2019}
|
ba8ee99f675d4fc26f80d8abe4336448b4abb097 | 8eaa56f1a0071c0c105f732435804ca4a6a5e15f | ganborui/hue | /desktop/libs/notebook/src/notebook/connectors/hiveserver2.py | Python | py | 32,709 | permissive | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
1f7e446af9dc577211ae9e225316bb9cde32a293 | 45e94a73ca36da05a5b0e1df3ee2012c610277fc | evercx/HTTP_Middleware_for_PythonBE | /python/model.py | Python | py | 594 | no_license | import time
import random
import sys
class Timer:
def __init__(self):
self.__start = 0.0
self.__end = 0.0
def getStart(self):
self.__start = time.time()
return self
def getEnd(self):
self.__end = time.time()
return self
def getCostTime(self):
ret... |
1eac6af94c00c1f2ba5cef93836823d0a84ec10b | a74515454359a5e33eedfd5f9323055234b5c965 | PJfixer/Hercule2000.Vision | /OpenCV/keypoint.py | Python | py | 379 | no_license | import cv2
import numpy as np
img = cv2.imread('Amelie.jpg')
#img = cv2.resize(img, (640, 480))
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
img=cv2.drawKeypoints(gray,kp,img)
#img=cv2.drawKeypoints(img,kp)
cv2.imshow('key points',img)
if cv2.wait... |
c301307a70375c9b6da372862427a188c72b544d | 0cf25770af1b37cf024ccaeb3f95e89dab930df3 | nveskovic/indy-sdk | /wrappers/python/tests/pool/test_open_pool_ledger.py | Python | py | 588 | permissive | import pytest
from indy import pool
from indy.error import ErrorCode, IndyError
@pytest.mark.parametrize(
"pool_genesis_txn_count, pool_config",
[(2, None), (3, None), (4, None), (4, '{"refresh_on_open": true}')])
@pytest.mark.asyncio
async def test_open_pool_ledger_works(pool_handle):
pass
@pytest.mar... |
891b5d6623151d386861c9b3b60cc221302633c9 | e8ae6b6994976a7899879fd418125c9e0f2ad54a | lettinghenry/Unity-Robotics-Hub | /tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/mover.py | Python | py | 4,417 | permissive | #!/usr/bin/env python
from __future__ import print_function
import rospy
import sys
import copy
import math
import moveit_commander
import moveit_msgs.msg
from moveit_msgs.msg import Constraints, JointConstraint, PositionConstraint, OrientationConstraint, BoundingVolume
from sensor_msgs.msg import JointState
from m... |
c926499103516532fa888c3a94093e0d0eced5ef | 831f1808658ede4d24e42096376a1068a06c1c36 | NewRGB/lino | /lino/modlib/users/utils.py | Python | py | 2,087 | permissive | # Copyright 2011-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Utilities for managing the :ref:`current_user_type`.
"""
import threading
user_profile_rlock = threading.RLock()
_for_user_profile = None
def with_user_profile(profile, func, *args, **kwargs):
"""Run the given callable `fun... |
96ade99e6fcd1647ad945621ec6fa88304837179 | e249dca4c33d82f368cf68f620dfb89a8d3df20a | torresbc/ftt-api-ghibli | /main.py | Python | py | 831 | no_license | import requests
import json
import pandas
req = None
try:
req = requests.get('https://ghibliapi.herokuapp.com/films')
except:
print('Erro na conexão http!')
exit()
list = json.loads(req.text)
title_list = []
description_list = []
director_list = []
releasedate_list = []
rtscore_list = ... |
9492b5aaa812bdddee585ec91fd574a07803be0d | f22714db57a12a070fadee0227febf205319f376 | mzhuang1/opfmbrl | /mindbike/worlds/windy_world.py | Python | py | 3,250 | no_license | """
Continuous 1-D world. Can move forward, backward or not at all, and you can be
involuntarily moved too. Goal is to reach and remain in a particular spot.
"""
import autograd.numpy as np
from autograd import grad
from copy import copy
from mindbike.big_picture import World, WorldModel
from mindbike.distributions i... |
7e671050d3a6b9ad7ef47a993358d9132960e3cf | 841bcac9036a815a246c63c330730b195bac903c | dls-controls/pymalcolm | /tests/test_modules/test_ADCore/test_filepathtranslatorpart.py | Python | py | 1,745 | permissive | import unittest
from mock import MagicMock, call
from malcolm.core import PartRegistrar
from malcolm.modules.ADCore.infos import FilePathTranslatorInfo
from malcolm.modules.ADCore.parts import FilepathTranslatorPart
class TestFilePathTranslatorPartLocal(unittest.TestCase):
def setUp(self):
self.o = File... |
11c29929271ddf9fc5b44ce96a906170a0639928 | f21c99388536d07895038f42e1f2b2ba0da3c089 | kingbo2008/teb_scripts_programs | /zzz.scripts/braekup_db2_checklist.py | Python | py | 3,794 | no_license | #! /usr/bin/python
import sys
import gzip
# Written by Trent E. Balius, B. Shoichet Lab, UCSF
#################################################################################################################
def read_write_db2(input_file, output_prefix,namelist):
print "input file ="+input_file
file1 = open(i... |
c882728d343552cbc9d1bceadc42667c798a3655 | 6233e4fefc5105108b09bbc2c68c0df87fe6312f | tommasocalo/SLAMbyGeohot | /program.py | Python | py | 900 | no_license | #/usr/bin/env python3
import g2o
from frame import Frame,denormalize,match
import numpy as np
import cv2
from display import Display
w = 1920//2
h = 1080//2
F = 270
K = np.array(([F,0,w//2],[0,F,h//2],[0,0,1]))
disp = Display(w,h)
frames = []
def process_frame(img):
img = cv2.resize(img,(w,h))
frame = Frame(i... |
162a0f15cc467475534012049173043cdffd8a81 | 6a460341eb10925a4dcb0a6b1452e3d082eababb | rick0154/https-github.com-NikamRohan-News-Aggregator | /entertainmentcrawler/entertainmentcrawler/spiders/entertainment_spider.py | Python | py | 1,587 | permissive | import scrapy
from ..items import EntertainmentcrawlerItem
from news.models import ENHeadline
from entertainmentcrawler.spiders import entertainment_spider
from entertainmentcrawler import pipelines
class EntertainmentSpider(scrapy.Spider):
name = "entertainment"
start_urls = [
'https://variety.com/'
]
def pars... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.