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
603320762
import yaml from src.loop_list.loop_list import LoopList CACHE_PATH = "resources/cache.yml" CACHE_TEMPLATE_PATH = "resources/cache.yml.template" class GystCache(): Inst = None def __init__(self, *args, **kwargs): if GystCache.Inst is not None: return cache_content = readCache() ...
null
src/gyst_cache/gyst_cache.py
gyst_cache.py
py
1,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.loop_list.loop_list.LoopList.SafeLoad", "line_number": 27, "usage_type": "call" }, { "api_name": "src.loop_list.loop_list.LoopList", "line_number": 27, "usage_type": "name" }, { "api_name": "yaml.load", "line_number": 56, "usage_type": "call" }, { ...
616435004
""" Base function for "stirring" a single word and a whole text. """ import random from typing import List import regex def _process_word(word: str) -> str: """Randomize letter order in word leaving first and last letters in place. Parameters ---------- word : str Normal word Returns ...
null
wordstirr/wordstirr.py
wordstirr.py
py
1,116
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.shuffle", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "regex.split", "line_number": 49, "usage_type": "call" } ]
288910478
import cms import sys import os import datetime from datetime import timedelta yest = datetime.date.today() - timedelta(1) cms_call = cms.test() def data_disk_util_status(path,filename): with open(path + '\\df_h.txt', 'a+') as fw: data_disk_space = cms_call.data_pars(path+'\\'+filename, '--df...
null
firstone/lcs_healthcheck.py
lcs_healthcheck.py
py
2,538
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 8, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "cms.test", ...
360411131
from __future__ import print_function, unicode_literals from PyInquirer import style_from_dict, Token, prompt import stock_quote_data import requests import pandas import csv import os auth_token = stock_quote_data.auth_token def search_companies(company_name, token): # extract answer string from dict returned b...
null
stock_quote_cli.py
stock_quote_cli.py
py
5,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "stock_quote_data.auth_token", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.ConnectionError", "line_number": 28, "usage_type": "attribute" }, { "api_na...
289292462
import twitter import os import text_analyzer # get auth from Twitter CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY') CONSUMER_SECRET = os.environ.get('TWITTER_CONSUMER_SECRET') ACCESS_TOKEN = os.environ.get('TWITTER_ACCESS_TOKEN') ACCESS_TOKEN_SECRET = os.environ.get('TWITTER_ACCESS_TOKEN_SECRET') api = twitt...
null
data_grabber.py
data_grabber.py
py
935
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
228981801
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 23 14:09:21 2020 @author: jacobfaibussowitsch """ import os import requests imDir = os.path.join("..", "_static", "images") ownerURL = "https://gitlab.com/api/v4/groups/petsc/members/all" integratorURL = "https://gitlab.com/api/v4/groups/5583565/m...
null
src/docs/sphinx_docs/genteamtable.py
genteamtable.py
py
10,611
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
367921451
from matplotlib import pyplot as plt from matplotlib import pylab as pylab #from skimage import data, img_as_float, img_as_ubyte, exposure, io, color from skimage import * import cv2 import numpy as np def plothist(im, title=''): im = img_as_ubyte(im) pylab.hist(np.array(im).ravel(), bins=256, range=(0,256)) ...
null
scripts/May/bottles.py
bottles.py
py
1,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pylab.hist", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pylab", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pylab.x...
384020007
# coding:utf-8 import sys import json from components.scroll_area import ScrollArea from View.playlist_interface.playlist_info_bar import PlaylistInfoBar from PyQt5.QtCore import Qt, pyqtSignal, QSize from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QWidget, QListWidget, QListWidgetItem, QVBoxLayout, QAppli...
null
tests/test_collapsing_scroll_view.py
test_collapsing_scroll_view.py
py
2,644
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QListWidget", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.ScrollBarAlwaysOff", "line_number": 16, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 16, "usage_type": "name" }, { ...
257476840
import pickle as pkl import pandas as pd import matplotlib.pyplot as plt import numpy as np import os os.environ['KMP_DUPLICATE_LIB_OK']='True' def optim_plot(cur_code): import FX_DATA_GEN as DG cntry = DG.Get_country_name(cur_code) path = './log/%s/CLXAMSGrad_LSTMClx_bs{32}_lr{1.0e-05}_eps{1.0e-03}_ech{40...
null
THEO_POULA_Plot.py
THEO_POULA_Plot.py
py
7,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "FX_DATA_GEN.Get_country_name", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.load",...
483541394
#coding: utf-8 import sys import checkin import pyinotify import utils config = utils.Configuration.from_env() mask = pyinotify.IN_CLOSE_WRITE class EventHandler(pyinotify.ProcessEvent): def process_IN_CLOSE_WRITE(self, event): attempt = checkin.get_attempt(event.pathname) utils.send_message...
null
balaio/monitor.py
monitor.py
py
771
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.Configuration.from_env", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.Configuration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pyinotify.IN_CLOSE_WRITE", "line_number": 12, "usage_type": "attribute" }, { ...
243390417
#_*_ encoding:utf-8 _*_ import requests import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS url="https://api.github.com/search/repositories?q=language:python&sort=stars" r=requests.get(url) print("Status code:", r.status_code) #将API响应存储到一个文件中 response_dict=r.json() print("Total reposit...
null
book/pygal/python_repos_pygal.py
python_repos_pygal.py
py
1,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "pygal.style.LightenStyle", "line_number": 25, "usage_type": "call" }, { "api_name": "pygal.style.LightColorizedStyle", "line_number": 25, "usage_type": "name" }, { "api_name": "...
442901067
from scipy.io import loadmat import numpy as np import matplotlib.pyplot as plt def LoadData(): # load two class with 100 examples : # w1: (2, 100) # w2: (2, 100) a = loadmat('D:/w1x.mat') b = loadmat('D:/w1y.mat') c = loadmat('D:/w2x.mat') d = loadmat('D:/w2y.mat') x1 =...
null
FisherClassifer.py
FisherClassifer.py
py
2,113
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.loadmat", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.io.loadmat",...
107282640
from __future__ import absolute_import from __future__ import unicode_literals from unittest import TestCase import json from six.moves.urllib.parse import urlparse from os import environ as env import httmock from httmock import urlmatch from evesrp import create_app, db, init_app from evesrp.auth import AuthMethod fr...
null
tests_python/util_tests.py
util_tests.py
py
6,727
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 28, "usage_type": "name" }, { "api_name": "evesrp.create_app", "...
23523954
#! python3 # This script finds and prints out Email addresses and North American phone numbers from the clipboard import pyperclip, re # import the necessary modules - pyperclip and re - which will access the clipboard and compile regex pattern objects, respectively. phoneRegex = re.compile(r'''( ...
null
phone number and email address extractor/extractor.py
extractor.py
py
2,663
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.VERBOSE", "line_number": 13, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.VERBOSE", "line_number": ...
574846637
from urllib.parse import quote_plus from bs4 import BeautifulSoup from selenium import webdriver import time import random import dload searchStr = input('찾을 이미지 이름을 입력하세요:') baseUrl = 'https://search.daum.net/search?nil_suggest=btn&w=img&DA=SBC&q=' url = baseUrl + quote_plus(searchStr) #print(url) driv...
null
Python/WebCrawling/day4/day4/seleniumPart/snEx5.py
snEx5.py
py
731
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.parse.quote_plus", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "...
39676633
#!/usr/bin/env python # -*- coding: utf-8 -*- import pygame # biblioteka pygame potrzebna do stworzenia gry import random # biblioteka random potrzebna do losowej organizacji stones #!/usr/bin/env python # -*- coding: utf-8 -*- import ctypes import pygame import random import sys import math # klasa matemat...
null
Main.py
Main.py
py
41,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.image.load", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.transform.s...
420261822
import tensorflow as tf from tensorflow.contrib import slim from tensorflow.python.framework import ops from utils import tf_layer from utils import tf_utils from utils import custom_layers from utils import cfg_utils def lrelu(inputs): N, H, W, C = inputs.shape.as_list() para_shape = [C] alpha = slim.vari...
null
detection_for_voc/python/model/backbone/tpn_backbone.py
tpn_backbone.py
py
11,635
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.contrib.slim.variable", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.contrib.slim", "line_number": 12, "usage_type": "name" }, { "api_name": "tensorflow.constant_initializer", "line_number": 13, "usage_type": "call" }, ...
329722647
#!/usr/bin/python # -*- coding: utf8 -*- """ Взаимодействие с кнопками """ import random import os import datetime from time import sleep from itertools import islice import requests from telebot import apihelper from bs4 import BeautifulSoup from bs4 import BeautifulSoup as bs import pickle from config import bot...
null
plugins/callback.py
callback.py
py
53,842
python
en
code
null
code-starcoder2
76
[ { "api_name": "plugins.crocodile.crocodile.__annotations__", "line_number": 43, "usage_type": "attribute" }, { "api_name": "plugins.crocodile.crocodile", "line_number": 43, "usage_type": "name" }, { "api_name": "plugins.crocodile.crocodile.__annotations__", "line_number": 45,...
315672309
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt def sinussh(x): k=0 a=x/2 s= a while k < 500: k+=1 R =x*x/(2*k*(2*k+1)*4) a = a * R s = s + a return s x = np.arange(-7.5,7.5,0.1) y = sinussh(x) plt.plot(x, y) plt.show()
null
PYTHON/sinhx_caur_summu_zimesana.py
sinhx_caur_summu_zimesana.py
py
265
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
291142490
import requests as Req url_padrao = "http://127.0.0.1:5000" def TesteCreateTipoAtendimento(nome, preco, qtdRetorno): url = url_padrao + "/tipo-atendimento/cadastrar" tipoAtendimento = { "nome" : nome, "preco" : preco, "qtdRetorno" : qtdRetorno } Dados = Req.api.post(url, js...
null
Teste/testeTipoAtendimento.py
testeTipoAtendimento.py
py
1,153
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.api.post", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.api", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests.api.get", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.api", ...
389684804
"""This is define model for projects app.""" from django.db import models import uuid import os from django.conf import settings # import third-party from django_extensions.db.models import TimeStampedModel from imagekit.models import ProcessedImageField # import from apps from apps.accounts.models import User def...
null
apps/projects/models.py
models.py
py
9,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.conf.settings.FILE_UPLOAD...
386331195
from functools import partial from threading import Thread from enum import IntEnum from aspyrobotmx.codes import (HolderType, PortState, RobotStatus, DumbbellState, SampleState, PortState) from dcss import Server as DHS SAMPLES_PER_POSITION = 96 HOLDER_TYPE_MAP = { HolderType.unk...
null
pyrobotdhs/dhs.py
dhs.py
py
27,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "aspyrobotmx.codes.HolderType.unknown", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aspyrobotmx.codes.HolderType", "line_number": 13, "usage_type": "name" }, { "api_name": "aspyrobotmx.codes.HolderType.normal", "line_number": 14, "usage_ty...
114261015
import subprocess import cv2 import numpy as np from keras.models import load_model windowName = "Live Camera Input" # window name cv2.namedWindow(windowName, cv2.WINDOW_NORMAL) model = load_model('Hand_Gesture_Recognize.h5') gesture = { 0: "Left hand up", 1: "Hands down", 2: "Right ha...
null
__main__.py
__main__.py
py
2,439
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.namedWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NORMAL", "line_number": 9, "usage_type": "attribute" }, { "api_name": "keras.models.load_model", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.resi...
627465730
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Basic example for a bot that uses inline keyboards. # This program is dedicated to the public domain under the CC0 license. import logging from telegram import InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup from telegram.ext import Upda...
null
inline.py
inline.py
py
11,045
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "telegram.InlineKeyboardButton", "line_number": 16, "usage_type": "call" }, { "api_name": "t...
205419030
from django.shortcuts import render # Create your views here. from rest_framework import mixins, generics from address.models import Address from address.serializers import AddressSerializers class AddressListView(mixins.ListModelMixin, mixins.CreateModelMixin, mixins.Upd...
null
address/views.py
views.py
py
1,531
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.mixins.ListModelMixin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.mixins", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework.mixins.CreateModelMixin", "line_number": 11, "usage_type":...
75751095
from uuid import UUID from furl import furl from rest_framework import status from rest_framework.reverse import reverse as drf_reverse from . import BaseAPITestCase class ArtistTests(BaseAPITestCase): def setUp(self): self.artist_name = "Pearl Jam" self.artist_uuid = UUID("9e52205f-9927-4eff-b1...
null
grunge/tests/test_artists.py
test_artists.py
py
1,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.UUID", "line_number": 13, "usage_type": "call" }, { "api_name": "rest_framework.reverse.reverse", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_200_OK", "line_number": 18, "usage_type": "attribute" }, { "a...
18998105
#Enumerating Oriented Gene Orderings #SIGN """Given: A positive integer n≤6. Return: The total number of signed permutations of length n, followed by a list of all such permutations (you may list the signed permutations in any order).""" from itertools import permutations n = 5 #given L = list(range(-n,n+1)) L.remo...
null
bio_stronghold/sign.py
sign.py
py
671
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.permutations", "line_number": 13, "usage_type": "call" } ]
278265155
from django import forms from newUnit.choices import * from newUnit.models import Rating, Review, Unit class LowerCharField(forms.CharField): """Convert Charfield string to lowercase""" def to_python(self, value): return value.lower() class UnitDetailsForm(forms.ModelForm): faculty = forms.Choi...
null
newUnit/forms.py
forms.py
py
1,796
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.CharField", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 13, "usage_type": "attribute" }, { "api_name": "dj...
176910227
from keras.optimizers import Adam, SGD, RMSprop from keras.applications.inception_v3 import InceptionV3, preprocess_input from keras.preprocessing import image from keras.models import Model from keras.layers import Flatten from keras.layers import Dense, GlobalAveragePooling2D from keras import backend as K from keras...
null
week4/cnn_augm_hs.py
cnn_augm_hs.py
py
5,822
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.applications.inception_v3.InceptionV3", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.layers.GlobalAveragePooling2D", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 36, "usage_type": "ca...
298094595
import pygame from src.scene import Scene class GameOverScene(Scene): def __init__(self, game): super().__init__(game) # Game Over Title self.font = pygame.font.Font("assets/font/Silver.ttf", 192) self.title_image = self.font.render("T'as perdu, t'es nul.", False, (0, 0, 0)) ...
null
src/scenes/gameover.py
gameover.py
py
1,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.scene.Scene", "line_number": 5, "usage_type": "name" }, { "api_name": "pygame.font.Font", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.image.load", ...
597330358
#!/usr/bin/env python3 """ Author : seabney Date : 2020-04-22 Purpose: Win in Vegas """ import argparse import os import re import sys from typing import List, NamedTuple, Optional class State(NamedTuple): player: str = 'Babbit' runningcount: int = 0 quit: bool = False error: Optional[str] = None ...
null
assignments/project/kyc.py
kyc.py
py
3,696
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.NamedTuple", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 20, "usage_type": "name" }, { "api_name": "argparse.ArgumentPa...
124485209
from braces.views import LoginRequiredMixin from django.http import Http404 from django.shortcuts import redirect from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.views import View from django.views.generic import ( ListView, DetailView, CreateView, UpdateView, Tem...
null
articles/views.py
views.py
py
3,966
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.ListView", "line_number": 21, "usage_type": "name" }, { "api_name": "models.Article", "line_number": 25, "usage_type": "name" }, { "api_name": "models.Article.published.order_by", "line_number": 33, "usage_type": "call" }, { "ap...
271912864
from featureflow import Node, Feature, Decoder from timeseries import \ ConstantRateTimeSeries, ConstantRateTimeSeriesMetadata from samplerate import AudioSampleRate, audio_sample_rate import numpy as np from duration import Seconds from soundfile import SoundFile from io import BytesIO class AudioSamples(Constan...
null
zounds/timeseries/audiosamples.py
audiosamples.py
py
3,537
python
en
code
null
code-starcoder2
76
[ { "api_name": "timeseries.ConstantRateTimeSeries", "line_number": 11, "usage_type": "name" }, { "api_name": "samplerate.AudioSampleRate", "line_number": 13, "usage_type": "argument" }, { "api_name": "timeseries.ConstantRateTimeSeries.__new__", "line_number": 15, "usage_ty...
225609577
import numpy as np import matplotlib.pyplot as plt import tsplib95 import plotTSP def get_best_path(filename, tsp_name): file = open(filename, "r") lines = file.readlines() file.close() final_path_len = list() path_lengths = [line.split("], [")[2] for line in lines] for pl in p...
null
Implementation/plot_best_path.py
plot_best_path.py
py
1,223
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "tsplib95.load", "line_number": 22, "usage_type": "call" }, { "api_name": "tsplib95.load", "line_numbe...
544981397
from django.shortcuts import render, redirect, HttpResponse from django.http import JsonResponse import json import datetime from .models import * from .utils import cookieCart, cartData, guestOrder from django.contrib.auth.models import User from store.forms import RegistrationForm, EditProfileForm, LoginForm from d...
null
shop/store/views.py
views.py
py
5,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.cartData", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.cartData", "line_number": 29, "usage_type": "call" }, { "api_name": "django.shortcut...
108837321
#coding:utf-8 """ ID: gtcs.ref_integ_drop_pk_constraint TITLE: Constraint of PRIMARY KEY should not be avail for DROP if there is FK that depends on it DESCRIPTION: Original test see in: https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/REF_INT.2.ISQL.script FBTEST: functional.gtcs.re...
null
tests/functional/gtcs/test_ref_integ_drop_pk_constraint.py
test_ref_integ_drop_pk_constraint.py
py
1,575
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.linesep.join", "line_number": 51, "usage_type": "call" }, { "api_name": "os.linesep", "line_number": 51, "usage_type": "attribute" }, { "api_name": "pytest.mark.version", "line_number": 37, "usage_type": "call" }, { "api_name": "pytest.mark", ...
494541970
from flask import Flask, render_template, request import requests import subprocess from werkzeug.utils import secure_filename import os, os.path from poparse import get_file app = Flask(__name__) UPLOAD_FOLDER = "/data" app.config["UPLOAD_FOLDER"] = UPLOAD_FOLDER if not os.path.isdir("/data"): os.mkdir("/data") @ap...
null
poparse/app.py
app.py
py
755
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 1...
555056213
from checkers import game import numpy as np from functools import reduce from math import ceil import random BOARD_SIZE = 8 HUMAN = 'human' AGENT = 'agent' class Gameplay(object): @staticmethod def calc_col(pos, row_width, row): return (2*(pos - 1 - row*row_width)) + ((row+1) % 2) @staticmetho...
null
python_applications/Q_checkers/utils/gameplay.py
gameplay.py
py
8,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.ceil", "line_number": 20, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
524852486
import psycopg2 from scrapy.utils.project import get_project_settings from .helpers import list_to_string settings = get_project_settings() class NewsPipeline(object): def open_spider(self, spider): self.connection = psycopg2.connect(host=settings.get('DB_HOST'), ...
null
news_parser/pipelines.py
pipelines.py
py
2,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 5, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "helpers.list_to_string", "line_number": 45, "usage_type": "call" }, { "...
586239732
from functools import cmp_to_key def solution(numbers): numbers = list(map(lambda x: str(x), numbers)) numbers = sorted(numbers, key=cmp_to_key(lambda a, b: -1 if a+b >= b+a else 1)) print(numbers) answer = ''.join(numbers) return str(int(answer)) numbers = [6, 10, 2] answer = solution(numbers) p...
null
Python/progrmmers/정렬_가장큰수.py
정렬_가장큰수.py
py
748
python
en
code
null
code-starcoder2
76
[ { "api_name": "functools.cmp_to_key", "line_number": 5, "usage_type": "call" } ]
316210577
from __future__ import absolute_import from sklearn.datasets import make_moons from sklearn.model_selection import train_test_split from src.algorithms import * from src import neural_network import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import argparse def get_args(): """ Read inp...
null
subsampled_DSGD/make_moon_classification.py
make_moon_classification.py
py
2,963
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 48, "usage_type": "call" }, { "api_name": "sklearn.datasets.make_moons", "line_number": 53, "usage_type": "call" }, { "api_name": "sklearn...
265224985
""" @file @brief Simple wrapper for `treant-js <http://fperucic.github.io/treant-js/>`_. """ _template_html = """ <style> __STYLE__ </style> <link rel="stylesheet" href="http://fperucic.github.io/treant-js/Treant.css"> <script src="http://fperucic.github.io/treant-js/vendor/raphael.js"></script> <script src="http://f...
null
src/jupytalk/talk_examples/treant_wrapper.py
treant_wrapper.py
py
1,794
python
en
code
null
code-starcoder2
76
[ { "api_name": "IPython.core.display.HTML", "line_number": 54, "usage_type": "call" } ]
181388866
#!/usr/bin/env python # Script qui va chercher une adresse IP et # envoie un courriel si l'adresse a change # Jacques Faucher 2016-04-27 # socket : Pour la resolution de domaine import socket # smptlib et MIMEText pour le courriel import smtplib from email.mime.text import MIMEText # Retourne l'IP a partir d'un URL...
null
vyos_auto.py
vyos_auto.py
py
1,549
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.gethostbyname", "line_number": 16, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 35, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 39, "usage_type": "call" } ]
126511824
import pygame from TileClasses import * from Member import * orientations = {'nw': 5, 'no': 4, 'ne': 3, 'ea': 2, 'se': 1, 'so': 0, 'sw': 7, 'we': 6} class CombatEntity: def __init__(self, entity, coord, weapon): """ Gère le soldat au combat """ # On vérifie les paramètres if type(coord) !...
null
CombatEntity.py
CombatEntity.py
py
9,896
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.Rect", "line_number": 58, "usage_type": "call" }, { "api_name": "pygame.Rect", "line_number": 222, "usage_type": "call" } ]
469835717
# coding=utf-8 ''' DATE: 2020/09/01 AUTHOR: Yanxi Li ''' # P37-38 from flask import Flask, jsonify, request import json class XFFMiddleware: def __init__(self, app, real_ip='1.1.1.1'): # 1.1.1.1 is a invalid ip, set it just for debug self.app = app self.real_ip = real_ip def __call_...
null
microservices/flask_middleware.py
flask_middleware.py
py
1,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.request.headers", "line_number": 33, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 33, "usage_type": "name" }, { "api_name": "flask.request.he...
26137484
from rest_framework import viewsets, generics from rest_framework.filters import DjangoFilterBackend from django_filters import FilterSet from .models import NewsPost, ArchivePost from .serializers import NewsSerializer, ArchiveSerializer class NewsFilter(FilterSet): class Meta: model = NewsPost ...
null
apps/news/views.py
views.py
py
1,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "django_filters.FilterSet", "line_number": 9, "usage_type": "name" }, { "api_name": "models.NewsPost", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.viewsets.ReadOnlyModelViewSet", "line_number": 17, "usage_type": "attribute" }, ...
125644832
from __future__ import print_function import sys, os.path, glob, json import cv2, numpy as np import caffe from fast_rcnn.config import cfg from fast_rcnn.test import im_detect from fast_rcnn.nms_wrapper import nms gpu_id = int(sys.argv[1]) vgg16_net = 'models/rcnn/vgg16_faster_rcnn_iter_80000.caffemodel' prototxt = ...
null
scripts/face_extraction.py
face_extraction.py
py
3,560
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "fast_rcnn.config.cfg.GPU_ID", "line_number": 13, "usage_type": "attribute" }, { "api_name": "fast_rcnn.config.cfg", "line_number": 13, "usage_type": "name" }, { "api_name": "fa...
387827687
# aln_stats has functions # Should raise warning when there are empty comparisons # should avoid capitalizing sequences #------------------------------------------------------------ import sys, os, re import pandas as pd from itertools import combinations from utils import get_file_paths_from_dir, substring_delim, cds...
null
200423_aln_stats/get_aln_stats_from_aln_dir.py
get_aln_stats_from_aln_dir.py
py
6,082
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "utils.cds_to_dict", "line_number": 45, "usage_type": "call" }, { "api_name": "utils.map_dict_vals", ...
389204456
# -*- coding: utf-8 -*- import unittest from datetime import datetime from unittest.mock import call from uuid import uuid4, UUID from mock import patch, MagicMock from alamo_worker.alerter.backend.cassandra import ( CassandraDriver, SELECT_QUERY, INSERT_QUERY, INSERT_SERVICE_QUERY, AsyncCassandraDriver ) fro...
null
alamo_worker/alerter/tests/test_cassandra_backend.py
test_cassandra_backend.py
py
4,102
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", "line_number": 20, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 21, "usage_type": "call" }, { "api_name": "mock.MagicMock", "li...
521237780
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Object mapper modal.""" from lib import base from lib.page.modal import search_modal_elements class ObjectMapper(base.WithBrowser): """Object mapper modal.""" # pylint: disable=too-few-public-methods...
null
test/selenium/src/lib/page/modal/object_mapper.py
object_mapper.py
py
850
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.base.WithBrowser", "line_number": 8, "usage_type": "attribute" }, { "api_name": "lib.base", "line_number": 8, "usage_type": "name" }, { "api_name": "lib.page.modal.search_modal_elements.SearchFilterArea", "line_number": 15, "usage_type": "call" }, {...
171583397
# -*- coding: utf-8 -*- from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.urls import reverse, NoReverseMatch from django.core.cache import cache from django.utils.translation import ugettext_lazy as _ from django.db ...
null
catalog/models.py
models.py
py
4,165
python
en
code
null
code-starcoder2
76
[ { "api_name": "mptt.models.MPTTModel", "line_number": 16, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 19, "usage_type": "c...
398533225
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Yue Wang @Contact: yuewangx@mit.edu @File: model.py @Time: 2018/10/13 6:35 PM """ import os import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F def knn(x, k): inner = -2*torch.matmul(x.transpose(2, 1), x) ...
null
dgcnn_pytorch/model.py
model.py
py
5,188
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.matmul", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.cat", "line_number": 34...
595177174
import django_tables2 as django_tables from utilizadores.models import Administrador, Utilizador from django.utils.html import format_html from django.urls import reverse class UtilizadoresTable(django_tables.Table): nome = django_tables.Column( empty_values=(), order_by=("first_name", "last_name")) ...
null
src/Utilizadores/tables_old.py
tables_old.py
py
6,910
python
en
code
null
code-starcoder2
76
[ { "api_name": "django_tables2.Table", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django_tables2.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "django_tables2.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "d...
212768269
import sys import numpy as np from time import sleep from timeit import default_timer as timer from SLSE import SLSE from utils.link_funcs import PolynLink, LogisticLink, LogexpLink from utils.data_gen import gen_slcnr_obj # n_samples_range = [50000, 100000, 150000, 200000, 250000, 300000] n_samples_range = [100000, 2...
null
SLSE-develop/exp_aaai20_synthesized.py
exp_aaai20_synthesized.py
py
9,749
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.link_funcs.PolynLink", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.link_funcs.PolynLink", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.link_funcs.PolynLink", "line_number": 19, "usage_type": "call" }, { "...
372219420
import scrapy class QuotesSpider(scrapy.Spider): name = "quotes" def start_requests(self): urls = [ 'http://quotes.toscrape.com/page/1/', 'http://quotes.toscrape.com/page/2/', ] for url in urls: yield scrapy.Request(url=url, callback=self....
null
klse/klse/spiders/quotes_spider.py
quotes_spider.py
py
741
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 3, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 12, "usage_type": "call" } ]
61763015
import glob import os import pathlib import sys import numpy as np sys.path.append('../../../') from util import env, make_dirs dataset = 'scannet' param ='-o 0.7 -d 0.01 -t 1000 -n 200' def main(): data_path = env() PATH_MODEL='%s/processed_dataset/{}/{}/' % data_path PATH_RELATIVE = '%s/relative_pose/...
null
src/relative_pose_estimation/super4pcs/generate_tasks.py
generate_tasks.py
py
1,761
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "util.env", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.normpath", "line_num...
146716833
import matplotlib.pyplot as plt import numpy as np import pandas as pd # Perform confusion matrix statistical tests on the output summary.csv # Output the file to peakerror/confusion/confusion.csv f = snakemake.input o = snakemake.output df = pd.DataFrame.from_csv(f, sep="\t") # Convert the csv to a DataFrame df["...
null
dm6/wrappers/confusion/wrapper.py
wrapper.py
py
1,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame.from_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame.to_csv", "line_number": 25, "usage_type": "call" }, { "api_name"...
337026814
__author__ = 'linmichaelj' import urllib2 import helper from bs4 import BeautifulSoup from selenium import webdriver #requires html5lib def get_soup(url, selenium): if selenium: driver = webdriver.Firefox() driver.get(url) data = driver.page_source else: usock = urllib2.urlope...
null
webparser.py
webparser.py
py
4,999
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "urllib2.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.Bea...
227793255
#%% import numpy as np import sys import os import matplotlib.pyplot as plt import datetime tstart = datetime.datetime.now() seed = sys.argv[1] seed = float(seed) seed = int(seed) target = sys.argv[2] target = float(target) target = int(target) np.random.seed(seed) print(seed) # PARAMETERS # --------------------...
null
figS1/code/place_cells.py
place_cells.py
py
10,457
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
532493382
from datetime import datetime from os import scandir def convert_date(timestamp): d = datetime.utcfromtimestamp(timestamp) formated_date = d.strftime('%d %b %Y') return formated_date def get_files(): dir_entries = scandir('/') for entry in dir_entries: if entry.is_file(): ...
null
examples/file/convertutc.py
convertutc.py
py
446
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "name" }, { "api_name": "os.scandir", "line_number": 10, "usage_type": "call" } ]
565332913
#!/usr/bin/env python import pytz from datetime import time from tasklib.task import Task LOCALTZ = pytz.timezone('America/Los_Angeles') # Your timezone DEFAULT_TIME = time(20,0,0) # Your wanted default time def is_local_midnight(timestamp): return timestamp.astimezone(LOCALTZ).time() == time(0,0,0) def set_de...
null
task/hooks/on-add-default-time.py
on-add-default-time.py
py
765
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytz.timezone", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.time", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.time", "line_number": 10, "usage_type": "call" }, { "api_name": "tasklib.task.Task.from_input"...
228478820
#!/usr/bin/env python3 from argparse import ArgumentParser import parsedatetime import time cal = parsedatetime.Calendar() def maybe_one_string(args): dt, parsed = cal.parse(' '.join(args)) if parsed: return dt return None def main(fmt, datestrs): dt = maybe_one_string(datestrs) if dt: ...
null
bin/dateparse.py
dateparse.py
py
806
python
en
code
null
code-starcoder2
76
[ { "api_name": "parsedatetime.Calendar", "line_number": 6, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 17, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.ArgumentPa...
182061425
from http.server import BaseHTTPRequestHandler, HTTPServer import time import urllib.parse import pytz from datetime import datetime hostName = "localhost" serverPort = 8000 class Server(BaseHTTPRequestHandler): def do_GET(self): if self.path.startswith('/city/'): self.get_city_info() ...
null
script.py
script.py
py
7,845
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 11, "usage_type": "name" }, { "api_name": "urllib.parse.parse.unquote", "line_number": 107, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 107, "usage_type": "attribute" }, ...
466695800
from ..kern import WEBKernel from gp_grief.models import BaseModel # numpy/scipy stuff import numpy as np # development stuff from logging import getLogger from warnings import warn logger = getLogger(__name__) class GPwebTransformedModel (BaseModel): """ GP with weighted basis function kernel (WEB) with...
null
gp_grief/models/gp_web_transformed_model.py
gp_web_transformed_model.py
py
4,786
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "gp_grief.models.BaseModel", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.linalg.svd", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.li...
620269851
"""Provide different loss or metrics classes for labels.""" from typing import List, Optional import tensorflow as tf from deepreg.loss.util import NegativeLossMixin, cauchy_kernel1d from deepreg.loss.util import gaussian_kernel1d_sigma as gaussian_kernel1d from deepreg.loss.util import separable_filter from deepreg...
null
deepreg/loss/label.py
label.py
py
12,472
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.backend.epsilon", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 15, "usage_type": "attribute" }, { "api_...
620009657
import tensorflow as tf from tensorflow.python import keras import networkx as nx class WeightedSum(keras.layers.Layer): def __init__(self, kernel_regularizer=None, **kwargs): self.kernel_regularizer = kernel_regularizer self.aggregate_w = None super(WeightedSum, self).__init__(**kwargs) ...
null
randnet/model/layers.py
layers.py
py
9,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.python.keras.layers", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tensorflow.python.keras", "line_number": 6, "usage_type": "name" }, { "api_name": "tensorflow.TensorShape", "line_number": 19, "usage_type": "call" }, { "...
563205148
from pygame.locals import * from personnage import * from map import * title = "The Labyrinth" image_icone = "image/Labyrinthe.jpg" image_intro = "image/Labyrinthe.jpg" map_path = "Map/Map1.txt" pygame.mixer.init(44100, -16, 2, 2048) pygame.init() nb_case = 25 case_width = 30 window = pygame.display.set_mode((nb_c...
null
labyrinthe.py
labyrinthe.py
py
1,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.locals.mixer.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.locals.mixer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.locals", "line_number": 11, "usage_type": "name" }, { "api_name": "pygam...
495778098
# -*- coding: UTF-8 -*- #!/usr/bin/python3 """ @Author Yi Zhu Upated 31/05/2018 The code is borrowed from https://github.com/Adoni/word2vec_pytorch/ https://github.com/ray1007/pytorch-word2vec/ """ #************************************************************ # Imported Libraries #**********************************...
null
code/w2v/mul_word2vec.py
mul_word2vec.py
py
3,458
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random", "l...
372155343
from __future__ import absolute_import import os import uuid try: import six.moves.urllib.parse except ImportError: from urllib.parse import urlparse import logging from functools import wraps from django.conf import settings from django.core import exceptions from django.http import HttpResponsePermanentRedi...
null
tikibar/utils.py
utils.py
py
9,658
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings.TIKIBAR_SETTINGS.get", "line_number": 79, "usage_type": "call" }, { "api_name": "django.conf.settings.TIKIBAR_SETTINGS", "line_number": 79, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 79, "usage_typ...
525387754
# coding:utf-8 from django.conf.urls import patterns, include, url from .views import list_artists, save_artist, list_albuns, list_songs, index, remove_artist urlpatterns = patterns('', # Artist url(r'^artists/save/(\d+)', save_artist, name='save_artist'), url(r'^artists/remove/(\d+)', remove_artist, name='remov...
null
catalogo/catalogo/music/urls.py
urls.py
py
568
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.save_artist", "line_number": 10, "usage_type": "argument" }, { "api_name": "d...
22604167
import matplotlib.pyplot as plt import sys,os,csv,argparse def plotPercNUsr(fileusr1,fileusr2,fileusr3,fileusr4,fileout): #remove header fileusr1.readline() fileusr2.readline() fileusr3.readline() fileusr4.readline() lusr1 = list(csv.reader(fileusr1,delimiter=',')) lusr2 = list(csv.reader...
null
version_20160401.dir/study_period_2_weeks_1_week_ovlerap.dir/catvectors/plotNbUsrsPercentagesOneCat.py
plotNbUsrsPercentagesOneCat.py
py
3,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 15, ...
50717543
""" This module defines the CustomQueryPredictiveObject class that allows wrapping of one or many GraphLab Create data structures and additional functionality within a predictive object, which can be deployed into a Predictive Service. """ import logging import types as _types from _predictive_object import Predictive...
null
ML_coursera/graphlab/lib/python2.7/site-packages/graphlab/deploy/_predictive_service/_custom_query_predictive_object.py
_custom_query_predictive_object.py
py
3,247
python
en
code
null
code-starcoder2
76
[ { "api_name": "_predictive_object.PredictiveObject", "line_number": 12, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 63, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 69, "usage_type": "call" }, { "api_name": "types.F...
30934520
import oauth2 as oauth import utils from api import Api from user_api_queryset import UserApiQueryset class UserApi(Api): '''Api abstraction specific to a given user, using his tokens ''' URL_ENDPOINT = { 'people': '/v1/people', 'people_search': '/v1/people-search', 'groups': '/v...
null
pylinkedin/user_api.py
user_api.py
py
2,516
python
en
code
null
code-starcoder2
76
[ { "api_name": "api.Api", "line_number": 8, "usage_type": "name" }, { "api_name": "api.Api.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "api.Api", "line_number": 24, "usage_type": "name" }, { "api_name": "oauth2.Token", "line_number": 26,...
48257803
"""Application container - manages a list of available tasks to execute (all imported) """ import os import sys from datetime import datetime from typing import Dict, List, Union, Tuple from importlib.machinery import SourceFileLoader from traceback import print_exc from rkd import env from .api.syntax import TaskDe...
null
rkd/context.py
context.py
py
10,859
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 30, "usage_type": "call" }, { "api_name": "api.contract.ContextInt...
333079426
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Ticket', fields=[ ('id', models.AutoField(verbo...
null
railwaydescapp/migrations/0001_initial.py
0001_initial.py
py
1,455
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.CreateModel", "line_number": 13, "usage_type": "call" }, ...
135226767
# Trainer for Total3D. # author: ynie # date: Feb, 2020 from models.training import BaseTrainer import torch import numpy as np import os from net_utils import visualization as vis from net_utils.ap_helper import parse_predictions, parse_groundtruths import imageio GT_VOTE_FACTOR = 3 # number of GT votes per point cla...
null
models/iscnet/training.py
training.py
py
9,259
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.training.BaseTrainer", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.no_grad", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "net_utils.ap_he...
138749501
#!/usr/bin/python # -*- coding: UTF-8 -*- # ********************************************************** # * Author : Weibin Meng # * Email : m_weibin@163.com # * Create time : 2018-10-07 22:58 # * Last modified : 2018-10-16 01:26 # * Filename : train_lstm.py # * Description : ''' ''' # *********...
null
train_lstm.py
train_lstm.py
py
4,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.reshape", "line_number": 96, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 97, "usage_type": "call" }, { "api_name": "keras.utils.np_utils.to_categorical", "line_number": 101, "usage_type": "call" }, { "api_name": "kera...
491605128
from numpy import array from keras.models import Sequential from keras.layers import Dense, LSTM, SimpleRNN from keras.callbacks import EarlyStopping from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import StandardScaler early = EarlyStopping...
null
keras/keras30_simpleRNN2_scale.py
keras30_simpleRNN2_scale.py
py
2,463
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.callbacks.EarlyStopping", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 10, "usage_type": "c...
579559758
#!/usr/bin/python # #!/usr/bin/python3 import argparse from datetime import datetime from inputs import kwargs import logging import os import psycopg2 import requests import sys class Hubspot: '''Hubspot class that takes in Hubspot URL and has methods that retrieve/store data''' # set up a logfile for t...
null
hubspot.py
hubspot.py
py
10,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 20, "usage_type": "attribute" }, { "api_name": "inputs.kwargs", "line_number": 27, "usage_type": "argument" }, { "api_name": "inputs.kwarg...
80291883
import pygame, sys , os, src.level_rendering.wall_block from src.level_rendering.wall_block import wall_block class Player(): def __init__(self): pygame.init() self.next_move = pygame.time.get_ticks() + 100 # 100ms = 0.1s (janky stuff to throttle player movement) real_path = os.pa...
null
src/player/Player.py
Player.py
py
5,842
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.time.get_ticks", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", ...
95895829
import hashlib import math import operator from decimal import Decimal from vyper import ast as vy_ast from vyper.ast.validation import validate_call_args from vyper.context.types.abstract import ( ArrayValueAbstractType, BytesAbstractType, IntegerAbstractType, NumericAbstractType, ) from vyper.context...
null
vyper/functions/functions.py
functions.py
py
58,365
python
en
code
null
code-starcoder2
76
[ { "api_name": "vyper.ast.validation.validate_call_args", "line_number": 83, "usage_type": "call" }, { "api_name": "vyper.context.validation.utils.validate_expected_type", "line_number": 85, "usage_type": "call" }, { "api_name": "vyper.context.types.value.numeric.DecimalDefinition...
46518724
import numpy as np import matplotlib.pylab as plt from matplotlib.animation import FuncAnimation from matplotlib.colors import ListedColormap from matplotlib.colors import BoundaryNorm from copy import copy from time import time def sigmoid(x): return 1/(1 + np.exp(-x)) # Chaque cellule de l'automate contient un o...
null
LearningTest/automata.py
automata.py
py
4,932
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.exp", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.colors.ListedColormap", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.colors.BoundaryNorm", "line_number": 24, "usage_type": "call" }, { "api_nam...
113296606
from datetime import datetime from journeychurch.config import acs import requests class ACSConnection: """ ACS Connection class to use ACS Facility Scheduler REST API https://wiki.acstechnologies.com/display/DevCom/ACS+Facility+Scheduler+REST+API """ # ACS Facility Scheduler Site ID site_id ...
null
utils/acs/acs_connection.py
acs_connection.py
py
3,929
python
en
code
null
code-starcoder2
76
[ { "api_name": "journeychurch.config.acs", "line_number": 13, "usage_type": "name" }, { "api_name": "journeychurch.config.acs", "line_number": 16, "usage_type": "name" }, { "api_name": "journeychurch.config.acs", "line_number": 22, "usage_type": "name" }, { "api_na...
380826254
import time from functools import wraps from reconcile.status import RunningState from reconcile.utils.metrics import reconcile_time def elapsed_seconds_from_commit_metric(function): @wraps(function) def wrapper(*args, **kwargs): runing_state = RunningState() result = function(*args, **kwar...
null
reconcile/utils/qrtracking.py
qrtracking.py
py
672
python
en
code
null
code-starcoder2
76
[ { "api_name": "reconcile.status.RunningState", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "reconcile.utils.metrics.reconcile_time.labels", "line_number": 20, "usage_type": "call" }, { ...
457689074
import re from html2text import html2text from pprint import pprint class ParserBase(object): """ Parent class with common code for all flavors of Botocore parser """ def __init__(self, service, client_name): self.client_name = client_name self.service = service self.code = ""...
null
codegen/parserbase.py
parserbase.py
py
5,810
python
en
code
null
code-starcoder2
76
[ { "api_name": "html2text.html2text", "line_number": 39, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 40, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 41, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 161, ...
109413908
from django.conf import settings from django.urls import include, path from django.conf.urls.static import static from django.contrib import admin from django.views import defaults as default_views from tienda.users.views import (Indice,ListaProducto,DetalleProducto, ComentarioProducto,I...
null
config/urls.py
urls.py
py
2,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 17, "usage_type": "call" }, { "api_name": "tienda.users.views.Indice.as_view", "line_number": 17, "usage_type": "call" }, { "api_name": "tienda.users.views.Indice", "line_number": 17, "usage_type": "name" }, { "api_...
66582235
import networkx as nx import matplotlib.pyplot as plt import logging from logging import handlers import sys filename = "D:/PythonProjects/learnpytorch/vertices.txt" f = open(filename) lines = f.readlines() vertices = [] edges = [] edges_list = [] for line in lines: if ':' in str(line): edge = str(line).rep...
null
python_script_scp3.py
python_script_scp3.py
py
1,818
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.Graph", "line_number": 26, "usage_type": "call" }, { "api_name": "networkx.connected_components", "line_number": 31, "usage_type": "call" } ]
485855115
import numpy as np import cv2 import os def search(dirname): filenames = os.listdir(dirname) print('\n---------- npy lists ----------') cnt = 0 for filename in filenames: full_filename = os.path.join(dirname, filename) ext = os.path.splitext(full_filename)[-1] if ext == '.npy...
null
np_test.py
np_test.py
py
1,015
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_numb...
568495813
import pytest from api.models import CartItem from api.utils.models import save_to_db from ..model_factories.cart_item_factory import CartItemFactory @pytest.fixture def _cart_item(db, book, cart, customer, user): save_to_db(db, user) customer.user_id = user.id save_to_db(db, customer) cart.custome...
null
tests/model_tests/test_cart_item.py
test_cart_item.py
py
793
python
en
code
null
code-starcoder2
76
[ { "api_name": "api.utils.models.save_to_db", "line_number": 10, "usage_type": "call" }, { "api_name": "api.utils.models.save_to_db", "line_number": 13, "usage_type": "call" }, { "api_name": "api.utils.models.save_to_db", "line_number": 16, "usage_type": "call" }, { ...
635008096
#!/usr/bin/env python import logging import tornado.web import tornado.gen import tornado.escape import tornado.ioloop import tornado.httpserver from tornado.concurrent import Future from tornado.options import define, options, parse_command_line from tornado.log import app_log from sqlalchemy import create_engine f...
null
python/tornado/helloworld.py
helloworld.py
py
1,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sqlalchemy.c...
60794830
from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from .models import Post, Comment from .form import PostForm, CommentForm from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import au...
null
mysite/blog/views.py
views.py
py
3,446
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Post.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 10, "usage_type": "name" }, { "api_name": "django.u...
558019855
import os from setuptools import setup root = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(root, 'README.txt')) as f: README = f.read() setup( name = "multipserve", version = "1.0.4", author = "Mario Idival", author_email = "marioidival@gmail.com", description = ("Scrip...
null
setup.py
setup.py
py
852
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
204855400
import numpy as np import cv2 from utils import load_model def hsv_filter(frame): # hasv color space frame = cv2.GaussianBlur(frame,(5,5),30) hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range of blue color in HSV lower_skin = np.array([0,18,36], dtype=np.uint8) upper_skin = np.array(...
null
11-ClassificationProject/test.py
test.py
py
3,182
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.GaussianBlur", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "...
288097477
#!/usr/bin/python """ Small and simple example of parsing large xml files using SAX parsing in Python. """ import os import sys import logging import resource from lxml import etree from docopt import docopt from faker import Factory FAKE = Factory.create() LOG = logging.getLogger(__name__) XML_ENABLED_CLASSES = ...
null
metaclasses/metaclass_example.py
metaclass_example.py
py
5,341
python
en
code
null
code-starcoder2
76
[ { "api_name": "faker.Factory.create", "line_number": 18, "usage_type": "call" }, { "api_name": "faker.Factory", "line_number": 18, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "lxml.etree.Eleme...
608372956
import socket import sys import json from sys import argv import time import os from collections import namedtuple import threading import pickle Interface = namedtuple("Interface", "Interface_num IP port distance") number = 0 class router: localhost = '127.0.0.1' interface = [] # holds the table neighb...
null
router.py
router.py
py
6,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 24, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 25, "usage_type": "attribute" }, { "api_name": "socket.SOCK_...
480864918
from MSGG.pro_SG_pre import SG_pre from MSGG.SGraph import VocabLabel,Vocab from MSGG.datautils import read_pickle,load_SGraph import torch.nn as nn import torch filename='pdb_full' task='regression' label_std = 1.7216773344326362 label_mean = 6.243830971659918 data_root= 'data/' + filename + '/' model_root...
null
eva_model_pdb.py
eva_model_pdb.py
py
1,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "MSGG.SGraph.Vocab", "line_number": 14, "usage_type": "call" }, { "api_name": "MSGG.datautils.read_pickle", "line_number": 15, "usage_type": "call" }, { "api_name": "MSGG.SGraph.VocabLabel", "line_number": 16, "usage_type": "call" }, { "api_name": "M...
564306931
import enum import json import logging import operator import os import pathlib import pickle import pprint import random import shutil import traceback import typing import copy import pandas as pd # type: ignore from d3m.base import utils as d3m_utils from d3m.container.dataset import Dataset, D3MDatasetLoader from ...
null
python/dsbox/controller/controller.py
controller.py
py
86,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 42, "usage_type": "attribute" }, { "api_name": "dsbox.controller.config.DsboxConfig", "line_number": 61, "usage_type": "name" }, { "api_name": "dsbox.schema.SpecializedProblem.NONE", "line_number": 69, "usage_type": "attribute" ...
599736061
import pygame import Ship class PygView(object): def __init__(self, width=640, height=200, fps=60): """Initialize pygame, window, background, font,... """ pygame.init() pygame.display.set_caption("Press ESC to quit") self.width = width self.height = height #...
null
test.py
test.py
py
3,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display.set_caption", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.disp...
313318375
from typing import ClassVar, List, Optional, cast from cuenca_validations.types.enums import WebhookEvent from cuenca_validations.types.requests import ( EndpointRequest, EndpointUpdateRequest, ) from pydantic import HttpUrl from pydantic.dataclasses import dataclass from ..http import Session, session as glo...
null
cuenca/resources/endpoints.py
endpoints.py
py
1,978
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.Creatable", "line_number": 16, "usage_type": "name" }, { "api_name": "base.Deactivable", "line_number": 16, "usage_type": "name" }, { "api_name": "base.Retrievable", "line_number": 16, "usage_type": "name" }, { "api_name": "base.Queryable", ...
31611525
from django import forms from django.forms import widgets from django.core.exceptions import NON_FIELD_ERRORS,ValidationError from .models import * class RegisterForm(forms.Form): user = forms.CharField(min_length=5, help_text="6~16个字符,区分大小写", error_messages={...
null
mainfu/mytitle/Diy/forms.py
forms.py
py
2,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.forms"...