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
29002547
import pymongo from pymongo import MongoClient import pprint import os #from swagger_server.models.vm import VM MONGO_URL = "mongodb://localhost:27017" MONGO_DATABASE = "virtual_machine" MONGO_COLLECTION = "vm" # Configuration optional default development database host #default_host = 'some-development-mongo-host' #...
null
swagger/cloudmesh/awsvm/vmdao.py
vmdao.py
py
1,400
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" } ]
286656631
from rest_framework import filters from .recommenders.CB_model import cb class ContentFilter(filters.BaseFilterBackend): def filter_queryset(self, request, queryset, view): from .models import Book book_id = request.GET.get("id", None) base_book = Book.objects.filter(uid=book_id) ...
null
backend/product/filters.py
filters.py
py
2,168
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.filters.BaseFilterBackend", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.filters", "line_number": 6, "usage_type": "name" }, { "api_name": "models.Book.objects.filter", "line_number": 12, "usage_type": "call" ...
460280714
#coding:utf-8 from flask import Flask, render_template, request, redirect, url_for import numpy as np import urllib2 import json #Global variables app = Flask(__name__) apiurl = 'https://blockchain.info/ja/ticker' data = json.load(urllib2.urlopen(apiurl)) curapi = 'http://api.aoikujira.com/kawase/json/usd' curdata = j...
null
app.py
app.py
py
1,693
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", "line_number": 1...
560155762
import numpy as np import os import h5py, pathlib os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE' import glob, json import fastmri from fastmri.data import subsample from fastmri.data import transforms, mri_data from fastmri.data import SliceDataset from torch.utils.data import DataLoader, Dataset import torch import ...
null
VN_SPIRIT/utils/dataset.py
dataset.py
py
6,855
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.utils.data.Dataset", "line_number": 20, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "h5py.File", ...
26713678
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DTS.settings") django.setup() from account.models import Member for member in Member.objects.all(): level = member.level if level == '1': member.level = '公司级重点客户' elif level == ...
null
tags/v3.0.4/tests/update_cutomer_level.py
update_cutomer_level.py
py
510
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.setdefault", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "account.models.Member...
320528313
"""empty message Revision ID: b5933bdba889 Revises: 8e17d9c049f6 Create Date: 2020-07-17 11:21:49.582582 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b5933bdba889' down_revision = '8e17d9c049f6' branch_labels = None depends_on = None def upgrade(): # ...
null
backend/migrations/versions/b5933bdba889_.py
b5933bdba889_.py
py
677
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.drop_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.add_column", "line_number": 27, "usage_type": "call" }, { "api_name": "alembic.op", ...
608683182
import os import numpy as np import pandas as pd from tqdm import tqdm from collections import Counter from pandarallel import pandarallel from utils_preprocess_title import preprocess_title from keras.preprocessing.sequence import pad_sequences pandarallel.initialize(progress_bar=True) TEST_CSV_DIR = './data/test.cs...
null
ml_test_normalization.py
ml_test_normalization.py
py
1,086
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandarallel.pandarallel.initialize", "line_number": 10, "usage_type": "call" }, { "api_name": "pandarallel.pandarallel", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_na...
372127815
import os import StringIO from unipath import Path from xhtml2pdf import pisa from django.conf import settings from django.template import Context from .models import * from mongoengine import * # Create your views here. from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import Temp...
null
o_apps/horario/views.py
views.py
py
5,459
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.TemplateView", "line_number": 25, "usage_type": "name" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 28, "usage_type": "call" }, { "api_name": "django.template.context.RequestContext", "line_number": 28, "usage_...
113454202
#!/usr/bin/env python ''' @author David Stuebe <dstuebe@asasscience.com> @file abstract_reader.py @date 03/11/13 @description An abstract class for the particle readers ''' import numpy from pystoch import util from pystoch.datatypes import DT from pystoch.readers.abstract_reader import AbstractParticleReader from pyst...
null
SyncModelRun/Push2ESRI/pystoch/pystoch/pystoch/readers/random_generator.py
random_generator.py
py
6,784
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "pystoch.readers.abstract_reader.AbstractParticleReader", "line_number": 20, "usage_type": "name" }, { "api_name": "pystoch.datatypes.DT.IDEAL_PARTICLE", "line_number": 47, "usage_...
304350436
import pytest from ..tutils import Placeholder from ..tutils import Playbook from ..tutils import reply from mitmproxy.proxy.commands import CloseConnection from mitmproxy.proxy.commands import OpenConnection from mitmproxy.proxy.commands import SendData from mitmproxy.proxy.events import ConnectionClosed from mitmpro...
null
test/mitmproxy/proxy/layers/test_udp.py
test_udp.py
py
3,740
python
en
code
null
code-starcoder2
66
[ { "api_name": "tutils.Playbook", "line_number": 22, "usage_type": "call" }, { "api_name": "mitmproxy.proxy.layers.udp.UDPLayer", "line_number": 22, "usage_type": "call" }, { "api_name": "mitmproxy.proxy.layers.udp", "line_number": 22, "usage_type": "name" }, { "ap...
367512370
import requests import json import pprint import time import re #Base Link http://services.runescape.com/m=itemdb_oldschool #API: /api/catalogue/items.json?category=1&alpha=y&page=z ''' category = '1' alpha = 'y' page = 'z' for i in range(1,12): page = str(i) link = 'http://services.runescape.com/m=itemdb_ol...
null
api2.py
api2.py
py
2,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 67, "usage_type": "call" } ]
202482780
from django import forms from django.utils.html import escape from application.presentation.utilities import NannyForm from datetime import date from application.presentation.form_fields import CustomSplitDateField from dateutil.relativedelta import relativedelta class FirstAidTrainingDetailsForm(NannyForm): """ ...
null
application/presentation/first_aid/forms/training_details.py
training_details.py
py
2,389
python
en
code
null
code-starcoder2
66
[ { "api_name": "application.presentation.utilities.NannyForm", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 17, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 17, "usage_type": "name" }, { "a...
178447575
from urllib.request import urlopen from bs4 import BeautifulSoup import datetime import re import random random.seed(datetime.datetime.now()) def getLinks(articleUrl): html = urlopen("http://en.wikipedia.org"+articleUrl) bsObj = BeautifulSoup(html,"html.parser") pattern = re.compile("^(/wiki/)((?!:).)*$")...
null
data_scraping/wikiLink.py
wikiLink.py
py
623
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.seed", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "urllib.request....
147504174
import pandas as pd import numpy as np import chainer import chainerrl import matplotlib.pyplot as plt def execute(experiment): df = preprocessing() env = build_env(df) agent = build_agent(env, experiment) learn_agent(env, agent, experiment) df_result = simulate_agent(env, agent, experiment) b...
null
investment_stocks_predict_trend/agent_2.py
agent_2.py
py
7,324
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 110, "usage_type": "call" }, { "api_name": "numpy.float32", "line_n...
438618384
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import random def rand_num(seed, a, c, m, n): result = np.zeros(n) num1 = seed for i in range(n): result[i] = num1 / 256 # print(num1) num1 = (a * num1 + c) % m return result def prob2(color): ...
null
Ch4/problems.py
problems.py
py
2,193
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 2...
632001878
#!/usr/bin/python from __future__ import print_function import cv2 as cv import numpy as np import sys import os if __name__ == '__main__': print(__doc__) try: fn = sys.argv[1] except IndexError: fn = "board.jpg" #while(1): src = cv.imread(fn) out = cv.medianBlur(src, 7) p_in = out #till here reading pho...
null
VisionCode/parts/colorFilter.py
colorFilter.py
py
766
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.medianBlur", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_numb...
519449481
import numpy as np import itertools as it import ctypes as ct class Interaction(object): """ Base Interaction class. """ def __init__(self): pass def forces(self, x, v, pairs=None): """ Main loop calculation. NOTE: This is highly experimental and slow. It is just meant to be a proof of c...
null
pexmd_test/morse.py
morse.py
py
3,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros_like", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 48, "usage_type": "call" }, { "api_name": "itertools.combinations"...
214268020
import discord, random, asyncio, chalk,re from discord.ext import commands as client from Cogs.config import conf class Event(client.Cog): def __init__(self, bot): self.b = bot @client.Cog.listener() async def on_ready(self): #When the bot is ready print("\n") print(c...
null
yuri/Cogs/events.py
events.py
py
28,881
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "chalk.green", "line_number": 13, "usage_type": "call" }, { "api_name": "Cogs.con...
460527753
''' Copyright (c) 2013 Potential Ventures Ltd Copyright (c) 2013 SolarFlare Communications Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above c...
null
cocotb/decorators.py
decorators.py
py
14,586
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.modules", "line_number": 54, "usage_type": "attribute" }, { "api_name": "cocotb.log.SimLog", "line_number": 90, "usage_type": "call" }, { "api_name": "cocotb.log.SimLog", "line_number": 92, "usage_type": "call" }, { "api_name": "cocotb.triggers....
603064702
# coding:utf-8 import random from os import listdir import numpy as np from PIL import Image def sigmoid(x): return 1 / (1 + np.exp(-x)) def diff_sigmoid(x): val = sigmoid(x) return val * (1 - val) def tanh(x): return np.tanh(x) def diff_tanh(x): val = tanh(x) return 1 - val * val de...
null
backPropagation3.py
backPropagation3.py
py
14,680
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.tanh", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.ones_like", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 3...
132445016
import sublime, sublime_plugin import json import gzip import webbrowser import threading import urllib try: import StringIO except ImportError: import io as StringIO class QueryThread (threading.Thread): PREFIX = "[StackExchangeQuery]: " def __init__(self, name, edit, view): threading.Thread....
null
StackExchangeQuery.py
StackExchangeQuery.py
py
3,227
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 12, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 16, "usage_type": "attribute" }, { "api_name": ...
536819634
from django import template import datetime from xamine.models import TimeCategory, WeeklyHours, Order, Team, User from xamine.utils import is_in_group register = template.Library() @register.simple_tag def get_patient_count(staff, week_of=datetime.date.today() - datetime.timedelta(days=datetime.date.today().weekday...
null
xamine/templatetags/get_patient_count.py
get_patient_count.py
py
1,150
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.da...
413558056
from flask import Flask, render_template, redirect, url_for, request, flash import psycopg2 from datetime import datetime, date import pymongo app = Flask(__name__) app.secret_key = 'F1askPy2000' con = psycopg2.connect(host="localhost", database="Faculty_leave_management_DB", user="postgres", password="postgres") cur...
null
main.py
main.py
py
22,379
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.redirect", "...
554353719
import numpy as np import woodwork as ww from scipy.stats import shapiro from evalml.data_checks import ( DataCheck, DataCheckAction, DataCheckActionCode, DataCheckError, DataCheckMessageCode, DataCheckWarning, ) from evalml.utils import infer_feature_types class TargetDistributionDataCheck(D...
null
evalml/data_checks/target_distribution_data_check.py
target_distribution_data_check.py
py
4,850
python
en
code
null
code-starcoder2
66
[ { "api_name": "evalml.data_checks.DataCheck", "line_number": 16, "usage_type": "name" }, { "api_name": "evalml.data_checks.DataCheckError", "line_number": 48, "usage_type": "call" }, { "api_name": "evalml.data_checks.DataCheckMessageCode.TARGET_IS_NONE", "line_number": 51, ...
499880354
#!/usr/bin/python # Copyright 2017 Google Inc. 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 # # Unless required by ...
null
neat/main.py
main.py
py
12,443
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 23, "usage_type": "call" }, { "api_name": "absl.flags.FLAGS", "line_number": 41, "usage_type": "attribute" }, { "api_name": "absl.flags", "line_number": 41, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_str...
645422779
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 31 11:28:23 2017 Code to examine average light curves of objects in certain flux bins. @author: ppxee """ ### Import required libraries ### import matplotlib.pyplot as plt #for plotting from astropy.io import fits #for handling fits #from astropy....
null
avglightcurve.py
avglightcurve.py
py
4,508
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.close", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "astropy.io.fits.open", "line_number": 22, "usage_type": "call" }, { "api_name": "astrop...
249066035
import shutil from main import conv, videoCut import os import time import json # 创建临时文件夹 def createTempFolder(): create_path = ['temp1', 'temp2'] for cpath in create_path: if not os.path.exists(cpath): os.makedirs(cpath) def createVideoFrameTemp(d2rs): tempFolder = ['temp2'] for...
null
c3onv.py
c3onv.py
py
3,106
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.makedirs", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
275848809
#!/usr/bin/env python # -*- coding: utf-8 -*- from mpi4py import MPI import numpy as np # Use default communicator. No need to complicate things. COMM = MPI.COMM_WORLD size = COMM.size rank = COMM.Get_rank() status = MPI.Status() # Collect whatever has to be done in a list. Here we'll just collect a...
null
Embarrassingly_parallel_PTP.py
Embarrassingly_parallel_PTP.py
py
1,361
python
en
code
null
code-starcoder2
66
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 9, "usage_type": "name" }, { "api_name": "mpi4py.MPI.Status", "line_number": 12, "usage_type": "call" }, { "api_name": "mpi4py.MPI", ...
654173998
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from common.models import ReleaseNotes, ReleaseStatistics, ReleaseStatisticsType from protein.models import Protein, Species from ligand.models import Ligand from structure.models import Structure from mutation.models im...
null
build/management/commands/build_release_notes.py
build_release_notes.py
py
3,201
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 16, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "os.sep.join", "line_number": 21, "usage_type": "call" }, { "api_name": ...
591594737
import numpy as np import keras from keras import Sequential, optimizers, regularizers from keras.layers import Dense from rdkit.Chem import Descriptors, MolFromSmiles from rdkit.Chem.AllChem import GetMorganFingerprintAsBitVect from rdkit import rdBase rdBase.DisableLog('rdApp.error') from sklearn.base import BaseE...
null
pIC50_predictor/pIC50_predictor/sklearn_predictor.py
sklearn_predictor.py
py
2,160
python
en
code
null
code-starcoder2
66
[ { "api_name": "rdkit.rdBase.DisableLog", "line_number": 10, "usage_type": "call" }, { "api_name": "rdkit.rdBase", "line_number": 10, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 16, "usage_type": "name" }, { "api_name": "sklea...
324332646
''' Created on 16 Aug 2016 @author: james from: http://machinelearningmastery.com/using-learning-rate-schedules-deep-learning-models-python-keras/ ''' # Two popular and easy to use learning rate schedules are as follows: # - Decrease the learning rate gradually based on the epoch. # - Decrease the learning rate using...
null
src/tutorial09_learningRateSchedule.py
tutorial09_learningRateSchedule.py
py
3,648
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 31, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.preproces...
285562752
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import datetime import warnings import math warnings.filterwarnings("ignore") from sklearn.model_selection import KFold, train_test_split, StratifiedKFold from sklearn.preprocessing import MinMaxScaler, StandardScaler from skle...
null
data/dacon/comp3/dacon01_Conv1D.py
dacon01_Conv1D.py
py
3,475
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_cs...
393049343
import json import sklearn import sqlite3 from gensim.models import word2vec , doc2vec import gensim import pickle from gensim.parsing import * from gensim.similarities.docsim import SparseMatrixSimilarity ,Similarity def preprocess(text): CUSTOM_FILTERS = [lambda x: x.lower(), strip_tags, strip_punctuation,stem_...
null
gamerecommder/search.py
search.py
py
1,463
python
en
code
null
code-starcoder2
66
[ { "api_name": "gensim.parsing.preprocess_string", "line_number": 13, "usage_type": "call" }, { "api_name": "gensim.parsing", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gensim.corpora", "line_number": 15, "usage_type": "attribute" }, { "api_name...
607030555
from rest_framework.permissions import IsAuthenticated from django.http import Http404,JsonResponse from rest_framework_simplejwt.tokens import RefreshToken from rest_framework import status from ...serializers.user_serializer import UserSerializer from rest_framework.response import Response from rest_framework.views ...
null
bouncer/api/views/auth/email_verification.py
email_verification.py
py
1,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "models.user.User.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "models.user.User.objects", "line_number": 14, "usage_type": "attribute" }, ...
257540437
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
src/fleet/azext_fleet/tests/latest/test_validators.py
test_validators.py
py
1,476
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "azure.cli.core.util.CLIError", "line_number": 21, "usage_type": "argument" }, { "api_name": "azext_fleet._validators.validate_member_cluster_id", "line_number": 22, "usage_ty...
454901909
from flask import request, jsonify, abort from sqlalchemy.orm.exc import NoResultFound from server_root import app, db, regional_db from sqlalchemy import and_, or_ from server_root.models.users.models import User, user_contacts from server_root.models.users.models import check_cur_user_token from server_root.models.me...
null
server_root/apis/v1/send_request/api.py
api.py
py
6,675
python
en
code
null
code-starcoder2
66
[ { "api_name": "server_root.regional_db.session.query", "line_number": 20, "usage_type": "call" }, { "api_name": "server_root.models.users.models.user_contacts", "line_number": 20, "usage_type": "argument" }, { "api_name": "server_root.regional_db.session", "line_number": 20, ...
168988961
import numpy as np from scipy.constants import Boltzmann, atomic_mass, hbar, electron_volt from functools import partial from scipy.constants import physical_constants from scipy.integrate import quad k_b = physical_constants['Boltzmann constant in eV/K'][0] def f_nu(nu): tmp0 = (2.0 / 3.0) * ((1.0 + nu) / (1.0...
null
cmtools/debye.py
debye.py
py
4,853
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.constants.physical_constants", "line_number": 8, "usage_type": "name" }, { "api_name": "scipy.optimize.brentq", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.finfo", "line_number": 24, "usage_type": "call" }, { "api_name": "s...
555124917
from blueprints import db from flask_restful import fields import datetime class Product(db.Model): __tablename__ = "product" product_id = db.Column(db.Integer, primary_key = True, autoincrement = True) admin_id = db.Column(db.Integer, nullable = False) product_name = db.Column(db.String(100), nullabl...
null
blueprints/product/model.py
model.py
py
1,950
python
en
code
null
code-starcoder2
66
[ { "api_name": "blueprints.db.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "blueprints.db", "line_number": 5, "usage_type": "name" }, { "api_name": "blueprints.db.Column", "line_number": 7, "usage_type": "call" }, { "api_name": "blueprints.d...
509527900
# -*- coding: utf-8 -*- from __future__ import print_function from pprint import pprint from fractions import * import numpy as np class pg_point(np.ndarray): def __new__(cls, inputarr): obj = np.asarray(inputarr).view(cls) return obj def __eq__(self, other): if type(othe...
null
proj_geom.py
proj_geom.py
py
5,672
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.cross", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ndarray.__add__", ...
143641804
# -*- coding: utf-8 -*- """ flask_jsondash.db_adapters ~~~~~~~~~~~~~~~~~~~~~~~~~~ A translation adapter for making queries between storage types. Types are either: 1. PostgreSQL json fields 2. MongoDB collections. """ import json from datetime import datetime as dt from pymongo import MongoClient from . import se...
null
flask_jsondash/db_adapters.py
db_adapters.py
py
2,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 35, "usage_type": "name" }, { "api_name": "json.load...
488486456
from crudlfap import shortcuts as crudlfap from django.conf import settings from django.conf.urls import include, re_path from django.views.static import serve urlpatterns = [ crudlfap.site.urlpattern, re_path( r'^%s(?P<path>.*)$' % settings.STATIC_URL.lstrip('/'), serve, kwargs=dict(d...
null
src/crudlfap_example/urls.py
urls.py
py
544
python
en
code
null
code-starcoder2
66
[ { "api_name": "crudlfap.shortcuts.site", "line_number": 8, "usage_type": "attribute" }, { "api_name": "crudlfap.shortcuts", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf.urls.re_path", "line_number": 9, "usage_type": "call" }, { "api_name": ...
153281024
"""Translates one or all of the english source files to target language """ from argparse import ArgumentParser, ArgumentTypeError, Namespace from dataclasses import fields from pathlib import Path from languages import Language, LanguageCollection, source_language, target_language from tqdm import tqdm from translat...
null
# Development/tools/machine_translation/main.py
main.py
py
3,426
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "languages.target_language", "line_number": 27, "usage_type": "name" }, { "api_name": "pathli...
463807741
import string import pyperclip ALPHABET = list(string.ascii_uppercase) def main(): print('Vigenère Cipher') print('The Vigenère cipher is a polyalphabetic substitution cipher that was powerful enough to remain unbroken for centuries.') print('Do you want o (e)ncrypt of (d)ecrypt?') while True: ...
null
Chapter_80_VigenereCipher/VigenereCipher.py
VigenereCipher.py
py
2,319
python
en
code
null
code-starcoder2
66
[ { "api_name": "string.ascii_uppercase", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pyperclip.copy", "line_number": 54, "usage_type": "call" }, { "api_name": "pyperclip.copy", "line_number": 75, "usage_type": "call" } ]
176607147
import asyncio # swap a = 1 b = 2 a, b = b, a print(a, ' and ', b) # inequality if 3 < 5 < 7: print('3 < 5 < 7') # document help(asyncio.run) # instance of print(type(lambda x: 1)) print(type(asyncio.get_event_loop())) class Xyz: id = None name = None def __init__(self, id, name): self.id ...
null
practice/trick.py
trick.py
py
863
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.run", "line_number": 14, "usage_type": "attribute" }, { "api_name": "asyncio.get_event_loop", "line_number": 17, "usage_type": "call" } ]
516023051
import os import pathlib import subprocess # Local imports from .common import PARTICLE_DEPS, running_on_windows, particle_cli, projectFiles from .common import ProcessError, ProjectError, UserError, min_particle_env from .manifest import load_manifest, get_manifest_value from .project import get_settings, check_libra...
null
neopo/build.py
build.py
py
6,182
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
205191116
import serial import time from postRequest import * def readGasSensor(ser): b = "\r".encode() ser.write(b) line = ser.readline().decode('utf-8') values = line.split(", ") return float(str(values[1]))/1000.0 def run(): serials = [] for x in range(5): serials.append(serial.Seria...
null
sendGas.py
sendGas.py
py
1,431
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 54, "usage_type": "call" } ]
461582388
from numpy import zeros, linspace import matplotlib.pyplot as plt # Time unit: 1 h beta = 10./(40*8*24) gamma = 3./(15*24) dt = 0.1 # 6 min D = 30 # Simulate for D days N_t = int(D*24/dt) # Corresponding no of hours t = linspace(0, N_t*dt, N_t+1) S = zeros(N_t+1) I = zeros(N_t+1) R = zeros...
null
Programming_for_Computations/SIR1.py
SIR1.py
py
752
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number...
623969504
import os, subprocess,sys,commands from time import strftime from datetime import date import socket import json ### Utility Methods and Global Variables ### sys.path.append(os.environ['OPENCMISSEXAMPLES_ROOT']) hostname = socket.gethostname() def append_path(prefix, suffix) : if (not prefix.endswith("/")) : ...
null
noseMain.py
noseMain.py
py
6,875
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.gethostname", ...
107774680
# ------------------------- # Project: Deep Q-Learning on Flappy Bird # Author: Flood Sung # Date: 2016.3.21 # ------------------------- import cv2 import sys sys.path.append("game/") import wrapped_flappy_bird as game from BrainDQN_Nature import BrainDQN import numpy as np import neat import gym import visualize CON...
null
My_FlappyBird/FlappyBirdGA.py
FlappyBirdGA.py
py
4,326
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "neat.Config", "line_number": 26, "usage_type": "call" }, { "api_name": "neat.DefaultGenome", "lin...
554172713
from __future__ import print_function, division from torch.autograd import Variable import numpy as np import cv2 import os import torch import io import pandas as pd import helper as helper from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import random import imgaug as ia fro...
null
scripts/dataset.py
dataset.py
py
7,479
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.utils.data.Dataset", "line_number": 20, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "...
146548865
import os import requests import json from bs4 import BeautifulSoup if "DEFINING VARIABLES IN CURRENT NAMESPACE": reviewstring = "https://www.rottentomatoes.com/m/{movie}/reviews/?page={page}&type={reviewer_type}&sort=" reviewpage = reviewstring.format CRITIC, TOP_CRITIC, USER = range(3) html_param = {...
null
__main__.py
__main__.py
py
6,574
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 27, "usage_type": "attribute" }, { "api_name": "requests.exceptions", "line_number": 28, "usage_type": "attribute" }, { "api_name": "reques...
126856163
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import os from .visual import individual from .visual import profusion from .visual.common import hp_kwargs_generator from .visual...
null
benchmark/COMPARE/S3D2/REG-Marginal.py
REG-Marginal.py
py
2,849
python
en
code
null
code-starcoder2
66
[ { "api_name": "visual.common.make_hp_table", "line_number": 25, "usage_type": "call" }, { "api_name": "hyper_parameters.REG_M_HP", "line_number": 25, "usage_type": "argument" }, { "api_name": "loader.REGLoader", "line_number": 25, "usage_type": "argument" }, { "ap...
74690352
from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QGraphicsView, QApplication class SlideGraphicsView(QGraphicsView): def __init__(self, scene, *args, zoomhandler=None, **kwargs): super().__init__(scene, *args, **kwargs) self.zoom_handler = None def setZoomhandler(self, zoomhandler): ...
null
histoslider/slide_viewer/SlideGraphicsView.py
SlideGraphicsView.py
py
1,950
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QGraphicsView", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication.keyboardModifiers", "line_number": 43, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 43, "usage_type...
454810726
from keras.applications.resnet50 import ResNet50 from keras.preprocessing import image from keras.applications.resnet50 import preprocess_input from keras.models import Model import numpy as np import time import cv2 def collect_demo(path, num_patch, aux_dim, action_dim): for i in range(num_patch): path_...
null
wgail_info_2/preprocess.py
preprocess.py
py
3,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.float32", "line_...
621594947
# Copyright 2019-2020 SURF. # 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 writing, soft...
null
orchestrator/api/api_v1/endpoints/subscriptions.py
subscriptions.py
py
7,258
python
en
code
null
code-starcoder2
66
[ { "api_name": "fastapi.routing.APIRouter", "line_number": 44, "usage_type": "call" }, { "api_name": "structlog.get_logger", "line_number": 46, "usage_type": "call" }, { "api_name": "orchestrator.db.SubscriptionTable", "line_number": 49, "usage_type": "name" }, { "...
172221184
#!/usr/bin/env python3 import numpy as np import argparse import random import os from collections import Counter import math parser = argparse.ArgumentParser(description='Calculates WER on each Line from the provided two text files') parser.add_argument('input_1', help="Hypotheses, your Text to evaluate against grou...
null
Walkest1_Code/Base_Model_Google_API/script_Google_Evaluate.py
script_Google_Evaluate.py
py
5,014
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.splitext...
188276977
import subprocess import re import csv import os import time import shutil from datetime import datetime # 创建一个空列表 active_wireless_networks = [] # 测试ESSID是否已在列表文件中 def check_for_essid(essid, lst): check_status = True # 如果列表中没有ESSID,则添加该行 if len(lst) == 0: return check_status # 仅当列表中有无线访问点时,此...
null
WIFIDOS/wifidos.py
wifidos.py
py
5,938
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.keys", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 39, "usage_type": "call" }, { "api_name": "os.getcwd", "line_numb...
37552251
from typing import List, Optional, Dict import json import asyncio import logging import argparse import uvloop from concurrent.futures import ThreadPoolExecutor from ..utils import tqdm from . import Transfer, Copier from .router_fs import RouterAsyncFS from .utils import make_tqdm_listener async def copy(*, ...
null
hail/python/hailtop/aiotools/copy.py
copy.py
py
4,488
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Optional", ...
271458925
"""config objects and session objects to build decoders, caches and all kinds of other useful things for retro-conversion. """ from pathlib import Path import libaaron import deromanize import enum from . import filters from .decode import Decoder from typing import NamedTuple CACHE_NAMES = "DIN1982", "LOC/ALA", "phon...
null
arc/config.py
config.py
py
8,578
python
en
code
null
code-starcoder2
66
[ { "api_name": "deromanize.Config", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 29, "usage_type": "call" }, { "api_name": "pathlib.Path", "...
342606330
import os import sys import tempfile from collections import Counter import mock import pytest from prequ._pip_compat import path_to_url, url_to_path from prequ.exceptions import IncompatibleRequirements from prequ.sync import dependency_tree, diff, merge, sync from prequ.utils import get_ireq_version, key_from_dist,...
null
tests/test_sync.py
test_sync.py
py
12,212
python
en
code
null
code-starcoder2
66
[ { "api_name": "mock.patch.object", "line_number": 17, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mock.patch", ...
650735597
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
null
seeseehome/linkboard/migrations/0001_initial.py
0001_initial.py
py
1,047
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": 11, "usage_type": "call...
556112362
''' Named Placeholder ''' import sqlite3 conn = sqlite3.connect("C:/CodeLab/SQLite/sqlite-shell/test.db") cur = conn.cursor() # where 절의 :Id 가 Named Placeholder입니다. # 이 Id의 값은 execute() 메서드의 두번째 파라미터에 지정됩니다. # 이 값은 Tuple이 아닌 Dictionary 형태로 Id 값이 지정된다. sql = "SELECT * FROM customer WHERE id = :Id" # 첫번째 파라미터에...
null
PythonData/src/ch-SQLite/ex04.py
ex04.py
py
616
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" } ]
151677745
# -*- coding: utf-8 -*- """Identify common checkmate patterns in games. Identifies all games in a PGN file that ended in a common checkmate pattern. Currently identifiable patterns: back rank, hook, Anastasia's, Arabian, smothered. Mostly adapted from Thibault's Duplessis code for Lichess puzzles v2: https:/...
null
R/Python/checkmate_patterns.py
checkmate_patterns.py
py
7,671
python
en
code
null
code-starcoder2
66
[ { "api_name": "chess.Board", "line_number": 37, "usage_type": "call" }, { "api_name": "chess.square_rank", "line_number": 45, "usage_type": "call" }, { "api_name": "chess.SquareSet.from_square", "line_number": 46, "usage_type": "call" }, { "api_name": "chess.Squar...
21221340
# Práctica final RNA from __future__ import print_function import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Activation, Reshape from keras.optimizers import SGD from keras.layers.normalization import BatchNormalization as BN from keras.layers import Gauss...
null
RNA/DA.py
DA.py
py
3,387
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 19, "usage_type": "name" }, { "api_name": "keras.utils.to_categorical", "line_number": 40, "usage_type": "call" }, { "ap...
643302232
import requests, sys import ssl import base64 import json from aip import AipFace #得到acess_token验证码 url = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=LwciGoB63nAAYnB8PHi4kSoU&client_secret=aAtGzvxaUP83aOR1bOhy1pVfiD93sGNx' d = {'Content-Type':'application/json','charset':'UTF-8'}...
null
百度人脸识别api/模板.py
模板.py
py
1,937
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 10, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 33, "usage_type": "call" } ]
134439660
#!/usr/bin/env python import os import jinja2 import webapp2 from models import Models template_dir = os.path.join(os.path.dirname(__file__), "templates") jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir), autoescape=False) class BaseHandler(webapp2.RequestHandler): def write(self, *...
null
main.py
main.py
py
3,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line...
161156114
import aiohttp import asyncio import time from time import struct_time, localtime from src.util.config import load_config from src.util.default_root import DEFAULT_ROOT_PATH from src.util.byte_types import hexstr_to_bytes from src.rpc.full_node_rpc_client import FullNodeRpcClient def make_parser(parser): parser...
null
src/cmds/netspace.py
netspace.py
py
4,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.struct_time", "line_number": 41, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 41, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 42, "usage_type": "call" }, { "api_name": "src.util.config.load_co...
276282345
import logging from logging.handlers import RotatingFileHandler import configration class Logger(object): def __init__(self): pass @staticmethod def get_logger(name): log = logging.getLogger(name) if log.handlers: return log else: config = configra...
null
common/logger.py
logger.py
py
818
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "configration.ConfigurationHolder", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "...
557215075
""" Collection of microservices on top of tokenize-uk python module. tokenize-uk uses regexes and rules to tokenize text into paragraphs, paragraphs into sentences and sentences into words. """ from aiohttp import web from aiohttp_validate import validate from aiohttp_swaggerify import swaggerify, document from tokeni...
null
app.py
app.py
py
1,659
python
en
code
null
code-starcoder2
66
[ { "api_name": "tokenize_uk.tokenize_text", "line_number": 48, "usage_type": "call" }, { "api_name": "aiohttp_validate.validate", "line_number": 22, "usage_type": "call" }, { "api_name": "schema.TOKENIZE_TEXT_INPUT_SCHEMA", "line_number": 23, "usage_type": "name" }, { ...
283360165
from __future__ import print_function from pyimagesearch.descriptors import DetectAndDescribe from pyimagesearch.ir import BagOfVisualWords from pyimagesearch.localbinarypatterns import LocalBinaryPatterns from pyimagesearch.object_detection.helpers import sliding_window_double,sliding_window from pyimagesearch.object...
null
src/train_hs.py
train_hs.py
py
8,411
python
en
code
null
code-starcoder2
66
[ { "api_name": "h5py.File", "line_number": 45, "usage_type": "call" }, { "api_name": "pickle.loads", "line_number": 59, "usage_type": "call" }, { "api_name": "pyimagesearch.localbinarypatterns.LocalBinaryPatterns", "line_number": 60, "usage_type": "call" }, { "api_...
123626833
import pygame import random import math # resting sprite background = pygame.image.load("start.png") class Player(object): walk_right_mouse = [pygame.image.load("mouse/tile003.png"), pygame.image.load("mouse/tile004.png"), pygame.image.load("mouse/tile005.png")] walk_left_mouse = [p...
null
chars.py
chars.py
py
7,401
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.image", ...
340566967
# # Copyright (C) 2011 Red Hat, Inc. # Copyright (C) 2011 Cole Robinson <crobinso@redhat.com> # # Python implementation of autodrawer, originally found in vinagre sources: # http://git.gnome.org/browse/vinagre/tree/vinagre/view # Copyright (c) 2005 VMware Inc. # # This program is free software; you can redistribute it ...
null
lib/autodrawer.py
autodrawer.py
py
18,636
python
en
code
null
code-starcoder2
66
[ { "api_name": "gi.require_version", "line_number": 27, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.Box", "line_number": 45, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 45, "usage_type": "name" }, { "api_name": "gi.re...
646837550
from django.shortcuts import render from django.http import HttpResponse import requests def home_page(request): print("REQUEST: ", request) url = "https://jikan1.p.rapidapi.com/search/anime" querystring = {"q": "sword"} headers = { 'x-rapidapi-host': "jikan1.p.rapidapi.com", 'x-r...
null
rec_webapp/content/views.py
views.py
py
538
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.request", "line_number": 20, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 22, "usage_type": "call" } ]
179336937
import calendar from datetime import datetime, timedelta import os import json from cStringIO import StringIO import time import urllib2 from django.conf import settings import fudge from fudge.inspector import arg import jwt import mock from nose.tools import eq_ from requests.exceptions import RequestException, Tim...
null
mkt/inapp_pay/tests/test_tasks.py
test_tasks.py
py
14,172
python
en
code
null
code-starcoder2
66
[ { "api_name": "mkt.inapp_pay.tests.test_views.PaymentTest", "line_number": 26, "usage_type": "name" }, { "api_name": "users.models.UserProfile.objects.get", "line_number": 32, "usage_type": "call" }, { "api_name": "users.models.UserProfile.objects", "line_number": 32, "us...
563641422
# coding:utf-8 import sys from setuptools import setup, find_packages kwargs = {} install_requires = [] version = '1.6.0.7' if sys.version_info < (3, 0): with open('README.md') as f: kwargs['long_description'] = f.read() with open('requirements.txt') as f: for require in f: inst...
null
setup.py
setup.py
py
1,339
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.version_info", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.platform.startswith", "line_number": 27, "usage_type": "call" }, { "api_name": "s...
362662001
""" Download dataset, extract, and remove zip file. """ import os import urllib.request import zipfile filename = 'data.zip' url = 'http://vips.sci.univr.it/research/fformation/download/data.zip' response = urllib.request.urlopen(url) with open(filename, 'wb') as f: f.write(response.read()) with zipfile.ZipFile(...
null
get_dataset.py
get_dataset.py
py
379
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.request.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_nam...
554477403
#!/usr/bin/env python """ @package mi.idk.instrument_agent IDK Instrument resource agent @file mi/idk/instrument_agent.py @author Bill French @brief Speciaized instrument agent for the IDK to trap event and publish. In the IDK we don't test all the way to a data granule, but stop at the data particle. This is so if ...
null
mi/idk/instrument_agent.py
instrument_agent.py
py
2,102
python
en
code
null
code-starcoder2
66
[ { "api_name": "ion.agents.instrument.instrument_agent.agents", "line_number": 26, "usage_type": "attribute" }, { "api_name": "ion.agents.instrument.instrument_agent", "line_number": 26, "usage_type": "name" }, { "api_name": "ion.agents.instrument.instrument_agent.agents.instrumen...
190273897
"""BCP Server interface for the MPF Media Controller""" # bcp_server.py # Mission Pinball Framework # Written by Brian Madden & Gabe Knuth # Released under the MIT License. (See license info at the end of this file.) # The Backbox Control Protocol was conceived and developed by: # Quinn Capen # Kevin Kelm # Gabe Knuth...
null
mpf/media_controller/core/bcp_server.py
bcp_server.py
py
6,587
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 24, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 38, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 38, "usage_type": "attribute" }, { "api_name": ...
265846969
from flask import Flask app = Flask(__name__) from flask import render_template, request, redirect, url_for from Ornament_group import game import os from werkzeug.utils import secure_filename @app.route("/") def main(): return render_template('ornament_group.html') def allowed_file(filename): return '...
null
app.py
app.py
py
2,875
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 2, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.reque...
39879775
import os import matplotlib.pyplot as plt import statsmodels.api as sm # from scipy.fftpack import fft, ifft from numpy.fft import fft from matplotlib.pylab import mpl import numpy as np import image_enhance from statsmodels.tsa.stattools import adfuller from statsmodels.tsa.stattools import coint # # mode = 'zone' #...
null
fft_test4.py
fft_test4.py
py
11,478
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.load", "line_number": 83, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 84, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 87,...
466860607
import os import MySQLdb import MySQLdb.cursors import requests from itertools import groupby from operator import itemgetter from dataset import Dataset def get_db_connection(): mysql_host = os.getenv('DB_HOST', '127.0.0.1') mysql_user = os.getenv('DB_USER', '') mysql_password = os.getenv('DB_PASSWORD', ...
null
backend/cron_jobs/pay_provider/pay_provider.py
pay_provider.py
py
2,056
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, ...
445003479
import requests from bs4 import BeautifulSoup import json def get_data(url): HEADERS = { 'Accept': 'text/html, */*; q=0.01', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'ru,en;q=0.9', 'Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win...
null
parser.py
parser.py
py
1,278
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 30, "usage_type": "call" } ]
289253046
# -*- coding: utf-8 -*- """ Module to interact with a Focus EVC300 module. Uses the pySerial module to communicate with the device. Assumes the address is of the form COM<xx> where <xx> is the relevant port. Version 1.0 (2023-02-27) Daan Wielens - Researcher at ICE/QTM University of Twente d.h.wielens@utwente.nl """ ...
null
instruments/EVC300.py
EVC300.py
py
4,287
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 20, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 23, "usage_type": "attribute" } ]
458216520
# -*- coding: utf-8 -*- # AZ | May 25th, 2015 from scrapy.item import Item from scrapy.item import Field class HotelPage(Item): hotel_name = Field() # Name of the hotel. hotel_link = Field() # Link to the hotel page. hotel_stars = Field() # Number of hotel's stars hotel_reviews = Field() ...
null
TA_master/items.py
items.py
py
1,585
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.item.Item", "line_number": 7, "usage_type": "name" }, { "api_name": "scrapy.item.Field", "line_number": 8, "usage_type": "call" }, { "api_name": "scrapy.item.Field", "line_number": 9, "usage_type": "call" }, { "api_name": "scrapy.item.Field",...
547466954
from django import template from django.utils.safestring import mark_safe import markdown2 from courses.models import Course register = template.Library() # better way to register tag @register.simple_tag def newest_course(): """Get most recent course added to library.""" # This is a simple tag, which retur...
null
Learn_Django/_08_Customizing_Django_Templates/courses/templatetags/course_extras.py
course_extras.py
py
1,540
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "courses.models.Course.objects.latest", "line_number": 16, "usage_type": "call" }, { "api_na...
575170202
import requests def get_deconz_info(domain="sensors"): try: request_string = "http://192.168.1.45:40850/api/1C17E08298/" + domain r = requests.get(request_string) if r.status_code != 200: print("\nThere was a problem downloading from Deconz, error code: ", r.status_code) exc...
null
apicode6.py
apicode6.py
py
3,846
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
169311322
""" Implementation taken from: https://github.com/locuslab/TCN and modified to work with 2D inputs """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm from LongTermClassificationMain.Models.model_utils import ReversalGradientLayerF class Ch...
null
LongTermClassificationMain/Models/raw_TCN_no_BN.py
raw_TCN_no_BN.py
py
6,126
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
159352261
import io import numpy as np from PIL import Image import deep_dream def save_image(img, name): im = np.array(img) fft_mag = np.abs(np.fft.fftshift(np.fft.fft2(im))) visual = np.log(fft_mag) visual = (visual - visual.min()) / (visual.max() - visual.min()) result = Image.fromarray((visual * 255).astype(np.u...
null
TraeumeTiefAllein.py
TraeumeTiefAllein.py
py
853
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.fft.fftshift", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number...
215738121
from lib.hand_eval import convert_string_to_int from Global import State from lib.starting_hands import classify_hole, HoleScorer from random import random SEAT1 = 1 SEAT2 = 2 SEAT3 = 3 TWO_PLAYERS = 2 THREE_PLAYERS = 3 PLAY_PREFLOP = .3 UTG_EXTRA = .1 RAISE_UTG = .75 MIN_RAISE_UTG = .85 UTG_BLUFF = .02 SB_EXTRA = ...
null
players/v3/Preflop.py
Preflop.py
py
13,028
python
en
code
null
code-starcoder2
66
[ { "api_name": "lib.hand_eval.convert_string_to_int", "line_number": 72, "usage_type": "call" }, { "api_name": "Global.State.timebank", "line_number": 94, "usage_type": "attribute" }, { "api_name": "Global.State", "line_number": 94, "usage_type": "name" }, { "api_n...
198814755
import requests #Getting the HTML of the website: url= 'https://en.wikipedia.org/wiki/List_of_Asian_countries_by_area' # requesting HTML of the website: response = requests.get(url).text from bs4 import BeautifulSoup soup = BeautifulSoup(response,'lxml') #print(soup.prettify()) #to check the connection #extracting ...
null
wikiscraping.py
wikiscraping.py
py
921
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "call" } ]
426452785
import requests from bs4 import BeautifulSoup from googletrans import Translator from pprint import pprint import pandas as pd import re, os from requests_testadapter import Resp from fetch_urls import get_item_details class LocalFileAdapter(requests.adapters.HTTPAdapter): def build_response_from_file(s...
null
main.py
main.py
py
3,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.adapters", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.getsize", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests_testadap...
283817484
from datetime import datetime from AER_experimentalist.experiment_environment.IV_in_silico import IV_In_Silico as IV from AER_experimentalist.experiment_environment.DV_in_silico import DV_In_Silico as DV from AER_experimentalist.experiment_environment.variable import outputTypes as output_type from AER_experimentalist....
null
run_weber_original_study_slurm.py
run_weber_original_study_slurm.py
py
4,850
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "AER_e...
627523988
from abc import ABC from typing import Tuple from main.model.character.alignment import Alignment from main.model.character.utility.enumerators.size import Size from test_helper.race_test_helper import RaceTestHelper class HalflingTestHelper(RaceTestHelper, ABC): def _test_halfling_init( self, ...
null
test_helper/races/halfling_test_helper.py
halfling_test_helper.py
py
2,945
python
en
code
null
code-starcoder2
66
[ { "api_name": "test_helper.race_test_helper.RaceTestHelper", "line_number": 9, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 12, "usage_type": "name" }, { "api_name": "main.m...
202135817
from math import pi import time import pandas as pd import matplotlib.pyplot as plt import odrive from odrive.enums import * from control.trajectory import * import calibrate import configure import archive_pandas import trajectory name_plot = "" def gains_iterator(odrv, kp_min=25, kp_max=25, kv_min=250/1000, kv_ma...
null
Odrive_control/archive/archive_data.py
archive_data.py
py
3,563
python
en
code
null
code-starcoder2
66
[ { "api_name": "archive_pandas.build_raw", "line_number": 21, "usage_type": "call" }, { "api_name": "trajectory.build_trajectory", "line_number": 22, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 22, "usage_type": "name" }, { "api_name": "configur...
413848795
import numpy as np import cv2 cap = cv2.VideoCapture(0) face_cascade = cv2.CascadeClassifier('E:/visual studio/share/Python37_64/Lib/site-packages/cv2/data/haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('E:/visual studio/share/Python37_64/Lib/site-packages/cv2/data/haarcascade_eye.xml') ...
null
student/yzy/opencv_facetracking.py
opencv_facetracking.py
py
1,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.line", ...
115539358
# importing the required packages import re import string import numpy as np from random import shuffle from nltk.stem import PorterStemmer import matplotlib.pyplot as plt from collections import Counter # convert data to one-hot encoding format # 0-ham 1-spam encoding used def one_hot_enc(): for i in train: token...
null
15CS10053_ML_A2/b.py
b.py
py
10,524
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 14, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 26, "usage_type": "call" }, { "api_name": "string.punctuation", "line_...
60960302
import os from flask import Flask, render_template, send_from_directory def create_app(config_path): # setup flask app = Flask('jazzband') @app.errorhandler(404) def page_not_found(e): return render_template('error.html'), 404 @app.errorhandler(403) def forbidden(error): retu...
null
jazzband/app.py
app.py
py
2,944
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_t...
186984379
from sklearn.feature_extraction.text import TfidfVectorizer from nltk.corpus import cess_esp as cess from nltk import UnigramTagger as ut import pandas as pd from scipy import spatial import numpy as np from sklearn.metrics import pairwise_distances from sklearn.metrics.pairwise import cosine_similarity from scipy.spa...
null
devItems/ETICodeOnGit/restructure/changeConfig/pca_tfidf_i_textAndPOS_combineFeatures.py
pca_tfidf_i_textAndPOS_combineFeatures.py
py
7,041
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_num...
396427451
import numpy as np from sklearn.metrics import confusion_matrix, roc_curve from sklearn.metrics import recall_score, roc_auc_score from sklearn.metrics import precision_recall_curve, average_precision_score from sklearn.preprocessing import StandardScaler import argparse import IPython import _pickle as pickle from in...
null
scripts/thresholds/get_thresholds.py
get_thresholds.py
py
3,445
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", ...
424857536
"""Minimal settings needed for tests.""" import os path_to_repo = os.path.dirname((os.path.dirname(os.path.abspath(__file__)))) def pytest_configure(): from django.conf import settings settings.configure( DEBUG=True, DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', ...
null
tests/conftest.py
conftest.py
py
892
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.settings.config...