seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
214141194
from django.conf.urls import url from .views import (ProductListView,volunteer,home,contact,projects,Knitting, SupplierFormView, ContactSupplier,training,trainingdetail) urlpatterns = [ url(r'^$',home, name='home'), url(r'^market/$',ProductListView.as_view(), name='market'), url(r'^volunteer/$',volunt...
null
home/urls.py
urls.py
py
770
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "views.home", "line_number": 9, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.ProductL...
444297017
#Librerias importadas para este programa import pygame import math #Dimensiones de la pantalla ANCHO = 600 ALTO = 600 #Colores en RGB BLANCO = (255,255,255) NEGRO = (0,0,0) ROJO = (255,0,0) VERDE = (59,179,34) AZUL = (0,191,255) ROSA = (255,20,147) MAGENTA = (139,0,139) LIMON = (255,250,205) NARANJA = (255,128,0) ...
null
CodigoEspirografo.py
CodigoEspirografo.py
py
3,533
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pygame.time.C...
383840291
import pytest from PyQt5.QtWidgets import QMainWindow import mfixgui.graphic_tabs @pytest.fixture def mfix_gui(qtbot, mocker): """ define MfixGui fixture """ qmain = QMainWindow() mfixgui_fixture = mfixgui.gui.MfixGui(qmain) mocker.patch.object(mfixgui_fixture, 'confirm_close', return_value=True) ...
null
mfix-18.1.5/mfixgui/tests/test_graphic_tabs.py
test_graphic_tabs.py
py
2,299
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "mfixgui.graphic_tabs.gui.MfixGui", "line_number": 11, "usage_type": "call" }, { "api_name": "mfixgui.graphic_tabs.gui", "line_number": 11, "usage_type": "attribute" },...
54890788
import uiautomator2 as u2 import time import os import logging from redis import Redis redis_cli = Redis() logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('Soul Monitor') class Greet: def __init__(self): """ 初始化鏈...
null
auto_mobile/soul_robot/greet.py
greet.py
py
2,719
python
en
code
null
code-starcoder2
76
[ { "api_name": "redis.Redis", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", ...
194975027
import matplotlib.pyplot as plt import numpy as np import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data import time import math import sys sample_num = 10000 origin_x = np.linspace(0, 1, sample_num) origin_y = (np.sin...
null
hw1/codes/observe_gradient_norm_during_training/train.py
train.py
py
2,519
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", "line_...
651874122
import logging import copy import time import pathos import numpy as np from beluga.utils.logging import logger, make_a_splash from beluga.data_classes.trajectory import Trajectory from beluga.utils import save from beluga.data_classes.problem_components import getattr_from_list from beluga.transforms.problem_function...
null
beluga/beluga.py
beluga.py
py
4,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "beluga.utils.logging.logger.level", "line_number": 23, "usage_type": "attribute" }, { "api_name": "beluga.utils.logging.logger", "line_number": 23, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 23, "usage_type": "attribute" }, { ...
336389022
from typing import Tuple, Optional, Callable import logging as log import threading import time from abc import ABC from controllerdata import ControllerData, VariableAccess from networkmanager import NetworkManager from controllererror import ControllerError class Controller(ABC): """ Controller is an abstract b...
null
src/controller.py
controller.py
py
6,350
python
en
code
null
code-starcoder2
76
[ { "api_name": "abc.ABC", "line_number": 11, "usage_type": "name" }, { "api_name": "networkmanager.NetworkManager", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 21, "usage_type": "call" }, { "api_name": "threading.Thread",...
561908725
# coding: utf-8 """ Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
null
isi_sdk/models/fsa_settings_settings.py
fsa_settings_settings.py
py
8,316
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.iteritems", "line_number": 235, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 259, "usage_type": "call" } ]
79539342
from exchangelib import DELEGATE, IMPERSONATION, Account, Credentials, ServiceAccount, \ EWSDateTime, EWSTimeZone, Configuration, NTLM, CalendarItem, Message, \ Mailbox, Attendee, Q, ExtendedProperty, FileAttachment, ItemAttachment, \ HTMLBody, Build, Version def send_msg(sub,bdy): credentials = Credentials(...
null
send_mail.py
send_mail.py
py
1,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "exchangelib.Credentials", "line_number": 7, "usage_type": "call" }, { "api_name": "exchangelib.Configuration", "line_number": 12, "usage_type": "call" }, { "api_name": "exchangelib.Account", "line_number": 14, "usage_type": "call" }, { "api_name": "...
184147847
import pytest import tensorflow as tf import numpy as np from tfs.models import LeNet from tfs.dataset.predefined import Mnist import tfs.g @pytest.fixture def data(): mnist=Mnist().to_one_hot() return mnist @pytest.fixture def net(): n = LeNet() n.build() return n class TestOptimizer: def test_fit(self...
null
tests/core/optimizer/optimizer_test.py
optimizer_test.py
py
512
python
en
code
null
code-starcoder2
76
[ { "api_name": "tfs.dataset.predefined.Mnist", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tfs.models.LeNet", "line_number": 16, "usage_type": "call" }, { "api_name": "pyte...
469015746
from flask.views import MethodView from flask import request, jsonify from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from Services.ItemService import ItemService from init import InitApp class Item(MethodView): def __init__(self): self.engine = create_engine(InitApp.db_uri...
null
Views/Item.py
Item.py
py
1,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.views.MethodView", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "init.InitApp.db_uri", "line_number": 14, "usage_type": "call" }, { "api_name": "i...
515842614
import json import requests import numpy as np from PIL import Image from io import BytesIO import onnxruntime as rt from torchvision import transforms # azureml imports from azureml.core.model import Model def init(): global session, transform, classes, input_name try: model_path = Model.get_model_p...
null
score.py
score.py
py
1,500
python
en
code
null
code-starcoder2
76
[ { "api_name": "azureml.core.model.Model.get_model_path", "line_number": 16, "usage_type": "call" }, { "api_name": "azureml.core.model.Model", "line_number": 16, "usage_type": "name" }, { "api_name": "onnxruntime.InferenceSession", "line_number": 21, "usage_type": "call" ...
144896703
#coding=utf-8 #!/usr/bin/python import os import sys import json import time import urllib2 import re import copy from bs4 import BeautifulSoup from selenium import webdriver from datetime import datetime from sc_utils import ScrapperUtils as SC class BuzzfeedScrapperUrllib: reaction_names_temp...
null
facebook_fanpage_posts/buzzfeed/buzzfeed_scrapper_urllib.py
buzzfeed_scrapper_urllib.py
py
3,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "sc_utils.ScrapperUtils.get_tag", "line_number": 60, "usage_type": "call" }, { "api_name": "sc_utils.ScrapperUtils", "line_number": 60, "usage_type": "name" }, { "api_name": "sc_utils.ScrapperUtils.get_tag", "line_number": 61, "usage_type": "call" }, { ...
160467659
import glob import time import requests from lxml import etree import hashlib def get_webloc_file_list(): webloc_file_list = glob.glob('people_all/*.webloc') return webloc_file_list def get_webloc_str(path): with open(path, 'r') as file: row_list = file.readlines() webloc_str = ''.join(row_list) return webloc...
null
news/get_people_news.py
get_people_news.py
py
3,007
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 8, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 18, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 18, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 39...
573045215
import sys import boto3 class colors: """ Python program to print colored text and background Colors class:reset all colors with colors.reset; two sub classes fg for foreground and bg for background; use as colors.subclass.colorname. i.e. colors.fg.red or colors.bg.greenalso, the ge...
null
ec2-control.py
ec2-control.py
py
2,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.client", "line_number": 57, "usage_type": "call" } ]
9878968
import cv2 import numpy as np img=cv2.imread('Image.JPG',0) rows,cols=img.shape M = cv2.getRotationMatrix2D((cols/2,rows/2),45,1) #задаем поворот изображение(последний параметр zoom) dst = cv2.warpAffine(img,M,(cols,rows)) # производим преобразование cv2.imshow('origin',img) cv2.imshow('Affine transfor...
null
OPENCV/Обработка изображения/Аффинные преобразования/Script-Rotation.py
Script-Rotation.py
py
440
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imshow", "line...
16182261
""" SlipStream Client ===== Copyright (C) 2013 SixSq Sarl (sixsq.com) ===== Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required ...
null
client/src/main/python/slipstream/cloudconnectors/cloudstack/CloudStackAdvancedZoneClientCloud.py
CloudStackAdvancedZoneClientCloud.py
py
4,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "slipstream.cloudconnectors.cloudstack.CloudStackClientCloud.CloudStackClientCloud", "line_number": 35, "usage_type": "name" }, { "api_name": "libcloud.security.security", "line_number": 40, "usage_type": "attribute" }, { "api_name": "libcloud.security", "line_n...
326828086
# Copyright (c) 2017, 2018 Jae-jun Kang # See the file LICENSE for details. from datetime import timedelta from x2py.builtin_events import TimeoutEvent from x2py.config import Config from x2py.flow import Flow from x2py.flows.time_flow import TimeFlow from x2py.util.trace import Trace from x2py.yields.wait_handle_poo...
null
x2py/yields/wait_for_event.py
wait_for_event.py
py
1,995
python
en
code
null
code-starcoder2
76
[ { "api_name": "x2py.config.Config.Coroutine", "line_number": 14, "usage_type": "attribute" }, { "api_name": "x2py.config.Config", "line_number": 14, "usage_type": "name" }, { "api_name": "x2py.flow.Flow.bind", "line_number": 16, "usage_type": "call" }, { "api_name...
17126784
from django.shortcuts import render , HttpResponse , redirect import csv from .models import Movie , Year , Rating , Genres , FeedBack , Series , Language import random import requests from bs4 import BeautifulSoup from datetime import date # Create your views here. def index(request): m = Rating.objects.get(rati...
null
Movies/movi/views.py
views.py
py
21,257
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Rating.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Rating.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Rating", "line_number": 12, "usage_type": "name" }, { "api_name": "ra...
644839516
from __future__ import print_function from lxml import etree from pprint import pprint import requests from utils.xml import xml_dict_get from soap.response import parse_response class ActionArgument(object): def __init__(self, data): self.name = data['name'] self.direction = data['direction'] ...
null
simpleupnp/upnp/action.py
action.py
py
5,638
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.xml.xml_dict_get", "line_number": 37, "usage_type": "call" }, { "api_name": "lxml.etree.Element", "line_number": 92, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 92, "usage_type": "name" }, { "api_name": "lxml.etree.Eleme...
16647111
import contextlib import os from pathlib import Path import re import warnings from .calendar import ( load_calendar_file, load_business_calendar, CalendarDir, format_calendar, dump_calendar_file, get_calendar_dir, set_calendar_dir, get_calendar, ) from .ext import * from .weekday import * from ...
null
python/ora/__init__.py
__init__.py
py
5,808
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 118, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 120, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 120, "usage_type": "attribute" }, { "api_name": "warnings.warn", "l...
418019038
# Team "camelCase" # Matthew Chan & Jionghao Wu # SoftDev1 pd2 # K#18: Average # 2019-10-12 import sqlite3 #enable control of an sqlite database import csv #facilitate CSV I/O import math #facilitate averaging of grades DB_FILE="../17_csv2db/discobandit.db" db = sqlite3.connect(DB_FILE) #open if file e...
null
fall/18_db-nmcrnch/stu_mean.py
stu_mean.py
py
2,884
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "math.fsum", "line_number": 63, "usage_type": "call" } ]
646959129
# -*- coding: utf-8 -*- import scrapy import re from bs4 import BeautifulSoup class StocksSpider(scrapy.Spider): name = 'stocks' start_urls = ['http://quote.eastmoney.com/stocklist.html'] # 爬取股票代码 def parse(self, response): soup = BeautifulSoup(response.text, 'html.parser') a = soup.fi...
null
scrapy框架的使用/BaiduStocks/BaiduStocks/spiders/stocks.py
stocks.py
py
1,304
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 17, "usage_type": "call" }, { "api_name": "scrapy.Request", "...
307365363
#curses_wrapper.py import curses as crs import os from curses import wrapper def main(stdscr): crs.initscr() crs.endwin() os.system("git status") stdscr.getch() os.system("clear") # wrapper is a function that does all of the setup and teardown, and makes sure # your program cleans up properly if i...
null
curses_wrapper.py
curses_wrapper.py
py
345
python
en
code
null
code-starcoder2
76
[ { "api_name": "curses.initscr", "line_number": 7, "usage_type": "call" }, { "api_name": "curses.endwin", "line_number": 8, "usage_type": "call" }, { "api_name": "os.system", "line_number": 9, "usage_type": "call" }, { "api_name": "os.system", "line_number": 11...
479730466
import os, time import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart # 发送附件的方法 from email.header import Header def insert_img(driver,filename): # 以下这行代码获取到的路径格式E:\Python-test\unittest_project\common (realpath也可以写成dirname) function_path = os.path.dirname(os.path.re...
null
unittest_requests_project/common/function.py
function.py
py
3,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "time.strftime", "line_...
151985457
import json import string import nltk from fuzzywuzzy import fuzz from nltk.stem import * from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords import operator from collections import defaultdict import os import numpy as np import re import xlrd import xlwt impo...
null
Yao_Ge_Assignment1.py
Yao_Ge_Assignment1.py
py
7,048
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 43, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 56, "usage_type": "call" }, { "api_name": "itertools.islice", "line_number": 88, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", ...
587385986
import serial import time import json import http import urllib.request import time import contract_abi import contracBuggy_abi import codecs from web3 import Web3, HTTPProvider print("Hello Word! I am here to serve") contract_address = "0xfa541D50E3B434cb2BA7BD6CDb330a94bA0e67c1" keyMapping = {"Card UID: A9 27 D3 2A...
null
arduino.py
arduino.py
py
2,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "web3.Web3", "line_number": 20, "usage_type": "call" }, { "api_name": "web3.HTTPProvider", "line_number": 20, "usage_type": "call" }, { "api_name": "contracBuggy_abi.abi", "line_number": 23, "usage_type": "attribute" }, { "api_name": "serial.Serial",...
289059350
""" Use output of detection to divide an image into cells using a voronoi diagram Written by Stefano Gatti """ # General imports import os import sys import itertools import numpy as np import pickle as pk import matplotlib.pyplot as plt from scipy import ndimage from scipy.spatial import Voronoi, voronoi_plot_2d # ...
null
cell/CellVoronoiDiagram.py
CellVoronoiDiagram.py
py
3,440
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 45, "usage_type": "call" }, { "api_name": "scipy.ndimage.measurements....
147502332
#Discord bot for running ComplexCipher. import discord from discord.ext import commands import complexcipher2 import logging import time import os import random import requests logging.basicConfig(format = '%(levelname)s:%(name)s:(%(asctime)s): %(message)s', datefmt = '%d-%b-%y %H:%M:%S', ...
null
cipherinterpreterbot.py
cipherinterpreterbot.py
py
17,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 18, "usage_type": "call" }, { "api_name": "discor...
125127750
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' https://docs.python.org/2/library/argparse.html#module-argparse http://stackoverflow.com/questions/7605631/passing-a-list-to-python-from-command-line ''' import sys, getopt, os import argparse import subprocess # just to call an arbitrary command e.g. 'ls' GITHUB_ROO...
null
autopush.py
autopush.py
py
1,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.expanduser", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 21, "usage_type": "call" }, { "api_name": "os.chdir", "line_number...
584507693
import numpy as np from sklearn import linear_model from sklearn.preprocessing import PolynomialFeatures from PyQt5.QtCore import pyqtSignal, QObject class Calculator(QObject): # signal of predict price for UI prediction_ok = pyqtSignal(float, float) log = pyqtSignal(str) def __init__(self, plot_m...
null
Steam_Analyzer_Calculator.py
Steam_Analyzer_Calculator.py
py
1,764
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 8, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQ...
107093739
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/virsh_start_stop/virsh_start_stop.py # Compiled at: 2019-02-27 06:17:38 # Size of source mod 2**32: 3283 bytes import libvirt, time, ...
null
pycfiles/virsh_start_stop-0.0.1-py3.6/virsh_start_stop.cpython-36.py
virsh_start_stop.cpython-36.py
py
2,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "libvirt.registerErrorHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "libvirt.open", "line_number": 16, "usage_type": "call" }, { "api_name": "libvirt.VIR_DOMAIN_RUNNING", "line_number": 23, "usage_type": "attribute" }, { "api_nam...
144385809
# Downloading necessary files import numpy as np import pandas as pd import yfinance as yf from matplotlib import pyplot import matplotlib.pyplot as plt from datetime import datetime import datetime as dt import plotly.graph_objects as go import plotly.graph_objs as go import plotly.express as px from plotly.subplots i...
null
karina/thesis/services/rolling_m_sd.py
rolling_m_sd.py
py
3,910
python
en
code
null
code-starcoder2
76
[ { "api_name": "plotly.graph_objs.Figure", "line_number": 23, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 23, "usage_type": "name" }, { "api_name": "plotly.graph_objs.Scatter", "line_number": 24, "usage_type": "call" }, { "api_name": "...
322938398
import re from jira import JIRA from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import configparser import os import logging from ..common_utils.common_util import project_dir_path from jira_cache import CachedIssues import threading stops = set(stopwords.words("english")) stemmer = SnowballSte...
null
app/modules/jira_scraper/jira_worker.py
jira_worker.py
py
10,480
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 12, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 12, "usage_type": "name" }, { "api_name": "nltk.stem.SnowballStemmer", "line_number": 13, "usage_type": "call" }, { "api_n...
436958312
from django.db import models from django.utils.translation import gettext_lazy as _ from .question import Question class directIndicatorManager(models.Manager): def create(self, isMandatory, key, topic, name, answertype, survey=None, description=None, instruction=None, default=None, max_number=None, min...
null
django_backend/core/models/direct_indicator.py
direct_indicator.py
py
4,424
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Manager", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "question.Question.objects.create", "line_number": 10, "usage_type": "call" }, { "api...
463481517
#-*- coding:utf-8 -*- from optparse import make_option import os from os.path import join, lexists from django.conf import settings from django.core.management.commands import startapp SKEL_DIR = join(settings.SITE_ROOT, 'app-skel') class Command(startapp.Command): option_list = startapp.Command.option_list + (...
null
project_name/apps/utils/management/commands/startapp.py
startapp.py
py
1,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.settings.SITE_ROOT", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name": ...
418328907
""" Faça uma programa que receba como entrada o ano corrente e o nome de dois arquivos: um de entrada outro de saída. Cada linha do arquivo de entrada contém o nome de uma pessoa e o seu ano de nascimento. O programa deverá ler o arquivo de entrada e gerar um arquivo de saída onde aparece o nome da pessoa seguida por u...
null
Seção 13 - Manipulando arquivos/ex015.py
ex015.py
py
1,215
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 6, "usage_type": "name" } ]
332394753
# -*- coding: utf-8 -*- from __future__ import unicode_literals from io import BytesIO from django.utils import dateformat from reportlab.lib import colors from reportlab.pdfgen import canvas from reportlab.lib.units import cm, mm from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.li...
null
src/transmittals/pdf.py
pdf.py
py
7,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "reportlab.pdfgen.canvas.Canvas", "line_number": 18, "usage_type": "attribute" }, { "api_name": "reportlab.pdfgen.canvas", "line_number": 18, "usage_type": "name" }, { "api_name": "reportlab.pdfgen.canvas.Canvas.__init__", "line_number": 26, "usage_type": "c...
234896118
""" The lxc v1, v2, v3 resource driver """ import os from datetime import datetime import resources as Res from rcUtilitiesLinux import check_ping from rcUtilities import which, justcall, lazy, makedirs from rcGlobalEnv import rcEnv import resContainer import rcExceptions as ex import rcStatus CAPABILITIES = { "c...
null
lib/resContainerLxc.py
resContainerLxc.py
py
19,570
python
en
code
null
code-starcoder2
76
[ { "api_name": "resContainer.Container", "line_number": 19, "usage_type": "attribute" }, { "api_name": "resContainer.Container.__init__", "line_number": 57, "usage_type": "call" }, { "api_name": "resContainer.Container", "line_number": 57, "usage_type": "attribute" }, ...
409720632
import logging logging.basicConfig(handlers = [logging.FileHandler('log.txt', mode = 'w', encoding = 'utf-8')], level = logging.INFO, format = '%(asctime)s - %(levelname)s - %(message)s') import sys, io, pprint sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') #改变标准输出的默认编码 import requests, bs4, r...
null
dangdang/dangdang.py
dangdang.py
py
5,553
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 2, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 2, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.stdout", ...
266222814
#!/usr/bin/env python3 from collections import defaultdict def solve(problem): prog = [l.split() for l in problem.splitlines()] state = defaultdict(int) res = 0 for r,op,x,_,c,cond,v in prog: c = state[c] x = int(x) v = int(v) t = False if cond == '>': ...
null
code/08-2-registers/solve.py
solve.py
py
1,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 56, "usage_type": "call" } ]
58784078
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contact', '0001_initial'), ] operations = [ migrations.AddField( model_name='contact', name='gender'...
null
contact/migrations/0002_contact_gender.py
0002_contact_gender.py
py
478
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
16004367
# -*- encoding: utf-8 -*- # @Version : 1.0 # @time: 2019年10月22日21:47:19 import os import sys import re import requests from bs4 import BeautifulSoup as bb import urllib import time import random import socket from multiprocessing import Pool headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1...
null
beauty_figs.py
beauty_figs.py
py
3,767
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
488662062
# set QT_API environment variable import os os.environ["QT_API"] = "pyqt5" import qtpy # qt libraries from qtpy.QtCore import * from qtpy.QtWidgets import * from qtpy.QtGui import * # app specific libraries import control.widgets as widgets import control.camera as camera import control.core as core import control.m...
null
software/control/gui.py
gui.py
py
5,795
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "control.core.ImageDisplayWindow", "line_number": 28, "usage_type": "call" }, { "api_name": "control.core", "line_number": 28, "usage_type": "name" }, { "api_name": "control.c...
218041487
import http.client from flask_restplus import Namespace, Resource from nanotwitter_pg.backend.models import TweetModel from nanotwitter_pg.backend.db import db admin_namespace = Namespace('admin', description='Admin operations') @admin_namespace.route('/tweets/<int:tweet_id>/') class TweetsDelete(Resource): @ad...
null
nanotwitter_pg/backend/admin_namespace.py
admin_namespace.py
py
767
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restplus.Namespace", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_restplus.Resource", "line_number": 10, "usage_type": "name" }, { "api_name": "nanotwitter_pg.backend.models.TweetModel.query.get", "line_number": 18, "usage_type": "ca...
353156842
from typing import Any, Callable, Optional import numpy as np from numpy import ndarray from scipy.sparse import coo_matrix from .form import Form, BasisTuple from .form_parameters import FormParameters from ..global_basis import GlobalBasis class LinearForm(Form): def kernel(self, b: ndarray, ...
null
skfem/assembly/form/linear_form.py
linear_form.py
py
1,826
python
en
code
null
code-starcoder2
76
[ { "api_name": "form.Form", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 16, "usage_type": "name" }, { "api_name": "form.BasisTuple", "line_num...
51570946
from django.conf.urls import url, include from rest_framework.urlpatterns import format_suffix_patterns from apps.api import views urlpatterns = format_suffix_patterns([ url(r'^posts/$', views.PostList.as_view(), name='api_posts_list'), url(r'^posts/(?P<uuid>[a-f0-9]{32})/$', views.PostDetail.as_view(), name...
null
apps/api/urls.py
urls.py
py
1,132
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.urlpatterns.format_suffix_patterns", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.api.views.PostList.as_view", "line_number": 8, "usage_type": "c...
423914047
######################################################################################################################### # [This sources was extremely helpful] # # Sources: [https://www.youtube.com/watch?v=2FwNy4Gxyh4&feature=youtu.be&lis...
null
Networking_Assignment_1/Assignments_1/HTTPServerClient/client.py
client.py
py
2,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 56, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 57, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number"...
468899022
import zmq def add1(n): return n + 1 def parse_number(s): try: return int(s) except ValueError: return float(s) def add1_server(listen_address="tcp://*:5555"): context = zmq.Context() socket = context.socket(zmq.REP) socket.bind(listen_address) while True: # W...
null
message-queue/add_1_server.py
add_1_server.py
py
812
python
en
code
null
code-starcoder2
76
[ { "api_name": "zmq.Context", "line_number": 16, "usage_type": "call" }, { "api_name": "zmq.REP", "line_number": 17, "usage_type": "attribute" } ]
447957232
from sklearn.feature_extraction import DictVectorizer def dict_demo(): data = [{"city": "北京", "temperature": 100}, {"city": "上海", "temperature": 60}, {'city': '深圳', 'temperature': 30}] # 1.实例化一个转换类 transfer = DictVectorizer(sparse=False) # 2.调用fit_transform data = transfer....
null
python/third_library/Machine_learning/sk-learn/sklearn_test003.py
sklearn_test003.py
py
498
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.DictVectorizer", "line_number": 9, "usage_type": "call" } ]
310633835
from riotwatcher import RiotWatcher, ApiError import json, requests # The values before the region table are for you to modify apiKey = "Put API Key Here" # Get API key here: https://developer.riotgames.com/ # List of queue types found here: http://static.developer.riotgames.com/docs/lol/queues.json gameType = 450 ...
null
LolStats.py
LolStats.py
py
7,267
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "riotwatcher.RiotWatcher", "line_number": 37, "usage_type": "call" }, { "api_name": "riotwatcher.ApiError"...
494035739
from Bio import SeqIO from Bio.Seq import Seq from src.core.annotations import read_annotations, localize_all_variants, CDSType from src.core.constants import codon_table, codon_table_compl, complement, upstream_length path_to_annotations = './data/AL123456_rev.gff' path_to_ref = './data/h37rv.fasta' path_to_snps = '...
null
phylo_methods/translate_snp_pos.py
translate_snp_pos.py
py
5,598
python
en
code
null
code-starcoder2
76
[ { "api_name": "Bio.SeqIO.parse", "line_number": 14, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 14, "usage_type": "name" }, { "api_name": "src.core.constants.codon_table", "line_number": 23, "usage_type": "name" }, { "api_name": "src.core.con...
86757775
from collections import deque # DSLR 모범답안 방식으로 다시 풀어봄! MAXN = 100000 def bfs() : q = deque() q.append([N,str(N)]) while q : cur,path = q.popleft() if cur == K : print(dp[K]) print(path) break for i in [2*cur,cur-1,cur+1] : if 0 <= i ...
null
BOJ/27_동적 계획법과 최단거리 역추적/13913_숨바꼭질4_다른풀이.py
13913_숨바꼭질4_다른풀이.py
py
588
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
24500994
# -*- coding: utf-8 -*- from __future__ import unicode_literals from plone.recipe.codeanalysis.scsslint import console_script from plone.recipe.codeanalysis.scsslint import SCSSLint from plone.recipe.codeanalysis.testing import CodeAnalysisTestCase from shutil import rmtree from tempfile import mkdtemp from testfixture...
null
plone/recipe/codeanalysis/tests/test_scsslint.py
test_scsslint.py
py
7,710
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "plone.recipe.codeanalysis.testing.CodeAnalysisTestCase", "line_number": 51, "usage_type": "name" }, { ...
508343208
import threading, socket, json, uuid # Size of the buffer for receiving TCP messages (in bytes) BUFFER_SIZE = 1024 # Don't worry too much about SOCKET_QUEUE_SIZE SOCKET_QUEUE_SIZE = 20 class Worker: def __init__(self, client1_port, client2_port, client3_port): self.client2_port = client2_port self.client3...
null
testWesClient.py
testWesClient.py
py
3,350
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 16, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 19, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", ...
244883672
import ast import datetime def reducer(key, value): value = value.next() yield key, value class ActorFilterMapper(object): def __call__(self, key, value): id_, val = value.split('\t') record = ast.literal_eval(val) if record.get('record_type', '') == 'actor' and 'birthday' in recor...
null
src/mapreduce/query3.py
query3.py
py
988
python
en
code
null
code-starcoder2
76
[ { "api_name": "ast.literal_eval", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "da...
614368664
from __future__ import division import collections import importlib import networkx as nx import numpy as np PI = np.pi from geometry.opticaxis import opticaxisFactory, RuleHexArrayMap, OpticAxisRule def divceil(x, y): return (x+y-1)//y class Ommatidium(object): def __init__(self, element): ''' ...
null
retina/retina.py
retina.py
py
16,961
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "collections.OrderedDict", "line_number": 28, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 65, "usage_type": "call" }, { "api_name": "importli...
646134960
from itertools import product class Hashabledict(dict): def __hash__(self): return hash(frozenset(self.items())) def get_dict_combinations(dikt): return (dict(zip(dikt.keys(), values)) for values in product(*dikt.values())) def bfsCreateTo(PG, TS): queue = list(TS['I']) visited = list(que...
null
ass4/hw4.py
hw4.py
py
1,395
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" } ]
411692252
import os import multiprocessing def whoami(what): print(f'Process PID: {os.getpid()} say: {what}') def do(what_to_do): whoami(what_to_do) def main(): whoami("I'm the main program") for _, n in enumerate(range(5), start=1): print(f'[*] start process # {_}') process = multiprocessi...
null
spl/multiprocessing_module/app3.py
app3.py
py
561
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getpid", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 18, "usage_type": "call" } ]
206976969
import os import re import sys from typing import Dict, List, Tuple import click from workspacesio import s3utils, schemas from .util import exit_with, handle_request_error SUPPORTED_MINIO_COMMANDS = [ "ls", "cp", "mirror", "cat", "head", "pipe", "share", "find", "sql", "stat...
null
workspacesio/cli/mc.py
mc.py
py
2,248
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.expanduser", ...
388068248
__author__ = "Nigshoxiz" from flask import render_template, abort, request, redirect, send_file from hashlib import md5 from jinja2 import TemplateNotFound import os, json, shutil from app import db, app from app.controller.global_config import GlobalConfig from app.controller.user_inst import UserInstance from app.c...
null
app/blueprints/server_inst/create_inst.py
create_inst.py
py
10,322
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.utils.returnModel", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 25, "usage_type": "call" }, { "api_name": "app.blueprints.superadmin.check_login.check_login", "line_number": 23, "usage_type": "name" ...
308368695
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : gbdt_model.py # @Author: Huangqinjian # @Date : 2018/3/28 # @Desc : import numpy as np import pandas as pd from sklearn.model_selection import GridSearchCV from sklearn.ensemble import GradientBoostingRegressor # 加载训练集 def load_trainData(trainFilePath): d...
null
Public_Bike/gbdt_model.py
gbdt_model.py
py
4,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn.ensemble.GradientBoostingRegressor", "line_number": 44, "usage_type": "call" }, { "api_na...
305043011
#!/usr/bin/env python import cv2 import os import sys if __name__=="__main__": nmFile=sys.argv[1] dim=96 img = cv2.imread(nmFile) if img is None: os.system('del %s'%nmFile) print("REJECTED, not image remove , no add to repository ") else: print("ACCEPTED")
null
public/code/checkImage.py
checkImage.py
py
317
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "os.system", "line_number": 12, "usage_type": "call" } ]
56075484
def chunkerExample(n): import nltk import re text = nltk.word_tokenize(n) post = nltk.tag.pos_tag(text) print(type(post)) print(post) grammer = "NP: {<DT>?<JJ.*>*<NN.*>+}" NPChunker = nltk.RegexpParser(grammer) result = NPChunker.parse(post) print(result) result.draw() ...
null
NPL/Lab 4/chunkerExample.py
chunkerExample.py
py
321
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.word_tokenize", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.tag.pos_tag", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.tag", "line_number": 5, "usage_type": "attribute" }, { "api_name": "nltk.RegexpParser", ...
582593421
import pygame from pygame.locals import * from common.Scene import Scene from common.VideoPlayer import VideoPlayer from common.Button import Button from common.Log import Log class VideoScene(Scene): def __init__(self, game, filename, endScene, soundFile=None, hasBack=False, endSceneData=None, initialFrames=None, f...
null
code/Exhibits/common/VideoScene.py
VideoScene.py
py
1,672
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.Scene.Scene", "line_number": 9, "usage_type": "name" }, { "api_name": "pygame.image.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.image.lo...
53470936
# Nameko relies on eventlet # You should monkey patch the standard library as early as possible to avoid # importing anything before the patch is applied. # See http://eventlet.net/doc/patching.html#monkeypatching-the-standard-library import eventlet eventlet.monkey_patch() import logging logger = logging.getLogger(__...
null
docs/examples/helloworld.py
helloworld.py
py
1,229
python
en
code
null
code-starcoder2
76
[ { "api_name": "eventlet.monkey_patch", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "nameko.events.Event", "line_number": 16, "usage_type": "name" }, { "api_name": "nameko.even...
227169120
from compute_error import compute_error import matplotlib.pyplot as plt import numpy as np import os import sys import glob import warnings warnings.simplefilter("ignore") def plot_all_errors(folder): errors = [] labels = [] for i, model in enumerate(os.listdir(folder)): if not model.startswith('.'...
null
libraries/mclab/data_model/test/plot_all_errors.py
plot_all_errors.py
py
986
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.simplefilter", "line_number": 8, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 17, "usage_type": "call" }, { "api_name": "glob.glob", "line_number...
427792229
import argparse from diacritizer import Diacritizer from itertools import repeat import random import numpy as np import torch SEED = 1234 random.seed(SEED) np.random.seed(SEED) torch.manual_seed(SEED) torch.cuda.manual_seed(SEED) torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False def...
null
python/diacritize.py
diacritize.py
py
1,338
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", ...
551399382
import pandas as pd import numpy as np from tiingo import TiingoClient import matplotlib.pyplot as plt from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() filepath = "C:\\Users\\Dell\\OneDrive - George Mason University\\MBA 797 SMIF\\Plots\\" API_KEY = "your API key" config = {...
null
MBA797, FNAN477/graphing daily pct returns.py
graphing daily pct returns.py
py
1,670
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.plotting.register_matplotlib_converters", "line_number": 7, "usage_type": "call" }, { "api_name": "tiingo.TiingoClient", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 38, "usage_type": "call" }, ...
76779072
# -*- coding: utf8 -*- # # # # # beginnings of a test suite for the utility functions # # # # import unittest import rasterio import numpy as np class TestWriteGTiff( unittest.TestCase ): ''' tests for testing write_gtiff function ''' def setUp( self ): print( 'setup' ) from affine import Affine # make dumm...
null
downscale/tests/test_utils.py
test_utils.py
py
1,555
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "affine.Affine", "line_number": 16, "usage_type": "call" }, { "api_name": "rasterio.drivers", "line_number": 25, "usage_type": "call" }, { "api_name": "rasterio.open",...
173051738
from string import ascii_uppercase as asc from itertools import product as d import re print("Playfair Cypher: Enter your key and plain text :") key=input() text=input() #key="hmarepasskey" #text="iskidetailmenhamnhijaengy" t=lambda x: x.upper().replace('J','I') s=[] for _ in t(key+asc): if _ not in s and _...
null
playfair.py
playfair.py
py
1,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "string.ascii_uppercase", "line_number": 11, "usage_type": "name" }, { "api_name": "string.ascii_uppercase", "line_number": 12, "usage_type": "name" }, { "api_name": "itertools.product", "line_number": 15, "usage_type": "call" }, { "api_name": "itert...
332894050
import json import requests as req import wikipediaapi q = "werqwerewwrwrwerweasdasdfewrerwrwrwerfasdfdsfaf" url = "https://app.zenserp.com/api/v2/search?apikey=3006e4b0-5578-11ea-8b01-070206ede933&q=" + q try: ret = req.get(url) #print(ret.text) json_data = json.loads(ret.text) #print(json_data) res = json_dat...
null
json_data_extraction.py
json_data_extraction.py
py
809
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "wikipediaapi.Wikipedia", "line_number": 20, "usage_type": "call" } ]
223783308
from django.shortcuts import render, HttpResponse, redirect import random import datetime def index(request): return render(request, 'django_gold/index.html') def process(request): print(request.POST['postType']) x = datetime.datetime.now().strftime("%a, %B %d, %Y") request.session['color'] = "green" ...
null
ninja_gold_2/apps/django_gold/views.py
views.py
py
1,815
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "r...
411534020
from httpx import AsyncClient, Cookies, Headers def test_client_headers(): client = AsyncClient() client.headers = {"a": "b"} # type: ignore assert isinstance(client.headers, Headers) assert client.headers["A"] == "b" def test_client_cookies(): client = AsyncClient() client.cookies = {"a": ...
null
tests/client/test_properties.py
test_properties.py
py
526
python
en
code
null
code-starcoder2
76
[ { "api_name": "httpx.AsyncClient", "line_number": 5, "usage_type": "call" }, { "api_name": "httpx.Headers", "line_number": 7, "usage_type": "argument" }, { "api_name": "httpx.AsyncClient", "line_number": 12, "usage_type": "call" }, { "api_name": "httpx.Cookies", ...
285361151
#! /usr/bin/env python3 ############################################################ # Copyright(c) 2017, Sara Mirzaee # ############################################################ import os import time import numpy as np import minopy_utilities as mnp from skimage.measure import label from m...
null
dev/patch_inversion.py
patch_inversion.py
py
10,261
python
en
code
null
code-starcoder2
76
[ { "api_name": "minopy.objects.arg_parser.MinoPyParser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "mino...
42600318
import gym from dqn_agent import DQNAgent, DQNConfig import tensorflow as tf import numpy as np def train_lander(): env = gym.make("LunarLander-v2") cfg = DQNConfig() cfg.model_savename = "lunar_lander" cfg.plot_scores = True cfg.validate_completions = True cfg.winning_score = 200.0 cfg.re...
null
dqn_lander.py
dqn_lander.py
py
936
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 7, "usage_type": "call" }, { "api_name": "dqn_agent.DQNConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "dqn_agent.DQNAgent", "line_number": 20, "usage_type": "call" }, { "api_name": "gym.make", "line_nu...
190488791
#!/usr/bin/env python import os from setuptools import setup from setuptools.dist import Distribution from setuptools.command.install import install import itertools as it from wheel.bdist_wheel import bdist_wheel as _bdist_wheel class bdist_wheel(_bdist_wheel): def finalize_options(self): _bdist_wheel.fi...
null
setup.py
setup.py
py
2,206
python
en
code
null
code-starcoder2
76
[ { "api_name": "wheel.bdist_wheel.bdist_wheel", "line_number": 10, "usage_type": "name" }, { "api_name": "wheel.bdist_wheel.bdist_wheel.finalize_options", "line_number": 12, "usage_type": "call" }, { "api_name": "wheel.bdist_wheel.bdist_wheel", "line_number": 12, "usage_ty...
495336035
# -*- coding: utf-8 -*- import torch import torch.nn as nn from torch import optim import torch.nn.functional as F import re import json import random import utils import time import os from numpy import argsort # ToDo: handling the UNK # ToDo: batches DATA = 'data/' device = torch.device('cuda' if torch.cuda.is_...
null
train.py
train.py
py
10,770
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
50450566
#!/usr/bin/env python # -*- coding: utf-8 -*- import branca import folium import geopandas import pandas as pd import numpy as np import seaborn as sns import tensorflow as tf import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import animation from matplotlib.backends.backend_p...
null
utils.py
utils.py
py
8,740
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.prod", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.cast", "line_number": 34, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 34, "usage_type": "attribute" }, { "api_name": "tensorflow.cast", ...
171206510
import json import re def is_question(sentence: str): """ 检测句子是否是问句 :param sentence: :return: """ q_words = ["为什么", "是否", "请问", "哪里", "是什么", "怎么", "如何", "有什么", "有听说过"] for word in q_words: if word in sentence: return True if any([ sentence.endswith("?"), ...
null
tmp/acg/step2_build_dia_action.py
step2_build_dia_action.py
py
2,583
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 29, "usage_type": "call" }, { "api_name": "json.load", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 77, "usage_type": "call" } ]
513062256
#!/usr/bin/env python """Convert between crystal structure formats using ASE. For a list of supported formats, see https://wiki.fysik.dtu.dk/ase/ase/io/io.html. Among the supported formats: - espresso-in: Quantum ESPRESSO input files - xsf: xcrysden - cif - xyz """ import sys def check_ase_is_installed(): try:...
null
convert_structure.py
convert_structure.py
py
1,545
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 28, "usage_type": "attribute" }, { "api_name": "ase.io.io.read", "line_number": 36, "usage_type": "call" }, { "...
541138989
#! usr/bin/python3 # -*- coding: utf-8 -*- from flask import url_for from application import app from application.flicket.models.flicket_models import FlicketPriority, FlicketCategory from application.flicket.models.flicket_user import FlicketUser from tests.main import TestCase, CreateUser, dump_to_tmp, CreateTicke...
null
tests/tickets.py
tickets.py
py
1,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.main.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "application.app.app_context", "line_number": 16, "usage_type": "call" }, { "api_name": "application.app", "line_number": 16, "usage_type": "name" }, { "api_name": "appli...
457299244
# -*- coding: utf-8 -*- import os import glob from PIL import Image from keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img def RGBA2RGB( path1=None, path2=None ): """ Convert RGBA memes into RGB ones alpha channel drops params: path1 (str), path...
null
meme_preprocessing.py
meme_preprocessing.py
py
2,100
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_numb...
294651135
from time import perf_counter import aiohttp, asyncio from sys_http.http_ansy import fetch_text, fetch_resp_text from mm_channel import get_mei_channel from mm_parase import get_page_index def get_count_page_urls(start=1, count=1): '''build url page''' base_url = 'http://www.mzitu.com/page' page_urls = [...
null
mm_zt/mm_pages.py
mm_pages.py
py
1,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys_http.http_ansy.fetch_text", "line_number": 19, "usage_type": "call" }, { "api_name": "mm_channel.get_mei_channel", "line_number": 20, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 21, "usage_type": "call" }, { "api_na...
583979092
import face_recognition as face from PIL import Image, ImageDraw import cv2, numpy def find_faces(file): image = face.load_image_file(file) locations = face.face_locations(image) landmarks = face.face_landmarks(image) assert not ([locations, landmarks] == [[], []]), "A face could not be identified" ...
null
Python/recognise faces 1/main.py
main.py
py
6,103
python
en
code
null
code-starcoder2
76
[ { "api_name": "face_recognition.load_image_file", "line_number": 6, "usage_type": "call" }, { "api_name": "face_recognition.face_locations", "line_number": 7, "usage_type": "call" }, { "api_name": "face_recognition.face_landmarks", "line_number": 8, "usage_type": "call" ...
584769881
''' Megh Vakharia AStar.py A* Search of a problem space. The Problem should be given in a separate Python file using the "QUIET" file format. The Heuristics are attached to the Problem as well. Example of Usage: #python3 AStar.py hw4 h_not_full_subsets ''' # heapq imported to get access to priority queue import sys...
null
AStar.py
AStar.py
py
3,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_n...
127418567
import torch import torch.nn as nn import torch.nn.functional as F import torch.nn.parallel import torch.utils.data class AutoPool1D(nn.Module): def __init__(self, dim=0): super(AutoPool1D, self).__init__() # By default, initialize to all zeros self.kernel = torch.nn.Parameter(data=torch.T...
null
cdsd/autopool.py
autopool.py
py
1,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
4115139
from attackcti import attack_client from stix2 import TAXIICollectionSource, Filter, CompositeDataSource, FileSystemSource from sys import platform import yaml from enum import Enum import json from functools import reduce from models import AttackTactic, AttackTechnique, _atomics_folder_path, _home_path, JupyterCells ...
null
playbook-generator/generator.py
generator.py
py
3,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "attackcti.attack_client", "line_number": 16, "usage_type": "call" }, { "api_name": "models.AttackTactic", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path",...
489255211
import json import uuid from bs4 import BeautifulSoup from flask import url_for from itsdangerous import SignatureExpired from tests.conftest import normalize_spaces def test_should_return_verify_template( client, api_user_active, mock_send_verify_code, ): # TODO this lives here until we work out ho...
null
tests/app/main/views/test_verify.py
test_verify.py
py
5,716
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.url_for", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" }, { "api_name": "uuid.UUID", "line_number": 41, "usage_type": "call" }, { "api_name": "flask.url_for", "line_n...
123673715
import xlrd import time import os import logging import datetime from xlrd import xldate_as_tuple #把excel的数据直接存到临时数组,直接进行分析,抛弃mysql支持 class excel_operation(): def foreach(self,rootDir): files_excel=[] for root,dirs,files in os.walk(rootDir): for file in files: file_name=...
null
待自动化运行脚本/客户过期资料-数据监控/scripts/数据校对.py
数据校对.py
py
9,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number"...
153713367
import numpy as np from scipy.linalg import expm from scipy.interpolate import Akima1DInterpolator from qiskit import QuantumCircuit X = np.matrix([[0, 1.0], [1.0, 0]], dtype='complex128') Y = np.matrix([[0, -1.0j], [1.0j, 0]], dtype='complex128') Z = np.matrix([[1.0, 0], [0, -1.0]], dtype='complex128') I = np...
null
Code/4spin/qfunctions4spin.py
qfunctions4spin.py
py
7,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.matrix", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number":...
580075542
'''scrape.py: Scrape historical end-of-season data from sports-reference.com''' from bs4 import BeautifulSoup import requests import csv from tqdm import tqdm from time import sleep from data import cleandata years = [i for i in range(1993, 2021)] def write_table(table, year, s=""): output_rows = [] for tab...
null
scrape.py
scrape.py
py
1,666
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_numbe...
471458436
from django.conf.urls import url from django.contrib import admin from app01.views import index, login, list urlpatterns = [ # url <--> func url(r'^admin/', admin.site.urls), url(r'^index/', index), url(r'^login/', login), url(r'^list/(?P<name>\w*)/(?P<id>\d*)/$', list), url(r'^list/(?P<name>\w*)/$', list...
null
westos201708/app01/urls.py
urls.py
py
341
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": ...
620969213
import io import logging import pexpect from pexpect.spawnbase import SpawnBase class SerialSpawn(SpawnBase): """Due to pyserial not support file descriptor for windows, fdspawn could not be used. This class implement a spawn for pyserial, all interfaces are defined from the base `SpawnBase`. For more in...
null
mcutk/pserial/serialspawn.py
serialspawn.py
py
4,439
python
en
code
null
code-starcoder2
76
[ { "api_name": "pexpect.spawnbase.SpawnBase", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 35, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 86, "usage_type": "attribute" }, { "api_name": "logging.debu...
129372166
# coding: utf-8 import os import pandas as pd from datetime import datetime # cur_path = os.path.split(os.path.realpath(__file__))[0] cur_path = "./test" file_kline = os.path.join(cur_path, "data/000001.XSHG_1MIN.csv") kline = pd.read_csv(file_kline, encoding="utf-8") kline.loc[:, 'dt'] = pd.to_datetime(kline['dt']) ...
null
test/profile_modify.py
profile_modify.py
py
802
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "lin...
166448089
# -*- coding: utf-8 -*- from typing import Optional # https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses class OneTaskError(Exception): """ Base Entity for onetask errors. """ def __init__(self, message: Optional[str] = None): if message is None: messa...
null
onetask/exceptions.py
exceptions.py
py
2,182
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 62, "usage_type": "name" } ]
604200833
import socket import os import sys import select import threading import errno from Cryptodome.Cipher import DES class Server(): def __init__(self): self.host = '' self.backlog = 5 self.size = 1024 self.server = None self.threads = [] self.port = '...
null
dfs/dfs.py
dfs.py
py
10,730
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os._exit", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os._exit", "line_number": 27...
290440245
# coding=utf-8 from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import cv2 import numpy as np __all__ = ['reader'] def reader(paths=[], images=None): """ data generator Args: paths (list[str]): paths to images. image...
null
modules/image/object_detection/yolov3_darknet53_venus/data_feed.py
data_feed.py
py
1,977
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
179917261
import os from collections import Counter import cv2 # list all the image in one path # get the nums of image in one data by Counter # make dir base on the Counter def GetAllImageDirPath(dir_path): return [dir_path + filename for filename in os.listdir(dir_path)] def GetDateInImageName(imagenam...
null
count_numbers_of_image_by_data.py
count_numbers_of_image_by_data.py
py
4,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 3...
249501870
# -*- coding: utf-8 -*- from collections import namedtuple import json import re import scrapy from scrapy import Selector from urllib.parse import urljoin, urlparse from .. import items from ..items import ( ForumItem, ActiveTopicItem, ArchivedTopicItem, TopicCompletedItem ) from ..loaders import Fo...
null
forum_scraper/spiders/a2ch.py
a2ch.py
py
8,064
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spiders", "line_number": 23, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 25, "usage_type": "call" }, { "api_name": "json.load", "line_number": 30, "usage_type": "call" }, { "api_name": "scrapy.Request",...