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
253221865
# -*- encoding: utf-8 -*- ######################################################################### # Copyright (C) 2016 Ing. Harry Alvarez, Elitum Group # # # # This program is free software: you can redistribute it and/or modify ...
null
elitum_compras/report_py3o/reportes.py
reportes.py
py
7,647
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "odoo.models.TransientModel", "line_number": 37, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 37, "usage_type": "name" }, { "api_name": "odoo.fi...
582700418
import os import cv2 import numpy import os def bitOperation(locations,img1): img2 = cv2.imread(os.getcwd().replace('\\','/')+'/models/virus.png') for x1,y1,x2,y2 in locations: if x2-x1 > y2-y1: #img2 = cv2.resize(img2, dsize=(x1-x2, x1-x2), interpolation=cv2.INTER_AREA) img2 = cv2.resize(img2, ...
null
models/convention.py
convention.py
py
993
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 11,...
225183819
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F ############################################################################## # reprojection loss ############################################################################## def compute_reprojection_map(pred, target, ...
null
_Costfunc/base_confunc.py
base_confunc.py
py
7,717
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.abs", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.ReplicationPad2d", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 38, "usage_type": "name" }, { "api_name": "torch.nn.ReplicationPad2...
264903431
import spacy from nltk.corpus import stopwords import openpyxl import re from nltk.corpus import stopwords import spacy from nltk import Tree from nltk.stem.snowball import SnowballStemmer import string EXCEL_IN = 'sample.xlsx' EXCEL_OUT = 'sample.xlsx' common = ['scary', 'sleep', 'head', 'prolactin', 'night', 'echo...
null
make_roots/make_roots.py
make_roots.py
py
4,843
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 39, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 39, "usage_type": "attribute" }, { "api_name": "re.split", "line_number": 41, "usage_type": "call" }, { "api_name": "re.split", "line_number":...
192104705
import json from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.shortcuts import redirect, render from django.views import View from .filters impor...
null
store/views.py
views.py
py
5,025
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Category.get_all_categories", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Category", "line_number": 19, "usage_type": "name" }, { "api_name": "models.Product.get_products_by_Categoryid", "line_number": 23, "usage_type": "call" ...
593219200
#!/usr/bin/env python # # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in...
null
troposhpere/NFS_Server.py
NFS_Server.py
py
22,807
python
en
code
null
code-starcoder2
66
[ { "api_name": "troposphere.Template", "line_number": 46, "usage_type": "call" }, { "api_name": "troposphere.Ref", "line_number": 65, "usage_type": "call" }, { "api_name": "troposphere.Ref", "line_number": 66, "usage_type": "call" }, { "api_name": "troposphere.Ref"...
56344679
# coding:utf-8 import jieba.analyse import numpy as np # 打开词典文件,返回列表 def open_dict(Dict='name', path=r'data/Textming'): path = path + '%s.txt' % Dict dictionary = open(path, 'r', encoding='utf-8') dict = [] for word in dictionary: word = word.strip('\n') dict.append(word) ...
null
NLP2.py
NLP2.py
py
7,742
python
en
code
null
code-starcoder2
66
[ { "api_name": "jieba.analyse.lcut", "line_number": 49, "usage_type": "call" }, { "api_name": "jieba.analyse", "line_number": 49, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 142, "usage_type": "call" }, { "api_name": "numpy.sum", "line_n...
235764502
# Copyright 2015 Metaswitch Networks # # 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 w...
null
calico_containers/tests/st/workload.py
workload.py
py
5,061
python
en
code
null
code-starcoder2
66
[ { "api_name": "netaddr.IPAddress", "line_number": 70, "usage_type": "call" }, { "api_name": "netaddr.IPAddress", "line_number": 108, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 123, "usage_type": "call" }, { "api_name": "utils.retry_u...
109239901
import pickle import socket from threading import Thread, Event from data import Data from user import User from utils import recvcmd, log, BUFFSIZSE DATAFILE = 'data.pkl' class Server(): """ Instance Messanger server for managing all connections and data. """ def __init__(self, host, port): super(Se...
null
server.py
server.py
py
13,913
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Event", "line_number": 19, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 24, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 24, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM"...
218613891
# Nathan Welch # Data Mining Hw 1 # 9/5/18 import random import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt pd.set_option('display.expand_frame_repr', False) pd.set_option('display.max_rows', 1400) train_df = pd.read_csv('train.csv') test_df = pd.read_csv('test.csv') combine...
null
data_mining/hw1/hw1.py
hw1.py
py
3,428
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.set_option", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv",...
236971621
#!/usr/bin/env python # coding: utf-8 # In[ ]: # данный скрипт: ## - высчитывает еженедельный чарт ВК/BOOM ## - должен запускаться один раз в неделю утром пятницы после Youtube_parsing и Spotify_parsing ## соединяет получающиеся чарты в единый html файл для публикации на сайте (включая "настоящие" еженедельные чарт...
null
Daily/Make_weekly_vk.py
Make_weekly_vk.py
py
7,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "Make_weekly_charts_functions.average", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 67, "usage_type": "call" }, { "api_name": "...
443329758
import os import datetime basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' SQLALCHEMY_DATABASE_URI = 'mysql://estasney:password@localhost:3306/profiles2?charset=utf8mb4' SQLALCHEMY_TRACK_MODIFICATIONS = True ...
null
mysite/site_config.py
site_config.py
py
2,426
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ.get", "line_...
563978506
import requests from multiprocessing.dummy import Pool url = 'http://localhost:8080/girl' def req_split(r): #requests.head is much faster than requests.get if your intention is only to get the status code req = requests.get(url) if req.status_code == 200: temp = r #return the url string if the serv...
null
multi-thread_request.py
multi-thread_request.py
py
488
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "multiprocessing.dummy.Pool", "line_number": 18, "usage_type": "call" } ]
319389398
import os from gym import envs, logger SKIP_MUJOCO_V3_WARNING_MESSAGE = ( "Cannot run mujoco test because mujoco-py is not installed" ) skip_mujoco_v3 = False try: import mujoco_py except ImportError: skip_mujoco_v3 = True def should_skip_env_spec_for_tests(spec): # We skip tests for envs that requ...
null
tests/envs/spec_list.py
spec_list.py
py
1,284
python
en
code
null
code-starcoder2
66
[ { "api_name": "gym.logger.warn", "line_number": 43, "usage_type": "call" }, { "api_name": "gym.logger", "line_number": 43, "usage_type": "name" }, { "api_name": "gym.envs.registry.all", "line_number": 50, "usage_type": "call" }, { "api_name": "gym.envs.registry", ...
157647876
__author__ = 'kelly' """ General simple logging """ import datetime class data_logging: # First the properties log_path = '/home/pi/scripts/shower/logs/' log_filename = 'datalog.csv' # Default name auto_add_date = False def add_log(self, line): """ Add a single l...
null
logging.py
logging.py
py
720
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "attribute" } ]
504832710
from typing import List class Solution: def removeDuplicates(self, nums: List[int]) -> int: """ // Time Complexity : O(n) // Space Complexity : O(1) // Did this code successfully run on Leetcode : Yes // Three line explanation of solution in plain english : ...
null
26_remove_duplicates_from_sorted_array_I.py
26_remove_duplicates_from_sorted_array_I.py
py
1,961
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
456704299
from django.shortcuts import render # Create your views here. def index(request): return render(request,'newsapp/index.html') def moviesinfo(request): head_msg='Latest Movies Information' msg1='Sara is slowly getting cute' msg2='Love Aaj Kal coming on this 14th' msg3='Kartik Aryan Fire the Bollywo...
null
akashnewsproject/newsapp/views.py
views.py
py
1,216
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 5, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api_name":...
308327739
from tensorflow import keras from keras.datasets import mnist from keras.layers import Dense, Flatten import numpy as np import matplotlib.pyplot as plt import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = x_train / 255 x_test = x_test / 255 y_train_cat...
null
L12.py
L12.py
py
1,059
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "keras.datasets.mnist.load_data", "line_number": 10, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 10, "usage_type": "name" }, { "api_name": "te...
406412819
import re import sqlite3 import numpy as np def isnumber(bw): try: bw = float(bw) except ValueError: bw = None return bw USER_RE = re.compile(r"^[a-zA-Z0-9_-]{3,20}$") PASS_RE = re.compile(r"^.{3,20}$") EMAIL_RE = re.compile(r"^[\S]+@[\S]+\.[\S]+$") def valid_username(usern...
null
pbpk/util.py
util.py
py
8,112
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number":...
435107302
import requests import json import uuid import datetime from requests_toolbelt.multipart import decoder TERASTORE_URL = 'http://appstore:3000' PROVIDER_DAT="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJAY29udGV4dCI6Imh0dHBzOi8vamlyYS5pYWlzLmZyYXVuaG9mZXIuZGUvc3Rhc2gvcHJvamVjdHMvSUNUU0wvcmVwb3MvaWRzLWluZm9tb2RlbC1jb21tb25z...
null
consumer/notebooks/.ipynb_checkpoints/idsComm-checkpoint.py
idsComm-checkpoint.py
py
11,331
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, ...
137366768
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import re import copy import json import time import os from svtplay_dl.service import Service from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse from svt...
null
lib/svtplay_dl/service/dplay.py
dplay.py
py
7,503
python
en
code
null
code-starcoder2
66
[ { "api_name": "svtplay_dl.service.Service", "line_number": 19, "usage_type": "name" }, { "api_name": "svtplay_dl.utils.urllib.urlparse", "line_number": 25, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": ...
155771144
""" tahua.reporting.views This module defines the various view functions for the Tahua system's "reporting" package. """ from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from djang...
null
tahua/reporting/views.py
views.py
py
4,001
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.http.HttpResponseRedirect", "line_number": 21, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 21, "usage_type": "call" }, { "api_name": "tahua.reporting.base.report_helper.list_reports", "line_number": 25, "u...
555589925
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.dates ~~~~~~~~~~~~~~ Provides date and time helpers """ from __future__ import ( absolute_import, division, print_function, unicode_literals) from datetime import timedelta, time, datetime as dt from time import gmtime from calendar import timegm from ope...
null
riko/dates.py
dates.py
py
4,224
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.utcnow", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 32, "usage_type": "call" }, { "api_name": "datetim...
225336123
import datetime import re from django.db.models import Q from django.conf import settings from ..models import Application, ApplicantName from ..services.db_gateways import NannyGatewayActions, HMGatewayActions class SearchService: @staticmethod def search(name: str, dob: str, home_postcode: str, care_locat...
null
arc_application/services/search_service.py
search_service.py
py
15,319
python
en
code
null
code-starcoder2
66
[ { "api_name": "services.db_gateways.NannyGatewayActions", "line_number": 71, "usage_type": "call" }, { "api_name": "django.conf.settings.ENABLE_HM", "line_number": 91, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 91, "usage_type": "nam...
97737572
import codecs import pyexcel from mytestwrapper import DEFAULT_CONFIG, MyBaseCase, MyTestCase class TestStyle(MyBaseCase): def test_book_renderring_style(self): self.fake_uuid.side_effect = ["1", "2", "3", "4"] styles = {"styled sheet": {"colWidths": [100, 100]}} expected = 'var customSty...
null
tests/test_book.py
test_book.py
py
1,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "mytestwrapper.MyBaseCase", "line_number": 7, "usage_type": "name" }, { "api_name": "pyexcel.Book", "line_number": 12, "usage_type": "call" }, { "api_name": "pyexcel.Sheet", "line_number": 13, "usage_type": "call" }, { "api_name": "pyexcel.Sheet", ...
118563421
import helpers import random, pygame, time class sub(helpers.subBase): def OnStart(self): self.Sound.SetBGM("died this way") w, h = self.Game.window.get_size() self.s_objective = tuple(helpers.Text.Create("MLG QUICKSCOPING LEAGUE", 60, i) for i in helpers.colors) self.objW = self.s_objective[0].get_width...
null
quickscoper.py
quickscoper.py
py
6,792
python
en
code
null
code-starcoder2
66
[ { "api_name": "helpers.subBase", "line_number": 4, "usage_type": "attribute" }, { "api_name": "helpers.Text.Create", "line_number": 9, "usage_type": "call" }, { "api_name": "helpers.Text", "line_number": 9, "usage_type": "attribute" }, { "api_name": "helpers.color...
519203140
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "Thieu" at 15:37, 19/03/2021 % # ...
null
mealpy/swarm_based/HGS.py
HGS.py
py
6,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "mealpy.optimizer.Optimizer", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.random.uniform", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 55, "usage_type": "attribute" }, { "api_name": "num...
530624070
#Circular Photometry #Libraries import numpy as np from astropy.io import fits from math import sin,cos,tan,atan2,sqrt,pi,radians as rad, degrees as deg, log10 #Inputs im = "2002Q15.00000030.ENTERED COORDINATES.REDUCED.FIT" #input("Image file name:") im = fits.getdata(im) x = np.rint(499.0895265423242) #int(input("x:...
null
Circular Photometry/circularphotometryfunction.py
circularphotometryfunction.py
py
5,580
python
en
code
null
code-starcoder2
66
[ { "api_name": "astropy.io.fits.getdata", "line_number": 10, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.rint", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.rint", "...
469428781
#!/usr/bin/python3 """ Fabric script (based on the file 2-do_deploy_web_static.py) that creates and distributes an archive to your web servers, using the function deploy """ from fabric.api import local, env, run, put, hosts from datetime import datetime import os env.hosts = ['34.74.23.57', '35.196.161.89'] def do_...
null
3-deploy_web_static.py
3-deploy_web_static.py
py
2,087
python
en
code
null
code-starcoder2
66
[ { "api_name": "fabric.api.env.hosts", "line_number": 10, "usage_type": "attribute" }, { "api_name": "fabric.api.env", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "dateti...
329613047
import argparse import time from skyengine.drone import DroneController from skyengine.exceptions import FlightAbortedException from skylog.logger import DirectLogger from skylog.message import BaseMessage from skymission.concurrency import tick from skymission.mission import Mission from skymission.mission import cal...
null
missions/traversal/mission.py
mission.py
py
10,696
python
en
code
null
code-starcoder2
66
[ { "api_name": "skylog.message.BaseMessage", "line_number": 23, "usage_type": "name" }, { "api_name": "skymission.mission.Mission", "line_number": 56, "usage_type": "name" }, { "api_name": "skyengine.drone.DroneController", "line_number": 74, "usage_type": "call" }, { ...
299638949
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : shenqiang ''' 注意:定义类的时候,内部方法之间的互调 步骤: 1.按照流的方式进行下载 2.存储在某个文件中 ''' import requests import shutil import time class DownLoadFile(): def readyDatas(self): ''' 准备数据:固定参数 :param datas 接口参数 :param downLoadPath 下载文件地址 ''' ...
null
tryApiTest/requestsPractice/requestsDownFiles.py
requestsDownFiles.py
py
2,534
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.strftime", "line_number": 23, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.Session", "line_n...
547451924
import torch import numpy as np import scipy.fftpack import matplotlib.pyplot as plt # weight = torch.tensor([ # [1., 0.], # [0.707, -0.707], # [0., -1.], # [-0.707, -0.707] # ], requires_grad=True) class FFTModel(torch.nn.Module): def __init__(self, len): super(FFTModel, self).__init__()...
null
ml_fft.py
ml_fft.py
py
3,631
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.log", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number":...
620650705
from __future__ import absolute_import import glob import logging import multiprocessing import os from io import open import numpy as np import tensorflow as tf import tensorflow.contrib.tensorrt as trt import time from threading import Semaphore logger = logging.getLogger(__name__) class DynamicMomentum(object):...
null
inference/inference/inference.py
inference.py
py
11,866
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "threading.Semaphore", "line_number": 38, "usage_type": "call" }, { "api_name": "threading.Semaphore", "line_number": 39, "usage_type": "call" }, { "api_name": "tensorflow....
633022483
"""Download flags of countries (with error handling). asyncio async/await version """ # BEGIN FLAGS2_ASYNCIO_TOP import asyncio import collections import aiohttp from aiohttp import web import tqdm from flags2_common import main, HTTPStatus, Result, save_flag # default set low to avoid errors from remote site, suc...
null
flags/flags2_asyncio.py
flags2_asyncio.py
py
3,045
python
en
code
null
code-starcoder2
66
[ { "api_name": "aiohttp.web.HTTPNotFound", "line_number": 34, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 34, "usage_type": "name" }, { "api_name": "aiohttp.HttpProcessingError", "line_number": 36, "usage_type": "call" }, { "api_name": "aioh...
383596940
#"coding=utf-8" import tornado.httpserver import tornado.web import tornado.ioloop import tornado.options import os.path from tornado.options import define, options from condb import * define("port", default=9002, type=int) class IndexHandler(tornado.web.RequestHandler): def get(self,info): #接受一个经纬度和高度,就近...
null
neural-server.py
neural-server.py
py
1,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "tornado.options.define", "line_number": 9, "usage_type": "call" }, { "api_name": "tornado.httpserver.web", "line_number": 12, "usage_type": "attribute" }, { "api_name": "tornado.httpserver", "line_number": 12, "usage_type": "name" }, { "api_name": "...
500259023
from django.shortcuts import render from .models import * from rpc4django import rpcmethod from hackers.zillow.zillow_post_api import Zillow from informer.models import * import json # Create your views here. @rpcmethod(name='post_man.add_to_postbox', signature=['str', 'dict', 'str']) def add_to_postbox(target=None, ...
null
growthHack/growth_hack/post_man/views.py
views.py
py
3,297
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "rpc4django.rpcmethod", "line_number": 10, "usage_type": "call" }, { "api_name": "rpc4django.rpcmethod", "line_number": 35, "usage_type": "call" }, { "api_name": "json.loads", ...
607343429
from datetime import datetime, timezone from flask import ( current_app, url_for ) def absolute_url_for(endpoint: str, **kwargs) -> str: """ Implements Flask `url_for`, but by default creates absolute URL (`_external` and `_scheme`) with `PREFERRED_URL_SCHEME` scheme. - you can specify t...
null
src/blueprints/utils.py
utils.py
py
1,093
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.current_app.config", "line_number": 23, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 23, "usage_type": "name" }, { "api_name": "flask.url_for", "line_number": 25, "usage_type": "call" }, { "api_name": "datetim...
588911663
import math from rest_framework import status from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import AllowAny from rest_framework.response import Response from app.devoff.serializers import EncryptSerializer @api_view(["POST"]) @permission_classes([AllowAny]) def e...
null
django/project/app/devoff/views.py
views.py
py
1,790
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.devoff.serializers.EncryptSerializer", "line_number": 15, "usage_type": "call" }, { "api_name": "rest_framework.response.Response", "line_number": 22, "usage_type": "call" }, { "api_name": "rest_framework.response.Response", "line_number": 24, "usage_ty...
206284861
import logging from pathlib import Path import click import psutil from petastorm import make_reader from petastorm.pytorch import DataLoader from pytorch_lightning import Trainer from pytorch_lightning import loggers as pl_loggers from ml.vae import VAE from ml.ae import AE from torch.utils.tensorboard import Summa...
null
train_vae.py
train_vae.py
py
2,645
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 33, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 41, "usage_type": "call" }, { "api_name": "petastorm.make_r...
466528243
import sqlite3, os, logging from rsquarelabs_core.config import RSQ_DB_LOG, RSQ_DB_PATH """ db_engine is a module built as database handler across the project. db_engine uses sqlite as the database . """ logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) # create a file handler handler = logging.F...
null
rsquarelabs_core/engines/db_engine/__init__.py
__init__.py
py
3,110
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "rsquarelabs_c...
576928960
from __future__ import print_function import boto3 import json import decimal import re import traceback import urllib from boto3.dynamodb.conditions import Key, Attr from cStringIO import StringIO class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): ...
null
lambdaS3DynamodbDifferentBucket.py
lambdaS3DynamodbDifferentBucket.py
py
4,252
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.JSONEncoder", "line_number": 11, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 13, "usage_type": "attribute" }, { "api_name": "boto3.resource", "line_number": 23, "usage_type": "call" }, { "api_name": "json.dumps"...
368950997
from scipy.stats import maxwell import matplotlib.pyplot as plt import numpy as np # Chris Fenton # CNC - AI # Homework 3 # Question 1 def guessing(p=0.6, n=50): guess = p * n know = n - guess n_correct = know + (guess * .5) return n_correct / n # 35 students (or 70%) would get the right answer # General for...
null
ai/hw3/Hw3_w_chris_fenton.py
Hw3_w_chris_fenton.py
py
2,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "scipy.stats.maxwell.stats", "line_number": 23, "usage_type": "call" }, { "api_name":...
262877113
from django.shortcuts import render from ninja import Router from commerce.models import Product from commerce.models import Address from commerce.models import Category commerce_controller = Router() @commerce_controller.get('get_products') def get_products(request): k=list(Product.objects.values()) f...
null
commerce/controllers.py
controllers.py
py
983
python
en
code
null
code-starcoder2
66
[ { "api_name": "ninja.Router", "line_number": 7, "usage_type": "call" }, { "api_name": "commerce.models.Product.objects.values", "line_number": 13, "usage_type": "call" }, { "api_name": "commerce.models.Product.objects", "line_number": 13, "usage_type": "attribute" }, ...
370975335
#!/usr/bin/env python """" ML mapping from external potential to charge density - AP275 Class Project, Harvard University References: [1] Brockherde et al. Bypassing the Kohn-Sham equations with machine learning. Nature Communications 8, 872 (2017) Simon Batzner, """ from __future__ import absolute_import from ...
null
main.py
main.py
py
4,508
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.models.Sequential", "line_number": 45, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 46, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 48, "usage_type": "call" }, { "api_name": "keras.l...
376957822
from .Video_to_Image_Split import extraction, rotate from .face_recognition import choice, choice2 from .fetch import fetching import shutil import os import cv2 from .attendance_camera import cam_attendance # Find current face_train.py directory BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # From base direc...
null
Smart_Attendance_System/face_recognition/Face_Recognition/start.py
start.py
py
2,312
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line...
7000090
from os import system import serial import subprocess from time import sleep from ISStreamer.Streamer import Streamer ser=serial.Serial( '/dev/serial0', 115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1) ser.write...
null
fonav4.py
fonav4.py
py
410
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 7, "usage_type": "call" }, { "api_name": "serial.EIGHTBITS", "line_number": 10, "usage_type": "attribute" }, { "api_name": "serial.PARITY_NONE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "serial.STO...
401708610
# import model import tensorflow as tf from keras.optimizers import SGD, Adam from keras.callbacks import EarlyStopping, ModelCheckpoint from keras.preprocessing.image import ImageDataGenerator from keras.layers import Dense,Dropout, Activation, Flatten,GlobalAveragePooling2D from keras.layers import Conv2D,MaxPooling2...
null
newtrain.py
newtrain.py
py
3,104
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.applications.MobileNet", "line_number": 17, "usage_type": "name" }, { "api_name": "keras.applications.MobileNet.layers", "line_number": 21, "usage_type": "attribute" }, { "api_name": "keras.applications.MobileNet", "line_number": 21, "usage_type": "na...
233974966
# # 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, software # distributed under t...
null
ryu/consistency-update-with-openstate.py
consistency-update-with-openstate.py
py
14,828
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "ryu.base.app_manager.RyuApp", "line_number": 54, "usage_type": "attribute" }, { "api_name": "ryu.base.app_manager", "line_number": 54, "usage_type": "name" }, { "api_name"...
337661255
import threading import subprocess import multiprocessing import time class Audio(object): queue = [] playing = False popen = None def __init__(self, single_play): self.playing = False self.popen = None self.single_play = single_play def play(self, fname): ...
null
audio.py
audio.py
py
1,121
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.Popen", "line_number": 34, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 45, "usage_type": "call" } ]
621604387
import numpy as np import dlib import cv2 import logging import time import math import argparse from config import * logging.basicConfig(level=logging.DEBUG, format="%(levelname)s:%(lineno)d:%(message)s") class Detector(object): def __init__(self): self.detector = cv2.CascadeClassifie...
null
FaceSwap/face_detect_and_track.py
face_detect_and_track.py
py
6,818
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ndar...
134999374
from flask import Flask from flask import jsonify from pymongo import Connection, MongoClient from pymongo.errors import ConnectionFailure from bson import json_util import os app = Flask(__name__, static_url_path='/') #DB MODELING client = MongoClient('mongodb://user:user@ds045679.mongolab.com:45679/openhack') DB...
null
pyapp.py
pyapp.py
py
3,039
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 91, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
199152708
import os import time,random import pytest from Params import index as i from Params.index import Comm r = Comm() from Params import params as p class Test_jiou(): def setup_class(self): """登录后台""" s = p.get_value('登录') r.input_data('xpath',s['账号输入框'],'17611520838') r.input_data('xpa...
null
PCHTUI/Test_case/SCGLHT.py
SCGLHT.py
py
4,250
python
en
code
null
code-starcoder2
66
[ { "api_name": "Params.index.Comm", "line_number": 6, "usage_type": "call" }, { "api_name": "Params.params.get_value", "line_number": 11, "usage_type": "call" }, { "api_name": "Params.params", "line_number": 11, "usage_type": "name" }, { "api_name": "Params.params....
75897974
""" IMPORTS """ import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.neighbors import NearestNeighbors def load_and_clean(): """ spotify, identify = load_and_clean() """ spotify = pd.read_csv('https://raw.githubusercontent.com/Build-Week-Spotify/ds/master/data/tracks_over_40popul...
null
model.py
model.py
py
3,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 45, "usage_type": "call" }, { "api_name": "sklearn.neighbors.NearestNeighbors", "line_number": 52, "usage_type": "call" }, ...
296753894
#imports import cv2 import numpy as np import time #initialize net= cv2.dnn.readNet('yolov3.weights', 'yolov3.cfg')#models classes = [] with open('coco.names', 'r') as f:#dataset classes= f.read().splitlines() #load cap = cv2.VideoCapture(0); #img = cv2.imread('image.jpg') #initialize fps starting...
null
SALCEDO_final_Project.py
SALCEDO_final_Project.py
py
2,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.dnn.readNet", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_num...
62363349
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
null
test/terra/backends/qasm_simulator/matrix_product_state_method.py
matrix_product_state_method.py
py
3,797
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "test.terra.reference.ref_1q_clifford.h_gate_circuits_deterministic", "line_number": 38, "usage_type": "attribute" }, { "api_name": "test.terra.reference.ref_1q_clifford", "line_number...
104219798
#!/usr/bin/python import os import sys import pdb from gensim import models def extract_topic_statistics(corpus,transf,top_num,dir_tm_models,dir_output,n_w): # Load tm_models model = models.LdaModel.load(dir_tm_models, mmap='r') if not os.path.exists(dir_output + '/' + corpus + '/'): os.makedirs(dir_output ...
null
src/tms/extract_stats.py
extract_stats.py
py
1,803
python
en
code
null
code-starcoder2
66
[ { "api_name": "gensim.models.LdaModel.load", "line_number": 11, "usage_type": "call" }, { "api_name": "gensim.models.LdaModel", "line_number": 11, "usage_type": "attribute" }, { "api_name": "gensim.models", "line_number": 11, "usage_type": "name" }, { "api_name": ...
20159934
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from __future__ import annotations from typing import Union, TYPE_CHECKING from datado...
null
src/datadog_api_client/v1/model/formula_and_function_event_query_group_by.py
formula_and_function_event_query_group_by.py
py
1,850
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 16, "usage_type": "name" }, { "api_name": "datadog_api_client.model_utils.ModelNormal", "line_number": 22, "usage_type": "name" }, { "api_name": "datadog_api_client.v1.model.formula_and_function_event_query_group_by_sort.Formul...
22553605
#Importing pyplot from matplotlib import pyplot as plt from Mysq import Mysq from rsidao_mysql import rsidao_mysql #Plotting to our canvas #plt.plot([1,2,3],[4,5,1]) #Showing what we plotted #plt.show() datear = [] rsiar = [] datear1 = [] rsiar1 = [] mysq = Mysq() rsidao = rsidao_mysql() conn = mysq.getConnection(...
null
mychart.py
mychart.py
py
778
python
en
code
null
code-starcoder2
66
[ { "api_name": "Mysq.Mysq", "line_number": 18, "usage_type": "call" }, { "api_name": "rsidao_mysql.rsidao_mysql", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib...
90874960
# This file contains the function to convert .csv to .json import json import time def convert(inputfile, outputfile): csv_input_file = open(inputfile, 'r', encoding='utf-8') linecount = 0 headers = [] outputdict = {} start = time.time() for record in csv_input_file: if linecount ==...
null
csv2json.py
csv2json.py
py
836
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 30, "usage_type": "call" } ]
469313307
# %load q04_chi2_test/build.py # Default imports import scipy.stats as stats import pandas as pd df = pd.read_csv('data/house_pricing.csv') # Enter Code Here def chi_square(df): x = df['SalePrice'] y = df['LandSlope'] price = pd.qcut(df['SalePrice'], 3, labels = ['High', 'Medium', 'Low']) freqtab = ...
null
q04_chi2_test/build.py
build.py
py
430
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.qcut", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.crosstab", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.stats.chi2_contingen...
511200862
import cv2 # HW1 建環境,把結果截圖,並附上GitHub連結 def output_img(img, text): cv2.namedWindow(text, cv2.WINDOW_NORMAL) cv2.imshow(text, img) cv2.imwrite('%s.png' % text, img) path = "./road/road.jpg" road = cv2.imread(path) road_gray = cv2.cvtColor(road, cv2.COLOR_BGR2GRAY) # output_img(road_gray, text='./road/gra...
null
HW1 Sobel/hw1.py
hw1.py
py
514
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.namedWindow", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NORMAL", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imwrite", "lin...
493431163
from flask import Flask, request, render_template, redirect from threading import Thread import time import random app = Flask(__name__) spi = {"VACA": "cit1"} @app.route('/') def index(): global spi page = render_template('main.html', a=spi) return page @app.route('/create', methods=['GET']) def create_htm...
null
programm.py
programm.py
py
572
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request....
194819300
import argparse import cv2 ap = argparse.ArgumentParser() ap.add_argument("-s", "--source", required=True, help="Path to the source image") ap.add_argument("-t", "--template", required=True, help="Path to the template image") args = vars(ap.parse_args()) source = cv2.imread(args["source"]) template = cv2.imread(args[...
null
lessons/template_matching.py
template_matching.py
py
806
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.matchTemplate", "...
348093247
from django.conf.urls import * from accounts.views import * from django.contrib.auth.views import login, logout urlpatterns = patterns('', url(r'^profile/$', profile, name='accounts_profile'), url(r'^register/$', register, name='accounts_register'), ) urlpatterns += patterns('', url(r'^login/$', login, kwargs={'...
null
accounts/urls.py
urls.py
py
428
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.views.login", "line_number": 12, "usage_type": "argument" }, { "api_name": "django.contrib.auth.views.logout", "line_number": 13, "usage_type": "argument" } ]
531237023
# -*- coding utf-u -*- """ @author: Sam """ import os import pandas as pd from collections import defaultdict, Counter, OrderedDict import re import json from subprocess import call import zipfile as zf from extract_all_tags import * import pymongo from xmljson import Yahoo from pathlib import Path from xml.etree ...
null
src/LNParser.py
LNParser.py
py
2,752
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "lin...
513267198
# -*- coding: utf-8 -*- from account.accounts import Account from account.decorators import login_exempt from common.mymako import render_mako_context def new_release_job(request): print ('111111111111') account = Account() print(account) print(request.method) if request.method == 'POST': ...
null
ckops/views.py
views.py
py
686
python
en
code
null
code-starcoder2
66
[ { "api_name": "account.accounts", "line_number": 10, "usage_type": "name" }, { "api_name": "account.accounts.Account", "line_number": 10, "usage_type": "call" }, { "api_name": "account.accounts", "line_number": 11, "usage_type": "argument" }, { "api_name": "common...
303031079
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='NoiseGen', version...
null
setup.py
setup.py
py
1,452
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
441025664
from django.shortcuts import render, HttpResponse, redirect from django.contrib import messages from .models import User # Create your views here. # should need def index(request): return render(request, "login/index.html") def login(request): if not request.method == "POST": return redirect ("logi...
null
apps/login/views.py
views.py
py
1,805
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "models.User.objects.login", "line_number": 16, "usage_type": "call" }, { "api_n...
535084448
import argparse import ast parser = argparse.ArgumentParser(description='Parameters Configuration!') parser.add_argument('--reg', '-r', help='正则化', type=ast.literal_eval, default=False) parser.add_argument('--dropout', '-d', help='Dropout', type=ast.literal_eval, default=False) args = parser.parse_args() Reg = args.r...
null
Experiment/ARIMA-LSTM-Hybrid/test.py
test.py
py
402
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ast.literal_eval", "line_number": 7, "usage_type": "attribute" } ]
403619770
import os import math import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import argparse import subprocess import shlex import seaborn as sns from calendar import isleap import string import baltic as bt parser = argparse.ArgumentParser() parser.add_argument('--log', defau...
null
phylodynamic_analysis/scripts/combine_plot_traj.py
combine_plot_traj.py
py
17,407
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 52, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 53, "usage_type": "attribute" }, { "api_nam...
416527951
import re import operator from itertools import zip_longest from pathlib import Path from urllib import request from lxml import html from io import BytesIO from sys import version_info def _compare_version_parts(op, p1, p2): matches = [re.match(r'(\d*)(.*)', p) for p in [p1, p2]] if not all(match...
null
Project_Kivy/venv/Lib/site-packages/gohlkegrabber/gohlkegrabber.py
gohlkegrabber.py
py
7,905
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.match", "line_number": 12, "usage_type": "call" }, { "api_name": "re.match", "line_number": 32, "usage_type": "call" }, { "api_name": "operator.eq", "line_number": 38, "usage_type": "attribute" }, { "api_name": "operator.gt", "line_number": 3...
647036788
import tkinter as tk import requests from bs4 import BeautifulSoup import time def get_url(): url = 'https://rate.bot.com.tw/xrt?Lang=zh-TW' headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'} r = requests.get...
null
main.py
main.py
py
6,124
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 87, "usage_type": "call" }, { "api_name": "tkinter.Canvas", "line_n...
53793346
import os import mne import numpy as np import pandas as pd from matplotlib import pyplot as plt from matplotlib import pylab from scipy.signal import butter, filtfilt, freqz from scipy.signal import find_peaks import logging logging.getLogger().setLevel(logging.INFO) mne.set_log_level('ERROR') CONFIG = os.path.joi...
null
utils/preprocessing.py
preprocessing.py
py
11,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mne.set_log_level", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", ...
350489643
from pyglet.gl import * from pyglet.window import key from pyglet.window import FPSDisplay import math from CarSprite import * WINDOWWIDTH=1280 WINDOWHEIGHT=720 class MyWindow(pyglet.window.Window): def __init__(self, *args, **kwargs): super(MyWindow,self).__init__(*args, **kwargs) #this clear thin...
null
mainWindow.py
mainWindow.py
py
3,476
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyglet.gl.window", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyglet.gl", "line_number": 8, "usage_type": "name" }, { "api_name": "pyglet.window.FPSDisplay", "line_number": 14, "usage_type": "call" }, { "api_name": "pyglet.window....
548374884
# -*- coding: utf-8 -*- import json import time from openpyxl.styles import Font, Side, Border, Alignment from HousePrice.items import ErShouFangVillageItem, ErShouFangCityItem, ErShouFangSourceItem, RentingHouseSourceItem, NewHouseItem from openpyxl import Workbook # 设定excel的样式 font = Font(name='宋体', size=11, bold=F...
null
HousePrice/pipelines.py
pipelines.py
py
10,289
python
en
code
null
code-starcoder2
66
[ { "api_name": "openpyxl.styles.Font", "line_number": 10, "usage_type": "call" }, { "api_name": "openpyxl.styles.Side", "line_number": 11, "usage_type": "call" }, { "api_name": "openpyxl.styles.Border", "line_number": 12, "usage_type": "call" }, { "api_name": "open...
119875626
from selenium.webdriver import Chrome import pytest from selenium.webdriver.chrome.options import Options from Base_methods.Export_methods import * from Base_methods.Mydocs_methods import * from Base_methods.Home_methods import * # @pytest.fixture(scope = 'session') - запуск тестов в одной сессии @pytest.fixture() d...
null
indian_pytest/Execute/Smoke_fast_Chrome.py
Smoke_fast_Chrome.py
py
1,042
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { ...
614697339
# uncompyle6 version 3.6.7 # Python bytecode 3.4 (3310) # Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] # Embedded file name: build/bdist.macosx-10.10-x86_64/egg/boto/services/sonofmmm.py # Compiled at: 2015-11-24 05:02:18 # Size of source mod 2**32: 3498 bytes i...
null
pycfiles/boto_rsync-0.8.1.tar/sonofmmm.cpython-34.py
sonofmmm.cpython-34.py
py
2,555
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto.services.service.Service", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "boto.set_file...
550569585
#!/usr/bin/env python3 import collections import re import sys import pandas as pd import progressbar import spacy from nltk.metrics import BigramAssocMeasures from nltk.probability import ConditionalFreqDist, FreqDist from data import prepare_csv nlp = spacy.load("en_core_web_sm") def read_corpus(corpus_file, tit...
null
preprocessing_data.py
preprocessing_data.py
py
5,493
python
en
code
null
code-starcoder2
66
[ { "api_name": "spacy.load", "line_number": 15, "usage_type": "call" }, { "api_name": "data.prepare_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "data.groupby", "line_...
166034041
#!/usr/bin/env python3 """ Can use as cmd line lisky, api calls or db calls They will both be classes and will take a node address or the directory where lisk is installed """ import re import sys import argparse import json import yaml from . import lskutils from . import helpers def main(args, parser): """ ...
null
pylisk/__main__.py
__main__.py
py
12,109
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.exit", "line_number": 68, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 159, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 220, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 225, "...
233887935
""" This is a Mutual Information and Entropy estimator, implemented by Hilla Schefler and Maya Avidor, as part of Industrial Project course 234313, CS department, Technion. Implementation is based on 2 papers: (1) Efficient Estimation of Mutual Information for Strongly Dependent Variables- https://arxiv.org/pdf/1411.20...
null
art/metrics/privacy/MIestimator.py
MIestimator.py
py
18,650
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.neighbors.DistanceMetric.get_metric", "line_number": 41, "usage_type": "call" }, { "api_name": "sklearn.neighbors.DistanceMetric", "line_number": 41, "usage_type": "attribute" }, { "api_name": "sklearn.neighbors", "line_number": 41, "usage_type": "n...
122847269
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html # Support unicode in python 3 try: unicode except NameError: unicode = str import six from scrapy.utils.python impor...
null
src/CanadianTire/pipelines.py
pipelines.py
py
3,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "MySQLdb.escape_string", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" }, { "api_name": "scrapy.exporters.BaseItemExporter", "line_number": 37, "usage_type": "name" }, { "api_name": "Ca...
346471282
import os import gdown path = './weights' if not os.path.exists(path): os.makedirs(path) if not os.path.exists(os.path.join(path, 'detecion')): os.makedirs(os.path.join(path, 'detecion')) if not os.path.exists(os.path.join(path, 'recognition')): os.makedirs(os.path.join(path, 'recognition')) mobilenet0...
null
download_weights.py
download_weights.py
py
1,070
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numbe...
135038363
import dynet_config import sys, os import _dynet as dy dyparams = dy.DynetParams() dyparams.set_mem(40000) dyparams.set_autobatch(True) dyparams.init() import numpy as np import pandas as pd import sys import itertools import string from collections import Counter from nltk.corpus import wordnet as wn from collections ...
null
assignment2-three-eyed-crow/word2vec.py
word2vec.py
py
14,899
python
en
code
null
code-starcoder2
66
[ { "api_name": "_dynet.DynetParams", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.stem.PorterStemmer", "line_number": 20, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 24, "usage_type": "call" }, { "api_name": "nltk.download...
515529712
import random import matplotlib.pyplot as plt import math def f(x): return -(x**2.-4.*x+3.)/256 x = [] y = [] for i in range(-256 * 100, 256 * 100): x.append(i / 100.0) y.append(f(i / 100.0)) plt.plot(x, y) plt.show() x = [] y = [] for i in range(0, 256 * 100): x.append(i / 100.0) y.append(f(...
null
lab5/.ipynb_checkpoints/lab5-checkpoint.py
lab5-checkpoint.py
py
3,248
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 14, "usage_type": "call" }, { "api_name": "matpl...
521004672
import matplotlib.pyplot as plt import scipy.ndimage as ndi import numpy as np import scipy.misc import imutils import time import sys import os W = 250 H = 250 n_gen = 5 state = np.zeros((W, H)) ind2sub = imutils.ind2sub(state.shape) minima = 0 maxima = 1 k = [[1,1,1],[1,0,1],[1,1,1]] # Add Noise to seed the algor...
null
2020/Generative/mazy.py
mazy.py
py
763
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "imutils.ind2sub", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.random_integers", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random...
613290472
import skimage.transform import shapely.wkt #import tables as tb import tqdm import pandas as pd import numpy as np from matplotlib import pyplot as plt import gdal from os import listdir from os.path import isfile, join import scipy FN_MASK_CSV = "/data/train/AOI_2_Vegas_Train/summaryData/AOI_2_Vegas_Train_Buildin...
null
im_pre_1.py
im_pre_1.py
py
3,690
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.percentile", "line_number": 26, "usage_type": "call" }, { "api_name": "scipy.percentile", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
79880137
from datetime import datetime from flask import render_template, request, redirect, flash, Blueprint, url_for from flask_login import current_user, login_required import json import app.model.weight as _weight from app.pkg.config import Config from app.pkg.db import get_db weight_bp = Blueprint("weight_bp", __name__...
null
app/controller/weight.py
weight.py
py
1,542
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "app.pkg.config.Config", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime....
241684145
from typing import * from tqdm import tqdm from datetime import datetime from collections import defaultdict from nltk.tokenize import sent_tokenize from compling.lexicalAnalysis.tokenization import tokenization_abc from collections.abc import Iterable as abciterable from compling.lexicalAnalysis.tokenization.im...
null
venv/lib/python3.9/site-packages/compling/lexicalAnalysis/tokenization/impl/tokenizer.py
tokenizer.py
py
10,418
python
en
code
null
code-starcoder2
66
[ { "api_name": "compling.lexicalAnalysis.tokenization.tokenization_abc.Tokenization", "line_number": 13, "usage_type": "attribute" }, { "api_name": "compling.lexicalAnalysis.tokenization.tokenization_abc", "line_number": 13, "usage_type": "name" }, { "api_name": "collections.abc.I...
61703671
import pytest from django.core.urlresolvers import reverse from rest_framework_json_api.pagination import PageNumberPagination from example.tests.utils import load_json from example.views import EntryViewSet try: from unittest import mock except ImportError: import mock pytestmark = pytest.mark.django_db ...
null
example/tests/integration/test_non_paginated_responses.py
test_non_paginated_responses.py
py
3,807
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.mark", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework_json_api.pagination.PageNumberPagination", "line_number": 105, "usage_type": "name" }, { "api_name": "example.views.EntryViewSet", "line_number": 108, "usage_type": ...
6304928
#!/usr/bin/env python """Plot results read from a result set """ from __future__ import division import os import argparse import logging import matplotlib.pyplot as plt from icarus.util import Settings, config_logging from icarus.results import plot_lines, plot_bar_chart from icarus.registry import RESULTS_READER ...
null
ds2os-topology-prob/plotresults.py
plotresults.py
py
5,717
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "m...
191161551
""" This spider is a AmeInfo spider created on top of the ATSSpider scrapy crawl ameinfo -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://jobs.ameinfo.com/en/international/job-search/" sample url: http://jobs.ameinfo.com/en/international/job-search/ """ from re import compile from scrapy.http import R...
null
brightcorp/brightcorp/spiders/ameinfo.py
ameinfo.py
py
3,779
python
en
code
null
code-starcoder2
66
[ { "api_name": "brightcorp.base.atsspiders.ATSSpider", "line_number": 20, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "urlparse.u...
403471771
# ==================================================== # @Author : Xiao Junbin # @Email : junbin@comp.nus.edu.sg # @File : detection.py # ==================================================== from detect_frame import * import dataloader from tools.util import set_gpu_devices BATCH_SIZE = 1 num_workers = 1 dataset...
null
detection.py
detection.py
py
1,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "dataloader.DetectFrameLoader", "line_number": 20, "usage_type": "call" }, { "api_name": "tools.util.set_gpu_devices", "line_number": 33, "usage_type": "call" }, { "api_name": "detect_frame.run", "line_number": 38, "usage_type": "call" } ]
322280870
import urllib3 import json LOCAL_FILE_SYS = [] #S3_BUCKET = "your-s3-bucket" # please replace with your bucket name CHUNK_SIZE = 10000 # determined based on API, memory constraints, experimentation def get_num_records(): # Dummy function, to replicate GET http://jsonplaceholder.typicode.com/number_of_users cal...
null
apiDataPullLocal.py
apiDataPullLocal.py
py
1,842
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib3.PoolManager", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib3.util.Retry", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib3.util", "line_number": 23, "usage_type": "attribute" }, { "api_name": "json.loads",...
127881220
from flask import Flask, request from storage import influx, elasticsearch import zlib, json, settings, time app = Flask(__name__) def tags_format(tags): new_tags = {} if tags: for tag in tags: k, v = tag.split(":", 1) new_tags[k] = v.strip() return new_tags @app.route('...
null
app.py
app.py
py
4,066
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 24, "usage_type": "name" }, { "api_name": "zlib.decompress", ...
25412683
import joblib import json import numpy as np import os #from inference_schema.schema_decorators import input_schema, output_schema #from inference_schema.parameter_types.numpy_parameter_type import NumpyParameterType def init(): global model # AZUREML_MODEL_DIR is an environment variable created during deploy...
null
score.py
score.py
py
1,160
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": ...
272126358
from django.contrib import admin from .models import News, EmailSubscription from tinymce.widgets import TinyMCE from django.db import models class NewsAdmin(admin.ModelAdmin): fieldsets = [ ("Slug" , {'fields':['slug']}), ('Headline',{'fields': ['headline']}), ('News Content',{'fields': ['...
null
backend/news/admin.py
admin.py
py
811
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 19, "usage_type": "attribute" }, ...
249530089
"""Groups commands and event listeners in the bot together using cogs.""" from discord.ext import commands bot = commands.Bot(command_prefix=commands.when_mentioned_or("!")) class Happy(commands.Cog, name="happy_mood"): """A cog that is called 'happy_mood'.""" def __init__(self, bot): """Initializes ...
null
cogs.py
cogs.py
py
1,233
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.when_mentioned_or", "line_number": 5, "usage_type": "call" }, { ...
179862142
#-*- coding:utf-8 -*- import json import random import urllib import json from handhelper.jdhclogin import nloginpwd from httphelper import jdhcformData from httphelper import jdhcheaders from httphelper.jdhcDownload import beforeHtml from filehelper import filepath from filehelper import codesapi result = None class...
null
vspjd/handhelper/jdhclogin/login.py
login.py
py
2,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "httphelper.jdhcDownload.beforeHtml.beforeHtml.session.get", "line_number": 26, "usage_type": "call" }, { "api_name": "httphelper.jdhcDownload.beforeHtml.beforeHtml", "line_number": 26, "usage_type": "attribute" }, { "api_name": "httphelper.jdhcDownload.beforeHtml",...
32501484
import keras from keras import backend as k from keras.models import load_model from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Permute from keras.layers import Conv2D, MaxPooling2D class DqnNetwork: """ Creates a dqn_network instance. Parameters are: state_shape:...
null
dqn_network.py
dqn_network.py
py
2,812
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.models.Sequential", "line_number": 21, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 22, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 28, "usage_type": "call" }, { "api_name": "keras...
138978276
# Copyright (C) 2009 - Kyle Florence # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope tha...
null
CPTI2F.py
CPTI2F.py
py
13,407
python
en
code
null
code-starcoder2
66
[ { "api_name": "gi.repository.GObject.Object", "line_number": 32, "usage_type": "attribute" }, { "api_name": "gi.repository.GObject", "line_number": 32, "usage_type": "name" }, { "api_name": "gi.repository.Peas.Activatable", "line_number": 32, "usage_type": "attribute" }...