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
291405753
from django.core.management.base import BaseCommand from django_uwsgi import uwsgi class Command(BaseCommand): help = "Reloads uWSGI application of the project." def handle(self, *args, **options): if uwsgi is not None and uwsgi.masterpid() > 0: uwsgi.reload() print('uWSGI re...
null
django_uwsgi/management/commands/reload_uwsgi.py
reload_uwsgi.py
py
404
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "django_uwsgi.uwsgi", "line_number": 10, "usage_type": "name" }, { "api_name": "django_uwsgi.uwsgi.masterpid", "line_number": 10, "usage_type": "call" }, {...
96771397
import requests import json """ Load an image from the web to be analyzed Params: URL of the image Returns: JSON file with the image analysis """ def loadImage(img_url): # put your keys in the header headers = { "app_id": "28cffa81", "app_key": "a53c47109871936d7d22221e9099ddb0"...
null
detect.py
detect.py
py
2,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 21, "usage_type": "call" } ]
250876064
import logging import os def _to_bool(v): return str(v).lower()[:1] in ("t", "y", "1") BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HTTP_PORT = 8000 BASE_HTTP_URL = f"http://192.168.5.50:{HTTP_PORT}/" PUB_DIR = os.path.join(BASE_DIR, "pub") GPHOTO_PATH = "gphoto2" FOCUSER_IP = "192....
null
telescopy/settings.py
settings.py
py
1,047
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
603010251
# -*- coding: utf-8 -*- """ Created on Tue Apr 28 13:51:36 2020 @author: singh """ #%% from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras import optimizers import matplotlib.pyplot as plt import tensorflow as tf from keras.callbacks import EarlyStopping, ModelChe...
null
Disease_Detection_Coconut_PLantation_Transfer_Learning/NasNetMobile_imagenet.py
NasNetMobile_imagenet.py
py
7,306
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.callbacks.EarlyStopping", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.callbacks.ModelCheckpoint", "line_number": 28, "usage_type": "call" }, { "api_name": "tensorflow.keras.applications.NASNetMobile", "line_number": 32, "usage_type...
623382316
from datetime import timedelta from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.timezone import now class ShopUser(AbstractUser): avatar = models.ImageField( upload_to='users_avatars', blank=True ) age = models.PositiveIntegerField( ...
null
djangoshop/authapp/models.py
models.py
py
706
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.ImageField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { ...
175017327
import yaml def test_yaml(): corpid = 'wwb183614ea47a13fc' corpsecret = 'cyd6sQ5dXTgKy3-RNg6iSv0jM8pdhLb7jYHCj_WlLQM' req = { "method": "get", "url": "https://qyapi.weixin.qq.com/cgi-bin/gettoken", "params": { "corpid": corpid, "corpsecret": corpsecret ...
null
test_request/test_yaml.py
test_yaml.py
py
416
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.safe_dump", "line_number": 17, "usage_type": "call" } ]
618111213
# coding=utf-8 import json import sys import os from time import sleep, time from subprocess import getstatusoutput import pexpect import requests from common import settings from common.api_requests import AlaudaRequest from common.exceptions import ResponseError, ParseResponseError from common.loadfile import FileUti...
null
base_request.py
base_request.py
py
13,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.api_requests.AlaudaRequest", "line_number": 16, "usage_type": "name" }, { "api_name": "common.loadfile.FileUtils.load_file", "line_number": 19, "usage_type": "call" }, { "api_name": "common.loadfile.FileUtils", "line_number": 19, "usage_type": "name"...
204557347
from MVP.UserModule import UserModule from Modules.Design import Ui_MainWindow from Modules.Entities import User from PyQt5 import QtWidgets, QtCore class UserView(QtWidgets.QMainWindow): def __init__(self, module: UserModule): super(UserView, self).__init__() self.module = module s...
null
MVP/UserView.py
UserView.py
py
2,713
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 7, "usage_type": "name" }, { "api_name": "MVP.UserModule.UserModule", "line_number": 9, "usage_type": "name" }, { "api_name"...
281560558
# -*- coding: utf-8 -*- from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.urls import reverse from django.http import HttpResponse,HttpResponseRedirect from django.views.decorators.csrf import csrf_exempt from django.db.models import F from .permit import Authent...
null
powerbankWeb/powerbank/apps/vueapi/views/inst.py
inst.py
py
6,682
python
en
code
null
code-starcoder2
66
[ { "api_name": "users.models.institutions.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "users.models.institutions.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "users.models.institutions", "line_number": 22, "usage_type":...
301325720
import psycopg2 as psy conexion = psy.connect(dbname="world", user="postgres", password="cachi1234") # se crea la conexión cursor = conexion.cursor() # se crea un cursor poblacionArgentina = "SELECT population FROM country where name = 'Argentina'" cursor.execute(poblacionArgentina) print('Poblacion argentina: ' + st...
null
TP 3/ejercicio2.py
ejercicio2.py
py
3,828
python
en
code
null
code-starcoder2
66
[ { "api_name": "psycopg2.connect", "line_number": 3, "usage_type": "call" } ]
576442558
# -*- coding: utf-8 -*- """ Created on Mon Jun 29 14:14:45 2020 @author: Nikki """ import numpy as np import cv2 import transform as tform import sys import math import scipy.spatial import markers ###--------------------------------------------------------------------------- # Allows video to be initialized usin...
null
pixel_gps.py
pixel_gps.py
py
12,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "markers.mrb3_markers", "line_number": 52, "usage_type": "call" }, { "api_name": "markers.aot_1_markers", "line_number": 55, "usage_type": "call" }, { "api_name": "markers.aot_2_markers", "line_number": 58, "usage_type": "call" }, { "api_name": "mark...
297931026
# -*- coding:utf-8 -*- from django.shortcuts import render, HttpResponseRedirect from .models import ExtractedMusicList, MusicStorage from .forms import UploadForm from extractor.main import extraction from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.shortcuts import render def i...
null
highlight/views.py
views.py
py
1,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "forms.UploadForm", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponseRedirect", "line_number": 21, "usage_type": "call" }, { "ap...
256316329
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import weakref """ Some Garbage Collector tips http://asvetlov.blogspot.ru/2013_05_01_archive.html https://tech.yandex.ru/events/yagosti/19-july-2014/talks/2075/ Do not override (rewrite) __del__ method! GC don't collect it (GC is not very smart). __del__ is not C++ dest...
null
core/gc_tips.py
gc_tips.py
py
1,865
python
en
code
null
code-starcoder2
66
[ { "api_name": "gc.set_debug", "line_number": 53, "usage_type": "call" }, { "api_name": "gc.DEBUG_SAVEALL", "line_number": 53, "usage_type": "attribute" }, { "api_name": "gc.collect", "line_number": 54, "usage_type": "call" }, { "api_name": "inspect.isclass", "...
536099313
""" Example of using a decorator but for caching on a slow remote processing # check documentation, python3 has one like this called LRU cache, python2 we have to do it ourselves. # # You will spend more time using decorators than writing them, this shows how to define/use them. # look @ numba.pydata.org @jit is all...
null
intermediate_python_2014_11_17/course_days/day2/decorators/example_decorator_cached.py
example_decorator_cached.py
py
1,523
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.wraps", "line_number": 25, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 41, "usage_type": "call" } ]
248026451
from typing import TypeVar, Any, Dict class MessageBase: def __init__(self, msg_type: str, agent_name: str): self.msg_type = msg_type self.agent_name = agent_name @classmethod def from_json(cls, message_json): return cls(**message_json) def to_json(self) -> dict: ret...
null
core/transport/messages.py
messages.py
py
2,779
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TypeVar", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Any", "line_number"...
16318117
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
null
are-you-pretty/main.py
main.py
py
1,445
python
en
code
null
code-starcoder2
66
[ { "api_name": "webapp2.RequestHandler", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 24, "usage_type": "call" }, { "api_name": "webapp2.RequestHandler", "line_number": 29, "usage_type": "attribute" }, { "api_name": "...
51960280
''' This file deals with taking constituent sentence vectors and building a single feature vector based on the sentence vectors. This can be done in multiple ways: 1. average all the sentence vectors 2. build bag of words from k-means cluster assignments of each sentence (e.g., 400 clusters -> ...
null
feature_engineering/analysis/vectorization_and_clustering/essay_vectorization.py
essay_vectorization.py
py
9,010
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.reader", "line_number": 28, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 54, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 64,...
648472688
#!/usr/bin/env python # coding: utf-8 # ## Importing all necessery packages # In[1]: import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data.dataloader import DataLoader from itertools import product import time from collections import ...
null
kiperwasser dependency parser/generated_comp_tagged.py
generated_comp_tagged.py
py
17,084
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 57, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.utils.data.dataset.Dataset", "line_number": 115, "usage_type": "name" }, { ...
383452529
# -*- coding: utf-8 -*- """ A class that extends metaEventProcessing to implement the step response algorithm from :cite:`Balijepalli:2014` :Created: 4/18/2013 :Author: Arvind Balijepalli <arvind.balijepalli@nist.gov> :License: See LICENSE.TXT :ChangeLog: .. line-block:: 06/28/16 AB Upgrade lmfit to > 0.9 ...
null
mosaic/process/adept2State.py
adept2State.py
py
11,328
python
en
code
null
code-starcoder2
66
[ { "api_name": "mosaic.utilities.util.avg", "line_number": 50, "usage_type": "call" }, { "api_name": "mosaic.utilities.util", "line_number": 50, "usage_type": "name" }, { "api_name": "mosaic.utilities.util.sd", "line_number": 51, "usage_type": "call" }, { "api_name...
652239729
import subprocess import os import shutil import serial import re import numpy as np import tensorflow as tf import tensorflow.compat.v1.keras.backend as K #add your target hardware properties here device_list = ["NUCLEO_F746ZG","NUCLEO_L476RG", "NUCLEO_F446RE", "ARCH_MAX", "Esense"] arenaSize_list = [np.array([10,30,...
null
examples/THIN-Bayes/Activity Recognition/hardware_utils.py
hardware_utils.py
py
8,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
393278089
#!/usr/bin/env python import sys import os import semanticnet as sn import networkx as nx def calculate_degree_map(igraph): degree_map = dict() edges = igraph.get_edges() for eid in edges.keys(): src = edges[eid]["src"] dst = edges[eid]["dst"] if src not in degree_map: ...
null
extract.py
extract.py
py
6,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "semanticnet.DiGraph", "line_number": 54, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 141, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 142, "usage_type": "attribute" }, { "api_name": "sys.exit", "lin...
616046043
import requests from bs4 import BeautifulSoup detail_url = 'http://www.jisudhw.com/?m=vod-detail-id-15409.html' r = requests.get(url = detail_url) r.encoding = 'utf-8' detail_bf = BeautifulSoup(r.text, 'lxml') num = 1 search_res = {} for each_url in detail_bf.find_all('input'): if 'm3u8' in each_url.get('value'): ...
null
video/解析详情页.py
解析详情页.py
py
503
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
361411070
import wx from collections import OrderedDict class FileDropTarget(wx.FileDropTarget): def __init__(self, main): wx.FileDropTarget.__init__(self) self.main = main def OnDropFiles(self, x, y, filenames): for file in filenames: if hasattr(self.main, 'onRead'): ...
null
lib/wxlib/filechecklist.py
filechecklist.py
py
3,288
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.FileDropTarget", "line_number": 4, "usage_type": "attribute" }, { "api_name": "wx.FileDropTarget.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "wx.FileDropTarget", "line_number": 6, "usage_type": "attribute" }, { "api_name": ...
184814388
from gocardless_pro.resources import Event from .exceptions import UnsupportedEventError, UnsupportedLinksError from .signals import * # NOQA from .utils import model_from_links class EventHandler(object): ACTIONS = { 'mandates': { 'created': mandate_created, 'submitted': mandat...
null
lunchbreak/django_gocardless/handlers.py
handlers.py
py
2,712
python
en
code
null
code-starcoder2
66
[ { "api_name": "gocardless_pro.resources.Event", "line_number": 51, "usage_type": "argument" }, { "api_name": "exceptions.UnsupportedEventError", "line_number": 55, "usage_type": "call" }, { "api_name": "exceptions.UnsupportedEventError", "line_number": 64, "usage_type": "...
401961108
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ @File : MailInfo.py @Contact : riseidr@hotmail.com @License : (C)Copyright 2020 @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2020-3-7 12:01 risseidr 1.0 None """ from selenium.webdrive...
null
MailInfo.py
MailInfo.py
py
1,912
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "selenium.webdriver.remote.webelement.WebElement", "line_number": 25, "usage_type": "name" ...
544777138
from pytube import YouTube import json from urllib import request import ffmpeg import pylivestream import sys from pathlib import Path import pylivestream as pls import pytest from pytest import approx import subprocess import os import pyfakewebcam yt = YouTube audio = video = YouTube.streams audio_name = video_name...
null
main.py
main.py
py
4,545
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytube.YouTube", "line_number": 15, "usage_type": "name" }, { "api_name": "pytube.YouTube.streams", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytube.YouTube", "line_number": 16, "usage_type": "name" }, { "api_name": "pathlib.Pat...
192773165
import pytz from faker import Faker from django.db import models from django.conf import settings from django.shortcuts import get_object_or_404 from django.contrib.auth import get_user_model from django.utils import timezone class Board(models.Model): name = models.CharField(max_length=100) url_name = model...
null
community/models.py
models.py
py
2,717
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 12, "usage_type": "call" }, { "api_name"...
564281472
"""This module will test the views""" from django.test import TestCase, Client from django.urls import reverse from django.contrib.auth.models import User from app.models import Product class Viewstests(TestCase): """ This class test all the views As most of the methods of the views are contained in app/...
null
app/tests/tests_views.py
tests_views.py
py
3,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 21, "usage_ty...
331226166
import pytest import os import sys from Classes.stickysettings import StickySettings as ss def create_filename(): """Create filename to use in testing""" file_exists = True n = 0 testfile = '' while file_exists: n += 1 testfile = os.path.join(os.getenv('APPDATA'), 'xyz...
null
Classes/test_stickysettings.py
test_stickysettings.py
py
1,967
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
335932894
import caffe import glog import sys import random import numpy as np import h5py import json from proto_utils import proto_to_np import os.path as osp from transformer import Xformer from multiprocessing import Pool from threading import Thread from IPython.core.debugger import Tracer class MultiInputDataLayer(caffe.L...
null
python/layers/multi_input_data.py
multi_input_data.py
py
7,742
python
en
code
null
code-starcoder2
66
[ { "api_name": "caffe.Layer", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 26, "usage_type": "call" }, { "api_name": "glog.info", "lin...
646514475
# Original Author : https://www.cnblogs.com/laizhenghong2012/p/11348004.html # Adjusted by Kirigaya, including exposure of API and structure adjustment import os import sys import fire import prettytable as pt # collection of suffix of python, cpp and java CPP_SUFFIX_SET : set = {'.h', '.hpp', '.hxx', '.c', '.cpp'...
null
count.py
count.py
py
2,840
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_numbe...
143262389
import pandas as pd import numpy as np import sklearn from sklearn import linear_model from sklearn.utils import shuffle import matplotlib.pyplot as pyplot from matplotlib import style import pickle data = pd.read_csv("student-mat.csv", sep=";") # print(data.head()) data = data[["G1", "G2", "G3", "studytime", "fai...
null
LinearRegression/regression.py
regression.py
py
1,869
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train...
397427336
# -*- coding: utf-8 -*- """ statusbar_basic revision 0.2 2015/nov mlabru pep8 style conventions revision 0.1 2014/nov mlabru initial release (Linux/Python) """ # < imports >-------------------------------------------------------------------------------------- # pyQt library from PyQt5 import Qt, QtWidgets from P...
null
view/common/statusbar_basic.py
statusbar_basic.py
py
8,426
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QStatusBar", "line_number": 20, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 20, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 46, "usage_type": "attribute" }, { "api_name": "...
356862130
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals import requests from .models import ProxyModel from time import sleep import threading class ProxyDownloaderMiddleware(obj...
null
猎聘网无限制爬取/liepinwang/liepinwang/middlewares.py
middlewares.py
py
2,272
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Lock", "line_number": 24, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 48, "usage_type": "call" }, { "api_name": "models.ProxyModel", ...
508750990
#Created on Fri Feb 19 21:42:08 2021 #@author: Thomas Gaudin import matplotlib.pyplot as plt import numpy as np def alpha_function(alpha): ang = alpha / 206625 return ang alph_max = alpha_function(0.01) alph_min = alpha_function(0.0005) def diameter(dist, angle): RS = 2.254610e-8 d = (dist / angle) ...
null
CHARA_plot.py
CHARA_plot.py
py
791
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.vectorize", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
493631057
# Faz o cadastrado de novos usarios no banco de dados SQLite # helpthx '''' Capture infos about users. There r five filds, ID, nome, matricula, ru and acessos. ==> Each user will have a unique numeric integer ID linked with a SQLite3 database call Banco_de_dados.db ==> Each ID has a name, matricula, amount of cr...
null
3_Trabalho/Arquivos/01_cadastro.py
01_cadastro.py
py
982
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 33, "usage_type": "call" } ]
525361061
import os import logging.handlers logger = logging.getLogger('mail.deliver') handler = logging.handlers.SysLogHandler( '/dev/log', facility=logging.handlers.SysLogHandler.LOG_LOCAL6) handler.setFormatter( logging.Formatter('%%(filename)s[%d]: %%(levelname)s: %%(message)s' % os.getpid())) logger.addHandler(handl...
null
test_python/test_logging2.py
test_logging2.py
py
508
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.handlers.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.handlers", "line_number": 3, "usage_type": "name" }, { "api_name": "logging.handlers.handlers.SysLogHandler", "line_number": 4, "usage_type": "call" }, { "...
368430746
from art import logo, vs from game_data import data import random import os END_GAME = False user_count = 0 def random_question(data_with_info, questions): global END_GAME if len(questions) == len(data): END_GAME = True return END_GAME random_question_from_data = random.choice(data_with_info) ...
null
main.py
main.py
py
2,231
python
en
code
null
code-starcoder2
66
[ { "api_name": "game_data.data", "line_number": 13, "usage_type": "argument" }, { "api_name": "random.choice", "line_number": 16, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 18, "usage_type": "call" }, { "api_name": "art.logo", "line_n...
339380926
import xlrd import pymysql # import importlib # importlib.reload(sys) #出现呢reload错误使用 def open_excel(): try: book = xlrd.open_workbook("国内生产总值指数1978.xlsx") # 文件名,把文件与py文件放在同一目录下 except: print("open excel file failed!") try: sheet = book.sheet_by_name("Sheet1") # execl里面的workshee...
null
scriptFiles/economicScriptFiles/excel-mysql-gdp-index-year.py
excel-mysql-gdp-index-year.py
py
2,698
python
en
code
null
code-starcoder2
66
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 67, "usage_type": "call" } ]
487189009
#!/usr/bin/env python import requests import json import tinymongo as tm import tinydb # Bug: https://github.com/schapman1974/tinymongo/issues/58 class TinyMongoClient(tm.TinyMongoClient): @property def _storage(self): return tinydb.storages.JSONStorage db_name = 'practica' def clear(): conn =...
null
practica.py
practica.py
py
1,471
python
en
code
null
code-starcoder2
66
[ { "api_name": "tinymongo.TinyMongoClient", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tinydb.storages", "line_number": 13, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" } ]
139014762
from django.utils import timezone import itertools import requests from mnm.taskapp import celery from celery.utils.log import get_task_logger from mnm.releases.models import Release from . import parsers from . import countries from . import models from . import influxdb_client logger = get_task_logger(__name__) ...
null
mnm/instances/tasks.py
tasks.py
py
4,074
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "itertools.islice", "line_number": 20, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 25, "usage_type": "call" }, { "api_name": "mnm...
529391060
from flask import request, redirect, Flask, send_from_directory, abort, jsonify, render_template import joblib import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') import seaborn as sb # from sklearn.linear_model import LogisticRegression import io import base64 app = Flask(__name__) @app.route('/...
null
flaskLoan.py
flaskLoan.py
py
2,037
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.method"...
443733153
# extract_gps.py # Gets lat, lon, and alt from Parrot Sequoia exif tags # Based on https://gist.github.com/erans/983821 from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS def get_exif_data(image): """Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags""" exif_dat...
null
extract_gps.py
extract_gps.py
py
2,748
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.ExifTags.TAGS.get", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.ExifTags.TAGS", "line_number": 14, "usage_type": "name" }, { "api_name": "PIL.ExifTags.GPSTAGS.get", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL....
187581182
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """Unittests for monorail.search.backendnonviewable.""" from __future__ import print_function f...
null
appengine/monorail/search/test/backendnonviewable_test.py
backendnonviewable_test.py
py
6,273
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 24, "usage_type": "attribute" }, { "api_name": "services.service_manager.Services", "line_number": 27, "usage_type": "call" }, { "api_name": "services.service_manager", "line_number": 27, "usage_type": "name" }, { ...
5744219
#! /usr/bin/env python3 """ A one-sample t test answers these questions: Is the average of a sample different from a specified value? Is the average of a sample less than a specified value? Is the average of a sample greater than a specified value? What is the range of values that is likely to include the population a...
null
one_sample_t.py
one_sample_t.py
py
4,874
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 36, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 49, "usage_type": "call" }, { "api_name": "datasense.html_begin", "line_number": 50, "usage_type": "call" }, { "api_name": "datasense.script_...
191065783
import pickle import os import numpy as np from torch.utils.data import DataLoader from grover.data import MolCollator from grover.util.utils import create_logger, load_checkpoint, get_data def generate_embeddings(args, logger): if not os.path.exists(args.output_path): os.mkdir(args.output_path) ch...
null
task/embedding.py
embedding.py
py
2,120
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 13, "usage_type": "call" }, { "api_name": "grover.util.utils.create_logger"...
39974788
import sys import os import matplotlib.pyplot as plt import numpy as np import spectra from numpy.polynomial import polynomial as P from scipy.integrate import simps DRAW_TH = False def simple_integrate(x, y, dx, dy): errorsq = 0 area = 0 for i, (v) in enumerate(zip(x, y)): print(x[i], dx[i], y[i...
null
analysis/draw.py
draw.py
py
4,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "spectra.list_clean", "line_number": 32, "usage_type": "call" }, { "api_name": "spectra.loads_clean", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.p...
100860384
import math import typing from ..._detail import PolicyCouplerBase from ..._impl import CalcMrcaUncertaintyAbsUpperBoundWorstCase from .._PolicySpec import PolicySpec from .._impl import calc_common_ratio class CalcMrcaUncertaintyAbsUpperBound: """Functor to provide member function implementation in Policy class...
null
hstrat/stratum_retention_strategy/stratum_retention_algorithms/geom_seq_nth_root_algo/_invar/_CalcMrcaUncertaintyAbsUpperBound.py
_CalcMrcaUncertaintyAbsUpperBound.py
py
3,166
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Optional", "line_number": 15, "usage_type": "attribute" }, { "api_name": "_PolicySpec.PolicySpec", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 21, "usage_type": "attribute" }, { "api_name": "_detail.P...
75699703
from django import forms from django.contrib.auth import get_user_model from mailjet_rest import Client import os class ContactForm(forms.Form): title = forms.CharField() message = forms.CharField(widget=forms.Textarea) def send_email(self): User = get_user_model() mailing_list = User.obj...
null
newsletter/forms.py
forms.py
py
1,332
python
en
code
null
code-starcoder2
66
[ { "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"...
603269033
# As Commander Lambda's personal assistant, you've been assigned the task of configuring the LAMBCHOP doomsday device's axial orientation gears. It should be pretty simple - just add gears to create the appropriate rotation ratio. But the problem is, due to the layout of the LAMBCHOP and the complicated system of beams...
null
level2_1.py
level2_1.py
py
3,319
python
en
code
null
code-starcoder2
66
[ { "api_name": "fractions.Fraction", "line_number": 20, "usage_type": "call" } ]
257751991
# %% Importing import numpy as np import matplotlib.pyplot as plt import mne # %% Reading Raw Eximia for i in range(1,16): raw = mne.io.read_raw_eximia(f"C:\\Users\\bruno\\Documents\\NNCLab\\Data\\ct_AS2\\AS_ct_NaturalFrequencies_20100302_110735_{i}.nxe") # %% Raw to info print(raw.info) info = dict(raw.info) # ...
null
tests.py
tests.py
py
4,739
python
en
code
null
code-starcoder2
66
[ { "api_name": "mne.io.read_raw_eximia", "line_number": 8, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.percentile", "l...
9244669
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
null
horizon/openstack_dashboard/dashboards/compute/instances/views.py
views.py
py
26,247
python
en
code
null
code-starcoder2
66
[ { "api_name": "horizon.tables.DataTableView", "line_number": 55, "usage_type": "attribute" }, { "api_name": "horizon.tables", "line_number": 55, "usage_type": "name" }, { "api_name": "openstack_dashboard.dashboards.compute.instances.tables.InstancesTable", "line_number": 56, ...
618063295
import itertools import json import numpy as np import torch from pyramid_nested_ner.data.dataset import PyramidNerDataset from pyramid_nested_ner.model import PyramidNer from pyramid_nested_ner.training.optim import get_default_sgd_optim from pyramid_nested_ner.training.trainer import PyramidNerTrainer from pyramid_...
null
test_script.py
test_script.py
py
5,805
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "itertools.islice",...
71075082
""" pyexcel.sources.file_source_output ~~~~~~~~~~~~~~~~~~~ Representation of output file sources :copyright: (c) 2015-2016 by Onni Software Ltd. :license: New BSD License """ import pyexcel.renderers as renderers from pyexcel.sources.factory import FileSource from pyexcel.sources import params c...
null
pyexcel/sources/file_source_output.py
file_source_output.py
py
2,656
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyexcel.sources.factory.FileSource", "line_number": 15, "usage_type": "name" }, { "api_name": "pyexcel.renderers.get_all_file_types", "line_number": 19, "usage_type": "call" }, { "api_name": "pyexcel.renderers", "line_number": 19, "usage_type": "name" }, ...
127563307
""" The pymbar package contains the pymbar suite of tools for the analysis of simulated and experimental data with the multistate Bennett acceptance ratio (MBAR) estimator. """ from distutils.core import setup from setuptools import setup, Extension import numpy import os import subprocess import six ################...
null
setup.py
setup.py
py
5,204
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "subprocess.Popen", "line_number": 38, "usage_type": "call" }, { "api_name": "subprocess.PIPE", ...
375681631
import discord import json import os from discord.ext import commands from datetime import datetime import asyncio import random import math import enum bot = commands.Bot(command_prefix=commands.when_mentioned_or('a!'), case_insensitive=True, owner_id=275328804770021376) os.chdir(r'C:\Users\Uncle03\Desktop\U...
null
UncleBot.py
UncleBot.py
py
106,882
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Bot", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.ext.commands.when_mentioned_or", "line_number": 10, "usage_type": "call" }, { ...
404014665
from __future__ import unicode_literals from prompt_toolkit.buffer import Buffer from prompt_toolkit.application.current import get_app class ModalBuffer(Buffer): last_working_index = -1 def _change_prompt_mode(self, index, redraw=True): if index < len(self.history.modes): app = get_app()...
null
rice/modalbuffer.py
modalbuffer.py
py
2,624
python
en
code
null
code-starcoder2
66
[ { "api_name": "prompt_toolkit.buffer.Buffer", "line_number": 6, "usage_type": "name" }, { "api_name": "prompt_toolkit.application.current.get_app", "line_number": 11, "usage_type": "call" }, { "api_name": "prompt_toolkit.application.current.get_app", "line_number": 62, "u...
542081021
# # Alternating Least Squares # # This is an example implementation of ALS for learning how to use Spark. # Please refer to # [this example](https://github.com/apache/spark/blob/master/examples/src/main/python/ml/als_example.py) # for more conventional use. # # This example requires [NumPy](http://www.numpy.org/) fr...
null
als.py
als.py
py
1,987
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sum", "line_...
581530952
import json import requests def get_ngrok_url(): url = "http://localhost:4040/api/tunnels" res = requests.get(url) res_unicode = res.content.decode("utf-8") res_json = json.loads(res_unicode) return res_json["tunnels"][0]["public_url"]
null
ngrok/ngrok.py
ngrok.py
py
258
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" } ]
301302455
import os import numpy as np from keras.applications.vgg16 import VGG16 from keras.applications.vgg16 import preprocess_input as preprocess_input_vgg from keras.preprocessing import image from numpy import linalg as LA from common.const import input_shape import time # 读取图片路径 def get_imlist(path): return [os.pat...
null
vggnet.py
vggnet.py
py
3,327
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.applications.vgg16.VGG16",...
22592623
import json import random import time from Deck import * from Card import * from tkinter import * class CardButton(Button): __mainText="" __subText="" def __init__(self, master=None, **kargs): super().__init__( master, kargs) self.__cardObj=None if('card' in kargs): self....
null
1학기/programming/basic/파이썬/teamProject/mytest/localGame/Player.py
Player.py
py
12,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "Card.Levels", "line_number": 146, "usage_type": "call" }, { "api_name": "Deck.getEmptyDeck", "line_number": 224, "usage_type": "call" }, { "api_name": "Deck.getEmptyDeck", "line_number": 269, "usage_type": "call" }, { "api_name": "json.loads", "...
375689977
from __future__ import unicode_literals from pydoc import deque from threading import Thread from Queue import Queue import gc import time from traceback import print_exc from django.db import connection from py4j.java_gateway import JavaGateway from codebase.models import CodeElementKind, CodeElement, MethodElement,\ ...
null
recodoc2/apps/codebase/parser/java_code_parser.py
java_code_parser.py
py
18,523
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 20, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 29, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 29, "usage_type": "name" }, { "api_name": "codebase....
174258230
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
null
datalabeling/google/cloud/datalabeling_v1beta1/gapic/enums.py
enums.py
py
6,365
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.IntEnum", "line_number": 22, "usage_type": "attribute" }, { "api_name": "enum.IntEnum", "line_number": 35, "usage_type": "attribute" }, { "api_name": "enum.IntEnum", "line_number": 48, "usage_type": "attribute" }, { "api_name": "enum.IntEnum", ...
572797321
# A configuration file for the fileprocess. We could do a .ini, but everybody # knows python here import logging import os from logging import handlers config = { 'port': 48260, 'S3.accesskey': '17G635SNK33G1Y7NZ2R2', 'S3.secret': 'PHDzFig4NYRJoKKW/FerfhojljL+sbNyYB9bEpHs', 'S3.music_bucket': 'music.r...
null
fileprocess/fileprocess/configuration.py
configuration.py
py
2,469
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.get", "line_number": 46, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 46, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 60, "usage_type": "attribute" }, { "api_name": "logging.StreamHandle...
420041049
import collections import itertools import string import json import random import re import nltk from nltk.corpus import stopwords stop = stopwords.words('english') from nltk.corpus import wordnet from nltk.corpus import wordnet as wn filename = "new.txt" contractions = { "aren't": "are not", "can't": "cannot", "ca...
null
add pharsesV2.py
add pharsesV2.py
py
15,314
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 9, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 9, "usage_type": "name" }, { "api_name": "string.ascii_lowercase", "line_number": 162, "usage_type": "attribute" }, { "api_...
257833923
# -*- coding: cp1251 -*- from django import forms from django.http import HttpResponse, Http404 from django.shortcuts import render from django_ajax.decorators import ajax from .models import Cocktail, Recipe, Storage, Order class FileUploadForm(forms.Form): file_source = forms.FileField() @ajax def cocktails(...
null
cocktail_master/views.py
views.py
py
1,595
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.Form", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.FileField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.for...
640484222
import numpy as np from scipy.interpolate import interp2d def resize_smalltolarge(im1, deltapix1, new_dim, deltapix2): """ Function resizes a small image to match the dimesions of a larger image with a different pixel size Args: im1 (numpy.ndarray): data for smaller image deltap...
null
build/lib/astrodesim/resize_smalltolarge.py
resize_smalltolarge.py
py
2,522
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.pad", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 45, "usage_type": "call" }, { "api_name": "scipy.interpolate.interp2d", ...
382434210
from flask import Flask, request from flask_restful import Resource, Api, reqparse from flask_jwt import JWT, jwt_required from security import authenticate, identity #Define our resource class Item(Resource): #be aware of these aren't instance variabe instead these are class variable parser = reqparse.RequestPa...
null
section-4/code/app.py
app.py
py
2,961
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_restful.Resource", "line_number": 10, "usage_type": "name" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_restful.reqparse", "line_number": 13, "usage_type": "name" }, { ...
301478978
from typing import TypeVar, cast import jax from jax import numpy as jnp from .. import hints from .._base import MatrixLieGroup from .._se2 import SE2 from .._se3 import SE3 from .._so2 import SO2 from .._so3 import SO3 T = TypeVar("T", bound=MatrixLieGroup) @jax.jit def rplus(transform: T, delta: hints.TangentVe...
null
jaxlie/manifold/_manifold_helpers.py
_manifold_helpers.py
py
3,652
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TypeVar", "line_number": 13, "usage_type": "call" }, { "api_name": "_base.MatrixLieGroup", "line_number": 13, "usage_type": "name" }, { "api_name": "jax.jit", "line_number": 16, "usage_type": "attribute" }, { "api_name": "_base.MatrixLieGroup...
596576807
# -*- coding: utf-8 -*- import scrapy from scrapy.loader import ItemLoader from meizitu.items import MeizituItem class WholeSpider(scrapy.Spider): name = 'whole' allowed_domains = ['www.meizitu.com'] start_urls = ['http://www.meizitu.com//'] def __init__(self, **kwargs): super().__init__(**kw...
null
meizitu/spiders/whole.py
whole.py
py
1,961
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "scrapy.loader.ItemLoader", "line_number": 36, "usage_type": "call" }, { "api_name": "meizitu.items.MeizituItem", "line_number": 36, "usage_type": "call" } ]
413073133
from datetime import datetime, timedelta from django.test import TestCase from casexml.apps.case.tests.util import check_xml_line_by_line from corehq.apps.mobile_auth.utils import new_key_record, get_mobile_auth_payload from dimagi.ext.jsonobject import HISTORICAL_DATETIME_FORMAT class MobileAuthTest(TestCase): ...
null
corehq/apps/mobile_auth/tests.py
tests.py
py
2,486
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "dimagi.ext.jsonobject.HISTORICAL_DATETIME_FORMAT", "line_number": 13, "usage_type": "argument" }, { "api_name": "datetime.datetime.utcnow", "line_number": 16, "usage_type": "cal...
185218237
################################################################################ """This program will read in a SAINT 'list.txt' file and the interactions from the consensus path db database and return all the interactions that we saw in our experiment in a format suitable for cytoscape. This allows us to filter be...
null
ProteinInteractions.py
ProteinInteractions.py
py
3,166
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "itertools.chain", "line_number": 43, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 85, "usage_type": "call" }, { "api_name": "sys.argv", "line_number":...
320932259
from helpers.utils import paginator from helpers.helpers import upload_df_S3 from datetime import datetime import pandas as pd import os elements_to_extract = { 'characters': {'end_point': 'characters', 'values': ['id', 'name', 'modified'] }, 'comic_character': ...
null
avengers/functions/extractor.py
extractor.py
py
2,524
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 40, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "name" }, { "api_name": "helpers....
259782834
from ahoy.dockerApi import docker_client from flask import Blueprint, json, request, session, current_app from docker.errors import APIError, NotFound docker_swarm_bp = Blueprint('docker_swarm_bp', __name__, url_prefix="/swarm") @docker_swarm_bp.route('/') def swarm(): return "swarm" # Swarm Node @docker_swarm_b...
null
ahoy/dockerApi/swarm/__init__.py
__init__.py
py
2,667
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "ahoy.dockerApi.docker_client.nodes.list", "line_number": 16, "usage_type": "call" }, { "api_name": "ahoy.dockerApi.docker_client.nodes", "line_number": 16, "usage_type": "attribute" ...
509724974
import requests from dateutil.relativedelta import relativedelta import datetime import smtplib # Foursquare Token # https://foursquare.com/developers/explore API_TOKEN = "" # Amazon SES SMTP_AUTH_USER = "" SMTP_AUTH_PWD = "" EMAIL = "" def get_checkins_from_past(years): endDate = datetime.datetime.now() - rela...
null
4square_past_checkins_script.py
4square_past_checkins_script.py
py
2,188
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "attribute" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 17, "usage_type": "call" }, { ...
586043741
# The contents of this file are licensed at your option under any and/or all of the following: # WTFPL, CC0, Apache 2.0, MIT, BSD 3-clause, MPL 2.0, GPL2.0, GPL3.0, LGPL, CDDL1.0, EPL1.0. # So pick your favorite license, do what you want, and have fun! from typing import cast, Union, Dict, Mapping, Optional, Tuple, An...
null
teddy.py
teddy.py
py
43,454
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Optional", "line_nu...
423537584
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy.spatial.distance import euclidean import matplotlib.pyplot as plt from ase.io import read, write from ase.visualize impor...
null
krrThomas/searchStat/get_best_current.py
get_best_current.py
py
1,128
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ase.io.read", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
258095977
"""CodEX URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based v...
null
Star's Python Workspace/Web App/Distributed/CodEX/CodEX/urls.py
urls.py
py
1,200
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 21, "usage_type": "name" }, { "api_name": "...
111683453
#!/usr/bin/python3 # 导入相关包 # 禁止输出warning信息 import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd from pandas import plotting import matplotlib.pyplot as plt plt.style.use('seaborn') import seaborn as sns sns.set_style("whitegrid") from sklearn.linear_model import LogisticRegre...
null
iris.py
iris.py
py
11,864
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 15, "usage_type": "attribute" }, { "a...
365913867
#!/usr/bin/env python3 #-*- coding: utf-8 -*- # Programmiertechniken in der Computerlinguistik II # Uebung 4, Aufgabe 1.2 # Autoren: Frik Bauer, Salome Wildermuth import xml.etree.ElementTree as ET import random def split_corpus(infile, outdir): abstract = [] document_start = False for _,article in ET....
null
corpus_splitter.py
corpus_splitter.py
py
1,679
python
en
code
null
code-starcoder2
66
[ { "api_name": "xml.etree.ElementTree.iterparse", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 16, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 39, "usage_type": "call" } ]
80646820
""" Usages: python run_layoutlmv2.py --train_config default --work_dir runs/train/layoutlmv2-base-uncased_50e/ """ import argparse from transformers import AutoModelForQuestionAnswering import torch.nn as nn from utils import load_and_process_data, create_logger from config import TRAIN_DATA, VAL_DATA, MODEL_CHECK...
null
libs/layoutlmv2/run_layoutlmv2.py
run_layoutlmv2.py
py
6,332
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.cuda.devic...
212083151
import pytest import time import logging import contextlib import numpy as np import curio import caproto as ca from .conftest import default_setup_module, default_teardown_module from . import _asv_shim ioc_handler = None logger = logging.getLogger(__name__) def setup_module(module): default_setup_module(modu...
null
caproto/tests/test_bench.py
test_bench.py
py
11,903
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "conftest.default_setup_module", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 21, "usage_type": "call" }, { "api_name": "l...
413942902
"""Fastapi based Web services.""" import logging import time from multiprocessing import Process import uvicorn from ambianic import DEFAULT_DATA_DIR from ambianic.util import ManagedService from ambianic.webapp.fastapi_app import set_data_dir log = logging.getLogger(__name__) # configuration DEBUG = True class Fa...
null
src/ambianic/webapp/fastapi_server.py
fastapi_server.py
py
3,735
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "ambianic.util.ManagedService", "line_number": 17, "usage_type": "name" }, { "api_name": "ambianic.DEFAULT_DATA_DIR", "line_number": 27, "usage_type": "name" }, { "api_name...
583971095
from pathlib import Path import pickle from typing import Mapping, List, Union import numpy as np import janome.tokenizer from .base_word_preprocessor import BaseWordPreprocessor from mltool.datasource.loader.ahcloader import AhcLoader from mltool.util import config_loader FEATURE_PATH = Path('config/feature_path.ym...
null
mltool/preprocessor/text/japanese_word_preprocessor.py
japanese_word_preprocessor.py
py
5,179
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "mltool.util.config_loader.load", "line_number": 13, "usage_type": "call" }, { "api_name": "mltool.util.config_loader", "line_number": 13, "usage_type": "name" }, { "api_name": ...
35745068
from django.db import models from django.contrib.auth.models import AbstractUser from django_countries.fields import CountryField # Create your models here. class User(AbstractUser): email = models.EmailField('email address', max_length=100, unique=True, error_messages={'unique': "A...
null
enpassant/users/models.py
models.py
py
1,973
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.EmailField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { ...
380123678
"""Fixes file permissions after the file gets written on import. Put something like the following in your config.yaml to configure: permissions: file: 644 """ import os from beets import config, util from beets.plugins import BeetsPlugin def convert_perm(perm): """If the perm is a int it will fir...
null
beetsplug/permissions.py
permissions.py
py
1,865
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.stat", "line_number": 25, "usage_type": "call" }, { "api_name": "beets.plugins.BeetsPlugin", "line_number": 28, "usage_type": "name" }, { "api_name": "beets.config", "line_number": 44, "usage_type": "name" }, { "api_name": "os.chmod", "line_n...
541077703
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('remote_users', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ...
null
apps/transfers/migrations/0001_initial.py
0001_initial.py
py
2,987
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 12, "usage_type": "call...
316552832
import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.datasets import make_moons, make_circles, make_classification import tensorflow.compat.v1 as tf tf.disable_v2_behavior() #################### T...
null
Circle 선형식별.py
Circle 선형식별.py
py
2,400
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.compat.v1.disable_v2_behavior", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.datasets.make_circles", "line_number": 11, "usage_type": "call" }, ...
550754179
# Copyright 2008-2018 Univa Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
null
src/installer/src/tortuga/db/resourceAdapterCredentialsDbHandler.py
resourceAdapterCredentialsDbHandler.py
py
6,897
python
en
code
null
code-starcoder2
66
[ { "api_name": "tortuga.db.tortugaDbObjectHandler.TortugaDbObjectHandler", "line_number": 30, "usage_type": "name" }, { "api_name": "tortuga.exceptions.resourceNotFound.ResourceNotFound", "line_number": 34, "usage_type": "call" }, { "api_name": "resourceAdaptersDbHandler.ResourceA...
198554980
from django.conf import settings from django.contrib.auth import login from django.http import HttpResponse, JsonResponse from django.shortcuts import redirect, render, reverse from django.utils.decorators import method_decorator from django.views import View from lib.decorators import ajax_required from web.forms.reg...
null
web/views/signin.py
signin.py
py
2,290
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.View", "line_number": 13, "usage_type": "name" }, { "api_name": "django.shortcuts.redirect", "line_number": 16, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 16, "usage_type": "call" }, { "api_name": "...
8496651
#!/usr/bin/env python import os from math import copysign, cos, log, sin, sqrt import roslib import rospy import std_srvs.srv from asebaros_msgs.msg import AsebaEvent from asebaros_msgs.srv import GetNodeList, LoadScripts, LoadScriptToTarget from dynamic_reconfigure.server import Server from geometry_msgs.msg import ...
null
src/ros-aseba/thymio_driver/nodes/multi_thymio_driver_node.py
multi_thymio_driver_node.py
py
26,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "thymio_msgs.msg.Led.CIRCLE", "line_number": 36, "usage_type": "attribute" }, { "api_name": "thymio_msgs.msg.Led", "line_number": 36, "usage_type": "name" }, { "api_name": "thymio_msgs.msg.Led.PROXIMITY", "line_number": 36, "usage_type": "attribute" }, {...
97804777
import logging import time from aws_reaper.common.main import get_aws_account_id from aws_reaper.config import Config from aws_reaper.execution_plan import ExecutionPlan from aws_reaper.execution_worker import ExecutionWorker from aws_reaper.execution_manager import CheckExecutionManager, CleanExecutionManager from aw...
null
aws_reaper/main.py
main.py
py
14,782
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "aws_reaper.service_loader.ServiceLoader", "line_number": 15, "usage_type": "call" }, { "api...
551742224
# /usr/local/bin/python3.8 # -*- coding: utf-8 -*- # @Time : 2021-03-27 11:15 上午 # @Author : 张晨旭 # @IDE : PyCharm # @PROJECT : Test_Api # @File : test_address.py import pytest import yaml from test_conntact.contact_api.address_api import AddressApi class TestAddress(): ''' 编写测试用例,并进行相应的数据清洗 '...
null
test_conntact/test_case/test_address.py
test_address.py
py
2,901
python
en
code
null
code-starcoder2
66
[ { "api_name": "test_conntact.contact_api.address_api.AddressApi", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 25, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 25, "usage_type": "attribute" }, ...
255056067
#! /usr/bin/env python # -*- coding:utf-8 -*- # json 转 xml # json2xml.py # Version 1.0 import json from libs.dicttoxml import dicttoxml from xml.dom.minidom import parseString class Json2Xml: def __init__(self, file=None): self.result = None if file: self.loadjson2xml(file) def lo...
null
libs/json2xml.py
json2xml.py
py
852
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "libs.dicttoxml.dicttoxml", "line_number": 20, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parseString", "line_number": 26, "usage_type": "call" } ]
60854841
""" Make a pie chart This script is written by Vamei, http://www.cnblogs.com/vamei you may freely use it. """ import matplotlib.pyplot as plt import numpy as np # quants: GDP # labels: country name labels = [] quants = [] # Read data for line in file('../data/country_gdp.txt'): info = line.split() labels.a...
null
hmm/chart-bar.py
chart-bar.py
py
797
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib....
574605914
from math import sqrt, exp, pi, log import matplotlib.pyplot as plt import scipy.optimize as sciOpt from numpy.random import normal as rngNormal areas = dict() #return normal distribution function def normal(mean, sigma): return lambda x: (1/sqrt(2*sigma*sigma*pi))*exp(-(1/(2*sigma*sigma))*(x-mean)*(x-mean)) #Cl...
null
election_stats.py
election_stats.py
py
4,387
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 10, "usage_type": "name" }, { "api_name": "math.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_num...
433000206
# CUSTOM MIDDLEWARE FOR DJANGO: import re from utils import get_viewer_region from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response, redirect # Middleware processor for IE redirects. class IERedirectMiddleware(object): def process_request(self, request): ...
null
app/lib/middleware.py
middleware.py
py
1,648
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 30, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_r...
565130647
from typing import Dict from .base import BaseParser class OpenGraphParser(BaseParser): allowed_og_properties = { 'og:title', 'og:description', 'og:image', } def extract_data(self) -> Dict[str, str]: meta = self._soup.findAll('meta') result = {} for tag in...
null
zerver/lib/url_preview/parsers/open_graph.py
open_graph.py
py
696
python
en
code
null
code-starcoder2
66
[ { "api_name": "base.BaseParser", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" } ]
496407497
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def copy_to_teamusercopy(apps, schema_editor): """Copy from TeamUser to TeamUserCopy""" TeamUser = apps.get_model('status', 'TeamUser') TeamUserCopy = apps.get_model('status', 'TeamUserCopy') for teamuse...
null
standup/status/migrations/0013_backup_teamuser.py
0013_backup_teamuser.py
py
1,508
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 33, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 33, "usage_type": "name" }, { "api_name": "django.db.migrations.RunPython", "line_number": 40, "usage_type": "call" }, ...
15913211
import cv2 import os import numpy as np import tensorflow as tf def model(x, y, dropout_probability, is_training, settings): """ This method builds the classification model :param x: The input to be processed by the classifier. Expected to be of size [None, image_height, image_width, image_channels] :...
null
model.py
model.py
py
13,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.reshape", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.variable_scope", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.layers.batch_normalization", "line_number": 34, "usage_type": "call" }, { ...