index int64 0 100k | blob_id stringlengths 40 40 | code stringlengths 7 7.27M | steps listlengths 1 1.25k | error bool 2
classes |
|---|---|---|---|---|
10,100 | 3161ee98445156af569967ccf26987c18df29669 | r"""The ``fourier`` module provides the core functionality of MPoL via :class:`mpol.fourier.FourierCube`."""
from __future__ import annotations
from typing import Any
import numpy as np
import torch
import torch.fft # to avoid conflicts with old torch.fft *function*
import torchkbnufft
from numpy import complexfloa... | [
"r\"\"\"The ``fourier`` module provides the core functionality of MPoL via :class:`mpol.fourier.FourierCube`.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import Any\n\nimport numpy as np\nimport torch\nimport torch.fft # to avoid conflicts with old torch.fft *function*\nimport torchkbnufft\nfrom num... | false |
10,101 | dc8030ce2a8c415209ecc19ca9926055c46a12b8 | # longest_palindrome2.py
class Solution:
def longestPalindrome(self, s):
map_dict = dict()
for i in s:
if i in map_dict.keys():
map_dict[i] += 1
else:
map_dict[i] = 1
result = 0
mark = 0
for j in map_dict.keys():
... | [
"# longest_palindrome2.py\nclass Solution:\n def longestPalindrome(self, s):\n map_dict = dict()\n\n for i in s:\n if i in map_dict.keys():\n map_dict[i] += 1\n else:\n map_dict[i] = 1 \n\n result = 0 \n mark = 0\n\n for j in ... | false |
10,102 | 6528abc78922a64f4353a2d7541e4a0938d601de | """Test antisymmetric_projection."""
import numpy as np
from toqito.perms import antisymmetric_projection
def test_antisymmetric_projection_d_2_p_1():
"""Dimension is 2 and p is equal to 1."""
res = antisymmetric_projection(2, 1).todense()
expected_res = np.array([[1, 0], [0, 1]])
bool_mat = np.iscl... | [
"\"\"\"Test antisymmetric_projection.\"\"\"\nimport numpy as np\n\nfrom toqito.perms import antisymmetric_projection\n\n\ndef test_antisymmetric_projection_d_2_p_1():\n \"\"\"Dimension is 2 and p is equal to 1.\"\"\"\n res = antisymmetric_projection(2, 1).todense()\n expected_res = np.array([[1, 0], [0, 1]... | false |
10,103 | 1fe5f2f76999c7484acfae831e2a66337f041601 | # Credit: http://realiseyourdreams.wordpress.com/latex-scripts/
#Script to clean up a directory tree!
import os,subprocess
#browse the directory
for dirname, dirnames, filenames in os.walk('.'):
for filename in filenames:
#Check every file for:
filepath = os.path.join(dirname, filename)
#hidden file
if filena... | [
"# Credit: http://realiseyourdreams.wordpress.com/latex-scripts/\n#Script to clean up a directory tree!\nimport os,subprocess\n\n#browse the directory\nfor dirname, dirnames, filenames in os.walk('.'):\n\tfor filename in filenames:\n\t\t#Check every file for:\n\t\tfilepath = os.path.join(dirname, filename)\n\t\t#hi... | true |
10,104 | 17575318372e09039c8d94ed803192e24859cb05 | import subprocess
import shlex
import time
import os
import signal
PROCESS = []
while True:
ANSWER = input('ะัะฑะตัะธัะต ะดะตะนััะฒะธะต: q - ะฒัั
ะพะด, s - ะทะฐะฟัััะธัั ัะตัะฒะตั ะธ ะบะปะธะตะฝัั, x - ะทะฐะบัััั ะฒัะต ะพะบะฝะฐ: ')
if ANSWER == 'q':
break
elif ANSWER == 's':
PROCESS.append(subprocess.Popen('gnome-terminal ... | [
"import subprocess\nimport shlex\nimport time\nimport os\nimport signal\n\n\nPROCESS = []\n\nwhile True:\n\n ANSWER = input('ะัะฑะตัะธัะต ะดะตะนััะฒะธะต: q - ะฒัั
ะพะด, s - ะทะฐะฟัััะธัั ัะตัะฒะตั ะธ ะบะปะธะตะฝัั, x - ะทะฐะบัััั ะฒัะต ะพะบะฝะฐ: ')\n\n if ANSWER == 'q':\n break\n elif ANSWER == 's':\n PROCESS.append(subprocess.P... | false |
10,105 | 133acc36f9c3b54ed808a209054f5efcddbb04ae | # Generated by Django 2.2.7 on 2020-02-03 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fillintheblanks', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='fillquestion',
name='answer_ord... | [
"# Generated by Django 2.2.7 on 2020-02-03 13:54\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('fillintheblanks', '0001_initial'),\n ]\n\n operations = [\n migrations.AddField(\n model_name='fillquestion',\n ... | false |
10,106 | d90d6cd69a792ba03697df51cb5224467c74deeb | from rest_framework import serializers
from .models import *
from django.contrib.auth import authenticate
from django.contrib.auth.models import Group
from rest_framework.response import Response
import json
from django.db import models
class LoginSerializer(serializers.ModelSerializer):
email = serializers.CharFie... | [
"from rest_framework import serializers\nfrom .models import *\nfrom django.contrib.auth import authenticate\nfrom django.contrib.auth.models import Group\nfrom rest_framework.response import Response\n\nimport json\nfrom django.db import models\n\n\nclass LoginSerializer(serializers.ModelSerializer):\n\temail = se... | false |
10,107 | 5e901074031de4e02fa68fa42c3ff780e14d8110 | import os
import spotipy
from spotipy.oauth2 import SpotifyOAuth
import pyautogui
import cv2
from datetime import datetime
from utils import *
class SpotifyControls:
"""
This class execute Spotify API commands based on the hand pose predicted from HandPoses.
The gesture controller uses a specific... | [
"import os\nimport spotipy\nfrom spotipy.oauth2 import SpotifyOAuth\nimport pyautogui\nimport cv2\nfrom datetime import datetime\n\nfrom utils import *\n\n\nclass SpotifyControls:\n \"\"\"\n This class execute Spotify API commands based on the hand pose predicted from HandPoses.\n The gesture contr... | false |
10,108 | ce051e802eb45ba3bd5fcf4a1389eb9baf6a0408 | from inv.models import Item
from dogma.models import TypeAttributes
from dogma.const import *
def getCPUandPGandSlot(itemsIter):
"""Adds extra information to the given list of items.
Returns:
A list of tuples in the form (item, cpu, pg, classes).
- cpu and pg are the unbonused values of the CPU and PG a... | [
"from inv.models import Item\nfrom dogma.models import TypeAttributes\nfrom dogma.const import *\n\n\ndef getCPUandPGandSlot(itemsIter):\n \"\"\"Adds extra information to the given list of items.\n\n Returns:\n A list of tuples in the form (item, cpu, pg, classes).\n\n - cpu and pg are the unbonused values ... | false |
10,109 | 36e6f0b965827ee85ff79c8d591e8307e8b1a590 | import psycopg2
#open databse connection
db = psycopg2.connect(database = "postgres")
###################------------3g------------####################
#####Question 3g##### What percent of students transfer into one of the ABC majors?
cursor3g1 = db.cursor()
#find total num of student ended in ABC
cursor3g1.exec... | [
"import psycopg2\n\n\n#open databse connection\ndb = psycopg2.connect(database = \"postgres\")\n\n###################------------3g------------####################\n\n#####Question 3g##### What percent of students transfer into one of the ABC majors?\ncursor3g1 = db.cursor()\n\n#find total num of student ended in A... | true |
10,110 | 6b9ca358d4a42aac3fb7f208435efecc22dab6c7 | """
This class is the most granular section of the Pabuito Grade Tool.
It takes a subcategory from the xml and generates all GUI components for grading.
It includes all class attributes required to retrieve and load grading attributes [comments, values, etc]
"""
import maya.cmds as cmds
# import maya.utils
import ... | [
"\"\"\"\nThis class is the most granular section of the Pabuito Grade Tool. \n\nIt takes a subcategory from the xml and generates all GUI components for grading. \n\nIt includes all class attributes required to retrieve and load grading attributes [comments, values, etc]\n\"\"\"\n\nimport maya.cmds as cmds\n# impor... | true |
10,111 | d9aa30b8557d9797b9275b5d3dfe2cb31d4755c8 | #!/usr/bin/env python
import numpy as np
import sys
import os
import argparse as ARG
import pylab as plt
sys.path.insert(0, os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')))
sys.path.insert(0, os.path.abspath(
os.path.join(os.path.dirname(__file__), '.')))
import fqlag
from sim_psd import ... | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport sys\nimport os\nimport argparse as ARG\nimport pylab as plt\n\nsys.path.insert(0, os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..')))\nsys.path.insert(0, os.path.abspath(\n os.path.join(os.path.dirname(__file__), '.')))\n \nimport fqlag\nf... | false |
10,112 | 33c49773b2ebb081ed2436e398eaaf389720c24c | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 25 12:04:20 2019
@author: Usuario
"""
from matplotlib import pyplot as plt
import argparse
import cv2
import numpy as np
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image",required=True,help="Set the Path of image")
args = vars(ap.parse_args())
image = cv2.i... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 25 12:04:20 2019\n\n@author: Usuario\n\"\"\"\nfrom matplotlib import pyplot as plt\nimport argparse\nimport cv2\nimport numpy as np\n\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\",\"--image\",required=True,help=\"Set the Path of image\")\nargs = vars(ap... | false |
10,113 | d802b6d08fc7e5b47705374aa305ee6f0b23690b | # -*- coding:UTF-8 -*-
import cx_Oracle
import datetime
import os
# ่ฎพ็ฝฎๅญ็ฌฆ้ไธoracleไธ่ด๏ผไธ็ถinsertไธญๆไนฑ็
os.environ['NLS_LANG'] = 'AMERICAN_AMERICA.ZHS16GBK'
print('====beging...')
# ่ทๅ้่ฆๅคๆญ็ๆฐๆฎไฟกๆฏ
startTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
print('===========================',startTime,'=======================... | [
"# -*- coding:UTF-8 -*-\nimport cx_Oracle\nimport datetime\nimport os\n\n# ่ฎพ็ฝฎๅญ็ฌฆ้ไธoracleไธ่ด๏ผไธ็ถinsertไธญๆไนฑ็ \nos.environ['NLS_LANG'] = 'AMERICAN_AMERICA.ZHS16GBK'\nprint('====beging...')\n# ่ทๅ้่ฆๅคๆญ็ๆฐๆฎไฟกๆฏ\nstartTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')\nprint('===========================',startTime,'========... | false |
10,114 | a7114a9f1c7342e155cde04dc0f5d1461fd08f87 | '''
Given a string s, return the longest palindromic substring in s.
-------
RESULTS
-------
Time Complexity:
Space Complexity:
''' | [
"'''\nGiven a string s, return the longest palindromic substring in s.\n\n-------\nRESULTS\n-------\nTime Complexity:\nSpace Complexity:\n\n'''",
"<docstring token>\n"
] | false |
10,115 | 15f11fae7dbededb6aaf3292c8e211a9b86c605d | from django.contrib import admin
from .models import Article
# Register your models here.
@admin.register(Article)
class ArticleModel(admin.ModelAdmin):
list_filter = ('subject', 'date_of_publish', 'state')
list_display = ('subject', 'date_of_publish', 'state')
date_hierarchy = ('date_of_publish')
| [
"from django.contrib import admin\nfrom .models import Article\n# Register your models here.\n\n\n@admin.register(Article)\nclass ArticleModel(admin.ModelAdmin):\n list_filter = ('subject', 'date_of_publish', 'state')\n list_display = ('subject', 'date_of_publish', 'state')\n date_hierarchy = ('date_of_pub... | false |
10,116 | a6852f294fd536d7b020db33fab561a12829837f | from django.contrib.auth.hashers import BasePasswordHasher
from collections import OrderedDict
class PlainTextPassword(BasePasswordHasher):
algorithm = "plain"
def salt(self):
return ''
def encode(self, password, salt):
assert salt == ''
return password
def verify(self, passwo... | [
"from django.contrib.auth.hashers import BasePasswordHasher\nfrom collections import OrderedDict\nclass PlainTextPassword(BasePasswordHasher):\n algorithm = \"plain\"\n\n def salt(self):\n return ''\n\n def encode(self, password, salt):\n assert salt == ''\n return password\n\n def ... | false |
10,117 | abe111117ab67c2fbc0cba8d867937fb54b9b7da | """
@author: Viet Nguyen <nhviet1009@gmail.com>
"""
import torch
import torch.nn as nn
class WordAttNet(nn.Module):
def __init__(self, hidden_size, word_dict_len, embed_size):
super(WordAttNet, self).__init__()
self.lookup = nn.Embedding(num_embeddings=word_dict_len, embedding_dim=embed_size)
... | [
"\"\"\"\n@author: Viet Nguyen <nhviet1009@gmail.com>\n\"\"\"\nimport torch\nimport torch.nn as nn\n\n\nclass WordAttNet(nn.Module):\n def __init__(self, hidden_size, word_dict_len, embed_size):\n super(WordAttNet, self).__init__()\n\n self.lookup = nn.Embedding(num_embeddings=word_dict_len, embeddi... | false |
10,118 | 6523c652c98874716aa973e39d767e0915aa46fd | '''
้ฎ้ข๏ผๅฆๆไธๅ็็ถ็ฑปๅบ็ฐไบ็ธๅๅ็งฐ็ๅฑๆงๆ่
ๆนๆณ
ๅญ็ฑปไผ็ปงๆฟ่ฐ็ๅฑๆงๆ่
ๆนๆณ๏ผ
python3ไธญ้ฝๆฏๆฐๅผ็ฑป๏ผๅนฟๅบฆไผๅ
๏ผไป็ถ็ฑปไธญๆฅ่ฏขๅฏนๅบ็ๆนๆณ๏ผๆฅ่ฏขๅฐ็ฌฌไธไธชๆปก่ถณ็ๆนๆณไนๅๅฐฑ็ดๆฅ่ฟๅ
object
|
A(object)
|
A_1(A) --> A_2(A)
|
Test(A_1, A_2)
python2ไธญ็็ปๅ
ธ็ฑป๏ผๆทฑๅบฆไผๅ
A
... | [
"'''\n้ฎ้ข๏ผๅฆๆไธๅ็็ถ็ฑปๅบ็ฐไบ็ธๅๅ็งฐ็ๅฑๆงๆ่
ๆนๆณ\n ๅญ็ฑปไผ็ปงๆฟ่ฐ็ๅฑๆงๆ่
ๆนๆณ๏ผ\n\n python3ไธญ้ฝๆฏๆฐๅผ็ฑป๏ผๅนฟๅบฆไผๅ
๏ผไป็ถ็ฑปไธญๆฅ่ฏขๅฏนๅบ็ๆนๆณ๏ผๆฅ่ฏขๅฐ็ฌฌไธไธชๆปก่ถณ็ๆนๆณไนๅๅฐฑ็ดๆฅ่ฟๅ\n object\n |\n A(object)\n |\n A_1(A) --> A_2(A)\n |\n Test(A_1, A_2)\n\n python2ไธญ็็ปๅ
ธ็ฑป๏ผๆทฑๅบฆไผๅ
\n ... | false |
10,119 | 3345787c7d7a7a72f1db2490cc585d39ca74240e | __author__ = 'ericdennison'
from hhscp import app
from hhscp.events import *
from hhscp.users import User, Users, ADMIN, USERSFILE
from flask import render_template
from flask import request, session
from flask import redirect
import inspect
import sys
import datetime
import tempfile
@app.route('/calendar')
def site... | [
"__author__ = 'ericdennison'\n\nfrom hhscp import app\nfrom hhscp.events import *\nfrom hhscp.users import User, Users, ADMIN, USERSFILE\nfrom flask import render_template\nfrom flask import request, session\nfrom flask import redirect\nimport inspect\nimport sys\nimport datetime\nimport tempfile\n\n\n@app.route('/... | false |
10,120 | 1d14118d1ee7f2888ed7ee68be4a27ff7488faab | import random
from socket import *
port = 2500
BUFFER = 1024
server = "localhost"
sock = socket(AF_INET, SOCK_DGRAM)
sock.connect((server, port))
for i in range(10):
delay = 0.1
data = 'Hello message'
while True:
sock.send(data.encode())
print("Waiting up to {} secondes for a reply".form... | [
"import random\nfrom socket import *\n\nport = 2500\nBUFFER = 1024\nserver = \"localhost\"\n\nsock = socket(AF_INET, SOCK_DGRAM)\nsock.connect((server, port))\n\nfor i in range(10):\n delay = 0.1\n data = 'Hello message'\n\n while True:\n sock.send(data.encode())\n print(\"Waiting up to {} se... | false |
10,121 | 3eee7008c7db28f7c6fcc4500683b34f808aa2d7 | # -*- coding: utf-8 -*-
# // --- Directions
# // Check to see if two provided strings are anagrams of eachother.
# // One string is an anagram of another if it uses the same characters
# // in the same quantity. Only consider characters, not spaces
# // or punctuation. Consider capital letters to be the same as lower ... | [
"# -*- coding: utf-8 -*-\n# // --- Directions\n# // Check to see if two provided strings are anagrams of eachother.\n# // One string is an anagram of another if it uses the same characters\n# // in the same quantity. Only consider characters, not spaces\n# // or punctuation. Consider capital letters to be the same... | false |
10,122 | c33697970dfb1d99d9b071460c235dbf2b612e62 | from DateTime import DateTime
from Products.ATContentTypes.interfaces import IATEvent as IATEvent_ATCT
from Products.ATContentTypes.tests.utils import EmailValidator
from Products.ATContentTypes.tests.utils import EmptyValidator
from Products.ATContentTypes.tests.utils import NotRequiredTidyHTMLValidator
from Products.... | [
"from DateTime import DateTime\nfrom Products.ATContentTypes.interfaces import IATEvent as IATEvent_ATCT\nfrom Products.ATContentTypes.tests.utils import EmailValidator\nfrom Products.ATContentTypes.tests.utils import EmptyValidator\nfrom Products.ATContentTypes.tests.utils import NotRequiredTidyHTMLValidator\nfrom... | false |
10,123 | c00873814c110f571396973e99ffc953b2e21788 | dict = {'naam': } | [
"dict = {'naam': }"
] | true |
10,124 | 59e446d26c5becfe8e7d4486e204d85a0b807dab | __author__ = 'Gina Pappagallo (gmp5vb)'
def greetings(msg):
print(str(msg)) | [
"__author__ = 'Gina Pappagallo (gmp5vb)'\n\ndef greetings(msg):\n print(str(msg))",
"__author__ = 'Gina Pappagallo (gmp5vb)'\n\n\ndef greetings(msg):\n print(str(msg))\n",
"<assignment token>\n\n\ndef greetings(msg):\n print(str(msg))\n",
"<assignment token>\n<function token>\n"
] | false |
10,125 | 4cc15ca62803def398ce31181c0a73184d8b28f6 | """
:Copyright: 2014-2023 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import pytest
from byceps.services.tourney import (
tourney_match_comment_service,
tourney_match_service,
)
def test_hide_comment(api_client, api_client_authz_header, admin_user, comment):
comment_b... | [
"\"\"\"\n:Copyright: 2014-2023 Jochen Kupperschmidt\n:License: Revised BSD (see `LICENSE` file for details)\n\"\"\"\n\nimport pytest\n\nfrom byceps.services.tourney import (\n tourney_match_comment_service,\n tourney_match_service,\n)\n\n\ndef test_hide_comment(api_client, api_client_authz_header, admin_user,... | false |
10,126 | d26f1a7e426c5a280e66638bc239ce4b69f7b71b | import sys
import numpy as np
import random
import os
import math
def usage():
print("Usage \n")
print("python3 packet_generator.py <num_packets> <payload_length> <radix> <stages> <output_file_name> \n")
print("output_file_name is optional will default to test.mem in the current working directory")
def packet_gen... | [
"import sys\nimport numpy as np\nimport random\nimport os\nimport math\n\ndef usage():\n\tprint(\"Usage \\n\")\n\tprint(\"python3 packet_generator.py <num_packets> <payload_length> <radix> <stages> <output_file_name> \\n\")\n\tprint(\"output_file_name is optional will default to test.mem in the current working dire... | false |
10,127 | 2cf767ba9dea293fb5df7725d9f89ab17e0d6a8a | ## https://leetcode.com/problems/max-increase-to-keep-city-skyline/description/
class Solution:
def findMaxInCol(self,grid,m,n):
ret = [0]*n
for j in range(n):
i=1
temp = grid[0][j]
while i<m:
if grid[i][j] > temp:
temp = g... | [
"## https://leetcode.com/problems/max-increase-to-keep-city-skyline/description/\nclass Solution:\n \n def findMaxInCol(self,grid,m,n):\n ret = [0]*n\n for j in range(n):\n i=1\n temp = grid[0][j]\n while i<m:\n if grid[i][j] > temp:\n ... | false |
10,128 | eea67d437a504d06bd909c4b52a8d59d770620a1 | #!/bin/python
import platform
os_info = platform.platform()
print os_info
if os_info.find('Linux') >= 0 or os_info.find('Darwin') >= 0: # Linux or Mac build
env = Environment()
env.Append(CPPFLAGS = '-Wall -O3')
env.Append(CPPPATH = ['src',])
elif os_info.find('Windows') >= 0:
env = Environment(MSVC_U... | [
"#!/bin/python\n\nimport platform\nos_info = platform.platform()\nprint os_info\n\nif os_info.find('Linux') >= 0 or os_info.find('Darwin') >= 0: # Linux or Mac build\n env = Environment()\n env.Append(CPPFLAGS = '-Wall -O3')\n env.Append(CPPPATH = ['src',])\nelif os_info.find('Windows') >= 0:\n env = En... | true |
10,129 | e8842838829bb9d68f660c0635d1dbac14a3f1c4 | import csv
from selenium.webdriver.support.ui import Select
def selectdepaturereturn(self, d="none", r="none", prom_cod="none"):
find_element_text = "Departure_option_xpath"
session_name = "Booking"
Departure_date_selected = Select(self.get_path(session_name, find_element_text))
Departure_date = self.g... | [
"import csv\nfrom selenium.webdriver.support.ui import Select\n\ndef selectdepaturereturn(self, d=\"none\", r=\"none\", prom_cod=\"none\"):\n find_element_text = \"Departure_option_xpath\"\n session_name = \"Booking\"\n Departure_date_selected = Select(self.get_path(session_name, find_element_text))\n D... | true |
10,130 | 68d93144b338174773b709a3ccca8294593122cc | #โ๐๐๐๐๐๐๐๐โ#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''โ'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
def is_prime(n):
n = a... | [
"#โ๐๐๐๐๐๐๐๐โ#\nimport sys\nimport math\nfrom math import ceil, floor\nimport itertools\nfrom functools import lru_cache\nfrom collections import deque\nsys.setrecursionlimit(10000000)\ninput=lambda : sys.stdin.readline().rstrip()\n'''''โ'''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\ndef is_pri... | false |
10,131 | 8f2ea021c34f154961db57b8d28ab14f6a7e3beb | from datetime import datetime, timedelta, timezone
import time_machine
from translator.tools import date_tools
# --------------------------------------------------------------------------------unit test for parse_datetime_from_unix function-----------------------------------------------------------------------------... | [
"from datetime import datetime, timedelta, timezone\n\nimport time_machine\nfrom translator.tools import date_tools\n\n\n# --------------------------------------------------------------------------------unit test for parse_datetime_from_unix function------------------------------------------------------------------... | false |
10,132 | 3a8149808aadc48420f9050a93a167347b073a80 | def main():
N, K = (int(i) for i in input().split())
if (N+1)//2 >= K:
print("YES")
else:
print("NO")
if __name__ == '__main__':
main()
| [
"def main():\n N, K = (int(i) for i in input().split())\n if (N+1)//2 >= K:\n print(\"YES\")\n else:\n print(\"NO\")\n\n\nif __name__ == '__main__':\n main()\n",
"def main():\n N, K = (int(i) for i in input().split())\n if (N + 1) // 2 >= K:\n print('YES')\n else:\n ... | false |
10,133 | ae1dc185a11658df7838a799c1318b7167c5051b | #Short and handy script to login and after "x" seconds logout from Stackoverflow
import requests
import config
import re
import datetime
import time
### DEFINING VARIABLES ###
headers = {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 1... | [
"#Short and handy script to login and after \"x\" seconds logout from Stackoverflow\nimport requests\nimport config\nimport re\nimport datetime\nimport time\n\n\n### DEFINING VARIABLES ###\nheaders = {\n 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',\n \"User-Agent\": \"Mozilla/5.0 (Macint... | false |
10,134 | 0d8c6dec7b375a385c4df501e05eab2e5f685288 |
# coding: utf-8
# # Awele TME 1
# ##DE BEZENAC DE TOLDI
#
# In[9]:
# - - - - - - - - - - -
# IAMSI - 2016
# joueur d'Awele
# - - - - -
# REM: ce programme a ete ecrit en Python 3.4
#
# En salle machine : utiliser la commande "python3"
# - - - - - - - - - - -
# - - - - - - - - - - - - - - - INFORMATIONS BINOME
#... | [
"\n# coding: utf-8\n\n# # Awele TME 1\n# ##DE BEZENAC DE TOLDI\n# \n\n# In[9]:\n\n# - - - - - - - - - - -\n# IAMSI - 2016\n# joueur d'Awele\n# - - - - -\n# REM: ce programme a ete ecrit en Python 3.4\n# \n# En salle machine : utiliser la commande \"python3\"\n# - - - - - - - - - - -\n\n# - - - - - - - - - - - - - ... | true |
10,135 | 0be99279635d8b5185fb29b2dd272f51d2d6c8f0 | import apps.configs.configuration as conf
from apps.configs.vars import Vars
from apps.models.tarea_programada import TareaProgramada,StatusTarea
from apps.models.receptor_estado import ReceptorDeEstado
from apps.utils.system_util import path_join
import json
from apps.models.exception import AppException
from apps.uti... | [
"import apps.configs.configuration as conf\nfrom apps.configs.vars import Vars\nfrom apps.models.tarea_programada import TareaProgramada,StatusTarea\nfrom apps.models.receptor_estado import ReceptorDeEstado\nfrom apps.utils.system_util import path_join\nimport json\nfrom apps.models.exception import AppException\nf... | false |
10,136 | 9eecfc950df298c1de1c1c596f981051b2eb4f89 |
import random
#-----Entradas----#
MENSAJE_SALUDAR = '''
Bienvenido
a este programa,
!!!jueguemos!!'''
MENSAJE_SEGUNDO_NIVEL = 'Felicidades pasaste el primer nivel ahora ve por el รบltimo!!'
MENSAJE_CALIENTE = 'Estas caliente'
MENSAJE_FRIO = 'Estas Frio'
PREGUNTAR_NUMERO = '''
En este juego deb... | [
"\nimport random\n#-----Entradas----#\nMENSAJE_SALUDAR = '''\n Bienvenido \n a este programa, \n !!!jueguemos!!'''\nMENSAJE_SEGUNDO_NIVEL = 'Felicidades pasaste el primer nivel ahora ve por el รบltimo!!'\nMENSAJE_CALIENTE = 'Estas caliente'\nMENSAJE_FRIO = 'Estas Frio'\nPREGUNTAR_NUMERO = '''\n E... | false |
10,137 | f1d36444e6a1c54ff572586fa59566a52384819e | #!/usr/bin/python
#import os
import json
import sys
#import time
from datetime import datetime as dt
from datetime import date, timedelta
import pdb
import smtplib
#from time import strftime
#from types import *
import ConfigParser
import operator
from email.mime.multipart import MIMEMultipart
from email.mime.text imp... | [
"#!/usr/bin/python\n\n#import os\nimport json\nimport sys\n#import time\nfrom datetime import datetime as dt\nfrom datetime import date, timedelta\nimport pdb\nimport smtplib\n#from time import strftime\n#from types import *\nimport ConfigParser\nimport operator\nfrom email.mime.multipart import MIMEMultipart\nfrom... | true |
10,138 | 1b4bd28e41f14829f6cb760541c9114becf4863f |
with open("D:\DanielVIB\Maize\MoreDataSets\PearsonNetworks\ConsolidateCut\ProcessesRecallNoBP.txt", "r") as fileSAC,\
open("D:\DanielVIB\Maize\MoreDataSets\PearsonNetworks\ConsolidateCut\ProcessesRecallKrem.txt", "r") as fileKrem,\
open("D:\DanielVIB\Maize\MoreDataSets\PearsonNetworks\ConsolidateCut\Proc... | [
"\nwith open(\"D:\\DanielVIB\\Maize\\MoreDataSets\\PearsonNetworks\\ConsolidateCut\\ProcessesRecallNoBP.txt\", \"r\") as fileSAC,\\\n open(\"D:\\DanielVIB\\Maize\\MoreDataSets\\PearsonNetworks\\ConsolidateCut\\ProcessesRecallKrem.txt\", \"r\") as fileKrem,\\\n\t\t open(\"D:\\DanielVIB\\Maize\\MoreDataSets... | false |
10,139 | 4ebee1de80f17cbfef5a335124fd85c762adf5cf | from postprocess import dynamic_audio_normalize
from _shutil import *
f = get_files()[0]
dynamic_audio_normalize(f)
| [
"from postprocess import dynamic_audio_normalize\nfrom _shutil import *\n\nf = get_files()[0]\ndynamic_audio_normalize(f)\n",
"from postprocess import dynamic_audio_normalize\nfrom _shutil import *\nf = get_files()[0]\ndynamic_audio_normalize(f)\n",
"<import token>\nf = get_files()[0]\ndynamic_audio_normalize(f... | false |
10,140 | 20c22db1d9ac8c1f01fe5e64609396c07518bc08 | from copy import deepcopy
from django.contrib.auth.hashers import make_password
from django.core.mail import send_mail
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.contrib.auth import login, update_session_auth_hash
from django.contrib.auth.forms i... | [
"from copy import deepcopy\n\nfrom django.contrib.auth.hashers import make_password\nfrom django.core.mail import send_mail\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render, redirect\nfrom django.contrib.auth import login, update_session_auth_hash\nfrom django.contrib.... | false |
10,141 | f8cf01e2f554205b8a1a9b085c98b46d791ca3b3 | """backport module"""
import os
import shutil
import re
class Backport:
"""A simple class for transforming Python source files.
"""
DEFAULT_PATH = "."
PYTHON_EXTENSION = "py"
BACKUP_EXTENSION = "orig"
REPLACEMENTS = {}
IGNORE = (__file__,)
def __init__(self, path=DEFAULT_PATH, file... | [
"\"\"\"backport module\"\"\"\n\nimport os\nimport shutil\nimport re\n\n\nclass Backport:\n \"\"\"A simple class for transforming Python source files.\n\n \"\"\"\n\n DEFAULT_PATH = \".\"\n PYTHON_EXTENSION = \"py\"\n BACKUP_EXTENSION = \"orig\"\n REPLACEMENTS = {}\n IGNORE = (__file__,)\n\n d... | false |
10,142 | 6b27564c0870f6ef341dcc425d6af2ed6fc726f3 | # Copyright (c) 2021 by Cisco Systems, Inc.
# All rights reserved.
expected_output = {
'evi': {
1: {
'bd_id': {
11: {
'eth_tag': {
0: {
'remote_count': 4,
'local_count': 5,
... | [
"# Copyright (c) 2021 by Cisco Systems, Inc.\n# All rights reserved.\n\nexpected_output = {\n 'evi': {\n 1: {\n 'bd_id': {\n 11: {\n 'eth_tag': {\n 0: {\n 'remote_count': 4,\n 'local_c... | false |
10,143 | bbaeb7b13e50e14fe29dab5846310e43b6f73e83 | '''
Individual stages of the pipeline implemented as functions from
input files to output files.
The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''
from utils import safe_make_di... | [
"'''\nIndividual stages of the pipeline implemented as functions from\ninput files to output files.\n\nThe run_stage function knows everything about submitting jobs and, given\nthe state parameter, has full access to the state of the pipeline, such\nas config, options, DRMAA and the logger.\n'''\n\nfrom utils impor... | false |
10,144 | ce43bb3c2172dd0f286807a751827a4c3ab85816 | # We run a preorder depth first search on the root of a binary tree.
#
# At each node in this traversal, we output D dashes (where D is the depth of t
# his node), then we output the value of this node. (If the depth of a node is D,
# the depth of its immediate child is D+1. The depth of the root node is 0.)
#
# ... | [
"# We run a preorder depth first search on the root of a binary tree. \n# \n# At each node in this traversal, we output D dashes (where D is the depth of t\n# his node), then we output the value of this node. (If the depth of a node is D, \n# the depth of its immediate child is D+1. The depth of the root node is 0... | false |
10,145 | b07556b6800e79679cc3d40276a098aa90b0bff4 | import unittest
from deep_tasks import *
class TestFindFuncs(unittest.TestCase):
def setUp(self):
self.diki = {
'A': {
'C': [2, 5],
'D': {
'I': 'heyo!',
'J': 6,
'F': 'In [A][D]'
},
... | [
"import unittest\nfrom deep_tasks import *\n\n\nclass TestFindFuncs(unittest.TestCase):\n\n def setUp(self):\n self.diki = {\n 'A': {\n 'C': [2, 5],\n 'D': {\n 'I': 'heyo!',\n 'J': 6,\n 'F': 'In [A][D]'\n ... | false |
10,146 | d4814dc755ff0f3a8e82427659a7e4dfeaa84bcd | import math
import operator
from scipy import stats
from utils import getTweets
w1 = 0.3
w2 = 0.3
w3 = 0.3
def kullback_leibler(distr_a,distr_b):
return stats.entropy(distr_a,distr_b)
def logistic_increasing_func(x):
return 1 / (1 + math.exp(x))
def coverage_score(tweet):
return 0
def significance_sco... | [
"import math\nimport operator\n\nfrom scipy import stats\nfrom utils import getTweets\n\nw1 = 0.3\nw2 = 0.3\nw3 = 0.3\n\ndef kullback_leibler(distr_a,distr_b):\n return stats.entropy(distr_a,distr_b)\n\ndef logistic_increasing_func(x):\n return 1 / (1 + math.exp(x))\n\ndef coverage_score(tweet):\n return 0... | false |
10,147 | e70493981b140fc0b59b99b30f0d67c37ba967ea | from RSAAlgorithm import autoGen as genKeyPair
class Keyring:
def __init__(self):
self.name = "Me"
self.publicKey, self.privateKey = genKeyPair(10)#10 bits of entropy is ridiculously weak: for testing purposes only.
self.keys = [{self.name : self.publicKey}]
def addKeyValuePair(self, k... | [
"from RSAAlgorithm import autoGen as genKeyPair\n\nclass Keyring:\n def __init__(self):\n self.name = \"Me\"\n self.publicKey, self.privateKey = genKeyPair(10)#10 bits of entropy is ridiculously weak: for testing purposes only.\n self.keys = [{self.name : self.publicKey}]\n\n def addKeyVa... | false |
10,148 | 24b99b72d627ec6231516524c44767c60a4a5b5f | from functools import reduce
with open('input') as rawinput:
groups = rawinput.read().split('\n\n')
def count_individual_answers(individual):
def reducer(accumulator, letter):
accumulator[letter] = accumulator.get(letter, 0) + 1
return accumulator
return reduce(reducer, individual, {})
... | [
"from functools import reduce\n\nwith open('input') as rawinput:\n groups = rawinput.read().split('\\n\\n')\n\n\ndef count_individual_answers(individual):\n def reducer(accumulator, letter):\n accumulator[letter] = accumulator.get(letter, 0) + 1\n return accumulator\n return reduce(reducer, i... | false |
10,149 | edcbc5c642684eb83cf45a131a74c91de4404a58 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.http import HtmlResponse
from bookparser.items import BookparserItem
class Book24Spider(scrapy.Spider):
name = 'book24'
allowed_domains = ['book24.ru']
def __init__(self, book):
self.start_urls = [f'https://book24.ru/search/?q={book}']
def pa... | [
"# -*- coding: utf-8 -*-\nimport scrapy\nfrom scrapy.http import HtmlResponse\nfrom bookparser.items import BookparserItem\n\nclass Book24Spider(scrapy.Spider):\n name = 'book24'\n allowed_domains = ['book24.ru']\n\n def __init__(self, book):\n self.start_urls = [f'https://book24.ru/search/?q={book}... | false |
10,150 | ada2dff08d5221ed885ab97eabbd8d2972cf3396 | class Error(Exception):
pass
def foo():
for i in reversed(range(10)):
if i == 5:
raise Error
yield i
i = 0
try:
for (i, val) in enumerate(foo()):
print i
except Error:
print "caught exception at i = %d" % i
raise
| [
"class Error(Exception):\n pass\n\ndef foo():\n for i in reversed(range(10)):\n if i == 5:\n raise Error\n\n yield i\n\ni = 0\ntry:\n for (i, val) in enumerate(foo()):\n print i\nexcept Error:\n print \"caught exception at i = %d\" % i\n raise\n"
] | true |
10,151 | 297816b3f675d550d8abbe2ab4c2cee40c52b880 | #!/usr/bin/python3
#
# jip, 20.12.2017, falling into marasmus... :-)
#
import sys
import tkinter
from tkinter import Button
from tkinter import TOP, BOTTOM, LEFT
import time
from random import randint
#from Line import Line
from Point import Point
from Snowflake import Snowflake
def quit():
root.destroy()
s... | [
"#!/usr/bin/python3\n#\n# jip, 20.12.2017, falling into marasmus... :-)\n#\nimport sys\n\nimport tkinter\nfrom tkinter import Button\nfrom tkinter import TOP, BOTTOM, LEFT\nimport time\nfrom random import randint\n\n#from Line import Line\nfrom Point import Point\nfrom Snowflake import Snowflake\n\ndef quit(): \n ... | false |
10,152 | 2619d6f9cab0cbe231a6a7d3bb56e7bc6d489089 | # inpld project - python script
# - AIM: poll the value of a sensor and send as OSC to sclang e.g. '/gsr 52'
import OSC
from OSC import OSCClient, OSCMessage
from threading import Timer
import Adafruit_BBIO.ADC as ADC
import random # for faking random ADC values
inPin = "P9_40" # connect sensor to this pin
sendAddres... | [
"# inpld project - python script\n# - AIM: poll the value of a sensor and send as OSC to sclang e.g. '/gsr 52'\n\nimport OSC\nfrom OSC import OSCClient, OSCMessage\nfrom threading import Timer\nimport Adafruit_BBIO.ADC as ADC\nimport random # for faking random ADC values\n\ninPin = \"P9_40\" # connect sensor to thi... | true |
10,153 | 9afe405dfceec2abf6c1dea58fc92c447c33ca51 | # coding = utf-8
# python 3.7.3
# created by wuyang on 2020/3/24
from .base import BaseNet
from .fcn import FCN, FCNHead
from .pspnet import PSPNet
from .deeplabv3 import DeepLabV3
models = {
"fcn": FCN,
"pspnet": PSPNet,
"deeplabv3": DeepLabV3,
}
def get_segmentation_model(name, **kwargs):
return m... | [
"# coding = utf-8\n# python 3.7.3\n# created by wuyang on 2020/3/24\nfrom .base import BaseNet\nfrom .fcn import FCN, FCNHead\nfrom .pspnet import PSPNet\nfrom .deeplabv3 import DeepLabV3\n\n\nmodels = {\n \"fcn\": FCN,\n \"pspnet\": PSPNet,\n \"deeplabv3\": DeepLabV3,\n}\n\n\ndef get_segmentation_model(na... | false |
10,154 | 75a9863bd19775c603021dfb41e9f3f7b158f097 | import caw.widget
class Spacer(caw.widget.Widget):
def __init__(self, width=5, **kwargs):
super(Spacer, self).__init__(**kwargs)
self.width_hint = width
| [
"import caw.widget\n\nclass Spacer(caw.widget.Widget):\n def __init__(self, width=5, **kwargs):\n super(Spacer, self).__init__(**kwargs)\n self.width_hint = width\n",
"import caw.widget\n\n\nclass Spacer(caw.widget.Widget):\n\n def __init__(self, width=5, **kwargs):\n super(Spacer, self... | false |
10,155 | 06643d2c93f551e8e046711b1116a076c7446f43 | s="hello python this is python language"
'''expected out put is
hello:1
python:2
this:1
is:1
language:1
'''
x=s.split()
d={}
for i in x:
if d.get(i):
d[i]=d.get(i)+1
else:
d[i]=1
print d
| [
"s=\"hello python this is python language\"\n'''expected out put is\nhello:1\npython:2\nthis:1\nis:1\nlanguage:1\n'''\nx=s.split()\nd={}\nfor i in x:\n if d.get(i):\n d[i]=d.get(i)+1\n else:\n d[i]=1\nprint d\n"
] | true |
10,156 | 2cf66dbf96281e08a034ff4a43da177679efa423 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-09 21:18
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
from django.utils.timezone import now
class Migration(migrations.Migration):
dependencies = [
('csn', '0001_initial'),
... | [
"# -*- coding: utf-8 -*-\n# Generated by Django 1.10.6 on 2017-05-09 21:18\nfrom __future__ import unicode_literals\nimport django.core.validators\nfrom django.db import migrations, models\nfrom django.utils.timezone import now\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('csn', '00... | false |
10,157 | 8ca1e7fc49881ff859d35111f58754db0cd6881a | """Django templates for hiccup main page."""
| [
"\"\"\"Django templates for hiccup main page.\"\"\"\n",
"<docstring token>\n"
] | false |
10,158 | 740cb544c7e62fd40d5cebde9371cd34007dab0e |
def main():
#Escribe tu cรณdigo debajo de esta lรญnea
import math
x= int(input("Escribe un numero: "))
y= math.sqrt(x)
z= round(y)
u= z+1
print(str(u))
pass
if __name__=='__main__':
main()
| [
"\n\ndef main():\n #Escribe tu cรณdigo debajo de esta lรญnea\n import math\n x= int(input(\"Escribe un numero: \"))\n y= math.sqrt(x)\n z= round(y)\n u= z+1\n print(str(u))\n pass\n\nif __name__=='__main__':\n main()\n",
"def main():\n import math\n x = int(input('Escribe un numero:... | false |
10,159 | 13f2f8d8d0538b4f6cec0ef123eab769fb01f7d8 | <<<<<<< HEAD
import json
import re
import os
hotelname = input("่ฏท่พๅ
ฅ้
ๅบๅ๏ผ")
while not re.match(r'\w+', hotelname):
hotelname = input("่ฏท่พๅ
ฅๆญฃ็กฎ็้
ๅบๅ๏ผ")
json_filename='hotel_info.json'
f=open(json_filename,'r')
hotel_info=json.load(f)
for x in hotel_info:
y=x['hotel_name']
print(x)
print(y)
if y.find(hote... | [
"<<<<<<< HEAD\nimport json\nimport re\nimport os\n\nhotelname = input(\"่ฏท่พๅ
ฅ้
ๅบๅ๏ผ\")\nwhile not re.match(r'\\w+', hotelname):\n hotelname = input(\"่ฏท่พๅ
ฅๆญฃ็กฎ็้
ๅบๅ๏ผ\")\n\njson_filename='hotel_info.json'\nf=open(json_filename,'r')\nhotel_info=json.load(f)\nfor x in hotel_info:\n y=x['hotel_name']\n print(x)\n pr... | true |
10,160 | c0425fe2c2d713a8a97164d6127560d9d0154a2a | import os
os.system('clear')
import json
import importlib
import argparse
import gevent
import time
import requests
import smtplib
from smtplib import SMTPException
from gevent.threadpool import ThreadPool
from gevent.queue import Queue
from gevent import monkey
monkey.patch_all(thread=False)
os.environ['TERM'] = 'dum... | [
"import os\nos.system('clear')\nimport json\nimport importlib\nimport argparse\nimport gevent\nimport time\nimport requests\nimport smtplib\nfrom smtplib import SMTPException\nfrom gevent.threadpool import ThreadPool\nfrom gevent.queue import Queue\nfrom gevent import monkey\nmonkey.patch_all(thread=False)\n\nos.en... | true |
10,161 | 0e013ca31c3b969c8dac3638ec56d4d12492aa8e | import tensorflow as tf
from absl.testing import parameterized
from meta_model import utils
def assert_specs_equal(actual, expected):
assert tuple(actual._shape) == tuple(expected._shape)
assert actual._dtype == expected._dtype
assert type(actual) == type(expected)
if isinstance(actual, tf.RaggedTens... | [
"import tensorflow as tf\nfrom absl.testing import parameterized\n\nfrom meta_model import utils\n\n\ndef assert_specs_equal(actual, expected):\n assert tuple(actual._shape) == tuple(expected._shape)\n assert actual._dtype == expected._dtype\n assert type(actual) == type(expected)\n if isinstance(actual... | false |
10,162 | 5ad63a3149707961bb9ac76e162e4159330da6d1 | """
ํฑ๋๋ฐํด
https://www.acmicpc.net/problem/14891
"""
def moveClock(g) :
temp = gears[g][-1]
for i in range(8) :
gears[g][i], temp = temp, gears[g][i]
def moveNonClock(g) :
temp = gears[g][0]
for i in range(7,-1,-1) :
gears[g][i], temp = temp, gears[g][i]
def moveGear(gear, direction, be... | [
"\"\"\"\nํฑ๋๋ฐํด\nhttps://www.acmicpc.net/problem/14891\n\"\"\"\n\ndef moveClock(g) :\n temp = gears[g][-1]\n for i in range(8) :\n gears[g][i], temp = temp, gears[g][i]\n\ndef moveNonClock(g) :\n temp = gears[g][0]\n for i in range(7,-1,-1) :\n gears[g][i], temp = temp, gears[g][i]\n\ndef mo... | false |
10,163 | c918ca69685b0aff413be3d2e83a2e5221eebf10 | import urllib.request, urllib.error, urllib.parse, json
from flask import Flask, render_template, request, request
import logging
import random
app = Flask(__name__)
def safe_get(url):
try:
return urllib.request.urlopen(url)
except urllib.error.HTTPError as e:
print("The server coul... | [
"import urllib.request, urllib.error, urllib.parse, json\r\nfrom flask import Flask, render_template, request, request\r\nimport logging\r\nimport random\r\n\r\napp = Flask(__name__)\r\n\r\ndef safe_get(url):\r\n try:\r\n return urllib.request.urlopen(url)\r\n except urllib.error.HTTPError as e:\r\n ... | false |
10,164 | e00d82974c960d0322653a884a68e33197651a45 | import time, math, os
from selenium import webdriver
import pyperclip
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
options = webdriver.ChromeOptions()
options.binary_location = "/Applications/Google C... | [
"import time, math, os\nfrom selenium import webdriver\nimport pyperclip\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom selenium.webdriver.support.ui import WebDriverWait\noptions = webdriver.ChromeOptions()\noptions.binary_location = \"/Applicat... | false |
10,165 | 630c533a9c42d6a55747b8f874aee3daee3e96ef | import binascii
string = "1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736"
nums = binascii.unhexlify(string) #Convert hex to binary-data
strings = (''.join(chr(num ^ key) for num in nums) for key in range(256))
test = max(strings, key=lambda s: sum((26-i) * s.count(c) for i, c in enumerate('etaoins... | [
"import binascii\nstring = \"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736\"\nnums = binascii.unhexlify(string) #Convert hex to binary-data\nstrings = (''.join(chr(num ^ key) for num in nums) for key in range(256))\ntest = max(strings, key=lambda s: sum((26-i) * s.count(c) for i, c in enumera... | false |
10,166 | 5a170bfc6c894c0547755403b7b3028fa73bb949 | import random
import sqlite3
class DataBase:
def __init__(self):
self.ids = 0
self.conn = sqlite3.connect('card.s3db')
self.cur = self.conn.cursor()
def create_table(self) -> None:
self.cur.execute('''CREATE TABLE IF NOT EXISTS card (
id INTEGER... | [
"import random\nimport sqlite3\n\n\nclass DataBase:\n def __init__(self):\n self.ids = 0\n self.conn = sqlite3.connect('card.s3db')\n self.cur = self.conn.cursor()\n\n def create_table(self) -> None:\n self.cur.execute('''CREATE TABLE IF NOT EXISTS card (\n ... | false |
10,167 | e57eb8cbf84b2f54c47c5fda7f86ce41383bccd9 | from time import sleep
from .automodule import AutoModule
from .siad import Siad, Result
class AutoUnlock(AutoModule):
def __init__(self, configuration_dictionary: dict, siad: Siad):
self.password = configuration_dictionary.get("wallet-password", None)
self.siad = siad
if self.password is ... | [
"from time import sleep\nfrom .automodule import AutoModule\nfrom .siad import Siad, Result\n\nclass AutoUnlock(AutoModule):\n def __init__(self, configuration_dictionary: dict, siad: Siad):\n self.password = configuration_dictionary.get(\"wallet-password\", None)\n self.siad = siad\n\n if s... | false |
10,168 | fc86adc251a10c55c6e20c3e9e355fcfac8427c5 | def chang_first_value(list_to_change):
"""Changes a list inside the function"""
list_to_change[0]='something different'
some_nums=[2,6,4,2,22,54,12,8,-1]
print(some_nums)
chang_first_value(some_nums)
print(some_nums) | [
"def chang_first_value(list_to_change):\n \"\"\"Changes a list inside the function\"\"\"\n list_to_change[0]='something different'\n\nsome_nums=[2,6,4,2,22,54,12,8,-1]\n\nprint(some_nums)\nchang_first_value(some_nums)\nprint(some_nums)",
"def chang_first_value(list_to_change):\n \"\"\"Changes a list insi... | false |
10,169 | 8c2286d0911f5970eccd29122030f9f285c0cab3 | from django.test import TestCase
from django.test import Client
# Create your tests here.
class NoteTest(TestCase):
def test_get_note(self):
c = Client()
response = c.get('/edit/40/6/1/')
self.assertEqual(response.status_code, 200)
def test_save_note(self):
c = Client()
... | [
"from django.test import TestCase\nfrom django.test import Client\n\n# Create your tests here.\nclass NoteTest(TestCase):\n def test_get_note(self):\n c = Client()\n response = c.get('/edit/40/6/1/')\n self.assertEqual(response.status_code, 200)\n\n def test_save_note(self):\n c = ... | false |
10,170 | a58062de2c7ce4e6ea7bb2e2156aae1c607fe6c3 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
"# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n#\n# Code generated by Microsoft (R) AutoRest Code Generator.... | false |
10,171 | e7d6f6c6090d5dfa8a08b2349182403f61f92e9a | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class CdbTdsqlExpandInstanceRequest(Request):
def __init__(self):
super(CdbTdsqlExpandInstanceRequest, self).__init__(
'tdsql', 'qcloudcliV1', 'CdbTdsqlExpandInstance', 'tdsql.api.qcloud.com')
def get_cdbInstanceUuid(self)... | [
"# -*- coding: utf-8 -*-\n\nfrom qcloudsdkcore.request import Request\n\nclass CdbTdsqlExpandInstanceRequest(Request):\n\n def __init__(self):\n super(CdbTdsqlExpandInstanceRequest, self).__init__(\n 'tdsql', 'qcloudcliV1', 'CdbTdsqlExpandInstance', 'tdsql.api.qcloud.com')\n\n def get_cdbIns... | false |
10,172 | e2a8293b9d136ed9f85c25562c1d78fd9705f29c | import json
import numpy as np
import pandas as pd
from sklearn import tree
from sklearn.neighbors import KNeighborsClassifier
# In[2]:
#reading json
with open("./train.json") as f:
data = json.load(f)
df = pd.io.json.json_normalize(data)
df.columns = df.columns.map(lambda x: x.split(".")[-1])
df = df.values
in... | [
"import json\nimport numpy as np\nimport pandas as pd\nfrom sklearn import tree\nfrom sklearn.neighbors import KNeighborsClassifier\n\n\n# In[2]:\n\n\n#reading json\nwith open(\"./train.json\") as f:\n data = json.load(f)\ndf = pd.io.json.json_normalize(data)\ndf.columns = df.columns.map(lambda x: x.split(\".\")... | false |
10,173 | 3e66d928167468e45ae6c6962af56cbc8326a339 | import requests
import time
from config import URL
from config import LOCATION
from bs4 import BeautifulSoup
raw_html = requests.get(URL).text
data = BeautifulSoup(raw_html, 'html.parser')
tl = (data.select('h2')[1])
tl = (tl.encode_contents())
tl = tl.rstrip(' <span id="displayDate"></span>')
if (data.select('td')[... | [
"import requests\nimport time\nfrom config import URL\nfrom config import LOCATION\nfrom bs4 import BeautifulSoup\n\nraw_html = requests.get(URL).text\ndata = BeautifulSoup(raw_html, 'html.parser')\n\ntl = (data.select('h2')[1])\ntl = (tl.encode_contents())\ntl = tl.rstrip(' <span id=\"displayDate\"></span>')\n\nif... | false |
10,174 | c32ddc2de616c74e1108251f8266f0c5d526b249 | import module_fibonacci
module_fibonacci.fib(7) | [
"import module_fibonacci\r\nmodule_fibonacci.fib(7)",
"import module_fibonacci\nmodule_fibonacci.fib(7)\n",
"<import token>\nmodule_fibonacci.fib(7)\n",
"<import token>\n<code token>\n"
] | false |
10,175 | d9ff288d468ff914c4b8e1467f191a61562857f0 | from ginn.core import *
from ginn import utils
from ginn import models
| [
"from ginn.core import *\nfrom ginn import utils\nfrom ginn import models\n\n",
"from ginn.core import *\nfrom ginn import utils\nfrom ginn import models\n",
"<import token>\n"
] | false |
10,176 | 947f82ace44df37ef71984b76b8ab86d5da43fa0 | import PySimpleGUI as sg
import tkinter as tk
#### 00 get input files from user
sg.change_look_and_feel('Topanga') ### my GUI colourful setting
layout1 = [
[sg.Text('Number of input files: '), sg.Input()],
[sg.OK(), sg.Cancel()]
]
######Display first window to ask how many input files
window = sg.Window('Pro... | [
"import PySimpleGUI as sg\nimport tkinter as tk\n\n#### 00 get input files from user\nsg.change_look_and_feel('Topanga') ### my GUI colourful setting\n\nlayout1 = [\n [sg.Text('Number of input files: '), sg.Input()],\n [sg.OK(), sg.Cancel()]\n]\n######Display first window to ask how many input files\nwindow ... | false |
10,177 | 4c47361a8d08f89954100c486b39b4da3cddfbfc | from misc import *
start = time.time()
def gcdpower(a,b):
while(a != b and b != 0 and a!=0):
if(a >= 2*b):
a %= 2*b
if(a > b):
a,b = b,a
if(2*a >= b):
a,b = a,2*a-b
a,b = max(a,b),min(a,b)
return min(a,b)
n = 2000
matrix = [[10,1],[1,0]]
mod... | [
"from misc import *\n\nstart = time.time()\n\ndef gcdpower(a,b):\n while(a != b and b != 0 and a!=0):\n if(a >= 2*b):\n a %= 2*b\n if(a > b):\n a,b = b,a\n if(2*a >= b):\n a,b = a,2*a-b\n a,b = max(a,b),min(a,b)\n return min(a,b)\n\nn = 2000\nmatrix... | true |
10,178 | b6b2545ebf075eda66b4e453addac6491a20eba0 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SECRET_KEY = 'thisisdfjdshkddfjchanged'
CSRF_SESSION_KEY = 'ad190242b1dd440584ab5324688526dshb'
| [
"import os\nbasedir = os.path.abspath(os.path.dirname(__file__))\n\nDEBUG = False\nTESTING = False\nCSRF_ENABLED = True\nSQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']\nSECRET_KEY = 'thisisdfjdshkddfjchanged'\nCSRF_SESSION_KEY = 'ad190242b1dd440584ab5324688526dshb'\n",
"import os\nbasedir = os.path.abspath(... | false |
10,179 | ed1c5e019342cd783c2ba7709b9c337018b69242 | from models.gate import Gate
class Light(Gate):
def place_gate(self):
z = self.coord[0]
x = self.coord[1]
self.editor.set_block(x+0, 50, z+0, "gray_wool")
self.editor.set_block(x+1, 50, z+0, "gray_wool")
self.editor.set_block(x+2, 50, z+0, "gray_wool")
self.editor.s... | [
"from models.gate import Gate\n\nclass Light(Gate):\n\n def place_gate(self):\n z = self.coord[0]\n x = self.coord[1]\n self.editor.set_block(x+0, 50, z+0, \"gray_wool\")\n self.editor.set_block(x+1, 50, z+0, \"gray_wool\")\n self.editor.set_block(x+2, 50, z+0, \"gray_wool\")\n... | false |
10,180 | f6cf82b43aef951d7e44919d0833e6f36de2cdf9 |
# def calc(*numbers):
# sum=0
# for n in numbers:
# sum = sum + n*n
# return sum
# print(calc(1,2))
# from conf import conf
# # conf={'s':1}
# def sum(a,b):
# s=a+b
# return s
# if __name__=='__main__':
# print(sum(1,2))
# # print(conf['s'])
# def person(name,age,**... | [
"\n# def calc(*numbers):\n# sum=0\n# for n in numbers:\n# sum = sum + n*n\n# return sum\n# print(calc(1,2)) \n\n# from conf import conf\n\n# # conf={'s':1}\n# def sum(a,b):\n# s=a+b\n# return s\n \n# if __name__=='__main__':\n# print(sum(1,2))\n# # print(conf['s'])\n \n... | false |
10,181 | 5ef6253279c1788d925e7a5dc59c22edb6e18b5f | #Salary Prediction based on number of years of experience
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# import the dataset
dataset = pd.read_csv('Salary-Data.csv')
x = dataset.iloc[:, :-1].... | [
"#Salary Prediction based on number of years of experience\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# import the dataset\ndataset = pd.read_csv('Salary-Data.csv')\nx = dataset... | false |
10,182 | e38a779ff0f67f76039dd5050614675f4adaf99d | #!/usr/bin/env python
# coding: utf-8
# # Langchain Quickstart
#
# In this quickstart you will create a simple LLM Chain and learn how to log it and get feedback on an LLM response.
#
# [](https://colab.research.google.com/github/truera/trulens/... | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Langchain Quickstart\n#\n# In this quickstart you will create a simple LLM Chain and learn how to log it and get feedback on an LLM response.\n#\n# [](https://colab.research.google.com/github/tru... | false |
10,183 | f4c518e62f0d6797ccef75ce11f2c68082bfd603 | import os
import sys
from flask import Flask
# This is just here for the sake of examples testing
# to make sure that the imports work
# (you don't actually need it in your code)
sys.path.insert(1, ".")
from flask_discord_interactions import (DiscordInteractions, # noqa: E402
... | [
"import os\nimport sys\n\nfrom flask import Flask\n\n# This is just here for the sake of examples testing\n# to make sure that the imports work\n# (you don't actually need it in your code)\nsys.path.insert(1, \".\")\n\nfrom flask_discord_interactions import (DiscordInteractions, # noqa: E402\n ... | false |
10,184 | 02385fbaeaa49c0f51622334d9d1eda8d5c56db1 | nomeVendedor = input()
salario = float(input())
vendas = float(input())
total = salario + vendas * 0.15
print("TOTAL = R$ " + "{:.2f}".format(total)) | [
"nomeVendedor = input()\nsalario = float(input())\nvendas = float(input())\n\ntotal = salario + vendas * 0.15\nprint(\"TOTAL = R$ \" + \"{:.2f}\".format(total))",
"nomeVendedor = input()\nsalario = float(input())\nvendas = float(input())\ntotal = salario + vendas * 0.15\nprint('TOTAL = R$ ' + '{:.2f}'.format(tota... | false |
10,185 | fef91fa7ff4f007c889d4a838a67137c06aa7690 | """
This code was implemented by Vojtech Kubac as a part of his Master Thesis that will be defended
on February 2020. At the Faculty of Mathematics and Physics of Charles University in Prague.
"""
"""
This code solves FSI2 and FSI3 Bencmarks from
"S. Turek and J. Hron, โProposal for numerical benchmarking of fluid... | [
"\"\"\"\nThis code was implemented by Vojtech Kubac as a part of his Master Thesis that will be defended\non February 2020. At the Faculty of Mathematics and Physics of Charles University in Prague.\n\"\"\"\n\n\"\"\"\nThis code solves FSI2 and FSI3 Bencmarks from\n \"S. Turek and J. Hron, โProposal for numerical... | false |
10,186 | 3016046c947b119acdea2272d4aba7c8be79e9dc | # -*- coding:utf-8 -*-
import sys
from . import resnet, inception_v3, dense_net
from .error import ModelError
from lib import storage
_recognizer_cache = {}
_rec_config = {
'AJ#insole': { # ้ๅซ
'model_type': 'resnet',
'model_config': {
'num_epochs': 25,
'fixed_param': Fal... | [
"# -*- coding:utf-8 -*-\n\nimport sys\n\nfrom . import resnet, inception_v3, dense_net\nfrom .error import ModelError\nfrom lib import storage\n\n_recognizer_cache = {}\n\n_rec_config = {\n 'AJ#insole': { # ้ๅซ\n 'model_type': 'resnet',\n 'model_config': {\n 'num_epochs': 25,\n ... | false |
10,187 | 276b62d567fd7e03cbbe2a18554232f62d0aaed8 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
from django.template.loader import get_template
from django.core.mail import EmailMessage
from django.shortcuts import redirect
from django.contrib import messages
# Create your views here.
def portfolio(reques... | [
"from django.shortcuts import render\nfrom django.http import HttpResponse\nfrom django.template import loader\nfrom django.template.loader import get_template\nfrom django.core.mail import EmailMessage\nfrom django.shortcuts import redirect\nfrom django.contrib import messages\n\n\n# Create your views here.\ndef p... | false |
10,188 | 161e1d78da717ba10b76a695f9a37d5058397079 | #๋์ผํ ๋ฌผ๊ฑด์ A๋งค์ฅ์์๋ 20%, B๋งค์ฅ์์๋ 10% ํ ์ธ ํ 11% ํ ์ธ(์ค๋ณตํ ์ธ)ํ๋ค. ๋ฌผ๊ฑด์ด 10,000์์ผ ๋ ์ด๋ ์ผํ๋ชฐ์์ ์ธ๊ฒ ์ด ์ ์์๊น?
item_price = int(input("๋ฌผํ์ ๊ฐ๊ฒฉ : "))
#๋ง์ผ A์์์ ํ ์ธ์จ๊ณผ ๋ฌผํ ๊ฐ๊ฒฉ
sale_percent_M_A = float(input("A ๋ง์ผ ํ ์ธ์จ : ")) /100
market_a = item_price*(1-sale_percent_M_A)
print("A ๋งค์ฅ์์์ ํ ์ธ๋ ๋ฌผํ ๊ฐ๊ฒฉ์", market_a, "์ ์ด๋ค")
#๋ง์ผ B์์์ ํ ์ธ์จ๊ณผ ๋ฌผํ ๊ฐ๊ฒฉ
sale_pe... | [
"#๋์ผํ ๋ฌผ๊ฑด์ A๋งค์ฅ์์๋ 20%, B๋งค์ฅ์์๋ 10% ํ ์ธ ํ 11% ํ ์ธ(์ค๋ณตํ ์ธ)ํ๋ค. ๋ฌผ๊ฑด์ด 10,000์์ผ ๋ ์ด๋ ์ผํ๋ชฐ์์ ์ธ๊ฒ ์ด ์ ์์๊น?\n\nitem_price = int(input(\"๋ฌผํ์ ๊ฐ๊ฒฉ : \"))\n\n#๋ง์ผ A์์์ ํ ์ธ์จ๊ณผ ๋ฌผํ ๊ฐ๊ฒฉ\nsale_percent_M_A = float(input(\"A ๋ง์ผ ํ ์ธ์จ : \")) /100\nmarket_a = item_price*(1-sale_percent_M_A)\n\nprint(\"A ๋งค์ฅ์์์ ํ ์ธ๋ ๋ฌผํ ๊ฐ๊ฒฉ์\", market_a, \"์ ์ด๋ค\")\n\n\n#๋ง์ผ... | false |
10,189 | 4e5277c1808f61695559a3e0042dff509c9bd569 | MEDIA_ROOT_URL = '/'
MEDIA_ROOT = '/var/www/django/Coffee-in-the-Cloud/server/'
| [
"MEDIA_ROOT_URL = '/'\nMEDIA_ROOT = '/var/www/django/Coffee-in-the-Cloud/server/'\n",
"<assignment token>\n"
] | false |
10,190 | 8f76a676839c3e42b51728756098115abe7bcf56 | # Generated by Django 2.0.3 on 2018-05-15 15:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('feedbap', '0006_product'),
]
operations = [
migrations.CreateModel(
name='Order',
f... | [
"# Generated by Django 2.0.3 on 2018-05-15 15:21\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('feedbap', '0006_product'),\n ]\n\n operations = [\n migrations.CreateModel(\n name='Or... | false |
10,191 | f2162b7a1cd9c62ec0c2ab3456716d603ed6ecac | import logging
import sys
import optuna
from sklearn import datasets
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import train_test_split
def objective(trial):
iris = datasets.load_iris()
classes = list(set(iris.target))
train_x, valid_x, train_y, valid_y = train_test_split... | [
"import logging\nimport sys\n\nimport optuna\nfrom sklearn import datasets\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.model_selection import train_test_split\n\n\ndef objective(trial):\n iris = datasets.load_iris()\n classes = list(set(iris.target))\n train_x, valid_x, train_y, valid_y =... | false |
10,192 | 4f8fd40fd2cc91265881b0f4ba83ee5db076c1c6 | import uuid
from functools import wraps
from flask import request
from flask import Response
from flask_restful import Resource
def generate_members(element_name, url, total_num):
members = []
i = 0
while i < total_num:
dic = dict()
dic["@odata.id"] = url + element_name + str(i + 1)
... | [
"import uuid\n\nfrom functools import wraps\n\nfrom flask import request\nfrom flask import Response\nfrom flask_restful import Resource\n\n\ndef generate_members(element_name, url, total_num):\n members = []\n i = 0\n while i < total_num:\n dic = dict()\n dic[\"@odata.id\"] = url + element_n... | false |
10,193 | 6dde96565f9d7ab34a32fbc93b157301280cf4d7 | from ROOT import TH1F, TH2F
import math
class Particle(object):
def __init__(self, pdg_code, momentum, status):
self.pdg = pdg_code
self.momentum = momentum
self.status = status
self.mass = 0
if abs(self.pdg) == 11:
self.mass = 0.5109989461 / 10... | [
"from ROOT import TH1F, TH2F\r\n\r\nimport math\r\n\r\n\r\nclass Particle(object):\r\n\r\n def __init__(self, pdg_code, momentum, status):\r\n self.pdg = pdg_code\r\n self.momentum = momentum\r\n self.status = status\r\n self.mass = 0\r\n\r\n if abs(self.pdg) == 11:\r\n ... | true |
10,194 | dfe461bb6043067be580b06aee510a88c74d9b59 | from typing import Dict, Optional
from hidet.ir.expr import Var
from hidet.ir.type import ScalarType
_primitive_variables: Dict[str, Var] = {}
def attach_pool(var):
if '_primitive_variables' not in var.__dict__:
var.__dict__['_primitive_variables'] = _primitive_variables
return var
def thread_idx(... | [
"from typing import Dict, Optional\n\nfrom hidet.ir.expr import Var\nfrom hidet.ir.type import ScalarType\n\n_primitive_variables: Dict[str, Var] = {}\n\n\ndef attach_pool(var):\n if '_primitive_variables' not in var.__dict__:\n var.__dict__['_primitive_variables'] = _primitive_variables\n return var\n... | false |
10,195 | 69b0cc21404fefeb812e2bc636d4076cd15b4cb2 | import time
from django_rq.decorators import job
import django_rq
import rq
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@job
def printsomething(the_thing):
time.sleep(2)
print("Look at me I'm printing something!...{}".format(the_thing))
1 / 0
... | [
"import time\nfrom django_rq.decorators import job\nimport django_rq\nimport rq\n\nimport logging\nlogging.basicConfig()\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n\n@job\ndef printsomething(the_thing):\n time.sleep(2)\n print(\"Look at me I'm printing something!...{}\".format(th... | false |
10,196 | d9827d47f018afe2c6d35da2ca35b3b2f4b3de81 | """The class Movie is defined and it contains the details of a movie"""
import webbrowser
class Movie():
"""This class is for stores movie related information with
its attributes.
title: string to store title of a movie.
storyline: string to store storyline of movie.
poster_image_url: string to s... | [
"\"\"\"The class Movie is defined and it contains the details of a movie\"\"\"\nimport webbrowser\n\n\nclass Movie():\n \"\"\"This class is for stores movie related information with\n its attributes.\n\n title: string to store title of a movie.\n storyline: string to store storyline of movie.\n poste... | false |
10,197 | 489eb996af35fcfb70558fb3b95f6543551c4300 | # pylint: disable=C0103
# pylint: disable=C0301
# pylint: disable=C0321
'''๊ธฐ๋ณธ๊ตฌ์กฐ
for ๋ณ์ in ๋ฆฌ์คํธ(๋๋ ํํ, ๋ฌธ์์ด):
<์ํํ ๋ฌธ์ฅ1>
<์ํํ ๋ฌธ์ฅ2>
<์ํํ ๋ฌธ์ฅ3>
๋ฆฌ์คํธ๋ ํํ, ๋ฌธ์์ด์ ์ฒซ ๋ฒ์งธ ์์๋ถํฐ ๋ง์ง๋ง ์์๊น์ง ์ฐจ๋ก๋ก ๋ณ์์ ๋์
๋์ด <์ํํ ๋ฌธ์ฅ1> <์ํํ ๋ฌธ์ฅ2> ๋ฑ์ด ์ํ๋๋ค
'''
# ์ ํ์ ์ธ For๋ฌธ
test_list = ['one', 'two', 'three']
for i in test_list:
print(i) #๋ณ์(i)์ ๋ฆฌ... | [
"# pylint: disable=C0103\n# pylint: disable=C0301\n# pylint: disable=C0321\n\n'''๊ธฐ๋ณธ๊ตฌ์กฐ\nfor ๋ณ์ in ๋ฆฌ์คํธ(๋๋ ํํ, ๋ฌธ์์ด):\n <์ํํ ๋ฌธ์ฅ1>\n <์ํํ ๋ฌธ์ฅ2>\n <์ํํ ๋ฌธ์ฅ3>\n\n๋ฆฌ์คํธ๋ ํํ, ๋ฌธ์์ด์ ์ฒซ ๋ฒ์งธ ์์๋ถํฐ ๋ง์ง๋ง ์์๊น์ง ์ฐจ๋ก๋ก ๋ณ์์ ๋์
๋์ด <์ํํ ๋ฌธ์ฅ1> <์ํํ ๋ฌธ์ฅ2> ๋ฑ์ด ์ํ๋๋ค\n'''\n\n# ์ ํ์ ์ธ For๋ฌธ\ntest_list = ['one', 'two', 'three']\nfor i in test_list:\n ... | false |
10,198 | b6dc82ad3b278b49dd28ba9b5de8df31ddfd2562 | import sys
import glob
# sys.path.append('generated')
# sys.path.insert(0, glob.glob('../../lib/py/build/lib*')[0])
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.protocol import TMultiplexedProtocol
from ... | [
"import sys\nimport glob\n\n# sys.path.append('generated')\n# sys.path.insert(0, glob.glob('../../lib/py/build/lib*')[0])\n\nfrom thrift import Thrift\nfrom thrift.transport import TSocket\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol\nfrom thrift.protocol import TMultiplexed... | false |
10,199 | abee5d28776cf5fad4daf2b700f68cda3dfd21f3 | import datetime
import io
import os
import sys
import uuid
from urllib.parse import unquote_plus
from PIL import Image
from . import storage
client = storage.storage.get_instance()
# Disk-based solution
#def resize_image(image_path, resized_path, w, h):
# with Image.open(image_path) as image:
# image.thumbn... | [
"import datetime\nimport io\nimport os\nimport sys\nimport uuid\nfrom urllib.parse import unquote_plus\nfrom PIL import Image\n\nfrom . import storage\nclient = storage.storage.get_instance()\n\n# Disk-based solution\n#def resize_image(image_path, resized_path, w, h):\n# with Image.open(image_path) as image:\n# ... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.