index int64 0 1,000k | blob_id stringlengths 40 40 | code stringlengths 7 10.4M |
|---|---|---|
16,500 | 65f18a253948e3c713162277cb440e7d90d3a589 | from django.urls import path
from .views import IndexView, PollResultView, PollDetailView, vote
app_name = 'polls'
urlpatterns = [
path('', IndexView.as_view(), name='index'),
path('<int:pk>/', PollDetailView.as_view(), name='detail'),
path('<int:pk>/results/', PollResultView.as_view(), name='result'),
... |
16,501 | 06a918611093557aba62170cc64f2517a74a5f56 | """
This is where the implementation of the plugin code goes.
The MyPythonPlugin-class is imported from both run_plugin.py and run_debug.py
"""
import sys
import logging
from webgme_bindings import PluginBase
# Setup a logger
logger = logging.getLogger('MyPythonPlugin')
logger.setLevel(logging.INFO)
handler = logging.... |
16,502 | 1f36131547a11c738a09e4b383c58fde01fe3d04 | import PyPDF2
minutesFile = open('pdf/meetingminutes.pdf','rb')
pdfReader = PyPDF2.PdfFileReader(minutesFile)
# 90๋ ํ์
page = pdfReader.getPage(0)
# page.rotateClockwise(90)
page.rotateClockwise(180)
pdfWriter = PyPDF2.PdfFileWriter()
pdfWriter.addPage(page)
# resultPdfFile = open('rotate1.pdf', 'wb')
resultPdfFile... |
16,503 | 4099b8c3b52df51e017fb75206340d36fb1f4493 | # [S/W ๋ฌธ์ ํด๊ฒฐ ๊ธฐ๋ณธ] 9์ผ์ฐจ - ์ค์์ํ
def inorder(n):
global word
if n > 0:
inorder(ch1[n])
word += par[n]
inorder(ch2[n])
T = 10
for tc in range(1, T+1):
N = int(input())
par = [0]*(N+1)
ch1 = [0]*(N+1)
ch2 = [0]*(N+1)
for i in range(N):
node = input().split()
... |
16,504 | c3f0e8a6efc31b466a3bf4841eaf0a9e220b7147 | from django.urls import path
from lesson_4 import views
urlpatterns = [
path('create-flower/', views.create_flower, name='create_flower'),
path('create-client/', views.create_client, name='create_client'),
path('get_flower/', views.get_flower, name='get_flower')
]
|
16,505 | 7296b2a3ecea4314912a6ac2de021a5e5d7e14bd |
import json
class ConfigObject(object):
def __init__(self, version, type, redis, http):
self.version = version
self.type = type
self.redis = redis
self.http = http
@property.getter
def get_http_properties(self):
return self.http["authmethod"], self.http["port"], ... |
16,506 | 58471d9e039bfda05bce49e83b48b4393eb5882d | import socket
import sys
import util
from Crypto.Cipher import AES
Kp = b'secret_key_16bit'
IV = b'initial_vector_f'
BLOCK_SIZE = 16 # Bytes
def connect_to_node(host, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
address = (host, port)
sock.connect(address)
return sock
def choos... |
16,507 | d743941e5790d12ae6b868a0f827b0edb8d4a58b | # Generated by Django 2.2.3 on 2019-08-19 05:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userext', '0003_user_interface_wide_screen'),
]
operations = [
migrations.AddField(
model_name='user',
name='passwor... |
16,508 | 3cc7e80728191957a50a754784a11d11a8b30148 | import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
import math
import random
import graphics
import helpers
import mango
import other
import plat
import EZMenu
class Main:
def __init__(self):
fontSize = 72
level = int(EZMenu.EZMenu('Choose a level! :D',['Level 1','Level 2','Level ... |
16,509 | fb83f0394be923bb72a1e36b1974deee6ae6a441 | #!/usr/bin/env python
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
with open('sample/version.py') as version_file:
exec(version_file.read())
setup(
name='sample',
version=__version__,
description='Djang... |
16,510 | 4c6a8f4a195698b46aa37f13b74d65e0d2318b5e | def searchLo(x, left, right):
if(left == right):
if(a[left] >= x): return left
else: return None
mid = int((left+right)/2)
if(a[mid] >= x):
if(mid == left): return mid
if(mid > left):
mostLeft = searchLo(x, left, mid-1)
if(mostLeft == None): return mid
else: return mostLeft
... |
16,511 | 1de139d4e2189298d50d82ce40afe6661830bb1b | from django.contrib import admin
from .models import FileFieldModel
admin.site.register(FileFieldModel) |
16,512 | 871b6ae319c656ceb61e173042ce6dc39162d218 | def f(s):
l=s.find("f(",28)
print s[:l+2]+repr(s)+s[-1]
if __name__ == '__main__':
f('def f(s):\n\tl=s.find("f(",28)\n\tprint s[:l+2]+repr(s)+s[-1]\n\nif __name__ == \'__main__\':\n\tf()')
|
16,513 | 26a7c213ab0cff44dceae1e99035ab82416350ec | """Add license field to rights
Revision ID: 844b6f4ed646
Revises: 59c8cd1935d7
Create Date: 2019-02-04 14:52:40.610752
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '844b6f4ed646'
down_revision = '59c8cd1935d7'
branch_labels = None
depends_on = None
def upg... |
16,514 | 2a818780a1924f0294aa7e259d08f6abe8221677 | import os
import numpy as np
import random
class Reader(object):
def __init__(self, dataset_dir, listfile=None):
self._dataset_dir = dataset_dir
self._current_index = 0
if listfile is None:
listfile_path = os.path.join(dataset_dir, "listfile.csv")
else:
list... |
16,515 | 2b8ae34471de28cc52c4cdd19ca82d62b0726de6 | ### ์๋ฃํ2 ###
'''
๋ฆฌ์คํธ ( list )
- ๋ณต์์ ๋ฐ์ดํฐ๋ฅผ ๋ฌถ์ด์ ์ ์ฅํ์ฌ ๋ฐ์ดํฐ์ ์ ์ฅ,์ ์ง,์ฌ์ฉ์
์ฉ์ดํ๊ฒ ํ๋ ์๋ฃ๊ตฌ์กฐ
[ํ์]
๋ฆฌ์คํธ๋ช
= [๋ฐ์ดํฐ1,๋ฐ์ดํฐ2,๋ฐ์ดํฐ3,....]
- ํ ์ธ์ด์ ๋ฐฐ์ด๊ณผ๋ ๋ค๋ฆ
๋๋ค.
'''
# ๋ฆฌ์คํธ ์์ฑํ๊ธฐ
listDatas1 = [] # ๋น ๋ฆฌ์คํธ
listDatas2 = [1, 2, 3, 4, 5] # ์ ์ ๋ฆฌ์คํธ
listDatas... |
16,516 | d9e185894fa2ef477a46403e6780bf77a5982380 | import torch
import numpy as np
import random
from collections import deque, namedtuple
from utils import sync_networks, conv2d_size_out
Experience = namedtuple('Experience',
['state', 'action', 'reward', 'next_state', 'done'])
class DQN_Base_model(torch.nn.Module):
"""Docstring for DQN ... |
16,517 | 416051cded9dd44cdc9ff180baab95c1f7d274e1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName :download.py
# @Author :Shuranima
# @Time :2020/8/11 19:00
import os
import requests
from tqdm import tqdm
import time
from spider.ua import HEADERS
import random
def down_from_url(url, dst):
headers = random.choice(HEADERS)
with requests.... |
16,518 | 4d6ea00c6aefe3d8384c641cc472f7ea7487c31f | import numpy as np
from math import exp
import random
class Sampler(object):
def __init__(self,sample_negative_items_empirically):
self.sample_negative_items_empirically = sample_negative_items_empirically
def init(self,data,max_samples=None):
self.data = data
self.num_users,self.num_... |
16,519 | 071559d0203ef4def52b2b7b4de69ca0a05fcc6f | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from articles.models import Article,Category,Tag
from users.models import User
from img.upload import delete_image_to_qiniu
from django.db.models.signals import post_delete
# Register your models here.
class ArticleAdmin(a... |
16,520 | bac4ce4458e7027bed7f949dc71053b8b0031a53 | from PySide import QtGui
import sys
from BaseStation.ui.widgets.main_window import Main
from Robot.configuration.config import Config
from Robot.filler import country_repository_filler
from Robot.resources.kinect import Kinect
def init_ui():
app = QtGui.QApplication(sys.argv)
m = Main()
m.sho... |
16,521 | 0b59dcc9ab32a582f2156ecdfd54feed5b77815e | # -*- coding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1412041326.883988
_enable_loop = True
_template_filename = u'/home/chodges/lager-pylons/lager/lager/lager/templates/base.mako'
_template_u... |
16,522 | 5d7fe28f42a11704f5b94bdd9af1c212fd88e321 | import tkinter as tk
from tkinter import *
from tkinter.ttk import *
from tkinter import ttk
from tkcalendar import Calendar, DateEntry
from src.db import insert_expense
class Expense(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
... |
16,523 | 1f772db2073124073246b8dc8b7b98179bcd74cd | import tensorflow as tf
import numpy as np
import pdb
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.datasets import fetch_openml
from sklearn.metrics import accuracy_score
#--------------------------------------------------------------------------------
# mnistใใผใฟใใญใผใ... |
16,524 | 47cff94cd4131fce63abfb8a772a6bd49662c4fc | #!python3
import paho.mqtt.client as mqtt #import the client1
import time
#import I2C_LCD_driver
def on_connect(client, userdata, flags, rc):
if rc==0:
client.connected_flag=True #set flag
print("connected OK")
# mylcd.lcd_clear()
# mylcd.lcd_display_string("Connected!", 1)
else:
print(... |
16,525 | 8d276bb33ff4489c3ac28a7befc35597160d47d3 | # Create three radio buttons widgets using tkinter module
import tkinter as tk
parent = tk.Tk()
parent.title("Radiobutton")
parent.geometry('350*200')
radio1 = tk.Radiobutton(parent, text='First',value=1)
radio2 = tk.Radiobutton(parent, text='Second', value=2)
radio3 = tk.Radiobutton(parent, text='Thrd', value... |
16,526 | 562616504ac73912a1eeb1fef859b37ff95ae004 | import logging
import os
from abc import abstractmethod
import traceback
import celery.signals
from celery.task import Task
from utils.job_db import JobDb
from utils.object import Object
from utils.setup_logging import setup_logging
from utils.celery_client import celery_app
setup_logging()
@celery.signals.setup_... |
16,527 | 211e67e41e4ee60e03b1d30e4880db7e33b86405 |
from ..utils import Object
class MessageContent(Object):
"""
Contains the content of a message
No parameters required.
"""
ID = "messageContent"
def __init__(self, **kwargs):
pass
@staticmethod
def read(q: dict, *args) -> "MessageContactRegistered or MessageChatAd... |
16,528 | 4da1c9ff67a51878eafe3f120219fef50d480c46 | from tkinter import *
import os
class GUI:
def __init__(self):
self.Window = Tk()
self.Window.withdraw()
self.login = Toplevel()
self.login.title("Login usando RPC")
self.login.resizable(width=False, height=False)
self.login.configure(width=400, height=300)
... |
16,529 | 09771c39a18773854f0be53104dfefb269241b5c | from __future__ import print_function
import sys, warnings
import deepsecurity
from deepsecurity.rest import ApiException
from playsound import playsound
from twilio.rest import Client
import csv
import time
# play a sound when a parameter changes and send a message
lists = []
def text():
account_sid = ... |
16,530 | 2df81b4d87df73d0742bc93f368938b60d14e0fc |
##
## MySolrDbParse.py - primitive where clause converter
## for MySolrDb.py
##
import cStringIO, tokenize
def atom(token):
if token[0] is tokenize.NAME:
return token[1]
elif token[0] is tokenize.STRING:
#return token[1][1:-1].decode("string-escape")
return '"' + token[1][1:-1].decode... |
16,531 | 9671815ab10343d099bf3bd223901379a1d403ff | from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torchvision.datasets import ImageFolder
from torchvision import utils
import os
import numpy as np
augment_transform = transforms.Compose([
# transforms.Resize((32,32)),
transforms.RandomRotation(degrees=30),
transform... |
16,532 | ad161cbfa54a73a08f5599e6c4ba1df2e4d68c7c | # coding=utf-8
import tensorflow as tf
labels = ''
XXX = ''
biases = ''
# logits = tf.nn.softmax(XXX)
# loss = tf.reduce_mean(-tf.reduce_sum(labels * tf.log(logits)))
logits = tf.matmul(XXX, XXX) + biases
loss = tf.nn.sigmoid_cross_entropy_with_logits(labels=labels, logits=logits, name='losses')
|
16,533 | 34b2f9b500c7e7a6231245fb5ecf4fbcb0f9a97f | import os, sys
import shutil
def check_name(name):
new_name = name.strip()
new_name = new_name.replace(" ", "_")
new_name = new_name.replace("__", "_")
new_name = new_name.replace("__", "_")
return new_name
def copy_files(src, des):
if not os.path.exists(des):
os.mkdir(des)
for ... |
16,534 | 35a82979c6c124391276ef2dd62bac22cf3e253c | # -*- coding: utf-8 -*-
# @Time : 2018/9/28 9:13
# @Author : xuyun
import smtplib,os,HTMLTestRunner,unittest,time,datetime
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
def sendmain(file) :
# ๅ้้ฎ็ฎฑ
sender = '819077607@qq.com'
... |
16,535 | 2b5e59ed5def95368480464549cb01ea74632050 | import pyglet
import pyglet.gl
import random
import math
from random import randint
def get_triangle(radius, xcenter, ycenter, numberOfVertices):
"""
This function takes an (x,y) coordinate and a triangle
radius to ouput the coordinates of the triangle as a
list.
:param radius: radius of the tria... |
16,536 | 4ae7102e13b5ab15d59a7e1ce675122204bfa9ad | import pandas as pd
import boto3
import s3fs
import json
import random
import os
class MessageDatabaseCSV:
def next_message(self):
message_list_df = self.get_dataframe()
print('Successfully retrieved message database')
print('Values for number of times used: {}'.format(message_list_df['num_... |
16,537 | ce8abd70549029c8335e582733e66c2ddc54b0e0 | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
#ไปflaskๅ
ไธญๅฏผๅ
ฅFlask็ฑป
from flask import Flask, request
from config import Config
#ๅฐFlask็ฑป็ๅฎไพ่ตๅผ็ปๅไธบ app ็ๅ้๏ผ่ฟไธชๅฎไพๆไธบappๅ
็ๆๅ
from flask_sqlalchemy import SQLAlchemy#ไปๅ
ไธญๅฏผๅ
ฅ็ฑป
from flask_migrate import Migrate
import pymysql
from flask_login im... |
16,538 | a2739f6be3e9c7022ed04b637439e3cd68a61a47 | """add posts table
Revision ID: bff64a27bc9b
Revises: 4783cd3d66c8
Create Date: 2020-09-27 14:35:46.031402
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'bff64a27bc9b'
down_revision = '4783cd3d66c8'
branch_labels = None
de... |
16,539 | 01092704b9af5d64f4778189c2e5309b1e7d2be1 | def pearson(data, labels, dumped=False):
import numpy as np
import util.dump as dump
import math
import warnings
import scipy.stats as stats
warnings.filterwarnings('ignore')
def get_features(data_set):
n = len(data[0])
return [[i[j] for i in data_set] for j in range(n)]
... |
16,540 | d1d66729bece2e2cb12200900854e9651cf05965 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Tom.Lee
import platform
import time
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.forms import forms
from .file_tools import copy_file
from .file_tools import rename_file
from .http_funcs import json_response
from ..settin... |
16,541 | 50eebbd7f324117fd6dd9e519eb4c89d6d6bf458 | # Scrapes Tripadvisor restaurant page for data
'''
Code in this file scrapes all of the desired information (name, rating, price, address,
city, state, zipcode, country, phone #) on Tripadvisor. We did not use this in our final
implementation because of difficulties building a crawler, and thus this code was disconti... |
16,542 | f14a8eb14ff4885b8d875497c11b10abbaad78ca | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from linha_do_tempo import Event
def invencoes(limites = None):
lista = [
(1774, "Barco a vapor"),
(1811, "Prensa a vapor"),
(1825, "Linha Fรฉrrea"),
(1885, "Automรณvel"),
(1903, "Aviรฃo"),
(1913, "Linha de Montagem Ford T"),
(1876, "Telefone"),
]
create_e... |
16,543 | f02e832e8c60bc3dcd26938003e0bbe03aac74cb | from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
sa = SentimentIntensityAnalyzer()
reddit_quotes = [
'I had such low expectations and I still managed to fail my expectations.',
"big facts, 170 was decently cool (coming from someone who really enjoyed 70... I thought I'd like 170 more than ... |
16,544 | cc670e7b9c6683a8c1dd4f6ccf5c9b72d250a3fc | # Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... |
16,545 | edcb2f6e998089446593e24664af551f52a7f6ce | from .home.views import bp as home_blueprint
from .auth.views import jwt_views |
16,546 | b6fd38cee5609e1d4e56864333c2383c8a959226 | # Author: Mark Harmon
# Purpose: Make labels and final trading data for input into recurrent model for tick data
# This is to make my training set and labels for the cnn sequence. I'm going to treat it similarly to a video problem
# by having one sequence == one image. This model should inherently be better than... |
16,547 | c1ece249b4a36b3220bb75e1781c867190d25dc1 | #!/usr/bin/python
import sys
# We assume we know the dimensions of the final matrix output (m row, n columns)
# Here we will set m and n for our matrix example where A is (2 x 3) and B is (3 x 2) so C is (2 x 2)
# Since python indexing starts at 0 it has column indexes 0 and 1 (same for rows)
# IMPORTANT : - If you ... |
16,548 | 2d15e89d0e5a058452ebc11a78b0d75134c554f7 | # If a number c can be writen in a^2 + b^2 = c^2 or not, not yet solved
# Problem link: https://leetcode.com/contest/leetcode-weekly-contest-39/problems/sum-of-square-numbers/
import math
class Solution(object):
def primes(self,n):
primfac = []
d = 2
while d*d <= n:
wh... |
16,549 | 04b7ddbc13d35765845de194783b24132209bb2d | from graphics import *
import time
from numpy import *
import math
win=GraphWin("circle polar 2",640,480)
def drawsympoints(a,b,x,y):
time.sleep(0.3)
win.plotPixel( x+a, y+b, "yellow")
win.plotPixel( y+a, x+b, "green")
win.plotPixel( y+a,-x+b, "red")
win.plotPixel( x+a,-y+b, "blue")
win.plotPixel(-x+a,-y+b, "blac... |
16,550 | ef2cd38eb0f374379288ab7b449df654ab39f3ed | from django.apps import AppConfig
class Object2BookConfig(AppConfig):
name = 'object2book'
|
16,551 | 2682400549f788a1602bba67d0b1bb14160e7319 | #
def main():
print("Change Counter, by Khalid Hussain", "\n")
price = float(input("Price?: "))
amount_tendered = float(input("Amount tendered?: "))
change_due = round(amount_tendered - price, 2)
price_for_me = int(price * 100)
amount_tendered_for_me = int(amount_tendered * 100)
... |
16,552 | 8863d97aba36cd73027363c00db39666be8f5acc | from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import render
from .models import Product
from .forms import ProductForm, LoginForm
def home(request):
return HttpResponseRedirec... |
16,553 | c25ac83432640c8cd0758804f9afb50dca899036 | N = int(input())
E = int(input())
known = [0] * N
next_song = 0
for e in range(E):
K = [int(i) for i in input().split()][1:]
if 1 in K:
for k in K:
known[k - 1] |= 1 << next_song
next_song += 1
else:
share = 0
for k in K:
share |= known[k - 1]
for k in K:
known[k - 1] = share
for n, k in enumerate... |
16,554 | a5704dc2e5dc1951b0827920c56b7e6294a92646 | class Solution:
def DFS(self, candidates, target, start, valuelist):
length = len(candidates)
if target == 0 and valuelist not in Solution.ret: return Solution.ret.append(valuelist)
for i in range(start, length):
if target < candidates[i]:
return
self.... |
16,555 | 8cf4954e683437ad16a518b0590c68a8de09f9d6 | # -*- coding: utf-8 -*-
from watchdog.events import PatternMatchingEventHandler
from .functions import *
class BaseFileEventHandler(PatternMatchingEventHandler):
'''Looking for FileSystem events for base file and do something'''
def __init__(self, patterns, mainWindow):
super().__init__(patterns)
self.mainWind... |
16,556 | 38435ce82f0e8dd9e4282966f9ecee30160f2dfe | """A lightweight wrapper around PyMySQL for easy to use
Only for python 3
"""
import time
import traceback
import pymysql
import pymysql.cursors
class ConnectionSync:
def __init__(self, host, database, user, password,
port=0,
max_idle_time=7*3600,
connect_timeou... |
16,557 | 74510d90a000ad56910bc3321bc7702f0a120ba2 | import json
from j2v.generation.generator import Generator
from j2v.generation.result_writer import SQLWriter, LookerWriter
from j2v.utils.config import generator_config, supported_dialects
from j2v.utils.helpers import get_formatted_var_name
TABLE_WITH_JSON_COLUMN_DEFAULT = generator_config['TABLE_WITH_JSON_COLUMN_D... |
16,558 | 8e0f0010c8975f8b9403618bb87cff2e12611e68 | import time, sys
from tracks.models import Album
from .main import connect_to_broker
from .get_artist_albums import sleepWithHeartbeats
from .requeue_all_artists import publish
def run() :
try :
time_start = time.time()
albums_ids = [str(album.deezer_id) for album in Album.objects.all()]
... |
16,559 | fd2b8e17c0b129309d137629264b360c6e8a385d | # Generated by Django 3.2 on 2021-05-30 00:00
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('web', '0005_smartctl_date'),
]
operations = [
migrations.RemoveField(
model_name=... |
16,560 | b44425d125cb0ee7ceb295eea01fd2cb5c618152 | from scrapy import cmdline
if __name__ == '__main__':
cmdline.execute(['scrapy', 'crawl', 'jdSpider'])
|
16,561 | 667b30a763b29a5a32a6a7e8d28725fc8cc94cb9 | import numpy as np
## from qiskit_textbook.tools import array_to_latex
class Tr:
"""
This is a Python Class to compute traces and partial traces of (4 times 4) matrices.
# Example
If you want to calculate the matrix M using this class, you can call the method in the class as follows
```python
... |
16,562 | b98218bd0f579369ede39c2375b7b7753c96f405 | def errors(err_code):
err_dict = {
0: '์ ์์ฒ๋ฆฌ',
-10: '์คํจ',
-100: '์ฌ์ฉ์์ ๋ณด๊ตํ์คํจ',
-102: '๋ฒ์ ์ฒ๋ฆฌ์คํจ',
-103: '๊ฐ์ธ๋ฐฉํ๋ฒฝ์คํจ',
-104: '๋ฉ๋ชจ๋ฆฌ๋ณดํธ์คํจ',
-105: 'ํจ์์
๋ ฅ๊ฐ์ค๋ฅ',
-106: 'ํต์ ์ฐ๊ฒฐ์ข
๋ฃ',
-200: '์์ธ์กฐํ๊ณผ๋ถํ',
-201: '์ ๋ฌธ์์ฑ์ด๊ธฐํ์คํจ',
-202: '์ ๋ฌธ์์ฑ์
๋ ฅ๊ฐ์ค๋ฅ',
-203: ... |
16,563 | 1159635222a7389fa2fee133eb56cddde06edbb7 | f=open("list",mode="w")# wไธบๅๅปบๆจกๅผ๏ผๆฏๆฌก้ฝๆฏๆฐๅปบไธไธช๏ผๅฆๆๅญๅจๅฐฑ่ฆ็ๅๆฅ็
f.write("1\n")
f.write("2\n") #ๅชๆ่ฟๆ ทๆ่ฝๆข่ก
f.write("3\n")
f.close( )
|
16,564 | 20f39a17500620af161261a8c153f8c13fc13f7c | from django.apps import AppConfig
class AnnaConfig(AppConfig):
name = 'anna'
|
16,565 | bfe968b656286f6dc098098acb83d9f212ef7702 | from copy import deepcopy
from random import randrange, random
from typing import List, Dict
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics.classification import accuracy_score, log_loss
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels impor... |
16,566 | fcb86623b1a7f11c1d5f6e225da97f02340cdb2d | def aniversariantes_de_setembro(dic_aniversariantes):
dic_aniversariantes_setembro = {}
for chave, valor in dic_aniversariantes.items(): # cria dois contadores, primeiro รฉ chave, segundo รฉ valor
if (valor[3:5] == "09"): #Da posiรงรฃo 3 atรฉ a 5 (05, 09, etc) do item valor (cada par: nome, data)
... |
16,567 | daff1a757a84c2701b8be7af696eeb302285fdc9 | class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
sList = list(S)
for i in range(length):
if sList[i] == ' ':
sList[i] = '%20'
return ''.join(sList[:length])
|
16,568 | 8e814f0beec992b4e86e5c54cb23ae619549eea8 | #!/usr/bin/python
# Create MCP patches between releases of Forge from git history
import subprocess, os
srcRoot = "../MinecraftForge"
outDir = "../jars/upstream-patches/forge" # relative to srcRoot
startCommit = "feca047114562c2ec2ec6be42e3ffd7c09a9a94d" # build 528, Update FML to 556..
#startCommit = "6673844c54b8de... |
16,569 | 4f38800a41bb89aeb094729097ddda42360c6dc4 | import testlib
fee = 20
initialsend = 200000
capacity = 1000000
def run_test(env):
bc = env.bitcoind
lit1 = env.lits[0]
lit2 = env.lits[1]
# Connect the nodes.
lit1.connect_to_peer(lit2)
# First figure out where we should send the money.
addr1 = lit1.make_new_addr()
print('Got lit1 a... |
16,570 | 81477d0fd93a7b847e1d1e1c1e91e248ad65c3d7 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Food
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
# Create your views here.
def home(request):
context = {
'foods': Food.objects.all(),
}
i... |
16,571 | 8d21ae539025bee059bfcf5b4b2ef8a656b1c31a | #!/usr/bin/env python
"""
Secret Santa script.
"""
import logging
import os
import random
from argparse import ArgumentParser
from email.mime.text import MIMEText
import yaml_utils
from log_utils import log_setup
from smtp_conn import SmtpConn
def opt_setup():
parser = ArgumentParser()
parser.add_argument... |
16,572 | 7482081591821e13be2fa36d2795c8d9f28a8c64 | import numpy as np
from wafo.spectrum.models import (Bretschneider, Jonswap, OchiHubble, Tmaspec,
Torsethaugen, McCormick, Wallop)
def test_bretschneider():
S = Bretschneider(Hm0=6.5,Tp=10)
vals = S((0,1,2,3))
true_vals = np.array([ 0. , 1.69350993, 0.063... |
16,573 | 297ef9d9fac46572f77faab35c5a3bb9038021f5 | import os
import shutil
import time
train_folder_name = 'train'
validation_folder_name = 'val'
test_folder_name = 'test'
CURRENT_FOLDER = os.path.dirname(os.path.abspath(__file__))
def prepare_folders_and_data(path_src, path_dest, make_test_folder=False):
print("DATA FOLDER: {}".format(path_dest))
for (dir... |
16,574 | 105b568b8b06e77d0921946db4ab89fcb253cb99 | def locate_all(string, sub):
matches = []
index = 0
while index < len(string):
if string[index: index + len(sub)] == sub:
matches.append(index)
index += len(sub)
else:
index += 1
return matches
# Here are a couple function calls to test with.
print(l... |
16,575 | 27f58e378a83911cbea1cea85697486293d3bc7e | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import tensorflow as tf
#from keras.layers import Input, Dense, Lambda
#from k... |
16,576 | ffb07b87e7a044943ba909306d4cd0fde08f18a9 | from App.UI import create_app
from config import TestConfig
import unittest
import flask_unittest
from App.Data.Models.users import User
class TestRegistration(flask_unittest.ClientTestCase):
app = create_app(config_class=TestConfig)
def setUp(self, client) -> None:
pass
@staticmethod
def as... |
16,577 | 95810895564d58cf5f025b13b883d8b13c34ed7c | def normalize(name):
name = name.lower()
l = list(name)
l[0] = l[0].upper()
s = ''.join(l)
return s
L1 = ['adam', 'LISA', 'barT']
L2 = list(map(normalize, L1))
print(L2) |
16,578 | df6727ec863b50123e7ebc96cb418df317cac2a1 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2017, Gokturk Gok & Nurefsan Sarikaya.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# wit... |
16,579 | cd84831bb9940f8c5e4f4f497e715b4b6ae04419 | import smtplib
content = "Bu bir maildir"
mail = smtplib.SMTP("smtp.gmail.com",587)
mail.ehlo()
mail.starttls()
mail.login("metastaban@gmail.com","Qaz1907qaz.")
mail.sendmail("metastaban@gmail.com","mehmetemin@tastaban.net",content)
|
16,580 | d8ad3d77a02bb73a28d16b761727d6bceb9346b9 | __author__ = 'bill'
class Location(object):
def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude
def __str__(self):
return str(self.latitude) + "," + str(self.longitude) |
16,581 | 223e69ee41294604a2c7fb11ab53d50f6ee12e22 | from bot import Telegram_Chatbot
from chat_controller import Chat_Controller
# Instantiate bot with token specified in the config
my_bot = Telegram_Chatbot("config.cfg")
chat_controller = Chat_Controller()
def make_reply(message):
return "Okay cool"
update_id = None
while True:
updates = my_bot.get_updates(o... |
16,582 | 968258ff4a1b8997ec5ea507617a092011f534a9 | from struct import pack, unpack
import time
import re
import os
import _thread
# cofig if use existed dictionaries
USE_DICT_CREATED_PRIVIOUSLY = True
POLLING_TIME_FOR_ASSIGNMENT_ID = 0.5 # unit: second
HEART_PACKAGE_THREAD_STACK_SIZE = 8 * 1024
HEART_PACKAGE_THREAD_PRIORITY = 1
NO_VALID_FRAME = 0
HEAD_START ... |
16,583 | f3aeb0262a95983567b83841073498a2eddc0fac | class InvalidCommandException(Exception):
pass
class Block():
def __init__(self, x, y, data):
self.block = x+y*1j
self.data = data
def __getattr__(self, name):
return getattr(self.block, name)
def __repr__(self):
return repr(self.block)
class BlockStructure():
... |
16,584 | 9286e59ee98f7ca094d11e73285409f99fe45960 | from flask import Flask, request, jsonify, send_from_directory
from flask_cors import CORS
from uuid import uuid4
import glob, os
import pypdftk
from zipfile import ZipFile
app = Flask(__name__)
CORS(app)
production = False
pdf_path = "./files" # PDFS PFAD ANGEBEN !
filled_p... |
16,585 | 4917be0405d1ea6155f90ffa29ba71eed43e9426 | """
The backend of the configurable-ranking-system
Uses Flask
__init__.py initializes the app
db.py stores basic database connection related methods
tables.py stores all api routes for interacting with tables (details included there)
General API model (not necessarily representative of the actual backend implementati... |
16,586 | 9d0f7ac2f06ef0c16bdc04910b8bfe55deabbd09 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
from pathlib import Path
import testslide
from ... import error
from .. import incremental, subscription
class Subscription... |
16,587 | b9952bd8da221625f5ddf7036463ce1f406f9069 | #!/usr/bin/env python
# coding: utf-8
# In[45]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from numpy import set_printoptions
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection impo... |
16,588 | 5a2c6b0919236a770389c8fed818f656293413c3 | from flask import Flask, request
from src.measuring.postProcessMeasuring import PostProcessMeasuring
from src.prediction.predictionWrapper import PredictionWrapper
from src.utilities.errorFunctions import imagesMeanSquareError
from src.utilities.errorFunctions import trueSkillStatistic
app = Flask(__name__)
import ... |
16,589 | 643bc17a99624e4acf958251485a1bc76a87572d | # Generated by Django 3.1 on 2020-11-18 18:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... |
16,590 | 76ab203ad958270719b6b40f596b358232b87591 | from django.contrib.gis.db import models
# Create your models here.
class Shop(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
location = models.PointField()
|
16,591 | 05a4cfaaf8412860168028b58abf3ec253bc3bde | import FWCore.ParameterSet.Config as cms
process = cms.Process("LHCX")
process.source = cms.Source("NewEventStreamFileReader",
fileNames = cms.untracked.vstring('file:/tmp/avetisya/run273450/streamPhysicsEGammaCommissioning/data/run273450_ls0065_streamPhysicsEGammaCommissioning_StorageMana... |
16,592 | feaace838a266ecc4caf04656874d6089eadbed2 | import requests
import os,sys
import json
sys.path.append(os.getcwd())
from common.login import addCookie
from common.environment import env
params={
'appSysNo':None,
'areaCode': None,
'expandIntelliApp': 'true',
'followOrganizationCode': "0001",
'isInternal': None, # null --ๅ
จ็ 1--ๅขๅ
2--ๅขๅค
'... |
16,593 | 215d68ce90ec49571bdda0c89b2c5bd8cbea308e | from django.urls import path
from .views import BuyBasketView
urlpatterns = [
path('', BuyBasketView.as_view())
]
|
16,594 | 171f94a69731c170fe1e17fe8188e052a9753842 | def solve():
number_Of_Integers = int(input())
number_Arrays = list(map(int, input().split(' ')))
number_Of_Find_Integers = int(input())
find_Integers = list(map(int, input().split(' ')))
for count in range(number_Of_Integers):
temp = False
for find_Count in range(number_Of_Find_Inte... |
16,595 | 25deadd038944e95b9f949cea527832e174a37a6 | import pytest
import time
link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/"
def test_add_to_basket_button_is_present(browser):
browser.get(link)
# Uncomment next line to check the page language
#time.sleep(30)
items = browser.find_elements_by_css_selector("form#add_to_basket... |
16,596 | d64d17060894cae2525e42ea99796d4f1b9a5746 | """Test Mapchete default formats."""
import datetime
import json
import pytest
from rasterio.crs import CRS
from tilematrix import TilePyramid
import mapchete
from mapchete import errors
from mapchete.formats import (
available_input_formats,
available_output_formats,
base,
driver_from_extension,
... |
16,597 | 899a446e9c9479a2b5ff5889f64a720b628c14ac | import math
def mdc(x,y,z):
return mdcAux(x, mdcAux(y, z))
def mdcAux(x, y):
if (x%y == 0):
return y
else:
return mdcAux(y,x % y)
def a(x,y,z):
s = (y**2) + (z**2)
if(s == x**2):
return True
else:
return False
def b(x,y,z):
s = (x**2) + (z**2)
if(s == ... |
16,598 | eaa251901a5f0542bf8350f3ac126bd40c8702f3 | from src.architecture.ImageConverter import BinVec2RGBMatrix, RGBMatrix2BinVec
from src.architecture.Input import importImage, exportImage
from src.util import Function as Function
def simulateNoiseEffect(p, input_file, output_file):
image = importImage(input_file)
bin_image = RGBMatrix2BinVec(image)
row... |
16,599 | 23c129e93a3ccbb284b941a61640dad694e9883d | import csv
import json
from StringIO import StringIO
content = open('case_studies_aliases.txt', 'r')
jsonfile = open('case_studies_aliases.json', 'w')
reader = csv.DictReader( content, quotechar='"', delimiter=';', escapechar='\\')
out=[]
for row in reader:
row['filename'] = row['filename'].split('/')[-1]
out... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.