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
456971374
from itertools import groupby from numbers import Number import numpy as np import param from .dimension import Dimension, Dimensioned, ViewableElement from .layout import Composable, Layout, AdjointLayout, NdLayout from .ndmapping import OrderedDict, UniformNdMapping, NdMapping from .overlay import Overlayable, NdOv...
null
holoviews/core/element.py
element.py
py
37,309
python
en
code
null
code-starcoder2
76
[ { "api_name": "dimension.ViewableElement", "line_number": 15, "usage_type": "name" }, { "api_name": "layout.Composable", "line_number": 15, "usage_type": "name" }, { "api_name": "overlay.Overlayable", "line_number": 15, "usage_type": "name" }, { "api_name": "param...
225802118
# libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.spatial import distance ########################################################################### ######## Problem #1: EigenVectors using Euclidean Distance Method ###### ################################################...
null
Excercises/Numpy_Exercises.py
Numpy_Exercises.py
py
8,053
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
396603614
# # @lc app=leetcode id=93 lang=python3 # # [93] Restore IP Addresses # # https://leetcode.com/problems/restore-ip-addresses/description/ # # algorithms # Medium (37.75%) # Likes: 1805 # Dislikes: 570 # Total Accepted: 237.3K # Total Submissions: 620K # Testcase Example: '"25525511135"' # # Given a string s cont...
null
Python/93.restore-ip-addresses.py
93.restore-ip-addresses.py
py
3,228
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 57, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 97, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 74, "usage_type": "name" } ]
64247489
import random import json import os from pico2d import * import game_framework import interface_state name = "MainState" cookie = None background = None pet = None coin = None jelly = None obs = None input = None item = None font = None class Background: def __init__(self): self.bgm = load_music('resou...
null
CookieRun/CookieRun/main_state.py
main_state.py
py
39,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 386, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 396, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 554, "usage_type": "call" }, { "api_name": "json.load", "line...
613354108
# -*- coding: utf-8 -*- """ General analysis functions. Try to write all methods such that they take a dataframe as input and return a dataframe or list of dataframes. """ import datetime as dt import pandas as pd import matplotlib.pyplot as plt import numpy as np import statsmodels.formula.api as fm from statsmodels...
null
opengrid/library/regression.py
regression.py
py
17,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "analysis.Analysis", "line_number": 22, "usage_type": "name" }, { "api_name": "statsmodels.formula.api.ols", "line_number": 107, "usage_type": "call" }, { "api_name": "statsmodels.formula.api", "line_number": 107, "usage_type": "name" }, { "api_name"...
242159770
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Output,Input import plotly.express as px import pandas as pd import sqlite3 from datetime import date con = sqlite3.connect('data.sqlite') def select(sql): retu...
null
north.py
north.py
py
17,234
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 15, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 35, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.t...
166777273
#id_duplicates_functions import pandas as pd from scipy.spatial import cKDTree from scipy.spatial.distance import pdist, squareform from fuzzywuzzy import fuzz import numpy as np from itertools import combinations # from postal import expand # from postal.parser import parse_address # from postal.expand import expand_a...
null
data_prep_scripts/id_duplicates_functions.py
id_duplicates_functions.py
py
4,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "fuzzywuzzy.fuzz.ratio", "line_number": 51, "usage_type": "call" }, { "api_name": "fuzzywuzzy.fuzz", "line_number": 51, "usage_type": "name" }, { "api_name": "fuzzywuzzy.fuzz.partial_token_sort_ratio", "line_number": 51, "usage_type": "call" }, { "ap...
226704517
#!/usr/bin/env python # -*- coding: utf-8 -*- ### Andres Iwan ### from bottle import route, run, template, static_file, get, post, request import json import urllib2 import random import pickle from os import listdir, path from sys import argv word_site = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&cont...
null
app.py
app.py
py
2,654
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib2.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 32, "usage_type": "call" }, { "api_name": "bottle.template", "line_n...
435787592
# -*- coding: utf-8 -*- """ @author: Mik """ import csv import time import tweepy # Copy the api key, the api secret, the access token and the access token secret from the relevant page on your Twitter app api_key = '' api_secret = '' access_token = '-' access_token_secret = '' # You don't need to make any chang...
null
twittercrawling/followers.py
followers.py
py
1,915
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 21, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 29, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "li...
225660231
import argparse import os from parsel import Selector import requests import subprocess import sys from PIL import Image import time HEADER = {"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:50.0) Gecko/20100101 Firefox/50.0"} class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN ...
null
Train/webcrawler.py
webcrawler.py
py
3,131
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 41, "usage_type": "call" }, { "api_name": "parsel.Selector", ...
6955651
import logging import InfoList import ParserUtil from katacomb import obit_err, handle_obit_err from katacomb.obit_types import OBIT_TYPE_ENUM log = logging.getLogger('katacomb') def parse_aips_config(aips_cfg_file): """ Parses an AIPS config file into a dictionary with schema :code:`{ option: [typ...
null
katacomb/katacomb/aips_parser.py
aips_parser.py
py
2,760
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "katacomb.obit_err", "line_number": 43, "usage_type": "call" }, { "api_name": "InfoList.InfoList", "line_number": 44, "usage_type": "call" }, { "api_name": "ParserUtil.PPars...
477787693
from django.shortcuts import render,get_object_or_404 from django.shortcuts import redirect from django_tables2 import RequestConfig from SessionYear.models import SessionYear,SessionCourseExam, SessionCourseExamStudents from ExamMarks.models import SessionExamMarks from django.http import HttpResponseRedirect,HttpResp...
null
SessionYear/views.py
views.py
py
4,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "SessionYear.table.SessionYearTable", "line_number": 20, "usage_type": "call" }, { "api_name": "SessionYear.models.SessionYear.objects.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "SessionYear.models.SessionYear.objects", "line_number": 20, ...
426062200
import itertools def chrom_sort(chroms): # get characters after 'chr' alphanum = [c.split('chr')[1] for c in chroms] # split up chroms with and without '_', convert numbers to ints for easier sorting mapped = [] unmapped = [] for an in alphanum: if '_' in an: tup = (a...
null
ap_util.py
ap_util.py
py
1,250
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.tee", "line_number": 41, "usage_type": "call" }, { "api_name": "itertools.izip", "line_number": 43, "usage_type": "call" } ]
562114563
# -*- coding: utf-8 -*- """ Created on Fri Oct 29 09:52:53 2021 @author: Amr Emam """ import plotly.express as px import pandas as pd import plotly.graph_objects as go class Graphs: def __init__(self,df): self.df=df def histo(self,x): fi...
null
graphs.py
graphs.py
py
1,986
python
en
code
null
code-starcoder2
76
[ { "api_name": "plotly.express.histogram", "line_number": 19, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 19, "usage_type": "name" }, { "api_name": "plotly.express.pie", "line_number": 30, "usage_type": "call" }, { "api_name": "plotly.exp...
615873070
from rest_framework import serializers from .models import * from organization_management.serializers import CentreSerializer class UserProfileSerializer(serializers.ModelSerializer): """docstring for UserProfileSerializer""" Centre = CentreSerializer() ordering = ('User__username',) class Meta: ...
null
user_management/serializers.py
serializers.py
py
1,310
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "organization_management.serializers.CentreSerializer", "line_number"...
616520073
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. # # 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 # # ...
null
rlax/_src/perturbations.py
perturbations.py
py
2,518
python
en
code
null
code-starcoder2
76
[ { "api_name": "rlax._src.base.ArrayLike", "line_number": 26, "usage_type": "attribute" }, { "api_name": "rlax._src.base", "line_number": 26, "usage_type": "name" }, { "api_name": "rlax._src.base.type_assert", "line_number": 44, "usage_type": "call" }, { "api_name"...
257347783
#!/usr/bin/python3 # -*- coding: UTF-8 -*- '''FileCache Description: Class to receive, store and clean data on the file system ''' import os import tempfile # To get the temp directory import time # We need timestamps import json # To read/save the blob metadata import hashlib # Confirm sha1 hash of the blob import t...
null
BlendNet/FileCache.py
FileCache.py
py
12,858
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempfile.gettempdir", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 27, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.abspath", ...
195474155
# Random Forest example import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import r2_score from sklearn.model_selection import GridSearchCV from sklearn.model_selection import KFold from timeit import defaul...
null
sc/Week5_1_RandomForest/Week5_1.py
Week5_1.py
py
1,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.model_selection.KFold", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestRegressor", "line_number": 33, "usage_type": "call" }, { ...
51698404
import os from pytube import YouTube from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC #driver = webdriver.Chrome() driver = ...
null
VideoProcessing/youtubeSearch.py
youtubeSearch.py
py
2,120
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", ...
11848384
# -*- coding: utf-8 -*- """ Created on Tue Apr 30 15:20:56 2019 @author: charl """ import test_data_utils as tdu import test_plot_utils as tpu from pydmd import DMDc, idmdc import paper_settings as ps import matplotlib.pyplot as plt from dmd_data import DMDData import numpy as np import random random.seed(1415) #ran...
null
iDMD_paper/parameter_comparison_figure.py
parameter_comparison_figure.py
py
2,787
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "random.randint", ...
334904697
__author__ = "Jon Dawson" __copyright__ = "Copyright (C) 2012, Jonathan P Dawson" __version__ = "0.1" import struct from copy import copy from parse_tree import * from tokens import Tokens from allocator import Allocator types = ["float", "signed", "unsigned", "short", "long", "char", "int", "void"] numeric_types = ...
null
chips2/chips/compiler/parser.py
parser.py
py
35,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "tokens.Tokens", "line_number": 24, "usage_type": "call" }, { "api_name": "allocator.Allocator", "line_number": 25, "usage_type": "call" }, { "api_name": "copy.copy", "line_number": 131, "usage_type": "call" }, { "api_name": "copy.copy", "line_nu...
273405879
""" Module to find and save the best model trained on a given dataset to artifacts directory. Run: python training/save_best_model.py --entity=fsdl-user \ --project=fsdl-text-recognizer-2021-labs \ --trained_data_class=IAMLines To find entity and p...
null
lab9/training/save_best_model.py
save_best_model.py
py
5,583
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 33, "usage_type": "attribute" }, { "api_name": "wandb.Api", "line_number": 39, "usage_type": "call" }, { "api_name": "json.dump", "line_number"...
265386195
import time import pandas as pd import re from selenium import webdriver from bs4 import BeautifulSoup from lmf.dbv2 import db_write from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException,StaleElementReferenceException ...
null
代码汇总/ningxia/ningxia.py
ningxia.py
py
4,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 31, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 31, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.wait.WebDriverWait", "line_number": 32,...
115426155
from facenet_pytorch import MTCNN import numpy as np import cv2 as cv import math import time BACKGROUND_DIMS = 600 ''' A note on landmarks array structure: left eye coordinates are accessed by creating a tuple consisting of: (landmarks[0][0][0] , landmarks[0][0][1]) right eye coordinates are aceesed by creating a t...
null
face_detection_model.py
face_detection_model.py
py
14,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "facenet_pytorch.MTCNN", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 72, "usage_type": "attribute" }, { "api_name": "numpy.delete", ...
131943683
from django import forms from django.contrib.auth import get_user_model from decimal import Decimal User = get_user_model() class SendMoneyForm(forms.Form): """ Форма отправки денег списку ИНН """ from_user = forms.ModelChoiceField( required=True, label='От кого', queryset=User.objec...
null
users/forms.py
forms.py
py
2,080
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 6, "usage_type": "call" }, { "api_name": "django.forms.Form", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "d...
132288482
from predcell import * import tensorflow as tf import io import numpy as np from torch.utils.tensorboard import SummaryWriter writer = SummaryWriter('runs/run12') # $tensorboard --logdir "runs" # run something like the above command in a terminal, then navigate to http://localhost:6006 to see the Tensorboard visualiza...
null
predcell_train.py
predcell_train.py
py
5,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils.tensorboard.SummaryWriter", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.keras.utils.get_file", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "attribute" },...
563844141
# %% import numpy as np import matplotlib.pyplot as plt import pandas as pd from math import gamma # %% # Constants pi = 3.14159 # x = np.linspace(0,20,20) # %% def func_y(x): y = 0.5*x + x*np.sin(2*pi*x/10) return (y) # %% # 1a) Plot # y = func_y(x) # plt.plot(x,y) # plt.xlabel('x') # plt.ylabel('y') # plt...
null
HW10/HW10_v3.py
HW10_v3.py
py
3,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sin", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
138608340
# fitEllipse.py import numpy as np import matplotlib.pyplot as plt from numpy.linalg import eig, inv import multiprocessing as mulpr import time #TODO def XYtoThetaSimple(x, y, plots=0): ''' move xy elliptical trajectory to (0,0), rescale to be circular, find angle of each x,y simply by atan''' ...
null
lib/fitEllipse.py
fitEllipse.py
py
18,869
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.unwrap", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.arctan2", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
449013613
# v.1.1 # Last update: 19.10.2014 01:31 # Created by Trd from PIL import Image as PILImage from PIL import ImageOps import os import sys def create_my_thumb(pathfile, destination, size): if not os.path.exists(destination): width = size[0] height = size[1] if size[1] > 0 else None folderu...
null
home/nskphotos.py
nskphotos.py
py
935
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
595802126
""" Maintainability Index Tester Uses radon to calculate Maintainability Index (see: https://radon.readthedocs.io/en/latest/intro.html) Tools & Tests are excluded, as well as as there being an option to add a flag to the file to exclude spefific files. Radon itself will A grade for maintainability for score...
null
tools/mi/maintainability.py
maintainability.py
py
1,224
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.iglob", "line_number": 20, "usage_type": "call" }, { "api_name": "radon.metrics.metrics.mi_visit", "line_number": 30, "usage_type": "call" }, { "api_name": "radon.metrics.metrics", "line_number": 30, "usage_type": "attribute" }, { "api_name": "...
395179123
# Write a func that returns the most common item. from collections import Counter def least_common_item(given_string): my_counter = Counter(given_string) most_common = my_counter.most_common().pop() return most_common if __name__ == "__main__": test_string = 'aaaaabbbcccc' result = least_common_i...
null
Collections/least_occured.py
least_occured.py
py
355
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" } ]
479857008
#!/usr/bin/python3 """ a new view for State objects that handles all default RestFul API actions """ from flask import request, jsonify, abort from api.v1.views import app_views from models import storage from models.state import State @app_views.route("/states", strict_slashes=False, methods=["GET", "POST"]) def st...
null
api/v1/views/states.py
states.py
py
1,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "models.storage.all", "line_number": 18, "usage_type": "call" }, { "api_name": "models.sto...
160275476
import os from tasks.frames.atmt import ATMTFrame import time import threading from datetime import datetime import tkinter as tk from json import load from logging import config, getLogger from typing import Collection with open('./config/log_conf.json', 'r') as f: config.dictConfig(load(f)) from .baseapp import ...
null
tasks/apps/taskapp.py
taskapp.py
py
4,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.config.dictConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 11, "usage_type": "name" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "baseapp.BaseApp", ...
157598937
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-11-13 17:02 # @Author : weihuchao import os import time import settings import datetime import simplejson as json def backup_log_file(): """ 备份日志文件 """ gunicorn_file_path = os.path.join(settings.SOURCE_GUNICORN_LOG_PATH, settings.SOURC...
null
analyzer.py
analyzer.py
py
3,200
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "settings.SOURCE_GUNICORN_LOG_PATH", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sett...
146733243
from flask import Flask import os app = Flask(__name__) DIR = os.path.dirname(__file__) DIR += "/" @app.route("/") def hello(): print(__name__) return "hellooooooooooooo" if __name__ == "__main__": app.debug = True app.run()
null
apacheTest/__init__.py
__init__.py
py
261
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" } ]
448407095
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: Dan Zelenak Last Updated: 4/28/2017 Usage: Calculate the number of changes per pixel across all available ChangeMap layers. Alternatively can specify a 'from' and 'to' and the script will calculate the number of changes for each year interval within the given r...
null
5_nlcd_num_changes.py
5_nlcd_num_changes.py
py
10,271
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version", "line_number": 27, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "attribute" }, { "api_name": "gdal.Al...
338841304
# _*_ coding:utf-8 _*_ import numpy as np import sympy as sp import matplotlib.pyplot as plt sp.init_printing(use_unicode=False, wrap_line=False, no_global=True) x=sp.symbols('x') def DifferenceQuotient3 (xk,yk): #求f[xi-1,xi,xi+1] DiffQuo=yk k=len(xk)-1 ...
null
NumericalAnalysis/CubicSpline.py
CubicSpline.py
py
2,795
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.init_printing", "line_number": 5, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.mat", "line_num...
630495360
""" __Seed builder__v0.2.0 (Read_only) Builder helper """ from rest_framework import serializers from rest_auth.models import TokenModel class TokenSerializer(serializers.ModelSerializer): class Meta: model = TokenModel fields = ( 'key', 'user' )
null
seed/serializers/helpers/token.py
token.py
py
304
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_auth.models.TokenModel", "line_number": 13, "usage_type":...
164562942
from selenium import webdriver from selenium.webdriver import ActionChains import time # 创建编辑器 driver = webdriver.Chrome() # 打开页面 driver.get(r"http://www.baidu.com/") # 窗口最大化 driver.maximize_window() # 输入框 ele = driver.find_element_by_xpath("//*[@id='kw']") # 创建actionchains ac = ActionChains(dri...
null
pythonday02/class/模拟键盘.py
模拟键盘.py
py
513
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.ActionChains", "line_number": 19, "usage_type": "call" }, { "api_na...
518965224
""" Core main registry app settings Settings with the following syntax can be overwritten at the project level: SETTING_NAME = getattr(settings, "SETTING_NAME", "Default Value") """ from os.path import join from django.conf import settings if not settings.configured: settings.configure() REGISTRY_XSD_FILEPATH =...
null
core_main_registry_app/settings.py
settings.py
py
1,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings.configured", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name": "django.conf.settings.configure", "line_number": 11, "usage_type": "call" }, ...
592249150
from conv import DBI from guess_language import guess_language from tqdm import tqdm print('Examining article languages...') with tqdm(total=DBI.articles.count()) as pbar: for a in DBI.articles.all(): if 'language' not in a.keys(): lang = guess_language(a['text']) a['language'] = '...
null
non_en.py
non_en.py
py
735
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 7, "usage_type": "call" }, { "api_name": "conv.DBI.articles.count", "line_number": 7, "usage_type": "call" }, { "api_name": "conv.DBI.articles", "line_number": 7, "usage_type": "attribute" }, { "api_name": "conv.DBI", ...
634613571
import sys import pygame from bullet import Bullet def check_events(settings, screen, ship, bullets): """ checks for pygame events. These can be key presses or mouse clicks. :param ship: ship object. :return: Response to event. """ # Responds to key presses and mouse events. for event ...
null
bin/game_function.py
game_function.py
py
3,028
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.event.get", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.QUIT", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
531443736
from django.conf.urls import url from . import views app_name = "payment_ns" urlpatterns = [ url(r'^$', views.pay, name="pay"), url(r'^help/$', views.help, name="help"), url(r'^add_pmt/$', views.add_payment, name="add_pmt"), url(r'^edit_pmt/$', views.edit_payment, name="edit_pmt"), url(r...
null
projectx/shavingstore/cart/urls.py
urls.py
py
382
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
323112028
# Copyright 2018 Streamlit Inc. All rights reserved. # Python 2/3 compatibility from __future__ import print_function, division, unicode_literals, absolute_import from streamlit.compatibility import setup_2_3_shims setup_2_3_shims(globals()) from streamlit import case_converters class ChartComponent(object): de...
null
lib/streamlit/elements/lib/ChartComponent.py
ChartComponent.py
py
1,053
python
en
code
null
code-starcoder2
76
[ { "api_name": "streamlit.compatibility.setup_2_3_shims", "line_number": 6, "usage_type": "call" }, { "api_name": "streamlit.case_converters.to_upper_camel_case", "line_number": 31, "usage_type": "call" }, { "api_name": "streamlit.case_converters", "line_number": 31, "usag...
223781524
import globalenv,os,platform from cnnctwiz import * from freshdl import * from upgrade import * from Dataload import * from Integrity_Manager import * import datetime,time,logging,shutil from emexceptions import * from Upgrade104 import * def setLogFolder(EMWH, Action): OptDir = globalenv.__GLOBALENV__['OPTIONS'] Bu...
null
CaseTests.py
CaseTests.py
py
6,381
python
en
code
null
code-starcoder2
76
[ { "api_name": "globalenv.__GLOBALENV__", "line_number": 12, "usage_type": "attribute" }, { "api_name": "globalenv.__GLOBALENV__", "line_number": 13, "usage_type": "attribute" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 14, "usage_type": "call" }, ...
287874262
from django.shortcuts import render,HttpResponse,redirect,get_object_or_404 from django.http import HttpResponseRedirect,JsonResponse from django.views.generic import TemplateView from django.views.generic.edit import FormView from django.core.files.storage import FileSystemStorage from django.contrib.auth.models impor...
null
staff_alert/alert/views.py
views.py
py
5,750
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.TemplateView", "line_number": 21, "usage_type": "name" }, { "api_name": "form.FileUpload", "line_number": 29, "usage_type": "call" }, { "api_name": "models.FileData.objects.all", "line_number": 34, "usage_type": "call" }, { "api...
295142706
from django.urls import path from .api.views import ( IndexView, CreateView, DetailView, UpdateView, DeleteView, ) app_name = "crud" urlpatterns = [ path('', IndexView.as_view(), name="index"), path('create', CreateView.as_view(), name="create"), path('detail/<int:pk>/', DetailView.as_...
null
crud/urls.py
urls.py
py
480
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "api.views.IndexView.as_view", "line_number": 13, "usage_type": "call" }, { "api_name": "api.views.IndexView", "line_number": 13, "usage_type": "name" }, { "api_name": "djan...
179988804
from pynput.keyboard import Key, Listener import logging log_dir = "" logging.basicConfig(filename=(log_dir+"keylogs.txt"), \ level=logging.DEBUG,format='%(message)s') def on_press(key): logging.info(str(key)) with Listener(on_press=on_press) as Listener: Listener.join() ...
null
keylogger.py
keylogger.py
py
1,366
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "pynput.keyboard.Lis...
442520392
"""Allocation API tests.""" import unittest import tests.treadmill_test_deps # pylint: disable=W0611 import mock from treadmill import admin from treadmill.api import allocation class ApiAllocationTest(unittest.TestCase): """treadmill.api.allocation tests.""" @mock.patch('treadmill.context.AdminContext.co...
null
tests/api/allocation_test.py
allocation_test.py
py
1,526
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "treadmill.api.allocation.API", "line_number": 17, "usage_type": "call" }, { "api_name": "treadmill.api.allocation", "line_number": 17, "usage_type": "name" }, { "api_...
603547602
# coding:utf-8 from index import BaseHandler from models import session, Blog, User import tornado.web import logging from sqlalchemy import update logging.basicConfig(level=logging.DEBUG, format=logging.BASIC_FORMAT) class AuthLogoutHandler(BaseHandler): """退出登录""" @tornado.web.authenticated def get(self)...
null
admin.py
admin.py
py
2,963
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.BASIC_FORMAT", "line_number": 7, "usage_type": "attribute" }, { "api_name": "index.B...
154580694
# -*- coding:utf-8 -*- ''' @Author : xiaoyin_ing @Email : 2455899418@qq.com @Software: PyCharm @File : handle_mysql.py @Time : 2020/7/6 10:00 @Desc : ''' import pymysql from Common.handle_conf import red_conf class HandleDB: def __init__(self): # 建立连接 self.connect = py...
null
Common/handle_mysql.py
handle_mysql.py
py
1,553
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 24, "usage_type": "call" }, { "api_name": "Common.handle_conf.red_conf.get", "line_number": 25, "usage_type": "call" }, { "api_name": "Common.handle_conf.red_conf", "line_number": 25, "usage_type": "name" }, { "api_n...
134492901
# -*- coding: utf-8 -*- import re import os import scrapy from datetime import datetime from scrapy.selector import Selector from scrape.items import ScrapeItem class GiajSpider(scrapy.Spider): name = 'giaj' allowed_domains = ['saigai.gsi.go.jp'] start_urls = ['https://saigai.gsi.go.jp/jusho/download/inde...
null
scrape/scrape/spiders/giaj.py
giaj.py
py
2,627
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "scrapy.selector.Selector", "line_number": 19, "usage_type": "call" }, { "api_name": "re.match", "line_number": 22, "usage_type": "call" }, { "api_name": "scrapy.Request",...
623692669
import torch from torch.utils.data import DataLoader, dataset from image_extractor import sudoku_extractor import numpy as np class Predictor(): def __init__(self): self.model = torch.load('digit_from_grid/sudoku_model.pt') def get_predictions(self, data): return self.model(data) class get...
null
digit_from_grid/bin1.1/model_class.py
model_class.py
py
1,587
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.load", "line_number": 9, "usage_type": "call" }, { "api_name": "image_extractor.sudoku_extractor", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 19, "usage_type": "call" }, { "api_name":...
398544919
import numpy as np import pandas as pd from matplotlib import pyplot as plt import datetime def timetodate(): file = pd.read_csv('../data/ratings.csv') frame = pd.DataFrame(file) print( datetime.datetime.fromtimestamp(964982400 / 1000)) print( datetime.datetime.fromtimestamp(964982224 / 1000)) pri...
null
Hm/now_.py
now_.py
py
21,897
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 10, "usage_type": "call" }, { "api_name": "dateti...
615674267
import re from pathlib import Path from setuptools import setup from setuptools_rust import Binding, RustExtension description = 'A better TOML library for python implemented in rust.' THIS_DIR = Path(__file__).resolve().parent try: long_description = (THIS_DIR / 'README.md').read_text() except FileNotFoundError...
null
setup.py
setup.py
py
1,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "re.search", "line_number": 17, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_numbe...
242567580
import json import shutil import os from os import walk from os.path import basename import zipfile from datetime import datetime defaultC3ProjectRoot = 'temp/c3Project' folders = {'c3Pack' : {'source' : '', 'root' : 'temp/c3Pack'}, 'c3Project' : {'source' : defaultC3ProjectRoot, 'root' : 'temp/c3Project'}, 'backup' ...
null
c3pm.py
c3pm.py
py
12,660
python
en
code
null
code-starcoder2
76
[ { "api_name": "zipfile.ZipFile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17,...
619737845
import os import os.path as osp from pathlib import Path import json import numpy as np import mxnet as mx from gluonts.model.lstnet import LSTNetEstimator from gluonts.trainer import Trainer from gluonts.dataset.common import TrainDatasets from gluonts.model.predictor import Predictor from data import load_multivar...
null
src/deep_demand_forecast/train.py
train.py
py
4,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
514149222
# coding:utf-8 import asyncio """ 绑定回调,在task执行完成的时候可以获取执行的结果,回调的最后一个参数是future对象,通过该对象可以获取协程返回值。 """ async def do_something(x): print("waiting: ", x) r = await asyncio.sleep(1) return "Done: %s" % x def callback(future): print("callback:", future.result()) coroutine = do_something(2) # 这里是一个协程对象,这个时候do_some...
null
Code/built_in/asyncio34/asyncio_4.py
asyncio_4.py
py
978
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 22, "usage_type": "call" } ]
520928637
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 16 14:22:28 2021 @author: caelus """ import xarray as xr import pandas as pd import matplotlib.pyplot as plt import numpy as np r_path = '/home/caelus/dock_1/Working_hub/DATA_dep/' NPGO = xr.open_dataset(r_path+'inpgo.nc',decode_times=False) NPG...
null
gather_indexes.py
gather_indexes.py
py
1,717
python
en
code
null
code-starcoder2
76
[ { "api_name": "xarray.open_dataset", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.date_range", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotl...
297250571
""" Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
null
dialogue-engine/test/programytest/parser/template/node_tests/test_base.py
test_base.py
py
3,633
python
en
code
null
code-starcoder2
76
[ { "api_name": "programytest.parser.base.ParserTestsBaseClass", "line_number": 26, "usage_type": "name" }, { "api_name": "programy.parser.template.nodes.base.TemplateNode", "line_number": 29, "usage_type": "call" }, { "api_name": "programy.parser.template.nodes.base.TemplateNode",...
367301426
from collections import defaultdict import itertools from itertools import combinations import copy import json, operator, collections from openpyxl import load_workbook from classes import implications import time import random # from random import * # try: from settings import * from general_functions import * from...
null
inference2/proofs_old_copy/lemmas.py
lemmas.py
py
36,951
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 31, "usage_type": "call" }, { "api_name": "time.time", "line_number": 66, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 110, "usage_type": "call" }, { "api_name": "collections.Counter", ...
531321839
import multiprocessing from csv import writer from datetime import datetime import math import time import os import sys Icgoal = 0.001 Ube = 0.7 Beta = 250 Temp25 = 25 Tempn15 = -15 Temp50 = 50 Ucc = 12.0 Ucegoal = 4.8 def priorytet(): #nietestowane poza Windowsem, os.system() powoduje czarne okno na początku dział...
null
aicue-projekt.py
aicue-projekt.py
py
11,375
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.getwindowsversion", "line_number": 20, "usage_type": "call" }, { "api_name": "os.system", "line_number": 26, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 26, "usage_type": "call" }, { "api_name": "os.nice", "line_number"...
194755496
import typer # use typer.run and typer.Argument def sum_numbers(a: int, b: int): """Sums two numbers""" return a + b def main( a: int = typer.Argument(1, help="The value of the first summand"), b: int = typer.Argument(2, help="The value of the second summand"), ): """ CLI that ...
null
pybites_bite353/script.py
script.py
py
443
python
en
code
null
code-starcoder2
76
[ { "api_name": "typer.Argument", "line_number": 10, "usage_type": "call" }, { "api_name": "typer.Argument", "line_number": 11, "usage_type": "call" }, { "api_name": "typer.run", "line_number": 20, "usage_type": "call" } ]
53624658
import logging import random from json import load from pathlib import Path import discord from discord.ext import commands from bot.constants import Colours log = logging.getLogger(__name__) LETTER_EMOJI = ':love_letter:' HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_h...
null
bot/exts/valentines/valentine_zodiac.py
valentine_zodiac.py
py
2,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 17, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 17, "usage_type": "name" }, { "api_name": "...
29434558
import argparser import datetime import numpy as np import numpy.random import os import tensorflow as tf from tensorflow import keras from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint from models.unet_patch import * from models.unet_dilated_v2_transposed_patch import * from data.data_patch import ...
null
src/main_patch.py
main_patch.py
py
5,755
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparser.get_parser", "line_number": 21, "usage_type": "call" }, { "api_name": "argparser.write_config_file", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow.random.set_seed", "line_number": 33, "usage_type": "call" }, { "api_n...
571600103
import numpy as np import matplotlib.pyplot as plt from netCDF4 import Dataset from scipy import interpolate, integrate from analysis_tools import downwind_rectangle, fromComponents, lcl, find_h from STASH_keys import temp_key, theta_key, q_key, w_key, u_key, v_key, zi_new_key, lcl_key, pthe_key from mpl_toolkits.axes_...
null
plot_stability_xsn.py
plot_stability_xsn.py
py
8,823
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "netCDF4.Dataset", "line_number": 20, "usage_type": "call" }, { "api_name": "STAS...
418902240
from django.conf.urls import url from django.conf.urls.static import static from django.conf import settings from questions.views import * urlpatterns = [ url(r'about', index, name='about'), url(r'ask', ask, name='ask'), url(r'(?P<question_id>[0-9]+)$', question, name='question'), url(r'tag/(?P<tag_id>...
null
questions/urls.py
urls.py
py
638
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
556248404
import numpy as np import cv2 from matplotlib import pyplot as plt image_1 = cv2.imread("image-1.png",0) image_2 = cv2.imread("image-2.png",0) cv2.imshow("image 1", image_1) cv2.imshow("image 2", image_2) image_new = np.zeros([359, 492, 2]) dft_1 = cv2.dft(np.float64(image_1),flags = cv2.DFT_COMPLEX_OUTPUT) dft_2 = ...
null
3-a.py
3-a.py
py
809
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 8, ...
66268335
import copy import itertools import pandas as pd import pytest from fgscountrate.fgs_countrate_core import FGSCountrate from fgscountrate import conversions # Create data # Aiming to match output from: fgs = FGSCountrate(guide_star_id="N13I000018"); data = fgs.query_gsc() values = ['N13I000018', 420900912, 273.207,...
null
fgscountrate/tests/test_convert_jhk.py
test_convert_jhk.py
py
17,828
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.Series", "line_number": 24, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 42, "usage_type": "call" }, { "api_name": "fgscountrate.fgs_countrate_core.FGSCountrate", "line_number": 47, "usage_type": "call" }, { ...
579887970
# -*- coding: utf-8 -*- """ Created on Tue Feb 21 11:34:08 2017 @author: Akshay """ from __future__ import division from pulp import LpProblem, LpVariable, LpMaximize, LpStatus, LpInteger, LpAffineExpression import sys import os import codecs from collections import defaultdict from math import log #from StringIO impo...
null
src/Sentence Compression/support/Compression_1.py
Compression_1.py
py
6,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "depParse.readParses", "line_number": 30, "usage_type": "call" }, { "api_name": "m...
511100404
# coding: utf-8 """Logic regarding verification of affiliations.""" from __future__ import unicode_literals import csv import flask import sqlalchemy from eisitirio import app from eisitirio.database import db from eisitirio.database import models APP = app.APP DB = db.DB def verify_affiliation(user): """Mar...
null
eisitirio/logic/affiliation_logic.py
affiliation_logic.py
py
8,714
python
en
code
null
code-starcoder2
76
[ { "api_name": "eisitirio.app.APP", "line_number": 15, "usage_type": "attribute" }, { "api_name": "eisitirio.app", "line_number": 15, "usage_type": "name" }, { "api_name": "eisitirio.database.db.DB", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ei...
306550513
#!/usr/bin/python3.5 import Image import cv2 import matplotlib.pyplot as plt import pickle import numpy as np from scipy.ndimage.measurements import label class Detection: def __init__(self, img, pickfile): dist_pickle = pickle.load(open(pickfile, "rb")) self.clf, self.X_scaler, self.is_spatial, se...
null
computer_vision_deep_learning/CarND-Vehicle-Detection-master/Detection.py
Detection.py
py
7,078
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "Image.Image", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_num...
273517371
import unittest from BaseClassAdmin import BaseClassAdmin import time from selenium import webdriver from phptravels.pages.DashboardPage import DashboardPage from phptravels.pages.DashboardTourPage import DashboardTourPage from time import sleep import Properties class NewTour(unittest.TestCase, BaseClassAdmin): ...
null
src/test/python/NewTour.py
NewTour.py
py
1,107
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "BaseClassAdmin.BaseClassAdmin", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "ap...
261171893
from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.db.models import Prefetch from django.http import Http404, HttpResponseRedirect from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import DjangoFilterBackend from rest_framewor...
null
rdmo/projects/viewsets.py
viewsets.py
py
20,152
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 46, "usage_type": "name" }, { "api_name": "rdmo.core.permissions.HasModelPermission", "line_number": 47, "usage_type": "name" }, { "api_name": "rdmo.core.permissions.HasObjectPermission", "line_number": 47, ...
105954704
""" Module for training and testing generic SVMS. feature_encoders: please see doc/Feature Encoders.md for this definition. """ from sumall_analysis_tools.machine_learning.classification import BaseClassifier from sumall_analysis_tools.utils import misc_tools import sklearn from sklearn import svm as support_vector...
null
sumall_analysis_tools/machine_learning/classification/svm.py
svm.py
py
6,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "sumall_analysis_tools.utils.misc_tools.hexdigest", "line_number": 89, "usage_type": "call" }, { "api_name": "sumall_analysis_tools.utils.misc_tools", "line_number": 89, "usage_type": "name" }, { "api_name": "sumall_analysis_tools.machine_learning.classification.Bas...
47094924
from downloader import Downloader from lxml import etree class Spider(): ''' 解析网页,提取数据 ''' def get_data(self): downloader = Downloader() html = downloader.get_html("PHPSESSID=f47jj9br11fvtld6viktf6gg24") html = etree.HTML(html) # 商品名字 names = [] html_data ...
null
spider.py
spider.py
py
824
python
en
code
null
code-starcoder2
76
[ { "api_name": "downloader.Downloader", "line_number": 8, "usage_type": "call" }, { "api_name": "downloader.get_html", "line_number": 9, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 10, "usage_type": "call" }, { "api_name": "lxml.etree", ...
341334821
import argparse import os import warnings import sys import pandas as pd import numpy as np from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score from sklearn.model_selection import train_test_split from sklearn.linear_model import ElasticNet from urllib.parse import urlparse import ml...
null
custom_ml_cls.py
custom_ml_cls.py
py
2,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_squared_error", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.metrics.mean_absolute_error", "line_number": 17, "usage_type": "call" }, { ...
612428911
from flask import Flask,request,jsonify,abort,Blueprint,make_response,Response # from .dialogflow import Dialogflow from flask_restplus import Namespace,Resource from apis.spotify import Spotify from apis.emotion_classfication_model import emotion_analysis from apis.db import db import random import base64 music_api = ...
null
BluePrint/music.py
music.py
py
5,636
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restplus.Namespace", "line_number": 9, "usage_type": "call" }, { "api_name": "apis.db.db", "line_number": 12, "usage_type": "name" }, { "api_name": "flask_restplus.Resource", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.requ...
140164423
from setuptools import setup, find_packages import os from conversion_attribution import constants from conversion_attribution.dfp.model import ModelManager def install_packages(): ''' copy init models ''' if not os.path.exists(constants.ROOT_CONF_DIR): model_dir = os.path.join(os.path.abspath...
null
setup.py
setup.py
py
1,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "conversion_attribution.constants.ROOT_CONF_DIR", "line_number": 11, "usage_type": "attribute" }, { "a...
371503217
''' GAIN function ''' import numpy as np import tensorflow as tf import math from tensorflow import math from tensorflow import keras from tqdm import tqdm from .utils import normalization, renormalization, rounding from .utils import binary_sampler, uniform_sampler, sample_batch_index def gain(data_x, gain_parameter...
null
src/tools/gain.py
gain.py
py
5,482
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.isnan", "line_number": 31, "usage_type": "call" }, { "api_name": "utils.normalization", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.nan_to_num", "line_number": 47, "usage_type": "call" }, { "api_name": "tensorflow.nn.relu",...
394493017
# -*- coding:utf-8 -* ''' 1.用一个类完成对vae的封装,能够对给定的文件夹下的图片进行特征压缩 2.实现的功能 2.1 vae整体模型训练 2.2 输入图片和压缩后生成图片的对比 2.3 完成对输入图片的压缩来提取特征 2.4 输入压缩特征来生成图片 refrence: ''' from keras.datasets import mnist from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Lambda from keras.layers import Bat...
null
TianChi/variational_autoencoder.py
variational_autoencoder.py
py
6,892
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 34, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 42, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 42, "usage_type": "name" }, { "api_name": "os.path.join", "line_number":...
314331439
from collections import Counter from yatt import BASE_CURRENCY from yatt.price import Price from yatt.position import Position from yatt.order import SuggestedOrder from yatt.exception import NotSynchronizedTickers currency_to_symbol = {'EUR': '€', 'USD': '$', 'GBP': '£'} currency_from_symbol = {'€': 'EUR', '$': 'USD...
null
yatt/portfolio.py
portfolio.py
py
4,149
python
en
code
null
code-starcoder2
76
[ { "api_name": "yatt.BASE_CURRENCY", "line_number": 17, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 27, "usage_type": "call" }, { "api_name": "collection...
598179237
from __future__ import division from __future__ import print_function from distutils.version import LooseVersion from theano import __version__ theano_less_than_6 = (LooseVersion(__version__) < LooseVersion('0.6.0') ) def compile_multiargument_function(values, args_list, args_names, parms, fname='anonymous_function...
null
dolo/compiler/function_compiler_theano.py
function_compiler_theano.py
py
2,528
python
en
code
null
code-starcoder2
76
[ { "api_name": "distutils.version.LooseVersion", "line_number": 7, "usage_type": "call" }, { "api_name": "theano.__version__", "line_number": 7, "usage_type": "argument" }, { "api_name": "dolo.compiler.common.DicPrinter", "line_number": 64, "usage_type": "call" } ]
335524184
from __future__ import division import zmq import json from twisted.internet import task from lights import LedStrip, StripEffect, Color, effects, utils, renderers from .config import Config class LightPublisher(object): def __init__(self, zmq_context): self.pub = zmq_context.socket(zmq.PUB) self....
null
lights/server/service.py
service.py
py
5,884
python
en
code
null
code-starcoder2
76
[ { "api_name": "zmq.PUB", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "config.Config", "line_number":...
242730624
from collections import deque dx = [0,0,1,-1] dy = [1,-1,0,0] # 미세 먼지들 구하기 def get_dusts(): dusts = [] for i in range(r): for j in range(c): if maps[i][j] >= 1: dusts.append([i,j,maps[i][j]]) return dusts # 퍼지는거 구현 def spread(dusts): while dusts: x,y,dus...
null
baekjoon/baekjoon17144.py
baekjoon17144.py
py
3,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 83, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 141, "usage_type": "call" }, { "api_name": "collections.de...
489099038
from datetime import datetime from os.path import dirname, join from city_scrapers_core.constants import BOARD from city_scrapers_core.utils import file_response from freezegun import freeze_time from city_scrapers.spiders.pitt_housing import PittHousingSpider test_response = file_response( join(dirname(__file__...
null
tests/test_pitt_housing.py
test_pitt_housing.py
py
2,871
python
en
code
null
code-starcoder2
76
[ { "api_name": "city_scrapers_core.utils.file_response", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "c...
367562750
# -*- coding: utf-8 -*- import random from cocos import euclid from cocos.euclid import Vector2 from ai.movement import MoveBasic import logging logger = logging.getLogger() from util import AttrDict import game class Ai(object): def __init__(self): self.owner = None self.state = AttrDict() ...
null
src/ai/basic_ai.py
basic_ai.py
py
1,046
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "util.AttrDict", "line_number": 18, "usage_type": "call" }, { "api_name": "game.Game.get_entity", "line_number": 27, "usage_type": "call" }, { "api_name": "game.Game", "...
607928839
from django.contrib.auth.models import AbstractUser from django.db import models # Create your models here. class User(AbstractUser): # 用户信息 id = models.AutoField(primary_key = True) nickname = models.CharField(max_length=20,verbose_name="昵称",null=True) telephone = models.CharField(max_length...
null
app01/models.py
models.py
py
4,002
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "...
340768573
import json import urllib.parse import urllib.request from io import BytesIO from base64 import b64encode from datetime import timedelta, datetime from PIL import Image import config FB_PAGE = "https://www.facebook.com/pg/500szempar/posts/" FB_ID = "101776716528181" # Menu image W/H ratio MENU_RATIO = 1.41 MENU_RATI...
null
provider/otszaz.py
otszaz.py
py
3,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.parse.request.urlopen", "line_number": 37, "usage_type": "call" }, { "api_name": "urllib.parse.request", "line_number": 37, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 37, "usage_type": "name" }, { "api_name": "P...
520425476
# SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring import json from ..scraper import _ParserScraper class MangaDex(_ParserScraper): imageSearch = '//img[contains(@class, "_images")]/@data-url' prevSearch = '//a[contains(@class, "_prevEpisode")]'...
null
dosagelib/plugins/mangadex.py
mangadex.py
py
4,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "scraper._ParserScraper", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 55, "usage_type": "call" } ]
537539754
# Copyright 2013 Metacloud, Inc. # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
null
keystone/assignment/controllers.py
controllers.py
py
25,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "keystone.common.conf", "line_number": 29, "usage_type": "attribute" }, { "api_name": "keystone.common", "line_number": 29, "usage_type": "name" }, { "api_name": "oslo_log.log.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "oslo...
373491252
#!/usr/bin/python # -*- coding: utf-8 -*- import optparse import json import subprocess import sys import os def execute_command(command): proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = proc.communicate()[0] return result def get_inventory(show_meta_hostvars): ...
null
lxd.py
lxd.py
py
2,162
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.Popen", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.isdir", ...
200865200
import time import traceback, sys import serial import serial.tools.list_ports from pathlib import Path import random from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt, pyqtSlot, QCoreApplication from PyQt5.QtWidge...
null
signaltest3.py
signaltest3.py
py
9,957
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 47, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", "line_number": 47, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QThread.__init__", "line_number": 56, "usage_type": "call" }, { "api_name": "...
606694371
# -*- coding: utf-8 -*- import sys has_lxml = False try: from lxml import etree as ET has_lxml = True except ImportError: if sys.version_info < (2, 7): raise ImportError('lxml required for Python versions older than 2.7') from xml.etree import ElementTree as ET from .entity import declarative_...
null
odata/metadata.py
metadata.py
py
7,771
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 9, "usage_type": "attribute" }, { "api_name": "property.IntegerProperty", "line_number": 26, "usage_type": "name" }, { "api_name": "property.IntegerProperty", "line_number": 27, "usage_type": "name" }, { "api_name":...
451022540
from datetime import datetime from django.test import TestCase from django.db.models import Q, F from pizza.models import * from conceptq import prefix class TestPrefixQs(TestCase): def setUp(self): self.tomatoes = Topping.objects.create(name="tomatoes", savory=True, introduced=datetime(1...
null
testproj/pizza/tests.py
tests.py
py
2,267
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date...
11792594
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/buzz/utils.py # Compiled at: 2019-09-06 05:45:15 # Size of source mod 2**32: 12153 bytes import multiprocessing, os, re, shutil from ...
null
pycfiles/buzz-3.1.0-py3.7/utils.cpython-37.py
utils.cpython-37.py
py
11,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm_notebook", "line_number": 54, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 55, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 59, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number":...
625285934
''' * * NOTE: REQUIRES A COMPLEMENTARY STETHOSCOPE TO FUNCTION * * Position tracking of magnet based on Finexus * https://ubicomplab.cs.washington.edu/pdfs/finexus.pdf * * - 3 Modes of operations * (1) Point-by-Point (Data Sampling) * (2) 2D Static Plot (Data Sampling) * (3) 3D Static Plot (Data Sam...
null
Software/Python/Steth Edition/STETH - [PLOT] Finexus_Method.py
STETH - [PLOT] Finexus_Method.py
py
36,522
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 150, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 156, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 162, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
173060082
from datetime import datetime from decimal import Decimal from hashlib import md5 from os import environ from typing import List from fastapi import APIRouter, Depends, HTTPException, Query from areas.shared.logic.auth import get_current_active_user from areas.shared.logic.payment import (AffiliateProgramsCalculator,...
null
src/backend/areas/storefront/routes/payment.py
payment.py
py
3,253
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_numbe...
312244277
# -*- coding: utf-8 -*- """ Game board definition and position checking @author: seanxiong """ import enum from collections import namedtuple __all__ = [ 'Board', 'Move', 'Player', ] COL_NAMES = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' class Player(enum.Enum): black = 1 white = 2 @property def oth...
null
hexapwn/board.py
board.py
py
2,924
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 19, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 83, "usage_type": "attribute" } ]
218914516
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np Deep3 = __import__('3-deep_neural_network').DeepNeuralNetwork Deep4 = __import__('4-deep_neural_network').DeepNeuralNetwork one_hot_encode = __import__('0-one_hot_encode').one_hot_encode one_hot_decode = __import__('1-one_hot_decode').one_hot_d...
null
supervised_learning/0x01-multiclass_classification/4-main.py
4-main.py
py
2,797
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 39, ...