index int64 0 100k | blob_id stringlengths 40 40 | code stringlengths 7 7.27M | steps listlengths 1 1.25k | error bool 2
classes |
|---|---|---|---|---|
2,100 | 881d0c0808d8c0e656cdbf49450367553c100630 | # แแก แแ แแก แแแแ, แ แแแแแแช แฅแแแแก แแแกแฃแ แแก
import random
def get_all_words():
words = [] # แแก แแ แแก แแแกแขแ แงแแแแ แแกแแแ แกแแขแงแแแก
with open("poem.txt") as poem: # แ แแแแแก แแกแแแแแก แกแแแ แแแแแช 6-แแ แแแแแแแแ
for line in poem: # แแ แซแแ แกแแขแงแแแแแแ แแแแแจแ แ แแฃแ... | [
"# แแก แแ แแก แแแแ, แ แแแแแแช แฅแแแแก แแแกแฃแ แแก\nimport random\n\n\ndef get_all_words():\n words = [] # แแก แแ แแก แแแกแขแ แงแแแแ แแกแแแ แกแแขแงแแแก\n with open(\"poem.txt\") as poem: # แ แแแแแก แแกแแแแแก แกแแแ แแแแแช 6-แแ แแแแแแแแ\n for line in poem: # แแ แซแแ แกแแขแงแแแแ... | false |
2,101 | d24bbfc3587a2a79891a11e00ec865498c01c286 | from Crypto.PublicKey import DSA
from Crypto.Signature import DSS
from Crypto.Hash import SHA256
import os
import time
kB = 1024 # 1kB
with open('small_file.txt', 'wb') as f:
f.write(os.urandom(kB))
mB = 10485760 # 1GB
with open('large_file.txt', 'wb') as f:
f.write(os.urandom(mB))
Begin = time.time()
key = ... | [
"from Crypto.PublicKey import DSA\nfrom Crypto.Signature import DSS\nfrom Crypto.Hash import SHA256\nimport os\nimport time\n\nkB = 1024 # 1kB\nwith open('small_file.txt', 'wb') as f:\n f.write(os.urandom(kB))\n\nmB = 10485760 # 1GB\nwith open('large_file.txt', 'wb') as f:\n f.write(os.urandom(mB))\n\nBegin =... | false |
2,102 | 6fc43919f521234d0dc9e167bb72f014e9c0bf17 |
import sys
from PySide6.QtCore import *
from PySide6.QtWidgets import *
from PySide6.QtGui import *
from simple_drawing_window import *
class simple_drawing_window1( simple_drawing_window):
def __init__(self):
super().__init__()
def paintEvent(self, e):
p = QPainter()
p.begin(self)
"""
p.setPen(Q... | [
"\nimport sys\nfrom PySide6.QtCore import *\nfrom PySide6.QtWidgets import *\nfrom PySide6.QtGui import *\nfrom simple_drawing_window import *\n\nclass simple_drawing_window1( simple_drawing_window):\n\tdef __init__(self):\n\t\tsuper().__init__()\n \n\tdef paintEvent(self, e):\n\t\tp = QPainter()\n\t\tp.begi... | false |
2,103 | 4f15e2743b33e2f672cd258172da852edb7e4118 | from utils import *
EvinceRelation("different from")
| [
"from utils import *\n\nEvinceRelation(\"different from\")\n\n",
"from utils import *\nEvinceRelation('different from')\n",
"<import token>\nEvinceRelation('different from')\n",
"<import token>\n<code token>\n"
] | false |
2,104 | 9d8c4bf9f9279d5e30d0e9742cdd31713e5f4b9e | from app import app
from flask import request
@app.route('/')
@app.route('/index')
def index():
return 'Hello world'
@app.route('/api_post', methods = ['POST'])
def postJsonHandler():
print (request.is_json)
content = request.get_json()
print (content)
return 'JSON posted'
| [
"from app import app\nfrom flask import request\n\n@app.route('/')\n@app.route('/index')\ndef index():\n return 'Hello world'\n\n@app.route('/api_post', methods = ['POST'])\ndef postJsonHandler():\n print (request.is_json)\n content = request.get_json()\n print (content)\n return 'JSON posted'\n",
... | false |
2,105 | 166520ab5b9fd5a55dd2aa30b4d62f55096ce6cb | #!/usr/bin/env python
import sys
import typer
from cupcake import version_callback
from cupcake.sequence import GFF
app = typer.Typer(
name="cupcake.sequence.get_gffs_from_list",
help="Get records from a GFF file from a list",
)
def get_gff_from_list(gff_filename, listfile, partial_ok=False):
seqs = [l... | [
"#!/usr/bin/env python\nimport sys\n\nimport typer\n\nfrom cupcake import version_callback\nfrom cupcake.sequence import GFF\n\napp = typer.Typer(\n name=\"cupcake.sequence.get_gffs_from_list\",\n help=\"Get records from a GFF file from a list\",\n)\n\n\ndef get_gff_from_list(gff_filename, listfile, partial_o... | false |
2,106 | e6884afaae15e903c62eecb3baec868548998080 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-31 17:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('words', '0004_auto_20180330_0647'),
]
operations = [
migrations.AddField(
... | [
"# -*- coding: utf-8 -*-\n# Generated by Django 1.11.11 on 2018-03-31 17:58\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('words', '0004_auto_20180330_0647'),\n ]\n\n operations = [\n mi... | false |
2,107 | 1a42892095d820f1e91ba5e7f2804b5a21e39676 | from tkinter import *
from math import *
#Raiz
root=Tk()
root.title('Calculadora LE-1409')
root.iconbitmap('calculadora.ico')
root.geometry('510x480')
root.config(bg='gray42')
root.resizable(False, False)
#Pantalla
screen=Entry(root, font=("arial",20, "bold"), width=22, borderwidth=10, background="CadetBlue1", justi... | [
"from tkinter import *\nfrom math import *\n\n\n#Raiz\nroot=Tk()\nroot.title('Calculadora LE-1409')\nroot.iconbitmap('calculadora.ico')\nroot.geometry('510x480')\nroot.config(bg='gray42')\nroot.resizable(False, False)\n\n#Pantalla\nscreen=Entry(root, font=(\"arial\",20, \"bold\"), width=22, borderwidth=10, backgrou... | false |
2,108 | 4545d9756d1f396ead0b0c75d319fb6a718375cd | sentence = input()
check_list = ["U", "C", "P", "C"]
check = True
for i in range(len(check_list)):
if check_list[i] in sentence:
check = True
idx = sentence.find(check_list[i])
sentence = sentence[idx+1:]
else:
check = False
break
if check == True:
print("I love UCP... | [
"sentence = input()\ncheck_list = [\"U\", \"C\", \"P\", \"C\"]\ncheck = True\n\nfor i in range(len(check_list)):\n if check_list[i] in sentence:\n check = True\n idx = sentence.find(check_list[i])\n sentence = sentence[idx+1:]\n else:\n check = False\n break\n\nif check == T... | false |
2,109 | c71e367ad320d7eadabbbfda728d94448db6441d | #!/usr/bin/python
# Point of origin (connector J3, pad 1, net 3V3)
x = 0.0
y = 0.0
drillDiameter = 1.0
padWidth = 1.6
from os.path import exists
from pad import *
filename="iCEstick.kicad_mod"
header = ""
footer = ""
if exists(filename):
# Read existing footprint
f = open(filename)
footprint = f.read... | [
"#!/usr/bin/python\n\n# Point of origin (connector J3, pad 1, net 3V3)\nx = 0.0\ny = 0.0\n\ndrillDiameter = 1.0\npadWidth = 1.6\n\n\nfrom os.path import exists\nfrom pad import *\n\nfilename=\"iCEstick.kicad_mod\"\n\nheader = \"\"\nfooter = \"\"\n\nif exists(filename):\n # Read existing footprint\n f = open(f... | false |
2,110 | 463f50567c9dd4b7b47a84eea715541cec5d3cb5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Dang Kai
# @Date: 2018-10-30 15:52:57
# @Last Modified time: 2018-11-10 09:09:21
# @E-mail: 1370465454@qq.com
# @Description:
from time import sleep
import sys
sys.path.append('../')
from common.encapsulation import BasePage
class IndexPage:
def login(self... | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Author: Dang Kai\n# @Date: 2018-10-30 15:52:57\n# @Last Modified time: 2018-11-10 09:09:21\n# @E-mail: 1370465454@qq.com\n# @Description:\nfrom time import sleep\nimport sys\nsys.path.append('../')\nfrom common.encapsulation import BasePage\n\n\nclass IndexPage:\n... | false |
2,111 | 7ee5779625d53ff1e18f73b20ba5849666f89b55 | #/usr/bin/env python3
"""Demonstrates how to do deterministic task generation using l2l"""
import random
def fixed_random(func):
"""Create the data"""
def _func(self, i):
state = random.getstate()
if self.deterministic or self.seed is not None:
random.seed(self.seed + i)
... | [
"#/usr/bin/env python3\n\n\"\"\"Demonstrates how to do deterministic task generation using l2l\"\"\"\nimport random\n\ndef fixed_random(func):\n \"\"\"Create the data\"\"\"\n def _func(self, i):\n state = random.getstate()\n if self.deterministic or self.seed is not None:\n random.see... | false |
2,112 | 270dba92af583e37c35ed5365f764adfdc2f947d | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: TopJSON driver test suite.
# Author: Even Rouault
#
###############################################################################
# Copyr... | [
"#!/usr/bin/env pytest\n# -*- coding: utf-8 -*-\n###############################################################################\n# $Id$\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: TopJSON driver test suite.\n# Author: Even Rouault\n#\n#########################################################################... | false |
2,113 | 6c641ace8f1e5e8c42fa776bd7604daf243f9a41 | import torch
import torchvision.transforms.functional as F
import numpy as np
import yaml
from pathlib import Path
IGNORE_LABEL = 255
STATS = {
"vit": {"mean": (0.5, 0.5, 0.5), "std": (0.5, 0.5, 0.5)},
"deit": {"mean": (0.485, 0.456, 0.406), "std": (0.229, 0.224, 0.225)},
}
def seg_to_rgb(seg, colors):
i... | [
"import torch\nimport torchvision.transforms.functional as F\nimport numpy as np\nimport yaml\nfrom pathlib import Path\n\nIGNORE_LABEL = 255\nSTATS = {\n \"vit\": {\"mean\": (0.5, 0.5, 0.5), \"std\": (0.5, 0.5, 0.5)},\n \"deit\": {\"mean\": (0.485, 0.456, 0.406), \"std\": (0.229, 0.224, 0.225)},\n}\n\n\ndef ... | false |
2,114 | d373d283a622262e2da974549907bdd8f61e89ec | from flask import Flask, render_template, redirect, request, session, flash
from data import db_session
from data import users, products
import os
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField, SelectField, IntegerField
from wtforms.fields.html5 import E... | [
"from flask import Flask, render_template, redirect, request, session, flash\r\nfrom data import db_session\r\nfrom data import users, products\r\nimport os\r\nfrom flask_wtf import FlaskForm\r\nfrom wtforms import StringField, PasswordField, SubmitField, BooleanField, SelectField, IntegerField\r\nfrom wtforms.fiel... | false |
2,115 | ce12ede15f4ca4a085e38e455515d8a028da8fd2 | import FWCore.ParameterSet.Config as cms
class StageOneCustomize():
"""
Customizaton class for STXS stage 1 analysis
"""
def __init__(self, process, customize, metaConditions):
self.process = process
self.customize = customize
self.metaConditions = metaConditions
se... | [
"import FWCore.ParameterSet.Config as cms\n\nclass StageOneCustomize():\n \"\"\"\n Customizaton class for STXS stage 1 analysis\n \"\"\"\n \n def __init__(self, process, customize, metaConditions):\n self.process = process\n self.customize = customize\n self.metaConditions = meta... | false |
2,116 | cc703690151acd17430b5a9715e71a694fdeca10 | '''
Can you print numbers from 1 to 100 without using any loop.
'''
# Use Recursion | [
"'''\nCan you print numbers from 1 to 100 without using any loop.\n'''\n\n# Use Recursion",
"<docstring token>\n"
] | false |
2,117 | ea3b8fe602357fa3d1de4daefce1e71a7de6e010 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 31 16:55:33 2018
@author: GEAR
"""
'''
ๅจOpenCVไธญๆ่ถ
่ฟ150ไธญ่ฟ่ก้ข่ฒ่ฝฌๆข็ๆนๆณ๏ผไฝๆไปฌ็ปๅธธ็จๅฐ็ไธ่ฌๅชๆไธค็ง๏ผ
BGR <-> Gray ๅ BGR <-> HSV
ๆไปฌ้่ฆ็จๅฐ็ๅฝๆฐๆ๏ผcv2.cvtColor(input_image, flag),ๅ
ถไธญflagๆฏ่ฝฌๆข็ฑปๅ
ๅฏนไบBGR <-> Gray๏ผๆไปฌ็จๅฐ็flagไธบcv2.COLOR_BGR2GRAY,ไฝๆไปฌ่ฆๆณจๆๅจOpenCV
ไธญHSVๆ ผๅผไธญH ่ฒๅฝฉ/ไบฎๅบฆ ็ๅๅผ่ๅดๆฏ[0 179], S ้ฅฑๅๅบฆ ๅ V ไบฎๅบฆ็ๅๅผ่ๅดๆฏ
[0... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Aug 31 16:55:33 2018\n\n@author: GEAR\n\"\"\"\n\n'''\nๅจOpenCVไธญๆ่ถ
่ฟ150ไธญ่ฟ่ก้ข่ฒ่ฝฌๆข็ๆนๆณ๏ผไฝๆไปฌ็ปๅธธ็จๅฐ็ไธ่ฌๅชๆไธค็ง๏ผ\nBGR <-> Gray ๅ BGR <-> HSV\nๆไปฌ้่ฆ็จๅฐ็ๅฝๆฐๆ๏ผcv2.cvtColor(input_image, flag),ๅ
ถไธญflagๆฏ่ฝฌๆข็ฑปๅ\nๅฏนไบBGR <-> Gray๏ผๆไปฌ็จๅฐ็flagไธบcv2.COLOR_BGR2GRAY,ไฝๆไปฌ่ฆๆณจๆๅจOpenCV\nไธญHSVๆ ผๅผไธญH ่ฒๅฝฉ/ไบฎๅบฆ ็ๅๅผ่ๅดๆฏ[0 179]... | false |
2,118 | d7876a078af8572e44b4eb16f3ec0898db73724d | a = (5, 1, 3, 5, 3, 1, 0, 9, 5, 3, 8, 6, 5, 7)
b = []
for index, elements in enumerate (a):
if elements == 5:
b.append(index)
print(b) | [
"a = (5, 1, 3, 5, 3, 1, 0, 9, 5, 3, 8, 6, 5, 7)\r\nb = []\r\nfor index, elements in enumerate (a):\r\n if elements == 5:\r\n b.append(index)\r\nprint(b)",
"a = 5, 1, 3, 5, 3, 1, 0, 9, 5, 3, 8, 6, 5, 7\nb = []\nfor index, elements in enumerate(a):\n if elements == 5:\n b.append(index)\nprint(b... | false |
2,119 | 977841e0bb73cec879fbb1868f1e64102c6d8c1a | import requests
import os
import numpy as np
from bs4 import BeautifulSoup
from nltk import word_tokenize
from collections import Counter
import random
from utils import save_pickle
root = 'data'
ratios = [('train', 0.85), ('valid', 0.05), ('test', 0.1)]
max_len = 64
vocab_size = 16000
data = []
path = os.path.joi... | [
"import requests\nimport os\nimport numpy as np\nfrom bs4 import BeautifulSoup\nfrom nltk import word_tokenize\nfrom collections import Counter\nimport random\n\nfrom utils import save_pickle\n\n\nroot = 'data'\nratios = [('train', 0.85), ('valid', 0.05), ('test', 0.1)]\nmax_len = 64\nvocab_size = 16000\n\n\ndata =... | false |
2,120 | cc924892afe179e55166ea9b237b2bfe8ea900df | from tkinter import *
from tkinter import messagebox
from tkinter import ttk
from PIL import Image, ImageTk
import time
import socket
import threading
root = Tk()
root.title("Tic-Tac-Toe")
root.geometry('600x600')
winner = False
def start_thread(target):
thread = threading.Thread(target=target)
... | [
"from tkinter import *\r\nfrom tkinter import messagebox\r\nfrom tkinter import ttk\r\nfrom PIL import Image, ImageTk\r\nimport time\r\nimport socket\r\nimport threading\r\nroot = Tk()\r\nroot.title(\"Tic-Tac-Toe\")\r\nroot.geometry('600x600')\r\n\r\n\r\nwinner = False\r\n\r\ndef start_thread(target):\r\n thread... | false |
2,121 | 2af590ad11704ecf21489a5d546e61f40dcceee6 | from django.contrib import admin
from .models import Cliente, Pack
# Register your models here.
admin.site.register(Pack)
admin.site.register(Cliente)
| [
"from django.contrib import admin\nfrom .models import Cliente, Pack\n\n# Register your models here.\nadmin.site.register(Pack)\nadmin.site.register(Cliente)\n",
"from django.contrib import admin\nfrom .models import Cliente, Pack\nadmin.site.register(Pack)\nadmin.site.register(Cliente)\n",
"<import token>\nadm... | false |
2,122 | 92317996f884befd646138cd3a3dc3f8345679f4 | import sys
import os
import numpy as np
import math
sys.path.append("../")
from sir.improveagent import *
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
#from sklearn.neighbors import BallTree
from scipy.spatial import KDTree
from scipy.spatial import cKDTree
from scipy.spatial.distance im... | [
"import sys\nimport os\nimport numpy as np\nimport math\nsys.path.append(\"../\")\nfrom sir.improveagent import *\nimport numpy as np\nimport numpy.linalg as la\nimport matplotlib.pyplot as plt\n#from sklearn.neighbors import BallTree\nfrom scipy.spatial import KDTree\nfrom scipy.spatial import cKDTree\nfrom scipy.... | false |
2,123 | cffcfa08cd919f93dfe2ab8dc676efc76feafab3 | # coding=utf-8
"""
PYOPENGL-TOOLBOX UTILS
General purpouse functions.
MIT License
Copyright (c) 2015-2019 Pablo Pizarro R.
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, inc... | [
"# coding=utf-8\n\"\"\"\nPYOPENGL-TOOLBOX UTILS\nGeneral purpouse functions.\n\nMIT License\nCopyright (c) 2015-2019 Pablo Pizarro R.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software with... | false |
2,124 | 817d7259b3607f3a94d2f363c9684f733ee87d37 | from django.db import models
# Create your models here.
class Author(models.Model):
AuthorID = models.IntegerField(primary_key=True)
Name = models.CharField(max_length=200)
Age = models.IntegerField(max_length=50)
Country = models.CharField(max_length=100)
class Book(models.Model):
ISBN = models.C... | [
"from django.db import models\n\n# Create your models here.\nclass Author(models.Model):\n AuthorID = models.IntegerField(primary_key=True)\n Name = models.CharField(max_length=200)\n Age = models.IntegerField(max_length=50)\n Country = models.CharField(max_length=100)\n\nclass Book(models.Model):\n ... | false |
2,125 | 2a8032c23e3c7aa3a7b0593c79db7adbc0353f93 |
import pygame
import os
from time import sleep
screen = pygame.display.set_mode((900,700))
screen.fill((255,255,255))
pygame.display.set_caption("NTUFOODIERECOMMENDSYSTEM")
'''
###########################
โโโโโโโโโโ
โโโโโโโโโโโ
โโโโ โฆโโโฌโโโฌโฆโโโฆโโโโโโฆโโฆโโโโ
โโโโ โฃโโโโโโ โฃโโโโโโฃโโโโโฃโโโโ
โโโโโโโโโโโฃโโโโโ... | [
"\r\n\r\nimport pygame\r\nimport os\r\nfrom time import sleep\r\n\r\nscreen = pygame.display.set_mode((900,700))\r\nscreen.fill((255,255,255))\r\npygame.display.set_caption(\"NTUFOODIERECOMMENDSYSTEM\")\r\n\r\n'''\r\n###########################\r\nโโโโโโโโโโ\r\nโโโโโโโโโโโ\r\nโโโโ โฆโโโฌโโโฌโฆโโโฆโโโโโโฆโโฆโโโโ\r\nโโโโ โฃโโโ... | false |
2,126 | ee91e8c9dcb940882733b2d23b74a76d0392f4fe | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
import os
from qtpy.QtCore import *
# from qtpy.QtGui import *
from qtpy.QtWidgets import *
from six import string_types
from ..widgets import PathParamWidget, RelPathParamWidget, FilePath... | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import, unicode_literals\n\nimport os\n\nfrom qtpy.QtCore import *\n# from qtpy.QtGui import *\nfrom qtpy.QtWidgets import *\nfrom six import string_types\n\nfrom ..widgets import PathParamWidget, RelPathParam... | false |
2,127 | 8f1ec65ca60605747f46f596e0b5848922bcd0b5 | from day6input import *
groups = input.split('\n\n')
count = 0 #1
groupanswers = [] #2
for group in groups:
allananswers = set(list('abcdefghijklmnopqrstuvwxyz')) #2
answers = set() #1
people = group.split('\n')
for person in people:
allananswers = allananswers & set(list(person)) #2
... | [
"from day6input import *\n\ngroups = input.split('\\n\\n')\n\ncount = 0 #1\ngroupanswers = [] #2\n\nfor group in groups:\n\n allananswers = set(list('abcdefghijklmnopqrstuvwxyz')) #2\n answers = set() #1\n\n people = group.split('\\n')\n for person in people:\n\n allananswers = allananswers & set... | false |
2,128 | 542bd52e3d5bc79077277034234419983005f78e | from paypalcheckoutsdk.core import PayPalHttpClient, SandboxEnvironment
from paypalcheckoutsdk.orders import OrdersCaptureRequest, OrdersCreateRequest
from django.conf import settings
import sys
class PayPalClient:
def __init__(self):
self.client_id = settings.PAYPAL_CLIENT_ID
self.client_secret ... | [
"from paypalcheckoutsdk.core import PayPalHttpClient, SandboxEnvironment\nfrom paypalcheckoutsdk.orders import OrdersCaptureRequest, OrdersCreateRequest\n\nfrom django.conf import settings\n\nimport sys\n\nclass PayPalClient:\n def __init__(self):\n self.client_id = settings.PAYPAL_CLIENT_ID\n self... | false |
2,129 | d71ec86f68cc81c93a39f15c785c75c2a1023f14 | import numpy as np
import pandas as pd
def fetch_data(faultNumber, position):
df1 = pd.read_csv("./data/TEP_CaseStudy_Fault_" + str(faultNumber) + "_Pos_" + str(position) + "%.csv")
df1.set_index(df1.columns[0])
df1 = df1.drop(columns=[df1.columns[0]])
df2 = pd.read_csv("./data/TEP_CaseStudy_Fault_" ... | [
"import numpy as np\nimport pandas as pd\n\n\ndef fetch_data(faultNumber, position):\n df1 = pd.read_csv(\"./data/TEP_CaseStudy_Fault_\" + str(faultNumber) + \"_Pos_\" + str(position) + \"%.csv\")\n df1.set_index(df1.columns[0])\n df1 = df1.drop(columns=[df1.columns[0]])\n\n df2 = pd.read_csv(\"./data/T... | false |
2,130 | fcb13b087b9c967ab16b64885411cc4aae98583c | from django.contrib import admin
from .models import Invite
class InviteAdmin(admin.ModelAdmin):
list_display = ('invitee', 'inviter', 'created_on',
'approved', 'rejected','used')
admin.site.register(Invite, InviteAdmin)
| [
"from django.contrib import admin\nfrom .models import Invite\n\nclass InviteAdmin(admin.ModelAdmin):\n list_display = ('invitee', 'inviter', 'created_on',\n 'approved', 'rejected','used')\n\nadmin.site.register(Invite, InviteAdmin)\n",
"from django.contrib import admin\nfrom .models import ... | false |
2,131 | 07dc058ecef323ffd41299245e4fcafdc9e41506 | from django.http import HttpResponse
from polls.models import Pregunta
from django.template import loader
def index(request):
preguntas = Pregunta.objects.order_by('-fecha')[:5]
template = loader.get_template('polls/index.html')
context = { 'listado': preguntas,}
return HttpResponse(template.render(c... | [
"from django.http import HttpResponse\r\n\r\nfrom polls.models import Pregunta\r\n\r\nfrom django.template import loader\r\n\r\n\r\ndef index(request):\r\n\tpreguntas = Pregunta.objects.order_by('-fecha')[:5]\r\n\ttemplate = loader.get_template('polls/index.html')\r\n\tcontext = { 'listado': preguntas,}\r\n\treturn... | false |
2,132 | 8fe45332ce09195beabb24c8cbb56868c564ded4 | from golem import actions
from projects.golem_integration.pages import golem_steps
description = 'close_window_by_partial_title action'
def test(data):
actions.navigate(data.env.url + 'tabs/')
actions.send_keys('#title', 'lorem ipsum')
actions.click('#goButtonCustom')
actions.assert_amount_of_window... | [
"from golem import actions\n\nfrom projects.golem_integration.pages import golem_steps\n\n\ndescription = 'close_window_by_partial_title action'\n\ndef test(data):\n actions.navigate(data.env.url + 'tabs/')\n actions.send_keys('#title', 'lorem ipsum')\n actions.click('#goButtonCustom')\n actions.assert_... | false |
2,133 | d45ca839a24093266c48e5f97164b160190b154d | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 03:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_otp', '0001_initial'),
]
operations = [
migrations.AddField(
... | [
"# -*- coding: utf-8 -*-\n# Generated by Django 1.10.4 on 2016-12-29 03:38\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('django_otp', '0001_initial'),\n ]\n\n operations = [\n migration... | false |
2,134 | b2b961c6ff1d975d80a84be361321ab44dc026a0 | from queuingservices.managers.queue_lifecycle_manager import QueueLifecycleManager
from queuingservices.managers.queue_publisher_manager import QueuePublisherManager
from queuingservices.managers.queue_subscriber_manager import QueueSubscriberManager
class QueueMaster(QueueSubscriberManager, QueuePublisherManager, Qu... | [
"from queuingservices.managers.queue_lifecycle_manager import QueueLifecycleManager\nfrom queuingservices.managers.queue_publisher_manager import QueuePublisherManager\nfrom queuingservices.managers.queue_subscriber_manager import QueueSubscriberManager\n\n\nclass QueueMaster(QueueSubscriberManager, QueuePublisherM... | false |
2,135 | 302634b93725ceb9333e236021cbb64e023ff798 | import curses
from zeep import Client
from zeep import xsd
from zeep.plugins import HistoryPlugin
import time
from datetime import datetime
import os
LDB_TOKEN = 'NULLTOKEN'
WSDL = 'http://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2017-10-01'
if LDB_TOKEN == '':
raise Exception("Please configure y... | [
"import curses\n\nfrom zeep import Client\nfrom zeep import xsd\nfrom zeep.plugins import HistoryPlugin\nimport time\nfrom datetime import datetime\nimport os\n\nLDB_TOKEN = 'NULLTOKEN'\nWSDL = 'http://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2017-10-01'\n\nif LDB_TOKEN == '':\n raise Exception(\... | false |
2,136 | 3314ffdbc2f10170176c590aebf49c416bcc8856 | import os
import mysql.connector
import time
from flask import Flask, render_template
app = Flask(__name__)
def dbconnect():
return mysql.connector.connect(user= , password= , host="mysqlshereen.mysql.database.azure.com", port=3306, database='test')
@app.route('/result', methods=['POST', 'GET'])
def query():
... | [
"import os\n\nimport mysql.connector\nimport time\nfrom flask import Flask, render_template\n\napp = Flask(__name__)\n\ndef dbconnect():\n\n return mysql.connector.connect(user= , password= , host=\"mysqlshereen.mysql.database.azure.com\", port=3306, database='test')\n\n@app.route('/result', methods=['POST', 'GE... | true |
2,137 | c632c50028fee2f19fb65458f0b55ec228b8006f | #This is a module which implements Naive Set Theory in Python.
#It will be useful for Unions, Intersections, Mutual Exclusion, and more.
#ideas: print(sum([[[1],[2]], [[3],[4]], [[5],[6]]], [])) Monoid - abstraction on +
trial = [1, 2, 3]
trial2 = [3, 4, 5]
def recursiveUnioniser(set):
if isinstance(set[0], int)... | [
"#This is a module which implements Naive Set Theory in Python.\n#It will be useful for Unions, Intersections, Mutual Exclusion, and more.\n#ideas: print(sum([[[1],[2]], [[3],[4]], [[5],[6]]], [])) Monoid - abstraction on +\n\n\ntrial = [1, 2, 3]\ntrial2 = [3, 4, 5]\n\ndef recursiveUnioniser(set):\n if isinstanc... | false |
2,138 | 17ac827d181650cd8bd6e75ca7ff363d70d3c4a7 | import collections
import cPickle as pickle
import os
import shutil
import warnings
import numpy as np
import theano
import theano.tensor as T
import tables
#theano.config.compute_test_value = 'warn'
class SGD_Trainer(object):
"""Implementation of a stochastic gradient descent trainer
"""
#{{{ Properties
... | [
"import collections\nimport cPickle as pickle\nimport os\nimport shutil\nimport warnings\n\nimport numpy as np\nimport theano\nimport theano.tensor as T\nimport tables\n#theano.config.compute_test_value = 'warn'\n\n\nclass SGD_Trainer(object):\n \"\"\"Implementation of a stochastic gradient descent trainer\n ... | true |
2,139 | f5b18673dd5a3ba3070c07e88ae83a531669311a | """
Tests for `sqlalchemy-cql` module.
"""
import pytest
from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
metadata = MetaData()
users = Table('users', metadata,
Column('id', Integer, primary_key=True),
Column('name', String),
Column('fullname... | [
"\"\"\"\nTests for `sqlalchemy-cql` module.\n\"\"\"\nimport pytest\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey\n\nmetadata = MetaData()\nusers = Table('users', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String)... | false |
2,140 | eb890c68885cbab032ce9d6f3be3fd7013a2788b | import pandas as pd
import os
import re
main_dir = r'C:\Users\Username\Desktop\Python\End-to-End-Data-Analysis\1. Get the Data\table'
file = 'CMBS Table.csv'
os.chdir(main_dir)
cmbs = pd.read_csv(file, encoding='ISO-8859-1')
# Delete extra Loan & Seller columns
loan_seller_cols = [val for val in cmbs.co... | [
"import pandas as pd\r\nimport os\r\nimport re\r\n\r\nmain_dir = r'C:\\Users\\Username\\Desktop\\Python\\End-to-End-Data-Analysis\\1. Get the Data\\table'\r\nfile = 'CMBS Table.csv'\r\n\r\nos.chdir(main_dir)\r\n\r\ncmbs = pd.read_csv(file, encoding='ISO-8859-1')\r\n\r\n# Delete extra Loan & Seller columns\r\nloan_s... | false |
2,141 | 0e03a3b3401075384e580bc2bb8af1a106f1d238 | from __future__ import unicode_literals
from functools import partial
from django.contrib.auth import get_user_model
from .default_settings import settings
from . import signals
class AuditMiddleware(object):
"""
middleware to add the user from requests to ModelChange objects.
This is independent of req... | [
"from __future__ import unicode_literals\n\nfrom functools import partial\nfrom django.contrib.auth import get_user_model\n\nfrom .default_settings import settings\nfrom . import signals\n\n\nclass AuditMiddleware(object):\n \"\"\"\n middleware to add the user from requests to ModelChange objects.\n This i... | false |
2,142 | f5f1a4db33cea8421cb4236606dfb288efee7621 | # coding: utf-8
from flask import Blueprint, make_response, render_template, request
from flask_restful import Resource
from flask_security import login_required
from ..clients.service import list_clients
from ..roles.service import list_roles
from ...models import Client, Role
admin = Blueprint('admin', __name__, u... | [
"# coding: utf-8\nfrom flask import Blueprint, make_response, render_template, request\nfrom flask_restful import Resource\nfrom flask_security import login_required\n\nfrom ..clients.service import list_clients\nfrom ..roles.service import list_roles\nfrom ...models import Client, Role\n\n\nadmin = Blueprint('admi... | false |
2,143 | 9db1887c5379623687d1dea343d72122bab66303 | from django.urls import path
from . import views # ํ์ฌ ํจํค์ง์์ views ๋ชจ๋์ ๊ฐ์ ธ์ด
urlpatterns = [
path('', views.home, name='home'),
path('ppt1',views.ppt1,name='ppt1'),
path('ppt2',views.ppt2,name='ppt2'),
] | [
"from django.urls import path\n\nfrom . import views # ํ์ฌ ํจํค์ง์์ views ๋ชจ๋์ ๊ฐ์ ธ์ด\n\nurlpatterns = [\n path('', views.home, name='home'),\n path('ppt1',views.ppt1,name='ppt1'),\n path('ppt2',views.ppt2,name='ppt2'),\n\n]",
"from django.urls import path\nfrom . import views\nurlpatterns = [path('', views.ho... | false |
2,144 | b30e6af035b589d5f4bd1bc6cccdd53c157861a0 | #!/usr/bin/env python
# including libraries
import roslib
import sys
import rospy
import cv2
import math
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import matplotlib.pyplot as plt
MAP = np.array([[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... | [
"#!/usr/bin/env python\n\n# including libraries\nimport roslib\nimport sys\nimport rospy\nimport cv2\nimport math\nfrom std_msgs.msg import String\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBridgeError\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nMAP = np.array([[0,0,0,0,0,0,... | true |
2,145 | ba2f8598ec7e107ac71786cf9191777a93ae2c7a | import os
import sys
import csv
import math
for i in sys.stdin:
i = float(i)
key = math.floor(i*10)
print('%s\t%s' % (key, i))
| [
"import os\nimport sys\nimport csv\nimport math\n\n\nfor i in sys.stdin:\n i = float(i)\n key = math.floor(i*10)\n print('%s\\t%s' % (key, i))\n\n",
"import os\nimport sys\nimport csv\nimport math\nfor i in sys.stdin:\n i = float(i)\n key = math.floor(i * 10)\n print('%s\\t%s' % (key, i))\n",
... | false |
2,146 | d296e528d399ee772039777d139a1d8271711ee9 | from django.conf import settings
from django.contrib import messages
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views.generic import DetailView, ListView, View
from assessments.models import (Mine, Company,
QuestionCategory, Question, Assessment, Response)
class Home... | [
"from django.conf import settings\nfrom django.contrib import messages\nfrom django.shortcuts import redirect, render\nfrom django.urls import reverse\nfrom django.views.generic import DetailView, ListView, View\n\nfrom assessments.models import (Mine, Company,\n QuestionCategory, Question, Assessment, Response)... | false |
2,147 | 64368679aa2e387e25a36b2f3d0312a99b819e95 | #!/usr/bin/env python
from xrouter import api
api.main()
| [
"#!/usr/bin/env python\nfrom xrouter import api\napi.main()\n",
"from xrouter import api\napi.main()\n",
"<import token>\napi.main()\n",
"<import token>\n<code token>\n"
] | false |
2,148 | 49995e60b817e2c5a2ea7e85e4fe96ca95363cb2 | '''
Created on 2018-9-8
@author: weij
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os.path
import sys
import time
import numpy as np
from numpy import shape
from scipy import linalg
from sklearn import datas... | [
"'''\r\nCreated on 2018-9-8\r\n\r\n@author: weij\r\n'''\r\nfrom __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport argparse\r\nimport os.path\r\nimport sys\r\nimport time\r\nimport numpy as np\r\n\r\n\r\nfrom numpy import shape\r\nfrom scipy i... | false |
2,149 | 16215ee42c4ea284dca0ebb7372fef04c0cc54b9 | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 17:16:12 2019
@author: Meagatron
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from collections import defaultdict
import math
import itertools
from dtw import dtw
import timeit
from helper_functions import normalize,alphabetize_ts,hammin... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Aug 3 17:16:12 2019\n\n@author: Meagatron\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom collections import defaultdict\nimport math\nimport itertools\nfrom dtw import dtw\nimport timeit\n\nfrom helper_functions import norm... | false |
2,150 | 9aee715e976db632f0829a06cb9e0101c90512be | # -*- coding: utf-8 -*-
"""
VorRun
Runs Vorlax and plots wireframe output from Vorlax
(https://github.com/GalaxyHobo/VORLAX)
NOTE! Type: "%matplotlib auto" in iPython console to
switch to interactive plots, or "%matplotlib inline"
to switch to inline, in the console.
NOTE! Reads path to Vorlax .exe in "... | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nVorRun\r\n\r\nRuns Vorlax and plots wireframe output from Vorlax\r\n(https://github.com/GalaxyHobo/VORLAX)\r\n\r\nNOTE! Type: \"%matplotlib auto\" in iPython console to \r\nswitch to interactive plots, or \"%matplotlib inline\" \r\nto switch to inline, in the console.\r\n\r\nNO... | false |
2,151 | aa15f684d23d97a45a416b1fdcfb192710ebb56f | # https://www.hackerrank.com/challenges/bon-appetit
n, k = map(int, input().split())
prices = [int(temp) for temp in input().split()]
taken = int(input())
if (sum(prices) - prices[k]) // 2 == taken:
print("Bon Appetit")
else:
print(taken - (sum(prices) - prices[k])// 2)
| [
"# https://www.hackerrank.com/challenges/bon-appetit\n\nn, k = map(int, input().split())\nprices = [int(temp) for temp in input().split()]\ntaken = int(input())\nif (sum(prices) - prices[k]) // 2 == taken:\n print(\"Bon Appetit\")\nelse:\n print(taken - (sum(prices) - prices[k])// 2)\n\n",
"n, k = map(int, ... | false |
2,152 | 3553fa72cb831f82a1030b9eadc9594eee1d1422 | from datetime import datetime
class Guest:
def __init__(self, Name, FamilyName, Car, controlboard,
CarRotationManager, ID=0, linkedplatform=None,Start=0): # --Initializing Guest credentials/info---
self.Name = Name
self.FamilyName = FamilyName
self.Car = Car
... | [
"from datetime import datetime\r\n\r\nclass Guest:\r\n def __init__(self, Name, FamilyName, Car, controlboard,\r\n CarRotationManager, ID=0, linkedplatform=None,Start=0): # --Initializing Guest credentials/info---\r\n self.Name = Name\r\n self.FamilyName = FamilyName\r\n sel... | false |
2,153 | 879f7503f7f427f92109024b4646d1dc7f15d63d | K = input()
mat = "".join(raw_input() for i in xrange(4))
print ("YES", "NO")[max(mat.count(str(i)) for i in xrange(1, 10)) > K*2]
| [
"K = input()\nmat = \"\".join(raw_input() for i in xrange(4))\nprint (\"YES\", \"NO\")[max(mat.count(str(i)) for i in xrange(1, 10)) > K*2]\n\n",
"K = input()\nmat = ''.join(raw_input() for i in xrange(4))\nprint('YES', 'NO')[max(mat.count(str(i)) for i in xrange(1, 10)) > K * 2]\n",
"<assignment token>\nprint(... | false |
2,154 | 076e10b3741542b7137f6ac517dba482f545b123 | """
Name: Thomas Scola
lab1.py
Problem: This function calculates the area of a rectangle
"""
'''def calc_area():'''
def calc_rec_area():
length = eval(input("Enter the length: "))
width = eval(input("Enter the width: "))
area = length * width
print("Area =", area)
def calc_rec_vol():... | [
"\"\"\"\nName: Thomas Scola\nlab1.py\n\nProblem: This function calculates the area of a rectangle\n\"\"\"\n\n\n'''def calc_area():'''\ndef calc_rec_area():\n length = eval(input(\"Enter the length: \"))\n width = eval(input(\"Enter the width: \"))\n area = length * width\n print(\"Area =... | false |
2,155 | 0e3bf0ddd654b92b2cd962a2f3935c639eeb0695 | import sys; input = sys.stdin.readline
from collections import deque
from itertools import combinations
from copy import deepcopy
n, m = map(int, input().split())
graph = [list(map(int,input().split())) for i in range(n)]
virus_lst = []
for i in range(n):
for j in range(n):
if graph[i][j]==2:
g... | [
"import sys; input = sys.stdin.readline\nfrom collections import deque\nfrom itertools import combinations\nfrom copy import deepcopy\n\nn, m = map(int, input().split())\ngraph = [list(map(int,input().split())) for i in range(n)]\nvirus_lst = []\nfor i in range(n):\n for j in range(n):\n if graph[i][j]==2... | false |
2,156 | ef57f0dfea261f022ced36ef9e27a07d63c21026 | # Generated by Django 3.2.4 on 2021-06-18 01:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('eCom', '0014_auto_20210617_1503'),
]
operations = [
migrations.RemoveField(
model_name='order',... | [
"# Generated by Django 3.2.4 on 2021-06-18 01:20\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('eCom', '0014_auto_20210617_1503'),\n ]\n\n operations = [\n migrations.RemoveField(\n ... | false |
2,157 | 43b9d308bb8d2b38c5f539e8700f5c2d8fe2287d | from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.common.action_chains import ActionChains
import time
import json
import re
import os
import datetime
###########################################################################
driver_path = "/home/arnab/Codes/00_Libs/chromedriver_lin... | [
"from selenium import webdriver\nfrom bs4 import BeautifulSoup\nfrom selenium.webdriver.common.action_chains import ActionChains\nimport time\nimport json\nimport re\nimport os\nimport datetime\n\n###########################################################################\ndriver_path = \"/home/arnab/Codes/00_Libs/... | false |
2,158 | 06848ec0e327fed1da00446cec6392c6f42130af | '''Given a range of 2 numbers (i.e) L and R count the number of prime numbers in the range (inclusive of L and R ).
Input Size : L <= R <= 100000(complexity O(n) read about Sieve of Eratosthenes)
Sample Testcase :
INPUT
2 5
OUTPUT
3'''
x,y=map(int,input().split())
count=0
for i in range(x,y+1):
if i>1:
for... | [
"'''Given a range of 2 numbers (i.e) L and R count the number of prime numbers in the range (inclusive of L and R ).\nInput Size : L <= R <= 100000(complexity O(n) read about Sieve of Eratosthenes)\nSample Testcase :\nINPUT\n2 5\nOUTPUT\n3'''\n\nx,y=map(int,input().split())\ncount=0\nfor i in range(x,y+1):\n if ... | false |
2,159 | e9918f4fac2e13b36d9b20ffc28dc6508aad6f9b | class Solution:
# complexity: 2*n^2 + 4*n^2 -> 8*n^2
def numSmallerByFrequency(self, queries: List[str], words: List[str]) -> List[int]:
# complexity: n*2*l where l is the length of the word -> 2*n^2
words_freq = {
word: word.count(min(word)) for word in words
}
quer... | [
"class Solution:\n # complexity: 2*n^2 + 4*n^2 -> 8*n^2\n def numSmallerByFrequency(self, queries: List[str], words: List[str]) -> List[int]:\n # complexity: n*2*l where l is the length of the word -> 2*n^2\n words_freq = {\n word: word.count(min(word)) for word in words\n }\n\... | false |
2,160 | a718949ed95b7d78f091b1e0f237eed151b102ae | from .most_serializers import * | [
"from .most_serializers import *",
"from .most_serializers import *\n",
"<import token>\n"
] | false |
2,161 | e1172cadeb8b2ce036d8431cef78cfe19bda0cb8 | #Program to convert temp in degree Celsius to temp in degree Fahrenheit
celsius=input("Enter temperature in Celsius")
celsius=int(celsius)
fah=(celsius*9/5)+32
print("Temp in ",celsius,"celsius=",fah," Fahrenheit")
| [
"#Program to convert temp in degree Celsius to temp in degree Fahrenheit\ncelsius=input(\"Enter temperature in Celsius\")\ncelsius=int(celsius)\nfah=(celsius*9/5)+32\nprint(\"Temp in \",celsius,\"celsius=\",fah,\" Fahrenheit\")\n",
"celsius = input('Enter temperature in Celsius')\ncelsius = int(celsius)\nfah = ce... | false |
2,162 | 0ad529298f321d2f3a63cde8179a50cf2881ee00 | from __future__ import print_function
from __future__ import division
import os
import sys
import time
import datetime
import os.path as osp
from collections import defaultdict
import numpy as np
import math
from functools import partial
from tqdm import tqdm
import glog as log
import torch
import torch.nn as nn
impo... | [
"from __future__ import print_function\nfrom __future__ import division\n\nimport os\nimport sys\nimport time\nimport datetime\nimport os.path as osp\nfrom collections import defaultdict\nimport numpy as np\nimport math\nfrom functools import partial\nfrom tqdm import tqdm\nimport glog as log\n\nimport torch\nimpor... | false |
2,163 | 6cba431650ee8b74baa8310c144321b2e587155e | list_1 = ['color','white','black']#taking the colors of t-shirts as input
list_2 = ['short','medium','large','xl']#taking sizes of t-shirts as input
for color in list_1:
for size in list_2:
#using cartesien product asking to give output as the combinations of color and size of t-shirts we ... | [
"list_1 = ['color','white','black']#taking the colors of t-shirts as input\r\n\r\nlist_2 = ['short','medium','large','xl']#taking sizes of t-shirts as input \r\n\r\nfor color in list_1: \r\n \r\n for size in list_2:\r\n \r\n#using cartesien product asking to give output as the combinations of color and... | false |
2,164 | 810017cd5814fc20ebcdbdf26a32ea1bcfc88625 | from collections import deque
from etaprogress.eta import ETA
def test_linear_slope_1():
eta = ETA(100)
eta._timing_data = deque([(10, 10), (20, 20), (30, 30), (40, 40)])
getattr(eta, '_calculate')()
assert 100 == eta.eta_epoch
assert 1.0 == eta.rate
assert 1.0 == eta.rate_unstable
def tes... | [
"from collections import deque\n\nfrom etaprogress.eta import ETA\n\n\ndef test_linear_slope_1():\n eta = ETA(100)\n eta._timing_data = deque([(10, 10), (20, 20), (30, 30), (40, 40)])\n getattr(eta, '_calculate')()\n\n assert 100 == eta.eta_epoch\n assert 1.0 == eta.rate\n assert 1.0 == eta.rate_u... | false |
2,165 | 013189cd67cc44efd539c75ed235a0753d95f54e | import pandas as pd
import tensorflow as tf
import autokeras as ak
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
from numpy import concatenate
from pandas import read_csv, DataFrame, concat
from sklearn.preprocessing import MinMaxScaler
np.set_printoptions(... | [
"import pandas as pd\r\nimport tensorflow as tf\r\nimport autokeras as ak\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nimport tensorflow as tf\r\n\r\nfrom numpy import concatenate\r\nfrom pandas import read_csv, DataFrame, concat\r\nfrom sklearn.preprocessing import MinMaxScale... | false |
2,166 | 957e18b2536cda69ba1db571d0308d5e392fe488 | from config import Config
import numpy as np
from itertools import product
from sklearn.utils import shuffle
from sklearn.metrics import precision_recall_fscore_support
from keras import callbacks, regularizers
from keras.models import Sequential
from keras.layers import Dense, InputLayer
from keras import backend as K... | [
"from config import Config\nimport numpy as np\nfrom itertools import product\nfrom sklearn.utils import shuffle\nfrom sklearn.metrics import precision_recall_fscore_support\nfrom keras import callbacks, regularizers\nfrom keras.models import Sequential\nfrom keras.layers import Dense, InputLayer\nfrom keras import... | false |
2,167 | 9a9fdf0f3cfb876a384059f3dcf2508f960168c2 | # hi :)
import numpy as np
import random
from copy import deepcopy
# initialization....
# see also prepare.sh
header = np.loadtxt("header.txt", dtype=int)
TIME = header[2]
CARS = header[3]
STARTPOINT = header[4]
GRAPH = np.loadtxt("links.txt",dtype=int)
number_of_links = GRAPH.shape[0]
N = len(GRAPH[:,1])
VOI... | [
"# hi :)\nimport numpy as np\nimport random\nfrom copy import deepcopy\n\n\n# initialization....\n# see also prepare.sh\n\nheader = np.loadtxt(\"header.txt\", dtype=int)\nTIME = header[2]\nCARS = header[3]\nSTARTPOINT = header[4]\n\nGRAPH = np.loadtxt(\"links.txt\",dtype=int)\nnumber_of_links = GRAPH.shape[0]\... | true |
2,168 | bd179fda18551d4f3d8a4d695a9da38ee607ef1d | import datetime
import json
from dateutil import parser
import mock
from python_http_client.exceptions import ForbiddenError
from rdr_service import clock, config
from rdr_service.api_util import open_cloud_file
from rdr_service.clock import FakeClock
from rdr_service.dao.database_utils import format_datetime
from rd... | [
"import datetime\nimport json\n\nfrom dateutil import parser\nimport mock\nfrom python_http_client.exceptions import ForbiddenError\n\nfrom rdr_service import clock, config\nfrom rdr_service.api_util import open_cloud_file\nfrom rdr_service.clock import FakeClock\nfrom rdr_service.dao.database_utils import format_d... | false |
2,169 | e00cbe6e177ee841c6e64de842e5b8f95463b3a8 | import rpy2.robjects as robjects
from rpy2.robjects.packages import importr
ts=robjects.r('ts')
forecast = importr("forecast", lib_loc = "C:/Users/sand9888/Documents/sand9888/R/win-library/3.3")
import os
import pandas as pd
from rpy2.robjects import pandas2ri
pandas2ri.activate()
train = os.path.join('C:/DAT203.3x/... | [
"import rpy2.robjects as robjects\nfrom rpy2.robjects.packages import importr\nts=robjects.r('ts')\nforecast = importr(\"forecast\", lib_loc = \"C:/Users/sand9888/Documents/sand9888/R/win-library/3.3\")\nimport os\nimport pandas as pd\n\nfrom rpy2.robjects import pandas2ri\npandas2ri.activate()\n\n\ntrain = os.path... | false |
2,170 | 188f82b0fb04d6814d77617fa9148113d0e6ef01 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, hidden_size, encoder_layer=2, step=4, is_bidir=False, **kw):
super(Model, self).__init__()
fc_embedding = []
# First, we should convert the 1 dim data to ... | [
"import math\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass Model(nn.Module):\r\n\r\n def __init__(self, hidden_size, encoder_layer=2, step=4, is_bidir=False, **kw):\r\n super(Model, self).__init__()\r\n fc_embedding = []\r\n\r\n # First, we shou... | false |
2,171 | 9d22a90835f5cf293808ab359244fe1bde81f3e1 | from urllib.parse import urlencode
from urllib.request import urlopen, Request
from datetime import datetime
#ะฟะพะปัะทะพะฒะฐัะตะปััะบะธะต ะฟะตัะตะผะตะฝะฝัะต
period=7 # ะทะฐะดะฐัะผ ะฟะตัะธะพะด. ะัะฑะพั ะธะท: 'tick': 1, 'min': 2, '5min': 3, '10min': 4, '15min': 5, '30min': 6, 'hour': 7, 'daily': 8, 'week': 9, 'month': 10
start = "01.01.2021" #ั ะบะฐะบะพะน ะด... | [
"from urllib.parse import urlencode\nfrom urllib.request import urlopen, Request\nfrom datetime import datetime\n\n#ะฟะพะปัะทะพะฒะฐัะตะปััะบะธะต ะฟะตัะตะผะตะฝะฝัะต\nperiod=7 # ะทะฐะดะฐัะผ ะฟะตัะธะพะด. ะัะฑะพั ะธะท: 'tick': 1, 'min': 2, '5min': 3, '10min': 4, '15min': 5, '30min': 6, 'hour': 7, 'daily': 8, 'week': 9, 'month': 10\nstart = \"01.01.2021... | false |
2,172 | 285ca945696b32160175f15c4e89b3938f41ebf4 | """This module defines simple utilities for making toy datasets to be used in testing/examples"""
##################################################
# Import Miscellaneous Assets
##################################################
import pandas as pd
###############################################
# Import Learning Ass... | [
"\"\"\"This module defines simple utilities for making toy datasets to be used in testing/examples\"\"\"\n##################################################\n# Import Miscellaneous Assets\n##################################################\nimport pandas as pd\n\n###############################################\n# I... | false |
2,173 | b9eeccbed63aa42afa09fe7ef782066f300255a1 | from sense_hat import SenseHat
import time
sense = SenseHat()
b = (0, 0, 204) #Blue
w = (255, 255, 255) #White
e = (0, 0, 0) #Empty
y = (255, 255, 0) #Yellow
r = (255, 0, 0) #red
prenume = [
e, e, e, e, e, e, e, e,
e, e, e, e, e, e, e, e,
e, b, e, y, y, e, r, e,
b, e, b, y, e, y, r, e,
b, b, b, y,... | [
"from sense_hat import SenseHat\nimport time\n\nsense = SenseHat()\nb = (0, 0, 204) #Blue\nw = (255, 255, 255) #White\ne = (0, 0, 0) #Empty\ny = (255, 255, 0) #Yellow\nr = (255, 0, 0) #red\n\nprenume = [\n e, e, e, e, e, e, e, e,\n e, e, e, e, e, e, e, e,\n e, b, e, y, y, e, r, e,\n b, e, b, y, e, y, r,... | false |
2,174 | 609071fc3af1b526fbd4555ced2376f56ae0f3c3 | import time
import json
import pygame
from pygame.locals import *
import urllib.request
from pygame.color import THECOLORS
pygame.init()
Brack=[0,0,0]
White=[255,255,255]
Green=[0,255,0]
Red=[255,0,0]
Gray=[169,169,169]
button_text=["ๅผ ๅง","ๅผ ๅง","ๅผ ๅง","ๅผ ๅง","ๅผ ๅง"]
line=['http://localhost:5050/mixer/000','http://localhos... | [
"import time\nimport json\nimport pygame\nfrom pygame.locals import *\nimport urllib.request\nfrom pygame.color import THECOLORS\npygame.init()\nBrack=[0,0,0]\nWhite=[255,255,255]\nGreen=[0,255,0]\nRed=[255,0,0]\nGray=[169,169,169]\nbutton_text=[\"ๅผ ๅง\",\"ๅผ ๅง\",\"ๅผ ๅง\",\"ๅผ ๅง\",\"ๅผ ๅง\"]\nline=['http://localhost:5050... | false |
2,175 | 10723f703f40b5db2b7c9532cda520b2ae078546 | #! /bin/env python3
"""
Lane Emden Python interface.
Main routine:
lane_emden_int(dz, n)
"""
import numpy as np
from . import _solver
def test():
"""
A simple test.
"""
n = 3.
dz = 2.**(-14)
_solver.lane(dz,n)
out = _solver.laneout
n = out.ndata
t = out.theta
return t,n
d... | [
"#! /bin/env python3\n\n\"\"\"\nLane Emden Python interface.\n\nMain routine:\n lane_emden_int(dz, n)\n\"\"\"\n\nimport numpy as np\nfrom . import _solver\n\ndef test():\n \"\"\"\n A simple test.\n \"\"\"\n n = 3.\n dz = 2.**(-14)\n _solver.lane(dz,n)\n out = _solver.laneout\n n = out.ndat... | false |
2,176 | e4bfa0a55fe0dbb547bc5f65554ef96be654ec7a | import pytest
from django.utils.crypto import get_random_string
from django.utils.timezone import now
from respa_exchange import listener
from respa_exchange.ews.xml import M, NAMESPACES, T
from respa_exchange.models import ExchangeResource
from respa_exchange.tests.session import SoapSeller
class SubscriptionHandle... | [
"import pytest\nfrom django.utils.crypto import get_random_string\nfrom django.utils.timezone import now\n\nfrom respa_exchange import listener\nfrom respa_exchange.ews.xml import M, NAMESPACES, T\nfrom respa_exchange.models import ExchangeResource\nfrom respa_exchange.tests.session import SoapSeller\n\n\nclass Sub... | false |
2,177 | 91cf6d08be2ad86c08de4dd48b2f35dedc55b4bb | """GI on fast."""
import logging
from mpf.core.utility_functions import Util
from mpf.platforms.interfaces.gi_platform_interface import GIPlatformInterface
class FASTGIString(GIPlatformInterface):
"""A FAST GI string in a WPC machine."""
def __init__(self, number, sender):
"""Initialise GI string.
... | [
"\"\"\"GI on fast.\"\"\"\nimport logging\n\nfrom mpf.core.utility_functions import Util\nfrom mpf.platforms.interfaces.gi_platform_interface import GIPlatformInterface\n\n\nclass FASTGIString(GIPlatformInterface):\n\n \"\"\"A FAST GI string in a WPC machine.\"\"\"\n\n def __init__(self, number, sender):\n ... | false |
2,178 | 93ec15a37bd5f022e8f6e226e3bf0e91cc0457c6 | # Definition for a Node.
class Node:
def __init__(self, val, children):
self.val = val
self.children = children
class Solution(object):
def postorder(self, root):
"""
:type root: Node
:rtype: List[int]
"""
if not root:
return([])
if no... | [
"# Definition for a Node.\nclass Node:\n def __init__(self, val, children):\n self.val = val\n self.children = children\n\nclass Solution(object):\n def postorder(self, root):\n \"\"\"\n :type root: Node\n :rtype: List[int]\n \"\"\"\n if not root:\n ... | false |
2,179 | d4683d055ca70f31b050f0d84cb93c030feb4593 | import twitter
def twitter_authenticate():
return;
def identify_dupes():
return;
def remove_dupes():
return;
def get_tweets():
return;
| [
"import twitter\n\ndef twitter_authenticate():\n return;\n\ndef identify_dupes():\n return;\n\ndef remove_dupes():\n return;\n\ndef get_tweets():\n return;\n",
"import twitter\n\n\ndef twitter_authenticate():\n return\n\n\ndef identify_dupes():\n return\n\n\ndef remove_dupes():\n return\n\n\ndef ... | false |
2,180 | 445bb8ad8dadd207a3546f4623de583fc47a2910 | # Exercรญcio Python 20: O mesmo professor do desafio 19 quer sortear a ordem de apresentaรงรฃo de trabalhos dos alunos. Faรงa um programa que leia o nome dos quatro alunos e mostre a ordem sorteada.
import random
aluno1 = input('Primeiro aluno: ')
aluno2 = input('Segundo aluno: ')
aluno3 = input('Terceiro aluno: ')
... | [
"# Exercรญcio Python 20: O mesmo professor do desafio 19 quer sortear a ordem de apresentaรงรฃo de trabalhos dos alunos. Faรงa um programa que leia o nome dos quatro alunos e mostre a ordem sorteada.\r\nimport random\r\n\r\naluno1 = input('Primeiro aluno: ')\r\naluno2 = input('Segundo aluno: ')\r\naluno3 = input('Terce... | false |
2,181 | 74be250df785590ecf45e048b0d6189e2b445889 | print("HELLO3")
| [
"print(\"HELLO3\")\n",
"print('HELLO3')\n",
"<code token>\n"
] | false |
2,182 | 351963bee76ecaa9fa5c8d659f6d7c6ca9b22531 | from django.urls import path
from django.conf.urls.i18n import urlpatterns
from . import views
urlpatterns = [
path('signup/', views.signup, name='signup'),
path('home', views.home, name='home'),
path('collab/', views.collab, name='collab'),
] | [
"from django.urls import path\nfrom django.conf.urls.i18n import urlpatterns\n\nfrom . import views\n\nurlpatterns = [\n path('signup/', views.signup, name='signup'),\n path('home', views.home, name='home'),\n path('collab/', views.collab, name='collab'),\n]",
"from django.urls import path\nfrom django.c... | false |
2,183 | a05c94ae0ee41cfef5687f741e07a54ae793e40d | import os
import numpy as np
import pandas as pd
import random
import platform
import subprocess
import shlex
import teradata
from joblib import dump
import shutil
from tqdm import tqdm
def get_session(db, usr, pwd):
"""ะคัะฝะบัะธั ัััะฐะฝะฐะฒะปะธะฒะฐะตั ัะพะตะดะธะฝะตะฝะธะต ั ะขะ ะธ ะฒะพะทะฒัะฐัะฐะตั ัะตััะธั"""
if platform.... | [
"import os\r\nimport numpy as np\r\nimport pandas as pd\r\nimport random\r\nimport platform\r\nimport subprocess\r\nimport shlex\r\nimport teradata\r\nfrom joblib import dump\r\nimport shutil\r\nfrom tqdm import tqdm\r\n\r\n\r\ndef get_session(db, usr, pwd):\r\n \"\"\"ะคัะฝะบัะธั ัััะฐะฝะฐะฒะปะธะฒะฐะตั ัะพะตะดะธะฝะตะฝะธะต ั ะขะ ะธ ะฒะพะทะฒ... | false |
2,184 | 30b07e57737ac29643769c4773591199b2ba8656 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 9 18:52:17 2021
@author: lewis
"""
import csv
import pandas as pd
import re
import statistics
import matplotlib.pyplot as plt
import numpy as np
from bs4 import BeautifulSoup
from urllib.request import urlopen
#Creating a function that groups by, co... | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Sep 9 18:52:17 2021\r\n\r\n@author: lewis\r\n\"\"\"\r\n\r\nimport csv \r\nimport pandas as pd \r\nimport re \r\nimport statistics\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom bs4 import BeautifulSoup\r\nfrom urllib.request import urlopen\r\n\r... | false |
2,185 | fb64003c1acbddcbe952a17edcbf293a54ef28ae | """
This module is an intermediate layer between flopy version 3.2
and the inowas-modflow-configuration format.
Author: Ralf Junghanns
EMail: ralf.junghanns@gmail.com
"""
from .BasAdapter import BasAdapter
from .ChdAdapter import ChdAdapter
from .DisAdapter import DisAdapter
from .GhbAdapter import GhbAdapter
from .L... | [
"\"\"\"\nThis module is an intermediate layer between flopy version 3.2\nand the inowas-modflow-configuration format.\n\nAuthor: Ralf Junghanns\nEMail: ralf.junghanns@gmail.com\n\"\"\"\n\nfrom .BasAdapter import BasAdapter\nfrom .ChdAdapter import ChdAdapter\nfrom .DisAdapter import DisAdapter\nfrom .GhbAdapter imp... | false |
2,186 | 4cc138016cb1f82e12c76c185be19188d3e38bf9 | # Generated by Django 3.0.5 on 2020-04-25 12:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0006_order_date'),
]
operations = [
migrations.RemoveField(
model_name='order',
name='product',
),
... | [
"# Generated by Django 3.0.5 on 2020-04-25 12:29\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('api', '0006_order_date'),\n ]\n\n operations = [\n migrations.RemoveField(\n model_name='order',\n name='prod... | false |
2,187 | 77b7a0ae115aa063512ea7d6e91811470a4cf9d0 |
str = 'Hello world'
print ("ๅญ็ฌฆไธฒ้ฟๅบฆ : %d" %(len(str)))
print("ๅญ็ฌฆไธฒ็้ฟๅบฆ 444๏ผ",len(str))
print (str)
print (str[0])
print (str[1:5])
print (str[:len(str)])
print (str[1:]*3)
print (str[1:]*5)
print ('ๅญ็ฌฆไธฒๆผๆฅ')
print ("Hello" + "world")
#print ๏ผ"python : str.join Test"๏ผ
str1 = "-"
print (str1.join(str))
list = [1,2,3... | [
"\nstr = 'Hello world'\n\nprint (\"ๅญ็ฌฆไธฒ้ฟๅบฆ : %d\" %(len(str)))\nprint(\"ๅญ็ฌฆไธฒ็้ฟๅบฆ 444๏ผ\",len(str))\nprint (str)\nprint (str[0])\nprint (str[1:5])\nprint (str[:len(str)])\nprint (str[1:]*3)\nprint (str[1:]*5)\n\nprint ('ๅญ็ฌฆไธฒๆผๆฅ')\n\nprint (\"Hello\" + \"world\")\n\n\n#print ๏ผ\"python : str.join Test\"๏ผ\nstr1 = \"-\"\n\np... | true |
2,188 | cdb07241e08f8ac85a427c5b2bc3effca3917c85 | # -*- coding: utf-8 -*-
"""
Project Euler - Problem XX
...
"""
# Imports
import time
# Global variables
# Lamda functions
# Functions
# Main functions
def main():
print('Output')
# Execute code
start = time.time()
if __name__ == "__main__":
main()
end = time.time()
print('Run time: {}'.format(end - start... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nProject Euler - Problem XX\n...\n\"\"\"\n\n# Imports\nimport time\n\n# Global variables\n\n# Lamda functions\n\n# Functions\n\n# Main functions\ndef main():\n print('Output') \n\n# Execute code\nstart = time.time()\nif __name__ == \"__main__\":\n main()\nend = time.time()\npr... | false |
2,189 | b1b478965ad939a98478b19b4a94f3250167e25a | from glob import glob
from PIL import Image
import numpy as np
from tqdm import tqdm
import cv2
import os
import matplotlib.pyplot as plt
np.set_printoptions(precision=3, suppress=True)
def get_index(path):
"""
get the length of index for voc2012 dataset.
path: the index of train,val or test path
"""... | [
"from glob import glob\nfrom PIL import Image\nimport numpy as np\nfrom tqdm import tqdm\nimport cv2\nimport os\nimport matplotlib.pyplot as plt\n\nnp.set_printoptions(precision=3, suppress=True)\n\n\ndef get_index(path):\n \"\"\"\n get the length of index for voc2012 dataset.\n path: the index of train,va... | false |
2,190 | 11a31d3276201105ca7485fa4e4eb711012accd5 | import pandas as pd
from pandas import DataFrame
myencoding = 'utf-8'
chikenList = ['pelicana', 'nene', 'cheogajip', 'goobne']
# chikenList = ['pelicana']
newframe = DataFrame()
for onestore in chikenList:
filename = onestore + '.csv'
myframe = pd.read_csv(filename, index_col=0, encoding=myencoding)
# pr... | [
"import pandas as pd\nfrom pandas import DataFrame\n\nmyencoding = 'utf-8'\nchikenList = ['pelicana', 'nene', 'cheogajip', 'goobne']\n# chikenList = ['pelicana']\n\nnewframe = DataFrame()\n\nfor onestore in chikenList:\n filename = onestore + '.csv'\n myframe = pd.read_csv(filename, index_col=0, encoding=myen... | false |
2,191 | 78037d936ee5f9b31bf00263885fbec225a4f8f2 | n = int(input())
if n % 10 == 1 and (n < 11 or n > 20):
print(n, "korova")
elif n % 10 > 1 and n % 10 < 5 and (n < 11 or n > 20):
print(n, "korovy")
else:
print(n, "korov")
| [
"n = int(input())\n\nif n % 10 == 1 and (n < 11 or n > 20):\n print(n, \"korova\")\nelif n % 10 > 1 and n % 10 < 5 and (n < 11 or n > 20):\n print(n, \"korovy\")\nelse:\n print(n, \"korov\")\n",
"n = int(input())\nif n % 10 == 1 and (n < 11 or n > 20):\n print(n, 'korova')\nelif n % 10 > 1 and n % 10 ... | false |
2,192 | a0cce8d48f929dd63ba809a1e9bf02b172e8bc1b | from barista.sensor import CarafeLevel, CarafeTemp
class Carafe(object):
def __init__(self):
self.level = CarafeLevel()
self.temp = CarafeTemp()
# TODO add callback for when the temperature or level are too low. | [
"from barista.sensor import CarafeLevel, CarafeTemp\n\n\nclass Carafe(object):\n def __init__(self):\n self.level = CarafeLevel()\n self.temp = CarafeTemp()\n\n # TODO add callback for when the temperature or level are too low.",
"from barista.sensor import CarafeLevel, CarafeTemp\n\n\nclass C... | false |
2,193 | f0444676d28be27ad2f0f7cdaa58a96b7facc546 | # -*- coding: utf-8 -*-
from optparse import make_option
from django.core.management.base import BaseCommand, LabelCommand, CommandError
from open_coesione import utils
import sys
import logging
import csv
import os
class Command(LabelCommand):
"""
Task to extract data related to a sample of all projects.
... | [
"# -*- coding: utf-8 -*-\n\nfrom optparse import make_option\nfrom django.core.management.base import BaseCommand, LabelCommand, CommandError\nfrom open_coesione import utils\n\nimport sys\nimport logging\nimport csv\nimport os\n\nclass Command(LabelCommand):\n \"\"\"\n Task to extract data related to a sampl... | true |
2,194 | b218f5e401510f844006cb6079737b54aa86827b | """
stanCode Breakout Project
Adapted from Eric Roberts's Breakout by
Sonja Johnson-Yu, Kylie Jue, Nick Bowman,
and Jerry Liao
YOUR DESCRIPTION HERE
"""
from campy.gui.events.timer import pause
from breakoutgraphics import BreakoutGraphics
FRAME_RATE = 1000 / 120 # 120 frames per second.
NUM_LIVES = 3
def main():
... | [
"\"\"\"\nstanCode Breakout Project\nAdapted from Eric Roberts's Breakout by\nSonja Johnson-Yu, Kylie Jue, Nick Bowman,\nand Jerry Liao\n\nYOUR DESCRIPTION HERE\n\"\"\"\n\nfrom campy.gui.events.timer import pause\nfrom breakoutgraphics import BreakoutGraphics\n\nFRAME_RATE = 1000 / 120 # 120 frames per second.\nNUM_... | false |
2,195 | 53c874fbe14031c323f83db58f17990f4e60bc58 | from outils import Outils
class BilanComptes(object):
"""
Classe pour la crรฉation du bilan des comptes
"""
@staticmethod
def bilan(dossier_destination, subedition, subgeneraux, lignes):
"""
crรฉation du bilan
:param dossier_destination: Une instance de la classe dossier.Dos... | [
"from outils import Outils\n\n\nclass BilanComptes(object):\n \"\"\"\n Classe pour la crรฉation du bilan des comptes\n \"\"\"\n\n @staticmethod\n def bilan(dossier_destination, subedition, subgeneraux, lignes):\n \"\"\"\n crรฉation du bilan\n :param dossier_destination: Une instanc... | false |
2,196 | 9e3f4484542c2629d636fcb4166584ba52bebe21 | # -*- coding: utf-8 -*-
from LibTools.filesystem import Carpeta
from slaves import SentinelSat
import settings
if __name__ == '__main__':
carpeta = Carpeta(settings.folder_sat)
sentinela = SentinelSat(carpeta)
sentinela.start_Monitoring()
| [
"# -*- coding: utf-8 -*-\nfrom LibTools.filesystem import Carpeta\nfrom slaves import SentinelSat\n\nimport settings\n\nif __name__ == '__main__':\n\n carpeta = Carpeta(settings.folder_sat)\n sentinela = SentinelSat(carpeta)\n sentinela.start_Monitoring()\n",
"from LibTools.filesystem import Carpeta\nfro... | false |
2,197 | 1d0730e8fd120e1c4bc5b89cbd766234e1fa3bca | import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
from datetime import datetime
import statsmodels.api as sm
from quant.stock.stock import Stock
from quant.stock.date import Date
from quant.utility_fun.factor_preprocess import FactorPreProcess
from quant.utility_fun.write_excel import Wri... | [
"import pandas as pd\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\nimport statsmodels.api as sm\nfrom quant.stock.stock import Stock\nfrom quant.stock.date import Date\nfrom quant.utility_fun.factor_preprocess import FactorPreProcess\nfrom quant.utility_fun.write_ex... | false |
2,198 | 3c88e13e8796c5f39180a9a514f0528a074460a6 | from collections import OrderedDict
class LRU_Cache(object):
def __init__(self, capacity):
# Initialize class variables
self.size = capacity
self.jar = OrderedDict()
pass
def get(self, key):
# Retrieve item from provided key. Return -1 if nonexistent.
if key not ... | [
"from collections import OrderedDict\nclass LRU_Cache(object):\n def __init__(self, capacity):\n # Initialize class variables\n self.size = capacity\n self.jar = OrderedDict()\n pass\n\n def get(self, key):\n # Retrieve item from provided key. Return -1 if nonexistent.\n ... | false |
2,199 | e12c397ca1ae91ce314cda5fe2cd8e0ec4cfa861 | from django.db import models
from private_storage.fields import PrivateFileField
class PrivateFile(models.Model):
title = models.CharField("Title", max_length=200)
file = PrivateFileField("File")
class PrivateFile2(models.Model):
title = models.CharField("Title", max_length=200)
file = models.FileFi... | [
"from django.db import models\nfrom private_storage.fields import PrivateFileField\n\n\nclass PrivateFile(models.Model):\n title = models.CharField(\"Title\", max_length=200)\n file = PrivateFileField(\"File\")\n\n\nclass PrivateFile2(models.Model):\n title = models.CharField(\"Title\", max_length=200)\n ... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.