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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
368104555 | #!/usr/bin/env python3
import os
import sys
import threading
import cv2
import numpy as np
import yaml
import pickle
import pdb
import time
from joblib import Parallel, delayed
def get_surf_features_from_video(downsampled_video_filename, surf_feat_video_filename, keyframe_interval):
"Receives filename of downsam... | null | hw2_code/surf_feat_extraction.py | surf_feat_extraction.py | py | 4,776 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.matr",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
631285251 | import torchvision.transforms as transforms
from torchvision.datasets import ImageFolder
import os
import torch
import torchvision
from PIL import Image
import random
import cv2
import numpy as np
"""
data loader
"""
def illuminationNormalization(img):
"""
illumination Normalization by Histogram equalizati... | null | utils.py | utils.py | py | 7,609 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2YCR_CB",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"l... |
549020413 | from __future__ import division
import healpy as hp
import numpy as np
import matplotlib.pyplot as mp
from qubic import (create_random_pointings, gal2equ,
read_spectra,
compute_freq,
QubicScene,
QubicMultibandInstrument,
QubicPoly... | null | qubic/scripts/old_scripts/script_polychromatic.py | script_polychromatic.py | py | 3,351 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "qubic.gal2equ",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "qubic.compute_freq",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "qubic.create_random_pointings",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "qubic.... |
560782966 | # coding:utf-8
import json
import tornado.web
import tornado.escape
from tornado import gen
from lib import BaseHandler
from lib.orm import QueryTable
from manager.libs import ComplexEncoder, dataverify
UserGroupModel= QueryTable('opman_user_group')
UserModel = QueryTable('opman_user')
class UserGroupMain(BaseHandler... | null | manager/account/group.py | group.py | py | 1,382 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.orm.QueryTable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lib.orm.QueryTable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lib.BaseHandler",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "json.dumps",
... |
394361980 | #coding:utf-8
import requests
import json
# from my_python_requests.base._pycache_.demo import data
class RunMethod:
def post_main(self,url,data,header=None):
res = None
if header != None:
res = requests.post(url=url,data=data,headers=header)
# print("有header")... | null | runmethod.py | runmethod.py | py | 1,487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
216056496 | from django.template import Engine, Context
import os.path
import shutil
OUTPUT_DIR = '.build'
PAGE_DIR = 'pages'
STATIC_DIR = 'static'
TEMPLATE_DIR_SUFFIXES = [PAGE_DIR, 'includes']
class StaticSiteGenerator(object):
"""
A static site generator for Django. This takes a project directory and
builds a stat... | null | firetail/generator.py | generator.py | py | 2,484 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
"... |
649414788 | import numpy as np
import os
import gc
def complex2real(arg, output_stack = True):
arg = arg.copy()
A = [np.real(arg), np.imag(arg)]
if not output_stack:
return A[0], A[1]
return np.column_stack([A[0], A[1]])
def real2complex(*arg):
if type(arg) != np.ndarray and len(arg) == 2:... | null | calculate.py | calculate.py | py | 38,422 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.real",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.imag",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.column_stack",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ndarray",
"line_numb... |
486917063 | import scrapy
import os
import sys
# 引入容器
from course_spider.course_item import CourseItem
class CourseSpider(scrapy.Spider):
#设置name
name = "course_spider"
#设定域名
allowed_domains = ["imooc.com"]
#填写爬取地址
start_urls = ["http://www.imooc.com/course/list"]
#编写爬取方法
def parse(... | null | course_spider/course_spider/spiders/course_spider.py | course_spider.py | py | 2,402 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "course_spider.course_item.CourseItem",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 48,
"usage_type": "call"
}
] |
469065893 | # -*- coding: utf-8 -*-
"""Megaplan client module.
Provides a class that implements Megaplan authentication and request signing.
Only supports POST requests. The complete API documentation is at:
http://wiki.megaplan.ru/API
To use a password:
import megaplan
c = megaplan.Client('xyz.megaplan.ru')
c.au... | null | megaplan/megaplan.py | megaplan.py | py | 4,741 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "hmac.new",
"line_numbe... |
53656687 | import pymorphy2
morth = pymorphy2.MorphAnalyzer()
text = """Морфологический анализ - это определение характеристик слова на
основе того, как это слово пишется. При морфологическом анализе не
используется информация о соседних словах."""
text = text.split()
for word in text:
s = morth.parse(word)
print(s)... | null | Курсы/Тексты/1.py | 1.py | py | 468 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymorphy2.MorphAnalyzer",
"line_number": 3,
"usage_type": "call"
}
] |
298262990 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###Author
#Nathaniel Watson
#2017-09-18
#nathankw@stanford.edu
###
"""
Clones the specified CrisprModification onto the desired biosamples.
"""
import argparse
import pdb
import pulsarpy.models as models
import pulsarpy.utils
def get_parser():
parser = argparse.Ar... | null | pulsarpy/scripts/clone_crispr_modification.py | clone_crispr_modification.py | py | 1,191 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pulsarpy.models.CrisprModification",
"line_number": 36,
"usage_type": "call"
... |
25558964 | """ Defines a set of helper functions that make constructing hardware easier.
The set of functions includes
as_wires: converts consts to wires if needed (and does nothing to wires)
and_all_bits, or_all_bits, xor_all_bits: apply function across all bits
parity: same as xor_all_bits
mux: generate a multiplexer
concat: c... | null | pyrtl/helperfuncs.py | helperfuncs.py | py | 20,323 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wire.Input",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "wire.Output",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "wire.Register",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "wire.WireVector",
"line_numb... |
280519688 | # -*- coding: utf-8 -*-
import tornado
from MysqlUtils import *
import json
class MysqlHandler(tornado.web.RequestHandler):
def data_received(self, chunk):
pass
def get(self):
argument = self.get_argument('code', "0") # 获取get参数 url?xx=?&xx=?
print("argument==", argument)
res ... | null | TornadoTest/MysqlHandle.py | MysqlHandle.py | py | 747 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tornado.web",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
}
] |
509930499 | import pygame
import game_functions as gf
from settings import Settings
from game_stats import GameStats
from ship import Ship
from alien import Alien
from pygame.sprite import Group
from bullet import Bullet
from button import Button
from scoreboard import Scoreboard
def run_game():
#Initialize pygame, settings,... | null | alien_invasion.py | alien_invasion.py | py | 2,185 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "settings.Settings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display"... |
604119553 | import logging
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
# from airflow.operators.python_operator import PythonOperator
from airflow.operators.docker_operator import DockerOperator
from fileflow.operators import DivePythonOperator
from file... | null | dags/simple.py | simple.py | py | 3,563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "fileflow.task_runners.TaskRunner",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fileflow.task_runners.TaskRunner",
"line_number": 19,
"usage_type": "name"
},
{
"ap... |
149409597 | from flask import render_template, jsonify, Flask, redirect, url_for, request
from app import app
import random
import os
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.utils import to_cat... | null | app/views/main.py | main.py | py | 2,643 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.render_template",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line... |
17880013 | from __future__ import unicode_literals
__all__ = [
'canonical_exposure_data',
'coverage_type_ids',
'keys_data',
'keys_status_flags',
'peril_ids',
'write_input_files'
]
import string
from collections import OrderedDict
import pandas as pd
from hypothesis import given
from hypothesis.strateg... | null | tests/data.py | data.py | py | 3,394 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oasislmf.utils.coverage.BUILDING_COVERAGE_CODE",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "oasislmf.utils.coverage.CONTENTS_COVERAGE_CODE",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "oasislmf.utils.coverage.OTHER_STRUCTURES_COVERAGE_C... |
32571733 | import gevent.server
from mud_telnet_handler import MudTelnetHandler
from game_server import GameServer
import argparse
import logging
# Set up logging
log = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s')
handler.setFormatter(formatter)
... | null | mud.py | mud.py | py | 1,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG... |
148698253 | # -*- coding: utf-8 -*-
#
# Swiss Open Access Repository
# Copyright (C) 2021 RERO
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distribu... | null | sonar/modules/ark/api.py | api.py | py | 8,876 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.current_app.config",
"line_number": 110,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 110,
"usage_type": "name"
},
{
"api_name": "flask.current_app.config",
"line_number": 139,
"usage_type": "attribute"
},
{
"... |
606596702 | '''
Example of how to use single_noise_channel removal algorithm. In this example we also use what we have seen in other examples:
We're gonna synthetize a signal, Then we're gonna do processing on it using the algorithm and finally we are going to label
the newly obtained file and compare them to the file without any ... | null | examples/final_scripts_for_final/analyze_improvement_of_single_noise_channel_removal.py | analyze_improvement_of_single_noise_channel_removal.py | py | 8,404 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
... |
252074382 | #!/usr/bin/env python3
import subprocess
from termcolor import colored
import os
import threading
import time
import argparse
import shutil
import signal,sys
import socket
import re,configparser
# (.*)(?:\?) --> Matches the url part, ie before the ?
# (?:\?)(\w+)(?:=) --> Matches the first occurence after the ?
# (?... | null | recon-007.py | recon-007.py | py | 23,653 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.devnull",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "termcolor.colored",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "termcolor.colored... |
87717124 | import matplotlib.pyplot as plt
import numpy as np
import sys
# =============================================================================
# Importando e apresentando os dados dados
# =============================================================================
#Os dados são importados diretamente das tabelas re... | null | linear-regression/linear-regression_v05.py | linear-regression_v05.py | py | 4,073 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22... |
531886700 | from datetime import datetime
from changelog_machine.ChangelogGenerator import render_entry, render_title
class Test:
def test_render_entry_title_only(self):
raw_content = {
"title": "Title",
"merge_request": None,
"issue": None,
"author": None,
}
... | null | tests/changelog_machine/test_ChangelogGenerator.py | test_ChangelogGenerator.py | py | 1,535 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "changelog_machine.ChangelogGenerator.render_entry",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "changelog_machine.ChangelogGenerator.render_entry",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "changelog_machine.ChangelogGenerator.render_e... |
170606985 | from rest_framework import generics, mixins
from .models import Incident
from .serializers import IncidentSerializer
from datetime import datetime
from django.http.response import HttpResponse
from django.views.decorators.csrf import csrf_exempt
import re
class ListIncidentView(generics.ListAPIView):
queryset = In... | null | api/views.py | views.py | py | 1,828 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Incident.objects.all",
"line_number": 10,
"usage_type": "call"
},... |
396701860 | import solver
import dxchange
import objects
import numpy as np
import cupy as cp
import signal
import sys
if __name__ == "__main__":
igpu = np.int(sys.argv[1])
cp.cuda.Device(igpu).use() # gpu id to use
# Model parameters
voxelsize = 1e-6 # object voxel size
energy = 5 # xray energy
... | null | tmpscripts/testbig.py | testbig.py | py | 4,634 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.int",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cupy.cuda.Device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cupy.cuda",
"line_number... |
482305342 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path("signup/", views.sign_up, name="signup"),
path('list/', views.list_class, name='list'),
path('new/', views.new_post, name='new_post'),
path('post/<int:pk>/', views.post_view, name='post_view'... | null | section/urls.py | urls.py | py | 865 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
479340138 | #Simple linear regression practice
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Importing the dataset
dataset = pd.read_csv('50_Startups.csv')
x = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 4].values
#encoding categorical data
from sklearn.preprocessing import LabelEncoder, OneHotEnco... | null | simple linear regression practice.py | simple linear regression practice.py | py | 1,458 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 15,
"usage_type": "call"
},
{
... |
233113918 | from django.forms.widgets import ClearableFileInput
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
class ThumbnailFileInput(ClearableFileInput):
"""A widget for inputs of image field. Present thumbnail of
uploaded image.
"""
class Media:
... | null | apps/hello/widgets.py | widgets.py | py | 830 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.widgets.ClearableFileInput",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.safestring.mark_safe",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.template.loader.render_to_string",
"line_number": 29,
"us... |
207439438 | import sys
import os
from enum import Enum
import re
from tokenizer import TokenStateMachine, commentChar, TokenType
from dataclasses import dataclass
from typing import List, Optional
from textwrap import indent
tab = "\t"
# class StatementType(Enum):
# Let = 1
# While = 2
# If = 3
# Return = 4
unaryOperators = ... | null | 10/parser.py | parser.py | py | 17,675 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
... |
241016869 | from argparse import ArgumentParser, SUPPRESS
from invisibleroads_macros.disk import link_path
from invisibleroads_macros.iterable import sort_dictionary
from invisibleroads_macros.text import unicode_safely
from six.moves import getcwd
from sys import argv
from . import ToolScript, corral_arguments, run_script
from .... | null | crosscompute/scripts/run.py | run.py | py | 2,633 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "argparse.SUPPRESS",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "invisibleroads_macros.text.unicode_safely",
"line_number": 22,
"usage_type": "name"
},
{
... |
75400333 | from firebase import Firebase
FBConn = firebase.FirebaseApplication('https://test-44899.firebaseio.com/')
while true:
user = input(input("Enter your name here"))
data = {
"user1" : user
}
result = FBConn.post('/MytestData/', data)
print(result)
... | null | database.py | database.py | py | 324 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "firebase.FirebaseApplication",
"line_number": 3,
"usage_type": "call"
}
] |
301090126 | # -*- coding: utf-8 -*-
from django.conf import settings
def fun_settings(request):
"""Add ENVIRONMENT name (Brick, Ketch, dev) to template context when in backoffice application."""
context = {}
if request.path.startswith('/backoffice/'):
context['ENVIRONMENT'] = settings.ENVIRONMENT
return ... | null | fun/context_processor.py | context_processor.py | py | 328 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings.ENVIRONMENT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
}
] |
463396051 | import requests
import pytz
import datetime
def load_attempts():
page_number = 1
number_of_pages = 1
attempts = []
while page_number <= number_of_pages:
url = 'https://devman.org/api/challenges/solution_attempts/'
params = {"page":page_number}
try:
json_data = reque... | null | seek_dev_nighters.py | seek_dev_nighters.py | py | 1,359 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pytz.timezone",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
185085193 | from flask import request
from flask_restplus import fields, Namespace
from app.utils import get_logger
from app import utils
from . import ARLResource
from app import modules
ns = Namespace('user')
logger = get_logger()
login_fields = ns.model('LoginARL', {
'username': fields.String(required=True, descriptio... | null | app/routes/user.py | user.py | py | 1,091 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_restplus.Namespace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.utils.get_logger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restplus.fields.String",
"line_number": 15,
"usage_type": "call"
},
{
"api_nam... |
127516798 | import os
import sys
import time
import runpy
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from pprint import pprint
from tensorflow.keras import optimizers
from tensorflow.keras.optimizers.schedules import ExponentialDecay
from models import get_gen... | null | main.py | main.py | py | 14,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.reduce_mean",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.reduce_mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.nn.relu",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tens... |
178222152 | import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from LucasKanade import LucasKanade
# write your script here, we recommend the above libraries for making your animation
parser = argparse.ArgumentParser()
parser.add_argument('--num_iters', type=int, default=1e4, h... | null | hw3/code/testGirlSequenceWithTemplateCorrection.py | testGirlSequenceWithTemplateCorrection.py | py | 2,422 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line... |
358142373 | import numpy as np
import cv2
import os
import facerecognition as fr
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
face_recognizer.read(r'') # Where training file YML is
cap = cv2.VideoCapture(0) # 0 is the camera, if you want to test it on a video just put the video path
size = (int(cap.get(cv2.CAP_PROP_F... | null | load_model_video.py | load_model_video.py | py | 1,036 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.face.LBPHFaceRecognizer_create",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.face",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.C... |
5819765 | import sys
import os
absPath = os.path.dirname(os.path.abspath(__file__))
fileDir = absPath[:absPath.find('backend')]
sys.path.append(os.path.join(fileDir, 'backend'))
import datetime
import json
import codecs
from pymongo import MongoClient
from fiscal.src.services.read_files.CallReadXmls import CallReadXmls
from to... | null | backend/fiscal/src/services/products_dominio_x_xml/ProductsAccountSystemXXML.py | ProductsAccountSystemXXML.py | py | 8,316 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
81929198 | import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import train_test_split
from sklearn.cross_validation import KFold
from math import exp
#opening Sens... | null | HT_Sensor_Data/FS.py | FS.py | py | 8,042 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.double",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.int",
"lin... |
239013097 | import concurrent.futures
import logging
import queue
from concurrent.futures import Executor
from typing import Dict, Optional, Callable
import torch
from botorch.utils.sampling import draw_sobol_samples
from ..data import gather_and_save_training_data, get_data_json
from ..generators.generator import BayesianGenera... | null | xopt/bayesian/optim/asynch.py | asynch.py | py | 5,518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "generators.generator.BayesianGenerator",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "co... |
558893636 | from functools import partial
import numpy as np
from keras.preprocessing.image import img_to_array
from keras.preprocessing.image import load_img
from PIL import Image
from pathlib import Path
from toolbox.image import bicubic_rescale
from toolbox.image import modcrop
from toolbox.dataset import DATASET
def load_s... | null | toolbox/data.py | data.py | py | 9,388 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.random",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
444734429 | # -*- coding: utf-8-*-
'''
智能对话机器人实现
包含:
AIUI
图灵机器人
小影机器人
建议使用AIUI
'''
from __future__ import print_function
from __future__ import absolute_import
import requests
import json
import logging
import hashlib
import base64
import urllib2
import time
from uuid import getnode as get_mac
from .app_utils import sendT... | null | client/robot.py | robot.py | py | 6,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "importlib.reload",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.setdefaultencoding",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "logging.getLogger... |
194384592 | # -*- coding: utf-8 -*-
import scrapy
from allRencaiInfoScrapy.items import AllrencaiinfoscrapyItem
import codecs
import json
class allFemaleSpider(scrapy.Spider):
name = 'all_female_url'
# find_url = []
# unfind_url = []
def start_requests(self):
allowed_domains = ['https://baike.baidu.com']
... | null | allRencaiInfoScrapy/spiders/allFemaleSpider.py | allFemaleSpider.py | py | 3,519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_nu... |
224871520 | import sys
import os
import errno
import uuid
import traceback
from pycalico import netns
from pycalico.ipam import IPAMClient
from pycalico.datastore import Rules, Rule, Endpoint
from pycalico.util import get_host_ips
from netaddr import IPAddress, AddrFormatError
from pycalico.datastore_errors import PoolNotFound
imp... | null | calico_mesos/calico_mesos.py | calico_mesos.py | py | 10,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pycalico.ipam.IPAMClient",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.stdin.read",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sys.stdin",... |
622629945 | import os
import sys
import argparse
from sys import platform # mac or linux
import huepy # for color print
from datetime import datetime
from tqdm import tqdm
import func
# Объявляем переменные
bad_users = {}
followers_id_name = {}
madiaid_code = {}
# Приветственное сообщение
print(func.hello.format(func.scriptName[... | null | oxana/check_tags.py | check_tags.py | py | 4,796 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "func.hello.format",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "func.hello",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "func.scriptName",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "func.getOs",
... |
329721504 | from tkinter import *
import shutil
import os
import easygui
from tkinter import filedialog
from tkinter import messagebox as mb
def abrir_ventana():
leer=easygui.fileopenbox()
return leer
#----------------------------
def abrir_archivo():
ruta = abrir_ventana()
try:
os.startfile(rut... | null | prueba1.py | prueba1.py | py | 3,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "easygui.fileopenbox",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.startfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.... |
328644356 | from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
from past.utils import old_div
import os
import matplotlib.pyplot as plt
import numpy as np
import pytest
import pyFLUT.constructor
import pyFLUT.equilibrium as equilibrium
n_z = 201
@pytest.fixture(scope='mod... | null | test/test_equilibrium.py | test_equilibrium.py | py | 5,415 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyFLUT.equilibrium.EquilibriumSolution",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyFLUT.equilibrium",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 17,
"usage_type": "call"
},
{
"api_name... |
568863065 | #!/usr/bin/env python3
# A beginning attempt to make an efficient implementation of a brute force planet position
# Use spherical coords for position (start with circular to make easy)
# [r, theta, phi]
# Presumably then we need to use spherical coords for velocity
# [d_r, d_theta, d_phi]; v^2 = d_r + r*d_theta ...
#... | null | orbits.py | orbits.py | py | 1,452 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "lib.helpers.distance_spherical",
"... |
215191465 | from django.conf.urls import url
from . import views
app_name = 'blogengine'
urlpatterns = [
url(r'^$', views.home, name='home1'),
url(r'^home/$', views.IndexView.as_view(), name='home'),
url(r'^post/(?P<post_id>[0-9]+)/$', views.post_detail, name='post_detail'),
url(r'index/$', views.index, name='index'),
# u... | null | blogengine/urls.py | urls.py | py | 445 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
125436320 | import json
from urllib.request import urlopen
with urlopen('https://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json') as response:
source = response.read()
data = json.loads(source)
# print(json.dumps(data, indent=2))
print(len(data['list']['resources']))
#
input1: str = input('Enter T... | null | Currency_Converter.py | Currency_Converter.py | py | 628 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
}
] |
112845178 | from torch.utils.data import Dataset
from tqdm import tqdm
import numpy
from nltk.tokenize import TweetTokenizer
class SentenceDataset(Dataset):
"""
Our custom PyTorch Dataset, for preparing strings of text (sentences)
What we have to do is to implement the 2 abstract methods:
- __len__(self): in... | null | Voice Processing/Lab 3/Prelab/dataloading.py | dataloading.py | py | 3,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 113,
"usage_type": "call"
}
] |
97910483 | from flask import Flask, request, redirect, render_template
from flask_sqlalchemy import SQLAlchemy
import cgi
app = Flask(__name__)
app.config['DEBUG'] = True
##Database Requirements
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://blogadmin:password@localhost:8889/build_a_blog'
app.config['SQLALCHEMY_ECHO']... | null | main.py | main.py | py | 1,498 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.r... |
29168029 | #!/usr/bin/env python
# coding: utf-8
# In[5]:
# setup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
f... | null | usaads.py | usaads.py | py | 1,902 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.action_chains.ActionChains",
"line_number": 40,
"usage_type": "cal... |
379239415 | from lokomotyvas import Lokomotyvas
from vagonas import Vagonas
from traukinys import Traukinys
import argparse
import sys
import random
import json
def meniuSarasas():
""" Pateikia meniu skydeli konsoleje """
print ("""
1. Vagonų sąrašas
2. Lokomotyvų sąrašas
3. Traukinių sąrašas
4. Sukurti l... | null | surinktuvas.py | surinktuvas.py | py | 18,318 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "lokomotyvas.Lokomotyvas",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "vagonas.Vago... |
104024326 | import os
import tempfile
import argparse
import json
#creting temp file:
storage_path = os.path.join(tempfile.gettempdir(), 'storage.data')
#work with file (open and reading):
def get_data():
if not os.path.exists(storage_path):
return {}
with open(storage_path,'r') as f:
data = f.read()
... | null | Scripts/Course1/WEEK2/homeWork/solution1.py | solution1.py | py | 1,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tempfile.gettempdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line... |
535788643 | #
#
# Created by Richard Hedlund, richard.hedlund@afconsult.com, oct 2018
#
#
import time
import zmq
import struct
import numpy as np
from pymavlink import mavutil
from Antenna_rev2 import Antenna
context = zmq.Context()
socketX = context.socket(zmq.PULL)
socketY = context.socket(zmq.PULL)
socketX.connect("tc... | null | code/py-detect/detection_fbank_rev2.py | detection_fbank_rev2.py | py | 3,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zmq.Context",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "zmq.PULL",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "zmq.PULL",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "Antenna_rev2.Antenna",
"l... |
570150917 | import matplotlib.pyplot as plt
import numpy as np
def feval(funcName, *args):
return eval(funcName)(*args)
def backwardEuler(func, yinit, x_range, h):
m = len(yinit)
n = int((x_range[-1] - x_range[0])/h)
x = x_range[0]
y = yinit
xsol = np.empty(0)
xsol = np.append(xsol, x)
ysol = ... | null | modified backward.py | modified backward.py | py | 1,670 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.empty",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number"... |
257253926 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
import imutils
#from keras.preprocessing import image as pics
#------------------------------------------------------------------------------------------------------``
def find_contours(img):
contours, hierarchy = cv.findContours(image=img, ... | null | $Projects/ParkingLot_ComputerVisoin/main.py | main.py | py | 3,811 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.findContours",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_TREE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.CHAIN_APPROX_SIMPLE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.dra... |
307844063 | '''
python hw3.py -h help - Выводит сообщение как пользоваться
python hw3.py 1 get_value - позволяет получить значение хранимой
переменной;
python hw3.py 2 set_value - позволяет установить новое значение хранимой
переменной, и возв... | null | hw3.py | hw3.py | py | 1,260 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
}
] |
616476750 | from random import shuffle
from random import randint, randrange
from graph_tools import tour_length
from datetime import datetime
from nearest_neighbour import search_from_start
#Genetic algorithm main method
def genetic_search(graph, graphSize):
#Step 1 : Create initial sorted population
population = sorted(gen_po... | null | Stuff/genetic.py | genetic.py | py | 3,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "graph_tools.tour_length",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datet... |
175698707 | #!/usr/bin/env python3
import dbus
import re
class Spotify(object):
'''Wrapper for Spotify's DBus interface'''
def __init__(self, bus=None):
self.obj_path = '/org/mpris/MediaPlayer2'
self.prop_path = 'org.freedesktop.DBus.Properties'
self.player_path = 'org.mpris.MediaPlayer2.Player'
... | null | spotify.py | spotify.py | py | 3,746 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dbus.SessionBus",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dbus.Interface",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dbus.Interface",
"line_nu... |
234636343 | import argparse
import enum
import glob
import hashlib
import os
import requests
import sys
import tempfile
import time
import yaml
import shutil
from pathlib import Path
from PIL import Image
from urllib import parse
import dump_trace_images
TRACES_DB_PATH = os.getcwd() + "/traces-db/"
RESULTS_PATH = os.getcwd() + ... | null | .gitlab-ci/tracie/tracie.py | tracie.py | py | 6,418 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dump_trace_images.dump_from_trace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "glob.glob",
... |
123980537 | import os
import time
import numpy as np
from torch.utils.data import Dataset, DataLoader
def get_data(file_loc, to_dir, strip_docid=True):
"""
This function is used to load the data folds into .npy files
:param file_loc:
:param to_dir:
:param strip_docid:
:return:
"""
with open(file_... | null | dataloader.py | dataloader.py | py | 2,830 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.save",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"... |
55932182 | import os
import matplotlib.pyplot as plt
from chemprop.data.utils import get_data, get_task_names
def plot_distribution(data_path: str, save_dir: str, bins: int):
"""
Plots the distribution of values of a dataset.
:param data_path: Path to data CSV file.
:param save_dir: Directory where plot PNGs ... | null | chemprop/data_processing/plot_distribution.py | plot_distribution.py | py | 1,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "chemprop.data.utils.get_task_names",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "chemprop.data.utils.get_data",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 26,
"usage_type": "call"
},
{
"... |
5020475 | import jinja2
import sys
from os.path import join, dirname
REPO_ROOT = dirname(dirname(__file__))
sys.path.insert(0, REPO_ROOT)
from constructor import construct
valid_platforms = construct.ns_platform(sys.platform)
template = """
# Keys in `construct.yaml` file:
This document describes each of they keys in the ... | null | scripts/make_docs.py | make_docs.py | py | 1,650 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "constructor.construct.ns_p... |
629183191 | from bot import bot, file_handle_pool, MYTOKEN, sess, download_path, logger
import telebot
from views.register import check_register_code
from views.main import check_password, reply_after_parse_g, req_file
from views.menuinfo import reply_after_parse_m, reply_after_parse_mi
from models.models import init_db
import os
... | null | friday_bot/src/app.py | app.py | py | 3,082 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.models.init_db",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bot.bot.send_message",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bot.bot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "bot.bot.send_messag... |
588419288 | import logging
import sys
from subprocess import check_output, PIPE
import subprocess
import json
import string
import time
import decimal
import boto3
SIGNED_URL_EXPIRATION = 300 # The number of seconds that the Signed URL is valid
logger = logging.getLogger('boto3')
logger.setLevel(logging.INFO)
def lambda_... | null | Lambda/extractExif/extractMetadataFromExiftool.py | extractMetadataFromExiftool.py | py | 4,975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE"... |
640762383 | import sys
from PySide2.QtWidgets import QFileDialog, QPushButton, QTextEdit, QLineEdit, QTableWidget, QSizePolicy
from PySide2.QtGui import QIcon
import os
from custom_config_parser import custom_config_parser
class file_chooser(QPushButton):
def __init__(self, pipe_path, type='ms'):
super(file_chooser,... | null | dependencies/ui/tab1/file_chooser.py | file_chooser.py | py | 3,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySide2.QtWidgets.QPushButton",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "custom_config_parser.custom_config_parser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QFileDialog.Options",
"line_number": 26,
"usage_... |
242061095 | #!/usr/bin/python
import argparse as ag
from Bio.PDB.Polypeptide import one_to_three as ott
from Bio.Seq import Seq
import Bio.Alphabet
import Bio.Alphabet.IUPAC
import os
class PepBuilder(object):
def __init__(self):
self.pymol = self.init_pymol()
def gen_pept(
self,
seq,... | null | grid_scripts/build_pept.py | build_pept.py | py | 4,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Bio.PDB.Polypeptide.one_to_three",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.Polypeptide.one_to_three",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "Bio.PDB.Polypeptide.one_to_three",
"line_number": 52,
"usage_type": "ca... |
653064547 | from central.models import Idea, Recommendation, Site
from django.test import TestCase
from scripts import save_recommendations, save_tfidf_weights
class SaveTfidfWeightsAndRecommendationsTests(TestCase):
def setUp(self):
self.site, _ = Site.objects.get_or_create(domain="example.com")
# Create s... | null | tests/integration/test_save_tfidf_weights_and_recommendations.py | test_save_tfidf_weights_and_recommendations.py | py | 1,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "central.models.Site.objects.get_or_create",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "central.models.Site.objects",
"line_number": 9,
"usage_type": "attribute"
... |
212262524 | """ This file includes the definition for base command classes """
import re
# from .TelegramUser import TUser
from enum import Enum
from .TelegramUser import TChat, TUser, TGroup
class HandledStatus(Enum):
"""
HANDLED = Mark as handled but continues to the end.
NOT_HANDLED = Mark as not handled and con... | null | TelegramBotCommands/CommandsBase.py | CommandsBase.py | py | 15,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "TelegramUser.TGroup",
"line_number": 198,
"usage_type": "argument"
},
{
"api_name": "re.compile",
"line_nu... |
312940254 | import opencontracts
from bs4 import BeautifulSoup
import email
with opencontracts.enclave_backend() as enclave:
enclave.print("Fiat Swap started running in the Enclave!")
seller = enclave.user_input("Please enter the Venmo handle of the seller:")
amount = int(enclave.user_input("Please enter the transaction... | null | paypal_oracle/oracle.py | oracle.py | py | 2,307 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "opencontracts.enclave_backend",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "email.message_from_string",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 34,
"usage_type": "call"
}
] |
524822743 | # 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/sendgrid/helpers/inbound/app.py
# Compiled at: 2020-04-29 15:57:11
# Size of source mod 2**32: 1203 bytes
"""Receiver module for proc... | null | pycfiles/sendgrid-6.3.0-py3.6/app.cpython-36.py | app.cpython-36.py | py | 1,268 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sendgrid.helpers.inbound.config.Config",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 29,
"usage_type": "call"
},
{
"api_name... |
155070298 | from pymongo import MongoClient
from pprint import pprint
from argparse import ArgumentParser
client = MongoClient()
db = client['matchladder']
coll_players = db['players']
coll_matches = db['matches']
parser = ArgumentParser()
parser.add_argument('--clearc', action='store_true', dest='clear_canned', help='Clear can... | null | db_tweaker.py | db_tweaker.py | py | 1,284 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
}
] |
406396206 | # common front end imports
import logging
from pyNN.random import NumpyRNG
from pyNN.random import RandomDistribution
from spinn_front_end_common.utilities import globals_variables
from spynnaker.pyNN.abstract_spinnaker_common import AbstractSpiNNakerCommon
from spynnaker7.pyNN.models.pynn_population import Population... | null | spynnaker7/pyNN/spinnaker.py | spinnaker.py | py | 4,850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spinn_front_end_common.utilities.globals_variables.set_failed_state",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "spinn_front_end_common.utilities.globals_variables",
"l... |
217460200 | from urllib.request import urlopen
from urllib.parse import urlparse
from bs4 import BeautifulSoup
#dependancies
from sumy.summarizers.lex_rank import LexRankSummarizer
from sumy.parsers.html import HtmlParser
from sumy.nlp.tokenizers import Tokenizer
import re
import datetime
import random
import pandas as ... | null | about.py | about.py | py | 5,305 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sumy.summarizers.lex_rank.LexRankSummarizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
110356698 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
import seaborn as sb
import os
import sys
maindirectory = "G:/Behavioral Data/Sonntag Lab Dropbox/Phenotyper/Investigators/"
investigator = str(sys.argv[1])
treatment = str(sys.argv[2])
variableID1 = str(sys.ar... | null | micefigure.py | micefigure.py | py | 1,128 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
136892763 | '''
Contains common User Interface Classes.
'''
import os
import pygame
from . import event_manager, _color_scheme
from .event import EventListener
from .entity import Entity
class Button(Entity, EventListener):
'''
Basic Button Class for creating simple text buttons
'''
def __init__(self, text,... | null | src/engine/ui.py | ui.py | py | 3,656 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "entity.Entity",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "event.EventListener",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "entity.Entity.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "entity.Entit... |
620928096 | import json
import pickle
from django import test
from django.contrib.auth import models as auth_models
from guardian import shortcuts
from rest_framework import test as api_test, request as api_request
from rest_framework_reactive import models as observer_models
from rest_framework_reactive import request as obser... | null | tests/test_observers.py | test_observers.py | py | 12,748 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.test.APIRequestFactory",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rest_framework.test",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
... |
62253094 | from PyQt5.QtWidgets import QSizePolicy
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCavans
class MtMplCanv(FigureCavans):
def __init__(self, figure, parent = None):
self.figure = figure
FigureCavans.__init__(self, self.figure)
FigureCavans.setSizePolicy(self, Q... | null | MyMplCanc.py | MyMplCanc.py | py | 695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.backends.backend_qt5a... |
73953625 | """
用来进行数据处理的文件
"""
import codecs
import re
import jieba
import random
# def get_sentence_int_to_vocab(train_path,test_path,dev_path):
# sentence_vocab = []
# f1 = open(train_path,encoding="utf-8")
# f2 = open(test_path,encoding="utf-8")
# f3 = open(dev_path,encoding="utf-8")
#将数据转换成列表
def load_sentenc... | null | data_utils.py | data_utils.py | py | 5,090 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "codecs.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 152,... |
42040925 | import unittest
from testfixtures import ShouldRaise
from dsciqcm.prisource import _DAFDemoMap
from dsciqcm.config import DAF_DEMO_MAP_PPM
class TestDAFDemoMap(unittest.TestCase):
def test_invalid_name(self):
tname = "dsci_sandbox.daf_demo_map"
message = (
"{} is not th... | null | test/test_daf_demo_map.py | test_daf_demo_map.py | py | 684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dsciqcm.prisource._DAFDemoMap",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "testfixtures.ShouldRaise",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
112460243 | # coding: utf8
import tornado.ioloop
import tornado.httpserver
import tornado.options
import tornado.web
import tornado.gen
import requests
from tornado.concurrent import run_on_executor
from concurrent.futures import ThreadPoolExecutor
from htmlprocessor import process
from tornado.options import define, options
impo... | null | QAServer.py | QAServer.py | py | 1,879 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tornado.ioloop.web",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": ... |
113533385 | from django.shortcuts import render
from django.db.models import F, Count, Value
from website.models.product_model import ProductCategory
from website.models import Product
def list_product_categories(request):
"""
This function grabs the 3 most recent items added for each product
category.
---Argumen... | null | website/views/list_product_categories_view.py | list_product_categories_view.py | py | 2,400 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "website.models.product_model.ProductCategory.objects.all",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "website.models.product_model.ProductCategory.objects",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "website.models.product_model.P... |
554288099 | import json
from urllib.parse import urlencode
from urllib.parse import urljoin
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.http import HttpResponse
from django.http import HttpResponseBadRequest
from django.http import HttpResponseRedirect
from django.http... | null | shibboleth_discovery/views.py | views.py | py | 3,820 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.base.View",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.SHIB_DS_QUERY_PARAMETER",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 29,
"usage_type": ... |
544481084 | # -*- coding: utf-8 -*-
import json
import tornado
import tornado.web
import tornado.ioloop
import tornado.gen
from system_logic import setting
from system_logic.bo.object.User import User
from system_logic.bo.object.Manager import Manager
from system_logic.vo.method.DecodeJson import _decode_dict
class U... | null | system_logic/vo/LoginPartHandler.py | LoginPartHandler.py | py | 2,629 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tornado.web",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "system_logic.vo.method.DecodeJson._decode_dict",
"line_number": 36,
"usage_type": "call"
},
{
"api_na... |
9630474 | """
Discord Screenshot query bot for HCR2.
This is a discord bot for responding to queries regarding matching times that
are found from reading Screenshots of the leaderboard table.
"""
import os
import re
from discord import File, Embed
from discord.ext import commands
from dotenv import load_dotenv
... | null | SSQueryBot.py | SSQueryBot.py | py | 38,532 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
410815339 | """teachadvisor URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | null | test/src/voterable/urls.py | urls.py | py | 7,283 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 52,
"usage_type": "name"
},
{
"api_name... |
8370856 | from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py
from subprocess import call
short_desc = "API browser for proto based API definitions"
long_desc = "Protos are a great way to communicate APIs, even if not using the protobuf serilization format. " \
"... | null | setup.py | setup.py | py | 2,240 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.command.build_py.build_py",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "subprocess.call",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "setuptools.command.build_py.build_py.run",
"line_number": 37,
"usage_type": "call"
... |
112629273 | import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
import numpy as np
import altair as alt
import vega_datasets
alt.data_transformers.enable('default')
alt.data_transformers.disable_max_rows()
app = dash.Dash(__name__, assets_f... | null | app.py | app.py | py | 6,877 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "altair.data_transformers.enable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "altair.data_transformers",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "altair.data_transformers.disable_max_rows",
"line_number": 11,
"usage_type"... |
130488838 | from django.shortcuts import render, get_object_or_404, redirect
from .models import ElectronicPost
from .forms import ElectronicPostForm
# Create your views here.
def index(request):
electronicposts = ElectronicPost.objects.all
return render(request, 'electronic/index.html', {
'posts':electronicposts... | null | electronic/views.py | views.py | py | 1,582 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.ElectronicPost.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.ElectronicPost",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api... |
59156400 | #
# tokens_ws.py: A simple web service to use nltk to preprocess and get
# the tokens for a sentence.
#
# by George K. Thiruvathukal
# nltk example provided by Yu Cheng
#
from flask import Flask, jsonify, render_template, request
import nltk
import json
# This code is to setup the app container.
app = Flask(__name__... | null | experiments/tokens_ws.py | tokens_ws.py | py | 1,519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.accept_mimetypes.best_match",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.accept_mimetypes",
"line_number": 20,
"usage_type": "attribute"
},
... |
336268142 | import cv2
import os
import numpy as np
import time
os.chdir('/home/mukesh-deo/Downloads')
def draw_line(img,lines):
try:
i=1
for line in lines:
for i in range(0,len(line)):
coord=line[i]
cv2.line(img,(coord[0],co... | null | cv2_test2.py | cv2_test2.py | py | 1,130 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.line",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number":... |
340768894 | ## Copyright (c) 2012, 2013 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
import os
import subprocess
import pytest
import qibuild
import qibuild.gdb
from qibuild.test.test_toc import TestToc
def run_gdb(base_dir):
... | null | python/qibuild/test/test_gdb.py | test_gdb.py | py | 2,174 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
447532303 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.http import Http404
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from ... | null | social_media_analytics/social_media_analytics_app/views_from_git_ur_done.py | views_from_git_ur_done.py | py | 3,602 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "django.shortcuts.render",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "... |
607939819 |
"""进程间通信之队列Queue"""
"""
如果想要实现进程之间的通信,队列是常见的实现方式之一。
本节示例使用的队列是Queue。
《图解Python》
"""
from multiprocessing import Process, Queue
import os, time, random
# 写数据的子进程执行的代码
def write(q):
print('写数据的子进程%d启动' % os.getpid())
for obj in list(range(1, 10)):
print('写数据:%s' % obj)
q.put(obj, T... | null | 17_process_thread/48_2_multiprocess_queque.py | 48_2_multiprocess_queque.py | py | 1,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getpid",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 38,
... |
228977749 | import datetime
import logging
from io import BytesIO
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import mm
from PyPDF2 import PdfFileWriter, PdfFileReader
import register_loan_contracts as app_root
logger = logging.getLogger('loan_contracts_www.custom')
DOC_... | null | loan_contracts/register_loan_contracts/createpdfs/id_card.py | id_card.py | py | 1,505 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "reportlab.pdfgen.canvas.Canvas",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "reportlab... |
489922044 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.shortcuts import HttpResponseRedirect,redirect
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class SimpleMiddleware(MiddlewareMixin):
def process_request(self, request):
i... | null | RecruitmentSystem/Recruitment/middleware.py | middleware.py | py | 447 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 15,
"usage_ty... |
271583192 | import pandas as pd
from sklearn.svm import SVC
from sklearn.metrics import classification_report
def gen_result(path_train, path_test, test_size, layer):
data = pd.read_csv(path_train)
X_train = data.drop(['Feature 1', 'width', 'height', 'image', 'image name', 'size', 'Selected'], axis=1)
y_train = data[... | null | classification.py | classification.py | py | 852 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 17,
"usage_type": "call"
}
] |
325112426 | """
Домашнее задание №1
Использование библиотек: ephem
* Установите модуль ephem
* Добавьте в бота команду /planet, которая будет принимать на вход
название планеты на английском, например /planet Mars
* В функции-обработчике команды из update.message.text получите
название планеты (подсказка: используйте .split(... | null | 8_ephem_bot.py | 8_ephem_bot.py | py | 4,218 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "difflib.get_close_matches",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "datet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.